zl-code 0.0.28 → 0.0.29

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 (80) hide show
  1. package/dist/client/assets/{DiffPanel-B4RSrZzS.js → DiffPanel-tsulV-t0.js} +1 -1
  2. package/dist/client/assets/{FilePreviewPanel-DChPJ7tF.js → FilePreviewPanel-XaXCHGIv.js} +1 -1
  3. package/dist/client/assets/{PreviewPanel-Cy2rgpmd.js → PreviewPanel-Cdl736_J.js} +1 -1
  4. package/dist/client/assets/{angular-html-B1bl_mez.js → angular-html-B4hfmCJp.js} +1 -1
  5. package/dist/client/assets/{angular-ts-C7BaZv2O.js → angular-ts-C2k80k6N.js} +1 -1
  6. package/dist/client/assets/{apl-Blk1YK3R.js → apl-DNqpu2W9.js} +1 -1
  7. package/dist/client/assets/{astro-CkkDzAx2.js → astro-BK2hVT9q.js} +1 -1
  8. package/dist/client/assets/{blade-DgQlyuaS.js → blade-DN6rmDjV.js} +1 -1
  9. package/dist/client/assets/{c-B6S4BMb9.js → c-D5f5j_Qx.js} +1 -1
  10. package/dist/client/assets/{cobol-DWYE6sxd.js → cobol-BJMwkr-1.js} +1 -1
  11. package/dist/client/assets/{coffee-C4kN6t4N.js → coffee-CeAh-9Qa.js} +1 -1
  12. package/dist/client/assets/{cpp-Dplu-MWO.js → cpp-CoNR-I7i.js} +1 -1
  13. package/dist/client/assets/{crystal-CHQAArp6.js → crystal-BzulqQXm.js} +1 -1
  14. package/dist/client/assets/{css-D2hCWIkm.js → css-C8qqEQAz.js} +1 -1
  15. package/dist/client/assets/{edge-Dk_H1aHC.js → edge-DDiQaJBP.js} +1 -1
  16. package/dist/client/assets/{elixir-B5fytRcb.js → elixir-CqkRX5se.js} +1 -1
  17. package/dist/client/assets/{elm-DImvblX6.js → elm-D-Ak7Uuf.js} +1 -1
  18. package/dist/client/assets/{erb-CYhRZJbQ.js → erb-BaHYBNMy.js} +1 -1
  19. package/dist/client/assets/{fileCommentAnnotations-vr5n8hW8.js → fileCommentAnnotations-HmnWWCqP.js} +1 -1
  20. package/dist/client/assets/{git-rebase-CJCDNFVy.js → git-rebase-BM3tCX5K.js} +1 -1
  21. package/dist/client/assets/{glimmer-js-CX6nPbiA.js → glimmer-js-Dxp43H6G.js} +1 -1
  22. package/dist/client/assets/{glimmer-ts-B9m-2HQ0.js → glimmer-ts-CyIjQWjx.js} +1 -1
  23. package/dist/client/assets/{glsl-CBhpvhdC.js → glsl-DSrEzxBe.js} +1 -1
  24. package/dist/client/assets/{graphql-Br1-GroV.js → graphql-CRTEzgy6.js} +1 -1
  25. package/dist/client/assets/{hack-DZ1OQIy5.js → hack-Bzalgqzl.js} +1 -1
  26. package/dist/client/assets/{haml-DnkBTUe0.js → haml-BfRnAeIE.js} +1 -1
  27. package/dist/client/assets/{handlebars-C2KrFTp2.js → handlebars-CQs0rhbU.js} +1 -1
  28. package/dist/client/assets/{html-CMkuhdXz.js → html-CpQ2QAUg.js} +1 -1
  29. package/dist/client/assets/{html-derivative-x0jdXlzV.js → html-derivative-ysmGsd5_.js} +1 -1
  30. package/dist/client/assets/{http-DmnkYnYn.js → http-C88ROAv2.js} +1 -1
  31. package/dist/client/assets/{hurl-D4vx_Fqc.js → hurl-DByjE9Tq.js} +1 -1
  32. package/dist/client/assets/{index-D0fBCQfu.js → index-zd5b5MHc.js} +6 -6
  33. package/dist/client/assets/{java-BIX8UYqM.js → java-DctzPP6j.js} +1 -1
  34. package/dist/client/assets/{javascript-Itc1CXRo.js → javascript-CkjpkDgp.js} +1 -1
  35. package/dist/client/assets/{jinja-D-Nrc0OY.js → jinja-DiCQkkWB.js} +1 -1
  36. package/dist/client/assets/{jison-DszTAzg9.js → jison-D5jMyA1z.js} +1 -1
  37. package/dist/client/assets/{json-Dmpy7l_7.js → json-EFYaxuvv.js} +1 -1
  38. package/dist/client/assets/{jsx-BqcN7G1H.js → jsx-Dr0yRiaR.js} +1 -1
  39. package/dist/client/assets/{julia-Fk6QscNP.js → julia-ChZidwp6.js} +1 -1
  40. package/dist/client/assets/{just-Cjum5CtH.js → just-BEml4liD.js} +1 -1
  41. package/dist/client/assets/{latex-C1fWK8m1.js → latex-Dfj8_m7Q.js} +1 -1
  42. package/dist/client/assets/{liquid-CExQify-.js → liquid-DgqZo45B.js} +1 -1
  43. package/dist/client/assets/{lua-vWihEjkA.js → lua-CcmaHiBA.js} +1 -1
  44. package/dist/client/assets/{marko-Ct706lRZ.js → marko-DOPk6Il-.js} +1 -1
  45. package/dist/client/assets/{mdc-CEa7533U.js → mdc-BTTPgMof.js} +1 -1
  46. package/dist/client/assets/{nginx-Co_l6tY0.js → nginx-Cm8kmfAJ.js} +1 -1
  47. package/dist/client/assets/{nim-coXfXfVy.js → nim-wiz8yoEt.js} +1 -1
  48. package/dist/client/assets/{perl-C89XbEUv.js → perl-ByZR7XC0.js} +1 -1
  49. package/dist/client/assets/{php-fLXnzGIF.js → php-Dkz8UNzZ.js} +1 -1
  50. package/dist/client/assets/{pug-CuRm4s2z.js → pug-DvwMZlYj.js} +1 -1
  51. package/dist/client/assets/{qml-BFFk69Qq.js → qml-BGTv1Bri.js} +1 -1
  52. package/dist/client/assets/{r-uCGTvVik.js → r-BvdoDiGs.js} +1 -1
  53. package/dist/client/assets/{razor-D_z0wSiq.js → razor-CDbQtNI-.js} +1 -1
  54. package/dist/client/assets/{regexp-DhKVCizZ.js → regexp-Cg8wASZF.js} +1 -1
  55. package/dist/client/assets/{rst-F45CKNEI.js → rst-CGJGl0XM.js} +1 -1
  56. package/dist/client/assets/{ruby-CVKWxnNz.js → ruby-BV5Xv3Ba.js} +1 -1
  57. package/dist/client/assets/{sas-czv76DEy.js → sas-dynhi3mz.js} +1 -1
  58. package/dist/client/assets/{scss-QyS4wfs9.js → scss-AkI8EyHf.js} +1 -1
  59. package/dist/client/assets/{shellscript-CDkKKY2R.js → shellscript-CWCjWzzV.js} +1 -1
  60. package/dist/client/assets/{shellsession-B8cMWj_h.js → shellsession-C5QB2cRQ.js} +1 -1
  61. package/dist/client/assets/{soy-C9PrVwHk.js → soy-C1TnCrD_.js} +1 -1
  62. package/dist/client/assets/{sql-CMyt-gNo.js → sql-BSlHLxvN.js} +1 -1
  63. package/dist/client/assets/{stata-DMLJq-wA.js → stata-DQWl1ugW.js} +1 -1
  64. package/dist/client/assets/{surrealql-u16qHYKa.js → surrealql-BpisvbXS.js} +1 -1
  65. package/dist/client/assets/{svelte-DsJx8ZCy.js → svelte-NmZYVIhS.js} +1 -1
  66. package/dist/client/assets/{templ-Qiu_0qpt.js → templ-CNf2Z3RO.js} +1 -1
  67. package/dist/client/assets/{tex-zOJoIY_H.js → tex-DntGVni7.js} +1 -1
  68. package/dist/client/assets/{textarea-DPgV-teI.js → textarea-z0DHLDaT.js} +2 -2
  69. package/dist/client/assets/{ts-tags-Dmdvk4-M.js → ts-tags-CsnM6KgL.js} +1 -1
  70. package/dist/client/assets/{tsx-iYVCeT3I.js → tsx-_mrOymnM.js} +1 -1
  71. package/dist/client/assets/{twig-BvUAyRvi.js → twig-HkqeGEpv.js} +1 -1
  72. package/dist/client/assets/{typescript-D8d9qhD1.js → typescript-3OUGMlDk.js} +1 -1
  73. package/dist/client/assets/{vue-R2NiYYJG.js → vue-DfZZRv3m.js} +1 -1
  74. package/dist/client/assets/{vue-html-CHgSv8Qw.js → vue-html-LDEwJDT-.js} +1 -1
  75. package/dist/client/assets/{vue-vine-BvMcYLMT.js → vue-vine-DsKt9e5E.js} +1 -1
  76. package/dist/client/assets/{xml-8KzqdUcc.js → xml-Dev0NAD_.js} +1 -1
  77. package/dist/client/assets/{xsl-C8lfRQsv.js → xsl-Bafi7lpn.js} +1 -1
  78. package/dist/client/assets/{yaml-CnELwg0m.js → yaml-BakHNYXp.js} +1 -1
  79. package/dist/client/index.html +3 -3
  80. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{Al as e,C as t,E as n,Et as r,Kd as i,M as a,Qa as o,Rl as s,Ta as c,Wu as l,Yd as u,cs as d,ct as f,dt as p,et as m,f as h,hs as g,id as _,k as v,kd as y,lo as b,lt as x,os as S,qa as C,to as w,uo as T,w as E,xt as D,zs as O}from"./textarea-DPgV-teI.js";import{a as ee,c as k,i as te,n as A,o as j,r as M,s as N,t as ne}from"./fileCommentAnnotations-vr5n8hW8.js";import{$n as re,An as ie,Bn as ae,C as oe,Cr as se,D as ce,Dn as le,E as ue,Er as de,Ft as P,In as fe,Jt as F,Lt as pe,Mt as I,O as me,Or as he,Pn as ge,Qn as _e,T as ve,Tr as ye,Wt as be,Zn as xe,_ as Se,an as Ce,d as L,dt as we,er as Te,f as Ee,fn as De,g as Oe,h as ke,hr as Ae,in as je,jn as Me,jt as Ne,k as Pe,lr as Fe,m as Ie,nn as Le,on as Re,or as ze,pt as Be,rn as Ve,tn as He,tr as Ue,vr as We,wt as Ge,xt as Ke}from"./index-D0fBCQfu.js";var qe=w(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Je=()=>`Copy mention`,Ye=()=>`Copiar menção`,Xe=()=>`Copiar mención`,Ze=()=>`Copier la mention`,Qe=()=>`Copia menzione`,$e=()=>`メンションをコピー`,et=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ye(e):n===`es`?Xe(e):n===`fr`?Ze(e):n===`it`?Qe(e):n===`ja`?$e(e):Je(e)},tt=()=>`Hide file explorer`,nt=()=>`Ocultar explorador de arquivos`,rt=()=>`Ocultar explorador de archivos`,it=()=>`Masquer l’explorateur de fichiers`,at=()=>`Nascondi esplora file`,ot=()=>`ファイルエクスプローラーを非表示`,R=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?nt(e):n===`es`?rt(e):n===`fr`?it(e):n===`it`?at(e):n===`ja`?ot(e):tt(e)},z=()=>`Mention copied`,st=()=>`Menção copiada`,ct=()=>`Mención copiada`,lt=()=>`Mention copiée`,ut=()=>`Menzione copiata`,dt=()=>`メンションをコピーしました`,ft=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?st(e):n===`es`?ct(e):n===`fr`?lt(e):n===`it`?ut(e):n===`ja`?dt(e):z(e)},pt=()=>`Open file in preview browser`,mt=()=>`Abrir arquivo no navegador de visualização`,ht=()=>`Abrir archivo en el navegador de vista previa`,gt=()=>`Ouvrir le fichier dans le navigateur d’aperçu`,_t=()=>`Apri file nel browser di anteprima`,vt=()=>`プレビューブラウザーでファイルを開く`,yt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?mt(e):n===`es`?ht(e):n===`fr`?gt(e):n===`it`?_t(e):n===`ja`?vt(e):pt(e)},bt=()=>`Refresh workspace files`,xt=()=>`Atualizar arquivos do workspace`,St=()=>`Actualizar archivos del espacio de trabajo`,Ct=()=>`Actualiser les fichiers de l’espace de travail`,wt=()=>`Aggiorna file del workspace`,Tt=()=>`ワークスペースのファイルを更新`,Et=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?xt(e):n===`es`?St(e):n===`fr`?Ct(e):n===`it`?wt(e):n===`ja`?Tt(e):bt(e)},Dt=()=>`Search workspace files`,Ot=()=>`Pesquisar arquivos do workspace`,kt=()=>`Buscar archivos del espacio de trabajo`,At=()=>`Rechercher dans les fichiers de l’espace de travail`,jt=()=>`Cerca file del workspace`,Mt=()=>`ワークスペースのファイルを検索`,Nt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ot(e):n===`es`?kt(e):n===`fr`?At(e):n===`it`?jt(e):n===`ja`?Mt(e):Dt(e)},Pt=()=>`Show file explorer`,Ft=()=>`Mostrar explorador de arquivos`,It=()=>`Mostrar explorador de archivos`,Lt=()=>`Afficher l’explorateur de fichiers`,Rt=()=>`Mostra esplora file`,zt=()=>`ファイルエクスプローラーを表示`,Bt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ft(e):n===`es`?It(e):n===`fr`?Lt(e):n===`it`?Rt(e):n===`ja`?zt(e):Pt(e)},Vt=()=>`Show markdown source`,Ht=()=>`Mostrar fonte Markdown`,Ut=()=>`Mostrar fuente Markdown`,Wt=()=>`Afficher la source Markdown`,Gt=()=>`Mostra sorgente Markdown`,Kt=()=>`Markdown ソースを表示`,qt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ht(e):n===`es`?Ut(e):n===`fr`?Wt(e):n===`it`?Gt(e):n===`ja`?Kt(e):Vt(e)},Jt=()=>`Show rendered markdown`,Yt=()=>`Mostrar Markdown renderizado`,Xt=()=>`Mostrar Markdown renderizado`,Zt=()=>`Afficher le Markdown rendu`,Qt=()=>`Mostra Markdown renderizzato`,$t=()=>`レンダリング済み Markdown を表示`,en=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Yt(e):n===`es`?Xt(e):n===`fr`?Zt(e):n===`it`?Qt(e):n===`ja`?$t(e):Jt(e)},tn=`file-tree-container`,nn=`data-file-tree-style`,rn=`data-file-tree-unsafe-css`,an=`data-file-tree-scrollbar-measure`,on=`data-file-tree-scrollbar-gutter-measured`,sn=`--trees-scrollbar-gutter-measured`,cn=`header`,ln=`context-menu`,un=`context-menu-trigger`,dn=5,fn=1<<dn,pn=fn*4;function mn(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function hn(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function gn(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function _n(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function vn(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function yn(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function bn(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,wn(e,t)}function xn(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=_n(e).get(t);if(i===void 0)return;let a=i>>dn;e.childVisibleChunkSums[a]+=r}function Sn(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Tn(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=fn}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Cn(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>dn;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<dn}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function wn(e,t){if(t.childIds.length<pn){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/fn),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>dn]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Tn(e,t,n,r){let i=Math.min(t.childIds.length,n+fn),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var En=7,Dn=3,On=1<<Dn,kn=4;function An(e,t,n=0){return e<<kn|n<<Dn|t}function jn(e){return e.depthAndFlags>>>kn}function Mn(e){return(e.depthAndFlags&On)>>Dn}function B(e){return(e.depthAndFlags&On)!==0}function Nn(e){return e.depthAndFlags&En}function V(e,t){return(Nn(e)&t)!==0}function Pn(e,t){e.depthAndFlags|=t}function Fn(e,t){e.depthAndFlags=An(t,Nn(e),Mn(e))}var In=Symbol(`benchmarkInstrumentation`);function Ln(e,t){return t==null||Object.defineProperty(e,In,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Rn(e){return e==null?null:e[In]??null}function H(e,t,n){return e==null?n():e.measurePhase(t,n)}function zn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Bn(e){return e>=48&&e<=57}function Vn(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Bn(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&Bn(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Hn(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Vn(t)}}function Un(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Wn(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=Un(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Gn(e,t,n){let r=Wn(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Kn(e,t){return Gn(e,t,Hn)}function qn(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Jn(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=qn(e,r);return a===qn(t,r)?Kn(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Yn(e,t){return Jn(e,t)}function Xn(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Hn(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=qn(e,n);return o===qn(t,n)?Gn(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Zn(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Hn(r);return e.sortKeyById[t]=i,i}function Qn(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function $n(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function er(e){let{hasTrailingSlash:t,segments:n}=$n(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function tr(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=$n(e);return{requiresDirectory:t,segments:n}}var nr=``;function rr(){let e=new Map;return e.set(nr,0),{idByValue:e,valueById:[nr],sortKeyById:[Hn(nr)]}}function ir(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function ar(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var or=Symbol(`pathStorePreparedInputKind`);function sr(e,t){return e[or]=t,e}function cr(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function lr(e,t,n){return n==="default"?Yn(e,t):n(cr(e),cr(t))}function ur(){return{depthAndFlags:An(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function dr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function fr(e){return e.isDirectory?e.segments.length:e.segments.length-1}function pr(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function mr(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function hr(e,t={}){return xr(e,t).map(e=>e.path)}function gr(e,t={}){let n=xr(e,t);return sr({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function _r(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return sr({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function vr(e){let t=e,n=t.preparedPaths;if(t[or]===`prepared`&&n!=null)return n;if(!pr(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function yr(e){let t=e;return t[or]===`presorted`&&t.presortedPaths!=null||mr(t.presortedPaths)?t.presortedPaths:null}function br(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function xr(e,t={}){let n=Qn(t),r=Rn(t);zn(r,`workload.inputFiles`,e.length);let i=H(r,`store.preparePathEntries.parse`,()=>e.map(e=>er(e)));return H(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>lr(e,t,n.sort))),i}var Sr=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[ur()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=rr();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Rn(e),this.options=Qn(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,mn())}appendPaths(e){return H(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>er(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,H(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return H(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:An(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:An(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:An(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=er(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:An(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:An(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=er(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(H(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||H(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Xn(this.lastPreparedPath,e,this.segmentSortKeyCache):lr(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=fr(e),i=n==null?0:fr(n),a=n==null?0:dr(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=ir(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),vn(i,s),s}createFileChildUnchecked(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),a}getOrCreateDirectoryChild(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!B(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),this.directories.set(a,mn()),a}createDirectoryChild(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),this.directories.set(a,mn()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!B(n))throw Error(`Path is not a directory: "${t}"`);if(V(n,1))throw Error(`Duplicate path: "${t}"`);Pn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,hn());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(B(a)){let t=hn();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;B(n)&&this.directories.set(t,mn());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),vn(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!B(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return bn(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Cr(e,t=`closed`,n=null){let r=Tr(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function wr(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Tr(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Er(e,t){return V(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:jn(t)<=e.defaultExpansion}function Dr(e,t,n=e.snapshot.nodes[t]){return n==null||!B(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Er(e,n)}function Or(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!B(r))return;let i=Er(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function kr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Ar(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function jr(e,t){let n=kr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Mr(e,t){let n=kr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Nr(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Pr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Fr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Ir(e,t){e.directoryLoadInfoById.delete(t)}function Lr(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Rr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function zr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Br(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Vr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Hr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Ur(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Wr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Gr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Kr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function qr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Jr(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Yr(e,t,n){return{...n,visibleCountDelta:oi(e)-t}}function Xr(e,t){let n=oi(e),r=wr();e.transactionStack.push(r);try{t()}catch(t){throw $r(e,r,!1),t}$r(e,r,!0,oi(e)-n)}function Zr(e,t){let n=e.instrumentation;if(n==null){Qr(e,t);return}H(n,`store.events.record`,()=>Qr(e,t))}function Qr(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){ii(e,t);return}n.events.push(t),ri(n,t)}function $r(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?ni(i,t):H(n,`store.events.batch.merge`,()=>ni(i,t));return}let a=ei(t,r),o=e.instrumentation;if(o==null){ii(e,a);return}H(o,`store.events.batch.commit`,()=>ii(e,a))}function ei(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function ti(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function ni(e,t){for(let n of t.events)e.events.push(n);ti(e,t)}function ri(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function ii(e,t){let n=e.instrumentation;if(n==null){ai(e,t);return}H(n,`store.events.emit`,()=>ai(e,t))}function ai(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function oi(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function si(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!B(n)||V(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!B(a)?null:i}function ci(e,t){let n=t;for(;;){let t=si(e,n);if(t==null)return n;n=t}}function li(e,t){let n=[t],r=t;for(;;){let t=si(e,r);if(t==null)return n;n.push(t),r=t}}function ui(e,t){let n=t==null?e.snapshot.rootId:yi(e,t);return n==null?[]:xi(e,n)}function di(e,t){let n=er(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Ii(e,Fi(e,r)),{createdNodeIds:a,directoryId:o}=Si(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=G(e,o);if(V(n,1))throw Error(`Path already exists: "${t}"`);Pn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=wi(e,o,n.basename),s.add(c);gi(e,o);let l=Ii(e,o);return Rr({affectedAncestorIds:vi(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Li(i,l)})}function fi(e,t,n){let r=yi(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=G(e,r);if(V(i,2))throw Error(`The root node cannot be removed`);if(B(i)&&W(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Ii(e,a),s=Ni(e,r);Di(e,a,r,i.nameId),Pi(e,a),gi(e,a);let c=Ii(e,a);return zr({affectedAncestorIds:vi(e,a),affectedNodeIds:s,path:t,projectionChanged:Li(o,c),recursive:n.recursive===!0})}function pi(e,t,n,r){let i=yi(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=G(e,i);if(V(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=ji(e,i,n),c=Ii(e,a.parentId),l=Ii(e,s.parentId),u=ar(e.snapshot.segmentTable,a.nameId),d=ir(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(B(a)&&Vi(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=gn(e.snapshot.nodes,W(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Mi(e,p,o,Mn(a))===`skip`)return null;let m=a.parentId;Di(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Bi(e,i),Ei(e,s.parentId,i),Pi(e,m),e.pathCacheVersion++,gi(e,m),s.parentId!==m&&gi(e,s.parentId);let h=Ii(e,m),g=Ii(e,s.parentId);return Br({affectedAncestorIds:[...new Set([...vi(e,m),...vi(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Ri([c,l],[h,g]),to:U(e,i)})}function mi(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function hi(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function U(e,t){let n=G(e,t),r=mi(e,t);if(r!=null)return r;if(V(n,2))return hi(e,t,``);let i=U(e,n.parentId),a=ar(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return hi(e,t,B(n)?`${o}/`:o)}function gi(e,t){let n=e.instrumentation;if(n==null){Ui(e,t);return}H(n,`store.recomputeCountsUpwardFrom`,()=>Ui(e,t))}function _i(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!B(o)){Hi(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Hi(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function vi(e,t){let n=[],r=t;for(;r!=null;){let t=G(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function yi(e,t){if(t.length===0)return e.snapshot.rootId;let n=tr(t);return bi(e,n.segments,n.requiresDirectory)}function bi(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=W(e,r),a=gn(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=G(e,r);return n&&!B(i)?null:r}function W(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function G(e,t){let n=e.snapshot.nodes[t];if(n===void 0||V(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function xi(e,t){let n=e.snapshot.nodes[t];if(n===void 0||V(n,4))return[];if(!B(n))return[U(e,t)];if(W(e,t).childIds.length===0)return V(n,1)&&!V(n,2)?[U(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||V(n,4)){i.pop();continue}if(!B(n)){r.push(U(e,t.nodeId)),i.pop();continue}let a=W(e,t.nodeId);if(a.childIds.length===0){V(n,1)&&!V(n,2)&&r.push(U(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Si(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=ir(e.snapshot.segmentTable,i),a=W(e,r),o=gn(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!B(G(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Ci(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Ci(e,t,n){let r=G(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:An(jn(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,mn()),Ei(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function wi(e,t,n){let r=ir(e.snapshot.segmentTable,n),i=W(e,t);if(gn(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Gi(e,t,n)}"`);let a=G(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:An(jn(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Ei(e,t,o),e.activeNodeCount++,o}function Ti(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}Oi(e,n,o)<0?i=a:r=a+1}return r}function Ei(e,t,n){let r=W(e,t),i=G(e,n);gn(e.snapshot.nodes,r).set(i.nameId,n),xn(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Ti(e,r,n);r.childIds.splice(a,0,n),yn(r,a),wn(e.snapshot.nodes,r)}function Di(e,t,n,r){let i=W(e,t),a=_n(i),o=a.get(n)??-1;gn(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&xn(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),yn(i,o),wn(e.snapshot.nodes,i))}function Oi(e,t,n){let r=e.snapshot.options.sort;return r==="default"?ki(e,t,n):r(Ai(e,t),Ai(e,n))}function ki(e,t,n){let r=G(e,t),i=G(e,n),a=B(r);if(a!==B(i))return a?-1:1;let o=Wn(Zn(e.snapshot.segmentTable,r.nameId),Zn(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=ar(e.snapshot.segmentTable,r.nameId),c=ar(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Ai(e,t){let n=G(e,t),r=U(e,t),i=B(n),a=i?r.slice(0,-1):r;return{basename:ar(e.snapshot.segmentTable,n.nameId),depth:jn(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function ji(e,t,n){let r=G(e,t),i=yi(e,n);if(i!=null){let t=G(e,i);if(B(t))return{basename:ar(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=tr(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=tr(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:bi(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Mi(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${U(e,t)}"`);let i=G(e,t);if(Mn(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(B(i)&&W(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Ni(e,t),Di(e,a,t,o),Pi(e,a),gi(e,a),`handled`}function Ni(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=G(e,t.nodeId);if(t.visitedChildren||!B(i)){B(i)&&e.snapshot.directories.delete(t.nodeId),Pn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Ir(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=W(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function Pi(e,t){let n=t;for(;n!=null;){let t=G(e,n);if(!B(t)||V(t,2)||W(e,n).childIds.length>0)return;Pn(t,1),n=t.parentId===n?null:t.parentId}}function Fi(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=gn(e.snapshot.nodes,W(e,n)).get(t);if(i==null||!B(G(e,i)))break;n=i}return n}function Ii(e,t){let n=zi(e,t);if(n==null)return null;let r=ci(e,n),i=G(e,r),a=n===r?null:li(e,n).map(t=>U(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:W(e,r).childIds.length>0,path:U(e,r),terminalKind:Mn(i)})}function Li(e,t){return Ri([e],[t])}function Ri(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function zi(e,t){let n=t;for(;n!=null;){let t=G(e,n);if(!B(t)||V(t,2))return null;if(!Dr(e,n,t))return n;n=t.parentId}return null}function Bi(e,t){let n=G(e,t);if(Fn(n,(t===e.snapshot.rootId?-1:jn(G(e,n.parentId)))+1),!B(n))return;let r=W(e,t);for(let t of r.childIds)Bi(e,t)}function Vi(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=G(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Hi(e,t,n=G(e,t),r=!1){let i=e.instrumentation;if(i==null){Wi(e,t,n,r);return}H(i,`store.recomputeNodeCounts`,()=>Wi(e,t,n,r))}function Ui(e,t){let n=t;for(;n!=null;){let t=G(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Hi(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&xn(W(e,s),n,a,o),n=s}}function Wi(e,t,n,r){if(!B(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=W(e,t);if(r){let t=e.instrumentation;t==null?bn(e.snapshot.nodes,i):H(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>bn(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,V(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=si(e,t)==null?Dr(e,t,n)?1+o:1:o}function Gi(e,t,n){let r=U(e,t);return r.length===0?n:`${r}${n}`}function Ki(e){return e!=null&&!V(e,4)}function qi(e,t){let n=e.snapshot.nodes[t];return!Ki(n)||!B(n)||V(n,2)?null:n}function Ji(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Ki(e.snapshot.nodes[n])&&(t+=1);return t}function Yi(e){return Math.max(0,e.valueById.length-1)}function Xi(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Ji(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Yi(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Zi(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Qi(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)qi(e,n)!=null&&t.push(U(e,n));for(let t of e.expandedDirectoryIds)qi(e,t)!=null&&n.push(U(e,t));return{collapsedPaths:t,expandedPaths:n}}function $i(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)qi(e,n)==null||Ar(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:U(e,n)});return t}function ea(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=yi(e,n);t!=null&&Or(e,t,!0,G(e,t))}for(let n of t.collapsedPaths){let t=yi(e,n);t!=null&&Or(e,t,!1,G(e,t))}}function ta(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=yi(e,n.path);t!=null&&qi(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function na(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function ra(e){let t=e.snapshot.segmentTable,n=rr();for(let r of e.snapshot.nodes)if(Ki(r)){if(V(r,2)){r.nameId=0;continue}r.nameId=ir(n,ar(t,r.nameId))}e.snapshot.segmentTable=n}function ia(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Ki(r)||!B(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Ki(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[G(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),bn(e.snapshot.nodes,n)}}function aa(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Ki(n))break;--t}e.snapshot.nodes.length=t+1}function oa(e){let t=Qi(e),n=$i(e);H(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>na(e)),H(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>ra(e)),H(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ia(e)),H(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>aa(e)),H(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>ea(e,t)),H(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>ta(e,n)),H(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>_i(e,e.snapshot.rootId))}function sa(e){let t=Qi(e),n=$i(e),r=H(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>ui(e)),i=Ln({...e.snapshot.options},e.instrumentation),a=H(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Sr(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,H(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>ea(e,t)),H(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>ta(e,n)),H(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>_i(e,e.snapshot.rootId))}function ca(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function la(e,t){let n=Xi(e);t===`stable`?H(e.instrumentation,`store.cleanup.stable`,()=>oa(e)):H(e.instrumentation,`store.cleanup.aggressive`,()=>sa(e));let r=Xi(e);return Zi(t,t===`stable`,n,r)}var ua=64;function da(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function fa(e){return G(e,e.snapshot.rootId).visibleSubtreeCount}function pa(e,t,n,r){let i=G(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function ma(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Na(e,t.cursor),setSize:t.setSize,subtreeEndIndex:pa(e,t.cursor,t.index,n)}}function ha(e,t,n,r,i,a){let o=W(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Sn(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return ga(e,u,l,r+c,i+1,s,o.childIds.length,a)}function ga(e,t,n,r,i,a,o,s){if(!B(G(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=Da(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=G(e,c.terminalNodeId);if(!B(l)||!Dr(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return ha(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function _a(e,t){let n=fa(e);if(t<0||t>=n)return null;let r=ha(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>U(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=ma(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Na(e,r.cursor),setSize:r.setSize,subtreeEndIndex:pa(e,r.cursor,r.index,n)}}function va(e,t,n){let r=e.instrumentation,i=fa(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return Ma(e,o+1);let t=[],n=wa(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Na(e,n);t.push(r),n=ka(e,n)}return t}let s=[],c=0,l=0,u=H(r,`store.getVisibleSlice.selectFirstRow`,()=>wa(e,a));for(let t=a;t<=o&&u!=null;t++){let t=H(r,`store.getVisibleSlice.materializeRow`,()=>Na(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=H(r,`store.getVisibleSlice.advanceCursor`,()=>ka(e,u))}return zn(r,`workload.visibleRowsRead`,s.length),zn(r,`workload.flattenedRowsRead`,c),zn(r,`workload.flattenedSegmentsRead`,l),s}function ya(e,t=fa(e)){let n=e.instrumentation;return n==null?ja(e,t):H(n,`store.getVisibleTreeProjection`,()=>ja(e,t))}function ba(e){return Aa(ya(e))}function xa(e,t){let n=yi(e,t);if(n==null||n===e.snapshot.rootId||B(G(e,n))&&ci(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=G(e,i).parentId,n=W(e,t),s=_n(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Cn(a,n,s),t!==o){let n=G(e,t),a=si(e,t);if(!Dr(e,t,n)&&a!==i)return null;ci(e,t)===t&&(r+=1)}i=t}return r}function Sa(e,t){let n=yi(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=G(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return Dr(e,n,r)?null:(Or(e,n,!0,r),gi(e,n),Vr({affectedAncestorIds:vi(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Ca(e,t){let n=yi(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=G(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return Dr(e,n,r)?(Or(e,n,!1,r),gi(e,n),Hr({affectedAncestorIds:vi(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function wa(e,t){return t<0||t>=fa(e)?null:Ta(e,e.snapshot.rootId,t,-1)}function Ta(e,t,n,r){let i=W(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Sn(e.snapshot.nodes,i,n):H(a,`store.getVisibleSlice.selectChildIndex`,()=>Sn(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return Ea(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function Ea(e,t,n,r){if(!B(G(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=Da(e,t,r);if(n===0)return i;let a=G(e,i.terminalNodeId);if(!B(a)||!Dr(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Ta(e,i.terminalNodeId,n-1,i.visibleDepth)}function Da(e,t,n){return B(G(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:ci(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:H(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>ci(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function Oa(e,t){let n=G(e,t);if(!B(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:si(e,r)!==t}function ka(e,t){let n=G(e,t.terminalNodeId);if(B(n)){let r=W(e,t.terminalNodeId);if(Dr(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:Ea(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=G(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=W(e,n),o=_n(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return Ea(e,s,0,i);Oa(e,r)&&i--,r=n}}function Aa(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function ja(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(ua);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=da(o,y);let x,S=_;if(B(v))S=f?ci(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:U(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&B(C)&&Dr(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function Ma(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!B(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:U(e,f)};continue}let h=l?ci(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Na(e,g);let _=i[h];_!=null&&B(_)&&Dr(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Na(e,t){let n=G(e,t.terminalNodeId),r=B(n)?Pa(e,t):null,i=U(e,t.terminalNodeId),a=ar(e.snapshot.segmentTable,n.nameId),o=B(n)&&W(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?li(e,t.headNodeId).map(n=>{let r=G(e,n);return{isTerminal:n===t.terminalNodeId,name:ar(e.snapshot.segmentTable,r.nameId),nodeId:n,path:U(e,n)}}):H(c,`store.getVisibleSlice.flatten.collectSegments`,()=>li(e,t.headNodeId).map(n=>{let r=G(e,n);return{isTerminal:n===t.terminalNodeId,name:ar(e.snapshot.segmentTable,r.nameId),nodeId:n,path:U(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:B(n)&&Dr(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:B(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Pa(e,t){if(t.headNodeId===t.terminalNodeId)return Ar(e,t.terminalNodeId);let n=li(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Ar(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function Fa(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!B(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&wn(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&B(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,wn(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Ia(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var La=class e{#e;constructor(e={}){let t=Rn(e),n=H(t,`store.builder.create`,()=>new Sr(e));if(e.preparedInput!=null){let t=yr(e.preparedInput);t==null?n.appendPreparedPaths(vr(e.preparedInput),!1):n.appendPresortedPaths(t,br(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(H(t,`store.preparePathEntries`,()=>xr(r,e)))}let r=H(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=H(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=H(t,`store.state.create`,()=>Cr(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:H(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Ia(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&H(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?H(t,`store.state.initializeOpenVisibleCounts`,()=>Fa(this.#e)):H(t,`store.state.recomputeCounts`,()=>_i(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return hr(e,t)}static prepareInput(e,t={}){return gr(e,t)}static preparePresortedInput(e){return _r(e)}list(e){return H(this.#e.instrumentation,`store.list`,()=>ui(this.#e,e))}add(e){H(this.#e.instrumentation,`store.add`,()=>{let t=fa(this.#e);Zr(this.#e,Yr(this.#e,t,di(this.#e,e)))})}remove(e,t={}){H(this.#e.instrumentation,`store.remove`,()=>{let n=fa(this.#e);Zr(this.#e,Yr(this.#e,n,fi(this.#e,e,t)))})}move(e,t,n={}){H(this.#e.instrumentation,`store.move`,()=>{let r=fa(this.#e),i=pi(this.#e,e,t,n);i!=null&&Zr(this.#e,Yr(this.#e,r,i))})}batch(e){Xr(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return H(this.#e.instrumentation,`store.getVisibleCount`,()=>fa(this.#e))}getVisibleSlice(e,t){return H(this.#e.instrumentation,`store.getVisibleSlice`,()=>va(this.#e,e,t))}getVisibleRowContext(e){return H(this.#e.instrumentation,`store.getVisibleRowContext`,()=>_a(this.#e,e))}getVisibleTreeProjection(){return ba(this.#e)}getVisibleTreeProjectionData(e){return ya(this.#e,e)}getVisibleIndex(e){return H(this.#e.instrumentation,`store.getVisibleIndex`,()=>xa(this.#e,e))}getPathInfo(e){return H(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=yi(this.#e,e);if(t==null)return null;let n=G(this.#e,t);return{depth:jn(n),kind:B(n)?`directory`:`file`,path:U(this.#e,t)}})}isExpanded(e){return H(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=G(this.#e,t);return Dr(this.#e,t,n)})}expand(e){H(this.#e.instrumentation,`store.expand`,()=>{let t=fa(this.#e),n=Sa(this.#e,e);n!=null&&Zr(this.#e,Yr(this.#e,t,n))})}collapse(e){H(this.#e.instrumentation,`store.collapse`,()=>{let t=fa(this.#e),n=Ca(this.#e,e);n!=null&&Zr(this.#e,Yr(this.#e,t,n))})}on(e,t){return Lr(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Ar(this.#e,t)}markDirectoryUnloaded(e){H(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(W(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=fa(this.#e);Mr(this.#e,t),Zr(this.#e,Yr(this.#e,n,Ur({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return H(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=fa(this.#e),r=jr(this.#e,t);return Zr(this.#e,Yr(this.#e,n,Wr({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return H(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Ar(this.#e,n)!==`loading`||!Pr(this.#e,n,e.attemptId))return!1;let r=U(this.#e,n);this.validateChildPatch(r,t);let i=fa(this.#e),a=[];for(let e of t.operations){Ra(r,e);let t=fa(this.#e);switch(e.type){case`add`:a.push(Yr(this.#e,t,di(this.#e,e.path)));break;case`remove`:a.push(Yr(this.#e,t,fi(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=pi(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Yr(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Zr(this.#e,Yr(this.#e,i,Gr({affectedAncestorIds:vi(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:U(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return H(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=fa(this.#e),r=Nr(this.#e,t,e.attemptId);return Zr(this.#e,Yr(this.#e,n,Kr({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:U(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return H(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=fa(this.#e),i=Fr(this.#e,n,e.attemptId,t);return Zr(this.#e,Yr(this.#e,r,qr({affectedAncestorIds:vi(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:U(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return H(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(ca(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=fa(this.#e),n=la(this.#e,e.mode??`stable`);return Zr(this.#e,Yr(this.#e,t,Jr({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=W(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Hn(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=Wn(Zn(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!B(G(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=G(this.#e,n);Dr(this.#e,n,i)||(Or(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=G(this.#e,e);if(!Dr(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=yi(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!B(G(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!B(G(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=G(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=G(this.#e,e),r=si(this.#e,e);if(!Dr(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Ra(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var za={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Ba(e,t){if(typeof e==`number`)return{itemHeight:t??za.default.itemHeight,factor:e};let n=za[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Va=za.default.itemHeight,Ha=`@layer base, theme, unsafe;
1
+ import{Al as e,C as t,E as n,Et as r,Kd as i,M as a,Qa as o,Rl as s,Ta as c,Wu as l,Yd as u,cs as d,ct as f,dt as p,et as m,f as h,hs as g,id as _,k as v,kd as y,lo as b,lt as x,os as S,qa as C,to as w,uo as T,w as E,xt as D,zs as O}from"./textarea-z0DHLDaT.js";import{a as ee,c as k,i as te,n as A,o as j,r as M,s as N,t as ne}from"./fileCommentAnnotations-HmnWWCqP.js";import{$n as re,An as ie,Bn as ae,C as oe,Cr as se,D as ce,Dn as le,E as ue,Er as de,Ft as P,In as fe,Jt as F,Lt as pe,Mt as I,O as me,Or as he,Pn as ge,Qn as _e,T as ve,Tr as ye,Wt as be,Zn as xe,_ as Se,an as Ce,d as L,dt as we,er as Te,f as Ee,fn as De,g as Oe,h as ke,hr as Ae,in as je,jn as Me,jt as Ne,k as Pe,lr as Fe,m as Ie,nn as Le,on as Re,or as ze,pt as Be,rn as Ve,tn as He,tr as Ue,vr as We,wt as Ge,xt as Ke}from"./index-zd5b5MHc.js";var qe=w(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Je=()=>`Copy mention`,Ye=()=>`Copiar menção`,Xe=()=>`Copiar mención`,Ze=()=>`Copier la mention`,Qe=()=>`Copia menzione`,$e=()=>`メンションをコピー`,et=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ye(e):n===`es`?Xe(e):n===`fr`?Ze(e):n===`it`?Qe(e):n===`ja`?$e(e):Je(e)},tt=()=>`Hide file explorer`,nt=()=>`Ocultar explorador de arquivos`,rt=()=>`Ocultar explorador de archivos`,it=()=>`Masquer l’explorateur de fichiers`,at=()=>`Nascondi esplora file`,ot=()=>`ファイルエクスプローラーを非表示`,R=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?nt(e):n===`es`?rt(e):n===`fr`?it(e):n===`it`?at(e):n===`ja`?ot(e):tt(e)},z=()=>`Mention copied`,st=()=>`Menção copiada`,ct=()=>`Mención copiada`,lt=()=>`Mention copiée`,ut=()=>`Menzione copiata`,dt=()=>`メンションをコピーしました`,ft=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?st(e):n===`es`?ct(e):n===`fr`?lt(e):n===`it`?ut(e):n===`ja`?dt(e):z(e)},pt=()=>`Open file in preview browser`,mt=()=>`Abrir arquivo no navegador de visualização`,ht=()=>`Abrir archivo en el navegador de vista previa`,gt=()=>`Ouvrir le fichier dans le navigateur d’aperçu`,_t=()=>`Apri file nel browser di anteprima`,vt=()=>`プレビューブラウザーでファイルを開く`,yt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?mt(e):n===`es`?ht(e):n===`fr`?gt(e):n===`it`?_t(e):n===`ja`?vt(e):pt(e)},bt=()=>`Refresh workspace files`,xt=()=>`Atualizar arquivos do workspace`,St=()=>`Actualizar archivos del espacio de trabajo`,Ct=()=>`Actualiser les fichiers de l’espace de travail`,wt=()=>`Aggiorna file del workspace`,Tt=()=>`ワークスペースのファイルを更新`,Et=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?xt(e):n===`es`?St(e):n===`fr`?Ct(e):n===`it`?wt(e):n===`ja`?Tt(e):bt(e)},Dt=()=>`Search workspace files`,Ot=()=>`Pesquisar arquivos do workspace`,kt=()=>`Buscar archivos del espacio de trabajo`,At=()=>`Rechercher dans les fichiers de l’espace de travail`,jt=()=>`Cerca file del workspace`,Mt=()=>`ワークスペースのファイルを検索`,Nt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ot(e):n===`es`?kt(e):n===`fr`?At(e):n===`it`?jt(e):n===`ja`?Mt(e):Dt(e)},Pt=()=>`Show file explorer`,Ft=()=>`Mostrar explorador de arquivos`,It=()=>`Mostrar explorador de archivos`,Lt=()=>`Afficher l’explorateur de fichiers`,Rt=()=>`Mostra esplora file`,zt=()=>`ファイルエクスプローラーを表示`,Bt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ft(e):n===`es`?It(e):n===`fr`?Lt(e):n===`it`?Rt(e):n===`ja`?zt(e):Pt(e)},Vt=()=>`Show markdown source`,Ht=()=>`Mostrar fonte Markdown`,Ut=()=>`Mostrar fuente Markdown`,Wt=()=>`Afficher la source Markdown`,Gt=()=>`Mostra sorgente Markdown`,Kt=()=>`Markdown ソースを表示`,qt=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Ht(e):n===`es`?Ut(e):n===`fr`?Wt(e):n===`it`?Gt(e):n===`ja`?Kt(e):Vt(e)},Jt=()=>`Show rendered markdown`,Yt=()=>`Mostrar Markdown renderizado`,Xt=()=>`Mostrar Markdown renderizado`,Zt=()=>`Afficher le Markdown rendu`,Qt=()=>`Mostra Markdown renderizzato`,$t=()=>`レンダリング済み Markdown を表示`,en=(e={},t={})=>{let n=t.locale??C();return n===`pt-BR`?Yt(e):n===`es`?Xt(e):n===`fr`?Zt(e):n===`it`?Qt(e):n===`ja`?$t(e):Jt(e)},tn=`file-tree-container`,nn=`data-file-tree-style`,rn=`data-file-tree-unsafe-css`,an=`data-file-tree-scrollbar-measure`,on=`data-file-tree-scrollbar-gutter-measured`,sn=`--trees-scrollbar-gutter-measured`,cn=`header`,ln=`context-menu`,un=`context-menu-trigger`,dn=5,fn=1<<dn,pn=fn*4;function mn(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function hn(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function gn(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function _n(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function vn(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function yn(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function bn(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,wn(e,t)}function xn(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=_n(e).get(t);if(i===void 0)return;let a=i>>dn;e.childVisibleChunkSums[a]+=r}function Sn(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Tn(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=fn}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Cn(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>dn;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<dn}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function wn(e,t){if(t.childIds.length<pn){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/fn),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>dn]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Tn(e,t,n,r){let i=Math.min(t.childIds.length,n+fn),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var En=7,Dn=3,On=1<<Dn,kn=4;function An(e,t,n=0){return e<<kn|n<<Dn|t}function jn(e){return e.depthAndFlags>>>kn}function Mn(e){return(e.depthAndFlags&On)>>Dn}function B(e){return(e.depthAndFlags&On)!==0}function Nn(e){return e.depthAndFlags&En}function V(e,t){return(Nn(e)&t)!==0}function Pn(e,t){e.depthAndFlags|=t}function Fn(e,t){e.depthAndFlags=An(t,Nn(e),Mn(e))}var In=Symbol(`benchmarkInstrumentation`);function Ln(e,t){return t==null||Object.defineProperty(e,In,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Rn(e){return e==null?null:e[In]??null}function H(e,t,n){return e==null?n():e.measurePhase(t,n)}function zn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Bn(e){return e>=48&&e<=57}function Vn(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Bn(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&Bn(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function Hn(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Vn(t)}}function Un(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function Wn(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=Un(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Gn(e,t,n){let r=Wn(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Kn(e,t){return Gn(e,t,Hn)}function qn(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Jn(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=qn(e,r);return a===qn(t,r)?Kn(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Yn(e,t){return Jn(e,t)}function Xn(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Hn(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=qn(e,n);return o===qn(t,n)?Gn(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Zn(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Hn(r);return e.sortKeyById[t]=i,i}function Qn(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function $n(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function er(e){let{hasTrailingSlash:t,segments:n}=$n(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function tr(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=$n(e);return{requiresDirectory:t,segments:n}}var nr=``;function rr(){let e=new Map;return e.set(nr,0),{idByValue:e,valueById:[nr],sortKeyById:[Hn(nr)]}}function ir(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function ar(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var or=Symbol(`pathStorePreparedInputKind`);function sr(e,t){return e[or]=t,e}function cr(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function lr(e,t,n){return n==="default"?Yn(e,t):n(cr(e),cr(t))}function ur(){return{depthAndFlags:An(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function dr(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function fr(e){return e.isDirectory?e.segments.length:e.segments.length-1}function pr(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function mr(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function hr(e,t={}){return xr(e,t).map(e=>e.path)}function gr(e,t={}){let n=xr(e,t);return sr({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function _r(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return sr({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function vr(e){let t=e,n=t.preparedPaths;if(t[or]===`prepared`&&n!=null)return n;if(!pr(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function yr(e){let t=e;return t[or]===`presorted`&&t.presortedPaths!=null||mr(t.presortedPaths)?t.presortedPaths:null}function br(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function xr(e,t={}){let n=Qn(t),r=Rn(t);zn(r,`workload.inputFiles`,e.length);let i=H(r,`store.preparePathEntries.parse`,()=>e.map(e=>er(e)));return H(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>lr(e,t,n.sort))),i}var Sr=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[ur()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=rr();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Rn(e),this.options=Qn(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,mn())}appendPaths(e){return H(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>er(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,H(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return H(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:An(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:An(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:An(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=er(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:An(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:An(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=er(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(H(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||H(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Xn(this.lastPreparedPath,e,this.segmentSortKeyCache):lr(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=fr(e),i=n==null?0:fr(n),a=n==null?0:dr(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=ir(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),vn(i,s),s}createFileChildUnchecked(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),a}getOrCreateDirectoryChild(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!B(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),this.directories.set(a,mn()),a}createDirectoryChild(e,t){let n=ir(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:An(jn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vn(r,a),this.directories.set(a,mn()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!B(n))throw Error(`Path is not a directory: "${t}"`);if(V(n,1))throw Error(`Duplicate path: "${t}"`);Pn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,hn());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(B(a)){let t=hn();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;B(n)&&this.directories.set(t,mn());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),vn(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!B(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return bn(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Cr(e,t=`closed`,n=null){let r=Tr(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function wr(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Tr(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Er(e,t){return V(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:jn(t)<=e.defaultExpansion}function Dr(e,t,n=e.snapshot.nodes[t]){return n==null||!B(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Er(e,n)}function Or(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!B(r))return;let i=Er(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function kr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Ar(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function jr(e,t){let n=kr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Mr(e,t){let n=kr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Nr(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Pr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Fr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Ir(e,t){e.directoryLoadInfoById.delete(t)}function Lr(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Rr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function zr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Br(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Vr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Hr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Ur(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Wr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Gr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Kr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function qr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Jr(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Yr(e,t,n){return{...n,visibleCountDelta:oi(e)-t}}function Xr(e,t){let n=oi(e),r=wr();e.transactionStack.push(r);try{t()}catch(t){throw $r(e,r,!1),t}$r(e,r,!0,oi(e)-n)}function Zr(e,t){let n=e.instrumentation;if(n==null){Qr(e,t);return}H(n,`store.events.record`,()=>Qr(e,t))}function Qr(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){ii(e,t);return}n.events.push(t),ri(n,t)}function $r(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?ni(i,t):H(n,`store.events.batch.merge`,()=>ni(i,t));return}let a=ei(t,r),o=e.instrumentation;if(o==null){ii(e,a);return}H(o,`store.events.batch.commit`,()=>ii(e,a))}function ei(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function ti(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function ni(e,t){for(let n of t.events)e.events.push(n);ti(e,t)}function ri(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function ii(e,t){let n=e.instrumentation;if(n==null){ai(e,t);return}H(n,`store.events.emit`,()=>ai(e,t))}function ai(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function oi(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function si(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!B(n)||V(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!B(a)?null:i}function ci(e,t){let n=t;for(;;){let t=si(e,n);if(t==null)return n;n=t}}function li(e,t){let n=[t],r=t;for(;;){let t=si(e,r);if(t==null)return n;n.push(t),r=t}}function ui(e,t){let n=t==null?e.snapshot.rootId:yi(e,t);return n==null?[]:xi(e,n)}function di(e,t){let n=er(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Ii(e,Fi(e,r)),{createdNodeIds:a,directoryId:o}=Si(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=G(e,o);if(V(n,1))throw Error(`Path already exists: "${t}"`);Pn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=wi(e,o,n.basename),s.add(c);gi(e,o);let l=Ii(e,o);return Rr({affectedAncestorIds:vi(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Li(i,l)})}function fi(e,t,n){let r=yi(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=G(e,r);if(V(i,2))throw Error(`The root node cannot be removed`);if(B(i)&&W(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Ii(e,a),s=Ni(e,r);Di(e,a,r,i.nameId),Pi(e,a),gi(e,a);let c=Ii(e,a);return zr({affectedAncestorIds:vi(e,a),affectedNodeIds:s,path:t,projectionChanged:Li(o,c),recursive:n.recursive===!0})}function pi(e,t,n,r){let i=yi(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=G(e,i);if(V(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=ji(e,i,n),c=Ii(e,a.parentId),l=Ii(e,s.parentId),u=ar(e.snapshot.segmentTable,a.nameId),d=ir(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(B(a)&&Vi(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=gn(e.snapshot.nodes,W(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Mi(e,p,o,Mn(a))===`skip`)return null;let m=a.parentId;Di(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Bi(e,i),Ei(e,s.parentId,i),Pi(e,m),e.pathCacheVersion++,gi(e,m),s.parentId!==m&&gi(e,s.parentId);let h=Ii(e,m),g=Ii(e,s.parentId);return Br({affectedAncestorIds:[...new Set([...vi(e,m),...vi(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Ri([c,l],[h,g]),to:U(e,i)})}function mi(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function hi(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function U(e,t){let n=G(e,t),r=mi(e,t);if(r!=null)return r;if(V(n,2))return hi(e,t,``);let i=U(e,n.parentId),a=ar(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return hi(e,t,B(n)?`${o}/`:o)}function gi(e,t){let n=e.instrumentation;if(n==null){Ui(e,t);return}H(n,`store.recomputeCountsUpwardFrom`,()=>Ui(e,t))}function _i(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!B(o)){Hi(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Hi(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function vi(e,t){let n=[],r=t;for(;r!=null;){let t=G(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function yi(e,t){if(t.length===0)return e.snapshot.rootId;let n=tr(t);return bi(e,n.segments,n.requiresDirectory)}function bi(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=W(e,r),a=gn(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=G(e,r);return n&&!B(i)?null:r}function W(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function G(e,t){let n=e.snapshot.nodes[t];if(n===void 0||V(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function xi(e,t){let n=e.snapshot.nodes[t];if(n===void 0||V(n,4))return[];if(!B(n))return[U(e,t)];if(W(e,t).childIds.length===0)return V(n,1)&&!V(n,2)?[U(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||V(n,4)){i.pop();continue}if(!B(n)){r.push(U(e,t.nodeId)),i.pop();continue}let a=W(e,t.nodeId);if(a.childIds.length===0){V(n,1)&&!V(n,2)&&r.push(U(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Si(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=ir(e.snapshot.segmentTable,i),a=W(e,r),o=gn(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!B(G(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Ci(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Ci(e,t,n){let r=G(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:An(jn(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,mn()),Ei(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function wi(e,t,n){let r=ir(e.snapshot.segmentTable,n),i=W(e,t);if(gn(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Gi(e,t,n)}"`);let a=G(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:An(jn(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Ei(e,t,o),e.activeNodeCount++,o}function Ti(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}Oi(e,n,o)<0?i=a:r=a+1}return r}function Ei(e,t,n){let r=W(e,t),i=G(e,n);gn(e.snapshot.nodes,r).set(i.nameId,n),xn(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Ti(e,r,n);r.childIds.splice(a,0,n),yn(r,a),wn(e.snapshot.nodes,r)}function Di(e,t,n,r){let i=W(e,t),a=_n(i),o=a.get(n)??-1;gn(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&xn(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),yn(i,o),wn(e.snapshot.nodes,i))}function Oi(e,t,n){let r=e.snapshot.options.sort;return r==="default"?ki(e,t,n):r(Ai(e,t),Ai(e,n))}function ki(e,t,n){let r=G(e,t),i=G(e,n),a=B(r);if(a!==B(i))return a?-1:1;let o=Wn(Zn(e.snapshot.segmentTable,r.nameId),Zn(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=ar(e.snapshot.segmentTable,r.nameId),c=ar(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Ai(e,t){let n=G(e,t),r=U(e,t),i=B(n),a=i?r.slice(0,-1):r;return{basename:ar(e.snapshot.segmentTable,n.nameId),depth:jn(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function ji(e,t,n){let r=G(e,t),i=yi(e,n);if(i!=null){let t=G(e,i);if(B(t))return{basename:ar(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=tr(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=tr(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:bi(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Mi(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${U(e,t)}"`);let i=G(e,t);if(Mn(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(B(i)&&W(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Ni(e,t),Di(e,a,t,o),Pi(e,a),gi(e,a),`handled`}function Ni(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=G(e,t.nodeId);if(t.visitedChildren||!B(i)){B(i)&&e.snapshot.directories.delete(t.nodeId),Pn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Ir(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=W(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function Pi(e,t){let n=t;for(;n!=null;){let t=G(e,n);if(!B(t)||V(t,2)||W(e,n).childIds.length>0)return;Pn(t,1),n=t.parentId===n?null:t.parentId}}function Fi(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=gn(e.snapshot.nodes,W(e,n)).get(t);if(i==null||!B(G(e,i)))break;n=i}return n}function Ii(e,t){let n=zi(e,t);if(n==null)return null;let r=ci(e,n),i=G(e,r),a=n===r?null:li(e,n).map(t=>U(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:W(e,r).childIds.length>0,path:U(e,r),terminalKind:Mn(i)})}function Li(e,t){return Ri([e],[t])}function Ri(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function zi(e,t){let n=t;for(;n!=null;){let t=G(e,n);if(!B(t)||V(t,2))return null;if(!Dr(e,n,t))return n;n=t.parentId}return null}function Bi(e,t){let n=G(e,t);if(Fn(n,(t===e.snapshot.rootId?-1:jn(G(e,n.parentId)))+1),!B(n))return;let r=W(e,t);for(let t of r.childIds)Bi(e,t)}function Vi(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=G(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Hi(e,t,n=G(e,t),r=!1){let i=e.instrumentation;if(i==null){Wi(e,t,n,r);return}H(i,`store.recomputeNodeCounts`,()=>Wi(e,t,n,r))}function Ui(e,t){let n=t;for(;n!=null;){let t=G(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Hi(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&xn(W(e,s),n,a,o),n=s}}function Wi(e,t,n,r){if(!B(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=W(e,t);if(r){let t=e.instrumentation;t==null?bn(e.snapshot.nodes,i):H(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>bn(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,V(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=si(e,t)==null?Dr(e,t,n)?1+o:1:o}function Gi(e,t,n){let r=U(e,t);return r.length===0?n:`${r}${n}`}function Ki(e){return e!=null&&!V(e,4)}function qi(e,t){let n=e.snapshot.nodes[t];return!Ki(n)||!B(n)||V(n,2)?null:n}function Ji(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Ki(e.snapshot.nodes[n])&&(t+=1);return t}function Yi(e){return Math.max(0,e.valueById.length-1)}function Xi(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Ji(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Yi(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Zi(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Qi(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)qi(e,n)!=null&&t.push(U(e,n));for(let t of e.expandedDirectoryIds)qi(e,t)!=null&&n.push(U(e,t));return{collapsedPaths:t,expandedPaths:n}}function $i(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)qi(e,n)==null||Ar(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:U(e,n)});return t}function ea(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=yi(e,n);t!=null&&Or(e,t,!0,G(e,t))}for(let n of t.collapsedPaths){let t=yi(e,n);t!=null&&Or(e,t,!1,G(e,t))}}function ta(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=yi(e,n.path);t!=null&&qi(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function na(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function ra(e){let t=e.snapshot.segmentTable,n=rr();for(let r of e.snapshot.nodes)if(Ki(r)){if(V(r,2)){r.nameId=0;continue}r.nameId=ir(n,ar(t,r.nameId))}e.snapshot.segmentTable=n}function ia(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Ki(r)||!B(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Ki(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[G(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),bn(e.snapshot.nodes,n)}}function aa(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Ki(n))break;--t}e.snapshot.nodes.length=t+1}function oa(e){let t=Qi(e),n=$i(e);H(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>na(e)),H(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>ra(e)),H(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ia(e)),H(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>aa(e)),H(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>ea(e,t)),H(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>ta(e,n)),H(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>_i(e,e.snapshot.rootId))}function sa(e){let t=Qi(e),n=$i(e),r=H(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>ui(e)),i=Ln({...e.snapshot.options},e.instrumentation),a=H(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Sr(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,H(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>ea(e,t)),H(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>ta(e,n)),H(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>_i(e,e.snapshot.rootId))}function ca(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function la(e,t){let n=Xi(e);t===`stable`?H(e.instrumentation,`store.cleanup.stable`,()=>oa(e)):H(e.instrumentation,`store.cleanup.aggressive`,()=>sa(e));let r=Xi(e);return Zi(t,t===`stable`,n,r)}var ua=64;function da(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function fa(e){return G(e,e.snapshot.rootId).visibleSubtreeCount}function pa(e,t,n,r){let i=G(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function ma(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Na(e,t.cursor),setSize:t.setSize,subtreeEndIndex:pa(e,t.cursor,t.index,n)}}function ha(e,t,n,r,i,a){let o=W(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Sn(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return ga(e,u,l,r+c,i+1,s,o.childIds.length,a)}function ga(e,t,n,r,i,a,o,s){if(!B(G(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=Da(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=G(e,c.terminalNodeId);if(!B(l)||!Dr(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return ha(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function _a(e,t){let n=fa(e);if(t<0||t>=n)return null;let r=ha(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>U(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=ma(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Na(e,r.cursor),setSize:r.setSize,subtreeEndIndex:pa(e,r.cursor,r.index,n)}}function va(e,t,n){let r=e.instrumentation,i=fa(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return Ma(e,o+1);let t=[],n=wa(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Na(e,n);t.push(r),n=ka(e,n)}return t}let s=[],c=0,l=0,u=H(r,`store.getVisibleSlice.selectFirstRow`,()=>wa(e,a));for(let t=a;t<=o&&u!=null;t++){let t=H(r,`store.getVisibleSlice.materializeRow`,()=>Na(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=H(r,`store.getVisibleSlice.advanceCursor`,()=>ka(e,u))}return zn(r,`workload.visibleRowsRead`,s.length),zn(r,`workload.flattenedRowsRead`,c),zn(r,`workload.flattenedSegmentsRead`,l),s}function ya(e,t=fa(e)){let n=e.instrumentation;return n==null?ja(e,t):H(n,`store.getVisibleTreeProjection`,()=>ja(e,t))}function ba(e){return Aa(ya(e))}function xa(e,t){let n=yi(e,t);if(n==null||n===e.snapshot.rootId||B(G(e,n))&&ci(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=G(e,i).parentId,n=W(e,t),s=_n(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Cn(a,n,s),t!==o){let n=G(e,t),a=si(e,t);if(!Dr(e,t,n)&&a!==i)return null;ci(e,t)===t&&(r+=1)}i=t}return r}function Sa(e,t){let n=yi(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=G(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return Dr(e,n,r)?null:(Or(e,n,!0,r),gi(e,n),Vr({affectedAncestorIds:vi(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Ca(e,t){let n=yi(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=G(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return Dr(e,n,r)?(Or(e,n,!1,r),gi(e,n),Hr({affectedAncestorIds:vi(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function wa(e,t){return t<0||t>=fa(e)?null:Ta(e,e.snapshot.rootId,t,-1)}function Ta(e,t,n,r){let i=W(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Sn(e.snapshot.nodes,i,n):H(a,`store.getVisibleSlice.selectChildIndex`,()=>Sn(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return Ea(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function Ea(e,t,n,r){if(!B(G(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=Da(e,t,r);if(n===0)return i;let a=G(e,i.terminalNodeId);if(!B(a)||!Dr(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Ta(e,i.terminalNodeId,n-1,i.visibleDepth)}function Da(e,t,n){return B(G(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:ci(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:H(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>ci(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function Oa(e,t){let n=G(e,t);if(!B(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:si(e,r)!==t}function ka(e,t){let n=G(e,t.terminalNodeId);if(B(n)){let r=W(e,t.terminalNodeId);if(Dr(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:Ea(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=G(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=W(e,n),o=_n(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return Ea(e,s,0,i);Oa(e,r)&&i--,r=n}}function Aa(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function ja(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(ua);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=da(o,y);let x,S=_;if(B(v))S=f?ci(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:U(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&B(C)&&Dr(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function Ma(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!B(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:U(e,f)};continue}let h=l?ci(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Na(e,g);let _=i[h];_!=null&&B(_)&&Dr(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Na(e,t){let n=G(e,t.terminalNodeId),r=B(n)?Pa(e,t):null,i=U(e,t.terminalNodeId),a=ar(e.snapshot.segmentTable,n.nameId),o=B(n)&&W(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?li(e,t.headNodeId).map(n=>{let r=G(e,n);return{isTerminal:n===t.terminalNodeId,name:ar(e.snapshot.segmentTable,r.nameId),nodeId:n,path:U(e,n)}}):H(c,`store.getVisibleSlice.flatten.collectSegments`,()=>li(e,t.headNodeId).map(n=>{let r=G(e,n);return{isTerminal:n===t.terminalNodeId,name:ar(e.snapshot.segmentTable,r.nameId),nodeId:n,path:U(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:B(n)&&Dr(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:B(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function Pa(e,t){if(t.headNodeId===t.terminalNodeId)return Ar(e,t.terminalNodeId);let n=li(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Ar(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function Fa(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!B(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&wn(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&B(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,wn(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Ia(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var La=class e{#e;constructor(e={}){let t=Rn(e),n=H(t,`store.builder.create`,()=>new Sr(e));if(e.preparedInput!=null){let t=yr(e.preparedInput);t==null?n.appendPreparedPaths(vr(e.preparedInput),!1):n.appendPresortedPaths(t,br(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(H(t,`store.preparePathEntries`,()=>xr(r,e)))}let r=H(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=H(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=H(t,`store.state.create`,()=>Cr(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:H(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Ia(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&H(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?H(t,`store.state.initializeOpenVisibleCounts`,()=>Fa(this.#e)):H(t,`store.state.recomputeCounts`,()=>_i(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return hr(e,t)}static prepareInput(e,t={}){return gr(e,t)}static preparePresortedInput(e){return _r(e)}list(e){return H(this.#e.instrumentation,`store.list`,()=>ui(this.#e,e))}add(e){H(this.#e.instrumentation,`store.add`,()=>{let t=fa(this.#e);Zr(this.#e,Yr(this.#e,t,di(this.#e,e)))})}remove(e,t={}){H(this.#e.instrumentation,`store.remove`,()=>{let n=fa(this.#e);Zr(this.#e,Yr(this.#e,n,fi(this.#e,e,t)))})}move(e,t,n={}){H(this.#e.instrumentation,`store.move`,()=>{let r=fa(this.#e),i=pi(this.#e,e,t,n);i!=null&&Zr(this.#e,Yr(this.#e,r,i))})}batch(e){Xr(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return H(this.#e.instrumentation,`store.getVisibleCount`,()=>fa(this.#e))}getVisibleSlice(e,t){return H(this.#e.instrumentation,`store.getVisibleSlice`,()=>va(this.#e,e,t))}getVisibleRowContext(e){return H(this.#e.instrumentation,`store.getVisibleRowContext`,()=>_a(this.#e,e))}getVisibleTreeProjection(){return ba(this.#e)}getVisibleTreeProjectionData(e){return ya(this.#e,e)}getVisibleIndex(e){return H(this.#e.instrumentation,`store.getVisibleIndex`,()=>xa(this.#e,e))}getPathInfo(e){return H(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=yi(this.#e,e);if(t==null)return null;let n=G(this.#e,t);return{depth:jn(n),kind:B(n)?`directory`:`file`,path:U(this.#e,t)}})}isExpanded(e){return H(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=G(this.#e,t);return Dr(this.#e,t,n)})}expand(e){H(this.#e.instrumentation,`store.expand`,()=>{let t=fa(this.#e),n=Sa(this.#e,e);n!=null&&Zr(this.#e,Yr(this.#e,t,n))})}collapse(e){H(this.#e.instrumentation,`store.collapse`,()=>{let t=fa(this.#e),n=Ca(this.#e,e);n!=null&&Zr(this.#e,Yr(this.#e,t,n))})}on(e,t){return Lr(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Ar(this.#e,t)}markDirectoryUnloaded(e){H(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(W(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=fa(this.#e);Mr(this.#e,t),Zr(this.#e,Yr(this.#e,n,Ur({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return H(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=fa(this.#e),r=jr(this.#e,t);return Zr(this.#e,Yr(this.#e,n,Wr({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return H(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Ar(this.#e,n)!==`loading`||!Pr(this.#e,n,e.attemptId))return!1;let r=U(this.#e,n);this.validateChildPatch(r,t);let i=fa(this.#e),a=[];for(let e of t.operations){Ra(r,e);let t=fa(this.#e);switch(e.type){case`add`:a.push(Yr(this.#e,t,di(this.#e,e.path)));break;case`remove`:a.push(Yr(this.#e,t,fi(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=pi(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Yr(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Zr(this.#e,Yr(this.#e,i,Gr({affectedAncestorIds:vi(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:U(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return H(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=fa(this.#e),r=Nr(this.#e,t,e.attemptId);return Zr(this.#e,Yr(this.#e,n,Kr({affectedAncestorIds:vi(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:U(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return H(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=fa(this.#e),i=Fr(this.#e,n,e.attemptId,t);return Zr(this.#e,Yr(this.#e,r,qr({affectedAncestorIds:vi(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:U(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return H(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(ca(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=fa(this.#e),n=la(this.#e,e.mode??`stable`);return Zr(this.#e,Yr(this.#e,t,Jr({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=W(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Hn(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=Wn(Zn(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!B(G(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=G(this.#e,n);Dr(this.#e,n,i)||(Or(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=G(this.#e,e);if(!Dr(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=yi(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!B(G(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!B(G(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=G(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=G(this.#e,e),r=si(this.#e,e);if(!Dr(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function Ra(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var za={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Ba(e,t){if(typeof e==`number`)return{itemHeight:t??za.default.itemHeight,factor:e};let n=za[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Va=za.default.itemHeight,Ha=`@layer base, theme, unsafe;
2
2
 
3
3
  @layer base {
4
4
  :host {
@@ -1 +1 @@
1
- import{Al as e,C as t,Ca as n,Ds as r,E as i,Fa as a,Jl as o,Kd as s,Kl as c,Ls as l,Nn as u,Ns as d,O as f,On as p,Ta as m,Tn as h,Yd as g,_c as _,_o as v,bn as y,d as b,ds as x,dt as S,et as C,hs as w,js as T,k as E,kd as D,ks as O,qa as k,to as A,w as j,wn as M,xo as N,xt as P}from"./textarea-DPgV-teI.js";import{$n as F,Ar as I,Bn as L,Dr as R,Fn as z,Gn as B,Hn as V,Jn as H,Kn as U,Ln as W,Qn as G,Rn as K,Un as q,Vn as J,Wn as ee,Xn as te,Yn as ne,Zn as Y,_n as re,_r as ie,a as ae,br as oe,c as se,cn as ce,fr as le,gn as ue,gr as de,hn as fe,i as pe,kr as me,l as X,mn as he,n as ge,o as _e,p as ve,r as ye,s as be,sn as xe,t as Se,u as Ce,vn as we,wr as Te,xr as Ee,yr as De,zn as Oe}from"./index-D0fBCQfu.js";var ke=A(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ae=A(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),je=A(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Me=A(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Ne=()=>`Refresh`,Pe=()=>`Atualizar`,Fe=()=>`Actualizar`,Ie=()=>`Actualiser`,Le=()=>`Aggiorna`,Re=()=>`更新`,ze=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Pe(e):n===`es`?Fe(e):n===`fr`?Ie(e):n===`it`?Le(e):n===`ja`?Re(e):Ne(e)},Be=()=>`Search or enter URL`,Ve=()=>`Pesquisar ou inserir URL`,He=()=>`Buscar o introducir URL`,Ue=()=>`Rechercher ou saisir une URL`,We=()=>`Cerca o inserisci URL`,Ge=()=>`検索または URL を入力`,Ke=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ve(e):n===`es`?He(e):n===`fr`?Ue(e):n===`it`?We(e):n===`ja`?Ge(e):Be(e)},qe=()=>`Annotate preview`,Je=()=>`Anotar visualização`,Ye=()=>`Anotar vista previa`,Xe=()=>`Annoter l’aperçu`,Ze=()=>`Annota anteprima`,Qe=()=>`プレビューに注釈`,$e=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Je(e):n===`es`?Ye(e):n===`fr`?Xe(e):n===`it`?Ze(e):n===`ja`?Qe(e):qe(e)},et=()=>`Back`,tt=()=>`Voltar`,nt=()=>`Atrás`,rt=()=>`Retour`,it=()=>`Indietro`,at=()=>`戻る`,ot=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?tt(e):n===`es`?nt(e):n===`fr`?rt(e):n===`it`?it(e):n===`ja`?at(e):et(e)},st=()=>`Cancel annotation`,ct=()=>`Cancelar anotação`,lt=()=>`Cancelar anotación`,ut=()=>`Annuler l’annotation`,dt=()=>`Annulla annotazione`,ft=()=>`注釈をキャンセル`,pt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ct(e):n===`es`?lt(e):n===`fr`?ut(e):n===`it`?dt(e):n===`ja`?ft(e):st(e)},mt=()=>`Capture screenshot`,ht=()=>`Capturar tela`,gt=()=>`Capturar pantalla`,_t=()=>`Capturer l’écran`,vt=()=>`Cattura schermata`,yt=()=>`スクリーンショットを撮影`,bt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ht(e):n===`es`?gt(e):n===`fr`?_t(e):n===`it`?vt(e):n===`ja`?yt(e):mt(e)},xt=()=>`Checking your connection`,St=()=>`Verificar sua conexão`,Ct=()=>`Comprobar tu conexión`,wt=()=>`Vérifier votre connexion`,Tt=()=>`Verificare la connessione`,Et=()=>`接続を確認する`,Dt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?St(e):n===`es`?Ct(e):n===`fr`?wt(e):n===`it`?Tt(e):n===`ja`?Et(e):xt(e)},Ot=()=>`Checking the proxy and the firewall`,kt=()=>`Verificar o proxy e o firewall`,At=()=>`Comprobar el proxy y el firewall`,jt=()=>`Vérifier le proxy et le pare-feu`,Mt=()=>`Verificare proxy e firewall`,Nt=()=>`プロキシとファイアウォールを確認する`,Pt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?kt(e):n===`es`?At(e):n===`fr`?jt(e):n===`it`?Mt(e):n===`ja`?Nt(e):Ot(e)},Ft=()=>`Clear cache`,It=()=>`Limpar cache`,Lt=()=>`Borrar caché`,Rt=()=>`Vider le cache`,zt=()=>`Svuota cache`,Bt=()=>`キャッシュを消去`,Vt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?It(e):n===`es`?Lt(e):n===`fr`?Rt(e):n===`it`?zt(e):n===`ja`?Bt(e):Ft(e)},Ht=()=>`Clear cookies`,Ut=()=>`Limpar cookies`,Wt=()=>`Borrar cookies`,Gt=()=>`Effacer les cookies`,Kt=()=>`Cancella cookie`,qt=()=>`Cookie を消去`,Jt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ut(e):n===`es`?Wt(e):n===`fr`?Gt(e):n===`it`?Kt(e):n===`ja`?qt(e):Ht(e)},Yt=()=>`Collaborative browser preview`,Xt=()=>`Visualização colaborativa do navegador`,Zt=()=>`Vista previa colaborativa del navegador`,Qt=()=>`Aperçu collaboratif du navigateur`,$t=()=>`Anteprima collaborativa del browser`,en=()=>`共同ブラウザープレビュー`,tn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Xt(e):n===`es`?Zt(e):n===`fr`?Qt(e):n===`it`?$t(e):n===`ja`?en(e):Yt(e)},nn=()=>`Confirming the dev server is running`,rn=()=>`Confirmar se o servidor de desenvolvimento está em execução`,an=()=>`Confirmar que el servidor de desarrollo está activo`,on=()=>`Confirmer que le serveur de développement fonctionne`,sn=()=>`Confermare che il server di sviluppo sia attivo`,cn=()=>`開発サーバーが実行中か確認する`,ln=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?rn(e):n===`es`?an(e):n===`fr`?on(e):n===`it`?sn(e):n===`ja`?cn(e):nn(e)},un=()=>`Connecting to server browser…`,dn=()=>`Conectando ao navegador do servidor…`,fn=()=>`Conectando al navegador del servidor…`,pn=()=>`Connexion au navigateur du serveur…`,mn=()=>`Connessione al browser del server…`,hn=()=>`サーバーブラウザーに接続中…`,gn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?dn(e):n===`es`?fn(e):n===`fr`?pn(e):n===`it`?mn(e):n===`ja`?hn(e):un(e)},_n=()=>`Details`,vn=()=>`Detalhes`,yn=()=>`Detalles`,bn=()=>`Détails`,xn=()=>`Dettagli`,Sn=()=>`詳細`,Cn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?vn(e):n===`es`?yn(e):n===`fr`?bn(e):n===`it`?xn(e):n===`ja`?Sn(e):_n(e)},wn=()=>`Type a URL above, or run a dev script. Listening localhost ports will show up here automatically.`,Tn=()=>`Digite uma URL acima ou execute um script de desenvolvimento. Portas localhost em escuta aparecerão aqui automaticamente.`,En=()=>`Escribe una URL arriba o ejecuta un script de desarrollo. Los puertos localhost en escucha aparecerán aquí automáticamente.`,Dn=()=>`Saisissez une URL ci-dessus ou lancez un script de développement. Les ports localhost à l’écoute apparaîtront automatiquement ici.`,On=()=>`Digita un URL sopra o esegui uno script di sviluppo. Le porte localhost in ascolto appariranno qui automaticamente.`,kn=()=>`上に URL を入力するか、開発スクリプトを実行してください。待受中の localhost ポートが自動的に表示されます。`,An=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Tn(e):n===`es`?En(e):n===`fr`?Dn(e):n===`it`?On(e):n===`ja`?kn(e):wn(e)},jn=()=>`Forward`,Mn=()=>`Avançar`,Nn=()=>`Adelante`,Pn=()=>`Suivant`,Fn=()=>`Avanti`,In=()=>`進む`,Ln=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Mn(e):n===`es`?Nn(e):n===`fr`?Pn(e):n===`it`?Fn(e):n===`ja`?In(e):jn(e)},Rn=()=>`Hard reload`,zn=()=>`Recarregar completamente`,Bn=()=>`Recarga completa`,Vn=()=>`Rechargement forcé`,Hn=()=>`Ricaricamento completo`,Un=()=>`強制再読み込み`,Wn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?zn(e):n===`es`?Bn(e):n===`fr`?Vn(e):n===`it`?Hn(e):n===`ja`?Un(e):Rn(e)},Gn=()=>`Hide details`,Kn=()=>`Ocultar detalhes`,qn=()=>`Ocultar detalles`,Jn=()=>`Masquer les détails`,Yn=()=>`Nascondi dettagli`,Xn=()=>`詳細を非表示`,Zn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Kn(e):n===`es`?qn(e):n===`fr`?Jn(e):n===`it`?Yn(e):n===`ja`?Xn(e):Gn(e)},Qn=()=>`Hide device toolbar`,$n=()=>`Ocultar barra do dispositivo`,er=()=>`Ocultar barra del dispositivo`,tr=()=>`Masquer la barre d’appareil`,nr=()=>`Nascondi barra dispositivo`,rr=()=>`デバイスツールバーを非表示`,ir=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?$n(e):n===`es`?er(e):n===`fr`?tr(e):n===`it`?nr(e):n===`ja`?rr(e):Qn(e)},ar=()=>`Listening`,or=()=>`Escutando`,sr=()=>`Escuchando`,cr=()=>`À l’écoute`,lr=()=>`In ascolto`,ur=()=>`待受中`,dr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?or(e):n===`es`?sr(e):n===`fr`?cr(e):n===`it`?lr(e):n===`ja`?ur(e):ar(e)},fr=()=>`Loading…`,pr=()=>`Carregando…`,mr=()=>`Cargando…`,hr=()=>`Chargement…`,gr=()=>`Caricamento…`,_r=()=>`読み込み中…`,vr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?pr(e):n===`es`?mr(e):n===`fr`?hr(e):n===`it`?gr(e):n===`ja`?_r(e):fr(e)},yr=()=>`Local servers`,br=()=>`Servidores locais`,xr=()=>`Servidores locales`,Sr=()=>`Serveurs locaux`,Cr=()=>`Server locali`,wr=()=>`ローカルサーバー`,Tr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?br(e):n===`es`?xr(e):n===`fr`?Sr(e):n===`it`?Cr(e):n===`ja`?wr(e):yr(e)},Er=()=>`Preview menu`,Dr=()=>`Menu da visualização`,Or=()=>`Menú de vista previa`,kr=()=>`Menu de l’aperçu`,Ar=()=>`Menu anteprima`,jr=()=>`プレビューメニュー`,Mr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Dr(e):n===`es`?Or(e):n===`fr`?kr(e):n===`it`?Ar(e):n===`ja`?jr(e):Er(e)},Nr=()=>`More`,Pr=()=>`Mais`,Fr=()=>`Más`,Ir=()=>`Plus`,Lr=()=>`Altro`,Rr=()=>`その他`,zr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Pr(e):n===`es`?Fr(e):n===`fr`?Ir(e):n===`it`?Lr(e):n===`ja`?Rr(e):Nr(e)},Br=()=>`Navigation`,Vr=()=>`Navegação`,Hr=()=>`Navegación`,Ur=()=>`Navigation`,Wr=()=>`Navigazione`,Gr=()=>`ナビゲーション`,Kr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Vr(e):n===`es`?Hr(e):n===`fr`?Ur(e):n===`it`?Wr(e):n===`ja`?Gr(e):Br(e)},qr=()=>`No preview yet`,Jr=()=>`Nenhuma visualização ainda`,Yr=()=>`Aún no hay vista previa`,Xr=()=>`Aucun aperçu pour le moment`,Zr=()=>`Nessuna anteprima`,Qr=()=>`まだプレビューはありません`,$r=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Jr(e):n===`es`?Yr(e):n===`fr`?Xr(e):n===`it`?Zr(e):n===`ja`?Qr(e):qr(e)},ei=()=>`Not currently listening`,ti=()=>`Não está escutando`,ni=()=>`No está escuchando`,ri=()=>`Pas à l’écoute actuellement`,ii=()=>`Non in ascolto`,ai=()=>`現在待受中ではありません`,oi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ti(e):n===`es`?ni(e):n===`fr`?ri(e):n===`it`?ii(e):n===`ja`?ai(e):ei(e)},si=()=>`Open DevTools`,ci=()=>`Abrir DevTools`,li=()=>`Abrir DevTools`,ui=()=>`Ouvrir les outils de développement`,di=()=>`Apri DevTools`,fi=()=>`DevTools を開く`,pi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ci(e):n===`es`?li(e):n===`fr`?ui(e):n===`it`?di(e):n===`ja`?fi(e):si(e)},mi=()=>`Recently seen`,hi=()=>`Visto recentemente`,gi=()=>`Visto recientemente`,_i=()=>`Vu récemment`,vi=()=>`Visto di recente`,yi=()=>`最近確認`,bi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?hi(e):n===`es`?gi(e):n===`fr`?_i(e):n===`it`?vi(e):n===`ja`?yi(e):mi(e)},xi=()=>`Reload`,Si=()=>`Recarregar`,Ci=()=>`Recargar`,wi=()=>`Recharger`,Ti=()=>`Ricarica`,Ei=()=>`再読み込み`,Di=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Si(e):n===`es`?Ci(e):n===`fr`?wi(e):n===`it`?Ti(e):n===`ja`?Ei(e):xi(e)},Oi=()=>`Reset zoom`,ki=()=>`Redefinir zoom`,Ai=()=>`Restablecer zoom`,ji=()=>`Réinitialiser le zoom`,Mi=()=>`Reimposta zoom`,Ni=()=>`ズームをリセット`,Pi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ki(e):n===`es`?Ai(e):n===`fr`?ji(e):n===`it`?Mi(e):n===`ja`?Ni(e):Oi(e)},Fi=()=>`Collaborative preview is unavailable in this client runtime.`,Ii=()=>`A prévia colaborativa não está disponível neste runtime de cliente.`,Li=()=>`La vista previa colaborativa no está disponible en este runtime de cliente.`,Ri=()=>`L’aperçu collaboratif n’est pas disponible dans cet environnement client.`,zi=()=>`L’anteprima collaborativa non è disponibile in questo runtime client.`,Bi=()=>`このクライアントランタイムでは共同プレビューを利用できません。`,Vi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ii(e):n===`es`?Li(e):n===`fr`?Ri(e):n===`it`?zi(e):n===`ja`?Bi(e):Fi(e)},Hi=()=>`Select a listening port to open it in this browser tab.`,Ui=()=>`Selecione uma porta em escuta para abri-la nesta aba do navegador.`,Wi=()=>`Selecciona un puerto en escucha para abrirlo en esta pestaña.`,Gi=()=>`Sélectionnez un port à l’écoute pour l’ouvrir dans cet onglet.`,Ki=()=>`Seleziona una porta in ascolto per aprirla in questa scheda.`,qi=()=>`待受中のポートを選択して、このブラウザータブで開きます。`,Ji=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ui(e):n===`es`?Wi(e):n===`fr`?Gi(e):n===`it`?Ki(e):n===`ja`?qi(e):Hi(e)},Yi=()=>`Show device toolbar`,Xi=()=>`Mostrar barra do dispositivo`,Zi=()=>`Mostrar barra del dispositivo`,Qi=()=>`Afficher la barre d’appareil`,$i=()=>`Mostra barra dispositivo`,ea=()=>`デバイスツールバーを表示`,ta=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Xi(e):n===`es`?Zi(e):n===`fr`?Qi(e):n===`it`?$i(e):n===`ja`?ea(e):Yi(e)},na=()=>`Stop`,ra=()=>`Parar`,ia=()=>`Detener`,aa=()=>`Arrêter`,oa=()=>`Interrompi`,sa=()=>`停止`,ca=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ra(e):n===`es`?ia(e):n===`fr`?aa(e):n===`it`?oa(e):n===`ja`?sa(e):na(e)},la=()=>`Stop recording`,ua=()=>`Parar gravação`,da=()=>`Detener grabación`,fa=()=>`Arrêter l’enregistrement`,pa=()=>`Interrompi registrazione`,ma=()=>`記録を停止`,ha=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ua(e):n===`es`?da(e):n===`fr`?fa(e):n===`it`?pa(e):n===`ja`?ma(e):la(e)},ga=()=>`Try:`,_a=()=>`Tente:`,va=()=>`Prueba:`,ya=()=>`Essayez :`,ba=()=>`Prova:`,xa=()=>`確認事項:`,Sa=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?_a(e):n===`es`?va(e):n===`fr`?ya(e):n===`it`?ba(e):n===`ja`?xa(e):ga(e)},Ca=()=>`This site can’t be reached`,wa=()=>`Não foi possível acessar este site`,Ta=()=>`No se puede acceder a este sitio`,Ea=()=>`Ce site est inaccessible`,Da=()=>`Impossibile raggiungere il sito`,Oa=()=>`このサイトにアクセスできません`,ka=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?wa(e):n===`es`?Ta(e):n===`fr`?Ea(e):n===`it`?Da(e):n===`ja`?Oa(e):Ca(e)},Aa=()=>`Zoom`,ja=()=>`Zoom`,Ma=()=>`Zoom`,Na=()=>`Zoom`,Pa=()=>`Zoom`,Fa=()=>`ズーム`,Ia=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ja(e):n===`es`?Ma(e):n===`fr`?Na(e):n===`it`?Pa(e):n===`ja`?Fa(e):Aa(e)},La=()=>`Zoom in`,Ra=()=>`Aumentar zoom`,za=()=>`Acercar`,Ba=()=>`Zoomer`,Va=()=>`Aumenta zoom`,Ha=()=>`拡大`,Ua=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ra(e):n===`es`?za(e):n===`fr`?Ba(e):n===`it`?Va(e):n===`ja`?Ha(e):La(e)},Wa=()=>`Zoom out`,Ga=()=>`Reduzir zoom`,Ka=()=>`Alejar`,qa=()=>`Dézoomer`,Ja=()=>`Riduci zoom`,Ya=()=>`縮小`,Xa=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ga(e):n===`es`?Ka(e):n===`fr`?qa(e):n===`it`?Ja(e):n===`ja`?Ya(e):Wa(e)},Z=g(s(),1),Q=e(),$=D();function Za(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=m(`relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{className:i,"data-slot":`input-group`,role:`group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Qa=a(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function $a(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=m(Qa({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,$.jsx)(`div`,{className:o,"data-align":a,"data-slot":`input-group-addon`,onMouseDown:eo,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function eo(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function to(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(z,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var no=()=>{};function ro(e){let r=(0,Q.c)(101),{url:a,displayUrl:o,loading:s,loadProgress:c,canGoBack:l,canGoForward:u,refreshDisabled:d,inputDisabled:f,focusUrlNonce:p,onBack:h,onForward:g,onRefresh:_,onSubmit:v,onOpenInBrowser:y,onCapture:b,captureDisabled:x,recording:S,onPickElement:C,pickActive:w,pickDisabled:T,pickDisabledReason:E,trailingActions:D}=e,O=(0,Z.useRef)(null),[k,A]=(0,Z.useState)(a),[M,N]=(0,Z.useState)(!1),P,F;r[0]===p?(P=r[1],F=r[2]):(P=()=>{if(p==null)return;let e=O.current;e&&e.focus()},F=[p],r[0]=p,r[1]=P,r[2]=F),(0,Z.useEffect)(P,F);let L;r[3]!==k||r[4]!==v?(L=e=>{e?.preventDefault();let t=k.trim();t.length!==0&&(v(t),O.current?.blur())},r[3]=k,r[4]=v,r[5]=L):L=r[5];let z=L,B;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(B=Kr(),r[6]=B):B=r[6];let V=l?h:no,H=!l,U;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(U=ot(),r[7]=U):U=r[7];let W;r[8]!==V||r[9]!==H?(W=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:V,disabled:H,"aria-label":U,type:`button`}),r[8]=V,r[9]=H,r[10]=W):W=r[10];let G;r[11]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(I,{}),r[11]=G):G=r[11];let K;r[12]===W?K=r[13]:(K=(0,$.jsx)(i,{render:W,children:G}),r[12]=W,r[13]=K);let q;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(j,{children:ot()}),r[14]=q):q=r[14];let J;r[15]===K?J=r[16]:(J=(0,$.jsxs)(t,{children:[K,q]}),r[15]=K,r[16]=J);let ee=u?g:no,te=!u,ne;r[17]===Symbol.for(`react.memo_cache_sentinel`)?(ne=Ln(),r[17]=ne):ne=r[17];let Y;r[18]!==ee||r[19]!==te?(Y=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:ee,disabled:te,"aria-label":ne,type:`button`}),r[18]=ee,r[19]=te,r[20]=Y):Y=r[20];let re;r[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(me,{}),r[21]=re):re=r[21];let ie;r[22]===Y?ie=r[23]:(ie=(0,$.jsx)(i,{render:Y,children:re}),r[22]=Y,r[23]=ie);let ae;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(j,{children:Ln()}),r[24]=ae):ae=r[24];let se;r[25]===ie?se=r[26]:(se=(0,$.jsxs)(t,{children:[ie,ae]}),r[25]=ie,r[26]=se);let ce=d?no:_,ue;r[27]===s?ue=r[28]:(ue=s?ca():ze(),r[27]=s,r[28]=ue);let fe;r[29]!==d||r[30]!==ce||r[31]!==ue?(fe=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:d,"aria-label":ue,type:`button`}),r[29]=d,r[30]=ce,r[31]=ue,r[32]=fe):fe=r[32];let pe=s&&`animate-spin`,X;r[33]===pe?X=r[34]:(X=m(pe),r[33]=pe,r[34]=X);let he;r[35]===X?he=r[36]:(he=(0,$.jsx)(de,{className:X}),r[35]=X,r[36]=he);let ge;r[37]!==fe||r[38]!==he?(ge=(0,$.jsx)(i,{render:fe,children:he}),r[37]=fe,r[38]=he,r[39]=ge):ge=r[39];let _e;r[40]===s?_e=r[41]:(_e=s?vr():ze(),r[40]=s,r[41]=_e);let ve;r[42]===_e?ve=r[43]:(ve=(0,$.jsx)(j,{children:_e}),r[42]=_e,r[43]=ve);let ye;r[44]!==ge||r[45]!==ve?(ye=(0,$.jsxs)(t,{children:[ge,ve]}),r[44]=ge,r[45]=ve,r[46]=ye):ye=r[46];let be;r[47]!==J||r[48]!==se||r[49]!==ye?(be=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":B,children:[J,se,ye]}),r[47]=J,r[48]=se,r[49]=ye,r[50]=be):be=r[50];let xe=M?k:o??a,Se=y&&!M&&`group-hover/address:pe-7 transition-[padding]`,Ce;r[51]===Se?Ce=r[52]:(Ce=m(Se),r[51]=Se,r[52]=Ce);let we;r[53]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>A(e.target.value),r[53]=we):we=r[53];let Te;r[54]===a?Te=r[55]:(Te=()=>{A(a),N(!0),queueMicrotask(()=>O.current?.select())},r[54]=a,r[55]=Te);let Ee;r[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{N(!1)},r[56]=Ee):Ee=r[56];let De;r[57]!==z||r[58]!==a?(De=e=>{e.key===`Enter`&&z(e),e.key===`Escape`&&(e.preventDefault(),A(a),O.current?.blur())},r[57]=z,r[58]=a,r[59]=De):De=r[59];let Oe;r[60]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=Ke(),r[60]=Oe):Oe=r[60];let Ae;r[61]!==f||r[62]!==xe||r[63]!==Ce||r[64]!==Te||r[65]!==De?(Ae=(0,$.jsx)(i,{render:(0,$.jsx)(to,{ref:O,value:xe,className:Ce,onChange:we,onFocus:Te,onBlur:Ee,onKeyDown:De,placeholder:Oe,spellCheck:!1,disabled:f,"data-preview-url-input":!0,size:`sm`})}),r[61]=f,r[62]=xe,r[63]=Ce,r[64]=Te,r[65]=De,r[66]=Ae):Ae=r[66];let je;r[67]!==o||r[68]!==M||r[69]!==a?(je=!M&&o?(0,$.jsx)(j,{children:a}):null,r[67]=o,r[68]=M,r[69]=a,r[70]=je):je=r[70];let Me;r[71]!==Ae||r[72]!==je?(Me=(0,$.jsxs)(t,{children:[Ae,je]}),r[71]=Ae,r[72]=je,r[73]=Me):Me=r[73];let Ne;r[74]!==M||r[75]!==y?(Ne=y&&!M?(0,$.jsx)($a,{align:`inline-end`,className:`pointer-events-none absolute inset-y-0 right-0 opacity-0 transition-opacity group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsxs)(t,{children:[(0,$.jsx)(i,{render:(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:y,"aria-label":le(),type:`button`}),children:(0,$.jsx)(R,{})}),(0,$.jsx)(j,{children:le()})]})}):null,r[74]=M,r[75]=y,r[76]=Ne):Ne=r[76];let Pe;r[77]!==Me||r[78]!==Ne?(Pe=(0,$.jsxs)(Za,{className:`group/address h-7 flex-1 rounded-md border-transparent bg-transparent shadow-none before:shadow-none hover:bg-muted/40 focus-within:bg-background`,children:[Me,Ne]}),r[77]=Me,r[78]=Ne,r[79]=Pe):Pe=r[79];let Fe;r[80]!==C||r[81]!==w||r[82]!==T||r[83]!==E?(Fe=C?(0,$.jsxs)(t,{children:[(0,$.jsx)(i,{render:(0,$.jsx)(n,{variant:w?`secondary`:`ghost`,size:`icon-xs`,onClick:C,disabled:T,"aria-label":w?pt():$e(),"aria-pressed":w?`true`:`false`,type:`button`}),children:(0,$.jsx)(oe,{className:m(w&&`text-primary`)})}),(0,$.jsx)(j,{children:T&&E?E:w?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,r[80]=C,r[81]=w,r[82]=T,r[83]=E,r[84]=Fe):Fe=r[84];let Ie;r[85]!==x||r[86]!==b||r[87]!==S?(Ie=b?(0,$.jsxs)(t,{children:[(0,$.jsxs)(i,{render:(0,$.jsx)(n,{variant:S?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>b(e.shiftKey),"aria-label":S?ha():bt(),type:`button`,className:`relative`,disabled:x}),children:[(0,$.jsx)(ke,{className:m(S&&`text-destructive`)}),S?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(j,{children:S?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,r[85]=x,r[86]=b,r[87]=S,r[88]=Ie):Ie=r[88];let Le;r[89]!==z||r[90]!==be||r[91]!==Pe||r[92]!==Fe||r[93]!==Ie||r[94]!==D?(Le=(0,$.jsxs)(`form`,{onSubmit:z,className:`surface-subheader gap-1 px-2`,"data-surface-subheader":!0,children:[be,Pe,Fe,Ie,D]}),r[89]=z,r[90]=be,r[91]=Pe,r[92]=Fe,r[93]=Ie,r[94]=D,r[95]=Le):Le=r[95];let Re;r[96]===c?Re=r[97]:(Re=c>0?(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 rounded-r-full bg-primary transition-all duration-150 ease-out`,style:{width:`${c}%`,boxShadow:`0 0 6px 1px var(--color-ring)`}}):null,r[96]=c,r[97]=Re);let Be;return r[98]!==Le||r[99]!==Re?(Be=(0,$.jsxs)(`div`,{className:`relative`,children:[Le,Re]}),r[98]=Le,r[99]=Re,r[100]=Be):Be=r[100],Be}function io(e){try{let t=new URL(e.url),n=new URL(e.environmentHttpBaseUrl);if(t.origin===n.origin&&t.pathname.startsWith(`/api/assets/`)){let n=t.pathname.split(`/`).at(-1);if(!n)return null;let r=decodeURIComponent(n);return!r||r===`.`||r===`..`?null:`${e.environmentLabel} · ${r}`}return t.protocol===`http:`||t.protocol===`https:`?t.host:null}catch{return null}}function ao(e){let t=(0,Q.c)(6),{className:n}=e,r;t[0]===n?r=t[1]:(r=m(`relative flex flex-col gap-0.5 overflow-hidden rounded-[5px] border border-border/60 bg-card p-1 shadow-xs/5`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-destructive/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-warning/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-success/80`})]}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`div`,{className:`mt-[1px] flex flex-1 flex-col gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`h-[2px] w-full rounded-full bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-[2px] w-3/5 rounded-full bg-muted-foreground/20`})]}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,$.jsxs)(`div`,{"aria-hidden":!0,className:r,children:[i,a]}),t[4]=r,t[5]=o),o}function oo(e){let t=(0,Q.c)(17),{server:n,onOpen:r}=e,i;t[0]===n?i=t[1]:(i=so(n),t[0]=n,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ao,{className:`size-7 shrink-0`}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:a}),t[3]=a,t[4]=s);let c;t[5]!==n.host||t[6]!==n.port?(c=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n.host,`:`,n.port]}),t[5]=n.host,t[6]=n.port,t[7]=c):c=t[7];let l;t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u;t[11]===n.listening?u=t[12]:(u=n.listening?(0,$.jsx)(co,{}):(0,$.jsx)(lo,{}),t[11]=n.listening,t[12]=u);let d;return t[13]!==r||t[14]!==l||t[15]!==u?(d=(0,$.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex w-full items-center gap-3 px-3 py-3 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[o,l,u]}),t[13]=r,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function so(e){return e.processName?e.processName:e.listening?dr():e.source===`configured`?`Configured`:bi()}function co(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=dr(),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`span`,{"aria-label":t,className:`relative inline-flex size-2 shrink-0`,children:[(0,$.jsx)(`span`,{className:`absolute inset-0 animate-status-ping rounded-full bg-success opacity-60`}),(0,$.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-success`})]}),e[1]=n):n=e[1],n}function lo(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`span`,{"aria-label":oi(),className:`size-2 shrink-0 rounded-full bg-muted-foreground/40`}),e[0]=t):t=e[0],t}function uo(e){let t=(0,Q.c)(7),n=te(e.environmentId),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==e.recentlySeenUrls||t[3]!==n){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:H(e.environmentId,t.url)}),t[5]=e.environmentId,t[6]=i),r=fo({scanner:n.map(i),configuredUrls:e.configuredUrls??[],recentlySeenUrls:e.recentlySeenUrls??[]}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=e.recentlySeenUrls,t[3]=n,t[4]=r}else r=t[4];return r}function fo(e){let t=new Map;for(let n of e.configuredUrls){let e=mo(n);if(!e)continue;let r=po(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`configured`,listening:!1})}for(let n of e.scanner){let e=po(n.host,n.port),r=t.get(e);if(r){t.set(e,{...r,processName:n.processName??r.processName,pid:n.pid??r.pid,terminal:n.terminal??r.terminal,listening:!0});continue}t.set(e,{...n,source:`scanner`,listening:!0})}for(let n of e.recentlySeenUrls){let e=mo(n);if(!e)continue;let r=po(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`recent`,listening:!1})}return Array.from(t.values()).toSorted((e,t)=>{let n={configured:0,scanner:1,recent:2};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function po(e,t){return`${e.toLowerCase()}:${t}`}function mo(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!ne(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function ho(e){let t=(0,Q.c)(19),{environmentId:n,configuredUrls:r,recentlySeenUrls:i,onOpenUrl:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o={environmentId:n,configuredUrls:r,recentlySeenUrls:i},t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=uo(o);if(s.length===0){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ue,{variant:`icon`,children:(0,$.jsx)(Te,{className:`size-4.5 text-muted-foreground`})}),t[4]=e):e=t[4];let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(re,{children:$r()}),t[5]=n):n=t[5];let r;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(he,{children:[e,n,(0,$.jsx)(fe,{children:An()})]}),t[6]=r):r=t[6],r}let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Me,{className:`size-4 shrink-0`}),t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[c,(0,$.jsx)(`h2`,{className:`font-medium`,children:Tr()})]}),t[8]=l):l=t[8];let u;if(t[9]!==a||t[10]!==s){let e;t[12]===a?e=t[13]:(e=e=>(0,$.jsx)(oo,{server:e,onOpen:()=>a(e.url)},`${e.host}:${e.port}`),t[12]=a,t[13]=e),u=s.map(e),t[9]=a,t[10]=s,t[11]=u}else u=t[11];let d;t[14]===u?d=t[15]:(d=(0,$.jsx)(`div`,{className:`flex flex-col divide-y divide-border/60 overflow-hidden rounded-xl border border-border/70 bg-background`,children:u}),t[14]=u,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:Ji()}),t[16]=f):f=t[16];let p;return t[17]===d?p=t[18]:(p=(0,$.jsx)(`div`,{className:`flex h-full min-h-0 overflow-y-auto px-5 py-8`,children:(0,$.jsxs)(`div`,{className:`m-auto flex w-full max-w-xl flex-col gap-3`,children:[l,d,f]})}),t[17]=d,t[18]=p),p}function go(e){let r=(0,Q.c)(65),{tabId:a,hasWebContents:o,zoomFactor:s,deviceToolbarVisible:c,onToggleDeviceToolbar:l}=e;if(!X)return null;let d=!a||!o,f;r[0]===a?f=r[1]:(f=e=>()=>{a&&e(a).catch(So)},r[0]=a,r[1]=f);let m=f,g;r[2]===s?g=r[3]:(g=Math.round(s*100),r[2]=s,r[3]=g);let _=`${g}%`,v;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(i,{render:(0,$.jsx)(u,{render:(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":Mr()})}),children:(0,$.jsx)(Ae,{})}),r[4]=v):v=r[4];let b;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(t,{children:[v,(0,$.jsx)(j,{children:zr()})]}),r[5]=b):b=r[5];let x;r[6]===m?x=r[7]:(x=m(X.hardReload),r[6]=m,r[7]=x);let S;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=Wn(),r[8]=S):S=r[8];let C;r[9]!==x||r[10]!==d?(C=(0,$.jsx)(M,{onClick:x,disabled:d,children:S}),r[9]=x,r[10]=d,r[11]=C):C=r[11];let w;r[12]===m?w=r[13]:(w=m(X.openDevTools),r[12]=m,r[13]=w);let T;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=pi(),r[14]=T):T=r[14];let E;r[15]!==w||r[16]!==d?(E=(0,$.jsx)(M,{onClick:w,disabled:d,children:T}),r[15]=w,r[16]=d,r[17]=E):E=r[17];let D;r[18]===c?D=r[19]:(D=c?ir():ta(),r[18]=c,r[19]=D);let O;r[20]!==l||r[21]!==D||r[22]!==d?(O=(0,$.jsx)(M,{onClick:l,disabled:d,children:D}),r[20]=l,r[21]=D,r[22]=d,r[23]=O):O=r[23];let k;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(p,{}),r[24]=k):k=r[24];let A;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`span`,{children:Ia()}),r[25]=A):A=r[25];let N;r[26]===m?N=r[27]:(N=m(X.zoomOut),r[26]=m,r[27]=N);let P;r[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=Xa(),r[28]=P):P=r[28];let F;r[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(Ee,{}),r[29]=F):F=r[29];let I;r[30]!==N||r[31]!==d?(I=(0,$.jsx)(n,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:N,"aria-label":P,disabled:d,children:F}),r[30]=N,r[31]=d,r[32]=I):I=r[32];let L;r[33]===_?L=r[34]:(L=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:_}),r[33]=_,r[34]=L);let R;r[35]===m?R=r[36]:(R=m(X.zoomIn),r[35]=m,r[36]=R);let z;r[37]===Symbol.for(`react.memo_cache_sentinel`)?(z=Ua(),r[37]=z):z=r[37];let B;r[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(De,{}),r[38]=B):B=r[38];let V;r[39]!==R||r[40]!==d?(V=(0,$.jsx)(n,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:R,"aria-label":z,disabled:d,children:B}),r[39]=R,r[40]=d,r[41]=V):V=r[41];let H;r[42]===m?H=r[43]:(H=m(X.resetZoom),r[42]=m,r[43]=H);let U;r[44]===Symbol.for(`react.memo_cache_sentinel`)?(U=Pi(),r[44]=U):U=r[44];let W;r[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(ie,{}),r[45]=W):W=r[45];let G;r[46]!==H||r[47]!==d?(G=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:H,"aria-label":U,disabled:d,children:W}),r[46]=H,r[47]=d,r[48]=G):G=r[48];let K;r[49]!==I||r[50]!==L||r[51]!==V||r[52]!==G?(K=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[I,L,V,G]}),r[49]=I,r[50]=L,r[51]=V,r[52]=G,r[53]=K):K=r[53];let q;r[54]!==K||r[55]!==d?(q=(0,$.jsxs)(M,{closeOnClick:!1,onClick:xo,className:`justify-between`,disabled:d,children:[A,K]}),r[54]=K,r[55]=d,r[56]=q):q=r[56];let J;r[57]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(p,{}),r[57]=J):J=r[57];let ee;r[58]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(M,{onClick:yo,children:Jt()}),r[58]=ee):ee=r[58];let te;r[59]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(M,{onClick:_o,children:Vt()}),r[59]=te):te=r[59];let ne;return r[60]!==E||r[61]!==O||r[62]!==q||r[63]!==C?(ne=(0,$.jsxs)(y,{children:[b,(0,$.jsxs)(h,{align:`end`,sideOffset:6,className:`min-w-56`,children:[C,E,O,k,q,J,ee,te]})]}),r[60]=E,r[61]=O,r[62]=q,r[63]=C,r[64]=ne):ne=r[64],ne}function _o(){X.clearCache().catch(vo)}function vo(){}function yo(){X.clearCookies().catch(bo)}function bo(){}function xo(e){return e.preventDefault()}function So(){}function Co(e,t){return U[t]||(t.length>0?t:`Network error (${e})`)}function wo(e){let t=(0,Q.c)(36),{url:r,code:i,description:a,onReload:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===r?l=t[1]:(l=Do(r)??r,t[0]=r,t[1]=l);let u=l,d;t[2]!==i||t[3]!==a?(d=Co(i,a),t[2]=i,t[3]=a,t[4]=d):d=t[4];let f=d,p;t[5]!==i||t[6]!==a?(p=a.length>0?a:`ERR_${Math.abs(i)||`FAILED`}`,t[5]=i,t[6]=a,t[7]=p):p=t[7];let m=p,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Eo,{className:`mb-6 size-12 text-muted-foreground/70`}),t[8]=h):h=t[8];let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:ka()}),t[9]=g):g=t[9];let _;t[10]===u?_=t[11]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[10]=u,t[11]=_);let v;t[12]!==f||t[13]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[12]=f,t[13]=_,t[14]=v):v=t[14];let y;t[15]===s?y=t[16]:(y=s?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:Sa()}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:Dt()}),(0,$.jsx)(`li`,{children:ln()}),(0,$.jsx)(`li`,{children:Pt()})]})]}):null,t[15]=s,t[16]=y);let b;t[17]===m?b=t[18]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[17]=m,t[18]=b);let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(To),t[19]=x):x=t[19];let S;t[20]===s?S=t[21]:(S=s?Zn():Cn(),t[20]=s,t[21]=S);let C;t[22]===S?C=t[23]:(C=(0,$.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[22]=S,t[23]=C);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`div`,{className:`flex-1`}),t[24]=w):w=t[24];let T;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(T=Di(),t[25]=T):T=t[25];let E;t[26]===o?E=t[27]:(E=(0,$.jsx)(n,{type:`button`,size:`sm`,onClick:o,children:T}),t[26]=o,t[27]=E);let D;t[28]!==C||t[29]!==E?(D=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[C,w,E]}),t[28]=C,t[29]=E,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==v||t[33]!==y||t[34]!==b?(O=(0,$.jsx)(`div`,{className:`relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,D]})}),t[31]=D,t[32]=v,t[33]=y,t[34]=b,t[35]=O):O=t[35],O}function To(e){return!e}function Eo(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Do(e){try{return new URL(e).host}catch{return null}}var Oo=new Set([`Alt`,`Control`,`Meta`,`Shift`]),ko=e=>e===1?`middle`:e===2?`right`:`left`,Ao=(e,t,n,r,i=!1)=>{let a=e.getBoundingClientRect();if(a.width<=0||a.height<=0)return null;let o=Math.min(a.width/t.width,a.height/t.height),s=t.width*o,c=t.height*o,l=a.left+(a.width-s)/2,u=a.top+(a.height-c)/2;return!i&&(n<l||n>l+s||r<u||r>u+c)?null:{x:Math.min(t.width-1,Math.max(0,(n-l)/o)),y:Math.min(t.height-1,Math.max(0,(r-u)/o))}};function jo(e){let t=(0,Q.c)(58),{threadRef:n,tabId:r,viewport:i,visible:a,className:o}=e,s=(0,Z.useRef)(null),c=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={label:`collaborative preview input`,reportDefect:!1,reportFailure:!1},t[0]=d):d=t[0];let f=C(Y.humanInput,d),p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p={label:`collaborative preview presentation`,reportDefect:!1,reportFailure:!1},t[1]=p):p=t[1];let h=C(Y.present,p),g;t[2]!==r||t[3]!==n.environmentId||t[4]!==n.threadId?(g=Y.frames({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r}}),t[2]=r,t[3]=n.environmentId,t[4]=n.threadId,t[5]=g):g=t[5];let _=S(g),v;t[6]===_?v=t[7]:(v=l(_)?_.value:null,t[6]=_,t[7]=v);let y=v,b=y?`data:${y.mimeType};base64,${y.data}`:null,x;t[8]!==f||t[9]!==r||t[10]!==n.environmentId||t[11]!==n.threadId?(x=e=>{f({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r,event:e}})},t[8]=f,t[9]=r,t[10]=n.environmentId,t[11]=n.threadId,t[12]=x):x=t[12];let w=x,T,E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{u.current!==null&&cancelAnimationFrame(u.current)},E=[],t[13]=T,t[14]=E):(T=t[13],E=t[14]),(0,Z.useEffect)(T,E);let D;t[15]!==h||t[16]!==r||t[17]!==n.environmentId||t[18]!==n.threadId||t[19]!==i._tag||t[20]!==a?(D=()=>{let e=s.current;if(!e||!a||i._tag!==`fill`)return;let t=0,o=0,c=new ResizeObserver(e=>{let[i]=e;if(!i)return;let a=Math.max(1,Math.round(i.contentRect.width)),s=Math.max(1,Math.round(i.contentRect.height));a===t&&s===o||(t=a,o=s,h({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r,viewport:{width:a,height:s}}}))});return c.observe(e),()=>c.disconnect()},t[15]=h,t[16]=r,t[17]=n.environmentId,t[18]=n.threadId,t[19]=i._tag,t[20]=a,t[21]=D):D=t[21];let O;t[22]!==h||t[23]!==r||t[24]!==n||t[25]!==i._tag||t[26]!==a?(O=[h,r,n,i._tag,a],t[22]=h,t[23]=r,t[24]=n,t[25]=i._tag,t[26]=a,t[27]=O):O=t[27],(0,Z.useEffect)(D,O);let k;t[28]===y?k=t[29]:(k=(e,t)=>{let n=s.current;return n&&y?Ao(n,y,e,t):null},t[28]=y,t[29]=k);let A=k,j;t[30]!==w||t[31]!==A?(j=e=>{let t=A(e.clientX,e.clientY);t&&(c.current={_tag:`pointerMove`,...t},u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null;let e=c.current;c.current=null,e&&w(e)})))},t[30]=w,t[31]=A,t[32]=j):j=t[32];let M=j,N;t[33]!==w||t[34]!==A?(N=e=>{let t=A(e.clientX,e.clientY);t&&(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),w({_tag:`pointerDown`,...t,button:ko(e.button)}))},t[33]=w,t[34]=A,t[35]=N):N=t[35];let P=N,F;t[36]!==w||t[37]!==y||t[38]!==A?(F=e=>{let t=e.currentTarget.hasPointerCapture(e.pointerId),n=t&&y?Ao(e.currentTarget,y,e.clientX,e.clientY,!0):A(e.clientX,e.clientY);n&&(e.preventDefault(),t&&e.currentTarget.releasePointerCapture(e.pointerId),w({_tag:`pointerUp`,...n,button:ko(e.button)}))},t[36]=w,t[37]=y,t[38]=A,t[39]=F):F=t[39];let I=F,L;t[40]!==w||t[41]!==A?(L=e=>{let t=A(e.clientX,e.clientY);t&&(e.preventDefault(),w({_tag:`wheel`,...t,deltaX:e.deltaX,deltaY:e.deltaY}))},t[40]=w,t[41]=A,t[42]=L):L=t[42];let R=L,z;t[43]===w?z=t[44]:(z=e=>{if(Oo.has(e.key))return;e.preventDefault(),e.stopPropagation();let t=[];e.altKey&&t.push(`Alt`),e.ctrlKey&&t.push(`Control`),e.metaKey&&t.push(`Meta`),e.shiftKey&&t.push(`Shift`),w({_tag:`keyPress`,key:e.key===` `?`Space`:e.key,modifiers:t})},t[43]=w,t[44]=z);let B=z,V;t[45]===o?V=t[46]:(V=m(`touch-none select-none overflow-hidden bg-black outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/60`,o),t[45]=o,t[46]=V);let H;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=tn(),t[47]=H):H=t[47];let U;t[48]===b?U=t[49]:(U=b?(0,$.jsx)(`img`,{src:b,alt:``,draggable:!1,className:`pointer-events-none h-full w-full object-contain`}):(0,$.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-background text-xs text-muted-foreground`,children:gn()}),t[48]=b,t[49]=U);let W;return t[50]!==B||t[51]!==P||t[52]!==M||t[53]!==I||t[54]!==R||t[55]!==V||t[56]!==U?(W=(0,$.jsx)(`div`,{ref:s,className:V,role:`application`,"aria-label":H,tabIndex:0,onContextMenu:Mo,onKeyDown:B,onPointerDown:P,onPointerMove:M,onPointerCancel:I,onPointerUp:I,onWheel:R,children:U}),t[50]=B,t[51]=P,t[52]=M,t[53]=I,t[54]=R,t[55]=V,t[56]=U,t[57]=W):W=t[57],W}function Mo(e){return e.preventDefault()}function No(e){let t=e.toLowerCase();return t.includes(`mac`)?`Reveal in Finder`:t.includes(`win`)?`Reveal in File Explorer`:`Reveal in Files`}function Po(e){let t=(0,Q.c)(7),{tabId:n,visible:r,className:i}=e,a=(0,Z.useRef)(null),o,s;t[0]!==n||t[1]!==r?(o=()=>{let e=a.current;if(!e)return;let t=be(n),i=()=>{let n=e.getBoundingClientRect();t.present({x:Math.round(n.x),y:Math.round(n.y),width:Math.max(1,Math.round(n.width)),height:Math.max(1,Math.round(n.height))},r&&n.width>0&&n.height>0)};i();let o=new ResizeObserver(i);return o.observe(e),window.addEventListener(`resize`,i),window.addEventListener(`scroll`,i,!0),()=>{o.disconnect(),window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0),t.release()}},s=[n,r],t[0]=n,t[1]=r,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,Z.useLayoutEffect)(o,s);let c;return t[4]!==i||t[5]!==n?(c=(0,$.jsx)(`div`,{ref:a,className:i,"data-browser-surface-slot":n}),t[4]=i,t[5]=n,t[6]=c):c=t[6],c}var Fo=120,Io=220,Lo=4,Ro=90,zo=.08,Bo=.5;function Vo(e){let[t,n]=(0,Z.useState)(0),r=(0,Z.useRef)(0);return r.current=t,(0,Z.useEffect)(()=>{if(!e){if(r.current===0)return;n(100);let e=window.setTimeout(()=>n(0),Io);return()=>window.clearTimeout(e)}n(e=>e>0&&e<95?e:Lo);let t=window.setInterval(()=>{let e=r.current;if(e>=Ro)return;let t=Ro-e,i=Math.max(Bo,t*zo);n(Math.min(Ro,e+i))},Fo);return()=>window.clearInterval(t)},[e]),t}var Ho=class extends o()(`PreviewSessionThreadKeyParseError`,{threadKey:c}){get message(){return`Invalid scoped preview thread key: ${this.threadKey}`}},Uo=r(e=>{let t=v(e);if(t===null)throw new Ho({threadKey:e});let n=Y.list({environmentId:t.environmentId,input:{threadId:t.threadId}}),r=Y.events({environmentId:t.environmentId,input:{}});return O(e=>{let i=!1,a=0,o=null,s=0,c=0,u=r=>{if(!l(r))return;if(r.value.sessions.length>0){o=null,a+=1,V(t,r.value.sessions);return}let s=J(t).snapshot,c=s&&s.navStatus._tag!==`Idle`?s.navStatus.url:null;if(!c){Oe(t,null);return}if(o===c)return;o=c;let u=++a;x(e.registry,Y.open,{environmentId:t.environmentId,input:{threadId:t.threadId,url:c}},{reportDefect:!1,reportFailure:!1}).then(r=>{i||u!==a||(o=null,r._tag!==`Failure`&&(Oe(t,r.value),e.refresh(n)))})},d=r=>{!l(r)||r.value.threadId!==t.threadId||(K(t,r.value),(r.value.type===`opened`||r.value.type===`closed`)&&e.refresh(n))};e.addFinalizer(()=>{i=!0,a+=1});let f=e.once(n),p=e.once(r);e.subscribe(n,e=>{s+=1,u(e)}),e.subscribe(r,e=>{c+=1,d(e)}),queueMicrotask(()=>{i||(s===0&&u(f),c===0&&d(p))})}).pipe(T(1e3),d(`preview:session-sync:${e}`))});function Wo(e){let t=(0,Q.c)(2),n;t[0]===e?n=t[1]:(n=Uo(N(e)),t[0]=e,t[1]=n),S(n)}var Go=1500,Ko=.001;function qo(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Ko))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},Go),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=m(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let h;return t[7]!==u||t[8]!==d||t[9]!==p?(h=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=h):h=t[10],h}function Jo(e,t){return e?1:t===`human`?.18:.35}var Yo=700;function Xo(e){let t=(0,Q.c)(9),{tabId:n,zoomFactor:r,controller:i}=e,a;t[0]===n?a=t[1]:(a=e=>e.byTabId[n]??null,t[0]=n,t[1]=a);let o=Ce(a),s;t[2]===n?s=t[3]:(s=e=>e.byTabId[n]?.content??null,t[2]=n,t[3]=s);let c=se(s);if(!o)return null;let l;return t[4]!==c||t[5]!==i||t[6]!==o||t[7]!==r?(l=(0,$.jsx)(Zo,{event:o,content:c,zoomFactor:r,controller:i},o.sequence),t[4]=c,t[5]=i,t[6]=o,t[7]=r,t[8]=l):l=t[8],l}function Zo(e){let t=(0,Q.c)(15),{event:n,content:r,zoomFactor:i,controller:a}=e,[o,s]=(0,Z.useState)(!0),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=window.setTimeout(()=>s(!1),Yo);return()=>window.clearTimeout(e)},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Z.useEffect)(c,l);let u;t[2]!==o||t[3]!==a?(u=Jo(o,a),t[2]=o,t[3]=a,t[4]=u):u=t[4];let d=`translate3d(${n.x*i*(r?.scale??1)+(r?.x??0)-(r?.scrollLeft??0)}px, ${n.y*i*(r?.scale??1)+(r?.y??0)-(r?.scrollTop??0)}px, 0)`,f;t[5]!==u||t[6]!==d?(f={opacity:u,transform:d},t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;t[8]!==n.phase||t[9]!==n.sequence?(p=n.phase===`click`?(0,$.jsx)(`span`,{className:`absolute left-0.5 top-0.5 size-4 animate-status-ping rounded-full bg-primary/25 motion-reduce:animate-none`},n.sequence):null,t[8]=n.phase,t[9]=n.sequence,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(je,{className:`relative size-5 -translate-x-0.5 -translate-y-0.5 fill-background text-primary drop-shadow-sm`,strokeWidth:2}),t[11]=m):m=t[11];let h;return t[12]!==f||t[13]!==p?(h=(0,$.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-0 z-40 transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none`,style:f,"aria-hidden":`true`,"data-agent-browser-cursor":!0,children:[p,m]}),t[12]=f,t[13]=p,t[14]=h):h=t[14],h}var Qo=typeof window>`u`?null:b();function $o({threadRef:e,tabId:t,configuredUrls:n,visible:r}){let[i,a]=(0,Z.useState)(void 0),[o,s]=(0,Z.useState)(!1),c=_e(),l=(0,Z.useRef)(!1),u=(0,Z.useRef)(!0),d=B(e),p=P(e=>e.addPreviewAnnotation),m=P(e=>e.addImage),h=f(e.environmentId),g=E(e.environmentId),v=C(Y.open),y=C(Y.navigate),b=C(Y.resize,`preview viewport resize`),x=C(Y.refresh),S=C(Y.history);Wo(e),(0,Z.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let T=t??d.activeTabId,D=T?d.sessions[T]??null:null,O=T?d.desktopByTabId[T]??null:null,k=D?.navStatus??{_tag:`Idle`},A=k._tag===`Idle`?``:k.url,j=O?.loading??k._tag===`Loading`,M=O?.canGoBack??D?.canGoBack??!1,I=O?.canGoForward??D?.canGoForward??!1,L=k._tag===`Idle`,R=k._tag===`LoadFailed`,z=ce(D),V=O?.controller??(T?d.serverControllerByTabId[T]??`none`:`none`),U=Vo(j),K=A&&h&&g?io({url:A,environmentLabel:h.label,environmentHttpBaseUrl:g})??void 0:void 0,J=D?.viewport??_,te=se(e=>T?e.byTabId[T]?.rect??null:null),ne=(0,Z.useCallback)(async t=>{try{let n=H(e.environmentId,t);if(T&&X)await X.navigate(T,n),q(e,n);else if(T){let t=await y({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,url:n}});if(t._tag===`Failure`)throw w(t);ee(e,t.value),q(e,n)}else await W({openPreview:v,threadRef:e,url:n})}catch{}},[y,v,T,e]),re=(0,Z.useCallback)(()=>{if(T){if(X){X.refresh(T);return}x({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T}})}},[x,T,e]),ie=(0,Z.useCallback)(()=>{X&&T&&X.zoomIn(T)},[T]),oe=(0,Z.useCallback)(()=>{X&&T&&X.zoomOut(T)},[T]),le=(0,Z.useCallback)(()=>{X&&T&&X.resetZoom(T)},[T]),ue=(0,Z.useCallback)(async t=>{if(!T)return;let n=await b({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,viewport:t}});if(n._tag===`Failure`){let e=w(n);throw G.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}ee(e,n.value)},[b,T,e]),de=()=>{if(!T)return;if(J._tag!==`fill`){Se(T,_).catch(()=>void 0);return}let e=te?ye(te,O?.zoomFactor):{width:1024,height:768};Se(T,{_tag:`freeform`,...e}).catch(()=>void 0)};(0,Z.useEffect)(()=>{if(T)return ge(T,ue)},[ue,T]);let fe=(0,Z.useCallback)(()=>{if(T){if(X){X.goBack(T);return}S({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,direction:`back`}})}},[S,T,e]),me=(0,Z.useCallback)(()=>{if(T){if(X){X.goForward(T);return}S({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,direction:`forward`}})}},[S,T,e]),he=(0,Z.useCallback)(()=>{!Qo||!A||Qo.shell.openExternal(A).catch(()=>void 0)},[A]),be=(0,Z.useCallback)(e=>{if(!X||!T)return;let t=X;if(c===T){ae(T).then(e=>{if(!e)return;let n=!1,r,i=()=>{if(!navigator.clipboard?.writeText){G.update(r,F({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{n=!0,o(),window.setTimeout(()=>{n=!1,o()},2e3)},e=>{G.update(r,F({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:No(navigator.platform),onClick:()=>void t.revealArtifact(e.path)},o=()=>{G.update(r,F({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:n?`Copied!`:`Copy path`,disabled:n,onClick:i},secondaryActionVariant:`outline`}}))};r=G.add(F({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{G.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(e){if(c!==null){G.add({type:`warning`,title:`Another preview is recording`,description:`Stop the active recording before starting a new one.`});return}pe(T).catch(e=>{G.add({type:`error`,title:`Unable to start recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}t.captureScreenshot(T).then(e=>{let n={children:No(navigator.platform),onClick:()=>void t.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,t=`Screenshot saved`,o)=>{G.update(a,F({type:e,title:t,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...n},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{t.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=G.add(F({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...n},secondaryActionVariant:`outline`}}))},e=>{G.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[c,T]),xe=(0,Z.useCallback)(()=>{if(!X||!T)return;if(l.current){X.cancelPickElement(T).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null;l.current=!0,s(!0),(async()=>{try{let t=await X.pickElement(T);if(!t)return;p(e,t);let n=await ve(t);n&&t.screenshot&&m(e,{type:`image`,id:t.id,name:n.name,mimeType:n.type,sizeBytes:n.size,previewUrl:t.screenshot.dataUrl,file:n})}catch{}finally{if(l.current=!1,u.current&&s(!1),t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[m,p,T,e]);return(0,Z.useEffect)(()=>()=>{l.current&&(l.current=!1,X&&T&&X.cancelPickElement(T).catch(()=>void 0),u.current&&s(!1))},[T]),(0,Z.useEffect)(()=>{if(r)return we(e=>{switch(e){case`refresh`:re();return;case`focus-url`:a(e=>(e??0)+1);return;case`zoom-in`:ie();return;case`zoom-out`:oe();return;case`reset-zoom`:le();return;case`toggle-panel`:return}})},[re,le,ie,oe,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":N(e),children:[(0,$.jsx)(ro,{url:A,displayUrl:K,loading:j,loadProgress:U,canGoBack:M,canGoForward:I,refreshDisabled:L,focusUrlNonce:i,onBack:fe,onForward:me,onRefresh:re,onSubmit:e=>void ne(e),onOpenInBrowser:T?he:void 0,onCapture:X&&T?be:void 0,captureDisabled:!O||R,recording:T!==null&&c===T,onPickElement:X&&T?xe:void 0,pickActive:o,pickDisabled:!T||R,pickDisabledReason:R?`Page didn't load — pick unavailable until the page renders`:void 0,trailingActions:X?(0,$.jsx)(go,{tabId:T,hasWebContents:O!==null,zoomFactor:O?.zoomFactor??1,deviceToolbarVisible:J._tag!==`fill`,onToggleDeviceToolbar:de}):null}),(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[T&&D&&!z?X?(0,$.jsx)(Po,{tabId:T,visible:r&&!R,className:`absolute inset-0 h-full w-full`},T):r&&!R?(0,$.jsx)(jo,{threadRef:e,tabId:T,viewport:J,visible:r&&!R,className:`absolute inset-0 h-full w-full`},T):null:null,z?(0,$.jsx)(ho,{environmentId:e.environmentId,configuredUrls:n,recentlySeenUrls:d.recentlySeenUrls,onOpenUrl:e=>void ne(e)}):null,D&&O?(0,$.jsx)(qo,{zoomFactor:O.zoomFactor}):null,T&&O&&!z&&!R?(0,$.jsx)(Xo,{tabId:T,zoomFactor:O.zoomFactor,controller:V}):null,V===`none`?null:(0,$.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-3 z-40 rounded-full border border-border/70 bg-background/90 px-2.5 py-1 text-[11px] font-medium shadow-sm backdrop-blur`,children:V===`agent`?`Agent controlling browser`:`Human control`}),k._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(wo,{url:k.url,code:k.code,description:k.description,onReload:re})}):null]})]})}function es(e){let t=(0,Q.c)(13),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o}=e;if(!L()){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:Vi()})}),t[0]=e):e=t[0];let r;return t[1]===n?r=t[2]:(r=(0,$.jsx)(xe,{mode:n,children:e}),t[1]=n,t[2]=r),r}let s;t[3]===i?s=t[4]:(s=i===void 0?{}:{tabId:i},t[3]=i,t[4]=s);let c;t[5]!==a||t[6]!==s||t[7]!==r||t[8]!==o?(c=(0,$.jsx)($o,{threadRef:r,...s,configuredUrls:a,visible:o}),t[5]=a,t[6]=s,t[7]=r,t[8]=o,t[9]=c):c=t[9];let l;return t[10]!==n||t[11]!==c?(l=(0,$.jsx)(xe,{mode:n,children:c}),t[10]=n,t[11]=c,t[12]=l):l=t[12],l}export{es as PreviewPanel};
1
+ import{Al as e,C as t,Ca as n,Ds as r,E as i,Fa as a,Jl as o,Kd as s,Kl as c,Ls as l,Nn as u,Ns as d,O as f,On as p,Ta as m,Tn as h,Yd as g,_c as _,_o as v,bn as y,d as b,ds as x,dt as S,et as C,hs as w,js as T,k as E,kd as D,ks as O,qa as k,to as A,w as j,wn as M,xo as N,xt as P}from"./textarea-z0DHLDaT.js";import{$n as F,Ar as I,Bn as L,Dr as R,Fn as z,Gn as B,Hn as V,Jn as H,Kn as U,Ln as W,Qn as G,Rn as K,Un as q,Vn as J,Wn as ee,Xn as te,Yn as ne,Zn as Y,_n as re,_r as ie,a as ae,br as oe,c as se,cn as ce,fr as le,gn as ue,gr as de,hn as fe,i as pe,kr as me,l as X,mn as he,n as ge,o as _e,p as ve,r as ye,s as be,sn as xe,t as Se,u as Ce,vn as we,wr as Te,xr as Ee,yr as De,zn as Oe}from"./index-zd5b5MHc.js";var ke=A(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Ae=A(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),je=A(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Me=A(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),Ne=()=>`Refresh`,Pe=()=>`Atualizar`,Fe=()=>`Actualizar`,Ie=()=>`Actualiser`,Le=()=>`Aggiorna`,Re=()=>`更新`,ze=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Pe(e):n===`es`?Fe(e):n===`fr`?Ie(e):n===`it`?Le(e):n===`ja`?Re(e):Ne(e)},Be=()=>`Search or enter URL`,Ve=()=>`Pesquisar ou inserir URL`,He=()=>`Buscar o introducir URL`,Ue=()=>`Rechercher ou saisir une URL`,We=()=>`Cerca o inserisci URL`,Ge=()=>`検索または URL を入力`,Ke=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ve(e):n===`es`?He(e):n===`fr`?Ue(e):n===`it`?We(e):n===`ja`?Ge(e):Be(e)},qe=()=>`Annotate preview`,Je=()=>`Anotar visualização`,Ye=()=>`Anotar vista previa`,Xe=()=>`Annoter l’aperçu`,Ze=()=>`Annota anteprima`,Qe=()=>`プレビューに注釈`,$e=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Je(e):n===`es`?Ye(e):n===`fr`?Xe(e):n===`it`?Ze(e):n===`ja`?Qe(e):qe(e)},et=()=>`Back`,tt=()=>`Voltar`,nt=()=>`Atrás`,rt=()=>`Retour`,it=()=>`Indietro`,at=()=>`戻る`,ot=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?tt(e):n===`es`?nt(e):n===`fr`?rt(e):n===`it`?it(e):n===`ja`?at(e):et(e)},st=()=>`Cancel annotation`,ct=()=>`Cancelar anotação`,lt=()=>`Cancelar anotación`,ut=()=>`Annuler l’annotation`,dt=()=>`Annulla annotazione`,ft=()=>`注釈をキャンセル`,pt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ct(e):n===`es`?lt(e):n===`fr`?ut(e):n===`it`?dt(e):n===`ja`?ft(e):st(e)},mt=()=>`Capture screenshot`,ht=()=>`Capturar tela`,gt=()=>`Capturar pantalla`,_t=()=>`Capturer l’écran`,vt=()=>`Cattura schermata`,yt=()=>`スクリーンショットを撮影`,bt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ht(e):n===`es`?gt(e):n===`fr`?_t(e):n===`it`?vt(e):n===`ja`?yt(e):mt(e)},xt=()=>`Checking your connection`,St=()=>`Verificar sua conexão`,Ct=()=>`Comprobar tu conexión`,wt=()=>`Vérifier votre connexion`,Tt=()=>`Verificare la connessione`,Et=()=>`接続を確認する`,Dt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?St(e):n===`es`?Ct(e):n===`fr`?wt(e):n===`it`?Tt(e):n===`ja`?Et(e):xt(e)},Ot=()=>`Checking the proxy and the firewall`,kt=()=>`Verificar o proxy e o firewall`,At=()=>`Comprobar el proxy y el firewall`,jt=()=>`Vérifier le proxy et le pare-feu`,Mt=()=>`Verificare proxy e firewall`,Nt=()=>`プロキシとファイアウォールを確認する`,Pt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?kt(e):n===`es`?At(e):n===`fr`?jt(e):n===`it`?Mt(e):n===`ja`?Nt(e):Ot(e)},Ft=()=>`Clear cache`,It=()=>`Limpar cache`,Lt=()=>`Borrar caché`,Rt=()=>`Vider le cache`,zt=()=>`Svuota cache`,Bt=()=>`キャッシュを消去`,Vt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?It(e):n===`es`?Lt(e):n===`fr`?Rt(e):n===`it`?zt(e):n===`ja`?Bt(e):Ft(e)},Ht=()=>`Clear cookies`,Ut=()=>`Limpar cookies`,Wt=()=>`Borrar cookies`,Gt=()=>`Effacer les cookies`,Kt=()=>`Cancella cookie`,qt=()=>`Cookie を消去`,Jt=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ut(e):n===`es`?Wt(e):n===`fr`?Gt(e):n===`it`?Kt(e):n===`ja`?qt(e):Ht(e)},Yt=()=>`Collaborative browser preview`,Xt=()=>`Visualização colaborativa do navegador`,Zt=()=>`Vista previa colaborativa del navegador`,Qt=()=>`Aperçu collaboratif du navigateur`,$t=()=>`Anteprima collaborativa del browser`,en=()=>`共同ブラウザープレビュー`,tn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Xt(e):n===`es`?Zt(e):n===`fr`?Qt(e):n===`it`?$t(e):n===`ja`?en(e):Yt(e)},nn=()=>`Confirming the dev server is running`,rn=()=>`Confirmar se o servidor de desenvolvimento está em execução`,an=()=>`Confirmar que el servidor de desarrollo está activo`,on=()=>`Confirmer que le serveur de développement fonctionne`,sn=()=>`Confermare che il server di sviluppo sia attivo`,cn=()=>`開発サーバーが実行中か確認する`,ln=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?rn(e):n===`es`?an(e):n===`fr`?on(e):n===`it`?sn(e):n===`ja`?cn(e):nn(e)},un=()=>`Connecting to server browser…`,dn=()=>`Conectando ao navegador do servidor…`,fn=()=>`Conectando al navegador del servidor…`,pn=()=>`Connexion au navigateur du serveur…`,mn=()=>`Connessione al browser del server…`,hn=()=>`サーバーブラウザーに接続中…`,gn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?dn(e):n===`es`?fn(e):n===`fr`?pn(e):n===`it`?mn(e):n===`ja`?hn(e):un(e)},_n=()=>`Details`,vn=()=>`Detalhes`,yn=()=>`Detalles`,bn=()=>`Détails`,xn=()=>`Dettagli`,Sn=()=>`詳細`,Cn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?vn(e):n===`es`?yn(e):n===`fr`?bn(e):n===`it`?xn(e):n===`ja`?Sn(e):_n(e)},wn=()=>`Type a URL above, or run a dev script. Listening localhost ports will show up here automatically.`,Tn=()=>`Digite uma URL acima ou execute um script de desenvolvimento. Portas localhost em escuta aparecerão aqui automaticamente.`,En=()=>`Escribe una URL arriba o ejecuta un script de desarrollo. Los puertos localhost en escucha aparecerán aquí automáticamente.`,Dn=()=>`Saisissez une URL ci-dessus ou lancez un script de développement. Les ports localhost à l’écoute apparaîtront automatiquement ici.`,On=()=>`Digita un URL sopra o esegui uno script di sviluppo. Le porte localhost in ascolto appariranno qui automaticamente.`,kn=()=>`上に URL を入力するか、開発スクリプトを実行してください。待受中の localhost ポートが自動的に表示されます。`,An=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Tn(e):n===`es`?En(e):n===`fr`?Dn(e):n===`it`?On(e):n===`ja`?kn(e):wn(e)},jn=()=>`Forward`,Mn=()=>`Avançar`,Nn=()=>`Adelante`,Pn=()=>`Suivant`,Fn=()=>`Avanti`,In=()=>`進む`,Ln=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Mn(e):n===`es`?Nn(e):n===`fr`?Pn(e):n===`it`?Fn(e):n===`ja`?In(e):jn(e)},Rn=()=>`Hard reload`,zn=()=>`Recarregar completamente`,Bn=()=>`Recarga completa`,Vn=()=>`Rechargement forcé`,Hn=()=>`Ricaricamento completo`,Un=()=>`強制再読み込み`,Wn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?zn(e):n===`es`?Bn(e):n===`fr`?Vn(e):n===`it`?Hn(e):n===`ja`?Un(e):Rn(e)},Gn=()=>`Hide details`,Kn=()=>`Ocultar detalhes`,qn=()=>`Ocultar detalles`,Jn=()=>`Masquer les détails`,Yn=()=>`Nascondi dettagli`,Xn=()=>`詳細を非表示`,Zn=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Kn(e):n===`es`?qn(e):n===`fr`?Jn(e):n===`it`?Yn(e):n===`ja`?Xn(e):Gn(e)},Qn=()=>`Hide device toolbar`,$n=()=>`Ocultar barra do dispositivo`,er=()=>`Ocultar barra del dispositivo`,tr=()=>`Masquer la barre d’appareil`,nr=()=>`Nascondi barra dispositivo`,rr=()=>`デバイスツールバーを非表示`,ir=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?$n(e):n===`es`?er(e):n===`fr`?tr(e):n===`it`?nr(e):n===`ja`?rr(e):Qn(e)},ar=()=>`Listening`,or=()=>`Escutando`,sr=()=>`Escuchando`,cr=()=>`À l’écoute`,lr=()=>`In ascolto`,ur=()=>`待受中`,dr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?or(e):n===`es`?sr(e):n===`fr`?cr(e):n===`it`?lr(e):n===`ja`?ur(e):ar(e)},fr=()=>`Loading…`,pr=()=>`Carregando…`,mr=()=>`Cargando…`,hr=()=>`Chargement…`,gr=()=>`Caricamento…`,_r=()=>`読み込み中…`,vr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?pr(e):n===`es`?mr(e):n===`fr`?hr(e):n===`it`?gr(e):n===`ja`?_r(e):fr(e)},yr=()=>`Local servers`,br=()=>`Servidores locais`,xr=()=>`Servidores locales`,Sr=()=>`Serveurs locaux`,Cr=()=>`Server locali`,wr=()=>`ローカルサーバー`,Tr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?br(e):n===`es`?xr(e):n===`fr`?Sr(e):n===`it`?Cr(e):n===`ja`?wr(e):yr(e)},Er=()=>`Preview menu`,Dr=()=>`Menu da visualização`,Or=()=>`Menú de vista previa`,kr=()=>`Menu de l’aperçu`,Ar=()=>`Menu anteprima`,jr=()=>`プレビューメニュー`,Mr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Dr(e):n===`es`?Or(e):n===`fr`?kr(e):n===`it`?Ar(e):n===`ja`?jr(e):Er(e)},Nr=()=>`More`,Pr=()=>`Mais`,Fr=()=>`Más`,Ir=()=>`Plus`,Lr=()=>`Altro`,Rr=()=>`その他`,zr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Pr(e):n===`es`?Fr(e):n===`fr`?Ir(e):n===`it`?Lr(e):n===`ja`?Rr(e):Nr(e)},Br=()=>`Navigation`,Vr=()=>`Navegação`,Hr=()=>`Navegación`,Ur=()=>`Navigation`,Wr=()=>`Navigazione`,Gr=()=>`ナビゲーション`,Kr=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Vr(e):n===`es`?Hr(e):n===`fr`?Ur(e):n===`it`?Wr(e):n===`ja`?Gr(e):Br(e)},qr=()=>`No preview yet`,Jr=()=>`Nenhuma visualização ainda`,Yr=()=>`Aún no hay vista previa`,Xr=()=>`Aucun aperçu pour le moment`,Zr=()=>`Nessuna anteprima`,Qr=()=>`まだプレビューはありません`,$r=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Jr(e):n===`es`?Yr(e):n===`fr`?Xr(e):n===`it`?Zr(e):n===`ja`?Qr(e):qr(e)},ei=()=>`Not currently listening`,ti=()=>`Não está escutando`,ni=()=>`No está escuchando`,ri=()=>`Pas à l’écoute actuellement`,ii=()=>`Non in ascolto`,ai=()=>`現在待受中ではありません`,oi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ti(e):n===`es`?ni(e):n===`fr`?ri(e):n===`it`?ii(e):n===`ja`?ai(e):ei(e)},si=()=>`Open DevTools`,ci=()=>`Abrir DevTools`,li=()=>`Abrir DevTools`,ui=()=>`Ouvrir les outils de développement`,di=()=>`Apri DevTools`,fi=()=>`DevTools を開く`,pi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ci(e):n===`es`?li(e):n===`fr`?ui(e):n===`it`?di(e):n===`ja`?fi(e):si(e)},mi=()=>`Recently seen`,hi=()=>`Visto recentemente`,gi=()=>`Visto recientemente`,_i=()=>`Vu récemment`,vi=()=>`Visto di recente`,yi=()=>`最近確認`,bi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?hi(e):n===`es`?gi(e):n===`fr`?_i(e):n===`it`?vi(e):n===`ja`?yi(e):mi(e)},xi=()=>`Reload`,Si=()=>`Recarregar`,Ci=()=>`Recargar`,wi=()=>`Recharger`,Ti=()=>`Ricarica`,Ei=()=>`再読み込み`,Di=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Si(e):n===`es`?Ci(e):n===`fr`?wi(e):n===`it`?Ti(e):n===`ja`?Ei(e):xi(e)},Oi=()=>`Reset zoom`,ki=()=>`Redefinir zoom`,Ai=()=>`Restablecer zoom`,ji=()=>`Réinitialiser le zoom`,Mi=()=>`Reimposta zoom`,Ni=()=>`ズームをリセット`,Pi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ki(e):n===`es`?Ai(e):n===`fr`?ji(e):n===`it`?Mi(e):n===`ja`?Ni(e):Oi(e)},Fi=()=>`Collaborative preview is unavailable in this client runtime.`,Ii=()=>`A prévia colaborativa não está disponível neste runtime de cliente.`,Li=()=>`La vista previa colaborativa no está disponible en este runtime de cliente.`,Ri=()=>`L’aperçu collaboratif n’est pas disponible dans cet environnement client.`,zi=()=>`L’anteprima collaborativa non è disponibile in questo runtime client.`,Bi=()=>`このクライアントランタイムでは共同プレビューを利用できません。`,Vi=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ii(e):n===`es`?Li(e):n===`fr`?Ri(e):n===`it`?zi(e):n===`ja`?Bi(e):Fi(e)},Hi=()=>`Select a listening port to open it in this browser tab.`,Ui=()=>`Selecione uma porta em escuta para abri-la nesta aba do navegador.`,Wi=()=>`Selecciona un puerto en escucha para abrirlo en esta pestaña.`,Gi=()=>`Sélectionnez un port à l’écoute pour l’ouvrir dans cet onglet.`,Ki=()=>`Seleziona una porta in ascolto per aprirla in questa scheda.`,qi=()=>`待受中のポートを選択して、このブラウザータブで開きます。`,Ji=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ui(e):n===`es`?Wi(e):n===`fr`?Gi(e):n===`it`?Ki(e):n===`ja`?qi(e):Hi(e)},Yi=()=>`Show device toolbar`,Xi=()=>`Mostrar barra do dispositivo`,Zi=()=>`Mostrar barra del dispositivo`,Qi=()=>`Afficher la barre d’appareil`,$i=()=>`Mostra barra dispositivo`,ea=()=>`デバイスツールバーを表示`,ta=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Xi(e):n===`es`?Zi(e):n===`fr`?Qi(e):n===`it`?$i(e):n===`ja`?ea(e):Yi(e)},na=()=>`Stop`,ra=()=>`Parar`,ia=()=>`Detener`,aa=()=>`Arrêter`,oa=()=>`Interrompi`,sa=()=>`停止`,ca=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ra(e):n===`es`?ia(e):n===`fr`?aa(e):n===`it`?oa(e):n===`ja`?sa(e):na(e)},la=()=>`Stop recording`,ua=()=>`Parar gravação`,da=()=>`Detener grabación`,fa=()=>`Arrêter l’enregistrement`,pa=()=>`Interrompi registrazione`,ma=()=>`記録を停止`,ha=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ua(e):n===`es`?da(e):n===`fr`?fa(e):n===`it`?pa(e):n===`ja`?ma(e):la(e)},ga=()=>`Try:`,_a=()=>`Tente:`,va=()=>`Prueba:`,ya=()=>`Essayez :`,ba=()=>`Prova:`,xa=()=>`確認事項:`,Sa=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?_a(e):n===`es`?va(e):n===`fr`?ya(e):n===`it`?ba(e):n===`ja`?xa(e):ga(e)},Ca=()=>`This site can’t be reached`,wa=()=>`Não foi possível acessar este site`,Ta=()=>`No se puede acceder a este sitio`,Ea=()=>`Ce site est inaccessible`,Da=()=>`Impossibile raggiungere il sito`,Oa=()=>`このサイトにアクセスできません`,ka=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?wa(e):n===`es`?Ta(e):n===`fr`?Ea(e):n===`it`?Da(e):n===`ja`?Oa(e):Ca(e)},Aa=()=>`Zoom`,ja=()=>`Zoom`,Ma=()=>`Zoom`,Na=()=>`Zoom`,Pa=()=>`Zoom`,Fa=()=>`ズーム`,Ia=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?ja(e):n===`es`?Ma(e):n===`fr`?Na(e):n===`it`?Pa(e):n===`ja`?Fa(e):Aa(e)},La=()=>`Zoom in`,Ra=()=>`Aumentar zoom`,za=()=>`Acercar`,Ba=()=>`Zoomer`,Va=()=>`Aumenta zoom`,Ha=()=>`拡大`,Ua=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ra(e):n===`es`?za(e):n===`fr`?Ba(e):n===`it`?Va(e):n===`ja`?Ha(e):La(e)},Wa=()=>`Zoom out`,Ga=()=>`Reduzir zoom`,Ka=()=>`Alejar`,qa=()=>`Dézoomer`,Ja=()=>`Riduci zoom`,Ya=()=>`縮小`,Xa=(e={},t={})=>{let n=t.locale??k();return n===`pt-BR`?Ga(e):n===`es`?Ka(e):n===`fr`?qa(e):n===`it`?Ja(e):n===`ja`?Ya(e):Wa(e)},Z=g(s(),1),Q=e(),$=D();function Za(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=m(`relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{className:i,"data-slot":`input-group`,role:`group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Qa=a(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function $a(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=m(Qa({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,$.jsx)(`div`,{className:o,"data-align":a,"data-slot":`input-group-addon`,onMouseDown:eo,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function eo(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function to(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(z,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var no=()=>{};function ro(e){let r=(0,Q.c)(101),{url:a,displayUrl:o,loading:s,loadProgress:c,canGoBack:l,canGoForward:u,refreshDisabled:d,inputDisabled:f,focusUrlNonce:p,onBack:h,onForward:g,onRefresh:_,onSubmit:v,onOpenInBrowser:y,onCapture:b,captureDisabled:x,recording:S,onPickElement:C,pickActive:w,pickDisabled:T,pickDisabledReason:E,trailingActions:D}=e,O=(0,Z.useRef)(null),[k,A]=(0,Z.useState)(a),[M,N]=(0,Z.useState)(!1),P,F;r[0]===p?(P=r[1],F=r[2]):(P=()=>{if(p==null)return;let e=O.current;e&&e.focus()},F=[p],r[0]=p,r[1]=P,r[2]=F),(0,Z.useEffect)(P,F);let L;r[3]!==k||r[4]!==v?(L=e=>{e?.preventDefault();let t=k.trim();t.length!==0&&(v(t),O.current?.blur())},r[3]=k,r[4]=v,r[5]=L):L=r[5];let z=L,B;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(B=Kr(),r[6]=B):B=r[6];let V=l?h:no,H=!l,U;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(U=ot(),r[7]=U):U=r[7];let W;r[8]!==V||r[9]!==H?(W=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:V,disabled:H,"aria-label":U,type:`button`}),r[8]=V,r[9]=H,r[10]=W):W=r[10];let G;r[11]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(I,{}),r[11]=G):G=r[11];let K;r[12]===W?K=r[13]:(K=(0,$.jsx)(i,{render:W,children:G}),r[12]=W,r[13]=K);let q;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(j,{children:ot()}),r[14]=q):q=r[14];let J;r[15]===K?J=r[16]:(J=(0,$.jsxs)(t,{children:[K,q]}),r[15]=K,r[16]=J);let ee=u?g:no,te=!u,ne;r[17]===Symbol.for(`react.memo_cache_sentinel`)?(ne=Ln(),r[17]=ne):ne=r[17];let Y;r[18]!==ee||r[19]!==te?(Y=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:ee,disabled:te,"aria-label":ne,type:`button`}),r[18]=ee,r[19]=te,r[20]=Y):Y=r[20];let re;r[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(me,{}),r[21]=re):re=r[21];let ie;r[22]===Y?ie=r[23]:(ie=(0,$.jsx)(i,{render:Y,children:re}),r[22]=Y,r[23]=ie);let ae;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(j,{children:Ln()}),r[24]=ae):ae=r[24];let se;r[25]===ie?se=r[26]:(se=(0,$.jsxs)(t,{children:[ie,ae]}),r[25]=ie,r[26]=se);let ce=d?no:_,ue;r[27]===s?ue=r[28]:(ue=s?ca():ze(),r[27]=s,r[28]=ue);let fe;r[29]!==d||r[30]!==ce||r[31]!==ue?(fe=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:d,"aria-label":ue,type:`button`}),r[29]=d,r[30]=ce,r[31]=ue,r[32]=fe):fe=r[32];let pe=s&&`animate-spin`,X;r[33]===pe?X=r[34]:(X=m(pe),r[33]=pe,r[34]=X);let he;r[35]===X?he=r[36]:(he=(0,$.jsx)(de,{className:X}),r[35]=X,r[36]=he);let ge;r[37]!==fe||r[38]!==he?(ge=(0,$.jsx)(i,{render:fe,children:he}),r[37]=fe,r[38]=he,r[39]=ge):ge=r[39];let _e;r[40]===s?_e=r[41]:(_e=s?vr():ze(),r[40]=s,r[41]=_e);let ve;r[42]===_e?ve=r[43]:(ve=(0,$.jsx)(j,{children:_e}),r[42]=_e,r[43]=ve);let ye;r[44]!==ge||r[45]!==ve?(ye=(0,$.jsxs)(t,{children:[ge,ve]}),r[44]=ge,r[45]=ve,r[46]=ye):ye=r[46];let be;r[47]!==J||r[48]!==se||r[49]!==ye?(be=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":B,children:[J,se,ye]}),r[47]=J,r[48]=se,r[49]=ye,r[50]=be):be=r[50];let xe=M?k:o??a,Se=y&&!M&&`group-hover/address:pe-7 transition-[padding]`,Ce;r[51]===Se?Ce=r[52]:(Ce=m(Se),r[51]=Se,r[52]=Ce);let we;r[53]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>A(e.target.value),r[53]=we):we=r[53];let Te;r[54]===a?Te=r[55]:(Te=()=>{A(a),N(!0),queueMicrotask(()=>O.current?.select())},r[54]=a,r[55]=Te);let Ee;r[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{N(!1)},r[56]=Ee):Ee=r[56];let De;r[57]!==z||r[58]!==a?(De=e=>{e.key===`Enter`&&z(e),e.key===`Escape`&&(e.preventDefault(),A(a),O.current?.blur())},r[57]=z,r[58]=a,r[59]=De):De=r[59];let Oe;r[60]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=Ke(),r[60]=Oe):Oe=r[60];let Ae;r[61]!==f||r[62]!==xe||r[63]!==Ce||r[64]!==Te||r[65]!==De?(Ae=(0,$.jsx)(i,{render:(0,$.jsx)(to,{ref:O,value:xe,className:Ce,onChange:we,onFocus:Te,onBlur:Ee,onKeyDown:De,placeholder:Oe,spellCheck:!1,disabled:f,"data-preview-url-input":!0,size:`sm`})}),r[61]=f,r[62]=xe,r[63]=Ce,r[64]=Te,r[65]=De,r[66]=Ae):Ae=r[66];let je;r[67]!==o||r[68]!==M||r[69]!==a?(je=!M&&o?(0,$.jsx)(j,{children:a}):null,r[67]=o,r[68]=M,r[69]=a,r[70]=je):je=r[70];let Me;r[71]!==Ae||r[72]!==je?(Me=(0,$.jsxs)(t,{children:[Ae,je]}),r[71]=Ae,r[72]=je,r[73]=Me):Me=r[73];let Ne;r[74]!==M||r[75]!==y?(Ne=y&&!M?(0,$.jsx)($a,{align:`inline-end`,className:`pointer-events-none absolute inset-y-0 right-0 opacity-0 transition-opacity group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsxs)(t,{children:[(0,$.jsx)(i,{render:(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,onClick:y,"aria-label":le(),type:`button`}),children:(0,$.jsx)(R,{})}),(0,$.jsx)(j,{children:le()})]})}):null,r[74]=M,r[75]=y,r[76]=Ne):Ne=r[76];let Pe;r[77]!==Me||r[78]!==Ne?(Pe=(0,$.jsxs)(Za,{className:`group/address h-7 flex-1 rounded-md border-transparent bg-transparent shadow-none before:shadow-none hover:bg-muted/40 focus-within:bg-background`,children:[Me,Ne]}),r[77]=Me,r[78]=Ne,r[79]=Pe):Pe=r[79];let Fe;r[80]!==C||r[81]!==w||r[82]!==T||r[83]!==E?(Fe=C?(0,$.jsxs)(t,{children:[(0,$.jsx)(i,{render:(0,$.jsx)(n,{variant:w?`secondary`:`ghost`,size:`icon-xs`,onClick:C,disabled:T,"aria-label":w?pt():$e(),"aria-pressed":w?`true`:`false`,type:`button`}),children:(0,$.jsx)(oe,{className:m(w&&`text-primary`)})}),(0,$.jsx)(j,{children:T&&E?E:w?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,r[80]=C,r[81]=w,r[82]=T,r[83]=E,r[84]=Fe):Fe=r[84];let Ie;r[85]!==x||r[86]!==b||r[87]!==S?(Ie=b?(0,$.jsxs)(t,{children:[(0,$.jsxs)(i,{render:(0,$.jsx)(n,{variant:S?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>b(e.shiftKey),"aria-label":S?ha():bt(),type:`button`,className:`relative`,disabled:x}),children:[(0,$.jsx)(ke,{className:m(S&&`text-destructive`)}),S?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(j,{children:S?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,r[85]=x,r[86]=b,r[87]=S,r[88]=Ie):Ie=r[88];let Le;r[89]!==z||r[90]!==be||r[91]!==Pe||r[92]!==Fe||r[93]!==Ie||r[94]!==D?(Le=(0,$.jsxs)(`form`,{onSubmit:z,className:`surface-subheader gap-1 px-2`,"data-surface-subheader":!0,children:[be,Pe,Fe,Ie,D]}),r[89]=z,r[90]=be,r[91]=Pe,r[92]=Fe,r[93]=Ie,r[94]=D,r[95]=Le):Le=r[95];let Re;r[96]===c?Re=r[97]:(Re=c>0?(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 rounded-r-full bg-primary transition-all duration-150 ease-out`,style:{width:`${c}%`,boxShadow:`0 0 6px 1px var(--color-ring)`}}):null,r[96]=c,r[97]=Re);let Be;return r[98]!==Le||r[99]!==Re?(Be=(0,$.jsxs)(`div`,{className:`relative`,children:[Le,Re]}),r[98]=Le,r[99]=Re,r[100]=Be):Be=r[100],Be}function io(e){try{let t=new URL(e.url),n=new URL(e.environmentHttpBaseUrl);if(t.origin===n.origin&&t.pathname.startsWith(`/api/assets/`)){let n=t.pathname.split(`/`).at(-1);if(!n)return null;let r=decodeURIComponent(n);return!r||r===`.`||r===`..`?null:`${e.environmentLabel} · ${r}`}return t.protocol===`http:`||t.protocol===`https:`?t.host:null}catch{return null}}function ao(e){let t=(0,Q.c)(6),{className:n}=e,r;t[0]===n?r=t[1]:(r=m(`relative flex flex-col gap-0.5 overflow-hidden rounded-[5px] border border-border/60 bg-card p-1 shadow-xs/5`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-destructive/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-warning/80`}),(0,$.jsx)(`span`,{className:`size-[3px] rounded-full bg-success/80`})]}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`div`,{className:`mt-[1px] flex flex-1 flex-col gap-[2px]`,children:[(0,$.jsx)(`span`,{className:`h-[2px] w-full rounded-full bg-muted-foreground/30`}),(0,$.jsx)(`span`,{className:`h-[2px] w-3/5 rounded-full bg-muted-foreground/20`})]}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,$.jsxs)(`div`,{"aria-hidden":!0,className:r,children:[i,a]}),t[4]=r,t[5]=o),o}function oo(e){let t=(0,Q.c)(17),{server:n,onOpen:r}=e,i;t[0]===n?i=t[1]:(i=so(n),t[0]=n,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ao,{className:`size-7 shrink-0`}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:a}),t[3]=a,t[4]=s);let c;t[5]!==n.host||t[6]!==n.port?(c=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[n.host,`:`,n.port]}),t[5]=n.host,t[6]=n.port,t[7]=c):c=t[7];let l;t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u;t[11]===n.listening?u=t[12]:(u=n.listening?(0,$.jsx)(co,{}):(0,$.jsx)(lo,{}),t[11]=n.listening,t[12]=u);let d;return t[13]!==r||t[14]!==l||t[15]!==u?(d=(0,$.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex w-full items-center gap-3 px-3 py-3 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[o,l,u]}),t[13]=r,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function so(e){return e.processName?e.processName:e.listening?dr():e.source===`configured`?`Configured`:bi()}function co(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=dr(),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`span`,{"aria-label":t,className:`relative inline-flex size-2 shrink-0`,children:[(0,$.jsx)(`span`,{className:`absolute inset-0 animate-status-ping rounded-full bg-success opacity-60`}),(0,$.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-success`})]}),e[1]=n):n=e[1],n}function lo(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`span`,{"aria-label":oi(),className:`size-2 shrink-0 rounded-full bg-muted-foreground/40`}),e[0]=t):t=e[0],t}function uo(e){let t=(0,Q.c)(7),n=te(e.environmentId),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==e.recentlySeenUrls||t[3]!==n){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:H(e.environmentId,t.url)}),t[5]=e.environmentId,t[6]=i),r=fo({scanner:n.map(i),configuredUrls:e.configuredUrls??[],recentlySeenUrls:e.recentlySeenUrls??[]}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=e.recentlySeenUrls,t[3]=n,t[4]=r}else r=t[4];return r}function fo(e){let t=new Map;for(let n of e.configuredUrls){let e=mo(n);if(!e)continue;let r=po(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`configured`,listening:!1})}for(let n of e.scanner){let e=po(n.host,n.port),r=t.get(e);if(r){t.set(e,{...r,processName:n.processName??r.processName,pid:n.pid??r.pid,terminal:n.terminal??r.terminal,listening:!0});continue}t.set(e,{...n,source:`scanner`,listening:!0})}for(let n of e.recentlySeenUrls){let e=mo(n);if(!e)continue;let r=po(e.host,e.port);t.has(r)||t.set(r,{host:e.host,port:e.port,url:e.url,processName:null,pid:null,terminal:null,source:`recent`,listening:!1})}return Array.from(t.values()).toSorted((e,t)=>{let n={configured:0,scanner:1,recent:2};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function po(e,t){return`${e.toLowerCase()}:${t}`}function mo(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!ne(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function ho(e){let t=(0,Q.c)(19),{environmentId:n,configuredUrls:r,recentlySeenUrls:i,onOpenUrl:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o={environmentId:n,configuredUrls:r,recentlySeenUrls:i},t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=uo(o);if(s.length===0){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ue,{variant:`icon`,children:(0,$.jsx)(Te,{className:`size-4.5 text-muted-foreground`})}),t[4]=e):e=t[4];let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(re,{children:$r()}),t[5]=n):n=t[5];let r;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(he,{children:[e,n,(0,$.jsx)(fe,{children:An()})]}),t[6]=r):r=t[6],r}let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Me,{className:`size-4 shrink-0`}),t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[c,(0,$.jsx)(`h2`,{className:`font-medium`,children:Tr()})]}),t[8]=l):l=t[8];let u;if(t[9]!==a||t[10]!==s){let e;t[12]===a?e=t[13]:(e=e=>(0,$.jsx)(oo,{server:e,onOpen:()=>a(e.url)},`${e.host}:${e.port}`),t[12]=a,t[13]=e),u=s.map(e),t[9]=a,t[10]=s,t[11]=u}else u=t[11];let d;t[14]===u?d=t[15]:(d=(0,$.jsx)(`div`,{className:`flex flex-col divide-y divide-border/60 overflow-hidden rounded-xl border border-border/70 bg-background`,children:u}),t[14]=u,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:Ji()}),t[16]=f):f=t[16];let p;return t[17]===d?p=t[18]:(p=(0,$.jsx)(`div`,{className:`flex h-full min-h-0 overflow-y-auto px-5 py-8`,children:(0,$.jsxs)(`div`,{className:`m-auto flex w-full max-w-xl flex-col gap-3`,children:[l,d,f]})}),t[17]=d,t[18]=p),p}function go(e){let r=(0,Q.c)(65),{tabId:a,hasWebContents:o,zoomFactor:s,deviceToolbarVisible:c,onToggleDeviceToolbar:l}=e;if(!X)return null;let d=!a||!o,f;r[0]===a?f=r[1]:(f=e=>()=>{a&&e(a).catch(So)},r[0]=a,r[1]=f);let m=f,g;r[2]===s?g=r[3]:(g=Math.round(s*100),r[2]=s,r[3]=g);let _=`${g}%`,v;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(i,{render:(0,$.jsx)(u,{render:(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":Mr()})}),children:(0,$.jsx)(Ae,{})}),r[4]=v):v=r[4];let b;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(t,{children:[v,(0,$.jsx)(j,{children:zr()})]}),r[5]=b):b=r[5];let x;r[6]===m?x=r[7]:(x=m(X.hardReload),r[6]=m,r[7]=x);let S;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=Wn(),r[8]=S):S=r[8];let C;r[9]!==x||r[10]!==d?(C=(0,$.jsx)(M,{onClick:x,disabled:d,children:S}),r[9]=x,r[10]=d,r[11]=C):C=r[11];let w;r[12]===m?w=r[13]:(w=m(X.openDevTools),r[12]=m,r[13]=w);let T;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=pi(),r[14]=T):T=r[14];let E;r[15]!==w||r[16]!==d?(E=(0,$.jsx)(M,{onClick:w,disabled:d,children:T}),r[15]=w,r[16]=d,r[17]=E):E=r[17];let D;r[18]===c?D=r[19]:(D=c?ir():ta(),r[18]=c,r[19]=D);let O;r[20]!==l||r[21]!==D||r[22]!==d?(O=(0,$.jsx)(M,{onClick:l,disabled:d,children:D}),r[20]=l,r[21]=D,r[22]=d,r[23]=O):O=r[23];let k;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(p,{}),r[24]=k):k=r[24];let A;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`span`,{children:Ia()}),r[25]=A):A=r[25];let N;r[26]===m?N=r[27]:(N=m(X.zoomOut),r[26]=m,r[27]=N);let P;r[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=Xa(),r[28]=P):P=r[28];let F;r[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(Ee,{}),r[29]=F):F=r[29];let I;r[30]!==N||r[31]!==d?(I=(0,$.jsx)(n,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:N,"aria-label":P,disabled:d,children:F}),r[30]=N,r[31]=d,r[32]=I):I=r[32];let L;r[33]===_?L=r[34]:(L=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:_}),r[33]=_,r[34]=L);let R;r[35]===m?R=r[36]:(R=m(X.zoomIn),r[35]=m,r[36]=R);let z;r[37]===Symbol.for(`react.memo_cache_sentinel`)?(z=Ua(),r[37]=z):z=r[37];let B;r[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(De,{}),r[38]=B):B=r[38];let V;r[39]!==R||r[40]!==d?(V=(0,$.jsx)(n,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:R,"aria-label":z,disabled:d,children:B}),r[39]=R,r[40]=d,r[41]=V):V=r[41];let H;r[42]===m?H=r[43]:(H=m(X.resetZoom),r[42]=m,r[43]=H);let U;r[44]===Symbol.for(`react.memo_cache_sentinel`)?(U=Pi(),r[44]=U):U=r[44];let W;r[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(ie,{}),r[45]=W):W=r[45];let G;r[46]!==H||r[47]!==d?(G=(0,$.jsx)(n,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:H,"aria-label":U,disabled:d,children:W}),r[46]=H,r[47]=d,r[48]=G):G=r[48];let K;r[49]!==I||r[50]!==L||r[51]!==V||r[52]!==G?(K=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[I,L,V,G]}),r[49]=I,r[50]=L,r[51]=V,r[52]=G,r[53]=K):K=r[53];let q;r[54]!==K||r[55]!==d?(q=(0,$.jsxs)(M,{closeOnClick:!1,onClick:xo,className:`justify-between`,disabled:d,children:[A,K]}),r[54]=K,r[55]=d,r[56]=q):q=r[56];let J;r[57]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(p,{}),r[57]=J):J=r[57];let ee;r[58]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(M,{onClick:yo,children:Jt()}),r[58]=ee):ee=r[58];let te;r[59]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(M,{onClick:_o,children:Vt()}),r[59]=te):te=r[59];let ne;return r[60]!==E||r[61]!==O||r[62]!==q||r[63]!==C?(ne=(0,$.jsxs)(y,{children:[b,(0,$.jsxs)(h,{align:`end`,sideOffset:6,className:`min-w-56`,children:[C,E,O,k,q,J,ee,te]})]}),r[60]=E,r[61]=O,r[62]=q,r[63]=C,r[64]=ne):ne=r[64],ne}function _o(){X.clearCache().catch(vo)}function vo(){}function yo(){X.clearCookies().catch(bo)}function bo(){}function xo(e){return e.preventDefault()}function So(){}function Co(e,t){return U[t]||(t.length>0?t:`Network error (${e})`)}function wo(e){let t=(0,Q.c)(36),{url:r,code:i,description:a,onReload:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===r?l=t[1]:(l=Do(r)??r,t[0]=r,t[1]=l);let u=l,d;t[2]!==i||t[3]!==a?(d=Co(i,a),t[2]=i,t[3]=a,t[4]=d):d=t[4];let f=d,p;t[5]!==i||t[6]!==a?(p=a.length>0?a:`ERR_${Math.abs(i)||`FAILED`}`,t[5]=i,t[6]=a,t[7]=p):p=t[7];let m=p,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Eo,{className:`mb-6 size-12 text-muted-foreground/70`}),t[8]=h):h=t[8];let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:ka()}),t[9]=g):g=t[9];let _;t[10]===u?_=t[11]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[10]=u,t[11]=_);let v;t[12]!==f||t[13]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[12]=f,t[13]=_,t[14]=v):v=t[14];let y;t[15]===s?y=t[16]:(y=s?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:Sa()}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:Dt()}),(0,$.jsx)(`li`,{children:ln()}),(0,$.jsx)(`li`,{children:Pt()})]})]}):null,t[15]=s,t[16]=y);let b;t[17]===m?b=t[18]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[17]=m,t[18]=b);let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(To),t[19]=x):x=t[19];let S;t[20]===s?S=t[21]:(S=s?Zn():Cn(),t[20]=s,t[21]=S);let C;t[22]===S?C=t[23]:(C=(0,$.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[22]=S,t[23]=C);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`div`,{className:`flex-1`}),t[24]=w):w=t[24];let T;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(T=Di(),t[25]=T):T=t[25];let E;t[26]===o?E=t[27]:(E=(0,$.jsx)(n,{type:`button`,size:`sm`,onClick:o,children:T}),t[26]=o,t[27]=E);let D;t[28]!==C||t[29]!==E?(D=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[C,w,E]}),t[28]=C,t[29]=E,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==v||t[33]!==y||t[34]!==b?(O=(0,$.jsx)(`div`,{className:`relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,D]})}),t[31]=D,t[32]=v,t[33]=y,t[34]=b,t[35]=O):O=t[35],O}function To(e){return!e}function Eo(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Do(e){try{return new URL(e).host}catch{return null}}var Oo=new Set([`Alt`,`Control`,`Meta`,`Shift`]),ko=e=>e===1?`middle`:e===2?`right`:`left`,Ao=(e,t,n,r,i=!1)=>{let a=e.getBoundingClientRect();if(a.width<=0||a.height<=0)return null;let o=Math.min(a.width/t.width,a.height/t.height),s=t.width*o,c=t.height*o,l=a.left+(a.width-s)/2,u=a.top+(a.height-c)/2;return!i&&(n<l||n>l+s||r<u||r>u+c)?null:{x:Math.min(t.width-1,Math.max(0,(n-l)/o)),y:Math.min(t.height-1,Math.max(0,(r-u)/o))}};function jo(e){let t=(0,Q.c)(58),{threadRef:n,tabId:r,viewport:i,visible:a,className:o}=e,s=(0,Z.useRef)(null),c=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={label:`collaborative preview input`,reportDefect:!1,reportFailure:!1},t[0]=d):d=t[0];let f=C(Y.humanInput,d),p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p={label:`collaborative preview presentation`,reportDefect:!1,reportFailure:!1},t[1]=p):p=t[1];let h=C(Y.present,p),g;t[2]!==r||t[3]!==n.environmentId||t[4]!==n.threadId?(g=Y.frames({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r}}),t[2]=r,t[3]=n.environmentId,t[4]=n.threadId,t[5]=g):g=t[5];let _=S(g),v;t[6]===_?v=t[7]:(v=l(_)?_.value:null,t[6]=_,t[7]=v);let y=v,b=y?`data:${y.mimeType};base64,${y.data}`:null,x;t[8]!==f||t[9]!==r||t[10]!==n.environmentId||t[11]!==n.threadId?(x=e=>{f({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r,event:e}})},t[8]=f,t[9]=r,t[10]=n.environmentId,t[11]=n.threadId,t[12]=x):x=t[12];let w=x,T,E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{u.current!==null&&cancelAnimationFrame(u.current)},E=[],t[13]=T,t[14]=E):(T=t[13],E=t[14]),(0,Z.useEffect)(T,E);let D;t[15]!==h||t[16]!==r||t[17]!==n.environmentId||t[18]!==n.threadId||t[19]!==i._tag||t[20]!==a?(D=()=>{let e=s.current;if(!e||!a||i._tag!==`fill`)return;let t=0,o=0,c=new ResizeObserver(e=>{let[i]=e;if(!i)return;let a=Math.max(1,Math.round(i.contentRect.width)),s=Math.max(1,Math.round(i.contentRect.height));a===t&&s===o||(t=a,o=s,h({environmentId:n.environmentId,input:{threadId:n.threadId,tabId:r,viewport:{width:a,height:s}}}))});return c.observe(e),()=>c.disconnect()},t[15]=h,t[16]=r,t[17]=n.environmentId,t[18]=n.threadId,t[19]=i._tag,t[20]=a,t[21]=D):D=t[21];let O;t[22]!==h||t[23]!==r||t[24]!==n||t[25]!==i._tag||t[26]!==a?(O=[h,r,n,i._tag,a],t[22]=h,t[23]=r,t[24]=n,t[25]=i._tag,t[26]=a,t[27]=O):O=t[27],(0,Z.useEffect)(D,O);let k;t[28]===y?k=t[29]:(k=(e,t)=>{let n=s.current;return n&&y?Ao(n,y,e,t):null},t[28]=y,t[29]=k);let A=k,j;t[30]!==w||t[31]!==A?(j=e=>{let t=A(e.clientX,e.clientY);t&&(c.current={_tag:`pointerMove`,...t},u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null;let e=c.current;c.current=null,e&&w(e)})))},t[30]=w,t[31]=A,t[32]=j):j=t[32];let M=j,N;t[33]!==w||t[34]!==A?(N=e=>{let t=A(e.clientX,e.clientY);t&&(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),w({_tag:`pointerDown`,...t,button:ko(e.button)}))},t[33]=w,t[34]=A,t[35]=N):N=t[35];let P=N,F;t[36]!==w||t[37]!==y||t[38]!==A?(F=e=>{let t=e.currentTarget.hasPointerCapture(e.pointerId),n=t&&y?Ao(e.currentTarget,y,e.clientX,e.clientY,!0):A(e.clientX,e.clientY);n&&(e.preventDefault(),t&&e.currentTarget.releasePointerCapture(e.pointerId),w({_tag:`pointerUp`,...n,button:ko(e.button)}))},t[36]=w,t[37]=y,t[38]=A,t[39]=F):F=t[39];let I=F,L;t[40]!==w||t[41]!==A?(L=e=>{let t=A(e.clientX,e.clientY);t&&(e.preventDefault(),w({_tag:`wheel`,...t,deltaX:e.deltaX,deltaY:e.deltaY}))},t[40]=w,t[41]=A,t[42]=L):L=t[42];let R=L,z;t[43]===w?z=t[44]:(z=e=>{if(Oo.has(e.key))return;e.preventDefault(),e.stopPropagation();let t=[];e.altKey&&t.push(`Alt`),e.ctrlKey&&t.push(`Control`),e.metaKey&&t.push(`Meta`),e.shiftKey&&t.push(`Shift`),w({_tag:`keyPress`,key:e.key===` `?`Space`:e.key,modifiers:t})},t[43]=w,t[44]=z);let B=z,V;t[45]===o?V=t[46]:(V=m(`touch-none select-none overflow-hidden bg-black outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/60`,o),t[45]=o,t[46]=V);let H;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=tn(),t[47]=H):H=t[47];let U;t[48]===b?U=t[49]:(U=b?(0,$.jsx)(`img`,{src:b,alt:``,draggable:!1,className:`pointer-events-none h-full w-full object-contain`}):(0,$.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-background text-xs text-muted-foreground`,children:gn()}),t[48]=b,t[49]=U);let W;return t[50]!==B||t[51]!==P||t[52]!==M||t[53]!==I||t[54]!==R||t[55]!==V||t[56]!==U?(W=(0,$.jsx)(`div`,{ref:s,className:V,role:`application`,"aria-label":H,tabIndex:0,onContextMenu:Mo,onKeyDown:B,onPointerDown:P,onPointerMove:M,onPointerCancel:I,onPointerUp:I,onWheel:R,children:U}),t[50]=B,t[51]=P,t[52]=M,t[53]=I,t[54]=R,t[55]=V,t[56]=U,t[57]=W):W=t[57],W}function Mo(e){return e.preventDefault()}function No(e){let t=e.toLowerCase();return t.includes(`mac`)?`Reveal in Finder`:t.includes(`win`)?`Reveal in File Explorer`:`Reveal in Files`}function Po(e){let t=(0,Q.c)(7),{tabId:n,visible:r,className:i}=e,a=(0,Z.useRef)(null),o,s;t[0]!==n||t[1]!==r?(o=()=>{let e=a.current;if(!e)return;let t=be(n),i=()=>{let n=e.getBoundingClientRect();t.present({x:Math.round(n.x),y:Math.round(n.y),width:Math.max(1,Math.round(n.width)),height:Math.max(1,Math.round(n.height))},r&&n.width>0&&n.height>0)};i();let o=new ResizeObserver(i);return o.observe(e),window.addEventListener(`resize`,i),window.addEventListener(`scroll`,i,!0),()=>{o.disconnect(),window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0),t.release()}},s=[n,r],t[0]=n,t[1]=r,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,Z.useLayoutEffect)(o,s);let c;return t[4]!==i||t[5]!==n?(c=(0,$.jsx)(`div`,{ref:a,className:i,"data-browser-surface-slot":n}),t[4]=i,t[5]=n,t[6]=c):c=t[6],c}var Fo=120,Io=220,Lo=4,Ro=90,zo=.08,Bo=.5;function Vo(e){let[t,n]=(0,Z.useState)(0),r=(0,Z.useRef)(0);return r.current=t,(0,Z.useEffect)(()=>{if(!e){if(r.current===0)return;n(100);let e=window.setTimeout(()=>n(0),Io);return()=>window.clearTimeout(e)}n(e=>e>0&&e<95?e:Lo);let t=window.setInterval(()=>{let e=r.current;if(e>=Ro)return;let t=Ro-e,i=Math.max(Bo,t*zo);n(Math.min(Ro,e+i))},Fo);return()=>window.clearInterval(t)},[e]),t}var Ho=class extends o()(`PreviewSessionThreadKeyParseError`,{threadKey:c}){get message(){return`Invalid scoped preview thread key: ${this.threadKey}`}},Uo=r(e=>{let t=v(e);if(t===null)throw new Ho({threadKey:e});let n=Y.list({environmentId:t.environmentId,input:{threadId:t.threadId}}),r=Y.events({environmentId:t.environmentId,input:{}});return O(e=>{let i=!1,a=0,o=null,s=0,c=0,u=r=>{if(!l(r))return;if(r.value.sessions.length>0){o=null,a+=1,V(t,r.value.sessions);return}let s=J(t).snapshot,c=s&&s.navStatus._tag!==`Idle`?s.navStatus.url:null;if(!c){Oe(t,null);return}if(o===c)return;o=c;let u=++a;x(e.registry,Y.open,{environmentId:t.environmentId,input:{threadId:t.threadId,url:c}},{reportDefect:!1,reportFailure:!1}).then(r=>{i||u!==a||(o=null,r._tag!==`Failure`&&(Oe(t,r.value),e.refresh(n)))})},d=r=>{!l(r)||r.value.threadId!==t.threadId||(K(t,r.value),(r.value.type===`opened`||r.value.type===`closed`)&&e.refresh(n))};e.addFinalizer(()=>{i=!0,a+=1});let f=e.once(n),p=e.once(r);e.subscribe(n,e=>{s+=1,u(e)}),e.subscribe(r,e=>{c+=1,d(e)}),queueMicrotask(()=>{i||(s===0&&u(f),c===0&&d(p))})}).pipe(T(1e3),d(`preview:session-sync:${e}`))});function Wo(e){let t=(0,Q.c)(2),n;t[0]===e?n=t[1]:(n=Uo(N(e)),t[0]=e,t[1]=n),S(n)}var Go=1500,Ko=.001;function qo(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Ko))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},Go),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=m(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let h;return t[7]!==u||t[8]!==d||t[9]!==p?(h=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=h):h=t[10],h}function Jo(e,t){return e?1:t===`human`?.18:.35}var Yo=700;function Xo(e){let t=(0,Q.c)(9),{tabId:n,zoomFactor:r,controller:i}=e,a;t[0]===n?a=t[1]:(a=e=>e.byTabId[n]??null,t[0]=n,t[1]=a);let o=Ce(a),s;t[2]===n?s=t[3]:(s=e=>e.byTabId[n]?.content??null,t[2]=n,t[3]=s);let c=se(s);if(!o)return null;let l;return t[4]!==c||t[5]!==i||t[6]!==o||t[7]!==r?(l=(0,$.jsx)(Zo,{event:o,content:c,zoomFactor:r,controller:i},o.sequence),t[4]=c,t[5]=i,t[6]=o,t[7]=r,t[8]=l):l=t[8],l}function Zo(e){let t=(0,Q.c)(15),{event:n,content:r,zoomFactor:i,controller:a}=e,[o,s]=(0,Z.useState)(!0),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=window.setTimeout(()=>s(!1),Yo);return()=>window.clearTimeout(e)},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Z.useEffect)(c,l);let u;t[2]!==o||t[3]!==a?(u=Jo(o,a),t[2]=o,t[3]=a,t[4]=u):u=t[4];let d=`translate3d(${n.x*i*(r?.scale??1)+(r?.x??0)-(r?.scrollLeft??0)}px, ${n.y*i*(r?.scale??1)+(r?.y??0)-(r?.scrollTop??0)}px, 0)`,f;t[5]!==u||t[6]!==d?(f={opacity:u,transform:d},t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;t[8]!==n.phase||t[9]!==n.sequence?(p=n.phase===`click`?(0,$.jsx)(`span`,{className:`absolute left-0.5 top-0.5 size-4 animate-status-ping rounded-full bg-primary/25 motion-reduce:animate-none`},n.sequence):null,t[8]=n.phase,t[9]=n.sequence,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(je,{className:`relative size-5 -translate-x-0.5 -translate-y-0.5 fill-background text-primary drop-shadow-sm`,strokeWidth:2}),t[11]=m):m=t[11];let h;return t[12]!==f||t[13]!==p?(h=(0,$.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-0 z-40 transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none`,style:f,"aria-hidden":`true`,"data-agent-browser-cursor":!0,children:[p,m]}),t[12]=f,t[13]=p,t[14]=h):h=t[14],h}var Qo=typeof window>`u`?null:b();function $o({threadRef:e,tabId:t,configuredUrls:n,visible:r}){let[i,a]=(0,Z.useState)(void 0),[o,s]=(0,Z.useState)(!1),c=_e(),l=(0,Z.useRef)(!1),u=(0,Z.useRef)(!0),d=B(e),p=P(e=>e.addPreviewAnnotation),m=P(e=>e.addImage),h=f(e.environmentId),g=E(e.environmentId),v=C(Y.open),y=C(Y.navigate),b=C(Y.resize,`preview viewport resize`),x=C(Y.refresh),S=C(Y.history);Wo(e),(0,Z.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let T=t??d.activeTabId,D=T?d.sessions[T]??null:null,O=T?d.desktopByTabId[T]??null:null,k=D?.navStatus??{_tag:`Idle`},A=k._tag===`Idle`?``:k.url,j=O?.loading??k._tag===`Loading`,M=O?.canGoBack??D?.canGoBack??!1,I=O?.canGoForward??D?.canGoForward??!1,L=k._tag===`Idle`,R=k._tag===`LoadFailed`,z=ce(D),V=O?.controller??(T?d.serverControllerByTabId[T]??`none`:`none`),U=Vo(j),K=A&&h&&g?io({url:A,environmentLabel:h.label,environmentHttpBaseUrl:g})??void 0:void 0,J=D?.viewport??_,te=se(e=>T?e.byTabId[T]?.rect??null:null),ne=(0,Z.useCallback)(async t=>{try{let n=H(e.environmentId,t);if(T&&X)await X.navigate(T,n),q(e,n);else if(T){let t=await y({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,url:n}});if(t._tag===`Failure`)throw w(t);ee(e,t.value),q(e,n)}else await W({openPreview:v,threadRef:e,url:n})}catch{}},[y,v,T,e]),re=(0,Z.useCallback)(()=>{if(T){if(X){X.refresh(T);return}x({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T}})}},[x,T,e]),ie=(0,Z.useCallback)(()=>{X&&T&&X.zoomIn(T)},[T]),oe=(0,Z.useCallback)(()=>{X&&T&&X.zoomOut(T)},[T]),le=(0,Z.useCallback)(()=>{X&&T&&X.resetZoom(T)},[T]),ue=(0,Z.useCallback)(async t=>{if(!T)return;let n=await b({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,viewport:t}});if(n._tag===`Failure`){let e=w(n);throw G.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}ee(e,n.value)},[b,T,e]),de=()=>{if(!T)return;if(J._tag!==`fill`){Se(T,_).catch(()=>void 0);return}let e=te?ye(te,O?.zoomFactor):{width:1024,height:768};Se(T,{_tag:`freeform`,...e}).catch(()=>void 0)};(0,Z.useEffect)(()=>{if(T)return ge(T,ue)},[ue,T]);let fe=(0,Z.useCallback)(()=>{if(T){if(X){X.goBack(T);return}S({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,direction:`back`}})}},[S,T,e]),me=(0,Z.useCallback)(()=>{if(T){if(X){X.goForward(T);return}S({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:T,direction:`forward`}})}},[S,T,e]),he=(0,Z.useCallback)(()=>{!Qo||!A||Qo.shell.openExternal(A).catch(()=>void 0)},[A]),be=(0,Z.useCallback)(e=>{if(!X||!T)return;let t=X;if(c===T){ae(T).then(e=>{if(!e)return;let n=!1,r,i=()=>{if(!navigator.clipboard?.writeText){G.update(r,F({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{n=!0,o(),window.setTimeout(()=>{n=!1,o()},2e3)},e=>{G.update(r,F({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:No(navigator.platform),onClick:()=>void t.revealArtifact(e.path)},o=()=>{G.update(r,F({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:n?`Copied!`:`Copy path`,disabled:n,onClick:i},secondaryActionVariant:`outline`}}))};r=G.add(F({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{G.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(e){if(c!==null){G.add({type:`warning`,title:`Another preview is recording`,description:`Stop the active recording before starting a new one.`});return}pe(T).catch(e=>{G.add({type:`error`,title:`Unable to start recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}t.captureScreenshot(T).then(e=>{let n={children:No(navigator.platform),onClick:()=>void t.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,t=`Screenshot saved`,o)=>{G.update(a,F({type:e,title:t,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...n},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{t.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=G.add(F({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...n},secondaryActionVariant:`outline`}}))},e=>{G.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[c,T]),xe=(0,Z.useCallback)(()=>{if(!X||!T)return;if(l.current){X.cancelPickElement(T).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null;l.current=!0,s(!0),(async()=>{try{let t=await X.pickElement(T);if(!t)return;p(e,t);let n=await ve(t);n&&t.screenshot&&m(e,{type:`image`,id:t.id,name:n.name,mimeType:n.type,sizeBytes:n.size,previewUrl:t.screenshot.dataUrl,file:n})}catch{}finally{if(l.current=!1,u.current&&s(!1),t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[m,p,T,e]);return(0,Z.useEffect)(()=>()=>{l.current&&(l.current=!1,X&&T&&X.cancelPickElement(T).catch(()=>void 0),u.current&&s(!1))},[T]),(0,Z.useEffect)(()=>{if(r)return we(e=>{switch(e){case`refresh`:re();return;case`focus-url`:a(e=>(e??0)+1);return;case`zoom-in`:ie();return;case`zoom-out`:oe();return;case`reset-zoom`:le();return;case`toggle-panel`:return}})},[re,le,ie,oe,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":N(e),children:[(0,$.jsx)(ro,{url:A,displayUrl:K,loading:j,loadProgress:U,canGoBack:M,canGoForward:I,refreshDisabled:L,focusUrlNonce:i,onBack:fe,onForward:me,onRefresh:re,onSubmit:e=>void ne(e),onOpenInBrowser:T?he:void 0,onCapture:X&&T?be:void 0,captureDisabled:!O||R,recording:T!==null&&c===T,onPickElement:X&&T?xe:void 0,pickActive:o,pickDisabled:!T||R,pickDisabledReason:R?`Page didn't load — pick unavailable until the page renders`:void 0,trailingActions:X?(0,$.jsx)(go,{tabId:T,hasWebContents:O!==null,zoomFactor:O?.zoomFactor??1,deviceToolbarVisible:J._tag!==`fill`,onToggleDeviceToolbar:de}):null}),(0,$.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[T&&D&&!z?X?(0,$.jsx)(Po,{tabId:T,visible:r&&!R,className:`absolute inset-0 h-full w-full`},T):r&&!R?(0,$.jsx)(jo,{threadRef:e,tabId:T,viewport:J,visible:r&&!R,className:`absolute inset-0 h-full w-full`},T):null:null,z?(0,$.jsx)(ho,{environmentId:e.environmentId,configuredUrls:n,recentlySeenUrls:d.recentlySeenUrls,onOpenUrl:e=>void ne(e)}):null,D&&O?(0,$.jsx)(qo,{zoomFactor:O.zoomFactor}):null,T&&O&&!z&&!R?(0,$.jsx)(Xo,{tabId:T,zoomFactor:O.zoomFactor,controller:V}):null,V===`none`?null:(0,$.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-3 z-40 rounded-full border border-border/70 bg-background/90 px-2.5 py-1 text-[11px] font-medium shadow-sm backdrop-blur`,children:V===`agent`?`Agent controlling browser`:`Human control`}),k._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(wo,{url:k.url,code:k.code,description:k.description,onReload:re})}):null]})]})}function es(e){let t=(0,Q.c)(13),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o}=e;if(!L()){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:Vi()})}),t[0]=e):e=t[0];let r;return t[1]===n?r=t[2]:(r=(0,$.jsx)(xe,{mode:n,children:e}),t[1]=n,t[2]=r),r}let s;t[3]===i?s=t[4]:(s=i===void 0?{}:{tabId:i},t[3]=i,t[4]=s);let c;t[5]!==a||t[6]!==s||t[7]!==r||t[8]!==o?(c=(0,$.jsx)($o,{threadRef:r,...s,configuredUrls:a,visible:o}),t[5]=a,t[6]=s,t[7]=r,t[8]=o,t[9]=c):c=t[9];let l;return t[10]!==n||t[11]!==c?(l=(0,$.jsx)(xe,{mode:n,children:c}),t[10]=n,t[11]=c,t[12]=l):l=t[12],l}export{es as PreviewPanel};