sidediff 0.2.3 → 0.3.1

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 (87) hide show
  1. package/README.md +16 -1
  2. package/dist/cli.js +59 -14
  3. package/dist/git.js +0 -1
  4. package/dist/notes.js +50 -18
  5. package/dist/protocol.js +58 -0
  6. package/dist/repo.js +5 -3
  7. package/dist/server.js +91 -23
  8. package/dist/web/assets/{angular-html-KvMUz706.js → angular-html-dpkqgbRV.js} +1 -1
  9. package/dist/web/assets/{angular-ts-NlM5GifH.js → angular-ts-CsmXxkwl.js} +1 -1
  10. package/dist/web/assets/{apl-BXWiWEVo.js → apl-Cb01Bf5P.js} +1 -1
  11. package/dist/web/assets/{astro-Bhx06L1l.js → astro-C66OEn5O.js} +1 -1
  12. package/dist/web/assets/{blade-BlUBx0PC.js → blade-El75k66R.js} +1 -1
  13. package/dist/web/assets/{c-C0eQNQNW.js → c-Bhdr_xah.js} +1 -1
  14. package/dist/web/assets/{chapel-CKFpmDLJ.js → chapel-C5KQsiHG.js} +1 -1
  15. package/dist/web/assets/{cobol-DwsyCr9b.js → cobol-BRb1H5HB.js} +1 -1
  16. package/dist/web/assets/{coffee-C4hkhraW.js → coffee-NR0si6Vq.js} +1 -1
  17. package/dist/web/assets/{cpp-Bs3Ktq9r.js → cpp-DVyXcCha.js} +1 -1
  18. package/dist/web/assets/{crystal-DMpaaMhJ.js → crystal-0irrWVMC.js} +1 -1
  19. package/dist/web/assets/{css-DtPqiQGm.js → css-B69tIC5-.js} +1 -1
  20. package/dist/web/assets/{edge-ZfatZ85-.js → edge-Dfies4ns.js} +1 -1
  21. package/dist/web/assets/{elixir-F3RMzoCL.js → elixir-CkHYLBMl.js} +1 -1
  22. package/dist/web/assets/{elm-BGJ0PgxU.js → elm-BM3XZF_H.js} +1 -1
  23. package/dist/web/assets/{erb-C7WsHgWS.js → erb-ibsMVJQV.js} +1 -1
  24. package/dist/web/assets/{git-rebase-hktnMhXh.js → git-rebase-v0T8i51i.js} +1 -1
  25. package/dist/web/assets/{glimmer-js-DajRjYwP.js → glimmer-js-DLkiF188.js} +1 -1
  26. package/dist/web/assets/{glimmer-ts-dnv4My2j.js → glimmer-ts-C1MfSiD_.js} +1 -1
  27. package/dist/web/assets/{glsl-BVmpNKLS.js → glsl-DmJpMzIS.js} +1 -1
  28. package/dist/web/assets/{graphql-DCDJyx6a.js → graphql-Bx_gWPNL.js} +1 -1
  29. package/dist/web/assets/{hack-bEVwbA5b.js → hack-zuzo4z8C.js} +1 -1
  30. package/dist/web/assets/{haml-CdgCZHNu.js → haml-2O-haJVu.js} +1 -1
  31. package/dist/web/assets/{handlebars-BgotjozU.js → handlebars-DW9-jkUL.js} +1 -1
  32. package/dist/web/assets/{html-DSG7GFxE.js → html-4b-UbCWm.js} +1 -1
  33. package/dist/web/assets/{html-derivative-CYDMDI-0.js → html-derivative-lCJLFQ95.js} +1 -1
  34. package/dist/web/assets/{http-XatvGKBy.js → http-CkqYUsMn.js} +1 -1
  35. package/dist/web/assets/{hurl-BCQmW8qD.js → hurl-BpcUpblR.js} +1 -1
  36. package/dist/web/assets/index-BxMmt431.js +1584 -0
  37. package/dist/web/assets/{index-BQY0pgMH.css → index-Vivty9_l.css} +1 -1
  38. package/dist/web/assets/{java-Dm2W5EfJ.js → java-p9UcnYwP.js} +1 -1
  39. package/dist/web/assets/{javascript-C2_AZCD8.js → javascript-Dlz1Uo-L.js} +1 -1
  40. package/dist/web/assets/{jinja-CwzMoVwz.js → jinja-Bpg33dsD.js} +1 -1
  41. package/dist/web/assets/{jison-DsBwpiNe.js → jison-By-VToHw.js} +1 -1
  42. package/dist/web/assets/{json-jdIt9h50.js → json-BxAha_TD.js} +1 -1
  43. package/dist/web/assets/{jsx-Btu-zt-Q.js → jsx-DSiXkHRj.js} +1 -1
  44. package/dist/web/assets/{julia-CZUYdDvB.js → julia-D0yc7GFR.js} +1 -1
  45. package/dist/web/assets/{just-D532zIY8.js → just-C2DI3pUP.js} +1 -1
  46. package/dist/web/assets/{latex-D2J5-TH0.js → latex-DMT_f-3C.js} +1 -1
  47. package/dist/web/assets/{liquid-WY7D0fMm.js → liquid-DiASchGu.js} +1 -1
  48. package/dist/web/assets/{lua-Baa_WEf0.js → lua-BafzqdQU.js} +1 -1
  49. package/dist/web/assets/{marko-DsygGl2f.js → marko-oJq8ByTy.js} +1 -1
  50. package/dist/web/assets/{mdc-BcGy04Fp.js → mdc-RuZg9ymz.js} +1 -1
  51. package/dist/web/assets/{nginx-B86ZxrAw.js → nginx-B4H34M9v.js} +1 -1
  52. package/dist/web/assets/{nim-BM686CfU.js → nim-Cw8zuJky.js} +1 -1
  53. package/dist/web/assets/{org-RvFkgp46.js → org-hVregGpI.js} +1 -1
  54. package/dist/web/assets/{perl-C6U9yGM0.js → perl-CwTUPbAz.js} +1 -1
  55. package/dist/web/assets/{php-uAYB-Mtd.js → php-gQC_Fmii.js} +1 -1
  56. package/dist/web/assets/{pug-6ncXSInX.js → pug-D6dZj3jJ.js} +1 -1
  57. package/dist/web/assets/{qml-BE1B7Quf.js → qml-E4rdecj4.js} +1 -1
  58. package/dist/web/assets/{r-BZJcu9wg.js → r-DR6ad8yZ.js} +1 -1
  59. package/dist/web/assets/{razor-BKwfOyyl.js → razor-D8M2A4M7.js} +1 -1
  60. package/dist/web/assets/{regexp-Dih_I1qs.js → regexp-DSjZ8XWG.js} +1 -1
  61. package/dist/web/assets/{rst-DHEdAr-V.js → rst-DQnNZTXl.js} +1 -1
  62. package/dist/web/assets/{ruby-BbWx5B9V.js → ruby-BJSAqM9X.js} +1 -1
  63. package/dist/web/assets/{sas-Df5EO-Nu.js → sas-cMF9FoL4.js} +1 -1
  64. package/dist/web/assets/{scss-XJX16h32.js → scss-D1ikNPGF.js} +1 -1
  65. package/dist/web/assets/{shellscript-Dxd4inRL.js → shellscript-D4nS65SB.js} +1 -1
  66. package/dist/web/assets/{shellsession-Df2uEcSZ.js → shellsession-BX-bfrSn.js} +1 -1
  67. package/dist/web/assets/{soy-B9Ytzufd.js → soy-B8DHGyol.js} +1 -1
  68. package/dist/web/assets/{sql-Eeo1bdO9.js → sql-BXnvc70Q.js} +1 -1
  69. package/dist/web/assets/{stata-DJp7s67I.js → stata-i4_4KZkj.js} +1 -1
  70. package/dist/web/assets/{surrealql-CDYi7ARY.js → surrealql-CJYktgMP.js} +1 -1
  71. package/dist/web/assets/{svelte-BjXPUNXf.js → svelte-DkTFRfzJ.js} +1 -1
  72. package/dist/web/assets/{templ-CfTV__LG.js → templ-DR-sPCuW.js} +1 -1
  73. package/dist/web/assets/{tex-yGzDqfiz.js → tex-Bm81cpcu.js} +1 -1
  74. package/dist/web/assets/{ts-tags-H73Fp8-B.js → ts-tags-8o0M5w05.js} +1 -1
  75. package/dist/web/assets/{tsx-D0NsN8tR.js → tsx-DPlNg7Ry.js} +1 -1
  76. package/dist/web/assets/{twig-BxcdexCK.js → twig-Cteaw1dL.js} +1 -1
  77. package/dist/web/assets/{typescript-CTohDgGQ.js → typescript-CZO0lWCV.js} +1 -1
  78. package/dist/web/assets/{typst-BHhe5E0i.js → typst-BFzy4EUn.js} +1 -1
  79. package/dist/web/assets/{vue-xxrWY3vq.js → vue-Cvhq1cTP.js} +1 -1
  80. package/dist/web/assets/{vue-html-DZJ0eUb2.js → vue-html-BTAnySQ7.js} +1 -1
  81. package/dist/web/assets/{vue-vine-b741IG4q.js → vue-vine-BLuytsGS.js} +1 -1
  82. package/dist/web/assets/{xml-CVHrHsRm.js → xml-HIAzbxU_.js} +1 -1
  83. package/dist/web/assets/{xsl-Bo14RTqx.js → xsl-ZYoNgca3.js} +1 -1
  84. package/dist/web/assets/{yaml-769gRZTS.js → yaml-Bc5rHCoM.js} +1 -1
  85. package/dist/web/index.html +2 -2
  86. package/package.json +1 -1
  87. package/dist/web/assets/index-C7UosTBH.js +0 -1584
@@ -0,0 +1,1584 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-dpkqgbRV.js","assets/html-4b-UbCWm.js","assets/javascript-Dlz1Uo-L.js","assets/css-B69tIC5-.js","assets/angular-ts-CsmXxkwl.js","assets/scss-D1ikNPGF.js","assets/apl-Cb01Bf5P.js","assets/xml-HIAzbxU_.js","assets/java-p9UcnYwP.js","assets/json-BxAha_TD.js","assets/astro-C66OEn5O.js","assets/typescript-CZO0lWCV.js","assets/postcss-BXeXVLqQ.js","assets/tsx-DPlNg7Ry.js","assets/blade-El75k66R.js","assets/html-derivative-lCJLFQ95.js","assets/sql-BXnvc70Q.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-C5KQsiHG.js","assets/c-Bhdr_xah.js","assets/cobol-BRb1H5HB.js","assets/coffee-NR0si6Vq.js","assets/cpp-DVyXcCha.js","assets/regexp-DSjZ8XWG.js","assets/glsl-DmJpMzIS.js","assets/crystal-0irrWVMC.js","assets/shellscript-D4nS65SB.js","assets/edge-Dfies4ns.js","assets/elixir-CkHYLBMl.js","assets/elm-BM3XZF_H.js","assets/erb-ibsMVJQV.js","assets/ruby-BJSAqM9X.js","assets/haml-2O-haJVu.js","assets/graphql-Bx_gWPNL.js","assets/jsx-DSiXkHRj.js","assets/lua-BafzqdQU.js","assets/yaml-Bc5rHCoM.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-v0T8i51i.js","assets/glimmer-js-DLkiF188.js","assets/glimmer-ts-C1MfSiD_.js","assets/hack-zuzo4z8C.js","assets/handlebars-DW9-jkUL.js","assets/http-CkqYUsMn.js","assets/hurl-BpcUpblR.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-Bpg33dsD.js","assets/jison-By-VToHw.js","assets/julia-D0yc7GFR.js","assets/r-DR6ad8yZ.js","assets/just-C2DI3pUP.js","assets/perl-CwTUPbAz.js","assets/latex-DMT_f-3C.js","assets/tex-Bm81cpcu.js","assets/liquid-DiASchGu.js","assets/marko-oJq8ByTy.js","assets/less-DVTAwKKz.js","assets/mdc-RuZg9ymz.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-B4H34M9v.js","assets/nim-Cw8zuJky.js","assets/org-hVregGpI.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-gQC_Fmii.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-ZYoNgca3.js","assets/pug-D6dZj3jJ.js","assets/qml-E4rdecj4.js","assets/razor-D8M2A4M7.js","assets/rst-DQnNZTXl.js","assets/cmake-Bj61d0ZC.js","assets/sas-cMF9FoL4.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-BX-bfrSn.js","assets/soy-B8DHGyol.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-i4_4KZkj.js","assets/surrealql-CJYktgMP.js","assets/svelte-DkTFRfzJ.js","assets/templ-DR-sPCuW.js","assets/ts-tags-8o0M5w05.js","assets/twig-Cteaw1dL.js","assets/typst-BFzy4EUn.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-Cvhq1cTP.js","assets/vue-html-BTAnySQ7.js","assets/vue-vine-BLuytsGS.js","assets/stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},d={pipe(){return u(this,arguments)}},f=function(){function e(){}return e.prototype=d,e}(),p=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},m=e=>e,h=e=>()=>e,g=h(!0),_=h(!1),v=h(void 0),y=v;function b(e,...t){return u(e,t)}function x(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function S(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function C(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var w=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},T=new WeakSet,E=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),D=0,O=()=>{D++};function ee(e){return typeof e==`string`}function te(e){return typeof e==`number`}function ne(e){return typeof e==`boolean`}function re(e){return typeof e==`function`}function ie(e){return e!=null}function k(e){return!1}function ae(e){return!0}function oe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function se(e){return typeof e==`object`&&!!e||re(e)}var A=p(2,(e,t)=>se(e)&&t in e),ce=p(2,(e,t)=>A(e,`_tag`)&&e._tag===t);function le(e){return e instanceof Error}function ue(e){return A(e,Symbol.iterator)||ee(e)}var de=`~effect/Hash`,fe=e=>{switch(typeof e){case`number`:return _e(e);case`bigint`:return ve(e.toString(10));case`string`:return ve(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?ve(`Invalid Date`):ve(e.toISOString());if(e instanceof RegExp)return ve(e.toString());{if(T.has(e))return pe(e);let t=De.get(e);if(t!==void 0)return t;if(Oe.has(e))return O(),ve(`[Circular]`);Oe.add(e);let n=D,r;try{r=`~effect/Hash`in e?e[de]():typeof e==`function`?pe(e):e instanceof DataView?Se(E(e)):Array.isArray(e)||ArrayBuffer.isView(e)?Se(e):e instanceof Map?Ce(e):e instanceof Set?Te(e):be(e)}finally{Oe.delete(e)}return n===D&&De.set(e,r),r}}return ge(me(ve(String(e))))},pe=e=>(Ee.has(e)||Ee.set(e,ge(Math.random()*4294967296|0)),Ee.get(e)),me=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),he=p(2,(e,t)=>me(Math.imul(e,2654435761)+Math.imul(t,2246822507))),ge=e=>e&3221225471|e>>>1&1073741824,j=new DataView(new ArrayBuffer(8)),_e=e=>{let t=e|0;return t===e?ge(t):(j.setFloat64(0,e===e?e:NaN),ge(he(j.getInt32(0),j.getInt32(4))))},ve=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return ge(t)},ye=(e,t)=>{let n=12289;for(let r of t)n^=he(fe(r),fe(e[r]));return ge(n)},be=e=>ye(e,w(e)),xe=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return ge(r)},Se=e=>{let t=6151;for(let n of e)t=he(t,fe(n));return ge(t)},Ce=xe(ve(`Map`),([e,t])=>he(fe(e),fe(t))),we=ve(`Set`),Te=xe(we,e=>he(we,fe(e))),Ee=new WeakMap,De=new WeakMap,Oe=new WeakSet,ke=`~effect/Equal`;function Ae(){return arguments.length===1?e=>je(e,arguments[0]):je(arguments[0],arguments[1])}function je(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||T.has(e)||T.has(t)?!1:Me(e,t):!1}function Me(e,t){let n=Pe.length;for(let r=n;r-->0;)if(Pe[r]===e&&Fe[r]===t)return!0;if(n)return Ne(e,t);let r=Ie.get(e);r||Ie.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=Ne(e,t)),i}function Ne(e,t){Pe.push(e),Fe.push(t);try{return Le(e,t)}finally{Pe.pop(),Fe.pop()}}var Pe=[],Fe=[],Ie=new WeakMap;function Le(e,t){if(fe(e)!==fe(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=We(e);if(n!==We(t)||typeof e==`function`&&!n)return!1;if(n)return e[ke](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Re(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?ze(E(e),E(t)):ze(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Ve(e,t,He,Ue):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Ve(e,t,fe,je):Be(e,t)}function Re(e,t){for(let n=0;n<e.length;n++)if(!je(e[n],t[n]))return!1;return!0}function ze(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Be(e,t){let n=w(e),r=w(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!je(e[i],t[i]))return!1;return!0}function Ve(e,t,n,r){let i=new Map;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e])}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop();continue outer}}return!1}return!0}var He=e=>fe(e[0]),Ue=(e,t)=>je(e[0],t[0])&&je(e[1],t[1]),We=e=>A(e,ke),Ge=()=>Ae,Ke=Symbol.for(`~effect/Redactable`),qe=e=>A(e,Ke);function Je(e){return qe(e)?Ye(e):e}function Ye(e){return e[Ke](globalThis[`~effect/Fiber/currentFiber`]?.context??Qe)}var Xe=`~effect/Fiber/currentFiber`,Ze=new Map,Qe={"~effect/Context":{},base:Ze,depth:0,mapUnsafe:Ze,pipe(){return u(this,arguments)}};function $e(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return et;r.add(e);let l;if(Ke in e)l=c(Ye(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
3
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=rt(e);else if(!t?.ignoreToString&&A(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=it(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${tt(t)}:${c(at(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${tt(t)}: ${c(at(e,t),n+1)}`).join(`,
4
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var et=`[Circular]`;function tt(e){return typeof e==`string`?JSON.stringify(e):String(e)}function nt(e){return e.map(e=>`[${tt(e)}]`).join(``)}function rt(e){try{return e.toISOString()}catch{return`Invalid Date`}}function it(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function at(e,t){try{return e[t]}catch{return`[property access threw]`}}function ot(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=A(r,Ke)?Je(r):Je(t);if(typeof i==`bigint`)return $e(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!A(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(!n.includes(i))return n.push(i),a!==i&&n.push(a),a},t?.space)??`null`}var st=Symbol.for(`nodejs.util.inspect.custom`),ct=e=>{try{return e=Je(e),A(e,`toJSON`)&&re(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(ct):e}catch{return`[toJSON threw]`}},lt=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?ot(e,{space:t}):$e(e,{space:t})}catch{return String(e)}},ut={toJSON(){return ct(this)},[st](){return this.toJSON()},toString(){return $e(this.toJSON())}},dt=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),ft=()=>Error.stackTraceLimit,pt=e=>{dt&&(Error.stackTraceLimit=e)},mt=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},ht=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return ft()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function gt(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function _t(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&gt(e,n,t[n])}var vt=`~effect/Effect`,yt=`~effect/Exit`,bt={_A:m,_E:m,_R:m},xt=`${vt}/identifier`,M=`${vt}/args`,St=`${vt}/evaluate`,Ct=`${vt}/successCont`,wt=`${vt}/failureCont`,Tt=`${vt}/ensureCont`,Et=Symbol.for(`effect/Effect/Yield`),Dt={pipe(){return u(this,arguments)},toJSON(){return{...this}},toString(){return $e(this.toJSON(),{ignoreToString:!0,space:2})},[st](){return this.toJSON()}},Ot={[vt]:bt,...Dt,[Symbol.iterator](){return new mt(this)},toJSON(){return{_id:`Effect`,op:this[xt],...M in this?{args:this[M]}:void 0}}},kt=e=>A(e,vt),At=e=>A(e,yt),jt=`~effect/Cause`,Mt=`~effect/Cause/Reason`,Nt=e=>A(e,jt),Pt=e=>A(e,Mt),Ft=class{constructor(e){this[jt]=jt,this.reasons=e}pipe(){return u(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${$e(this.reasons)})`}[st](){return this.toJSON()}[ke](e){return Nt(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Ae(t,e.reasons[n]))}[de](){return Se(this.reasons)}},It=new WeakMap,Lt=class{[Mt];annotations;_tag;constructor(e,t,n){if(this[Mt]=Mt,this._tag=e,t!==Rt&&typeof n==`object`&&n&&t.size>0){let e=It.get(n);e&&(t=new Map([...e,...t])),It.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return u(this,arguments)}toString(){return $e(this)}[st](){return this.toString()}},Rt=new Map,zt=class extends Lt{constructor(e,t=Rt){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${$e(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ke](e){return Kt(e)&&Ae(this.error,e.error)&&Ae(this.annotations,e.annotations)}[de](){return he(ve(this._tag))(he(fe(this.error))(fe(this.annotations)))}},Bt=e=>new Ft(e),Vt=new Ft([]),Ht=e=>new Ft([new zt(e)]),Ut=class extends Lt{constructor(e,t=Rt){super(`Die`,t,e),this.defect=e}toString(){return`Die(${$e(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ke](e){return qt(e)&&Ae(this.defect,e.defect)&&Ae(this.annotations,e.annotations)}[de](){return he(ve(this._tag))(he(fe(this.defect))(fe(this.annotations)))}},Wt=e=>new Ft([new Ut(e)]),Gt=p(e=>Nt(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Ft(e.reasons.map(e=>e.annotate(t,n)))),Kt=e=>e._tag===`Fail`,qt=e=>e._tag===`Die`,Jt=e=>e._tag===`Interrupt`;function Yt(e){return an(`Effect.evaluate: Not implemented`)}var Xt=e=>({...Ot,[xt]:e.op,[St]:e[St]??Yt,[Ct]:e[Ct],[wt]:e[wt],[Tt]:e[Tt]}),Zt=e=>{let t=Xt(e),n=function(e){this[M]=e};return n.prototype=t,function(e){return new n(e)}},Qt=e=>{let t={[yt]:yt,_tag:e.op,get[e.prop](){return this[M]},...Xt(e),toString(){return`${e.op}(${$e(this[M])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[M]}},[ke](e){return At(e)&&e._tag===this._tag&&Ae(this[M],e[M])},[de](){return he(ve(e.op),fe(this[M]))}},n=function(e){this[M]=e};return n.prototype=t,function(e){return new n(e)}},$t=Qt({op:`Success`,prop:`value`,[St](e){let t=e.getCont(Ct);return t?t[Ct](this[M],e,this):e.yieldWith(this)}}),en={key:`effect/Cause/StackTrace`},tn={key:`effect/Cause/InterruptorStackTrace`},nn=Qt({op:`Failure`,prop:`cause`,[St](e){let t=this[M],n=!1;e.cache.stackFrame&&(t=Gt(t,{mapUnsafe:new Map([[en.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(wt);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(wt);return r?r[wt](t,e,n?void 0:this):e.yieldWith(n?nn(t):this)}}),rn=e=>nn(Ht(e)),an=e=>nn(Wt(e)),on=Zt({op:`WithFiber`,[St](e){return this[M](e)}}),sn=function(){class e extends globalThis.Error{}let t=Xt({op:`YieldableError`,[St](){return rn(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),cn=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends sn{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(_t(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),ln=e=>{class t extends cn{_tag=e}return t.prototype.name=e,t},un=`~effect/Cause/NoSuchElementError`,dn=class extends ln(`NoSuchElementError`){[un]=un;constructor(e){super({message:e})}},fn=`~effect/Cause/Done`,pn=e=>A(e,fn),mn={[fn]:fn,_tag:`Done`,value:void 0},hn=e=>e===void 0?mn:{[fn]:fn,_tag:`Done`,value:e},gn=rn(mn),_n=e=>e===void 0?gn:rn(hn(e)),vn=e=>Xt({op:e.label,[St]:e.evaluate}),yn=(e,t)=>e===t,bn=()=>yn,xn=`~effect/Option`,Sn={[xn]:{_A:e=>e},...Dt,[Symbol.iterator](){return new mt(this)}},Cn=Object.defineProperty(Object.assign(Object.create(Sn),{_tag:`Some`,_op:`Some`,[ke](e){return En(e)&&On(e)&&Ae(this.value,e.value)},[de](){return he(fe(this._tag))(fe(this.value))},toString(){return`some(${$e(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:ct(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),wn=fe(`None`),Tn=Object.assign(Object.create(Sn),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ke](e){return En(e)&&Dn(e)},[de](){return wn},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),En=e=>A(e,xn),Dn=e=>e._tag===`None`,On=e=>e._tag===`Some`,kn=Object.create(Tn),An=function(e){this.value=e};An.prototype=Cn;var jn=e=>new An(e),Mn=`~effect/Result`,Nn={[Mn]:{_A:e=>e,_E:e=>e},...Dt,[Symbol.iterator](){return new mt(this)}},Pn=Object.assign(Object.create(Nn),{_tag:`Success`,_op:`Success`,[ke](e){return In(e)&&Rn(e)&&Ae(this.success,e.success)},[de](){return he(fe(this._tag))(fe(this.success))},toString(){return`success(${$e(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:ct(this.success)}}}),Fn=Object.assign(Object.create(Nn),{_tag:`Failure`,_op:`Failure`,[ke](e){return In(e)&&Ln(e)&&Ae(this.failure,e.failure)},[de](){return he(fe(this._tag))(fe(this.failure))},toString(){return`failure(${$e(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:ct(this.failure)}}}),In=e=>A(e,Mn),Ln=e=>e._tag===`Failure`,Rn=e=>e._tag===`Success`,zn=function(e){this.failure=e};zn.prototype=Fn;var Bn=e=>new zn(e),Vn=function(e){this.success=e};Vn.prototype=Pn;var Hn=e=>new Vn(e);function Un(e){return(t,n)=>t===n?0:e(t,n)}var Wn=Un((e,t)=>e<t?-1:1),Gn=Un((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),Kn=p(2,(e,t)=>Un((n,r)=>e(t(n),t(r)))),qn=e=>p(2,(t,n)=>e(t,n)===1),Jn=e=>p(2,(t,n)=>t===n||e(t,n)<1?t:n),Yn=()=>kn,Xn=jn,Zn=En,Qn=Dn,$n=On,er=p(2,(e,{onNone:t,onSome:n})=>Qn(e)?t():n(e.value)),tr=p(2,(e,t)=>Qn(e)?t():e.value),nr=e=>e==null?Yn():Xn(e),rr=tr(v),ir=p(2,(e,t)=>{if($n(e))return e.value;throw t()}),ar=p(2,(e,t)=>Qn(e)?Yn():Xn(t(e.value))),or=p(2,(e,t)=>Qn(e)?Yn():t(e.value)),sr=p(2,(e,t)=>Qn(e)?Yn():nr(t(e.value))),cr=`~effect/Context/Service`,lr=function(){function e(){}let t=e;Object.setPrototypeOf(t,ur);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[fr]=fr,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&dr.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},ur={[cr]:cr,...vn({label:`Service`,evaluate(e){return $t(Fr(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return kr(this,e)},use(e){return on(t=>e(Fr(t.context,this)))},useSync(e){return on(t=>$t(e(Fr(t.context,this))))}},dr=new Set,fr=`~effect/Context/Reference`,pr=`~effect/Context`,mr=8,hr=8,gr=(e,t,n,r)=>{let i=Object.create(Cr);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},_r=(e,t)=>{t&&(_r(e,t.parent),e.set(t.key,t.value))},vr=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return _r(t,e.overlay),e._flat=t},yr=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),Sr(n)},br=Symbol(),xr=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?br:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=hr&&(n.base=vr(n),n.overlay=void 0,n.depth=0),r)},Sr=e=>gr(void 0,e,void 0,0),Cr={get mapUnsafe(){return vr(this)},...Dt,[pr]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ke](e){if(!Tr(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!Ae(r,n.get(e)))return!1;return!0},[de](){return _e(this.mapUnsafe.size)}},wr=(e,t)=>e.cacheRoot===t.cacheRoot,Tr=e=>A(e,pr),Er=e=>!!e[fr],Dr=()=>Or,Or=Sr(new Map),kr=(e,t)=>Sr(new Map([[e.key,t]])),Ar=p(3,(e,t,n)=>jr(e,t.key,n)),jr=(e,t,n)=>{let r=e,i=dr.has(t)?void 0:r.cacheRoot;if(r.depth>=mr){let e=new Map(r.mapUnsafe);return e.set(t,n),gr(i,e,void 0,0)}return gr(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Mr=p(2,(e,t)=>Nr(e,t.key)),Nr=(e,t)=>{let n=xr(e,t);return n===br?void 0:n},Pr=p(2,(e,t)=>{let n=xr(e,t.key);if(n===br){if(Er(t))return Lr(t);throw Rr(t)}return n}),Fr=Pr,Ir=`~effect/Context/defaultValue`,Lr=e=>Ir in e?e[Ir]:e[Ir]=e.defaultValue(),Rr=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
5
+ `);e.splice(1,3),t.stack=e.join(`
6
+ `)}return t},zr=p(2,(e,t)=>{let n=xr(e,t.key);return n===br?Er(t)?Xn(Lr(t)):Yn():Xn(n)}),Br=p(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:yr(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Vr=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((e,n)=>{t.set(n,e)});return Sr(t)},Hr=lr,Ur=e=>e.length>0,Wr=e=>e>0?Math.floor(e):0,Gr=Hn,Kr=Bn,qr=Ln,Jr=Rn,Yr=p(2,(e,t)=>Object.hasOwn(e,t)),Xr=e=>Object.keys(e),Zr=e=>p(2,(t,n)=>{for(let r of Xr(t))if(!Yr(n,r)||!e(t[r],n[r]))return!1;return!0}),Qr=e=>{let t=Zr(e);return(e,n)=>t(e,n)&&t(n,e)},$r=globalThis.Array,ei=e=>$r.isArray(e)?e:$r.from(e),ti=p(2,(e,t)=>[...e,t]),ni=p(2,(e,t)=>ei(e).concat(ei(t))),ri=$r.isArray,ii=Ur,ai=Ur,oi=e=>e[e.length-1],si=()=>[],ci=e=>[e],li=p(2,(e,t)=>e.map(t)),ui=`~effect/Duration`,di=BigInt(0),fi=BigInt(1),pi=BigInt(2),mi=BigInt(10),hi=BigInt(24),gi=BigInt(60),_i=BigInt(1e3),vi=BigInt(1e6),yi=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),bi=e=>yi(e*1e6),xi=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=mi**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*pi>=a?fi:di);return r?-s:s},Si=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Ci=e=>{switch(typeof e){case`number`:return zi(e);case`bigint`:return Ri(e);case`string`:{if(e===`Infinity`)return Ii;if(e===`-Infinity`)return Li;let t=Si.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return Ri(xi(r,fi));if(i===`micro`||i===`micros`)return Ri(xi(r,_i));let a=Number(r);switch(i){case`milli`:case`millis`:return zi(a);case`second`:case`seconds`:return Bi(a);case`minute`:case`minutes`:return Vi(a);case`hour`:case`hours`:return Hi(a);case`day`:case`days`:return Ui(a);case`week`:case`weeks`:return Wi(a)}break}case`object`:{if(e===null)break;if(ui in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(te)?wi(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Fi:e[0]===-1/0||e[1]===-1/0?Li:e[0]===1/0||e[1]===1/0?Ii:ki(yi(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?ki(n):ki(yi(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return wi(e)},wi=e=>{throw Error(`Invalid Input: ${e}`)},Ti={_tag:`Millis`,millis:0},Ei={_tag:`Infinity`},Di={_tag:`NegativeInfinity`},Oi={[ui]:ui,[de](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?fe(yi(e)):_e(this.value.millis)}case`Nanos`:return fe(this.value.nanos);default:return be(this.value)}},[ke](e){return Ai(e)&&Qi(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[st](){return this.toJSON()},pipe(){return u(this,arguments)}},ki=e=>{let t=Object.create(Oi);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Ti:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:bi(e)}:e>0?Ei:Di:e===di?Ti:{_tag:`Nanos`,nanos:e},t},Ai=e=>A(e,ui),ji=e=>e.value._tag!==`Infinity`&&e.value._tag!==`NegativeInfinity`,Mi=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===di;case`Infinity`:case`NegativeInfinity`:return!1}},Ni=e=>{switch(e.value._tag){case`Millis`:return e.value.millis<0;case`Nanos`:return e.value.nanos<di;case`NegativeInfinity`:return!0;case`Infinity`:return!1}},Pi=e=>{switch(e.value._tag){case`Infinity`:case`NegativeInfinity`:return Ii;case`Millis`:return e.value.millis<0?ki(-e.value.millis):e;case`Nanos`:return e.value.nanos<di?ki(-e.value.nanos):e}},Fi=ki(0),Ii=ki(1/0),Li=ki(-1/0),Ri=e=>ki(e),zi=e=>ki(e),Bi=e=>ki(e*1e3),Vi=e=>ki(e*6e4),Hi=e=>ki(e*36e5),Ui=e=>ki(e*864e5),Wi=e=>ki(e*6048e5),Gi=e=>qi(Ci(e),{onMillis:m,onNanos:e=>Number(e)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Ki=e=>{let t=Ci(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return bi(t.value.millis)}},qi=p(2,(e,t)=>{switch(e.value._tag){case`Millis`:return t.onMillis(e.value.millis);case`Nanos`:return t.onNanos(e.value.nanos);case`Infinity`:return t.onInfinity();case`NegativeInfinity`:return(t.onNegativeInfinity??t.onInfinity)()}}),Ji=p(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Ki(e),t.value.nanos):n.onNanos(e.value.nanos,Ki(t))),Yi=Un((e,t)=>Ji(e,t,{onMillis:(e,t)=>e<t?-1:+(e>t),onNanos:(e,t)=>e<t?-1:+(e>t),onInfinity:(e,t)=>e.value._tag===t.value._tag?0:e.value._tag===`Infinity`?1:e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`?-1:1})),Xi=(e,t)=>Ji(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Zi=Jn(Yi),Qi=p(2,(e,t)=>Xi(e,t)),$i=e=>{if(e.value._tag===`Infinity`)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};if(e.value._tag===`NegativeInfinity`)return{days:-1/0,hours:-1/0,minutes:-1/0,seconds:-1/0,millis:-1/0,nanos:-1/0};let t=Ki(e),n=t<di,r=n?-t:t,i=r/vi,a=i/_i,o=a/gi,s=o/gi,c=s/hi,l=n?-1:1;return{days:l*Number(c),hours:l*Number(s%hi),minutes:l*Number(o%gi),seconds:l*Number(a%gi),millis:l*Number(i%_i),nanos:l*Number(r%vi)}},ea=e=>{if(e.value._tag===`Infinity`)return`Infinity`;if(e.value._tag===`NegativeInfinity`)return`-Infinity`;if(Mi(e))return`0`;if(Ni(e))return`-`+ea(Pi(e));let t=$i(e),n=[];return t.days!==0&&n.push(`${t.days}d`),t.hours!==0&&n.push(`${t.hours}h`),t.minutes!==0&&n.push(`${t.minutes}m`),t.seconds!==0&&n.push(`${t.seconds}s`),t.millis!==0&&n.push(`${t.millis}ms`),t.nanos!==0&&n.push(`${t.nanos}ns`),n.join(` `)},ta=Hr(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new oa}),na=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},ra=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},ia=e=>{try{return ra(e)}catch{return na(e)}},aa=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},oa=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?na:ia)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new sa(this.setImmediate)}},sa=class{tasks=new aa;running=void 0;setImmediate;constructor(e=ia){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},ca=Hr(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),N=Hr(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),la=class extends f{constructor(e){super(),e&&_t(this,e)}},ua=ln,da=e=>{switch(e){case 16:return ma();case 32:return ha();default:{let t=``;for(let n=e>>>3;n>0;n--)t+=pa();return t}}},P=Uint8Array.from(`0123456789abcdef`,e=>e.charCodeAt(0)),fa=()=>Math.random()*4294967296>>>0,pa=()=>{let e=fa();return String.fromCharCode(P[e>>>28],P[e>>>24&15],P[e>>>20&15],P[e>>>16&15],P[e>>>12&15],P[e>>>8&15],P[e>>>4&15],P[e&15])},ma=()=>{let e=fa(),t=fa();return String.fromCharCode(P[e>>>28],P[e>>>24&15],P[e>>>20&15],P[e>>>16&15],P[e>>>12&15],P[e>>>8&15],P[e>>>4&15],P[e&15],P[t>>>28],P[t>>>24&15],P[t>>>20&15],P[t>>>16&15],P[t>>>12&15],P[t>>>8&15],P[t>>>4&15],P[t&15])},ha=()=>{let e=fa(),t=fa(),n=fa(),r=fa();return String.fromCharCode(P[e>>>28],P[e>>>24&15],P[e>>>20&15],P[e>>>16&15],P[e>>>12&15],P[e>>>8&15],P[e>>>4&15],P[e&15],P[t>>>28],P[t>>>24&15],P[t>>>20&15],P[t>>>16&15],P[t>>>12&15],P[t>>>8&15],P[t>>>4&15],P[t&15],P[n>>>28],P[n>>>24&15],P[n>>>20&15],P[n>>>16&15],P[n>>>12&15],P[n>>>8&15],P[n>>>4&15],P[n&15],P[r>>>28],P[r>>>24&15],P[r>>>20&15],P[r>>>16&15],P[r>>>12&15],P[r>>>8&15],P[r>>>4&15],P[r&15])},ga=`effect/Tracer/ParentSpan`,_a=class extends lr()(ga,{fiberCached:!0}){},va=e=>e,ya=Hr(`effect/Tracer/DisablePropagation`,{defaultValue:_}),ba=Hr(`effect/Tracer/CurrentTraceLevel`,{defaultValue:()=>`Info`}),xa=Hr(`effect/Tracer/MinimumTraceLevel`,{defaultValue:()=>`All`}),Sa=`effect/Tracer`,Ca=va({span:e=>new wa(e)}),wa=class{_tag=`Span`;sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:`Started`,startTime:e.startTime}}get traceId(){return this._traceId??=rr(this.parent)?.traceId??da(32)}get spanId(){return this._spanId??=da(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}},Ta=`effect/Metric/FiberRuntimeMetrics`,Ea=Hr(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:v}),Da=Hr(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:g}),Oa=Hr(`effect/References/TracerTimingEnabled`,{defaultValue:g}),ka=Hr(`effect/References/TracerSpanAnnotations`,{defaultValue:()=>({})}),Aa=Hr(`effect/References/TracerSpanLinks`,{defaultValue:()=>[]}),ja=Hr(`effect/References/CurrentLogAnnotations`,{defaultValue:()=>({})}),Ma=Hr(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Na=Hr(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Pa=Hr(`effect/References/CurrentLogSpans`,{defaultValue:()=>[]}),Fa=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=ft();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};pt(3);let n=Error();return pt(t),{...e,captureStackTrace:Ia(()=>n.stack)}},Ia=(e=>t=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let i=r.split(`
7
+ `);if(i[e]!==void 0)return n=i[e].trim(),n}})(3),La=class extends Lt{constructor(e,t=Rt){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ke](e){return Jt(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[de](){return he(ve(`${this._tag}:${this.fiberId}`))(pe(this.annotations))}},Ra=e=>new La(e),za=e=>new Ft([new La(e)]),Ba=e=>{let t=e.reasons.find(Kt);return t?Gr(t):Kr(e)},Va=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Gr(n.error)}return Kr(e)},Ha=e=>e.reasons.some(Jt),Ua=e=>{let t;for(let n=0;n<e.reasons.length;n++){let r=e.reasons[n];r._tag===`Interrupt`&&(t??=new Set,r.fiberId!==void 0&&t.add(r.fiberId))}return t?Gr(t):Kr(e)},Wa=e=>{let t=Ua(e);return qr(t)?Ga:t.success},Ga=new Set,Ka=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=fe(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>Ae(e,i)))continue;else t.push(i);r.push(i)}return r},qa=p(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Ft(Ka(e.reasons,t.reasons));return Ae(e,n)?e:n}),Ja=p(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Kt(e)?(n=!0,new zt(t(e.error),e.annotations)):e);return n?Bt(r):e}),Ya=e=>{let t;for(let n of e.reasons){if(n._tag===`Fail`)return n.error;n._tag===`Die`&&(t??=n)}return t===void 0?e.reasons.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`):t.defect},Xa=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=ft();i!==0&&pt(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Za(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=no(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(Za(i,r[0].annotations,t))}}finally{i!==0&&pt(i)}return n},Za=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(Qa(e),{cause:e.cause?Za(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=eo(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?to(e,t):e}n?.includeCauseInStack&&(i.stack=ao(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else i=new globalThis.Error(e?r===`string`?e:ot(e):`Unknown error: ${e}`);return i},Qa=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return ot(e)},$a=/\((.*)\)/g,eo=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
8
+ `),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?to(a.join(`
9
+ `),n):a.join(`
10
+ `)},to=(e,t)=>{let n=t?.get(en.key);return n&&(e=`${e}\n${ro(n)}`),e},no=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(tn.key);n.push(` at fiber (${t})`),r&&n.push(ro(r))}return n.join(`
11
+ `)},ro=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll($a),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
12
+ `)},io=e=>Xa(e).map(ao).join(`
13
+ `),ao=e=>e.cause?`${e.stack} {\n${oo(e.cause,` `)}\n}`:e.stack,oo=(e,t)=>{let n=e.stack.split(`
14
+ `),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${oo(e.cause,`${t} `)}\n${t}}`),r},so=`~effect/Fiber`,co={_A:m,_E:m},lo={id:0},uo=()=>globalThis[Xe],fo=class{constructor(e,t=!0){this.setContext(e),this.id=++lo.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[so](){return co}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Fr(this.context,e)}addObserver(e){return this._exit?(e(this._exit),y):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=za(e);this.cache.stackFrame&&(n=Gt(n,kr(en,this.cache.stackFrame))),t&&(n=Gt(n,t)),this._interruptedCause=this._interruptedCause?qa(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(To(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===Et)return;let n=go.interruptChildren&&go.interruptChildren(this);if(n!==void 0)return this.evaluate(ss(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=Dr()}runLoop(e){let t=globalThis[Xe];globalThis[Xe]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=To(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=ss(ko,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[St](this),i===Et){let e=this._yielded;if(yt in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Et}}}catch(e){return A(i,St)?this.runLoop(an(e)):an(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Xe]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,mo;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Tt];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&ho-1))return $t(e);let t=this.getCont(Ct);return t?t[Ct](e,this):this.yieldWith($t(e))}yieldWith(e){return this._yielded=e,Et}children(){return this._children??=new Set}pipe(){return u(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&wr(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=po(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},po=e=>{let t=Nr(e,Sa);return{scheduler:Fr(e,ta),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Fr(e,Da),span:Nr(e,ga),logLevel:Fr(e,Ma),minimumLogLevel:Fr(e,Na),stackFrame:Fr(e,Ea),runtimeMetrics:Nr(e,Ta),maxOpsBeforeYield:Fr(e,ca),preventYield:Fr(e,N)}},mo={[Ct](e,t){return To(t._interruptedCause)},[wt](e,t){return To(t._interruptedCause)}},ho=32,go={interruptChildren:void 0},_o=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(tn.key,e.cache.stackFrame),Sr(t)},vo=e=>{let t=e;return t._exit?F(t._exit):Lo(n=>t._exit?n(F(t._exit)):Do(e.addObserver(e=>n(F(e)))))},yo=e=>Lo(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(F(r))}return a(),Do(()=>i?.())}),bo=e=>{let t=e;return t._exit?t._exit:Lo(n=>t._exit?n(t._exit):Do(e.addObserver(n)))},xo=e=>Lo(t=>{let n=Array.from(e);if(n.length===0)return t(F(si()));let r=Array(n.length),i=si(),a=()=>{for(let e=0;e<i.length;e++)n[e].removeObserver(i[e])},o=0,s=!1;for(let e=0;e<n.length&&!s;e++){let c=i=>{if(o++,i._tag===`Failure`)return s=!0,a(),t(i);r[e]=i.value,o===n.length&&t(F(r))};i.push(c),n[e].addObserver(c)}return Do(()=>{s=!0,a()})}),So=e=>on(t=>Co(e,t.id)),Co=p(e=>A(e[0],so),(e,t,n)=>on(r=>{let i=_o(r);return i=i&&n?Br(i,n):i??n,e.interruptUnsafe(t,i),is(vo(e))})),wo=e=>on(t=>{let n=_o(t),r=si();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return is(yo(r))}),F=$t,To=nn,Eo=rn,Do=Zt({op:`Sync`,[St](e){let t=this[M](),n=e.getCont(Ct);return n?n[Ct](t,e):e.yieldWith($t(t))}}),Oo=Zt({op:`Suspend`,[St](e){return this[M]()}}),ko=Zt({op:`Yield`,[St](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(vs)},this[M]??0),e.yieldWith(()=>{t=!0})}})(0),Ao=F(Yn()),jo=e=>Oo(()=>To(e())),Mo=e=>an(e),No=e=>Oo(()=>Eo(e())),I=F(void 0),Po=e=>on(t=>e(t.id)),Fo=function(){let e=Xt({op:`Async`,[St](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(Io(()=>(t=!0,r?.abort(),i??vs))),Et):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Io=Zt({op:`AsyncFinalizer`,[Tt](e){e.interruptible&&(e.interruptible=!1,e._stack.push(Uc))},[wt](e,t){return Ha(e)?ss(this[M](),()=>To(e)):To(e)}}),Lo=e=>Fo(e,e.length>=2),Ro=Lo(y),zo=(...e)=>{if(e.length===1){let t=e[0];return Oo(()=>L(t()))}let[t,n]=e;return Oo(()=>L(n.call(t.self)))},Bo=(e,...t)=>{let n=t.length===0?function(){return Oo(()=>L(e.apply(this,arguments)))}:function(){let n=Oo(()=>L(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return Vo(e.length,n)},Vo=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Ho=(e,...t)=>Vo(e.length,t.length===0?function(){return Uo(()=>e.apply(this,arguments))}:function(){let n=Uo(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Uo=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return F(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Oo(()=>n?(n=!1,ss(r.value,e=>L(t,e))):Oo(()=>L(e())))}}}catch(e){return Mo(e)}},L=function(){let e=Xt({op:`Iterator`,[Ct](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return F(r.value);if(!R(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[St](e){return this[Ct](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Wo=p(2,(e,t)=>new qo(e,Jo,F(t))),Go=function(e){return e._stack.push(this),this[M]},Ko=Xt({op:`OnSuccess`,[St]:Go}),qo=function(e,t,n){this[M]=e,this[Ct]=t,this.payload=n};qo.prototype=Ko;var Jo=function(){return this.payload},Yo=function(e,t){return t.succeedWith(this.payload)},Xo=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Zo=function(e,t){let n=this.payload;return t.succeedWith(Xo?n(e):ht(()=>n(e)))},Qo=function(e){let t=this.payload;return t(e)},$o=function(e){let t=this.payload;return new qo(t(e),Yo,e)},es=function(e){return new qo(this.payload,Yo,e)},ts=e=>us(e,Xn),ns=p(2,(e,t)=>new qo(e,kt(t)?Jo:Qo,t)),rs=p(2,(e,t)=>new qo(e,kt(t)?es:$o,t)),is=e=>new qo(e,Jo,vs),as=(e,t)=>on(n=>Lo(r=>{let i=!1,a=new Set,o=e=>{i=!0,r(a.size===0?e:ss(Vc(wo(a)),()=>e))},s=0;for(let r of e){if(i)break;let e=s++,c=il(n,r,!0,!0,!1);a.add(c),c.addObserver(r=>{a.delete(c);let s=!i;o(r),s&&t?.onWinner&&t.onWinner({fiber:c,index:e,parentFiber:n})})}return wo(a)})),os=p(e=>kt(e[1]),(e,t,n)=>as([e,t],n)),ss=p(2,(e,t)=>new qo(e,Qo,t)),R=e=>e[yt]!==void 0,cs=p(2,(e,t)=>R(e)?e._tag===`Success`?t(e.value):e:ss(e,t)),ls=e=>ss(e,m),us=p(2,(e,t)=>new qo(e,Zo,t)),ds=p(2,(e,t)=>R(e)?ys(e,t):us(e,t)),fs=p(2,(e,t)=>R(e)?bs(e,t):Us(e,t)),ps=p(2,(e,t)=>R(e)?xs(e,t):Ws(e,t)),ms=e=>nn(za(e)),hs=e=>e._tag===`Success`,gs=e=>e._tag===`Failure`,_s=e=>e._tag===`Failure`?Gr(e.cause):Kr(e),vs=$t(void 0),ys=p(2,(e,t)=>e._tag===`Success`?$t(t(e.value)):e),bs=p(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Va(e.cause);return qr(n)?e:rn(t(n.success))}),xs=p(2,(e,t)=>{if(e._tag===`Success`)return $t(t.onSuccess(e.value));let n=Va(e.cause);return qr(n)?e:rn(t.onFailure(n.success))}),Ss=p(2,(e,t)=>hs(e)?t:e),Cs=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?vs:nn(Bt(t))},ws=e=>on(t=>F(zr(t.context,e))),Ts=p(2,(e,t)=>on(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),Nc(n,()=>{n.setContext(r)}),e)})),Es=p(3,(e,t,n)=>Ts(e,e=>{let r=Pr(e,t),i=n(r);return r===i?e:Ar(e,t,i)})),Ds=()=>Os,Os=on(e=>F(e.context)),ks=e=>on(t=>e(t.context)),As=p(2,(e,t)=>R(e)?e:Ts(e,Br(t))),js=function(){return arguments.length===1?p(2,(e,t)=>Ms(e,arguments[0],t)):p(3,(e,t,n)=>Ms(e,t,n)).apply(this,arguments)},Ms=(e,t,n)=>Ts(e,Ar(t,n)),Ns=p(2,(e,t)=>ss(t,t=>t?ts(e):Ao)),Ps=p(e=>kt(e[0]),(e,t)=>Xc({while:g,body:h(t?.disableYield?e:ss(e,e=>ko)),step:y})),Fs=p(2,(e,t)=>new Ls(e,t.length===1?t:e=>t(e))),Is=Xt({op:`OnFailure`,[St]:Go}),Ls=function(e,t){this[M]=e,this[wt]=t};Ls.prototype=Is;var Rs=p(3,(e,t,n)=>Fs(e,e=>{let r=t(e);return qr(r)?To(r.failure):n(r.success,e)})),zs=p(2,(e,t)=>Rs(e,Va,e=>t(e))),Bs=p(2,(e,t)=>Fs(e,e=>ns(t(e),To(e)))),Vs=p(3,(e,t,n)=>Fs(e,e=>{let r=t(e);return qr(r)?To(e):ns(n(r.success,e),To(e))})),Hs=p(2,(e,t)=>Vs(e,Va,e=>t(e))),Us=p(2,(e,t)=>zs(e,e=>No(()=>t(e)))),Ws=p(2,(e,t)=>ec(e,{onFailure:e=>No(()=>t.onFailure(e)),onSuccess:e=>Do(()=>t.onSuccess(e))})),Gs=e=>zs(e,Mo),Ks=p(e=>kt(e[0]),(e,t)=>{if(!t?.log)return ec(e,{onFailure:e=>I,onSuccess:e=>I});let n=Ql(t.log===!0?void 0:t.log);return Ys(e,{onFailure(e){let r=Ba(e);return qr(r)?To(r.failure):t.message===void 0?n(e):n(t.message,e)},onSuccess:e=>I})}),qs=p(e=>kt(e[0]),(e,t)=>{if(!t?.log)return Ys(e,{onFailure:e=>I,onSuccess:e=>I});let n=Ql(t.log===!0?void 0:t.log);return Ys(e,{onFailure:e=>t.message===void 0?n(e):n(t.message,e),onSuccess:e=>I})}),Js=e=>nc(e,{onFailure:Kr,onSuccess:Gr}),Ys=p(2,(e,t)=>new Zs(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),Xs=Xt({op:`OnSuccessAndFailure`,[St]:Go}),Zs=function(e,t,n){this[M]=e,this[Ct]=t,this[wt]=n};Zs.prototype=Xs;var Qs=function(e,t){let n=this.payload;return t.succeedWith(Xo?n.onSuccess(e):ht(()=>n.onSuccess(e)))},$s=((e,t)=>{let n=Xt({op:e,[St]:Go,[Ct]:Qs,[wt]:t}),r=function(e,t){this[M]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Kt);if(n===void 0)return To(e);let r=this.payload;return t.succeedWith(Xo?r.onFailure(n.error):ht(()=>r.onFailure(n.error)))}),ec=p(2,(e,t)=>Ys(e,{onFailure:e=>{let n=e.reasons.find(Kt);return n?t.onFailure(n.error):To(e)},onSuccess:t.onSuccess})),tc=p(2,(e,t)=>new $s(e,t)),nc=p(2,(e,t)=>{if(R(e)){if(e._tag===`Success`)return $t(t.onSuccess(e.value));let n=Va(e.cause);return qr(n)?e:$t(t.onFailure(n.success))}return tc(e,t)}),rc=e=>R(e)?$t(e):ic(e),ic=Zt({op:`Exit`,[St](e){return e._stack.push(this),this[M]},[Ct](e,t,n){return t.succeedWith(n??$t(e))},[wt](e,t,n){return t.succeedWith(n??nn(e))}}),ac=p(2,(e,t)=>ns(zl(t),e)),oc=p(2,(e,t)=>ss(lc(e,t.duration),e=>Qn(e)?t.orElse():F(e.value))),sc=e=>new Vl(`Operation timed out after '${ea(e)}'`),cc=p(2,(e,t)=>{let n=Ci(t);return oc(e,{duration:n,orElse:()=>Eo(sc(n))})}),lc=p(2,(e,t)=>os(ts(e),Wo(zl(t),Yn()))),uc=`~effect/Scope`,dc=`~effect/Scope/Closeable`,fc=lr(`effect/Scope`),pc=(e,t)=>on(n=>{let r=mc(e,t);return r===void 0?I:(Kc(n),r)}),mc=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&Sc(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return hc(n.finalizer,t);let r=n.finalizers;return r.size===1?hc(r.values().next().value,t):_c(e,r,t)},hc=(e,t)=>{try{return e(t)}catch(e){return an(e)}},gc=(e,t)=>hs(e)?t:Fs(t,t=>To(qa(e.cause,t))),_c=Bo(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=uo();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*rc(hc(s,n))):i.push(il(o,hc(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*yo(i)),yield*Cs(r)}),vc=(e,t)=>{let n=wc(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(xc(e,n,e=>pc(n,e)),n)},yc=(e,t)=>Oo(()=>e.state._tag===`Closed`?t(e.state.exit):(xc(e,{},t),I)),bc=(e,t)=>yc(e,h(t)),xc=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},Sc=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=Tc:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Tc))},Cc=e=>wc(e,void 0),wc=(e=`sequential`,t)=>({[dc]:dc,[uc]:uc,strategy:e,parent:t,state:Tc}),Tc={_tag:`Empty`},Ec=fc,Dc=js(fc),Oc=e=>on(t=>{let n=t.context,r=Cc();return t.setContext(Ar(t.context,fc,r)),Nc(t,e=>(t.setContext(n),mc(r,e))),e}),kc=e=>Oo(()=>{let t=Cc();return Pc(e(t),e=>Oo(()=>mc(t,e)??I))}),Ac=(e,t,n)=>ks(r=>Jc(i=>ss(Ec,a=>rs(n?.interruptible?i(e):e,e=>yc(a,n=>As(t(e,n),r)))))),jc=function(){let e=Xt({op:`OnExit`,[St](e){return e._stack.push(this),this.effect},[Tt](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(Uc),e.interruptible=!1)},[Ct](e,t,n){n??=$t(e);let r;try{r=this.onExit(n)}catch(e){r=an(e)}return r?ss(r,e=>n):n},[wt](e,t,n){n??=nn(e);let r;try{r=this.onExit(n)}catch(e){r=an(e)}return r?ss(gc(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),Mc=(e,t,n)=>new jc(e,t,n),Nc=(e,t)=>{e._stack.push(new jc(void 0,t,void 0))},Pc=p(2,Mc),Fc=p(2,(e,t)=>Pc(e,e=>t)),Ic=p(3,(e,t,n)=>Pc(e,e=>{let r=t(e);return qr(r)?I:n(r.success,e)})),Lc=p(2,(e,t)=>Ic(e,_s,t)),Rc=p(3,(e,t,n)=>Pc(e,e=>{if(e._tag!==`Failure`)return I;let r=t(e.cause);return qr(r)?I:n(r.success,e.cause)})),zc=p(2,(e,t)=>Rc(Ua,t)(e)),Bc=on(e=>To(za(e.id))),Vc=e=>on(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Uc),e):e),Hc=Zt({op:`SetInterruptible`,[Tt](e){if(e.interruptible=this[M],e._interruptedCause&&e.interruptible)return()=>To(e._interruptedCause)}}),Uc=Hc(!0),Wc=Hc(!1),Gc=e=>{if(e.interruptible=!0,e._stack.push(Wc),e._interruptedCause)return To(e._interruptedCause)},Kc=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(Uc))},qc=e=>on(t=>t.interruptible?e:Gc(t)??e),Jc=e=>on(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Uc),e(qc)):e(m)),Yc=(e,t)=>ue(e)?t?.mode===`result`?Zc(e,Js,t):Zc(e,m,t):t?.discard?t.mode===`result`?Zc(Object.values(e),Js,t):Zc(Object.values(e),m,t):Oo(()=>{let n={};return Wo(Zc(Object.entries(e),([e,r])=>us(t?.mode===`result`?Js(r):r,t=>{gt(n,e,t)}),{discard:!0,concurrency:t?.concurrency}),n)}),Xc=Zt({op:`While`,[Ct](e,t){return this[M].step(e),this[M].while()?(t._stack.push(this),this[M].body()):vs},[St](e){return this[M].while()?(e._stack.push(this),this[M].body()):vs}}),Zc=p(e=>typeof e[1]==`function`,(e,t,n)=>Oo(()=>{let r=$c(n?.concurrency);if(r===1)return Qc(e,t,n);let i=ei(e),a=i.length;if(a===0)return n?.discard?I:F([]);let o=n?.discard?void 0:Array(a),s=rl({f:t,out:o},i,{concurrency:r});return s?Wo(s,o):F(o)})),Qc=(e,t,n)=>Oo(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return Wo(Xc({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),$c=e=>e===`unbounded`?1/0:Math.max(1,e??1),el=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>ss(rc(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??I),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!R(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},tl=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f=!1,p,m,h=e=>{let t=an(e);return p=t,c=!0,f=!0,u&&u.size>0?ss(Vc(wo(Array.from(u))),()=>t):t},g=()=>{let i=!1;for(;!p&&a<o;a++){let o=r[a],_=m??t(e,o,a);if(R(_)){if(p=n(e,o,_,a),p)break}else if(l){m=void 0;let t=il(l,_,!0,!0,`inherit`);if(t._exit){if(p=n(e,o,t._exit,a),p)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(p){if(!f&&a._tag===`Failure`)for(let e of a.cause.reasons)if(e._tag===`Interrupt`)continue;else p._tag===`Failure`?p.cause.reasons.push(e):p=nn(Bt([e]))}else{let t=n(e,o,a,r);t&&(p=t._tag===`Failure`?nn(Bt(t.cause.reasons.slice())):t,g())}if(i){let e=g();e&&d(e)}else c&&u.size===0&&d(p??I)}catch(e){d(h(e))}}),u.size<s)continue;i=!0,a++;return}else return Lo(e=>{l=uo(),u=new Set,m=_,d=e;let t;try{t=g()}catch(t){return e(h(t))}return t?e(t):Oo(()=>(p=vs,f=!0,u?wo(u):I))})}if(c=!0,p){if(u&&u.size>0){let e=_o(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||p._tag===`Failure`)return p}else if(d){if(u)u.size===0&&d(I);else return vs}};return g()}},nl=()=>e=>tl(e),rl=tl({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),il=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new fo(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s._parent=a),s},al=p(e=>kt(e[0]),(e,t)=>on(n=>F(il(n,e,t?.startImmediately,!0,t?.uninterruptible)))),ol=p(e=>kt(e[0]),(e,t,n)=>on(r=>{let i=il(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!i._exit){if(t.state._tag!==`Closed`){let e={};xc(t,e,()=>Po(e=>e===i.id?I:So(i))),i.addObserver(()=>Sc(t,e))}else i.interruptUnsafe(r.id,_o(r))}return F(i)})),sl=p(e=>kt(e[0]),(e,t)=>ss(Ec,n=>ol(e,n,t))),cl=e=>(t,n)=>{let r=new fo(n?.scheduler?Ar(e,ta,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},ll=p(2,(e,t)=>{if(e._exit)return e;if(t.state._tag===`Closed`)return e.interruptUnsafe(e.id),e;let n={};return xc(t,n,()=>So(e)),e.addObserver(()=>Sc(t,n)),e}),ul=e=>{let t=cl(e);return(e,n)=>{let r=t(e,n);return n?.onExit&&r.addObserver(n.onExit),e=>r.interruptUnsafe(e)}},dl=e=>{let t=cl(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},fl=(e=>{let t=dl(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw Ya(e.cause);return e.value})})(Dr()),pl=e=>{let t=cl(e);return e=>{if(R(e))return e;let n=new oa(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??an(new Ul(r))}},ml=pl(Dr()),hl=e=>{let t=pl(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw Ya(n.cause);return n.value}},gl=hl(Dr()),_l=F(!0),vl=F(!1),yl=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return _l;if(this.scheduled===void 0)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],_l}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](vs)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](vs)}open=on(e=>this._isOpen?vl:(this._isOpen=!0,this.scheduleUnsafe(e)));release=on(e=>this._isOpen?vl:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=Lo(e=>this._isOpen?e(I):(this.waiters.push(e),Do(()=>{let t=this.waiters.indexOf(e);t===-1?this.scheduled!==void 0&&(t=this.scheduled.indexOf(e),t!==-1&&this.scheduled.splice(t,1)):this.waiters.splice(t,1)})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=Do(()=>this.closeUnsafe());whenOpen=e=>ss(this.await,()=>e);isOpen(){return this._isOpen}},bl=e=>new yl(e??!1),xl=BigInt(0),Sl={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:xl,endTime:xl,exit:vs},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}},Cl=e=>Object.assign(Object.create(Sl),e),wl=e=>e?Fr(e.annotations,ya)?e._tag===`Span`?wl(rr(e.parent)):Yn():Xn(e):Yn(),Tl=(e,t,n)=>{let r=!e.cache.tracerEnabled||n?.annotations&&Fr(n.annotations,ya),i=n?.parent===void 0?n?.root?Yn():wl(e.cache.span):Xn(n.parent),a;if(r)a=Cl({name:t,parent:i,annotations:Ar(n?.annotations??Dr(),ya,!0)});else{let r=e.cache.tracer??Ca,o=e.getRef(Ml),s=e.getRef(Oa),c=e.getRef(ka),l=e.getRef(Aa),u=n?.level??e.getRef(ba),d=n?.links===void 0?l.length===0?[]:l.slice():[...l,...n.links];a=r.span({name:t,parent:i,annotations:n?.annotations??Dr(),links:d,startTime:s?o.currentTimeNanosUnsafe():xl,kind:n?.kind??`internal`,root:n?.root??Qn(i),sampled:n?.sampled??($n(i)&&i.value.sampled===!1?!1:!Gl(e.getRef(xa),u))});for(let e in c)a.attribute(e,c[e]);if(n?.attributes!==void 0)for(let e in n.attributes)a.attribute(e,n.attributes[e])}return a},El=(e,t)=>Vc(on(n=>{let r=Pr(n.context,fc),i=Tl(n,e,t??{}),a=n.getRef(Ml),o=n.getRef(Oa);return Wo(yc(r,e=>Ol(i,e,a,o)),i)})),Dl=(e,t)=>(t=typeof t==`function`?t:v,Es(Ea,n=>({name:e,stack:t,parent:n}))),Ol=(e,t,n,r)=>Do(()=>{e.status._tag!==`Ended`&&e.end(r?n.currentTimeNanosUnsafe():xl,t)}),kl=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return on(t=>{let i=Tl(t,e,n),a=t.getRef(Ml),o=t.getRef(Oa);return Nc(t,e=>Ol(i,e,a,o)),r(i)})},Al=js(_a),jl=function(){let e=kt(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=m;return t._tag===`Span`&&(n=Fa(n),r=Dl(t.name,n?.captureStackTrace)),e?Al(r(arguments[0]),t):e=>Al(r(e),t)},Ml=Hr(`effect/Clock`,{defaultValue:()=>new Pl}),Nl=2**31-1,Pl=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=Do(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Ll()}currentTimeNanos=Do(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Il()}monotonicTimeNanos=Do(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Gi(e))}sleepMillis(e){return e<=0?ko:Number.isFinite(e)?Lo(t=>{let n=e>Nl?this.sleepMillis(e-Nl):I,r=setTimeout(()=>t(n),Math.min(e,Nl));return Do(()=>clearTimeout(r))}):Ro}},Fl=BigInt(1e6),Il=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*Fl;return e>t&&(t=e),t}}(),Ll=function(){let e=BigInt(1e9),t;return()=>{let n=Il(),r=BigInt(Date.now())*Fl;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),Rl=e=>on(t=>e(t.getRef(Ml))),zl=e=>Rl(t=>t.sleep(Ci(e))),Bl=`~effect/Cause/TimeoutError`,Vl=class extends ln(`TimeoutError`){[Bl]=Bl;constructor(e){super({message:e})}},Hl=`~effect/Cause/AsyncFiberError`,Ul=class extends ln(`AsyncFiberError`){[Hl]=Hl;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Wl=Hr(`effect/Console`,{defaultValue:()=>globalThis.console}),Gl=qn(Kn(Gn,e=>{switch(e){case`All`:return-(2**53-1);case`Fatal`:return 5e4;case`Error`:return 4e4;case`Warn`:return 3e4;case`Info`:return 2e4;case`Debug`:return 1e4;case`Trace`:return 0;case`None`:return 2**53-1}})),Kl=Hr(`effect/Logger/CurrentLoggers`,{defaultValue:()=>new Set([tu,nu])}),ql=Hr(`effect/Logger/LogToStderr`,{defaultValue:_}),Jl={"~effect/Logger":{_Message:m,_Output:m},pipe(){return u(this,arguments)}},Yl=e=>{let t=Object.create(Jl);return t.log=e,t},Xl=e=>e.replace(/[\s="]/g,`_`),Zl=(e,t)=>`${Xl(e[0])}=${t-e[1]}ms`,Ql=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];Nt(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?Bt(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=Vt),on(r=>{let i=e??r.cache.logLevel;if(Gl(r.cache.minimumLogLevel,i))return I;let a=r.getRef(Ml),o=r.getRef(Kl);if(o.size>0){let e=new Date(a.currentTimeMillisUnsafe());for(let a of o)a.log({cause:n,fiber:r,date:e,logLevel:i,message:t})}return I})},$l={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};$l.gray,$l.blue,$l.green,$l.yellow,$l.red,$l.bgBrightRed,$l.black;var eu=e=>`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}:${e.getSeconds().toString().padStart(2,`0`)}.${e.getMilliseconds().toString().padStart(3,`0`)}`,tu=Yl(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(io(e));let o=t.getTime(),s=n.getRef(Pa),c=``;for(let e of s)c+=` ${Zl(e,o)}`;let l=n.getRef(ja);Object.keys(l).length>0&&a.push(l);let u=n.getRef(Wl);(n.getRef(ql)?u.error:u.log)(`[${eu(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),nu=Yl(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(Ml),a=t.getRef(ja),o=t.cache.span;if(o===void 0||o._tag===`ExternalSpan`)return;let s={};for(let[e,t]of Object.entries(a))gt(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=io(e)),o.event(lt(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)}),ru=F(void 0),iu=Nt,au=Pt,ou=Kt,su=Bt,cu=Ht,lu=Wt,uu=za,du=e=>new zt(e),fu=e=>new Ut(e),pu=Ra,mu=Ja,hu=Ya,gu=Va,_u=Wa,vu=dn,yu=pn,bu=_n,xu=At,Su=$t,Cu=nn,wu=rn,Tu=an,Eu=ms,Du=vs,Ou=hs,ku=gs,Au={"~effect/Deferred":{_A:m,_E:m},pipe(){return u(this,arguments)}},ju=function(){this.resumes=void 0,this.effect=void 0};ju.prototype=Au;var Mu=()=>new ju,Nu=e=>Lo(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),Do(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),Pu=p(2,(e,t)=>Do(()=>Lu(e,t))),Fu=p(2,(e,t)=>Pu(e,nn(t))),Iu=p(2,(e,t)=>Fu(e,za(t))),Lu=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let n=e.resumes;e.resumes=void 0;for(let e=0;e<n.length;e++)n[e](t)}return!0},Ru=ja,zu=fc,Bu=Cc,Vu=Dc,Hu=yc,Uu=bc,Wu=vc,Gu=pc,Ku=`~effect/Layer`,qu=`~effect/Layer/MemoMap`,Ju=(e,t)=>{let n={observers:0,deferred:Mu(),scope:Bu(),finalizer:r=>Oo(()=>--n.observers>0?I:(e.map.delete(t),Gu(n.scope,r)))};return n},Yu=(e,t)=>t.state._tag!==`Closed`&&(e.observers++,xc(t,{},e.finalizer),!0),Xu={[Ku]:{_ROut:m,_E:m,_RIn:m},pipe(){return u(this,arguments)}},Zu=e=>{let t=Object.create(Xu);return t.build=e,t},Qu=e=>Zu((t,n)=>{let r=Wu(n);return Pc(e(t,r),e=>e._tag===`Failure`?Gu(r,e):I)}),$u=e=>{let t=Qu((n,r)=>n.getOrElseMemoize(t,r,e));return t},ed=class{get[qu](){return qu}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?(Yu(n,t),n.deferred.effect??Nu(n.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return Oo(()=>{let r;return Mc(Oo(()=>{let i=this.get(e,t);if(i)return i;let a=Ju(this,e);return Yu(a,t)?(r=a.deferred,this.map.set(e,a),n(this,a.scope)):n(this,t)}),e=>{r&&Lu(r,e)})})}},td=()=>new ed,nd=e=>new ed(e),rd=class e extends lr()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=Mr(t,e);return n?nd(n):td()}},id=p(3,(e,t,n)=>js(us(e.build(t,n),Ar(rd,t)),rd,t)),ad=p(2,(e,t)=>on(n=>id(e,rd.forkOrCreate(n.context),t))),z=function(){return arguments.length===1?e=>B(kr(arguments[0],e)):B(kr(arguments[0],arguments[1]))},B=e=>Zu(h(F(e))),od=function(){return arguments.length===1?e=>sd(arguments[0],e):sd(arguments[0],arguments[1])},sd=(e,t)=>cd(us(t,t=>kr(e,t))),cd=e=>$u((t,n)=>Vu(e,n)),ld=(e,t,n)=>{let r=Wu(n,`parallel`);return Zc(e,e=>e.build(t,Wu(r,`sequential`)),{concurrency:e.length}).pipe(us(e=>Vr(...e)))},ud=(...e)=>Qu((t,n)=>ld(e,t,n)),dd=(e,t,n)=>Qu((r,i)=>ss(Array.isArray(t)?ld(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(As(t),us(e=>n(e,t))))),fd=p(2,(e,t)=>dd(e,t,m)),pd=p(2,(e,t)=>dd(e,t,(e,t)=>Br(t,e))),md=e=>Zu((t,n)=>Gs(e.build(t,n))),hd=`~effect/DateTime`,gd=`~effect/DateTime/TimeZone`,_d={[hd]:hd,pipe(){return u(this,arguments)},[st](){return this.toString()},toJSON(){return yd(this).toJSON()}};({..._d}),{..._d};var vd={[gd]:gd,[st](){return this.toString()}};({...vd}),{...vd};var yd=e=>new Date(e.epochMilliseconds),bd=p(2,(e,t)=>Rs(e,wd,e=>t(e))),xd=e=>e.reasons.some(Sd),Sd=e=>e._tag===`Fail`&&yu(e.error),Cd=e=>{let t,n=!1;for(let r of e.reasons)Sd(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?Kr(e):n?Kr(su(e.reasons.filter(e=>!Sd(e)))):Gr(t)},wd=e=>{let t=Cd(e);return qr(t)?t:Gr(t.success.value)},Td=e=>{let t=Cd(e);return qr(t)?Cu(t.failure):Su(t.success.value)},Ed=p(2,(e,t)=>Ys(e,{onSuccess:t.onSuccess,onFailure:e=>{let n=Cd(e);return qr(n)?t.onFailure(n.failure):t.onDone(n.success.value)}})),Dd=`~effect/Schedule`,Od=Hr(`effect/Schedule/CurrentMetadata`,{defaultValue:h({input:void 0,output:void 0,duration:Fi,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),kd={[Dd]:{_Out:m,_In:m,_Env:m},pipe(){return u(this,arguments)}},Ad=e=>A(e,Dd),jd=e=>{let t=Object.create(kd);return t.step=e,t},Md=()=>{let e=0,t,n;return(r,i)=>{n===void 0&&(n=r);let a=r-n,o=t===void 0?0:r-t;return t=r,{input:i,attempt:++e,start:n,now:r,elapsed:a,elapsedSincePrevious:o}}},Nd=e=>jd(us(e,e=>{let t=Md();return(n,r)=>e(t(n,r))})),Pd=e=>Fs(e.step,e=>F(()=>To(e))),Fd=e=>Rl(t=>us(Pd(e),e=>{let n=Md();return r=>Oo(()=>{let i=t.currentTimeMillisUnsafe();return ss(e(i,r),([e,t])=>{let a=n(i,r);return a.output=e,a.duration=t,Wo(zl(t),a)})})})),Id=e=>jd(us(Yc(e.map(Pd)),e=>(t,n)=>ss(Zc(e,e=>Ed(e(t,n),{onSuccess:e=>F(e[1]),onDone:()=>ru,onFailure:To})),e=>{let t=Ld(e);return t===void 0?bu(Fi):F([t,t])}))),Ld=e=>{let t;for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(t=t===void 0?r:Zi(t,r))}return t},Rd=(e,t=2)=>{let n=Gi(Ci(e));return Nd(F(e=>{let r=zi(n*t**(e.attempt-1));return F([r,r])}))},zd=e=>jd(us(Pd(e),e=>(t,n)=>Ed(e(t,n),{onSuccess:e=>F([n,e[1]]),onFailure:To,onDone:()=>bu(n)}))),Bd=e=>{let t=Ci(e);return Nd(F(e=>F([e.attempt-1,t])))},Vd=p(2,(e,t)=>jd(us(Pd(e),e=>{let n=Md();return(r,i)=>ss(e(r,i),e=>{let[a,o]=e,s=t({...n(r,i),output:a,duration:o});return ss(kt(s)?s:F(s),t=>t?F(e):bu(a))})}))),Hd=Bd(Fi),Ud=(e,t,n)=>kc(r=>ss(n?.local?id(t,td(),r):ad(t,r),t=>As(e,t))),Wd=p(e=>kt(e[0]),(e,t,n)=>Tr(t)?As(e,t):Ud(e,Array.isArray(t)?ud(...t):t,n)),Gd=p(3,(e,t,n)=>ss(Fd(t),t=>{let r=Od.defaultValue(),i,a=zs(Oo(()=>js(e,Od,r)),e=>(i=e,ss(t(e),e=>(r=e,a))));return bd(a,e=>ht(()=>n(i,e)))})),Kd=p(2,(e,t)=>Gd(e,typeof t==`function`?t(m):Ad(t)?t:Jd(t),Eo)),qd=zd(Hd),Jd=e=>{let t=e.schedule?zd(e.schedule):qd;return e.while&&(t=Vd(t,({input:t})=>{let n=e.while(t);return kt(n)?n:F(n)})),e.until&&(t=Vd(t,({input:t})=>{let n=e.until(t);return kt(n)?us(n,e=>!e):F(!n)})),e.times!==void 0&&(t=Vd(t,({attempt:t})=>F(t<=e.times))),t},Yd=kt,Xd=Zc,Zd=Xc,V=F,Qd=Ao,$d=Oo,ef=Do,tf=I,nf=Lo,rf=Ro,af=zo,H=Eo,of=To,sf=jo,cf=Mo,lf=on,U=ss,uf=ls,df=ns,ff=rs,pf=rc,mf=us,hf=Wo,gf=is,_f=Fs,vf=Gs,yf=Hs,bf=Bs,xf=Kd,Sf=Gd,Cf=Ks,wf=qs,Tf=cc,Ef=oc,Df=ac,Of=os,kf=Ns,Af=Ys,jf=Ds,Mf=ks,Nf=Wd,Pf=As,Ff=ws,If=Ts,Lf=js,Rf=Ec,zf=Oc,Bf=kc,Vf=Ac,Hf=Fc,Uf=Lc,Wf=Pc,Gf=Bc,Kf=qc,W=zc,qf=Vc,Jf=Ps,Yf=El,Xf=kl,Zf=jl,Qf=ol,$f=sl,ep=al,tp=cl,np=ul,rp=fl,ip=gl,ap=hl,op=ml,sp=Bo,cp=Ql(`Error`),lp=p(e=>Yd(e[0]),(e,...t)=>Es(e,Ru,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||gt(n,t[0],t[1]),n})),up=ds,dp=fs,fp=ps,pp=cs,mp=Ho,hp=bo,gp=xo,_p=So,vp=uo,yp=ll,bp=bl,xp=`~effect/MutableRef`,Sp={[xp]:xp,...Dt,toJSON(){return{_id:`MutableRef`,current:ct(this.current)}}},Cp=e=>{let t=Object.create(Sp);return t.current=e,t},wp=p(2,(e,t)=>(e.current=t,e)),Tp=Symbol.for(`effect/MutableList/Empty`),Ep=()=>({head:void 0,tail:void 0,length:0}),Dp=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},Op=()=>({array:[],mutable:!0,offset:0,next:void 0}),kp=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Op(),e.tail=e.tail.next):e.head=e.tail=Op(),e.tail.array.push(t),e.length++},Ap=(e,t)=>jp(e,ei(t),!Array.isArray(t)),jp=(e,t,n=!1)=>{if(t.length===0)return 0;let r={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=r:e.head=e.tail=r,e.length+=t.length,t.length},Mp=e=>{e.head=e.tail=void 0,e.length=0},Np=(e,t)=>{if(t=Wr(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return Mp(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i.offset===i.array.length&&i.next?i.next:i,e.length-=t,e.length===0?Mp(e):Dp(e),n;i=i.next}return Mp(e),n},Pp=e=>Np(e,e.length),Fp=e=>{if(!e.head)return Tp;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:Mp(e):Dp(e),t},Ip=(e,t)=>{let n=[],r=e.head,i=0;for(;r;){for(let e=r.offset;e<r.array.length;e++)t(r.array[e],i++)&&n.push(r.array[e]);r=r.next}if(n.length===0){Mp(e);return}e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length},Lp=(e,t)=>Ip(e,e=>e!==t),Rp=`~effect/PubSub/Subscription`,zp=p(2,(e,t)=>e.shutdownFlag.current||$n(e.ended.current)?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),Bp=e=>qf(Mf(t=>{let n=Fr(t,zu),r=Wu(e.scope),i=Wp(e.pubsub,e.subscribers,e.strategy,e.ended);return Uu(r,Vp(i)).pipe(df(Hu(n,e=>Gu(r,e))),hf(i))})),Vp=e=>qf(lf(t=>(wp(e.shutdownFlag,!0),Xd(Pp(e.pollers),e=>Iu(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(ff(()=>ef(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),kf(e.shutdownHook.open),gf)))),Hp=e=>$d(function t(n){if(e.shutdownFlag.current)return Gf;let r=e.pollers.length===0?e.subscription.pollUpTo(1/0):[];return n&&(r=n.concat(r)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?V(e.replayWindow.takeAll().concat(r)):ii(r)?V(r):U(Up(e),e=>t([e]))}),Up=e=>nf(t=>{if(e.shutdownFlag.current)return t(Gf);if($n(e.ended.current))return t(V(e.ended.current.value));let n=Mu(),r=e.subscribers.get(e.subscription);return r||(r=new Set,e.subscribers.set(e.subscription,r)),r.add(e.pollers),kp(e.pollers,n),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),n.effect?t(n.effect):(n.resumes=[t],ef(()=>Lp(e.pollers,n)))}),Wp=(e,t,n,r)=>new Gp(e,t,e.subscribe(),Ep(),bp(!1),Cp(!1),n,e.replayWindow(),r),Gp=class{[Rp]={_A:m};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(e,t,n,r,i,a,o,s,c){this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s,this.ended=c}pipe(){return u(this,arguments)}},Kp=`~effect/Queue`,qp=`~effect/Queue/Enqueue`,Jp=`~effect/Queue/Dequeue`,Yp={_A:m,_E:m},Xp={[Kp]:Yp,[qp]:Yp,[Jp]:Yp,...Dt,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:fm(this)}}},Zp=e=>on(t=>{let n=Object.create(Xp);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=Ep(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},F(n)}),Qp=e=>Zp({capacity:e}),$p=p(2,(e,t)=>Oo(()=>em(e,t)?mm:e.state._tag===`Open`&&e.strategy===`suspend`?Sm(e,t):pm)),em=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(Fp(e.messages),kp(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(kp(e.messages,t),_m(e),!0):(kp(e.messages,t),vm(e),!0):!1,tm=p(2,(e,t)=>Lo(n=>{let r=nm(e,t);return r.length===0||e.strategy===`dropping`?n($t(r)):Cm(e,{_tag:`Array`,remaining:r,offset:0,resume:n})})),nm=(e,t)=>{if(e.state._tag!==`Open`)return ei(t);if(e.capacity===1/0||e.strategy===`sliding`)return Ap(e.messages,t),e.strategy===`sliding`&&Np(e.messages,e.messages.length-e.capacity),vm(e),[];let n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return ei(t);let r=[],i=0;for(let a of t)i<n?kp(e.messages,a):r.push(a),i++;return vm(e),r},rm=p(2,(e,t)=>Do(()=>im(e,t))),im=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=Ss(nn(t),hm);return e.state.offers.size===0&&e.messages.length===0?(Dm(e,n),!0):(e.state={...e.state,_tag:`Closing`,exit:n},vm(e),!0)},am=e=>rm(e,Ht(hn())),om=e=>Do(()=>sm(e)),sm=e=>{if(e.state._tag===`Done`)return!1;Mp(e.messages);let t=e.state.offers;Dm(e,e.state._tag===`Open`?gm:e.state.exit);for(let e of t)wm(e);return!0},cm=e=>lm(e,1,1/0),lm=p(3,(e,t,n)=>(t=Wr(t),n=Wr(n),Oo(()=>ym(e,t,n)??ns(xm(e,()=>bm(e,t)),lm(e,t,n))))),um=e=>Oo(()=>dm(e)??ns(xm(e,()=>bm(e,1)),um(e))),dm=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=Fp(e.messages);return Em(e),$t(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=Tm(e.state.offers);return Em(e),$t(t)}},fm=e=>e.state._tag===`Done`?0:e.messages.length,pm=$t(!1),mm=$t(!0),hm=rn(hn()),gm=ms(),_m=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(e.state.takers.delete(t),t(vs),e.messages.length===0)break}},vm=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,_m(e)},0))},ym=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return $t([]);if(!bm(e,t))return;let r=e.messages.length>0?Np(e.messages,n):[Tm(e.state.offers)];return Em(e),$t(r)},bm=(e,t)=>e.messages.length>=(e.state._tag===`Closing`?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==`Done`&&e.state.offers.size>0,xm=(e,t)=>Lo(n=>e.state._tag===`Done`?n(e.state.exit):t()?n(vs):(e.state.takers.add(n),Do(()=>{e.state._tag!==`Done`&&e.state.takers.delete(n)}))),Sm=(e,t)=>Lo(n=>em(e,t)?n(mm):Cm(e,{_tag:`Single`,message:t,resume:n})),Cm=(e,t)=>{if(e.state._tag!==`Open`)return wm(t);let n=e.state.offers;return n.add(t),Do(()=>{e.state._tag!==`Done`&&(n.delete(t),e.state._tag===`Closing`&&n.size===0&&e.messages.length===0&&Dm(e,e.state.exit))})},wm=e=>e._tag===`Single`?e.resume(pm):e.resume($t(e.remaining.slice(e.offset))),Tm=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(mm),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume($t([]))),n},Em=e=>{if(e.state._tag===`Done`)return xd(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Dm(e,e.state.exit),xd(e.state.exit.cause));for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag===`Single`)kp(e.messages,t.message),e.state.offers.delete(t),t.resume(mm);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;kp(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume($t([]))}}return!1},Dm=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},Om=e=>new Am(e),km=(e,t,n)=>Lo(r=>{if(e.free>=t)return r(n);let i=()=>{e.free<t||(e.waiters.delete(i),r(n))};return e.waiters.add(i),Do(()=>{e.waiters.delete(i)})}),Am=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=Oo(()=>this.free<e?km(this,e,t):(this.taken+=e,F(e)));return t}takeIfAvailable(e){return Oo(()=>this.free<e?F(!1):(this.taken+=e,F(!0)))}releaseUnsafe(e,t){return this.taken-=t,this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{for(let e of this.waiters){if(this.free<=0)break;e()}},0),this.free}resize(e){return on(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),I))}release(e){return on(t=>F(this.releaseUnsafe(t,e)))}get releaseAll(){return on(e=>F(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>Jc(n=>{let r=Oo(()=>this.free<e?ss(n(km(this,e,I)),()=>r):(this.taken+=e,Mc(n(t),()=>{this.releaseUnsafe(uo(),e)},!0)));return r})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Jc(n=>this.free<e?Ao:(this.taken+=e,Mc(n(ts(t)),()=>{this.releaseUnsafe(uo(),e)},!0)))}},jm=`~effect/Channel`,Mm=e=>A(e,jm),Nm={[jm]:{_Env:m,_InErr:m,_InElem:m,_OutErr:m,_OutElem:m},pipe(){return u(this,arguments)}},Pm=e=>{let t=Object.create(Nm);return t.transform=(t,n)=>_f(e(t,n),e=>V(of(e))),t},Fm=(e,t)=>Pm((n,r)=>U(Rm(e)(n,r),e=>t(e,r))),Im=e=>Pm((t,n)=>e),Lm=e=>Pm(sp(function*(t,n){let r=Wu(n),i=e=>Gu(r,Td(e));return Uf(yield*Uf(e(t,n,r),i),i)})),Rm=e=>e.transform,zm=(e,t,n)=>Zp({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(ff(t=>Uu(e,om(t))),ff(n=>Qf(Vu(t(n),e),e))),Bm=(e,t)=>Pm((n,r)=>mf(zm(r,e,t),cm)),Vm=e=>Pm((t,n)=>$d(()=>Rm(e())(t,n))),Hm=e=>Wm(V(e)),Um=Im(V(bu())),Wm=e=>Im(ef(()=>{let t=!1;return $d(()=>t?bu():(t=!0,e))})),Gm=e=>Im(V(cm(e))),Km=e=>Im(V(W(Hp(e),()=>bu()))),qm=e=>ah(mf(Bp(e),Km)),Jm=p(2,(e,t)=>Fm(e,e=>ef(()=>{let n=0;return mf(e,e=>t(e,n++))}))),Ym=e=>e===void 0||e!==`unbounded`&&e<=1,Xm=p(e=>Mm(e[0]),(e,t,n)=>Ym(n?.concurrency)?Zm(e,t):Qm(e,t,n)),Zm=(e,t)=>Pm((n,r)=>{let i=0;return mf(Rm(e)(n,r),U(e=>t(e,i++)))}),Qm=(e,t,n)=>Lm(sp(function*(r,i,a){let o=0,s=yield*Rm(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:n.concurrency,l=yield*Qp(0);yield*Uu(a,om(l));let u=tp(yield*jf()),d=yp(a);if(n.unordered){let e=Om(c),n=h(e.release(1)),r=Af({onFailure:e=>U(rm(l,e),n),onSuccess:e=>U($p(l,e),n)});yield*e.take(1).pipe(U(()=>s),U(e=>{let n=o++;return d(u(r($d(()=>t(e,n))))),tf}),Jf({disableYield:!0}),_f(t=>e.withPermits(c-1)(rm(l,t))),Qf(a))}else{let e=yield*Qp(c-2);yield*Uu(a,om(e)),yield*um(e).pipe(uf,U(e=>$p(l,e)),Jf({disableYield:!0}),_f(e=>rm(l,e)),Qf(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,im(l,e.cause))};yield*s.pipe(U(i=>{if(n)return of(n);let a=o++,s=u($d(()=>t(i,a)));return d(s),s.addObserver(r),$p(e,hp(s))}),Jf({disableYield:!0}),_f(t=>$p(e,Cu(t)).pipe(df(rm(e,t)))),Qf(a))}return um(l)})),$m=e=>Fm(e,e=>{let t,n=0;return V($d(function r(){if(t===void 0)return U(e,e=>{switch(e.length){case 0:return r();case 1:return V(e[0]);default:return t=e,V(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),V(i)}))}),eh=p(2,(e,t)=>Fd(typeof t==`function`?t(m):t).pipe(mf(t=>{let n=Od.defaultValue();return th(dh(e,Od,ef(()=>n)),e=>t(e).pipe(mf(e=>{n=e}),bd(()=>bu(e))))}),ah)),th=(e,t)=>Pm((n,r)=>ef(()=>{let i,a=()=>{let o=Wu(r);return U(Rm(e)(n,o),e=>(i=bd(e,e=>Gu(o,Du).pipe(U(()=>t(e)),U(a))),i))};return $d(()=>i??a())})),nh=p(2,(e,t)=>Fm(e,e=>V(U(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return ai(i)?V(i):U(e,n)})))),rh=p(e=>Mm(e[0]),(e,t,n,r)=>Pm((i,a)=>mf(Rm(e)(i,a),e=>{let i=t(),a,o=0,s,c=Af(e,{onFailure(e){s=e;let t=r?.onHalt&&r.onHalt(i);return t&&t.length>0?V([i,t]):of(e)},onSuccess(e){let t=n(i,e);return ri(t)?V(t):t}});return $d(function e(){if(a===void 0)return s?of(s):U(c,([t,n])=>(i=t,n.length===0?e():n.length===1?V(n[0]):(a=n,e())));let t=a[o++];return o>=a.length&&(a=void 0,o=0),V(t)})}))),ih=p(2,(e,t)=>Pm((n,r)=>{let i=Wu(r);return mf(Rm(e)(n,i),e=>{let a=e.pipe(_f(e=>{if(xd(e))return of(e);let o=i;return i=Wu(r),Gu(o,Cu(e)).pipe(df(Rm(t(e))(n,i)),U(e=>(a=e,e)))}));return $d(()=>a)})})),ah=e=>Pm((t,n)=>{let r;return V($d(()=>r||e.pipe(Vu(n),U(e=>Rm(e)(t,n)),U(e=>r=e))))}),oh=p(2,(e,t)=>Lm((n,r,i)=>Hu(i,t).pipe(df(Rm(e)(n,r))))),sh=p(2,(e,t)=>oh(e,e=>t)),ch=(e,t,n)=>$d(()=>{let r=Bu();return bd(U(Rm(e)(bu(),r),t),n||V).pipe(Wf(e=>Gu(r,e)))}),lh=p(2,(e,t)=>Pm((n,r)=>mf(Pf(Rm(e)(n,r),t),Pf(t)))),uh=p(3,(e,t,n)=>Pm((r,i)=>mf(Lf(Rm(e)(r,i),t,n),Lf(t,n)))),dh=p(3,(e,t,n)=>Pm((r,i)=>U(n,n=>Rm(uh(e,t,n))(r,i)))),fh=p(2,(e,t)=>ch(e,e=>Jf(U(e,t),{disableYield:!0}))),ph=sp(function*(e){let t=Om(1),n=yield*jf(),r=Fr(n,zu);return(yield*Rm(e)(bu(),r)).pipe(Pf(n),t.withPermits(1))},_f(e=>V(of(e)))),mh=(e,t)=>Rm(e)(bu(),t),hh=`~effect/MutableHashMap`,gh={[hh]:hh,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${$e(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:ct(Array.from(this))}},[st](){return this.toJSON()},pipe(){return u(this,arguments)}},_h=()=>{let e=Object.create(gh);return e.backing=new Map,e.buckets=new Map,e},vh=p(2,(e,t)=>{if(e.backing.has(t))return Xn(e.backing.get(t));if(bh(t))return Yn();let n=yh.get(t);if(n!==void 0&&e.backing.has(n))return Xn(e.backing.get(n));let r=fe(t),i=e.buckets.get(r);return i===void 0?Yn():xh(e,i,t)}),yh=new WeakMap,bh=e=>typeof e!=`object`&&typeof e!=`function`,xh=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(Ae(n,t[r])){let i=t[r];return yh.set(n,i),Xn(e.backing.get(i))}return Yn()},Sh=p(3,(e,t,n)=>{if(e.backing.has(t)||bh(t))return e.backing.set(t,n),e;let r=yh.get(t);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=fe(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=Ch(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),Ch=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(Ae(t,e[n]))return yh.set(t,e[n]),e[n]},wh=p(2,(e,t)=>{if(bh(t))return e.backing.delete(t),e;let n=yh.get(t)??t,r=fe(n),i=e.buckets.get(r);if(i===void 0)return e;for(let t=0,r=i.length;t<r;t++){let r=i[t];if(r===n||Ae(n,r)){e.backing.delete(r),i.splice(t,1);break}}return i.length===0&&e.buckets.delete(r),e}),Th=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Eh=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)Eh[Th.charCodeAt(e)]=e;Eh[61]=0;var Dh=`~effect/Stream`,Oh={_R:m,_E:m,_A:m},kh=function(e){this.channel=e};kh.prototype={[Dh]:Oh,pipe(){return u(this,arguments)}};var Ah=e=>new kh(e),jh=`~effect/Stream`,Mh=e=>A(e,jh),Nh=Ah,Ph=e=>e.channel,Fh=(e,t)=>Nh(Bm(e,t)),Ih=Nh(Um),Lh=e=>Nh(Hm(ci(e))),Rh=e=>Nh(Vm(()=>e().channel)),zh=e=>Nh(Gm(e)),Bh=e=>Nh(qm(e)),Vh=e=>Nh(ah(mf(e,Ph))),Hh=p(2,(e,t)=>Rh(()=>{let n=0;return Nh(Jm(e.channel,li(e=>t(e,n++))))})),Uh=p(e=>Mh(e[0]),(e,t,n)=>e.channel.pipe($m,Xm(t,n),Jm(ci),Nh)),Wh=p(2,(e,t)=>Nh(eh(e.channel,t))),Gh=e=>Hh(e,(e,t)=>[e,t]),Kh=p(2,(e,t)=>Nh(nh(Ph(e),t))),qh=p(2,(e,t)=>e.channel.pipe(ih(e=>t(e).channel),Nh)),Jh=p(3,(e,t,n)=>Rh(()=>{let r=!0;return Nh(rh(e.channel,t,(e,t)=>{let i=si();r&&(r=!1,i.push(e));for(let r=0;r<t.length;r++)e=n(e,t[r]),i.push(e);return[e,ci(i)]}))})),Yh=p(2,(e,t)=>Nh(sh(e.channel,t))),Xh=p(2,(e,t)=>Nh(lh(e.channel,t))),Zh=p(2,(e,t)=>fh(e.channel,t)),Qh=e=>ph(e.channel),$h=`~effect/BigDecimal`,eg={[$h]:$h,[de](){let e=cg(this);return he(ve(String(e.value)),_e(e.scale))},[ke](e){return tg(e)&&pg(this,e)===0},toString(){return`BigDecimal(${hg(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[st](){return this.toJSON()},pipe(){return u(this,arguments)}},tg=e=>A(e,$h),ng=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(eg);return n.value=e,n.scale=t,n},rg=(e,t)=>{let n=ng(e,t);return n.normalized=n,n},ig=BigInt(0),ag=BigInt(1),og=BigInt(10),sg=rg(ig,0),cg=e=>{if(e.normalized===void 0){if(e.value===ig)e.normalized=sg;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=rg(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},lg=100,ug=[ag],dg=(e,t)=>e===t?0:e<t?-1:1,fg=(e,t)=>{let n=`${e.value<ig?-e.value:e.value}`,r=`${t.value<ig?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==ig)return i<ig?-1:1;let a=Math.max(n.length,r.length);return Wn(n.padEnd(a,`0`),r.padEnd(a,`0`))},pg=(e,t)=>{if(e.scale===t.scale)return dg(e.value,t.value);let n=mg(e),r=mg(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>lg)return n===-1?fg(t,e):fg(e,t);let o=ug[a]??=og**BigInt(a);return i>0?dg(e.value,t.value*o):dg(e.value*o,t.value)},mg=e=>e.value===ig?0:e.value<ig?-1:1,hg=e=>{let t=cg(e);if(Math.abs(t.scale)>=16)return gg(t);let n=t.value<ig,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},gg=e=>{if(_g(e))return`0e+0`;let t=cg(e),n=`${t.value}`,r=t.value<ig?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},_g=e=>e.value===ig;({...ut}),{...ut};var vg=new WeakMap,yg=`~effect/Redacted`,bg=e=>A(e,yg),xg=(e,t)=>{let n=Object.create(Sg);return t?.label&&(n.label=t.label),vg.set(n,e),n},Sg={[yg]:{_A:e=>e},label:void 0,...Dt,toJSON(){return this.toString()},toString(){return`<redacted${ee(this.label)?`:`+this.label:``}>`},[de](){return fe(vg.get(this))},[ke](e){return bg(e)&&Ae(vg.get(this),vg.get(e))}},Cg=Symbol.for(`~effect/http/Headers`),wg=Object.defineProperties(Object.create(null),{[Cg]:{value:Cg},[Ke]:{value(e){return Ag(this,Fr(e,jg))}},toJSON:{value(){return Je(this)}},[ke]:{value(e){return Eg(this,e)}},[de]:{value(){return be(this)}},toString:{value:ut.toString},[st]:{value:ut[st]}}),Tg=e=>Object.assign(Object.create(wg),e),Eg=Qr(bn()),Dg=Object.create(wg),Og=e=>{if(e===void 0)return Dg;if(Symbol.iterator in e){let t=Object.create(wg);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(wg);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},kg=p(2,(e,t)=>{let n=Tg(e);return Object.assign(n,t),n}),Ag=p(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=xg(e[r]))}else for(let r in e)r.search(t)!==-1&&(n[r]=xg(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),jg=Hr(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]});({...Dt});function Mg(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var Ng=`~structural`,Pg=`~sentinels`,Fg=`~constructor`,Ig=S(e=>{let t=Mg(e)?.identifier;return typeof t==`string`?t:e.getExpected(Ig)}),G=Symbol(),Lg=Su,Rg=Lg(G),zg=Lg(G),Bg=e=>e===G?Yn():Xn(e),Vg=e=>e._tag===`None`?Rg:Lg(e.value),Hg=`~effect/SchemaIssue/Issue`;function Ug(e){return A(e,Hg)&&e[Hg]===Hg}function Wg(e){return Object.hasOwn(e,`input`)}var Gg=class{[Hg]=Hg;constructor(e,t){t?.reportInput===!0&&e!==G&&(this.input=e)}},Kg=class extends Gg{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},qg=class extends Gg{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Jg=class extends Gg{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Yg=class extends Gg{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Xg=class extends Gg{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Zg=class extends Gg{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Qg=class extends Gg{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},$g=class extends Gg{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}};function e_(e,t,n,r,i){return new Zg(e,[new Jg([t],n)],r,i)}var t_=class extends Gg{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},n_=class extends Gg{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function r_(e,t,n){if(Ug(e))return e;if(typeof e==`string`)return new $g({message:e},t,n);let r=typeof e.issue==`string`?new $g({message:e.issue},t,n):e.issue;return new Jg(e.path,r)}function i_(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new $g(void 0,t,n):r_(e,t,n)}function a_(e,t,n,r){return Array.isArray(t)?ai(t)?t.length===1?r_(t[0],n,r):new Zg(e,li(t,e=>r_(e,n,r)),n,r):void 0:i_(t,n,r)}var o_=e=>{let t=h_(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return u_(Ig(e.ast),e);case`InvalidValue`:{let t=l_(e);if(t!==void 0)return u_(t,e);let n=c_(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=c_(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=c_(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},s_=e=>h_(e.issue)??h_(e);function c_(e){return Wg(e)?$e(e.input):void 0}function l_(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function u_(e,t){let n=c_(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function d_(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>d_(e)).join(` & `)}}function f_(){return e=>m_(e,``)}var p_=f_();function m_(e,t){let n;switch(e._tag){case`Filter`:{let r=s_(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return m_(e.issue,t);let r=l_(e.issue);n=r===void 0?u_(d_(e.filter),e):u_(r,e.issue)}break}case`Encoding`:return m_(e.issue,t);case`Pointer`:return m_(e.issue,t+nt(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>m_(e,t)).join(`
15
+ `);n=h_(e)??u_(Ig(e.ast),e);break;default:n=o_(e)}return t?`${n}\n at ${t}`:n}function h_(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return h_(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function g_(e){let t;for(let n of e.reasons){if(!ou(n)||!Ug(n.error))return;t??=n.error}return t}function __(e,t){let n=g_(e);if(n===void 0)throw Error(t,{cause:e});return n}var v_=e=>Object.assign(Object.create(d),e),y_=v_({_tag:`Passthrough`});function b_(){return y_}function x_(e){return v_({_tag:`Transform`,transform:e})}function S_(){return x_(globalThis.String)}function C_(){return x_(globalThis.Number)}var w_=class extends f{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new w_(this.encode,this.decode)}},T_=`~effect/SchemaTransformation/Transformation`,E_=class extends f{[T_]=T_;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new E_(this.encode,this.decode)}};function D_(e){return A(e,T_)&&e[T_]===T_}var O_=e=>D_(e)?e:new E_(e.decode,e.encode);function k_(e){return new E_(x_(e.decode),x_(e.encode))}var A_=new E_(b_(),b_());function j_(){return A_}var M_=new E_(C_(),S_()),N_=e=>oe(e)&&typeof e.message==`string`,P_=e=>{let t=Object.hasOwn(e,`cause`)?Error(e.message,{cause:R_(e.cause)}):Error(e.message);return typeof e.name==`string`&&e.name!==`Error`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t},F_=e=>{try{let t=ot(e);return t===void 0?$e(e):JSON.parse(t)}catch{return $e(e)}},I_=(e,t,n)=>{let r={name:e.name,message:typeof e.message==`string`?e.message:``};return t?.includeStack&&typeof e.stack==`string`&&(r.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(r.cause=n(e.cause)),r},L_=e=>{let t=new WeakSet,n=r=>{if(le(r)){if(t.has(r))return`[Circular]`;t.add(r);let i=I_(r,e,n);return t.delete(r),i}return F_(r)};return n},R_=e=>N_(e)?P_(e):e,z_=e=>k_({decode:R_,encode:L_(e)});function B_(e){return t=>t._tag===e}var V_=B_(`Declaration`),H_=B_(`Never`),U_=B_(`Literal`),W_=B_(`UniqueSymbol`),G_=B_(`Arrays`),K_=B_(`Objects`),q_=B_(`Suspend`),J_=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Y_={},X_=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Z_=`~effect/Schema`,Q_=class{[Z_]=Z_;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},$_=class extends Q_{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===G?Rg:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=by(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new $_(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},ev=new class extends Q_{_tag=`Null`;getParser(){return Fy(this,null)}getExpected(){return`null`}},tv=class extends Q_{_tag=`Undefined`;getParser(){return Fy(this,void 0)}toCodecJson(){return cy(this,[nv])}getExpected(){return`undefined`}},nv=new J_(ev,new E_(x_(()=>void 0),x_(()=>null))),rv=new tv,iv=new class extends Q_{_tag=`Void`;getParser(){let e=Lg(void 0);return t=>t===G?Rg:e}toCodecJson(){return cy(this,[nv])}getExpected(){return`void`}},av=new class extends Q_{_tag=`Never`;getParser(){return Iy(this,k)}getExpected(){return`never`}},ov=new class extends Q_{_tag=`Unknown`;getParser(){return Iy(this,ae)}getExpected(){return`unknown`}},sv=class extends Q_{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${$e(e)}`);this.literal=e}getParser(){return Fy(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?cv(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:cv(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function cv(e){let t=globalThis.String(e.literal);return cy(e,[new J_(new sv(t),new E_(x_(()=>e.literal),x_(()=>t)))])}var lv=new class extends Q_{_tag=`String`;getParser(){return Iy(this,ee)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Gy(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},uv=class extends Q_{_tag=`Number`;getParser(){return Iy(this,te)}matchKey(e,t){return this._match(By,e,t)}matchPart(e,t){return this._match(zy,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Gy(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(dv(this.checks,`effect/schema/isFinite`)||dv(this.checks,`effect/schema/isInt`))?this:cy(this,[ry])}toCodecStringTree(){return this.toCodecJson()===this?cy(this,[Uy]):cy(this,[Wy])}getExpected(){return`number`}};function dv(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&dv(e.checks,t))}var fv=new uv,pv=new class extends Q_{_tag=`Boolean`;getParser(){return Iy(this,ne)}getExpected(){return`boolean`}},mv=class extends Q_{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Dy(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Dy(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}let c=e=>{let{input:t,len:r,options:i}=e;if(n.rest.length===0&&r>a)for(let o=a;o<r;o++){let r=new Xg(n,t[o],i),a=new Jg([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return H(new Zg(n,[a],t,i))}return e.issues?H(new Zg(n,e.issues,t,i)):Lg(e.output)},l=(e,t)=>{let r=e.length,i={ast:n,getParser:s,input:e,len:r,tailThreshold:Math.max(a,r-o),output:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:$c(t.concurrency),f=d===1?_v(i,e,0,u):vv(i,e,{concurrency:d,end:u});if(!f)return c(i);if(R(f))return pp(f,()=>c(i));let p=!0;return $d(()=>p?(p=!1,U(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===G)return Rg;try{return Array.isArray(e)?(r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)}))),l(e,a)):H(new Qg(n,e,a))}catch(e){return cf(e)}}}_rebuild(e,t,n){let r=by(this.elements,e),i=by(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new mv(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function hv(e,t,n,r){if(n._tag===`Failure`)return yv(e,e.ast,r,n);let i=n===zg?t:n[M];if(i!==G)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Dy(t.ast))return;let n=new Jg([r],new Yg(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return wu(new Zg(e.ast,[n],e.input,e.options))}}var gv={onItem(e,t,n){let r=n<e.len?t:G;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:hv},_v=el()(gv),vv=nl()(gv),yv=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=g_(r.cause);if(i===void 0)return Cu(mu(r.cause,r=>new Zg(t,[new Jg([n],r)],e.input,e.options)));let a=new Jg([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return wu(new Zg(t,[a],e.input,e.options))},bv=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function xv(e,t,n=Y_){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(Ly(jy(t)))}var Sv=class{name;type;constructor(e,t){this.name=e,this.type=t}};function Cv(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(Cv);default:return!1}}function wv(e){let t=uy(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(wv);default:return!1}}function Tv(e){return Cv(e)&&wv(e)}var Ev=class{parameter;type;constructor(e,t){if(!Tv(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Dy(t)&&!Py(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Dv=class extends Q_{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,t=e){let n=this,r=n.propertySignatures.length,i=n.indexSignatures.length;if(!r&&!i)return Iy(n,ie);let a,o,s=()=>(a||(a=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),o=i?n.indexSignatures.map(n=>({is:n,parserKey:e(Ly(n.parameter)),parserValue:t(n.type)})):void 0),a),c=()=>{let e=new Set(n.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),t=(t,i,a,o,s)=>{if(s._tag===`Failure`)return yv(t,n,i,s)??Du;let c=s===zg?o:s[M];if(a!==G&&c!==G){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Du;gt(t.out,a,c)}return Du},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!R(t))return U(pf(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return yv(e,n,r,a)??Du;let o=a===zg?r:a[M],s=e.input[r],l=i.parserValue(s,e.options);return R(l)?t(e,r,o,s,l):U(pf(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return R(a)?t(e,n,n,i,a):U(pf(a),r=>t(e,n,n,i,r))},u=i?nl()({onItem:(e,[t,n])=>n.is.parameter===lv?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return mp(function*(t,d){if(t===G)return G;if(typeof t!=`object`||!t||Array.isArray(t))return yield*H(new Qg(n,t,d));s();let f=t,p={},m={ast:n,input:f,out:p,issues:void 0,options:d},h=d.errors===`all`,g=d.onExcessProperty===`error`,_=d.concurrency===void 0?1:$c(d.concurrency),v=i&&g?n.indexSignatures.map(e=>xv(f,e.parameter,d)):void 0;if(g){let r=v?new Set(e):e;if(v)for(let e of v)for(let t of e)r.add(t);let i=Reflect.ownKeys(f);for(let e=0;e<i.length;e++){let a=i[e];if(!r.has(a)&&Object.prototype.propertyIsEnumerable.call(f,a)){let e=new Xg(n,f[a],d),r=new Jg([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*H(new Zg(n,[r],t,d))}}}if(r){let e=_===1?Av(m,a):jv(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===lv?l:c,r=v?.[e]??(t.is.parameter===lv?Object.keys(f):xv(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!R(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=si();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===lv?Object.keys(f):xv(f,n.is.parameter,d));for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=u(m,e,{concurrency:_});t&&(yield*t)}return m.issues?yield*H(new Zg(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return U(pf(n),n=>{let i=Ov(e,r,n);if(i)return i;let o=()=>Lg(e.out),s=Av(e,a.slice(t+1));return s?pp(s,o):o()})};return(e,t)=>{if(e===G)return Rg;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&$c(t.concurrency)!==1)return(l??=c())(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return H(new Qg(n,e,t));let r=s(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Hv(i,s),l=c?i[s]:G,d=n.parser(l,t);if(!R(d))return u(o,e,d);if(d===zg){c&&gt(a,s,l);continue}let f=Ov(o,n,d);if(f)return f}}catch(e){return cf(e)}return Lg(a)}}_rebuild(e,t,n,r){let i=by(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new Sv(t.name,n)}),a=by(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new Ev(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Dv(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Ov(e,t,n){if(n._tag===`Failure`)return yv(e,e.ast,t.name,n);if(n===zg)return;let r=n[M];if(r!==G){gt(e.out,t.name,r);return}if(delete e.out[t.name],!Dy(t.type)){let n=new Jg([t.name],new Yg(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return wu(new Zg(e.ast,[n],e.input,e.options))}}var kv={onItem(e,t){if(!Hv(e.input,t.name))return t.parser(G,e.options);let n=e.input[t.name];return gt(e.out,t.name,n),t.parser(n,e.options)},step:Ov},Av=el()(kv),jv=nl()(kv);function Mv(e,t){return e?t?[...e,...t]:e:t}function Nv(e,t,n){return new Dv(Reflect.ownKeys(e).map(t=>new Sv(t,e[t].ast)),[],n,t)}function Pv(e){return e.ast}function Fv(e,t,n){return new Kv(e.map(Pv),t,void 0,n)}var Iv=C(e=>{for(;;){if(q_(e))return ov;let t=e.encoding;if(!t)return e.recur?.(Iv,m)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==m))return ov;e=t[t.length-1].to}});function Lv(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Lv)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Rv(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Pg];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Dy(t)){if(U_(t))return[{key:e.name,literal:t.literal}];if(W_(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Dy(e)){if(U_(e))return[{key:t,literal:e.literal}];if(W_(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Rv(Iv(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Rv(e.thunk())}}var zv=new WeakMap,Bv=Object.freeze([]),Vv=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,Hv=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function Uv(e){let t=zv.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Iv(s);if(H_(c))continue;if(U_(c)||W_(c)){a??=new Map;let e=U_(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1;let l=Rv(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Lv(c);for(let n of e)(i[n]??=[]).push(t)}}let s={},c=t=>s[t]??=Object.freeze((i?.[t]??Bv).map(t=>e[t]));if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Bv;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(se(t)){let i=Hv(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Bv;if(n)return e}return Bv}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=Vv(t);if(!se(t))return c(o);let s=new Set(i?.[o]),l;if(a){let[e,[n]]=a,i=Hv(t,e),u=i?t[e]:void 0;if(i&&(!r||u!==void 0)){let t=n.get(u);if(!t)return c(o);for(let e of t)s.add(e);l=e}}if(l===void 0)for(let[e,[i,a]]of n){let n=Hv(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===l)continue;let n=Hv(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=e=>{let t=c(Vv(e));return a?t.filter(Wv(e)):t};return zv.set(e,t),t}function Wv(e){return t=>{let n=Iv(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Gv(e,t,n=!1){return Uv(t)(e,n)}var Kv=class extends Q_{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===G)return Rg;let a=Gv(r,n.types,t!==void 0);if(a.length===0)return H(new t_(n,[],r,i));if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:R(t)?qv(n,t.cause,r,i):_f(t,e=>qv(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=Jv(o,a);return s?pp(s,e=>o.out===zg?V(r):o.out?o.out:H(new t_(n,o.issues??[],r,i))):o.out?o.out:H(new t_(n,o.issues??[],r,i))}}_rebuild(e,t,n){let r=by(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new Kv(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=jy(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(U_);if(t.length>0)return`${Xv(n.isMutable)}[ ${t.map(t=>e(t)+Zv(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>U_(e.type));if(t.length>0)return`{ ${t.map(t=>`${Xv(t.type.context?.isMutable)}${tt(t.name)}${Zv(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function qv(e,t,n,r){let i=g_(t);return i?wu(new t_(e,[i],n,r)):Cu(t)}var Jv=el()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=g_(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),wu(new n_(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Du}}}),Yv=new Kv([new sv(`Infinity`),new sv(`-Infinity`),new sv(`NaN`)]);function Xv(e){return e?``:`readonly `}function Zv(e){return e?`?`:``}var Qv=class extends f{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new Qv(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Qv(this.run,this.annotations,!0)}and(e,t){return new $v([this,e],t)}},$v=class extends f{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new $v(this.checks,{...this.annotations,...e})}and(e,t){return new $v([this,e],t)}};function ey(e,t,n=!1){return new Qv((t,n,r)=>a_(n,e(t,n,r),t,r),t,n)}function ty(e){return ey(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var ny=py(fv,[ty()]),ry=new J_(new Kv([ny,Yv]),new E_(C_(),x_(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function iy(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return ey(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}function ay(e){return Object.assign(Object.create(Object.getPrototypeOf(e)),e)}var oy=new WeakMap;function sy(e){return oy.get(e)??e}function cy(e,t){if(e.encoding===t)return e;let n=ay(e);return n.encoding=t,n}function ly(e,t){if(e.context===t)return e;let n=sy(e);if(n.context===t)return n;let r=ay(e);return r.context=t,oy.set(r,n),r}function uy(e){return e.encoding?uy(e.encoding[e.encoding.length-1].to):e}function dy(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return fy(e,ti(e.checks.slice(0,-1),n.annotate(t)))}let n=ay(e);return n.annotations={...e.annotations,...t},n}function fy(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);if(e.checks===t)return e;let n=ay(e);return n.checks=t,n}function py(e,t){return fy(e,Mv(e.checks,t))}function my(e,t){let n=t(e.to);return n===e.to?e:new J_(n,e.transformation)}function hy(e,t){let n=e,r=n[n.length-1],i=my(r,t);return i===r?e:ti(e.slice(0,e.length-1),i)}function gy(e){return t=>t.encoding?cy(t,hy(t.encoding,e)):t}function _y(e,t){return gy(e=>ly(e,t))(e)}function vy(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:cy(r,hy(r.encoding,n))}return e(r)}return C(n)}function yy(e,t,n){let r=new J_(e,t);return cy(n,n.encoding?[...n.encoding,r]:[r])}function by(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function xy(e,t){return ly(e,e.context?new X_(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new X_(!1,!1,void 0,t))}var Sy=C(e=>Cy(ly(e,e.context?e.context.isOptional===!1?new X_(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new X_(!0,!1)))),Cy=gy(Sy),wy=S(e=>Sy(new Kv([e,rv])));function Ty(e,t){return ly(e,e.context?new X_(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new X_(!1,!1,t))}function Ey(e,t,n){return yy(e,n,t)}function Dy(e){return e.context?.isOptional??!1}function Oy(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Oy)}function ky(e){function t(e){return Oy(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return ii(n)?n:void 0}var Ay=C(e=>{let t=e,n=t.recur?.(Ay)??t,r=n.encodingChecks;if(r){let t=n===e?r:G_(n)||K_(n)||V_(n)&&n.typeParameters.length>0?ky(r):void 0,i=ay(n);return i.encoding=void 0,i.encodingChecks=void 0,i.checks=Mv(n.checks,t),i}return n.encoding?cy(n,void 0):n}),jy=C(e=>Ay(Ny(e)));function My(e,t){let n=t,r=n.length,i=n[r-1],a=[new J_(Ny(cy(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new J_(Ny(n[e-1].to),n[e].transformation.flip()));let o=Ny(i.to);return o.encoding?cy(o,[...o.encoding,...a]):cy(o,a)}var Ny=S(e=>{if(e.encoding)return My(e,e.encoding);let t=e;return t.flip?.(Ny)??t.recur?.(Ny)??t});function Py(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Py);default:return!1}}function Fy(e,t){let n=t===0?zg:Lg(t);return(r,i)=>r===G?Rg:r===t?n:H(new Qg(e,r,i))}function Iy(e,t){return(n,r)=>n===G?Rg:t(n)?zg:H(new Qg(e,n,r))}var Ly=vy(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Ly)}}),Ry=vy(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Ry)}}),zy=new globalThis.RegExp(`^${bv}$`),By=new globalThis.RegExp(`^(?:${bv}|Infinity|-Infinity|NaN)$`);function Vy(e){return iy(zy,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:zy.source}),...e})}var Hy=py(lv,[Vy()]),Uy=new J_(Hy,M_),Wy=new J_(new Kv([Hy,Yv]),M_);function Gy(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Gy(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Kg(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Ky(e){if(!V_(e))return;let t=e.annotations?.[Fg];return re(t)?t(e.typeParameters):void 0}function qy(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Jy(e){return e===void 0||typeof e==`string`}function Yy(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function Xy(e){return Yy(e,qy)}var Zy=new $_([],()=>(e,t,n)=>Xy(e)?zg:H(new Qg(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>tb}),Qy=new J_(Zy,j_()),$y=new J_(new Kv([new mv(!1,[],[Zy]),new Dv([],[new Ev(lv,Zy)])]),j_());function eb(e){return Yy(e,Jy)}var tb=new J_(new $_([],()=>(e,t,n)=>eb(e)?zg:H(new Qg(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),j_()),nb=(e,t,n)=>e===zg?n(t):pp(e,n);function rb(e){if(e._tag===`Middleware`)return(t,n,r)=>ib(t===zg?e.decode(Lg(Bg(n)),r):e.decode(up(t,Bg),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===zg?Lg(t):e;case`Transform`:{let e=e=>e===G?Rg:Lg(t.transform(e));return(t,n)=>nb(t,n,e)}case`TransformOptional`:{let e=e=>Vg(t.transform(Bg(e)));return(t,n)=>nb(t,n,e)}case`TransformEffect`:return(e,n,r)=>nb(e,n,e=>e===G?Rg:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>nb(e,n,e=>ib(t.transform(Bg(e),r)))}}var ib=e=>pp(e,Vg),ab=(e,t,n,r)=>_f(r,r=>sf(()=>mu(r,r=>new qg(e,r,t,n))));function ob(e,t){let n=rb(e.link.transformation),r;return(i,a)=>{if(i===G)return Rg;if(e.isConstructed(i))return zg;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function sb(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==G&&r!==void 0)return t(r,i);let a=n;if(R(a)&&a._tag===`Success`){let e=t(a[M],i);return e===zg?a:e}return pp(ab(e,r,i,a),e=>{let n=t(e,i);return n===zg?Lg(e):n})}}function cb(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:sb(e,n)}function lb(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Ky(e):void 0,o=a?ob(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>rb(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(R(r)){if(r._tag===`Success`){let i=r===zg?t:r[M];if(t!==G&&i!==G){let i=Gy(u,t,void 0,e,n);i&&(r=H(new Zg(e,i,t,n)))}}}else r=U(r,r=>{if(t!==G&&r!==G){let r=Gy(u,t,void 0,e,n);if(r)return H(new Zg(e,r,t,n))}return V(r)})}if(s&&!n.disableChecks){if(R(r)){if(r._tag===`Success`){let i=r===zg?t:r[M];if(i===G)return r;let a=Gy(s,i,void 0,e,n);a&&(r=H(new Zg(e,a,i,n)))}}else r=U(r,t=>{if(t!==G){let r=Gy(s,t,void 0,e,n);if(r)return H(new Zg(e,r,t,n))}return V(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[M],o=t(a,r)):o=pp(o,e=>{let n=t(e,r);return n===zg?Lg(e):n})}if(o._tag===`Success`){let e=o[M],t=p(e,r);return t===zg?o:t}return o=ab(e,n,r,o),pp(o,e=>{let t=p(e,r);return t===zg?Lg(e):t})}:p}var ub=Symbol(),db=new WeakMap,fb=e=>gb(e).parser,pb=e=>gb(e).makeEffect,mb=e=>cb(e,pb),hb=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=lb(this.ast,fb)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=lb(this.ast,pb,mb)}};function gb(e){let t=db.get(e);if(t!==void 0)return t;let n=new hb(e);return db.set(e,n),n}function _b(e){let t=e.ast,n;return(e,r)=>(n??=Eb(Ab,Ay(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function vb(e){let t=_b(e);return(e,n)=>{let r=op(t(e,n));return Ou(r)?Xn(r.value):(__(r.cause,`Option adapter can only return none for schema issues`),Yn())}}function yb(e){return Ob(Ay(e.ast))}function bb(e,t){let n=wb(e.ast);return t===void 0?n:(e,r)=>n(e,Sb(t,r))}function xb(e,t){let n=wb(Ny(e.ast));return t===void 0?n:(e,r)=>n(e,Sb(t,r))}var Sb=(e,t)=>t?{...e,...t}:e,Cb=e=>e===G?H(new $g):V(e);function wb(e){return Eb(kb,e)}function Tb(e,t){return e===zg?V(t):R(e)?e[M]===G?Cb(G):e:pp(e,Cb)}function Eb(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Y_);return a===zg?V(r):R(a)?a[M]===G?Cb(G):a:pp(a,Cb)}}function Db(e,t){let n=op(e);if(Ou(n))return n.value;let r=__(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function Ob(e){let t,n;return(r,i)=>{t??=gb(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??Y_,o=t.make;if(o!==void 0&&r!==G){let e;try{e=o(r,a)}catch(e){throw __(lu(e),`Constructor adapter can only throw schema issues`),e}if(e!==ub&&e!==G)return e}return Db(Tb((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var kb=e=>gb(e).parser,Ab=e=>gb(e).makeEffect,jb=`~effect/Schema/Schema`,Mb=Symbol(),Nb={[jb]:jb,get make(){let e=yb(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=_b(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=vb(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return u(this,arguments)},annotate(e){return this.rebuild(dy(this.ast,e))},annotateKey(e){return this.rebuild(xy(this.ast,e))},check(...e){return this.rebuild(py(this.ast,e))},rebuild(e){return Pb(e,this[Mb])}};function Pb(e,t){function n(){}let r=Object.setPrototypeOf(n,Nb);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[Mb]=t,r.ast=e,r}function Fb(e){return Pb(Ib(e.ast),{schema:e})}var Ib=vy(e=>{let t=Vb(e,Ib),n=e.context;return t===e||n===void 0?t:_y(t,Lb(n))});function Lb(e){return e.constructorDefault===void 0?e:new X_(e.isOptional,e.isMutable,void 0,e.annotations)}function Rb(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function zb(e){return t=>{let n=new Map;for(let e=0;e<t.length;e++)n.set(jy(t[e]),e);let r=[...t].sort((t,r)=>{t=jy(t),r=jy(r);let i=e(t),a=e(r);return i===a?n.get(t)-n.get(r):i-a});return r.some((e,n)=>e!==t[n])?r:t}}var Bb=zb(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function Vb(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!re(n))return cy(e,[Qy]);let r=n(e.typeParameters.map(e=>Pb(jy(e))));return r===void 0?e:cy(e,[my(r,t)])}case`Unknown`:return cy(e,[Qy]);case`ObjectKeyword`:return cy(e,[$y]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return Rb(e),e.recur(t,Ry);case`Union`:{let n=Bb(e.types);return n===e.types?e.recur(t):new Kv(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}var Hb=e=>e,Ub=`~effect/Schema/SchemaError`;function Wb(e){return A(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}var Gb=jb;function Kb(){return(e,t,n)=>sx(new $_(e.map(Pv),e=>t(e.map(e=>sx(e))),n))}function qb(e,t){return Kb()([],()=>(t,n,r)=>e(t)?V(t):H(new Qg(n,t,r)),t)}var Jb=class extends ua(`SchemaError`){[Ub]=Ub;constructor(e){let t=ft();pt(0);try{super({issue:e})}finally{pt(t)}}get message(){return p_(this.issue)}toString(){return`SchemaError(${this.message})`}};function Yb(e){return Wb(e)}function Xb(e){return R(e)?Zb(e):_f(e,e=>sf(()=>mu(e,e=>new Jb(e))))}function Zb(e){return Ou(e)?e:Cu(mu(e.cause,e=>new Jb(e)))}function Qb(e,t){let n;for(let r of e.reasons){if(!ou(r)||!Yb(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function $b(e){let t=op(e);if(Ou(t))return t.value;throw Qb(t.cause,`Sync adapter can only throw schema errors`)}function ex(e,t){let n=bb(e,t);return(e,t)=>Xb(n(e,t))}function tx(e,t){let n=ex(e,t);return(e,t)=>$b(n(e,t))}var nx=tx;function rx(e,t){let n=xb(e,t);return(e,t)=>Xb(n(e,t))}var ix=rx;function ax(e,t){let n=rx(e,t);return(e,t)=>$b(n(e,t))}var ox=ax,sx=Pb;function cx(e){return A(e,Gb)&&e[Gb]===Gb}var lx=Hb(e=>sx(Sy(e.ast),{schema:e})),ux=Hb(e=>{let t=Dx(e);return sx(wy(e.ast),{schema:t})});function dx(e){let t=sx(new sv(e),{literal:e,transform(n){return t.pipe(Ox(dx(n),{decode:x_(()=>n),encode:x_(()=>e)}))}});return t}var fx=sx(av),px=sx(ov),mx=sx(ev),hx=sx(rv),K=sx(lv),gx=sx(fv),_x=sx(pv),vx=sx(iv);function yx(e,t){return sx(e,{fields:t,mapFields(e,t){let n=e(this.fields);return yx(Nv(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function bx(e){return yx(Nv(e,void 0),e)}var xx=Hb(e=>sx(new mv(!1,[],[e.ast]),{value:e})),Sx=Hb(e=>sx(new mv(!1,[e.ast],[e.ast]),{value:e}));function Cx(e,t){return sx(e,{members:t,mapMembers(e,t){let n=e(this.members);return Cx(Fv(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function wx(e,t){return Cx(Fv(e,t,void 0),e)}function Tx(e){let t=e.map(dx);return sx(Fv(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return wx(e(this.members))},pick(e){return Tx(e)},transform(e){return wx(t.map((t,n)=>t.transform(e[n])))}})}var Ex=Hb(e=>wx([e,mx])),Dx=Hb(e=>wx([e,hx]));function Ox(e,t){return n=>sx(Ey(n.ast,e.ast,t?O_(t):j_()),{from:n,to:e})}function kx(e){return t=>sx(Ty(t.ast,e),{schema:t})}function Ax(e){return dx(e).pipe(kx(V(e)))}function jx(e,t){return bx({_tag:Ax(e),...t})}function Mx(){return(e,t)=>new J_(e.ast,O_(t))}var Nx=ey,Px=sx(ny);function Fx(e){let t=qn(e.order),n=e.formatter??$e;return(r,i)=>Nx(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function Ix(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${$e(e)}`);return e}var Lx=Fx({order:Gn,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:Ix(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${$e(e)})`})})});function Rx(e){return Nx(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var zx=gx.check(Rx());function Bx(e,t,n){return Nx(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Ng]:!0,arbitraryConstraint:{minLength:e},...n})}function Vx(e){return Bx(1,1,e)}var Hx=K.check(Vx()),Ux=e=>+(e?.includeStack===!0)|(e?.excludeCause===!0?2:0),Wx=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},Gx=[];function Kx(e){let t=Ux(e),n=Gx[t];if(n!==void 0)return n;let r=cS.pipe(Ox(px,z_(Wx(t))));return Gx[t]=r,r}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;function qx(e,t){return sx(Kb()([e,t],([e,t])=>(n,r,i)=>{if(!au(n))return H(new Qg(r,n,i));switch(n._tag){case`Fail`:return fp(bb(e)(n.error,i),{onSuccess:du,onFailure:e=>e_(r,`error`,e,n,i)});case`Die`:return fp(bb(t)(n.defect,i),{onSuccess:fu,onFailure:e=>e_(r,`defect`,e,n,i)});case`Interrupt`:return V(n)}},{representation:{id:`effect/schema/CauseReason`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.CauseReason(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Failure<${e[0].Type}, ${e[1].Type}>`,importDeclarations:[`import * as Cause from "effect/Cause"`]}),expected:`Cause.Failure`,toCodec:([e,t])=>Mx()(wx([bx({_tag:dx(`Fail`),error:e}),bx({_tag:dx(`Die`),defect:t}),bx({_tag:dx(`Interrupt`),fiberId:Dx(Px)})]),k_({decode:e=>{switch(e._tag){case`Fail`:return du(e.error);case`Die`:return fu(e.defect);case`Interrupt`:return pu(e.fiberId)}},encode:e=>{switch(e._tag){case`Fail`:return{_tag:`Fail`,error:e.error};case`Die`:return{_tag:`Die`,defect:e.defect};case`Interrupt`:return{_tag:`Interrupt`,fiberId:e.fiberId}}}}))}).ast,{error:e,defect:t})}function Jx(e,t){return sx(Kb()([e,t],([e,t])=>{let n=xx(qx(e,t));return(e,t,r)=>iu(e)?fp(bb(n)(e.reasons,r),{onSuccess:su,onFailure:n=>e_(t,`failures`,n,e,r)}):H(new Qg(t,e,r))},{representation:{id:`effect/schema/Cause`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Cause(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Cause<${e[0].Type}, ${e[1].Type}>`,importDeclarations:[`import * as Cause from "effect/Cause"`]}),expected:`Cause`,toCodec:([e,t])=>Mx()(xx(qx(e,t)),k_({decode:su,encode:({reasons:e})=>e}))}).ast,{error:e,defect:t})}function Yx(e,t,n){return sx(Kb()([e,t,n],([e,t,n])=>{let r=Jx(t,n);return(t,n,i)=>{if(!xu(t))return H(new Qg(n,t,i));switch(t._tag){case`Success`:return fp(bb(e)(t.value,i),{onSuccess:Su,onFailure:e=>e_(n,`value`,e,t,i)});case`Failure`:return fp(bb(r)(t.cause,i),{onSuccess:Cu,onFailure:e=>e_(n,`cause`,e,t,i)})}}},{representation:{id:`effect/schema/Exit`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Exit(${e[0].runtime}, ${e[1].runtime}, ${e[2].runtime})`,Type:`Exit.Exit<${e[0].Type}, ${e[1].Type}, ${e[2].Type}>`,importDeclarations:[`import * as Exit from "effect/Exit"`]}),expected:`Exit`,toCodec:([e,t,n])=>Mx()(wx([bx({_tag:dx(`Success`),value:e}),bx({_tag:dx(`Failure`),cause:Jx(t,n)})]),k_({decode:e=>e._tag===`Success`?Su(e.value):Cu(e.cause),encode:e=>Ou(e)?{_tag:`Success`,value:e.value}:{_tag:`Failure`,cause:e.cause}}))}).ast,{value:e,error:t,defect:n})}function Xx(e){return sx(Kb()([e],([e])=>(t,n,r)=>Zn(t)?Qn(t)?Qd:fp(bb(e)(t.value,r),{onSuccess:Xn,onFailure:e=>e_(n,`value`,e,t,r)}):H(new Qg(n,t,r)),{representation:{id:`effect/schema/Option`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Option(${e[0].runtime})`,Type:`Option.Option<${e[0].Type}>`,importDeclarations:[`import * as Option from "effect/Option"`]}),expected:`Option`,toCodec:([e])=>Mx()(wx([bx({_tag:dx(`Some`),value:e}),bx({_tag:dx(`None`)})]),k_({decode:e=>e._tag===`None`?Yn():Xn(e.value),encode:e=>$n(e)?{_tag:`Some`,value:e.value}:{_tag:`None`}}))}).ast,{value:e})}var Zx=globalThis.Symbol.for(`immer-draftable`),Qx={};function $x(e,t,n,r,i){let a=nS(n,t,r),o=tS(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Qx?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Qx,value:i}})}static[Gb]=Gb;get[o](){return o}static[Zx]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return u(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return yb(a(this))(e??{},t)}static makeOption(e,t){return vb(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(dy(this.ast,e))}static annotateKey(e){return this.rebuild(xy(this.ast,e))}static check(...e){return this.rebuild(py(this.ast,e))}static extend(e){return(t,r)=>{let a=rS(t)?t:bx(t),o={...n.fields,...a.fields},s=Nv(o,n.ast.checks,{identifier:e});return $x(this,e,yx(py(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function eS(e){return new E_(x_(t=>new e(t,{"~payload":{token:Qx,value:t}})),b_())}function tS(e){return`~effect/Schema/Class/${e}`}function nS(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=tS(t),o=e=>e instanceof i||A(e,a),s=eS(i);return r=Ox(sx(new $_([e.ast],()=>(e,t,n)=>o(e)?V(e):H(new Qg(t,e,n)),{identifier:t,[Fg]:([e])=>({isConstructed:o,link:new J_(e,s)}),toCodec:([e])=>new J_(e.ast,s),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[Pg]:Rv(e.ast),...n})),s)(e)}}function rS(e){return cx(e)}var iS=e=>(t,n)=>$x(la,e,rS(t)?t:bx(t),n,e=>({toString(){return`${e}(${$e({...this})})`}})),aS=e=>(t,n)=>$x(cn,e,rS(t)?t:bx(t),n,e=>({name:e})),oS=e=>(t,n,r)=>{let i=rS(n)?n.mapFields(e=>({_tag:Ax(t),...e}),{unsafePreserveChecks:!0}):jx(t,n);return aS(e??t)(i,r)},sS=Fb,cS=sx(dy(Zy,{toCode:()=>({runtime:`Schema.Json`,Type:`Schema.Json`})})),lS=`~effect/reactivity/Reactivity`,uS=lr(`effect/reactivity/Reactivity`),dS=ef(()=>{let e=new Map,t=t=>{_S(t,t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})},n=e=>Mf(n=>{let r=Mr(n,fS);return r?_S(e,e=>{r.add(e)}):t(e),tf}),r=(e,t)=>ff(t,n(e)),i=(t,n)=>{let r=[];return _S(t,t=>{r.push(t);let i=e.get(t);i===void 0&&(i=new Set,e.set(t,i)),i.add(n)}),()=>{for(let t=0;t<r.length;t++){let i=e.get(r[t]);i!==void 0&&(i.delete(n),i.size===0&&e.delete(r[t]))}}},a=(e,t)=>af(function*(){let n=yield*jf(),r=Fr(n,zu),a=yield*Zp(),o=x(tp(n),yp(r)),s=!1,c=!1,l=e=>{e._tag===`Failure`?im(a,e.cause):em(a,e.value),c?(c=!1,o(t).addObserver(l)):s=!1};function u(){if(s){c=!0;return}s=!0,o(t).addObserver(l)}return yield*Uu(r,ef(i(e,u))),u(),a}),o=(e,t)=>a(e,t).pipe(mf(zh),Vh),s=t=>$d(()=>{let n=new Set;return t.pipe(Lf(fS,n),Wf(t=>ef(()=>{n.forEach(t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})})))});return uS.of({[lS]:lS,mutation:r,query:a,stream:o,invalidateUnsafe:t,invalidate:n,registerUnsafe:i,withBatch:s})}),fS=class extends lr()(`effect/reactivity/Reactivity/PendingInvalidation`){},pS=p(2,(e,t)=>uS.use(n=>n.mutation(t,e))),mS=e=>uS.use(t=>t.invalidate(e)),hS=od(uS)(dS);function gS(e){switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:return String(e);default:return fe(e)}}var _S=(e,t)=>{if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(gS(e[n]));return}for(let n in e){t(n);let r=e[n];for(let e=0;e<r.length;e++)t(`${n}:${gS(r[e])}`)}},vS=`~effect/SubscriptionRef`,yS=e=>A(e,vS);({...Dt});var bS=e=>Bh(e.pubsub),xS=e=>ef(()=>e.value),SS=(e,t)=>{e.value=t,zp(e.pubsub,t)},CS=p(2,(e,t)=>e.semaphore.withPermit(ef(()=>SS(e,t)))),wS=`~effect/reactivity/AsyncResult`,TS=e=>A(e,wS),ES={[wS]:{E:m,A:m},pipe(){return u(this,arguments)},[ke](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return Ae(this.value,e.value);case`Failure`:return Ae(this.cause,e.cause)}},[de](){let e=ve(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:he(e)(this._tag===`Success`?fe(this.value):fe(this.cause))}},DS=(e,t)=>e._tag===`Success`?MS(e.value):FS(e.cause,{previous:t}),OS=e=>e._tag===`None`?AS(!0):LS(e.value),kS=e=>e._tag!==`Initial`,AS=(e=!1)=>{let t=Object.create(ES);return t._tag=`Initial`,t.waiting=e,t},jS=e=>e._tag===`Success`,MS=(e,t)=>{let n=Object.create(ES);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},NS=e=>e._tag===`Failure`,PS=(e,t)=>{let n=Object.create(ES);return n._tag=`Failure`,n.cause=e,n.previousSuccess=t?.previousSuccess??Yn(),n.waiting=t?.waiting??!1,n},FS=(e,t)=>PS(e,{previousSuccess:or(t.previous,e=>jS(e)?Xn(e):NS(e)?e.previousSuccess:Yn()),waiting:t.waiting}),IS=(e,t)=>FS(cu(e),t),LS=p(e=>TS(e[0]),(e,t)=>{if(e.waiting)return t?.touch?RS(e):e;let n=Object.assign(Object.create(ES),e);return n.waiting=!0,t?.touch&&jS(n)&&(n.timestamp=Date.now()),n}),RS=e=>jS(e)?MS(e.value,{waiting:e.waiting}):e,zS=p(2,(e,t)=>e._tag===`Failure`?FS(e.cause,{previous:t,waiting:e.waiting}):e),BS=e=>e._tag===`Success`?Xn(e.value):e._tag===`Failure`?ar(e.previousSuccess,e=>e.value):Yn(),VS=e=>ir(BS(e),()=>new vu(`AsyncResult.getOrThrow: no value found`)),HS=e=>{switch(e._tag){case`Success`:return Su(e.value);case`Failure`:return Cu(e.cause);default:return wu(new vu)}},US=e=>{let t=e.success??fx,n=e.error??fx,r=Kb()([t,Jx(n,Kx())],([e,t])=>(n,r,i)=>{if(!TS(n))return H(new Qg(r,n,i));switch(n._tag){case`Initial`:return V(n);case`Success`:return fp(bb(e)(n.value,i),{onSuccess:e=>MS(e,n),onFailure:e=>e_(r,`value`,e,n,i)});case`Failure`:{let a=n.previousSuccess.pipe(ar(t=>fp(bb(e)(t.value,i),{onSuccess:e=>Xn(MS(e,t)),onFailure:e=>new Zg(r,[new Jg([`previousSuccess`,`value`],e)],n,i)})),tr(()=>Qd)),o=dp(bb(t)(n.cause,i),e=>e_(r,`cause`,e,n,i));return pp(a,e=>up(o,t=>PS(t,{previousSuccess:e,waiting:n.waiting})))}}},{expected:`AsyncResult`,toCodec([e,t]){let n=jx(`Success`,{value:e,waiting:_x,timestamp:zx});return Mx()(wx([jx(`Initial`,{waiting:_x}),n,jx(`Failure`,{cause:t,previousSuccess:Xx(n),waiting:_x})]),k_({decode:e=>{switch(e._tag){case`Initial`:return AS(e.waiting);case`Success`:return MS(e.value,{waiting:e.waiting,timestamp:e.timestamp});case`Failure`:return PS(e.cause,{previousSuccess:ar(e.previousSuccess,e=>MS(e.value,e)),waiting:e.waiting})}},encode(e){switch(e._tag){case`Initial`:return{_tag:`Initial`,waiting:e.waiting};case`Success`:return{_tag:`Success`,value:e.value,waiting:e.waiting,timestamp:e.timestamp};case`Failure`:return{_tag:`Failure`,cause:e.cause,previousSuccess:e.previousSuccess,waiting:e.waiting}}}}))},toEquivalence:Ge,toFormatter:([e,t])=>n=>{switch(n._tag){case`Success`:return`AsyncResult.Success(${e(n.value)}, ${n.waiting}, ${n.timestamp})`;case`Failure`:return`AsyncResult.Failure(${t(n.cause)}, ${n.waiting})`;case`Initial`:return`AsyncResult.Initial(${n.waiting}, ${n.waiting})`}}});return Object.assign(r,{success:t,error:n})},WS=`~effect/reactivity/AtomRegistry`,GS=e=>A(e,WS),KS=e=>new tC(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),qS=lr(WS),JS=p(e=>GS(e[0]),(e,t,n)=>{let r=n?.suspendOnWaiting??!1;return nf(n=>{let i=e.get(t);if(i._tag!==`Initial`&&!(r&&i.waiting))return n(HS(i));let a=e.subscribe(t,e=>{e._tag!==`Initial`&&!(r&&e.waiting)&&(n(HS(e)),a())});return ef(a)})}),YS={immediate:!0},XS=e=>{e()},ZS={};function QS(e,t){let n=ZS;for(let r of e)try{t(r)}catch(e){n===ZS&&(n=e)}if(n!==ZS)throw n}var $S=`~effect-atom/atom/Atom/Serializable`,eC=e=>$S in e?e[$S].key:e,tC=class{[WS];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;dispatcher;onNodeAdded;onNodeRemoved;constructor(e,t,n,r){if(this[WS]=WS,this.scheduler=new oa(`sync`,t),this.schedulerAsync=new oa(`async`,t),this.dispatcher=this.schedulerAsync.makeDispatcher(),this.defaultIdleTTL=r,this.timeoutResolution=n===void 0&&r!==void 0?Math.round(r/2):n??1e3,e!==void 0)for(let[t,n]of e){let e=t;for(;e.initialValueTarget;)e=e.initialValueTarget;this.ensureNode(e).setInitialValue(n)}}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(e){return this.ensureNode(e).value()}set(e,t){e.write(this.ensureNode(e).writeContext,t)}setSerializable(e,t){this.preloadedSerializable.set(e,t)}modify(e,t){let n=this.ensureNode(e),r=t(n.value());return e.write(n.writeContext,r[1]),r[0]}update(e,t){let n=this.ensureNode(e);e.write(n.writeContext,t(n.value()))}refresh=e=>{e.refresh===void 0?this.invalidateAtom(e):e.refresh(this.refresh)};subscribe(e,t,n){let r=this.ensureNode(e);n?.immediate?t(r.value()):r.state===rC.stale&&r.value();let i=r.subscribe(function(){t(r._value)});return()=>{i(),r.canBeRemoved&&this.scheduleNodeRemoval(r)}}mount(e){return this.subscribe(e,y,YS)}atomHasTtl(e){return!e.keepAlive&&e.idleTTL!==0&&(e.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(e){let t=eC(e),n=this.nodes.get(t);if(n===void 0?(n=this.createNode(e),this.nodes.set(t,n),this.onNodeAdded?.(n)):this.atomHasTtl(e)&&this.removeNodeTimeout(n),typeof t==`string`&&this.preloadedSerializable.has(t)){let r=this.preloadedSerializable.get(t);this.preloadedSerializable.delete(t);let i=e[$S].decode(r),a=e;for(;a.initialValueTarget;)a=a.initialValueTarget;a===e?n.setValue(i):this.ensureNode(a).setInitialValue(i)}return n}createNode(e){if(this.disposed)throw Error(`Cannot access Atom ${e}: registry is disposed`);return e.keepAlive||this.scheduleAtomRemoval(e),new iC(this,e)}invalidateAtom=e=>{this.ensureNode(e).invalidate()};scheduleAtomRemoval(e){this.dispatcher.scheduleTask(()=>{let t=this.nodes.get(eC(e));t!==void 0&&t.canBeRemoved&&this.removeNode(t)},0)}scheduleNodeRemoval(e){this.dispatcher.scheduleTask(()=>{e.canBeRemoved&&this.removeNode(e)},0)}removeNode(e){this.atomHasTtl(e.atom)?this.setNodeTimeout(e):(this.nodes.delete(eC(e.atom)),e.remove(),this.onNodeRemoved?.(e))}setNodeTimeout(e){if(this.nodeTimeoutBucket.has(e))return;let t=e.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(t-=this.#e,t<=0)){this.nodes.delete(eC(e.atom)),e.remove(),this.onNodeRemoved?.(e);return}let n=Math.ceil(t/this.timeoutResolution)*this.timeoutResolution,r=Date.now()+n,i=r-r%this.timeoutResolution+this.timeoutResolution,a=this.timeoutBuckets.get(i);a===void 0&&(a=[new Set,setTimeout(()=>this.sweepBucket(i),i-Date.now())],this.timeoutBuckets.set(i,a)),a[0].add(e),this.nodeTimeoutBucket.set(e,i)}removeNodeTimeout(e){let t=this.nodeTimeoutBucket.get(e);if(t===void 0)return;this.nodeTimeoutBucket.delete(e),this.scheduleNodeRemoval(e);let[n,r]=this.timeoutBuckets.get(t);n.delete(e),n.size===0&&(clearTimeout(r),this.timeoutBuckets.delete(t))}#e=null;sweepBucket(e){let t=this.timeoutBuckets.get(e)[0];this.timeoutBuckets.delete(e),QS(t,this.removeIdleNode)}removeIdleNode=e=>{if(this.nodeTimeoutBucket.delete(e),e.canBeRemoved){this.nodes.delete(eC(e.atom)),this.onNodeRemoved?.(e),this.#e=e.atom.idleTTL??this.defaultIdleTTL;try{e.remove()}finally{this.#e=null}}};reset(){this.timeoutBuckets.forEach(([,e])=>clearTimeout(e)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear();let e=Array.from(this.nodes.values());this.nodes.clear();for(let t of e)t.state=rC.removed;QS(e,this.destroyNode)}destroyNode=e=>{e.remove(),this.onNodeRemoved?.(e)};dispose(){this.disposed=!0,this.reset()}},nC={alive:1,initialized:2,waitingForValue:4},rC={uninitialized:nC.alive|nC.waitingForValue,stale:nC.alive|nC.initialized|nC.waitingForValue,valid:nC.alive|nC.initialized,removed:0},iC=class{constructor(e,t){this.registry=e,this.atom=t,this.writeContext=new sC(e,this)}registry;atom;state=rC.uninitialized;lifetime;writeContext;preserveInitialValueOnBuild=!1;invalidatedDuringBuild=!1;failed=!1;parents=new Set;children=new Set;listeners=new Set;observedChildren=0;currentState(){switch(this.state){case rC.uninitialized:return`uninitialized`;case rC.stale:return`stale`;case rC.valid:return`valid`;default:return`removed`}}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.size===0&&this.state!==0}get building(){return this.lifetime!==void 0&&this.lifetime.reads!==void 0}get isObserved(){return!this.atom.lazy||this.listeners.size>0||this.observedChildren>0}childObserved(e){let t=this.isObserved;this.observedChildren+=e,t!==this.isObserved&&this.observedChanged(e)}observedChanged(e){for(let t of this.parents)t.childObserved(e)}_value=void 0;value(){for(;(this.state&nC.waitingForValue)!==0;)this.build();return this._value}build(){this.disposeLifetime(),this.invalidatedDuringBuild=!1;let e=oC(this);this.lifetime=e;let t,n=!1;try{t=this.atom.read(e),n=!0}finally{let t=e.reads;e.reads=void 0,this.lifetime===e&&(this.dropUnread(t),n||this.fail())}if(this.lifetime===e&&(this.state&nC.waitingForValue)!==0&&(this.preserveInitialValueOnBuild?(this.preserveInitialValueOnBuild=!1,this.failed=!1,this.state=rC.valid):this.setValue(t)),e.failure!==ZS)throw e.failure}fail(){this.failed=!0;try{this.invalidateChildren()}catch{}}readTracked(e,t){let n=this.registry.ensureNode(e);this.parents.has(n)||(this.parents.add(n),n.children.add(this),this.isObserved&&n.childObserved(1));try{return n.value()}catch(e){if(t.reads===void 0||n.state!==rC.valid)throw e;return t.failure===ZS&&(t.failure=e),n._value}finally{t.reads!==void 0&&!t.disposed&&t.reads.add(n)}}dropUnread(e){if(e.size===this.parents.size)return;let t=this.isObserved;for(let n of this.parents)e.has(n)||(this.parents.delete(n),n.children.delete(this),t&&n.childObserved(-1),n.canBeRemoved&&this.registry.scheduleNodeRemoval(n))}valueOption(){return(this.state&nC.initialized)===0?Yn():Xn(this._value)}setInitialValue(e){if((this.state&nC.initialized)===0){this.preserveInitialValueOnBuild=!0,this.state=rC.stale,this._value=e,this.listeners.size>0&&this.announce();return}this.setValue(e)}setValue(e){let t=this.failed;this.failed=!1;let n=(this.state&nC.initialized)!==0;if(this.state=rC.valid,n&&this.atom.equals(this._value,e)){t&&this.invalidateChildren();return}this._value=e;let r=ZS;try{this.invalidateChildren()}catch(e){r=e}if(this.listeners.size>0)try{this.announce()}catch(e){r===ZS&&(r=e)}if(r!==ZS)throw r}announce(){lC.phase===cC.collect?lC.notify.add(this):this.notify()}invalidate(){if(this.state===rC.valid){this.state=rC.stale;try{this.disposeLifetime()}finally{this.propagate()}}else this.building&&lC.phase!==cC.collect?this.build():this.propagate()}propagate(){lC.phase===cC.collect?(this.building&&(this.invalidatedDuringBuild=!0),lC.stale.push(this)):this.isObserved?this.value():this.invalidateChildren()}invalidateChildren(){if(this.children.size===0)return;let e=ZS;for(let t of Array.from(this.children))if(t.affectedBy(this))try{t.invalidate()}catch(t){e===ZS&&(e=t)}if(e!==ZS)throw e}affectedBy(e){if(this.state===rC.valid)return!0;let t=this.lifetime?.reads;return t===void 0?this.isObserved&&e.state===rC.valid:t.has(e)}notify(){lC.phase===cC.commit&&lC.notify.delete(this),QS(this.listeners,XS)}disposeLifetime(){let e=this.lifetime;e!==void 0&&(this.lifetime=void 0,e.dispose())}remove(){let e=this.isObserved;this.state=rC.removed,this.listeners.clear();try{this.disposeLifetime()}finally{let t=Array.from(this.parents);this.parents.clear(),QS(t,t=>{t.children.delete(this),e&&t.childObserved(-1),t.canBeRemoved&&this.registry.removeNode(t)})}}subscribe(e){let t=this.isObserved;return this.listeners.add(e),t||this.observedChanged(1),()=>{this.listeners.delete(e)&&!this.isObserved&&this.observedChanged(-1)}}},aC={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)return e();this.finalizers??=[],this.finalizers.push(e)},get(e){return this.disposed?this.node.registry.get(e):this.node.readTracked(e,this)},result(e,t){if(this.disposed||this.isFn)return this.resultOnce(e,t);let n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return rf;switch(n._tag){case`Initial`:return rf;case`Failure`:return Cu(n.cause);case`Success`:return V(n.value)}},resultOnce(e,t){return nf(n=>{let r=this.once(e);if(r._tag!==`Initial`&&!(t?.suspendOnWaiting&&r.waiting))return n(HS(r));let i=this.node.registry.subscribe(e,e=>{e._tag===`Initial`||t?.suspendOnWaiting&&e.waiting||(i(),n(HS(e)))},{immediate:!1});return ef(i)})},setResult(e,t){return this.disposed?rf:(this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0}))},some(e){if(this.disposed||this.isFn)return this.someOnce(e);let t=this.get(e);return t._tag===`None`?rf:V(t.value)},someOnce(e){return nf(t=>{let n=this.once(e);if($n(n))return t(V(n.value));let r=this.node.registry.subscribe(e,e=>{Qn(e)||(r(),t(V(e.value)))},{immediate:!1});return ef(r)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?Yn():this.node.valueOption()},refresh(e){this.disposed||this.node.registry.refresh(e)},refreshSelf(){this.disposed||this.node.invalidate()},mount(e){this.disposed||this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){this.disposed||this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){this.disposed||this.node.setValue(e)},set(e,t){this.disposed||this.node.registry.set(e,t)},stream(e,t){return this.disposed?Ih:Fh(n=>ef(()=>{this.subscribe(e,e=>em(n,e),{immediate:!t?.withoutInitialValue})}))},streamResult(e,t){return this.stream(e,t).pipe(Kh(kS),Uh(e=>e._tag===`Success`?V(e.value):of(e.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;let e=this.finalizers;this.finalizers=void 0,QS(e.reverse(),XS)}},oC=e=>{function t(n){return t.disposed||t.isFn?e.registry.get(n):e.readTracked(n,t)}return Object.setPrototypeOf(t,aC),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t.reads=new Set,t.failure=ZS,t},sC=class{constructor(e,t){this.registry=e,this.node=t}registry;node;get(e){return this.registry.get(e)}set(e,t){return this.registry.set(e,t)}setSelf(e){return this.node.setValue(e)}refreshSelf(){return this.node.invalidate()}},cC={disabled:0,collect:1,commit:2},lC={phase:cC.disabled,depth:0,stale:[],notify:new Set};function uC(e){let t=lC.phase;lC.phase=cC.collect,lC.depth++;let n=ZS;try{e()}catch(e){n=e}if(lC.depth===1){let{notify:e,stale:t}=lC,r=0;do{for(lC.phase=cC.collect;r<t.length;r++)try{dC(t[r])}catch(e){n===ZS&&(n=e)}lC.phase=cC.commit;for(let t of e)try{t.notify()}catch(e){n===ZS&&(n=e)}}while(r<t.length);lC.stale=[],e.clear()}if(lC.depth--,lC.phase=t,n!==ZS)throw n}function dC(e){if(e.state===rC.valid){if(!e.invalidatedDuringBuild)return;e.invalidatedDuringBuild=!1,e.state=rC.stale,e.disposeLifetime()}e.value()}var fC=`~effect/reactivity/Atom`,pC=e=>A(e,fC),mC=`~effect/reactivity/Atom/Writable`,hC=p(2,(e,t)=>{let n=Ci(t),r=ji(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Gi(n):void 0})}),gC=hC(0),_C={[fC]:fC,equals:Object.is,...Dt,toJSON(){return{_id:`Atom`,keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},vC={..._C,atom(e,t){let n=EC(e,t);return SC(e=>{let t=e.self(),r=e(this);return r._tag===`Success`?n(e,r.value):zS(r,t)})},fn(e,t){return arguments.length===0?(e,t)=>yC(this,e,t):yC(this,e,t)},pull(e,t){let n=gC(kC(0));return UC(n,SC(r=>{let i=r.self(),a=r(this);return a._tag===`Success`?jC(r,HC(r,n,e,t),AS(!0),a.value):zS(a,i)}))},subscriptionRef(e){return RC(gC(SC(t=>{let n=t.self(),r=t(this);if(r._tag!==`Success`)return zS(r,n);let i=typeof e==`function`?e(t):e;return yS(i)?i:jC(t,i,AS(!0),r.value)})),(e,t)=>LC(e,t,VS(e(this))))}},yC=(e,t,n)=>{let[r,i,a]=VC(n?.reactivityKeys?(e,r)=>{let i=t(e,r);return Yd(i)?pS(i,n.reactivityKeys):Yh(i,mS(n.reactivityKeys))}:t,n);return CC(t=>{t.get(a);let n=t.self(),i=t.get(e);return i._tag===`Success`?r(t,i.value):zS(i,n)},i)},bC={..._C,[mC]:mC},xC=e=>mC in e,SC=(e,t)=>{let n=Object.create(_C);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},CC=(e,t,n)=>{let r=Object.create(bC);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function wC(e,t){e.setSelf(t)}var TC=(e,t)=>{let n=EC(e,t);return`~effect/reactivity/Atom`in n?n:SC(n)},EC=(e,t)=>{if(typeof e==`function`&&!Yd(e)&&!Mh(e)){let n=e;return function(e,r){let i=n(e);switch(typeof i){case`function`:case`object`:return i===null?i:DC in i?AC(e,i,t,r):OC in i?FC(e,i,t,r):i;default:return i}}}return Yd(e)?function(n,r){return AC(n,e,t,r)}:Mh(e)?function(n,r){return FC(n,e,t,r)}:kC(e)},DC=`~effect/Effect`,OC=`~effect/Stream`,kC=e=>CC(function(t){return e},wC),AC=(e,t,n,r)=>jC(e,t,n?.initialValue===void 0?AS():MS(n.initialValue),r,n?.uninterruptible);function jC(e,t,n,r=Dr(),i=!1){let a=e.self(),o=Bu();e.addFinalizer(()=>{tp(r)(Gu(o,Du))});let s,c=!1,l=MC(r.pipe(Ar(zu,o),Ar(qS,e.registry),Ar(ta,e.registry.scheduler)),t,function(t){s=DS(t,a),c&&e.setSelf(s)},i);return c=!0,l!==void 0&&e.addFinalizer(l),s===void 0?a._tag===`Some`?OS(a):LS(n):s}function MC(e,t,n,r=!1){if(xu(t)){n(t);return}let i=tp(e)(t);i.currentDispatcher?.flush();let a=i.pollUnsafe();if(a){n(a);return}let o=i.addObserver(n);function s(){o(),r||i.interruptUnsafe()}return s}function NC(e){let t=e?.memoMap??gC(TC(()=>td())),n=e=>pC(t)?e(t):t,r=hS;function i(e){let t=Object.create(vC);t.keepAlive=!1,t.lazy=!0,t.refresh=void 0,t.factory=i;let a=GC(SC(typeof e==`function`?t=>pd(e(t),r):()=>pd(e,r)));return t.layer=a,t.read=function(e){let t=e(a);return AC(e,U(Rf,r=>id(t,n(e),r)),{uninterruptible:!0})},t}i.memoMap=t,i.addGlobalLayer=e=>{r=pd(r,fd(e,hS))};let a=gC(TC(e=>Mf(t=>id(hS,n(e),Fr(t,zu))).pipe(mf(Fr(uS)))));return i.withReactivity=e=>t=>KC(t,n=>{let r=VS(n(a));return n.addFinalizer(r.registerUnsafe(e,()=>{n.refresh(t)})),n.subscribe(t,e=>n.setSelf(e)),n.once(t)},{initialValueTarget:t}),i}var PC=NC();PC.withReactivity;var FC=(e,t,n,r)=>IC(e,t,n?.initialValue===void 0?AS():MS(n.initialValue),r);function IC(e,t,n,r=Dr()){let i=e.self();r=Ar(r,qS,e.registry);let a=Bf(n=>U(mh(t.channel,n),t=>Zd({while:g,body:()=>t,step(t){e.setSelf(MS(oi(t),{waiting:!0}))}}))).pipe(_f(t=>(xd(t)?b(e.self(),or(BS),er({onNone:()=>e.setSelf(IS(new vu,{previous:e.self()})),onSome:t=>e.setSelf(MS(t))})):e.setSelf(FS(t,{previous:e.self()})),tf))),o=MC(r.pipe(Ar(qS,e.registry),Ar(ta,e.registry.scheduler)),a,y,!1);return o!==void 0&&e.addFinalizer(o),i._tag===`Some`?OS(i):LS(n)}var LC=(e,t,n=Dr())=>yS(t)?(e.addFinalizer(bS(t).pipe(Zh(t=>{for(let n=0;n<t.length;n++)e.setSelf(t[n]);return tf}),np(n))),ap(n)(xS(t))):t._tag===`Success`?IC(e,bS(t.value),AS(!0),n):t,RC=(e,t)=>{function n(t,n){let r=t.get(e);yS(r)?ip(CS(r,n)):jS(r)&&ip(CS(r.value,n))}return CC(n=>{let r=n(e);return yS(r)||jS(r)?t(n,r):r},n)},zC=Symbol.for(`effect/reactivity/atom/Atom/Reset`),BC=Symbol.for(`effect/reactivity/atom/Atom/Interrupt`);function VC(e,t){let n=gC(kC([0,void 0])),r=t?.initialValue===void 0?AS():MS(t.initialValue),i=t?.concurrent?gC(SC(e=>{let t=new Set;return e.addFinalizer(()=>t.forEach(e=>e.interruptUnsafe())),t})):void 0;function a(t,a){let o=i?t(i):void 0;t.isFn=!0;let[s,c]=t.get(n);if(s===0)return r;if(c===BC)return FS(uu(),{previous:t.self()});let l=e(c,t);return DC in l?(o&&(l=U(ep(l,{startImmediately:!0}),e=>(o.add(e),e.addObserver(()=>o.delete(e)),mf(gp(o),e=>e[0])))),jC(t,l,r,a,!1)):IC(t,l,r,a)}function o(e,t){YC(()=>{t===zC?e.set(n,[0,void 0]):t===BC?e.set(n,[e.get(n)[0]+1,BC]):e.set(n,[e.get(n)[0]+1,t]),e.refreshSelf()})}return[a,o,n]}var HC=(e,t,n,r)=>U(Qh(typeof n==`function`?n(e):n),n=>{let i=vp().context,a=si(),o=Af(n,{onFailure(e){return xd(e)?ai(a)?V({done:!0,items:a}):H(new vu(`Atom.pull: no items`)):of(e)},onSuccess(e){let t;return r?.disableAccumulation?t=e:(t=ni(a,e),a=t),V({done:!1,items:t})}}),s=new Set;return e.addFinalizer(()=>{for(let e of s)e()}),e.once(t),e.subscribe(t,()=>{e.setSelf(OS(e.self()));let t;t=MC(i,o,n=>{t&&s.delete(t);let r=DS(n,e.self()),i=s.size>0;e.setSelf(i?LS(r):r)}),t&&s.add(t)}),o}),UC=(e,t)=>CC(t.read,function(t,n){t.set(e,t.get(e)+1)}),WC=typeof WeakRef>`u`||typeof FinalizationRegistry>`u`?e=>{let t=_h();return function(n){let r=vh(t,n);if(r._tag===`Some`)return r.value;let i=e(n);return Sh(t,n,i),i}}:e=>{let t=_h(),n=new FinalizationRegistry(e=>{wh(t,e)});return function(r){let i=vh(t,r).pipe(sr(e=>e.deref()));if(i._tag===`Some`)return i.value;let a=e(r);return Sh(t,r,new WeakRef(a)),n.register(a,r),a}},GC=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),KC=p(e=>pC(e[0]),(e,t,n)=>{let r=gC(xC(e)?CC(n=>t(n,e),function(t,n){t.set(e,n)},e.refresh??function(t){t(e)}):SC(n=>t(n,e),e.refresh??function(t){t(e)}));return n?.initialValueTarget&&(r.initialValueTarget=qC(n.initialValueTarget)),r}),qC=e=>{let t=e;for(;t.initialValueTarget;)t=t.initialValueTarget;return t},JC=p(2,(e,t)=>KC(e,n=>t(n(e)))),YC=uC,XC=`~effect-atom/atom/Atom/Serializable`,ZC=p(2,(e,t)=>{let n=sS(t.schema);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:e.label??[t.key,ft()===0?``:Error().stack?.split(`
16
+ `)[5]??``],[XC]:{key:t.key,encode:ox(n),decode:nx(n)}})}),QC=`~effect-atom/atom/Atom/ServerValue`,$C=p(2,(e,t)=>`~effect-atom/atom/Atom/ServerValue`in e?e[QC](e=>t.get(e)):t.get(e)),ew=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function ee(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function k(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,k(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(ee(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=k(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=k(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return k(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ae(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var se=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function A(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ce(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else A(ce.bind(null,e))}var le={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!ee(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=le,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ce,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ee,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=A,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),tw=o(((e,t)=>{t.exports=ew()})),nw=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),rw=o(((e,t)=>{t.exports=nw()})),q=l(tw(),1),iw=l(rw(),1);function aw(e){let t=iw.unstable_scheduleCallback(4,e);return()=>iw.unstable_cancelCallback(t)}var ow=q.createContext(KS({scheduleTask:aw,defaultIdleTTL:400})),sw=new WeakMap;function cw(e,t){let n=sw.get(e);n===void 0&&(n=new WeakMap,sw.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i={subscribe(n){return e.subscribe(t,n)},snapshot(){return e.get(t)},getServerSnapshot(){return $C(t,e)}};return n.set(t,i),i}function lw(e,t){let n=cw(e,t);return q.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}var uw=(e,t)=>{let n=q.useContext(ow);return t?lw(n,q.useMemo(()=>JC(e,t),[e,t])):lw(n,e)};function dw(e,t){q.useEffect(()=>e.mount(t),[t,e])}var fw=e=>{dw(q.useContext(ow),e)},pw=(e,t,n)=>{let r=q.useContext(ow);q.useEffect(()=>r.subscribe(e,t,n),[r,e,t,n?.immediate])},mw=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),hw=o(((e,t)=>{t.exports=mw()})),gw=o((e=>{var t=tw();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),_w=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=gw()})),vw=o((e=>{var t=hw(),n=tw(),r=_w();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function C(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var w=Object.assign,T=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),k=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),A=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case k:return`Suspense`;case ae:return`SuspenseList`;case A:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function Se(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Ce(e,t){be++,ye[be]=e.current,e.current=t}var we=xe(null),Te=xe(null),Ee=xe(null),De=xe(null);function Oe(e,t){switch(Ce(Ee,t),Ce(Te,e),Ce(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Se(we),Ce(we,e)}function ke(){Se(we),Se(Te),Se(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,Ce(De,e)),t=we.current;var n=_p(t,e.type);t!==n&&(Ce(Te,e),Ce(we,n))}function je(e){Te.current===e&&(Se(we),Se(Te)),De.current===e&&(Se(De),ph._currentValue=ve)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1<e.stack.indexOf(`
17
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
18
+ `+Me+e+Ne}var Fe=!1;function Ie(e,t){if(!e||Fe)return``;Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
19
+ `),l=s.split(`
20
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
21
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
22
+ Error generating stack: `+e.message+`
23
+ `+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,$e=null,et=null;function tt(e){if(typeof Ze==`function`&&Qe(e),et&&typeof et.setStrictMode==`function`)try{et.setStrictMode($e,e)}catch{}}var nt=Math.clz32?Math.clz32:at,rt=Math.log,it=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(rt(e)/it|0)|0}var ot=256,st=262144,ct=4194304;function lt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ut(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-nt(n),i=1<<r;t|=e[r],n&=~i}return t}function pt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mt(){var e=ct;return ct<<=1,!(ct&62914560)&&(ct=4194304),e}function ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-nt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&vt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function vt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function bt(e,t){var n=t&-t;return n=n&42?1:xt(n),(n&(e.suspendedLanes|t))===0?n:0}function xt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function M(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=_e.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function Ct(e,t){var n=_e.p;try{return _e.p=e,t()}finally{_e.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[Tt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Kt={},qt={};function Jt(e){return ze.call(qt,e)?!0:ze.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function $t(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+en(s):e.removeAttribute(`name`)}function ln(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+en(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fn(e,t,n){if(t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function gn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var yn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),bn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function xn(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Sn(){}var Cn=null;function wn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tn=null,En=null;function Dn(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));cn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var On=!1;function kn(e,t,n){if(On)return e(t,n);On=!0;try{return e(t)}finally{if(On=!1,(Tn!==null||En!==null)&&(Kd(),Tn&&(t=Tn,e=En,En=Tn=null,Dn(t),e)))for(t=0;t<e.length;t++)Dn(e[t])}}function An(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Mn=!1;if(jn)try{var Nn={};Object.defineProperty(Nn,"passive",{get:function(){Mn=!0}}),window.addEventListener(`test`,Nn,Nn),window.removeEventListener(`test`,Nn,Nn)}catch{Mn=!1}var Pn=null,Fn=null,In=null;function Ln(){if(In)return In;var e,t=Fn,n=t.length,r,i=`value`in Pn?Pn.value:Pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return In=i.slice(e,1<r?1-r:void 0)}function Rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zn(){return!0}function Bn(){return!1}function Vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?zn:Bn,this.isPropagationStopped=Bn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=zn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=zn)},persist:function(){},isPersistent:zn}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Un=Vn(Hn),Wn=w({},Hn,{view:0,detail:0}),Gn=Vn(Wn),Kn,qn,Jn,Yn=w({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Jn&&(Jn&&e.type===`mousemove`?(Kn=e.screenX-Jn.screenX,qn=e.screenY-Jn.screenY):qn=Kn=0,Jn=e),Kn)},movementY:function(e){return`movementY`in e?e.movementY:qn}}),Xn=Vn(Yn),Zn=Vn(w({},Yn,{dataTransfer:0})),Qn=Vn(w({},Wn,{relatedTarget:0})),$n=Vn(w({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0})),er=Vn(w({},Hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),tr=Vn(w({},Hn,{data:0})),nr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},rr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},ir={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ir[e])?!!t[e]:!1}function or(){return ar}var sr=Vn(w({},Wn,{key:function(e){if(e.key){var t=nr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?rr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type===`keypress`?Rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),cr=Vn(w({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lr=Vn(w({},Hn,{submitter:0})),ur=Vn(w({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or})),dr=Vn(w({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),fr=Vn(w({},Yn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),pr=Vn(w({},Hn,{newState:0,oldState:0,source:0})),mr=[9,13,27,32],hr=jn&&`CompositionEvent`in window,gr=null;jn&&`documentMode`in document&&(gr=document.documentMode);var _r=jn&&`TextEvent`in window&&!gr,vr=jn&&(!hr||gr&&8<gr&&11>=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return vr&&t.locale!==`ko`?null:t.data;default:return null}}var Er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Er[e.type]:t===`textarea`}function Or(e,t,n,r){Tn?En?En.push(r):En=[r]:Tn=r,t=$f(t,`onChange`),0<t.length&&(n=new Un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var kr=null,Ar=null;function jr(e){Kf(e,0)}function Mr(e){if(an(Lt(e)))return e}function Nr(e,t){if(e===`change`)return t}var Pr=!1;if(jn){var Fr;if(jn){var Ir=`oninput`in document;if(!Ir){var Lr=document.createElement(`div`);Lr.setAttribute(`oninput`,`return;`),Ir=typeof Lr.oninput==`function`}Fr=Ir}else Fr=!1;Pr=Fr&&(!document.documentMode||9<document.documentMode)}function Rr(){kr&&(kr.detachEvent(`onpropertychange`,zr),Ar=kr=null)}function zr(e){if(e.propertyName===`value`&&Mr(Ar)){var t=[];Or(t,Ar,e,wn(e)),kn(jr,t)}}function Br(e,t,n){e===`focusin`?(Rr(),kr=t,Ar=n,kr.attachEvent(`onpropertychange`,zr)):e===`focusout`&&Rr()}function Vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Mr(Ar)}function Hr(e,t){if(e===`click`)return Mr(t)}function Ur(e,t){if(e===`input`||e===`change`)return Mr(t)}function Wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Gr=typeof Object.is==`function`?Object.is:Wr;function Kr(e,t){if(Gr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ze.call(t,i)||!Gr(e[i],t[i]))return!1}return!0}function qr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yr(e,t){var n=Jr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qr(e.document)}return t}function Qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var $r=jn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`selectionStart`in r&&Qr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&Kr(ni,r)||(ni=r,r=$f(ti,`onSelect`),0<r.length&&(t=new Un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var oi={animationend:ai(`Animation`,`AnimationEnd`),animationiteration:ai(`Animation`,`AnimationIteration`),animationstart:ai(`Animation`,`AnimationStart`),transitionrun:ai(`Transition`,`TransitionRun`),transitionstart:ai(`Transition`,`TransitionStart`),transitioncancel:ai(`Transition`,`TransitionCancel`),transitionend:ai(`Transition`,`TransitionEnd`)},si={},ci={};jn&&(ci=document.createElement(`div`).style,`AnimationEvent`in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),`TransitionEvent`in window||delete oi.transitionend.transition);function li(e){if(si[e])return si[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ci)return si[e]=t[n];return e}var ui=li(`animationend`),di=li(`animationiteration`),fi=li(`animationstart`),pi=li(`transitionrun`),mi=li(`transitionstart`),hi=li(`transitioncancel`),gi=li(`transitionend`),_i=new Map,vi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);vi.push(`scrollEnd`);function yi(e,t){_i.set(e,t),Ut(t,[e])}var bi=0;function xi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Dd.identifierPrefix;var n=bi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Fd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Ci(e,t){return e=Si(e),t=Si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var wi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ti=[],Ei=0,Di=0;function Oi(){for(var e=Ei,t=Di=Ei=0;t<e;){var n=Ti[t];Ti[t++]=null;var r=Ti[t];Ti[t++]=null;var i=Ti[t];Ti[t++]=null;var a=Ti[t];if(Ti[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Mi(n,i,a)}}function ki(e,t,n,r){Ti[Ei++]=e,Ti[Ei++]=t,Ti[Ei++]=n,Ti[Ei++]=r,Di|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ai(e,t,n,r){return ki(e,t,n,r),Ni(e)}function ji(e,t){return ki(e,null,null,t),Ni(e)}function Mi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-nt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ni(e){if(50<Id)throw Id=0,Ld=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pi={};function Fi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ii(e,t,n,r){return new Fi(e,t,n,r)}function Li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ri(e,t){var n=e.alternate;return n===null?(n=Ii(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function zi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Li(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case A:return e=Ii(31,n,t,a),e.elementType=A,e.lanes=o,e;case O:return Vi(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Ii(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case k:return e=Ii(13,n,t,a),e.elementType=k,e.lanes=o,e;case ae:return e=Ii(19,n,t,a),e.elementType=ae,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ii(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case re:s=10;break a;case ne:s=9;break a;case ie:s=11;break a;case oe:s=14;break a;case se:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Vi(e,t,n,r){return e=Ii(7,e,r,t),e.lanes=n,e}function Hi(e,t,n){return e=Ii(6,e,null,t),e.lanes=n,e}function Ui(e){var t=Ii(18,null,null,0);return t.stateNode=e,t}function Wi(e,t,n){return t=Ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gi=new WeakMap;function Ki(e,t){if(typeof e==`object`&&e){var n=Gi.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},Gi.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var qi=[],Ji=0,Yi=null,Xi=0,Zi=[],Qi=0,$i=null,ea=1,ta=``;function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Yi,Yi=e,Xi=t}function ra(e,t,n){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,$i=e;var r=ea;e=ta;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var a=32-nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ea=1<<32-nt(t)+i|n<<i|r,ta=a+e}else ea=1<<a|n<<i|r,ta=e}function ia(e){e.return!==null&&(na(e,1),ra(e,1,0))}function aa(e){for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null;for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ta=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null}function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,ea=t.id,ta=t.overflow,$i=e}var sa=null,ca=null,N=!1,la=null,ua=!1,da=Error(i(519));function P(e){throw _a(Ki(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),da}function fa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:W(`cancel`,t),W(`close`,t);break;case`iframe`:case`object`:case`embed`:W(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)W(Wf[n],t);break;case`source`:W(`error`,t);break;case`img`:case`image`:case`link`:W(`error`,t),W(`load`,t);break;case`details`:W(`toggle`,t);break;case`input`:W(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:W(`invalid`,t);break;case`textarea`:W(`invalid`,t),pn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ap(t.textContent,n)?(r.popover!=null&&(W(`beforetoggle`,t),W(`toggle`,t)),r.onScroll!=null&&W(`scroll`,t),r.onScrollEnd!=null&&W(`scrollend`,t),r.onClick!=null&&(t.onclick=Sn),t=!0):t=!1,t||P(e,!0)}function pa(e){for(sa=e.return;sa;)switch(sa.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:sa=sa.return}}function ma(e){if(e!==sa)return!1;if(!N)return pa(e),N=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&ca&&P(e),pa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ca=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ca=_m(e)}else t===27?(t=ca,Op(e.type)?(e=gm,gm=null,ca=e):ca=t):ca=sa?hm(e.stateNode.nextSibling):null;return!0}function ha(){ca=sa=null,N=!1}function ga(){var e=la;return e!==null&&(yd===null?yd=e:yd.push.apply(yd,e),la=null),e}function _a(e){la===null?la=[e]:la.push(e)}var va=xe(null),ya=null,ba=null;function xa(e,t,n){Ce(va,t._currentValue),t._currentValue=n}function Sa(e){e._currentValue=va.current,Se(va)}function Ca(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function wa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ca(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ca(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ca(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&wa(t,e,n,r),t.flags|=262144,e!==null}function Ea(e){for(e=e.firstContext;e!==null;){if(!Gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){ya=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Oa(e){return Aa(ya,e)}function ka(e,t){return ya===null&&Da(e),Aa(e,t)}function Aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(i(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ja=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ma=t.unstable_scheduleCallback,Na=t.unstable_NormalPriority,Pa={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fa(){return{controller:new ja,data:new Map,refCount:0}}function Ia(e){e.refCount--,e.refCount===0&&Ma(Na,function(){e.controller.abort()})}function La(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ra=null;function za(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ba=null,Va=0,Ha=0,Ua=null;function Wa(e,t){if(Ba===null){var n=Ba=[];Va=0,Ha=zf(),Ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Va++,t.then(Ga,Ga),t}function Ga(){if(--Va===0&&(Ra=null,Ba!==null)){Ua!==null&&(Ua.status=`fulfilled`);var e=Ba;Ba=null,Ha=0,Ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ka(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var qa=j.S;j.S=function(e,t){if(Sd=We(),typeof t==`object`&&t&&typeof t.then==`function`&&Wa(e,t),Ra!==null)for(var n=Tf;n!==null;)La(n,Ra),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)La(r,n),r=r.next;if(Ha!==0){r=Ra,r===null&&(r=Ra=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}qa!==null&&qa(e,t)};var Ja=xe(null);function Ya(){var e=Ja.current;return e===null?ad.pooledCache:e}function Xa(e,t){t===null?Ce(Ja,Ja.current):Ce(Ja,t.pool)}function Za(){var e=Ya();return e===null?null:{parent:Pa._currentValue,pool:e}}var Qa=Error(i(460)),$a=Error(i(474)),eo=Error(i(542)),to={then:function(){}};function no(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ro(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Sn,Sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Sn,Sn);else{if(e=ad,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e}throw ao=t,Qa}}function io(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ao=e,Qa):e}}var ao=null;function oo(){if(ao===null)throw Error(i(459));var e=ao;return ao=null,e}function so(e){if(e===Qa||e===eo)throw Error(i(483))}var co=null,lo=0;function uo(e){var t=lo;return lo+=1,co===null&&(co=[]),ro(co,e,t)}function fo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function po(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function mo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),fo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===se&&io(i)===t.type)?(t=a(t,n.props),fo(t,n),t.return=e,t):(t=Bi(n.type,n.key,n.props,null,e.mode,r),fo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Wi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Vi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Bi(t.type,t.key,t.props,null,e.mode,n),fo(n,t),n.return=e,n;case D:return t=Wi(t,e.mode,n),t.return=e,t;case se:return t=io(t),f(e,t,n)}if(ge(t)||pe(t))return t=Vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,uo(t),n);if(t.$$typeof===re)return f(e,ka(e,t),n);po(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case se:return n=io(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,uo(n),r);if(n.$$typeof===re)return p(e,t,ka(e,n),r);po(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case se:return r=io(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,uo(r),i);if(r.$$typeof===re)return m(e,t,n,ka(t,r),i);po(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&na(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return N&&na(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),N&&na(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&na(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&na(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&na(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===se&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Vi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=Bi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Wi(o,e.mode,c),c.return=e,e=c}return s(e);case se:return o=io(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===re)return _(e,r,ka(e,o),c);po(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,id&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function So(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function F(){if(wo){var e=Ua;if(e!==null)throw e}}function To(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(B&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:_o=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),pd|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=xe(null),ko=xe(0);function Ao(e,t){e=dd,Ce(ko,e),Ce(Oo,t),dd=e|t.baseLanes}function jo(){Ce(ko,dd),Ce(Oo,Oo.current)}function Mo(){dd=ko.current,Se(Oo),Se(ko)}var No=xe(null),I=null;function Po(e){var t=e.alternate;Ce(zo,zo.current&1),Ce(No,e),I===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(I=e)}function Fo(e){Ce(zo,zo.current),Ce(No,e),I===null&&(I=e)}function Io(e){e.tag===22?(Ce(zo,zo.current),Ce(No,e),I===null&&(I=e)):Lo()}function Lo(){Ce(zo,zo.current),Ce(No,No.current)}function Ro(e){Se(No),I===e&&(I=null),Se(zo)}var zo=xe(0);function Bo(e,t){Ce(No,No.current),Ce(zo,t)}function Vo(e){Se(zo),Se(No),I===e&&(I=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,L=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Uo=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?_c:vc,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){j.H=gc;var t=Wo!==null&&Wo.next!==null;if(Uo=0,Go=Wo=L=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&Ea(e)&&(Fc=!0))}function rs(e,t,n,r){L=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=yc,o=t(n,r)}while(qo);return o}function is(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(L.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Uo=0,Go=Wo=L=null,qo=!1,Xo=Yo=0,Zo=null}function R(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?L.memoizedState=Go=e:Go=Go.next=e,Go}function cs(){if(Wo===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?L.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?L.memoizedState=Go=e:Go=Go.next=e}return Go}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=ro(Zo,e,t),t=L,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===de)return;if(e.$$typeof===re)return Oa(e)}throw Error(i(438,String(e)))}function fs(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),Wo,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(B&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ha&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,L.lanes|=p,pd|=p;f=u.action,Jo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,L.lanes|=f,pd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Gr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Gr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=L,a=cs(),o=N;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Gr((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ad===null)throw Error(i(349));o||Uo&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=ls(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gr(e,n)}catch{return!0}}function Ss(e){var t=ji(e,2);t!==null&&Vd(t,e,2)}function Cs(e){var t=R();if(typeof e==`function`){var n=e;if(e=n(),Jo){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,Wo,typeof r==`function`?r:ps)}function Ts(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};o.types=a===null?null:a.types,j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(N){var n=ad.formState;if(n!==null){a:{var r=L;if(N){if(ca){b:{for(var i=ca,a=ua;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ca=hm(i.nextSibling),r=i.data===`F!`;break a}}P(r)}r=!1}r&&(t=n[0])}}return n=R(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,L,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,L,!1,r.queue),r=R(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),Wo,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Qa?eo:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=Wo;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=ls(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=R();L.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(L.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=ls(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(id&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Uo&1073741824&&!(B&261930)?e.memoizedState=t:(e.memoizedState=n,e=zd(),L.lanes|=e,pd|=e,n)}function $s(e,t,n,r){return Gr(n,t)?n:Oo.current===null?!(Uo&106)||Uo&1073741824&&!(B&261930)?(Fc=!0,e.memoizedState=n):(e=zd(),L.lanes|=e,pd|=e,t):(e=Qs(e,n,r),Gr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=_e.p;_e.p=a!==0&&8>a?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,fc(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ka(c,r),Rd(e)):dc(e,t,r,Rd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Rd())}finally{_e.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,ve,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:ve},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Rd())}function ac(){return Oa(ph)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rd();e=bo(n);var r=xo(t,e,n);r!==null&&(Vd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Rd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Ai(e,t,n,r),n!==null&&(Vd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Rd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Gr(s,o))return ki(e,t,i,0),ad===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Vd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Ai(e,n,r,2),t!==null&&Vd(t,e,2)}function pc(e){var t=e.alternate;return e===L||t!==null&&t===L}function mc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var gc={readContext:Oa,use:ds,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},_c={readContext:Oa,use:ds,useCallback:function(e,t){return R().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=R();t=t===void 0?null:t;var r=e();if(Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=R();if(n!==void 0){var i=n(t);if(Jo){tt(!0);try{n(t)}finally{tt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=R();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(R(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,L,e.queue,!0,!1),R().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=R();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ad===null)throw Error(i(349));B&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=R(),t=ad.identifierPrefix;if(N){var n=ta,r=ea;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=R();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return R().memoizedState=cc.bind(null,L)},useEffectEvent:function(e){var t=R(),n={impl:e};return t.memoizedState=n,function(){if(id&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Oa,use:ds,useCallback:Xs,useContext:Oa,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),Wo.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),Wo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Oa,use:ds,useCallback:Xs,useContext:Oa,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return Wo===null?Qs(n,e,t):$s(n,Wo.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Wo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=bo(r);i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Vd(t,e,r),So(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=bo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Vd(t,e,r),So(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rd(),r=bo(n);r.tag=2,t!=null&&(r.callback=t),t=xo(e,r,n),t!==null&&(Vd(t,e,n),So(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Kr(n,r)||!Kr(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){wi(e)}function Ec(e){console.error(e)}function Dc(e){wi(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=bo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=bo(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Td===null?Td=new Set([this]):Td.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ta(t,n,a,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return I===null?Qd():n.alternate===null&&fd===0&&(fd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===to?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===to?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Qd(),!1}if(N)return t=No.current,t===null?(r!==da&&(t=Error(i(423),{cause:r}),_a(Ki(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ki(r,n),a=Ac(e.stateNode,r,a),Co(e,a),fd!==4&&(fd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==da&&(e=Error(i(422),{cause:r}),_a(Ki(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ki(o,n),vd===null?vd=[o]:vd.push(o),fd!==4&&(fd=2),t===null)return!0;r=Ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),Co(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Td===null||!Td.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),Co(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Da(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!Fc?(os(e,t,i),dl(e,t,i)):(N&&s&&ia(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Bi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Kr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Kr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Io(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Xa(t,null),jo(),Lo()):(Xa(t,a.cachePool),Ao(t,a),Lo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ya();return a=a===null?null:{parent:Pa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Xa(t,null),jo(),Io(t),e!==null&&Ta(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return ho(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(N){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Fo(t),(e=ca)?(e=dm(e,ua),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,ca=null)):e=null,e===null)throw P(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Ta(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Oo.current===null){if(r=ad,r!==null&&(s=bt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ji(e,s),Vd(r,e,s),Pc;Qd()}t=Wc(e,t,n)}else e=o.treeContext,ca=hm(s.nextSibling),sa=t,N=!0,la=null,ua=!1,e!==null&&oa(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Da(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!Fc?(os(e,t,i),dl(e,t,i)):(N&&r&&ia(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Da(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!Fc?(os(e,t,a),dl(e,t,a)):(N&&r&&ia(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Da(t),t.stateNode===null){var a=Pi,o=n.contextType;typeof o==`object`&&o&&(a=Oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},vo(t),o=n.contextType,a.context=typeof o==`object`&&o?Oa(o):Pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),F(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Pi,typeof u==`object`&&u&&(o=Oa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),_o=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),F(),l=t.memoizedState,s||f!==l||_o?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=_o||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,yo(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Pi,typeof l==`object`&&l&&(c=Oa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),_o=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),F();var p=t.memoizedState;o!==d||f!==p||_o||e!==null&&e.dependencies!==null&&Ea(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=_o||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return ha(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Za()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=gd),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(N){if(i?Po(t):Lo(),(e=ca)?(e=dm(e,ua),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,ca=null)):e=null,e===null)throw P(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Vi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Po(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ri(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Vi(i,a,n,null),i.flags|=2):i=Ri(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Za():(s=Pa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ii(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return ho(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Vi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ho(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,_a({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||Ta(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Oo.current!==null)return rl(e,t,c);if(r=ad,r!==null&&(a=bt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ji(e,a),Vd(r,e,a),Pc;return fm(o)||Qd(),rl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ca=hm(o.nextSibling),sa=t,N=!0,la=null,ua=!1,e!==null&&oa(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ca(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=N?Xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return xa(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ea(e)))}function pl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),xa(t,Pa,e.memoizedState.cache),ha();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ta(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Po(t),e=dl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:xa(t,Pa,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,N&&t.flags&1048576&&ra(t,Xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e==`function`)Li(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===re){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,yo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,xa(t,Pa,r),r!==o.cache&&wa(t,[Pa],n,!0),F(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Ki(Error(i(424)),t),_a(a),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ca=hm(e.firstChild),sa=t,N=!0,la=null,ua=!0,n=go(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ha(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:N||(t.stateNode=vp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&N&&(r=t.stateNode=xm(t.type,t.pendingProps,Ee.current),sa=t,ua=!0,a=ca,Op(t.type)?(gm=a,ca=hm(r.firstChild)):ca=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&N&&((a=r=ca)&&(r=lm(r,t.type,t.pendingProps,ua),r===null?a=!1:(t.stateNode=r,sa=t,ca=hm(r.firstChild),ua=!1,a=!0)),a||P(t)),Ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ts(e,t,is,null,null,n),ph._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&N&&((e=n=ca)&&(n=um(n,t.pendingProps,ua),n===null?e=!1:(t.stateNode=n,sa=t,ca=null,e=!0)),e||P(t)),null;case 13:return el(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Da(t),a=Oa(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Da(t),r=Oa(Pa),e===null?(a=Ya(),a===null&&(a=ad,o=Fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},vo(t),xa(t,Pa,a)):((e.lanes&n)!==0&&(yo(e,t),To(t,null,null,n),F()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,xa(t,Pa,r),r!==a.cache&&wa(t,[Pa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),xa(t,Pa,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:N&&ia(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Xd())e.flags|=8192;else throw ao=to,$a}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Xd())e.flags|=8192;else throw ao=to,$a}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:mt(),e.lanes|=t,_d|=t)}function yl(e,t){if(!N)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xl(e,t,n){var r=t.pendingProps;switch(aa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(Pa),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ga())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(je(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=we.current,ma(t)?fa(t,e):(e=xm(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,ma(t))fa(t,o);else{var s=hp(Ee.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Tt]=t,o[Et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(cp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=sa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||P(t,!0)}else e=hp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return ke(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return Sa(t.type),bl(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(fd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return Bo(t,zo.current&1|2),N&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>Cd&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!N)return bl(t),null}else 2*We()-r.renderingStartTime>Cd&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||N?Bo(t,o):(n=o,Ce(No,t),Ce(zo,n),I===null&&(I=t)),N&&na(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return Ro(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Se(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return Sa(t.type),null;case 22:case 23:return Ro(t),Mo(),e!==null&&Se(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function Cl(e,t){switch(aa(t),t.tag){case 3:Sa(Pa),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:Sa(t.type);break;case 22:case 23:Ro(t),Mo(),e!==null&&Se(Ja);break;case 24:Sa(Pa)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){vf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=xi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);f(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&om(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&sm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[Et]=t}catch(t){vf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sn)),Al(e,r),Yt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),Yt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){vf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Hl=!0,jp(o,ql===0?t:t+`_`+ql,n),ql++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Xl(e.child,t)),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Ci(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=xi(r,n),a=Ci(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Bd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Ci(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Bd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=Ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Bd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Bd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode);t=Ci(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=xi(n,r),a=Ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Bd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,pp=Sh,e=Zr(e),Qr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=xi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Ci(a.default,a.update),a!==`none`&&Jl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&wl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(zu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Do(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),su=t,cu=i}break;case 30:zu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:zu(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(et&&typeof et.onCommitFiberUnmount==`function`)try{et.onCommitFiberUnmount($e,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Op(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),Yt=!0}catch(e){vf(n,t,e)}else try{wu.removeChild(n.stateNode),Yt=!0}catch(e){vf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){vf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){vf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(i(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(i(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Mu(t,e,n),Fu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&64&&su&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Nu,Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else su||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):a.count--,n===null?su||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Fu(e),a&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Fu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(Yt=!1,Xm=null,o=Nu,Nu=Em(t.containerInfo),Mu(t,e,n),Nu=o,Fu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){vf(e,e.return,t)}uu&&(uu=!1,Iu(e)),Yt=!1;break;case 4:a=lu,lu=su,r=Xt(),o=Nu,Nu=Em(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=o,Yt&&mu&&(hu=!0),Yt=r,lu=a;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xd=We()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Fu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,Bu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:a&512&&(cu||r===null||kl(r,r.return)),a=Xt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&Ci(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&Yt&&(e.flags|=4),mu=o,Yt=a;break;case 21:break;case 7:a&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else ou(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Lu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),gu=!0}Gl=null;break;case 5:Lu(t,e);break;case 4:r=pu,pu=!1,Lu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Lu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=xi(a,o),o=xi(n.memoizedProps,o);var s=Ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Bd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Bu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Bu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),Bu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:kl(n,n.return),Bu(n,r);break;case 7:kl(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Vu(i,a,n),wl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Eo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||Qm(Em(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),Ol(a,a.return);break;case 30:Vu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ia(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ia(e))}function Wu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Gu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Gu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Wu(e,t,n,r);break;case 3:Wu(e,t,n,r),i&&gu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ia(a)));break;case 12:if(a&2048){Wu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else Wu(e,t,n,r);break;case 31:Wu(e,t,n,r);break;case 13:Wu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ru(t),o._visibility&2?Wu(e,t,n,r):(o._visibility|=2,Ku(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Wu(e,t,n,r):qu(e,t)),a&2048&&Hu(s,t);break;case 24:Wu(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Wu(e,t,n,r);break;default:Wu(e,t,n,r)}}function Ku(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ku(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ku(a,o,s,c,i)):u._visibility&2?Ku(a,o,s,c,i):qu(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Ku(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Ku(a,o,s,c,i)}t=t.sibling}}function qu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:qu(n,r),i&2048&&Hu(r.alternate,r);break;case 24:qu(n,r),i&2048&&Uu(r.alternate,r);break;default:qu(n,r)}t=t.sibling}}var Ju=8192;function Yu(e,t,n){if(e.subtreeFlags&Ju)for(e=e.child;e!==null;)Xu(e,t,n),e=e.sibling}function Xu(e,t,n){switch(e.tag){case 26:Yu(e,t,n),e.flags&Ju&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Yu(e,t,n),e.flags&Ju&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Nu;Nu=Em(e.stateNode.containerInfo),Yu(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ju,Ju=16777216,Yu(e,t,n),Ju=r):Yu(e,t,n));break;case 30:if((e.flags&Ju)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Yu(e,t,n);break;default:Yu(e,t,n)}}function Zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$u(e),e=e.sibling}function $u(e){switch(e.tag){case 0:case 11:case 15:Qu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Qu(e);break;case 12:Qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ed(e)):Qu(e);break;default:Qu(e)}}function ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),ed(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ed(t));break;default:ed(t)}e=e.sibling}}function td(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var nd={getCacheForType:function(e){var t=Oa(Pa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Oa(Pa).controller.signal}},rd=typeof WeakMap==`function`?WeakMap:Map,id=0,ad=null,z=null,B=0,od=0,sd=null,cd=!1,ld=!1,ud=!1,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=null,yd=null,bd=!1,xd=0,Sd=0,Cd=1/0,wd=null,Td=null,Ed=0,Dd=null,Od=null,kd=0,Ad=0,jd=null,Md=null,Nd=null,Pd=null,Fd=null,Id=0,Ld=null;function Rd(){return id&2&&B!==0?B&-B:j.T===null?St():zf()}function zd(){if(gd===0){if(!(B&536870912)||N){var e=st;st<<=1,!(st&3932160)&&(st=262144),gd=e}else gd=536870912}return e=No.current,e!==null&&(e.flags|=32),gd}function Bd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(xi(e.memoizedProps,n))),Pd===null&&(Pd=[]),Pd.push(t.bind(null,r))}}function Vd(e,t,n){(e===ad&&(od===2||od===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Gd(e,B,gd,!1)),gt(e,n),(!(id&2)||e!==ad)&&(e===ad&&(!(id&2)&&(md|=n),fd===4&&Gd(e,B,gd,!1)),jf(e))}function Hd(e,t,n){if(id&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||dt(e,t),a=r?tf(e,t):$d(e,t,!0),o=r;do{if(a===0){ld&&!r&&Gd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Wd(n)){a=$d(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=vd;var l=c.current.memoizedState.isDehydrated;if(l&&(Jd(c,s).flags|=256),s=$d(c,s,!1),s!==2&&s!==6){if(ud&&!l){c.errorRecoveryDisabledLanes|=o,md|=o,a=4;break a}o=yd,yd=a,o!==null&&(yd===null?yd=o:yd.push.apply(yd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Jd(e,0),Gd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Gd(r,t,gd,!cd);break a;case 2:yd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=xd+300-We(),10<a)){if(Gd(r,t,gd,!cd),ut(r,0,!0)!==0)break a;kd=t,r.timeoutHandle=Sp(Ud.bind(null,r,n,yd,wd,bd,t,gd,md,_d,cd,o,`Throttled`,-0,0),a);break a}Ud(r,n,yd,wd,bd,t,gd,md,_d,cd,o,null,-0,0)}break}while(1);jf(e)}function Ud(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sn},Ul=null,Xu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?xd-We():(a&4194048)===a?Sd-We():0,m=oh(d,m),m!==null)){kd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Gd(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Wd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Gr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gd(e,t,n,r){t=ft(e,t),t&=~hd,t&=~md,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-nt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vt(e,n,t)}function Kd(){return id&6?!0:(Mf(0,!1),!1)}function qd(){if(z!==null){if(od===0)var e=z.return;else e=z,ba=ya=null,ss(e),co=null,lo=0,e=z;for(;e!==null;)Cl(e.alternate,e),e=e.return;z=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),kd=0,qd(),ad=e,z=n=Ri(e.current,null),B=t,od=0,sd=null,cd=!1,ld=dt(e,t),ud=!1,_d=gd=hd=md=pd=fd=0,yd=vd=null,bd=!1,dd=ft(e,t),Oi(),n}function Yd(e,t){L=null,j.H=gc,t===Qa||t===eo?(t=oo(),od=3):t===$a?(t=oo(),od=4):od=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,sd=t,z===null&&(fd=1,Oc(e,Ki(t,e.current)))}function Xd(){var e=No.current;return e===null?!0:(B&4194048)===B?I===null:(B&62914560)===B||B&536870912?e===I:!1}function Zd(){var e=j.H;return j.H=gc,e===null?gc:e}function V(){var e=j.A;return j.A=nd,e}function Qd(){fd=4,cd||(B&4194048)!==B&&No.current!==null||(ld=!0),!(pd&134217727)&&!(md&134217727)||ad===null||Gd(ad,B,gd,!1)}function $d(e,t,n){var r=id;id|=2;var i=Zd(),a=V();(ad!==e||B!==t)&&(wd=null,Jd(e,t)),t=!1;var o=fd;a:do try{if(od!==0&&z!==null){var s=z,c=sd;switch(od){case 8:qd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=od;if(od=0,sd=null,H(e,s,c,l),n&&ld){o=0;break a}break;default:l=od,od=0,sd=null,H(e,s,c,l)}}ef(),o=fd;break}catch(t){Yd(e,t)}while(1);return t&&e.shellSuspendCounter++,ba=ya=null,id=r,j.H=i,j.A=a,z===null&&(ad=null,B=0,Oi()),o}function ef(){for(;z!==null;)rf(z)}function tf(e,t){var n=id;id|=2;var r=Zd(),a=V();ad!==e||B!==t?(wd=null,Cd=We()+500,Jd(e,t)):ld=dt(e,t);a:do try{if(od!==0&&z!==null){t=z;var o=sd;b:switch(od){case 1:od=0,sd=null,H(e,t,o,1);break;case 2:case 9:if(no(o)){od=0,sd=null,af(t);break}t=function(){od!==2&&od!==9||ad!==e||(od=7),jf(e)},o.then(t,t);break a;case 3:od=7;break a;case 4:od=5;break a;case 7:no(o)?(od=0,sd=null,af(t)):(od=0,sd=null,H(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?th(s):c.stateNode.complete){od=0,sd=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,of(u))}break b}}od=0,sd=null,H(e,t,o,5);break;case 6:od=0,sd=null,H(e,t,o,6);break;case 8:qd(),fd=6;break a;default:throw Error(i(462))}}nf();break}catch(t){Yd(e,t)}while(1);return ba=ya=null,j.H=r,j.A=a,id=n,z===null?(ad=null,B=0,Oi(),fd):0}function nf(){for(;z!==null&&!He();)rf(z)}function rf(e){var t=ml(e.alternate,e,dd);e.memoizedProps=e.pendingProps,t===null?of(e):z=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,B);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,B);break;case 5:ss(t);var r=t;r===sa&&(N?(pa(r),r.tag===5&&r.stateNode!=null&&(ca=r.stateNode)):(pa(r),N=!0));default:Cl(n,t),t=z=zi(t,dd),t=ml(n,t,dd)}e.memoizedProps=e.pendingProps,t===null?of(e):z=t}function H(e,t,n,r){ba=ya=null,ss(t),co=null,lo=0;var i=t.return;try{if(Nc(e,i,t,n,B)){fd=1,Oc(e,Ki(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;fd=1,Oc(e,Ki(n,e.current)),z=null;return}t.flags&32768?(N||r===1?e=!0:ld||B&536870912?e=!1:(cd=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,cd);return}e=t.return;var n=xl(t.alternate,t,dd);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);fd===0&&(fd=5)}function sf(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);fd=6,z=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Ed!==0);if(id&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ad&&(z=ad=null,B=0),Od=t,Dd=e,kd=n,jd=a,Md=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ad=s,s|=Di,_t(e,n,s,r,i,a),Pd=null,(n&335544064)===n?(Fd=za(e),r=10262):(Fd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Je,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=j.T,j.T=null,i=_e.p,_e.p=2,a=id,id|=4;try{_u(e,t,n)}finally{id=a,_e.p=i,j.T=r}}Ed=1,Hl?Nd=Rp(o,e.containerInfo,Fd,df,ff,uf,pf,gf,U,null,null):(df(),ff(),pf())}function U(e){if(Ed!==0){var t=Dd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Ed===3&&(Ed=0,Ru(Od,Dd),Ed=4)}function df(){if(Ed===1){Ed=0;var e=Dd,t=Od,n=kd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=j.T,j.T=null;var i=_e.p;_e.p=2;var a=id;id|=4;try{mu=hu=!1,Pu(t,e,n),n=mp;var o=Zr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Xr(s.ownerDocument.documentElement,s)){if(c!==null&&Qr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Yr(s,h),v=Yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!pp,mp=pp=null}finally{id=a,_e.p=i,j.T=r}}e.current=t,Ed=2}}function ff(){if(Ed===2){Ed=0;var e=Dd,t=Od,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=_e.p;_e.p=2;var i=id;id|=4;try{yu(e,t.alternate,t)}finally{id=i,_e.p=r,j.T=n}}Ed=3}}function pf(){if(Ed===4||Ed===3){Ed=0;var e=Nd;Nd=null,Ue();var t=Dd,n=Od,r=kd,i=Md,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Ed=5:(Ed=0,Od=Dd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Td=null),M(r),n=n.stateNode,et&&typeof et.onCommitFiberRoot==`function`)try{et.onCommitFiberRoot($e,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=j.T,a=_e.p,_e.p=2,j.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{j.T=n,_e.p=a}}if(i=Pd,o=Fd,Fd=null,i!==null&&(Pd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);kd&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Ld?Id++:(Id=0,Ld=t):(Id=0,Ld=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ia(t)))}function hf(){return Nd!==null&&(Nd.skipTransition(),Nd=null),df(),ff(),pf(),gf()}function gf(){if(Ed!==5)return!1;var e=Dd,t=Ad;Ad=0;var n=M(kd),r=j.T,a=_e.p;try{_e.p=32>n?32:n,j.T=null,n=jd,jd=null;var o=Dd,s=kd;if(Ed=0,Od=Dd=null,kd=0,id&6)throw Error(i(331));var c=id;if(id|=4,$u(o.current),Gu(o,o.current,s,n),id=c,Mf(0,!1),et&&typeof et.onPostCommitFiberRoot==`function`)try{et.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{_e.p=a,j.T=r,mf(e,t)}}function _f(e,t,n){t=Ki(n,t),t=Ac(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(gt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Td===null||!Td.has(r))){e=Ki(n,e),n=jc(2),r=xo(t,n,2),r!==null&&(Mc(n,r,t,e),gt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ud=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ad===e&&(B&n)===n&&(fd===4||fd===3&&(B&62914560)===B&&300>We()-xd?id&2?hd|=n:Jd(e,0):hd|=n,_d===B&&(_d=0)),jf(e)}function xf(e,t){t===0&&(t=mt()),e=ji(e,t),e!==null&&(gt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Be(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=B,a=ut(r,r===ad?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&xp()&&(e=Af);for(var t=We(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Ed!==0&&Ed!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-nt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=pt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ad,n=B,n=ut(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(od===2||od===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||dt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),M(n)){case 2:case 8:n=qe;break;case 32:n=Je;break;case 268435456:n=Xe;break;default:n=Je}return r=If.bind(null,e),n=Be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Ed!==0&&Ed!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=B;return r=ut(e,e===ad?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hd(e,r,t),Ff(e,We()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;Hd(e,t,!0)}function Rf(){Ep(function(){id&6?Be(Ke,Nf):Pf()})}function zf(){if(Af===0){var e=Ha;e===0&&(e=ot,ot<<=1,!(ot&261888)&&(ot=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:xn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Un(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<vi.length;Hf++){var Uf=vi[Hf];yi(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}yi(ui,`onAnimationEnd`),yi(di,`onAnimationIteration`),yi(fi,`onAnimationStart`),yi(`dblclick`,`onDoubleClick`),yi(`focusin`,`onFocus`),yi(`focusout`,`onBlur`),yi(pi,`onTransitionRun`),yi(mi,`onTransitionStart`),yi(hi,`onTransitionCancel`),yi(gi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){wi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){wi(e)}i.currentTarget=null,a=c}}}}function W(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!Mn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}kn(function(){var r=a,i=wn(n),s=[];a:{var c=_i.get(e);if(c!==void 0){var l=Un,u=e;switch(e){case`keypress`:if(Rn(n)===0)break a;case`keydown`:case`keyup`:l=sr;break;case`focusin`:u=`focus`,l=Qn;break;case`focusout`:u=`blur`,l=Qn;break;case`beforeblur`:case`afterblur`:l=Qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ur;break;case ui:case di:case fi:l=$n;break;case gi:l=dr;break;case`scroll`:case`scrollend`:l=Gn;break;case`wheel`:l=fr;break;case`copy`:case`cut`:case`paste`:l=er;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=cr;break;case`submit`:l=lr;break;case`toggle`:case`beforetoggle`:l=pr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=An(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Cn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=cr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Nr;else if(Dr(c)){if(Pr)_=Ur;else{_=Vr;var v=Br}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Nr):_=Hr;if(_&&=_(e,r)){Or(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Dr(v)||v.contentEditable===`true`)&&(ei=v,ti=r,ni=null);break;case`focusout`:ni=ti=ei=null;break;case`mousedown`:ri=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ri=!1,ii(s,n,i);break;case`selectionchange`:if($r)break;case`keydown`:case`keyup`:ii(s,n,i)}var y;if(hr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Cr?xr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(vr&&n.locale!==`ko`&&(Cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Cr&&(y=Ln()):(Pn=i,Fn=`value`in Pn?Pn.value:Pn.textContent,Cr=!0)),v=$f(r,b),0<v.length&&(b=new tr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Sr(n),y!==null&&(b.data=y)))),(y=_r?wr(e,n):Tr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new tr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=An(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=An(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=An(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=An(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
24
+ `).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);return;case`onScroll`:r!=null&&W(`scroll`,e);return;case`onScrollEnd`:r!=null&&W(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=xn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:W(`beforetoggle`,e),W(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&W(`scroll`,e);return;case`onScrollEnd`:r!=null&&W(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:W(`error`,e),W(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:W(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:op(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in W(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in W(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:op(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:op(e,t,l,r,n,null)}return;case`dialog`:W(`beforetoggle`,e),W(`toggle`,e),W(`cancel`,e),W(`close`,e);break;case`iframe`:case`object`:W(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)W(Wf[r],e);break;case`image`:W(`error`,e),W(`load`,e);break;case`details`:W(`toggle`,e);break;case`embed`:case`source`:case`link`:W(`error`,e),W(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||op(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||op(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:op(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}fn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:op(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&op(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:op(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[Tt]=r,n[Et]=t,cp(n,e,t),zt(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=_(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=hp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=_(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=_(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Ft(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),rm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),rm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=_(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Sn&&(e.onclick=null),Pt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=_e.d;_e.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Kd();return e||t}function km(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=w({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Rt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);zt(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Rt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=w({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),zt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Rt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),zt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Ee.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=Rt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=Rt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=Rt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+sn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),cp(t,`link`,n),zt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+sn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,zt(a),a):(r=n,(a=wm.get(o))&&(r=w({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Mt]||a[Tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:re,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function gh(e){return e?(e=Pi,e):Pi}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Vd(n,e,t),So(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Vd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Rd();t=xt(t);var n=ji(e,t);n!==null&&Vd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=j.T;j.T=null;var a=_e.p;try{_e.p=2,Th(e,t,n,r)}finally{_e.p=a,j.T=i}}function wh(e,t,n,r){var i=j.T;j.T=null;var a=_e.p;try{_e.p=8,Th(e,t,n,r)}finally{_e.p=a,j.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=lt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-nt(o);s.entanglements[1]|=c,o&=~c}jf(a),!(id&6)&&(Cd=We()+500,Mf(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Vd(s,a,2),Kd(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=wn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ge()){case Ke:return 2;case qe:return 8;case Je:case Ye:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=It(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=It(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Et]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Rd(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Kd(),t[Dt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));_e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{$e=eg.inject($h),et=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[Dt]=t.current,Yf(e),new Xh(t)}})),yw=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=vw()}));function bw(e){let t=(0,q.useRef)(e);return(0,q.useInsertionEffect)(()=>void(t.current=e)),(0,q.useCallback)((...e)=>t.current(...e),[])}var xw=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),J=o(((e,t)=>{t.exports=xw()}))(),Sw=(0,q.createContext)(void 0);function Cw(){return(0,q.useContext)(Sw)}var ww={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Tw={display:`contents`};function Ew(){return null}var Dw=`diffs-container`,Ow=/(?=^From [a-f0-9]+ .+$)/m,kw=/(?=^diff --git)/gm,Aw=/(?<=\n)/,jw=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Mw=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Nw=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Pw=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Fw=`header-prefix`,Iw=`header-filename-suffix`,Lw=`header-metadata`,Rw=`header-custom`,zw={dark:`pierre-dark`,light:`pierre-light`},Bw=`data-theme-css`,Vw=`data-unsafe-css`,Hw=`data-diffs-scrollbar-measure`,Uw=`--diffs-scrollbar-gutter-measured`,Ww=1e5,Gw={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Gw});var Kw=Object.freeze({fromStart:0,fromEnd:0}),qw={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Jw={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Yw(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Xw({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function Zw(e,t){return e-(t===0?0:1)}function Qw(e,t){return Zw(e,t)+t}function $w(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:eT(n,e.startContentIndex)}}function eT(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function tT({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d,getAnnotationSlotName:f=Yw}){let p=n?.(e),m=r?.(e),h=i?.(e),g=a?.(e);return(0,J.jsxs)(J.Fragment,{children:[p==null?(0,J.jsxs)(J.Fragment,{children:[m!=null&&(0,J.jsx)(`div`,{slot:`header-prefix`,children:m}),h!=null&&(0,J.jsx)(`div`,{slot:`header-filename-suffix`,children:h}),g!=null&&(0,J.jsx)(`div`,{slot:`header-metadata`,children:g})]}):(0,J.jsx)(`div`,{slot:Rw,children:p}),o!=null&&l?.map((e,t)=>(0,J.jsx)(`div`,{slot:f(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=nT(t,e);return(0,J.jsx)(`div`,{slot:n,style:Tw,children:c(t,d)},n)}),s!=null&&(0,J.jsx)(`div`,{slot:`gutter-utility-slot`,style:ww,children:s(u)})]})}function nT(e,t){let n=$w(e,t);return n==null?void 0:Xw({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function rT({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c,getAnnotationSlotName:l=Yw}){let u=t?.(e),d=n?.(e),f=r?.(e),p=i?.(e);return(0,J.jsxs)(J.Fragment,{children:[u==null?(0,J.jsxs)(J.Fragment,{children:[d!=null&&(0,J.jsx)(`div`,{slot:`header-prefix`,children:d}),f!=null&&(0,J.jsx)(`div`,{slot:`header-filename-suffix`,children:f}),p!=null&&(0,J.jsx)(`div`,{slot:`header-metadata`,children:p})]}):(0,J.jsx)(`div`,{slot:Rw,children:u}),a!=null&&o?.map((e,t)=>(0,J.jsx)(`div`,{slot:l(e),children:a(e)},t)),s!=null&&(0,J.jsx)(`div`,{slot:`gutter-utility-slot`,style:ww,children:s(c)})]})}var iT=new Map,aT=new Map,oT=new Map,sT=new Set;function cT(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!sT.has(t))return!1;return!0}function lT(e=zw){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var uT=new Set;function dT(e){let t=[],n=new Set;for(let r of fT(e.themes)){let e=hT(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return dT({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return dT({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function fT(e){return pT(e)?[e]:e}function pT(e){return hT(e)||mT(e)}function mT(e){return typeof e.name==`string`&&typeof e.load==`function`}function hT(e){return typeof e.getThemes==`function`}function gT(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var _T=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},vT=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},yT=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function bT(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new _T(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new vT(i));let c=r,l=s().then(e=>{let a=gT(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new yT(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var xT=bT();function ST(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=xT.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,xT.getResolvedTheme(n)??xT.seedResolvedTheme(n,e);uT.has(n)||(uT.add(n),t.loadThemeSync(e))}}function CT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(sT.has(n.name))continue;let e=iT.get(n.name);e??(e=n,iT.set(n.name,e));let r=e.data.find(t=>t.name===e.name||t.aliases?.includes(e.name)===!0);if(r==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${e.name}" as its name or an alias.`);t.loadLanguageSync(e.data);try{t.getLanguage(e.name)}catch{throw Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${e.name}". Load the alias first or give the grammar a unique name.`)}sT.add(e.name)}}function wT(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var TT=Object.defineProperty,ET=Object.getOwnPropertyDescriptor,DT=Object.getOwnPropertyNames,OT=Object.prototype.hasOwnProperty,kT=(e,t)=>{let n={};for(var r in e)TT(n,r,{get:e[r],enumerable:!0});return t||TT(n,Symbol.toStringTag,{value:`Module`}),n},AT=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=DT(t),a=0,o=i.length,s;a<o;a++)s=i[a],!OT.call(e,s)&&s!==n&&TT(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ET(t,s))||r.enumerable});return e},jT=(e,t,n)=>(AT(e,t,`default`),n&&AT(n,t,`default`)),MT=`modulepreload`,NT=function(e){return`/`+e},PT={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=NT(t,n),t=s(t),t in PT)return;PT[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:MT,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},FT=[{id:`abap`,name:`ABAP`,import:(()=>Y(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>Y(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Y(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>Y(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>Y(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Y(()=>import(`./angular-html-dpkqgbRV.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Y(()=>import(`./angular-ts-CsmXxkwl.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Y(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Y(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Y(()=>import(`./apl-Cb01Bf5P.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Y(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Y(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Y(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Y(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Y(()=>import(`./astro-C66OEn5O.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Y(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Y(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>Y(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Y(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Y(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Y(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Y(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Y(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Y(()=>import(`./blade-El75k66R.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Y(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Y(()=>import(`./c-Bhdr_xah.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Y(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Y(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Y(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>Y(()=>import(`./chapel-C5KQsiHG.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>Y(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Y(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Y(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Y(()=>import(`./cobol-BRb1H5HB.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Y(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Y(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Y(()=>import(`./coffee-NR0si6Vq.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Y(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>Y(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Y(()=>import(`./cpp-DVyXcCha.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>Y(()=>import(`./crystal-0irrWVMC.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Y(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Y(()=>import(`./css-B69tIC5-.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Y(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Y(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Y(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Y(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Y(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Y(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Y(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Y(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Y(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Y(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Y(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Y(()=>import(`./edge-Dfies4ns.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Y(()=>import(`./elixir-CkHYLBMl.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Y(()=>import(`./elm-BM3XZF_H.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Y(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Y(()=>import(`./erb-ibsMVJQV.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Y(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>Y(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Y(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Y(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Y(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Y(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Y(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Y(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Y(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Y(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Y(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Y(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Y(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Y(()=>import(`./git-rebase-v0T8i51i.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>Y(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Y(()=>import(`./glimmer-js-DLkiF188.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Y(()=>import(`./glimmer-ts-C1MfSiD_.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Y(()=>import(`./glsl-DmJpMzIS.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>Y(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Y(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Y(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Y(()=>import(`./graphql-Bx_gWPNL.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>Y(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Y(()=>import(`./hack-zuzo4z8C.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Y(()=>import(`./haml-2O-haJVu.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Y(()=>import(`./handlebars-DW9-jkUL.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Y(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Y(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Y(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Y(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Y(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Y(()=>import(`./html-4b-UbCWm.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Y(()=>import(`./html-derivative-lCJLFQ95.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Y(()=>import(`./http-CkqYUsMn.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>Y(()=>import(`./hurl-BpcUpblR.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>Y(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>Y(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Y(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Y(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Y(()=>import(`./java-p9UcnYwP.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Y(()=>import(`./javascript-Dlz1Uo-L.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Y(()=>import(`./jinja-Bpg33dsD.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Y(()=>import(`./jison-By-VToHw.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>Y(()=>import(`./json-BxAha_TD.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Y(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Y(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Y(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Y(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Y(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Y(()=>import(`./jsx-DSiXkHRj.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Y(()=>import(`./julia-D0yc7GFR.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>Y(()=>import(`./just-C2DI3pUP.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>Y(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Y(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Y(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Y(()=>import(`./latex-DMT_f-3C.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Y(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Y(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Y(()=>import(`./liquid-DiASchGu.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Y(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Y(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Y(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Y(()=>import(`./lua-BafzqdQU.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>Y(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Y(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Y(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Y(()=>import(`./marko-oJq8ByTy.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>Y(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Y(()=>import(`./mdc-RuZg9ymz.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>Y(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Y(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Y(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Y(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Y(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>Y(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Y(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Y(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Y(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Y(()=>import(`./nginx-B4H34M9v.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>Y(()=>import(`./nim-Cw8zuJky.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>Y(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>Y(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Y(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Y(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Y(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Y(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Y(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Y(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>Y(()=>import(`./org-hVregGpI.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>Y(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Y(()=>import(`./perl-CwTUPbAz.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Y(()=>import(`./php-gQC_Fmii.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Y(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Y(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Y(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Y(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Y(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Y(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>Y(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Y(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Y(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Y(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Y(()=>import(`./pug-D6dZj3jJ.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Y(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Y(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Y(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Y(()=>import(`./qml-E4rdecj4.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Y(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Y(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Y(()=>import(`./r-DR6ad8yZ.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Y(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Y(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Y(()=>import(`./razor-D8M2A4M7.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>Y(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Y(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Y(()=>import(`./regexp-DSjZ8XWG.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Y(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Y(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Y(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Y(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Y(()=>import(`./rst-DQnNZTXl.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Y(()=>import(`./ruby-BJSAqM9X.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Y(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Y(()=>import(`./sas-cMF9FoL4.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>Y(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Y(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Y(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Y(()=>import(`./scss-D1ikNPGF.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Y(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Y(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Y(()=>import(`./shellscript-D4nS65SB.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Y(()=>import(`./shellsession-BX-bfrSn.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>Y(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>Y(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Y(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Y(()=>import(`./soy-B8DHGyol.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Y(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Y(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Y(()=>import(`./sql-BXnvc70Q.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Y(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Y(()=>import(`./stata-i4_4KZkj.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Y(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Y(()=>import(`./surrealql-CJYktgMP.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Y(()=>import(`./svelte-DkTFRfzJ.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Y(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Y(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Y(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Y(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Y(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Y(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Y(()=>import(`./templ-DR-sPCuW.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Y(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Y(()=>import(`./tex-Bm81cpcu.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>Y(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Y(()=>import(`./ts-tags-8o0M5w05.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>Y(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Y(()=>import(`./tsx-DPlNg7Ry.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Y(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Y(()=>import(`./twig-Cteaw1dL.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Y(()=>import(`./typescript-CZO0lWCV.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Y(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Y(()=>import(`./typst-BFzy4EUn.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120])))},{id:`v`,name:`V`,import:(()=>Y(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Y(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>Y(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Y(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Y(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Y(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Y(()=>import(`./vue-Cvhq1cTP.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Y(()=>import(`./vue-html-BTAnySQ7.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Y(()=>import(`./vue-vine-BLuytsGS.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Y(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Y(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Y(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Y(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Y(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Y(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Y(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Y(()=>import(`./xml-HIAzbxU_.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Y(()=>import(`./xsl-ZYoNgca3.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Y(()=>import(`./yaml-Bc5rHCoM.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Y(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Y(()=>import(`./zig-CMLA9XwU.js`),[]))}],IT=Object.fromEntries(FT.map(e=>[e.id,e.import])),LT=Object.fromEntries(FT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RT={...IT,...LT},zT=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Y(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Y(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Y(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Y(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Y(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Y(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Y(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Y(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Y(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Y(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Y(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Y(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Y(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Y(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Y(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Y(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Y(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Y(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Y(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Y(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Y(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Y(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Y(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Y(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Y(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Y(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Y(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Y(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Y(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Y(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Y(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Y(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Y(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Y(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Y(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Y(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Y(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Y(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Y(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Y(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Y(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Y(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Y(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Y(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Y(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Y(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Y(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Y(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),BT=s({createOnigurumaEngine:()=>mE,getDefaultWasmLoader:()=>pE,loadWasm:()=>sE,setDefaultWasmLoader:()=>fE}),VT=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HT(){return 2147483648}function UT(){return typeof performance<`u`?performance.now():Date.now()}var WT=(e,t)=>e+(t-e%t)%t;async function GT(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=HT();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,WT(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:UT,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var KT=Object.defineProperty,qT=(e,t,n)=>t in e?KT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JT=(e,t,n)=>qT(e,typeof t==`symbol`?t:t+``,n),YT=null;function XT(e){throw new VT(e.UTF8ToString(e.getLastOnigError()))}var ZT=class e{constructor(t){JT(this,`utf16Length`),JT(this,`utf8Length`),JT(this,`utf16Value`),JT(this,`utf8Value`),JT(this,`utf16OffsetToUtf8`),JT(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QT=class e{constructor(t){if(JT(this,`id`,++e.LAST_ID),JT(this,`_onigBinding`),JT(this,`content`),JT(this,`utf16Length`),JT(this,`utf8Length`),JT(this,`utf16OffsetToUtf8`),JT(this,`utf8OffsetToUtf16`),JT(this,`ptr`),!YT)throw new VT(`Must invoke loadWasm first.`);this._onigBinding=YT,this.content=t;let n=new ZT(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YT.omalloc(1e4),e._sharedPtrInUse=!0,YT.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YT)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};JT(QT,`LAST_ID`,0),JT(QT,`_sharedPtr`,0),JT(QT,`_sharedPtrInUse`,!1);var $T=QT,eE=class{constructor(e){if(JT(this,`_onigBinding`),JT(this,`_ptr`),!YT)throw new VT(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZT(e[r]);t[r]=i.createString(YT),n[r]=i.utf8Length}let r=YT.omalloc(4*e.length);YT.HEAPU32.set(t,r/4);let i=YT.omalloc(4*e.length);YT.HEAPU32.set(n,i/4);let a=YT.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YT.ofree(t[n]);YT.ofree(i),YT.ofree(r),a===0&&XT(YT),this._onigBinding=YT,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $T(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function tE(e){return typeof e.instantiator==`function`}function nE(e){return typeof e.default==`function`}function rE(e){return e.data!==void 0}function iE(e){return typeof Response<`u`&&e instanceof Response}function aE(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oE;function sE(e){if(oE)return oE;async function t(){YT=await GT(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tE(n)?n=await n.instantiator(t):nE(n)?n=await n.default(t):(rE(n)&&(n=n.data),iE(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lE(n)(t):await uE(n)(t):aE(n)||n instanceof WebAssembly.Module?n=await cE(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cE(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oE=t(),oE}function cE(e){return t=>WebAssembly.instantiate(e,t)}function lE(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uE(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dE;function fE(e){dE=e}function pE(){return dE}async function mE(e){return e&&await sE(e),{createScanner(e){return new eE(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $T(e)}}}var hE=kT({});jT(hE,BT);var gE=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _E(e){return vE(e)}function vE(e){return Array.isArray(e)?yE(e):e instanceof RegExp?e:typeof e==`object`?bE(e):e}function yE(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=vE(e[n]);return t}function bE(e){let t={};for(let n in e)t[n]=vE(e[n]);return t}function xE(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function SE(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?SE(e.substring(0,e.length-1)):e.substr(~t+1)}var CE=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,wE=class{static hasCaptures(e){return e!==null&&(CE.lastIndex=0,CE.test(e))}static replaceCaptures(e,t,n){return e.replace(CE,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function TE(e,t){return e<t?-1:+(e>t)}function EE(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=TE(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function DE(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function OE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var kE=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},AE=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(FE(e),t)}static createFromParsedTheme(e,t){return RE(e,t)}_cachedMatchRoot=new kE(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ME(e.parent,t.parentScopes));return n?new PE(n.fontStyle,n.foreground,n.background):null}},jE=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ME(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!NE(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function NE(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var PE=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function FE(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&DE(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&DE(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new IE(l,u,e,o,s,c)}}return n}var IE=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},LE=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(LE||{});function RE(e,t){e.sort((e,t)=>{let n=TE(e.scope,t.scope);return n!==0||(n=EE(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new zE(t),o=new PE(n,a.getId(r),a.getId(i)),s=new HE(new VE(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new AE(a,o,s)}var zE=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},BE=Object.freeze([]),VE=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||BE,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},HE=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),VE.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(EE(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new VE(e,t,n,r,i))}},UE=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=GE(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function WE(e){return e}function GE(e){return e}function KE(e,t){let n=[],r=JE(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(qE(i)){let e=[];do e.push(i),i=r.next();while(qE(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function qE(e){return!!e&&!!e.match(/[\w\.:]+/)}function JE(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function YE(e){typeof e.dispose==`function`&&e.dispose()}var XE=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ZE=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},QE=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$E=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new XE(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new QE;for(let n of e)eD(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof XE){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function eD(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof XE?nD({baseGrammar:a,selfGrammar:i},r):tD(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new XE(e))}function tD(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];rD([r],t,n)}}function nD(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rD(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rD(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rD(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?xE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rD(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lD(i);switch(a.kind){case 0:nD({...t,selfGrammar:t.baseGrammar},n);break;case 1:nD(t,n);break;case 2:tD(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?tD(a.ruleName,i,n):nD(i,n)}else a.kind===4?n.add(new ZE(a.scopeName,a.ruleName)):n.add(new XE(a.scopeName))}}}var iD=class{kind=0},aD=class{kind=1},oD=class{constructor(e){this.ruleName=e}kind=2},sD=class{constructor(e){this.scopeName=e}kind=3},cD=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lD(e){if(e===`$base`)return new iD;if(e===`$self`)return new aD;let t=e.indexOf(`#`);return t===-1?new sD(e):t===0?new oD(e.substring(1)):new cD(e.substring(0,t),e.substring(t+1))}var uD=/\\(\d+)/,dD=/\\(\d+)/g,fD=-1,pD=-2;function mD(e){return e}function hD(e){return e}var gD=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=wE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=wE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${SE(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:wE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:wE.replaceCaptures(this._contentName,e,t)}},_D=class extends gD{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},vD=class extends gD{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new CD(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yD=class extends gD{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new wD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bD=class extends gD{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new CD(i,this.id),this.beginCaptures=a,this._end=new CD(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wD;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},xD=class extends gD{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new CD(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new CD(o,pD),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new wD;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new wD,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},SD=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new _D(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new vD(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=xE({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new yD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new xD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new bD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lD(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof yD||e instanceof bD||e instanceof xD)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},CD=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&uD.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dD.lastIndex=0,this.source.replace(dD,(e,t)=>OE(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},wD=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new TD(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new TD(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},TD=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
25
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ED=class{constructor(e,t){this.languageId=e,this.tokenType=t}},DD=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new ED(e,8),this._embeddedLanguagesMatcher=new OD(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ED(0,0);_getBasicScopeAttributes=new kE(e=>new ED(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},OD=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>OE(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var kD=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function AD(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=jD(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new kD(i,!0);f()}return new kD(i,!1);function f(){let o=MD(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===fD){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),LD(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof bD){let r=o;LD(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof xD){let r=o;LD(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(LD(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function jD(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof xD&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=ID(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==pD){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),LD(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function MD(e,t,n,r,i,a){let o=ND(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=PD(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function ND(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=FD(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function PD(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=FD(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function FD(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function ID(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function LD(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));AD(e,p,n&&d.start===0,d.start,f,i,!1,0),YE(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new RD(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var RD=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function zD(e,t,n,r,i,a,o,s){return new UD(e,t,n,r,i,a,o,s)}function BD(e,t,n,r,i){let a=KE(t,VD),o=SD.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function VD(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(HD(t[r],e))return n=r+1,!0;return!1})}function HD(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var UD=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new DD(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=WD(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=KE(e,VD);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)BD(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&BD(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(mD(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[hD(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=WD(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=SD.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===KD.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=UE.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?GD.createRootAndLookUpScopeName(a,r,this):GD.createRoot(`unknown`,r),t=new KD(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
26
+ `;let a=this.createOnigString(e),o=a.content.length,s=new JD(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=AD(this,a,i,0,t,s,!0,r);return YE(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function WD(e,t){return e=_E(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var GD=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=jE.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new jE(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new jE(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),UE.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},KD=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?GD.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:hD(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=GD.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,mD(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,GD.fromExtension(r,n.contentNameScopesList))}},qD=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):KE(e,VD).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>KE(e,VD).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},JD=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=UE.set(n,0,WE(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=UE.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},YD=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,zD(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},XD=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new YD(AE.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(AE.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new qD(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new $E(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ZD=KD.NULL;function QD(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function $D(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function eO(e){return Array.isArray(e)?e:[e]}async function tO(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function nO(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function rO(e){return e===`ansi`||nO(e)}function iO(e){return e===`none`}function aO(e){return iO(e)}var oO=/(\r?\n)/g;function sO(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(oO),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var cO={light:`#333333`,dark:`#bbbbbb`},lO={light:`#fffffe`,dark:`#1e1e1e`},uO=`__shiki_resolved`;function dO(e){if(e?.[uO])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?cO.light:cO.dark,n||=t.type===`light`?lO.light:lO.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,uO,{enumerable:!1,writable:!1,value:!0}),t}async function fO(e){return[...new Set((await Promise.all(e.filter(e=>!rO(e)).map(async e=>await tO(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function pO(e){return(await Promise.all(e.map(async e=>aO(e)?null:dO(await tO(e))))).filter(e=>!!e)}function mO(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gE(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var hO=class extends XD{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=dO(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=AE.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=mO(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new gE(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},gO=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},_O=0;function vO(e){_O+=1,e.warnings!==!1&&_O>=10&&_O%10==0&&console.warn(`[Shiki] ${_O} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new gE("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(dO),i=new hO(new gO(e.engine,n),r,n,e.langAlias),a;function o(t){return mO(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new gE(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new gE(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await fO(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await pO(e))}function g(){if(t)throw new gE(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--_O)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function yO(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([pO(e.themes||[]),fO(e.langs||[]),e.engine]);return vO({...e,themes:t,langs:n,engine:r})}var bO=new WeakMap;function xO(e,t){bO.set(e,t)}function SO(e){return bO.get(e)}var CO=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(eO(n).map(e=>[e,ZD])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return wO(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function wO(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function TO(e,t){if(!(e instanceof CO))throw new gE(`Invalid grammar state`);return e.getInternalStack(t)}var EO=/,/,DO=/ /;function OO(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(nO(e.resolveLangAlias(n.lang||`text`))||iO(r))return sO(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new gE(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new gE(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return AO(t,o,i,a,n)}function kO(...e){if(e.length===2)return SO(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(nO(i)||iO(a))throw new gE(`Plain language does not have grammar state`);if(i===`ansi`)throw new gE(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new CO(jO(n,c,o,s,r).stateStack,c.name,o.name)}function AO(e,t,n,r,i){let a=jO(e,t,n,r,i),o=new CO(a.stateStack,t.name,n.name);return xO(a.tokens,o),a.tokens}function jO(e,t,n,r,i){let a=QD(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=sO(e),u=i.grammarState?TO(i.grammarState,n.name)??ZD:i.grammarContextCode==null?ZD:jO(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=$D(r[UE.getForeground(s)],a),u=UE.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=UE.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(EO).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(DO))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?MO(t.scopes):NO(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function MO(e){return e.map(e=>({scopeName:e}))}function NO(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:IO(e,i,t.slice(0,r))}}return n}function PO(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function FO(e,t,n){if(!PO(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)PO(e[r],n[i])&&--r,--i;return r===-1}function IO(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(FO(e,t,n)){r.push(a);break}return r}function LO(e,t,n,r=OO){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:SO(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=RO(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new CO(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&xO(s,c),s}function RO(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var zO=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],BO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};BO.prototype.normal={},BO.prototype.property={},BO.prototype.space=void 0;function VO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new BO(n,r,t)}function HO(e){return e.toLowerCase()}var UO=class{constructor(e,t){this.attribute=t,this.property=e}};UO.prototype.attribute=``,UO.prototype.booleanish=!1,UO.prototype.boolean=!1,UO.prototype.commaOrSpaceSeparated=!1,UO.prototype.commaSeparated=!1,UO.prototype.defined=!1,UO.prototype.mustUseProperty=!1,UO.prototype.number=!1,UO.prototype.overloadedBoolean=!1,UO.prototype.property=``,UO.prototype.spaceSeparated=!1,UO.prototype.space=void 0;var WO=s({boolean:()=>X,booleanish:()=>KO,commaOrSpaceSeparated:()=>XO,commaSeparated:()=>YO,number:()=>Z,overloadedBoolean:()=>qO,spaceSeparated:()=>JO}),GO=0,X=ZO(),KO=ZO(),qO=ZO(),Z=ZO(),JO=ZO(),YO=ZO(),XO=ZO();function ZO(){return 2**++GO}var QO=Object.keys(WO),$O=class extends UO{constructor(e,t,n,r){let i=-1;if(super(e,t),ek(this,`space`,r),typeof n==`number`)for(;++i<QO.length;){let e=QO[i];ek(this,QO[i],(n&WO[e])===WO[e])}}};$O.prototype.defined=!0;function ek(e,t,n){n&&(e[t]=n)}function tk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new $O(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[HO(r)]=r,n[HO(a.attribute)]=r}return new BO(t,n,e.space)}var nk=tk({properties:{ariaActiveDescendant:null,ariaAtomic:KO,ariaAutoComplete:null,ariaBusy:KO,ariaChecked:KO,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:JO,ariaCurrent:null,ariaDescribedBy:JO,ariaDetails:null,ariaDisabled:KO,ariaDropEffect:JO,ariaErrorMessage:null,ariaExpanded:KO,ariaFlowTo:JO,ariaGrabbed:KO,ariaHasPopup:null,ariaHidden:KO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:JO,ariaLevel:Z,ariaLive:null,ariaModal:KO,ariaMultiLine:KO,ariaMultiSelectable:KO,ariaOrientation:null,ariaOwns:JO,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:KO,ariaReadOnly:KO,ariaRelevant:null,ariaRequired:KO,ariaRoleDescription:JO,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:KO,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function rk(e,t){return t in e?e[t]:t}function ik(e,t){return rk(e,t.toLowerCase())}var ak=tk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:YO,acceptCharset:JO,accessKey:JO,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:JO,autoFocus:X,autoPlay:X,blocking:JO,capture:null,charSet:null,checked:X,cite:null,className:JO,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:KO,controls:X,controlsList:JO,coords:Z|YO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:qO,draggable:KO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:JO,height:Z,hidden:qO,high:Z,href:null,hrefLang:null,htmlFor:JO,httpEquiv:JO,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:JO,itemRef:JO,itemScope:X,itemType:JO,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:Z,pattern:null,ping:JO,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:JO,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:JO,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:KO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:KO,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:JO,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:KO,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:YO,part:JO,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:ik}),ok=tk({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:XO,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:JO,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:YO,g2:YO,glyphName:YO,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:XO,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:JO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:XO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:XO,rev:XO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:XO,requiredFeatures:XO,requiredFonts:XO,requiredFormats:XO,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:XO,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:XO,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:XO,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:rk}),sk=tk({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ck=tk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ik}),lk=tk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),uk=/[A-Z]/g,dk=/-[a-z]/g,fk=/^data[-\w.:]+$/i;function pk(e,t){let n=HO(t),r=t,i=UO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(dk,hk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!dk.test(e)){let n=e.replace(uk,mk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=$O}return new i(r,t)}function mk(e){return`-`+e.toLowerCase()}function hk(e){return e.charAt(1).toUpperCase()}var gk=VO([nk,ak,sk,ck,lk],`html`),_k=VO([nk,ok,sk,ck,lk],`svg`),vk={}.hasOwnProperty;function yk(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&vk.call(t,e)){let n=String(t[e]);i=vk.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var bk=/["&'<>`]/g,xk=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Sk=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ck=/[|\\{}()[\]^$+*?.]/g,wk=new WeakMap;function Tk(e,t){return e=e.replace(t.subset?Ek(t.subset):bk,r),t.subset||t.escapeOnly?e:e.replace(xk,n).replace(Sk,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Ek(e){let t=wk.get(e);return t||(t=Dk(e),wk.set(e,t)),t}function Dk(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ck,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Ok=/[\dA-Fa-f]/;function kk(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Ok.test(String.fromCharCode(t))?r:r+`;`}var Ak=/\d/;function jk(e,t,n){let r=`&#`+String(e);return n&&t&&!Ak.test(String.fromCharCode(t))?r:r+`;`}var Mk=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Nk={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Pk=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Fk={}.hasOwnProperty,Ik={},Lk;for(Lk in Nk)Fk.call(Nk,Lk)&&(Ik[Nk[Lk]]=Lk);var Rk=/[^\dA-Za-z]/;function zk(e,t,n,r){let i=String.fromCharCode(e);if(Fk.call(Ik,i)){let e=Ik[i],a=`&`+e;return n&&Mk.includes(e)&&!Pk.includes(e)&&(!r||t&&t!==61&&Rk.test(String.fromCharCode(t)))?a:a+`;`}return``}function Bk(e,t,n){let r=kk(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=zk(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=jk(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Vk(e,t){return Tk(e,Object.assign({format:Bk},t))}var Hk=/^>|^->|<!--|-->|--!>|<!-$/g,Uk=[`>`],Wk=[`<`,`>`];function Gk(e,t,n,r){return r.settings.bogusComments?`<?`+Vk(e.value,Object.assign({},r.settings.characterReferences,{subset:Uk}))+`>`:`<!--`+e.value.replace(Hk,i)+`-->`;function i(e){return Vk(e,Object.assign({},r.settings.characterReferences,{subset:Wk}))}}function Kk(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function qk(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Jk(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Yk(e){return e.join(` `).trim()}var Xk=/[ \t\n\f\r]/g;function Zk(e){return typeof e==`object`?e.type===`text`&&Qk(e.value):Qk(e)}function Qk(e){return e.replace(Xk,``)===``}var $k=nA(1),eA=nA(-1),tA=[];function nA(e){return t;function t(t,n,r){let i=t?t.children:tA,a=(n||0)+e,o=i[a];if(!r)for(;o&&Zk(o);)a+=e,o=i[a];return o}}var rA={}.hasOwnProperty;function iA(e){return t;function t(t,n,r){return rA.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var aA=iA({body:cA,caption:oA,colgroup:oA,dd:fA,dt:dA,head:oA,html:sA,li:uA,optgroup:mA,option:hA,p:lA,rp:pA,rt:pA,tbody:_A,td:bA,tfoot:vA,th:bA,thead:gA,tr:yA});function oA(e,t,n){let r=$k(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Zk(r.value.charAt(0)))}function sA(e,t,n){let r=$k(n,t);return!r||r.type!==`comment`}function cA(e,t,n){let r=$k(n,t);return!r||r.type!==`comment`}function lA(e,t,n){let r=$k(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function uA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&r.tagName===`li`}function dA(e,t,n){let r=$k(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function fA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function pA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function mA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function hA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function gA(e,t,n){let r=$k(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function _A(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function vA(e,t,n){return!$k(n,t)}function yA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function bA(e,t,n){let r=$k(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var xA=iA({body:wA,colgroup:TA,head:CA,html:SA,tbody:EA});function SA(e){let t=$k(e,-1);return!t||t.type!==`comment`}function CA(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function wA(e){let t=$k(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Zk(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function TA(e,t,n){let r=eA(n,t),i=$k(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&aA(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function EA(e,t,n){let r=eA(n,t),i=$k(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&aA(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var DA={name:[[`
27
+ \f\r &/=>`.split(``),`
28
+ \f\r "&'/=>\``.split(``)],[`\0
29
+ \f\r "&'/<=>`.split(``),`\0
30
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
31
+ \f\r &>`.split(``),`\0
32
+ \f\r "&'<=>\``.split(``)],[`\0
33
+ \f\r "&'<=>\``.split(``),`\0
34
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function OA(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=_k);let l=kA(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!xA(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!aA(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function kA(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=AA(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function AA(e,t,n){let r=pk(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Vk(r.attribute,Object.assign({},e.settings.characterReferences,{subset:DA.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Jk:Yk)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Vk(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:DA.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&qk(n,o)>qk(n,e.alternative)&&(o=e.alternative),s=o+Vk(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?DA.single:DA.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var jA=[`<`,`&`];function MA(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Vk(e.value,Object.assign({},r.settings.characterReferences,{subset:jA}))}function NA(e,t,n,r){return r.settings.allowDangerousHtml?e.value:MA(e,t,n,r)}function PA(e,t,n,r){return r.all(e)}var FA=yk(`type`,{invalid:IA,unknown:LA,handlers:{comment:Gk,doctype:Kk,element:OA,raw:NA,root:PA,text:MA}});function IA(e){throw Error("Expected node, not `"+e+"`")}function LA(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var RA={},zA={},BA=[];function VA(e,t){let n=t||RA,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:HA,all:UA,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||zO,characterReferences:n.characterReferences||zA,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?_k:gk,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function HA(e,t,n){return FA(e,t,n,this)}function UA(e){let t=[],n=e&&e.children||BA,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var WA=/\s+/g;function GA(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(WA)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(WA);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var KA=/:?lang=["']([^"']+)["']/g,qA=/(?:```|~~~)([\w-]+)/g,JA=/\\begin\{([\w-]+)\}/g,YA=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,XA=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function ZA(e){let t=sO(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function QA(e,t,n){let r=new Set;for(let t of e.matchAll(KA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(qA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(JA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(YA)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(XA.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var $A=[`color`,`background-color`];function ej(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function tj(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function nj(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=tj(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return ej(e,a)})):e}function rj(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>ij(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&$A.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new gE('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function ij(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&LE.Italic&&(t[`font-style`]=`italic`),e.fontStyle&LE.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&LE.Underline&&n.push(`underline`),e.fontStyle&LE.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function aj(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function oj(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=ZA(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new gE(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new gE(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new gE(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));sj(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return nj(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new gE(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=cj(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new gE(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new gE(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&GA(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function sj(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new gE(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new gE(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function cj(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(cj).join(``):``}var lj=[oj()];function uj(e){let t=dj(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...lj]}function dj(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var fj=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],pj={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function mj(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function hj(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function gj(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)pj[r]&&t.push({type:`setDecoration`,value:pj[r]});else if(r<=29){let e=pj[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:fj[r-30]}});else if(r===38){let n=hj(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:fj[r-40]}});else if(r===48){let n=hj(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:fj[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:fj[r-100+8]}})}}return t}function _j(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=mj(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=gj(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var vj={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function yj(e=vj){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<fj.length;e++)r.push(t(fj[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var bj=/#([0-9a-f]{3,8})/i,xj=/var\((--[\w-]+-ansi-[\w-]+)\)/,Sj={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Cj(e,t,n){let r=QD(e,n),i=sO(t),a=yj(Object.fromEntries(fj.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Sj[t]]}))),o=_j();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=$D(i,r),o=$D(o,r),n.decorations.has(`dim`)&&(i=wj(i));let s=LE.None;return n.decorations.has(`bold`)&&(s|=LE.Bold),n.decorations.has(`italic`)&&(s|=LE.Italic),n.decorations.has(`underline`)&&(s|=LE.Underline),n.decorations.has(`strikethrough`)&&(s|=LE.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function wj(e){let t=e.match(bj);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(xj);return n?`var(${n[1]}-dim)`:e}function Tj(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!nO(r)&&!iO(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Cj(r,t,n)}return OO(e,t,n)}function Ej(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new gE("`themes` option must not be empty");let p=LO(e,t,n,Tj);if(c=SO(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new gE(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>rj(e,h,u,l,d))),c&&xO(a,c);let g=f.map(e=>QD(e.theme,n));i=Dj(f,m,g,u,l,`fg`,d),r=Dj(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=QD(n.theme,n);a=Tj(e,t,n);let l=e.getTheme(n.theme);r=$D(l.bg,s),i=$D(l.fg,s),o=l.name,c=SO(a)}else throw new gE("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Dj(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=$D(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new gE('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${$D(t[r][a],n[r])||`inherit`}, ${$D(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Oj=/^\s+$/,kj=/^(\s*)(.*?)(\s*)$/;function Aj(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Aj(e,t,n),codeToTokens:(t,n)=>Ej(e,t,n)}){let i=t;for(let e of uj(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Ej(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Mj(a):d===`never`&&(a=Nj(a)),f&&(a=Pj(a));let p={...r,get source(){return i}};for(let e of uj(n))a=e.tokens?.call(p,a)||a;return jj(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function jj(e,t,n,r=SO(e)){let i=uj(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:GA,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
35
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=aj(a.htmlStyle||ij(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&xO(m,r),m}function Mj(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&LE.Underline||i.fontStyle&LE.Strikethrough));o&&Oj.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Nj(e){return e.map(e=>e.flatMap(e=>{if(Oj.test(e.content))return e;let t=e.content.match(kj);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Pj(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=aj(e.htmlStyle||ij(e)),i=aj(n.htmlStyle||ij(n)),a=e.fontStyle&&(e.fontStyle&LE.Underline||e.fontStyle&LE.Strikethrough),o=n.fontStyle&&(n.fontStyle&LE.Underline||n.fontStyle&LE.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Fj=VA;function Ij(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Aj(e,t,n),codeToTokens:(t,n)=>Ej(e,t,n)},i=Fj(Aj(e,t,n,r));for(let e of uj(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Lj(e){let t=await yO(e);return{getLastGrammarState:(...e)=>kO(t,...e),codeToTokensBase:(e,n)=>Tj(t,e,n),codeToTokensWithThemes:(e,n)=>LO(t,e,n),codeToTokens:(e,n)=>Ej(t,e,n),codeToHast:(e,n)=>Aj(t,e,n),codeToHtml:(e,n)=>Ij(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Rj(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,rO(n))return[];let r=t[n];if(!r)throw new gE(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(aO(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new gE(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Lj({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function zj(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Bj(e,t){let n=zj(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Vj=Rj({langs:RT,themes:zT,engine:()=>(0,hE.createOnigurumaEngine)(Y(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:Hj,codeToHast:Uj,codeToTokens:Wj,codeToTokensBase:Gj,codeToTokensWithThemes:Kj,getSingletonHighlighter:qj,getLastGrammarState:Jj}=Bj(Vj,{guessEmbeddedLanguages:QA}),Yj=4294967295,Xj=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Yj,end:Yj,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Zj(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Qj(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var $j=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),eM=String.raw;function tM(e,t){if(e==null)throw Error(t??`Value expected`);return e}var nM=eM`\[\^?`,rM=`c.? | C(?:-.?)?|${eM`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${eM`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${eM`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${eM`o\{[^\}]*\}?`}|${eM`\d{1,3}`}`,iM=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,aM=new RegExp(eM`
36
+ \\ (?:
37
+ ${rM}
38
+ | [gk]<[^>]*>?
39
+ | [gk]'[^']*'?
40
+ | .
41
+ )
42
+ | \( (?:
43
+ \? (?:
44
+ [:=!>({]
45
+ | <[=!]
46
+ | <[^>]*>
47
+ | '[^']*'
48
+ | ~\|?
49
+ | #(?:[^)\\]|\\.?)*
50
+ | [^:)]*[:)]
51
+ )?
52
+ | \*[^\)]*\)?
53
+ )?
54
+ | (?:${iM.source})+
55
+ | ${nM}
56
+ | .
57
+ `.replace(/\s+/g,``),`gsu`),oM=new RegExp(eM`
58
+ \\ (?:
59
+ ${rM}
60
+ | .
61
+ )
62
+ | \[:(?:\^?\p{Alpha}+|\^):\]
63
+ | ${nM}
64
+ | &&
65
+ | .
66
+ `.replace(/\s+/g,``),`gsu`);function sM(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=LM(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(aM.lastIndex=0;s=aM.exec(e);){let t=cM(a,e,s[0],aM.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(aM.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?zM(e,u):e).flat(),flags:r}}function cM(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=lM(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:pM(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:DM(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:mM(n)}}if(a===`K`)return{token:xM(`keep`,n)};if(a===`N`||a===`R`)return{token:bM(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:bM(`any`,n)};if(a===`X`)return{token:bM(`text_segment`,n)};let e=dM(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:MM(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:jM(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:wM(`group`,n)};if(n===`(?>`)return{token:wM(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:wM(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:wM(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:wM(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:CM(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
67
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:bM(`dot`,n)}:n===`^`||n===`$`?{token:pM(e.singleline?{"^":eM`\A`,$:eM`\Z`}[n]:n,n)}:n===`|`?{token:fM(n)}:iM.test(n)?{tokens:BM(n)}:{token:hM(Zj(n),n)}}function lM(e,t,n){let r=[yM(t[1]===`^`,t)],i=1,a;for(oM.lastIndex=n;a=oM.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(yM(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(hM(93,e));else if(i--,r.push(gM(e)),!i)break}else{let t=uM(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:oM.lastIndex||e.length}}function uM(e){if(e[0]===`\\`)return dM(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!$j.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return bM(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?_M(e):e===`&&`?vM(e):hM(Zj(e),e)}function dM(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return AM(e);if(`dDhHsSwW`.includes(n))return PM(e);if(e.startsWith(eM`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return FM(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return hM(Zj(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return hM(RM(e),e);if(kM.has(n))return hM(kM.get(n),e);if(/\d/.test(n))return SM(t,e);if(e===`\\`)throw Error(eM`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return hM(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function fM(e){return{type:`Alternator`,raw:e}}function pM(e,t){return{type:`Assertion`,kind:e,raw:t}}function mM(e){return{type:`Backreference`,raw:e}}function hM(e,t){return{type:`Character`,value:e,raw:t}}function gM(e){return{type:`CharacterClassClose`,raw:e}}function _M(e){return{type:`CharacterClassHyphen`,raw:e}}function vM(e){return{type:`CharacterClassIntersector`,raw:e}}function yM(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function bM(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function xM(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:tM(n.flags),raw:t}}function SM(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function CM(e){return{type:`GroupClose`,raw:e}}function wM(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function TM(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function EM(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function DM(e){return{type:`Subroutine`,raw:e}}var OM=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),kM=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function AM(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return hM(Zj(t.toUpperCase())-64,e)}function jM(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=IM(n),o=IM(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),xM(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,wM(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function MM(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=OM.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return TM(l,r??null,i?.split(`,`)??null,e)}function NM(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return EM(t,n,r,e)}function PM(e){let t=e[1].toLowerCase();return bM({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function FM(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return bM(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function IM(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function LM(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function RM(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function zM(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[mM(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(eM`Octal encoded byte above 177 unsupported "${n}"`)}else r=Zj(t);a.push(hM(r,(e===0?`\\`:``)+t))}return a}function BM(e){let t=[],n=new RegExp(iM,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(NM(e.slice(0,-1)));continue}}}t.push(NM(e))}return t}function VM(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function HM(e){return UM.has(e.type)}var UM=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function WM(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=sM(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return eN();case`Assertion`:return GM(n);case`Backreference`:return KM(n,a);case`Character`:return iN(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return qM(n,a,t);case`CharacterClassOpen`:return JM(n,a,t);case`CharacterSet`:return YM(n,a);case`Directive`:return cN(n.kind,{flags:n.flags});case`GroupOpen`:return XM(n,a,t);case`NamedCallout`:return fN(n.kind,n.tag,n.arguments);case`Quantifier`:return ZM(n,a);case`Subroutine`:return QM(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=hN(lN(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(eM`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(eM`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function GM({kind:e}){return tN(tM({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===eM`\B`||e===eM`\Y`})}function KM({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,nN(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return nN(r)}return i(+r)}function qM(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),oN(o,e);throw Error(`Invalid character class range`)}return iN(Zj(`-`))}function JM({negate:e},t,n){let{tokens:r,walk:i}=t,a=[aN()],o=r[t.nextIndex],s=EN(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(aN()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=EN(r[t.nextIndex],o)}let c=aN({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function YM({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=TN(n);if($j.has(r)&&!o?.has(r))e=`posix`,n=r;else return _N(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?pN(n,{negate:t}):sN(e,{negate:t})}function XM(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=vN(e),l=c.type===`AbsenceFunction`,u=SN(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Qj(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=DN(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(eN()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(xN(t)||t.type===`CapturingGroup`)throw Error(e)}else if(xN(t)||SN(t)&&t.negate)throw Error(e)}}f=DN(r[t.nextIndex])}return t.nextIndex++,c}function ZM({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!HM(a))throw Error(`Quantifier requires a repeatable token`);let o=mN(e,t,n,a);return i.body.pop(),o}function QM({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=gN(i);return r.push(o),o}function $M(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:yN(t?.body)}}function eN(e){return{type:`Alternative`,body:bN(e?.body)}}function tN(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function nN(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function rN(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!CN(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:yN(t?.body)}}function iN(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function aN(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:bN(e?.body)}}function oN(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function sN(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function cN(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:tM(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function lN(e){return{type:`Flags`,...e}}function uN(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:yN(e?.body)}}function dN(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:yN(e?.body)}}function fN(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function pN(e,t){let n=!!t?.negate;if(!$j.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function mN(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function hN(e,t){return{type:`Regex`,body:yN(t?.body),flags:e}}function gN(e){return{type:`Subroutine`,ref:e}}function _N(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(TN(e));if(!r){if(n.normalizeUnknownPropertyNames)r=wN(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(eM`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function vN({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return $M(`repeater`);case`atomic`:return uN({atomic:!0});case`capturing`:return rN(i,{name:n});case`group`:return uN({flags:e});case`lookahead`:case`lookbehind`:return dN({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function yN(e){if(e===void 0)e=[eN()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function bN(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function xN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function SN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function CN(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function wN(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function TN(e){return e.replace(/[- _]+/g,``).toLowerCase()}function EN(e,t){let n=t;return tM(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function DN(e){return tM(e,`Unclosed group`)}function ON(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){kN(c).splice(Math.max(0,AN(s)+l),1),l--,u=!0},removeAllNextSiblings(){return kN(c).splice(AN(s)+1)},removeAllPrevSiblings(){let e=AN(s)+l;return l-=e,kN(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,AN(s)+l)]=e:tM(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(kN(c).splice(Math.max(0,AN(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,AN(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function kN(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function AN(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var jN=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function MN(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function NN(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var PN=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function FN(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===PN.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?PN.CHAR_CLASS:PN.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function IN(e,t,n,r){FN(e,t,n,r)}function LN(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===PN.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function RN(e,t,n){return!!LN(e,t,0,n)}function zN(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var BN=new RegExp(String.raw`(?<noncapturingStart>${jN})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function VN(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(BN.lastIndex=Number.isNaN(c)?0:c+7;f=BN.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),MN(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=FN(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},PN.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var HN=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,UN=new RegExp(String.raw`
68
+ \\(?: \d+
69
+ | c[A-Za-z]
70
+ | [gk]<[^>]+>
71
+ | [pPu]\{[^\}]+\}
72
+ | u[A-Fa-f\d]{4}
73
+ | x[A-Fa-f\d]{2}
74
+ )
75
+ | \((?: \? (?: [:=!>]
76
+ | <(?:[=!]|[^>]+>)
77
+ | [A-Za-z\-]+:
78
+ | \(DEFINE\)
79
+ ))?
80
+ | (?<qBase>${HN})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
81
+ | \\?.
82
+ `.replace(/\s+/g,``),`gsu`);function WN(e){if(!RegExp(`${HN}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(UN.lastIndex=0;o=UN.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=NN(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}UN.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var GN=String.raw,KN=GN`\(\?R=(?<rDepth>[^\)]+)\)|${GN`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,qN=GN`\(\?<(?![=!])(?<captureName>[^>]+)>`,JN=GN`${qN}|(?<unnamed>\()(?!\?)`,YN=new RegExp(GN`${qN}|${KN}|\(\?|\\?.`,`gsu`),XN=`Cannot use multiple overlapping recursions`;function ZN(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(KN,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&RN(e,GN`\(\?\(DEFINE\)`,PN.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=RN(e,GN`\\[1-9]`,PN.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(YN.lastIndex=0;f=YN.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(QN(m),l)throw Error(XN);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(YN.lastIndex);if(RN(s,KN,PN.DEFAULT))throw Error(XN);let c=m-1;e=$N(t,s,c,!1,n,a,d),i=nP(i,t,c,a.length,0,d);break}if(h){QN(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(XN);break}if(!u)throw Error(GN`Recursive \g cannot be used outside the referenced group "${r===`external`?h:GN`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=zN(e,p);if(o&&RN(m,GN`${qN}|\((?!\?)`,PN.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=$N(_,v,b,!0,n,a,d);i=nP(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,YN.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),YN.lastIndex),s.set(p,YN.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),YN.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function QN(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function $N(e,t,n,r,i,a,o){let s=new Set;r&&IN(e+t,qN,({groups:{captureName:e}})=>{s.add(e)},PN.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${eP(`(?:${e}`,`forward`,...c)}(?:)${eP(`${t})`,`backward`,...c)}${t}`}function eP(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=FN(e,GN`${JN}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),tP(i,n),s?e:`(?<${t}${l}>`}return GN`\k<${c}${l}>`},PN.DEFAULT)}return c}function tP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function nP(e,t,n,r,i,a){if(e.size&&r){let o=0;IN(t,JN,()=>o++,PN.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var rP=String.fromCodePoint,Q=String.raw,iP={},aP=globalThis.RegExp;iP.flagGroups=(()=>{try{new aP(`(?i:)`)}catch{return!1}return!0})(),iP.unicodeSets=(()=>{try{new aP(`[[]]`,`v`)}catch{return!1}return!0})(),iP.bugFlagVLiteralHyphenIsRange=iP.unicodeSets?(()=>{try{new aP(Q`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,iP.bugNestedClassIgnoresNegation=iP.unicodeSets&&new aP(`[[^a]]`,`v`).test(`a`);function oP(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function sP(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function cP(e,t){return uP[e]>=uP[t]}function lP(e,t){if(e==null)throw Error(t??`Value expected`);return e}var uP={ES2025:2025,ES2024:2024,ES2018:2018},dP={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function fP(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!dP[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=iP.flagGroups?`ES2025`:iP.unicodeSets?`ES2024`:`ES2018`),t}var pP=`[ -\r ]`,mP=new Set([rP(304),rP(305)]),hP=Q`[\p{L}\p{M}\p{N}\p{Pc}]`;function gP(e){if(mP.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=bP.get(n),a=vP.get(n),o=yP.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var _P=new Map(`C Other
83
+ Cc Control cntrl
84
+ Cf Format
85
+ Cn Unassigned
86
+ Co Private_Use
87
+ Cs Surrogate
88
+ L Letter
89
+ LC Cased_Letter
90
+ Ll Lowercase_Letter
91
+ Lm Modifier_Letter
92
+ Lo Other_Letter
93
+ Lt Titlecase_Letter
94
+ Lu Uppercase_Letter
95
+ M Mark Combining_Mark
96
+ Mc Spacing_Mark
97
+ Me Enclosing_Mark
98
+ Mn Nonspacing_Mark
99
+ N Number
100
+ Nd Decimal_Number digit
101
+ Nl Letter_Number
102
+ No Other_Number
103
+ P Punctuation punct
104
+ Pc Connector_Punctuation
105
+ Pd Dash_Punctuation
106
+ Pe Close_Punctuation
107
+ Pf Final_Punctuation
108
+ Pi Initial_Punctuation
109
+ Po Other_Punctuation
110
+ Ps Open_Punctuation
111
+ S Symbol
112
+ Sc Currency_Symbol
113
+ Sk Modifier_Symbol
114
+ Sm Math_Symbol
115
+ So Other_Symbol
116
+ Z Separator
117
+ Zl Line_Separator
118
+ Zp Paragraph_Separator
119
+ Zs Space_Separator
120
+ ASCII
121
+ ASCII_Hex_Digit AHex
122
+ Alphabetic Alpha
123
+ Any
124
+ Assigned
125
+ Bidi_Control Bidi_C
126
+ Bidi_Mirrored Bidi_M
127
+ Case_Ignorable CI
128
+ Cased
129
+ Changes_When_Casefolded CWCF
130
+ Changes_When_Casemapped CWCM
131
+ Changes_When_Lowercased CWL
132
+ Changes_When_NFKC_Casefolded CWKCF
133
+ Changes_When_Titlecased CWT
134
+ Changes_When_Uppercased CWU
135
+ Dash
136
+ Default_Ignorable_Code_Point DI
137
+ Deprecated Dep
138
+ Diacritic Dia
139
+ Emoji
140
+ Emoji_Component EComp
141
+ Emoji_Modifier EMod
142
+ Emoji_Modifier_Base EBase
143
+ Emoji_Presentation EPres
144
+ Extended_Pictographic ExtPict
145
+ Extender Ext
146
+ Grapheme_Base Gr_Base
147
+ Grapheme_Extend Gr_Ext
148
+ Hex_Digit Hex
149
+ IDS_Binary_Operator IDSB
150
+ IDS_Trinary_Operator IDST
151
+ ID_Continue IDC
152
+ ID_Start IDS
153
+ Ideographic Ideo
154
+ Join_Control Join_C
155
+ Logical_Order_Exception LOE
156
+ Lowercase Lower
157
+ Math
158
+ Noncharacter_Code_Point NChar
159
+ Pattern_Syntax Pat_Syn
160
+ Pattern_White_Space Pat_WS
161
+ Quotation_Mark QMark
162
+ Radical
163
+ Regional_Indicator RI
164
+ Sentence_Terminal STerm
165
+ Soft_Dotted SD
166
+ Terminal_Punctuation Term
167
+ Unified_Ideograph UIdeo
168
+ Uppercase Upper
169
+ Variation_Selector VS
170
+ White_Space space
171
+ XID_Continue XIDC
172
+ XID_Start XIDS`.split(/\s/).map(e=>[TN(e),e])),vP=new Map([[`s`,rP(383)],[rP(383),`s`]]),yP=new Map([[rP(223),rP(7838)],[rP(107),rP(8490)],[rP(229),rP(8491)],[rP(969),rP(8486)]]),bP=new Map([CP(453),CP(456),CP(459),CP(498),...wP(8072,8079),...wP(8088,8095),...wP(8104,8111),CP(8124),CP(8140),CP(8188)]),xP=new Map([[`alnum`,Q`[\p{Alpha}\p{Nd}]`],[`alpha`,Q`\p{Alpha}`],[`ascii`,Q`\p{ASCII}`],[`blank`,Q`[\p{Zs}\t]`],[`cntrl`,Q`\p{Cc}`],[`digit`,Q`\p{Nd}`],[`graph`,Q`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Q`\p{Lower}`],[`print`,Q`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Q`[\p{P}\p{S}]`],[`space`,Q`\p{space}`],[`upper`,Q`\p{Upper}`],[`word`,Q`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Q`\p{AHex}`]]);function SP(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function CP(e){let t=rP(e);return[t.toLowerCase(),t]}function wP(e,t){return SP(e,t).map(e=>CP(e))}var TP=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function EP(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};AP(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:cP(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};ON(e,DP,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return ON(e,OP,a),ON(e,kP,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var DP={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=uN();e.body[0].body.push(dN({negate:!0,body:r}),_N(`Any`));let i=uN();i.body[0].body.push(mN(`greedy`,0,1/0,e)),n(YP(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];sP(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=LP(t.get(e));if(n){let t=uN({flags:n});t.body[0].body=e.body,e.body=[YP(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(YP(dN({body:[eN({body:[tN(`string_end`)]}),eN({body:[iN(10)]})]}),t));else if(c===`line_start`)o(YP(KP(Q`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&UP(e))o(YP(dN({negate:!0}),t));else if(d)throw Error(Q`Uses "\G" in a way that requires a subclass`);else o(JP(tN(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(YP(KP(Q`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${hP})(?!${hP})|(?<!${hP})(?=${hP}))`,n=`(?:(?<=${hP})(?=${hP})|(?<!${hP})(?!${hP}))`;o(YP(KP(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!GP(n)&&(n=IP(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!GP(r)&&(r=IP(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(YP(aN({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(JP(sN(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(YP(qP(KP(pP),l),t));return}if(s&&(c===`word`||u===`word`)){n(JP(sN(`word`,{negate:l}),t));return}if(c===`any`)n(JP(_N(`Any`),t));else if(c===`digit`)n(JP(_N(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Q`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Q`\p{RI}{2}|${e}(?:\u200D${e})*`;n(YP(KP(Q`(?>\r\n|${i?Q`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(JP(_N(`AHex`,{negate:l}),t));else if(c===`newline`)n(YP(KP(l?`[^
173
+ ]`:`(?>\r
174
+ ?|[
175
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${rP(e.codePointAt(0)-1)}${rP(e.codePointAt(2)+1)}-\u{10FFFF}`),n(YP(KP(`[${e}]`),t))}else n(YP(qP(KP(xP.get(u)),l),t))}else if(c===`property`)_P.has(TN(u))||(e.key=`sc`);else if(c===`space`)n(JP(_N(`space`,{negate:l}),t));else if(c===`word`)n(YP(qP(KP(hP),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=uN({flags:c});e.body[0].body=o(),i(YP(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&VM(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Q`Uses "\K" in a way that's unsupported`);let o=dN({behind:!0});o.body[0].body=a(),i(YP(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(YP(dN({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=uN();t.body[0].body.push(e.body),e.body=YP(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=BP(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Q`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!GP(n)&&(n=IP(n,t),e.ref=n)}},OP={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=JP(PP(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&sP(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=sP(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=oP(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?PP(0):NP(o,r.groupOriginByCopy,null),l=c;if(!s){let e=LP(FP(o,e=>e.type===`Group`&&!!e.flags)),t=e?oP(r.globalFlags,e):r.globalFlags;jP(t,r.currentFlags)||(l=uN({flags:RP(t)}),l.body[0].body.push(c))}n(YP(l,t),{traverse:!s})}},kP={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>MP(t,e));i.length?i.length>1?n(YP(uN({atomic:!0,body:i.reverse().map(e=>eN({body:[nN(e.number)]}))}),t)):e.ref=i[0].number:n(YP(dN({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=rN();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function AP(e){ON(e,{"*"({node:e,parent:t}){e.parent=t}})}function jP(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function MP(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=zP(n.parent);for(let r of t){if(r===n)break;if(r===e||VP(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function NP(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=NP(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function PP(e){let t=gN(e);return t.isRecursive=!0,t}function FP(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function IP(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function LP(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function RP({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function zP(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function BP(e){let t=e.find(e=>e.kind===`search_start`||WP(e,{negate:!1})||!HP(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=BP(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function VP(e,t){let n=zP(e)??[];for(let e of n)if(e===t||VP(e,t))return!0;return!1}function HP({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function UP(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function WP(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&VM(e.body[0],{type:`Assertion`,kind:`search_start`})}function GP(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function KP(e,t){let n=WM(e,{...t,unicodePropertyMap:_P}).body;return n.length>1||n[0].body.length>1?uN({body:n}):n[0].body[0]}function qP(e,t){return e.negate=t,e}function JP(e,t){return e.parent=t,e}function YP(e,t){return AP(e),e.parent=t,e}function XP(e,t){let n=fP(t),r=cP(n.target,`ES2024`),i=cP(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];ON(e,ZP,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!(!e.flags.ignoreCase&&!o||s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,lP(QP[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&sP(f._captureTransfers,e.transferTo,[]).push(t)}),f}var ZP={"*":{enter({node:e},t){if(uF(e)){let n=t.getCurrentModI();t.pushModI(e.flags?oP({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){uF(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){iF(rP(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),aF(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&TP.has(e.value)&&t.setHasCasedChar()}},QP={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Q`\B`:Q`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=rP(e),r=oF(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&iF(n)){let e=gP(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);iP.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(fF)&&(o=[iN(45),...o.filter(e=>!fF(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||iP.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=uN(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=eN({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(iP.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=oF(n,i),o=oF(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&sF(aF(e)).forEach(e=>{s.add(Array.isArray(e)?`${oF(e[0],i)}-${oF(e[1],i)}`:oF(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Q`[^\n]`;if(e===`digit`)return t?Q`\D`:Q`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&TP.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Q`\P`:Q`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Q`\W`:Q`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=oP(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${cF(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+lF(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Q`\g<${t}&R=${r}>`}},$P=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),eF=new Set([`-`,`\\`,`]`,`^`,`[`]),tF=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),nF=new Map([[9,Q`\t`],[10,Q`\n`],[11,Q`\v`],[12,Q`\f`],[13,Q`\r`],[8232,Q`\u2028`],[8233,Q`\u2029`],[65279,Q`\uFEFF`]]),rF=/^\p{Cased}$/u;function iF(e){return rF.test(e)}function aF(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=rP(e);if(!iF(t))continue;let o=gP(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function oF(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(nF.has(e))return nF.get(e);if(e<32||e>126&&e<160||e>262143||t&&dF(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?tF:eF:$P,a=rP(e);return(i.has(a)?`\\`:``)+a}function sF(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function cF(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function lF({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function uF({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function dF(e){return e>47&&e<58}function fF({type:e,value:t}){return e===`Character`&&t===45}var pF=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=hF(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(mF(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=gF(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function mF(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function hF(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)sP(n,t,{}).transferTo=e;return n}function gF(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function _F(e,t){let n=vF(e,t);return n.options?new pF(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function vF(e,t){let n=fP(t),r=EP(WM(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:_P}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=XP(r,n),a=ZN(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=VN(WN(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function yF(e,t){return _F(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function bF(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>yF(e,{target:t.target}),{createScanner(e){return new Xj(e,t)},createString(e){return{content:e}}}}async function xF(e){if(wT())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=aT.get(e);if(t!=null)return t;try{let t=oT.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(RT,e)&&(t=RT[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return iT.has(e)||iT.set(e,n),n});return aT.set(e,n),await n}finally{aT.delete(e)}}function SF(e){return iT.get(e)??xF(e)}function CF(e){for(let t of lT(e))if(!uT.has(t))return!1;return!0}function wF({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:TF(t)}}function TF(e){return async()=>dO(gT(await e()))}var EF=`pierre`,DF=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],OF=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],kF=[...OF,...DF],AF=new Set(OF);function jF(e){return AF.has(e)?`light`:`dark`}var MF={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},NF={"pierre-dark":()=>Y(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>Y(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>Y(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>Y(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>Y(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>Y(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>Y(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>Y(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>Y(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>Y(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function PF(e){return wF({name:e,collection:EF,colorScheme:jF(e),displayName:MF[e],load:NF[e]})}var FF=dT({themes:kF.map(e=>PF(e))}),IF=`shiki`,LF=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],RF=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),zF=new Set(LF);function BF(e){return zF.has(e)?`light`:`dark`}var VF={andromeeda:()=>Y(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>Y(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>Y(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>Y(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>Y(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>Y(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>Y(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>Y(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>Y(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>Y(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>Y(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>Y(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>Y(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>Y(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>Y(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>Y(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>Y(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>Y(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>Y(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>Y(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>Y(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>Y(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>Y(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>Y(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>Y(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>Y(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>Y(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>Y(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>Y(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>Y(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>Y(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>Y(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>Y(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>Y(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>Y(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>Y(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>Y(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>Y(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>Y(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>Y(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>Y(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>Y(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>Y(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>Y(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>Y(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>Y(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>Y(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>Y(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>Y(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>Y(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>Y(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>Y(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>Y(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>Y(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>Y(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>Y(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>Y(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>Y(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>Y(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>Y(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>Y(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>Y(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>Y(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>Y(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>Y(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function HF(e){return wF({name:e,collection:IF,colorScheme:BF(e),load:VF[e]})}var UF=dT({themes:Object.freeze([...LF.map(e=>HF(e)),...RF.map(e=>HF(e))])});function WF(e){if(wT())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(xT.hasRegisteredTheme(e))return;let t=UF.getTheme(e);if(t!=null){xT.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function GF(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function KF(e){WF(e);let t=await xT.resolveTheme(e);return GF(e,t),t}function qF(e){return xT.getResolvedTheme(e)??KF(e)}var JF;async function YF({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){JF??=Vj({themes:[],langs:[`text`],engine:n===`shiki-wasm`?mE(Y(()=>import(`./wasm-BnjxR4X6.js`),[])):bF()});let r=ZF(JF)?await JF:JF;JF=r;let i=[];for(let e of Array.from(new Set(t))){if(e===`text`||e===`ansi`)continue;let t=SF(e);`then`in t?i.push(t):CT(t,r)}let a=[];for(let t of e){let e=qF(t);`then`in e?a.push(e):ST(e,JF)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{CT(e,r)}),Promise.all(a).then(e=>{ST(e,r)})]),r}function XF(e){if(!(JF==null||`then`in JF)&&(e==null||CF(e.theme)&&cT(e.lang)))return JF}function ZF(e=JF){return e!=null&&`then`in e}for(let e of FF.getThemes())xT.registerThemeIfAbsent(e.name,e.load);function QF(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function $F(e){return xT.hasResolvedThemes(e)}function eI(e,t){return QF(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}var tI=new Map,nI={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function rI(e){if(tI.has(e))return tI.get(e)??`text`;if(nI[e]!=null)return nI[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(tI.has(t[1]))return tI.get(t[1])??`text`;if(nI[t[1]]!=null)return nI[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return tI.has(n)?tI.get(n)??`text`:nI[n]??`text`}function iI(e){return(e.lang??rI(e.name))===`text`}var aI=10,oI=13,sI=4,cI=40;function lI(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
176
+ `),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
177
+ `,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
178
+ `,o)),t.push(o),++a===sI){if(o-i<=cI){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===aI||r===oI)&&(r===oI&&n+1<e.length&&e.charCodeAt(n+1)===aI&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function uI(e){let t=lI(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}function dI(e,t){for(let n of t)e.push(n)}function fI(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function pI({name:e,width:t=16,height:n=16,properties:r}){return $({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[$({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function mI(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function hI(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function gI(e,t,n,r={}){return $({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[$({tagName:`span`,properties:{"data-line-number-content":``},children:[fI(`${t}`)]})]})}function _I(e,t,n){return $({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function vI(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(fI(`
179
+ `)),e}var yI=Symbol(`no-token`),bI=Symbol(`multiple-tokens`);function xI(e){let t=SI(e);if(t!=null)return t;let n=yI,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){wI(e,a);for(let t of e.children)CI(t)}else CI(e);r.push(e),i=[],a=void 0;return}for(let e of i)CI(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==yI){if(e===bI){n=bI;return}if(n===yI){n=e;return}n!==e&&(n=bI)}};for(let t of e.children){let e=t.type===`element`?xI(t):yI;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function SI(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function CI(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)CI(t)}}function wI(e,t){e.properties[`data-char`]=t}function TI(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+EI(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function EI(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function DI(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=mI(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&xI(a),i.push(vI(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(kI,OI),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:OI}}var OI=TI({classPrefix:`hl-`}),kI={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function AI(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var jI=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,MI=/^0(?:\.0+)?%?$/;function NI(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function PI(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function FI(e){if(e==null)return null;let t=PI(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function II(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||jI.test(t))return!0;let n=NI(t);return n!=null&&MI.test(n)}function LI(e,t,n){if(t==null||n==null)return!1;let r=FI(e),i=FI(t),a=FI(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var RI=new WeakMap;function zI(e){let t=RI.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;BI(r,`editor.background`,i),BI(r,`editor.foreground`,a),BI(r,`sideBar.background`,o),BI(r,`sideBar.foreground`,s),BI(r,`input.background`,n[`input.background`]??o),BI(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),BI(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),BI(r,`gitDecoration.addedResourceForeground`,VI(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),BI(r,`gitDecoration.modifiedResourceForeground`,VI(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),BI(r,`gitDecoration.deletedResourceForeground`,VI(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(II(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(II(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(HI(l,o)||LI(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return RI.set(e,u),u}function BI(e,t,n){n!=null&&n!==``&&(e[t]=n)}function VI(...e){for(let t of e)if(t!=null&&t!==``)return t}function HI(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function UI({theme:e=zw,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=zI(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${AI(`global`)}fg:${a.fg};`,r+=`${AI(`global`)}bg:${a.bg};`,r+=WI(i,n)}else{let n=t.getTheme(e.dark),i=zI(n);r+=`${AI(`global`)}dark:${i.fg};`,r+=`${AI(`global`)}dark-bg:${i.bg};`,r+=WI(n,`dark`),n=t.getTheme(e.light),i=zI(n),r+=`${AI(`global`)}light:${i.fg};`,r+=`${AI(`global`)}light-bg:${i.bg};`,r+=WI(n,`light`)}return r}function WI(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${AI(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${AI(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${AI(`global`)}${t}modified-color:${a};`),n}function GI(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}var KI={forcePlainText:!1};function qI(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=KI){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=DI(i),f=a?`text`:e.lang??rI(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=UI({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:AI(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:AI(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=GI(t.codeToHast(JI(l?YI(c??uI(e.contents),o,s):e.contents),h)),_=l?Array(o):g;return l&&dI(_,g),{code:_,themeStyles:m,baseThemeType:p}}function JI(e){return e.replace(/\r(?!\n)/g,`
180
+ `)}function YI(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}function XI(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function ZI(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function QI(e,t){return QF(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function $I(e){let t=e.lang??rI(e.name),n=e.lang??(e.prevName==null?`text`:rI(e.prevName));return t===`text`&&n===`text`}function eL(e){return{...Gw,...e}}function tL(e,t){let n=nL(e,t);return t?n:e.diffHeaderHeight+n}function nL(e,t){return e.paddingTop??(t?e.spacing:0)}function rL(e){return e.paddingBottom??e.spacing}function iL(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function aL(e){return[Zw(e.additionStart,e.additionCount)+1,Qw(e.additionStart,e.additionCount)+1]}function oL({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function sL(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-Qw(t.additionStart,t.additionCount),r=e.deletionLines.length-Qw(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function cL({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-Qw(n.additionStart,n.additionCount),i=e.deletionLines.length-Qw(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function lL({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=cL({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function uL({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=aL(a);if(t<o){let s=oL({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=lL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=aL(a);return t<o+i.fromStart||t>=o+i.rangeSize}function dL({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=aL(n),l=oL({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=lL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function fL({type:e,metrics:t}){return t.hunkSeparatorHeight??iL(e)}function pL({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function mL({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function hL(e){return e!==`simple`&&e!==`metadata`}function gL({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!mL({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=fL({type:e,metrics:t}),a=pL({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function _L({type:e,metrics:t}){if(!hL(e))return;let n=fL({type:e,metrics:t}),r=pL({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function vL({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=yL({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Zw(r.deletionStart,r.deletionCount),s=Zw(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=oL({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?lL({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(SL(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,SL(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(SL(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=CL(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(wL({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(SL(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function yL({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=bL({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function bL({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=oL({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?lL({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function xL(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function SL(e,t,n,r,i,a){let[o,s]=xL(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function CL(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function wL({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}function TL(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var EL=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},DL=new class extends EL{};function OL(e,t,n){return DL.diff(e,t,n)}function kL(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function AL(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function jL(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function ML(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function NL(e,t){return jL(e,t,``)}function PL(e,t){return ML(e,t,``)}function FL(e,t){return t.slice(0,IL(e,t))}function IL(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function LL(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function RL(e,t){if(t)return BL(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function zL(e,t){if(t)return BL(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function BL(e,t){if(!t)return[zL(e),RL(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=LL(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var VL=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,HL=RegExp(`[${VL}]+|\\s+|[^${VL}]`,`ug`);new class extends EL{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=LL(e,r)}else n=e.match(HL)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&UL(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&UL(n,i,r,null,t.intlSegmenter),e}};function UL(e,t,n,r,i){if(t&&n){let[a,o]=BL(t.value,i),[s,c]=BL(n.value,i);if(e){let r=kL(a,s);e.value=ML(e.value,s,r),t.value=NL(t.value,r),n.value=NL(n.value,r)}if(r){let e=AL(o,c);r.value=jL(r.value,c,e),t.value=PL(t.value,e),n.value=PL(n.value,e)}}else if(n){if(e){let e=zL(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=zL(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=zL(r.value,i),[a,o]=BL(t.value,i),s=kL(n,a);t.value=NL(t.value,s);let c=AL(NL(n,s),o);t.value=PL(t.value,c),r.value=jL(r.value,n,c),e.value=ML(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=zL(r.value,i),n=FL(RL(t.value,i),e);t.value=PL(t.value,n)}else if(e){let n=FL(RL(e.value,i),zL(t.value,i));t.value=NL(t.value,n)}}var WL=new class extends EL{tokenize(e){let t=RegExp(`(\\r?\\n)|[${VL}]+|[^\\S\\n\\r]+|[^${VL}]`,`ug`);return e.match(t)||[]}};function GL(e,t,n){return WL.diff(e,t,n)}var KL=new class extends EL{constructor(){super(...arguments),this.tokenize=JL}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
181
+ `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
182
+ `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
183
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
184
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function qL(e,t,n){return KL.diff(e,t,n)}function JL(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
185
+ `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function YL(e){return e==`.`||e==`!`||e==`?`}new class extends EL{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(YL(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends EL{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends EL{constructor(){super(...arguments),this.tokenize=JL}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(XL(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function XL(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=XL(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=XL(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends EL{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function ZL(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function QL(e){if(!ZL(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var $L={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function eR(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;qL(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(qL(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||rR(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
186
+ `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function tR(e,t){if(t||=$L,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>tR(e,t)).join(`
187
+ `)}let n=[];if(e.isGit){if(t=$L,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+QL(r)+` `+QL(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+QL((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+QL((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+QL((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+QL((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+QL(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+QL(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
188
+ `)+`
189
+ `}function nR(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;eR(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?tR(e,o.headerOptions):void 0)}}))}else{let s=eR(e,t,n,r,i,a,o);return s?tR(s,o?.headerOptions):void 0}}function rR(e){let t=e.endsWith(`
190
+ `),n=e.split(`
191
+ `).map(e=>e+`
192
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function iR({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function aR({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}var oR={forcePlainText:!1};function sR(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=oR){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=UI({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??lR();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}vL({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&cR({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=uR({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else dI(f.deletionLines,s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else dI(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function cR({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=TL(e),t=TL(t),e.length>s||t.length>s))return;let c=o===`char`?OL(e,t):GL(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(aR({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),aR({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?aR({item:e,arr:l,enableJoin:d,isLastItem:t}):aR({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(iR({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(iR({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function lR(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function uR({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??rI(e.name),d=s??rI(t.name),{state:f,transformers:p}=DI(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:AI(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:AI(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,GI(i.codeToHast(TL(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,GI(i.codeToHast(TL(t.contents),m)))}}var dR=(0,q.createContext)(void 0);function fR(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function pR(e,t){let n=e?.theme??zw,r=t?.theme??zw,i=mR(e),a=mR(t);return QF(n,r)&&fR(e,t,[`theme`,`parseDiffOptions`])&&fR(i,a)}function mR(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var hR=new Set,gR=null;function _R(e){hR.add(e),gR??=requestAnimationFrame(yR)}function vR(e){hR.delete(e)&&hR.size===0&&gR!=null&&(cancelAnimationFrame(gR),gR=null)}function yR(e){let t=new Set(hR);hR.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}gR=hR.size>0?requestAnimationFrame(yR):null}function bR(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function xR(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function SR(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var CR=`-1,-1`;function wR(e){return e?.some(e=>e.lineNumber===0)??!1}function TR(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function ER(e){return e.startingLine===0&&e.totalLines>0}function DR(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function OR(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[pI({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function kR(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var AR=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),vR(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||bR(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&kR(e.composedPath())||(XR(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(XR(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(XR(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){XR(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();XR(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);XR(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=FR(i)&&this.hoveredLine?.lineElement===i.lineElement;PR(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),PR(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),FR(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(LR(i)&&p!=null){p(i);break}if(IR(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!FR(i))break;PR(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,XR(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),XR(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),XR(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();kR(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(DR(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=VA(OR());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);NR(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(BR(t));if(NR(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(NR(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(NR(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&kR(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=BR(e);if(t&&kR(n))return;let r=VR(e);return r==null?this.pathFromAnnotationSlot(e):BR(r)}pathFromAnnotationSlot(e){let t=HR(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return BR(t);let n=WR(UR(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:BR(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=GR(t)?t:GR(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}bR(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,_R(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{vR(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!qR(this.renderedSelectedLinesState,n),i=!qR(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);RR(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=YR(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=YR(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:zR(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:zR(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:JR(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:JR(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function jR({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:MR({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function MR({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function NR(e){return e!=null&&`kind`in e&&e.kind===`line`}function PR(e){return e!=null&&`kind`in e&&e.kind===`token`}function FR(e){return NR(e)||PR(e)}function IR(e){return`type`in e&&e.type===`line-info`}function LR(e){return`kind`in e&&e.kind===`merge-conflict-action`}function RR(e){return e===`current`||e===`incoming`||e===`both`}function zR(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function BR(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function VR(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function HR(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function UR(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function WR(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function GR(e){return e!=null&&typeof e.elementFromPoint==`function`}function KR(e,t){return e===t||bR(e??void 0,t??void 0)}function qR(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&KR(e?.range??null,t.range)}function JR(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function YR(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function XR(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var ZR=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),ez(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?rz(t):iz(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:QR(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:$R(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&tz(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function QR(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function $R(e){return Math.max(Math.ceil(e),0)}function ez(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?tz(e,{codeWidthChanged:!0,numberWidthChanged:!0}):nz(e))}function tz(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function nz(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function rz(e){e.codeElement.isConnected&&nz(e)}function iz(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function az(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function oz(e,t){return e.endsWith(`\r
193
+ `)?t+`\r
194
+ `:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
195
+ `)?t+`
196
+ `:t}function sz(e){return $({tagName:`div`,children:[$({tagName:`div`,children:e.annotations?.map(e=>$({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function cz(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function lz(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function uz({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return $({tagName:`div`,children:[t===`custom`?$({tagName:`slot`,properties:{name:Rw}}):dz({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[fz(r)]],properties:i})}function dz({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:Fw}}),pI({name:lz(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[fI(t)]})],properties:{"data-prev-name":``}})),r.push(pI({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[fI(e)]})],properties:{"data-title":``}})),r.push($({tagName:`slot`,properties:{name:Iw}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function fz(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push($({tagName:`span`,children:[fI(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[fI(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:Lw}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function pz(e){return $({tagName:`pre`,properties:mz(e)})}function mz({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function hz(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:Array.isArray(e)?e:[e??`text`],themes:lT(t),preferredHighlighter:n}}function gz(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function _z(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var vz=-1,yz=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`file-renderer:${++vz}`;highlighter;file;renderCache;pendingHighlightResult;computedLang=`text`;lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;get fileCache(){return this.renderCache?.file}constructor(e={theme:zw},t=Yw,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=CF(e.theme??zw)?XF():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(e,t){let{editSessionActive:n,renderCache:r}=this;if(this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.file=e,r==null||n&&r.file===e)return;let{options:i}=this.getRenderOptions(e),a=r.file===e,o=t!=null&&SR(r.file,t),{result:s}=r;if(!r.highlighted||s==null||!eI(r.options,i)||!a&&!o){this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;return}if(a)return;this.renderCache={...r,file:e,result:{...s,code:[...s.code]}};let{lineCache:c}=this;this.lineCache=c!=null&&t!=null&&_z(c,t)?{cacheKey:void 0,file:e,sourceContents:e.contents,lines:c.lines}:void 0}endEditSession(e){this.editSessionActive=!1,this.pendingHighlightResult=void 0;let{renderCache:t}=this;e!=null&&t!=null&&t.file!==e&&SR(t.file,e)&&(t.file=e)}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.file=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}clearRenderCache(){this.pendingStructuralRows=void 0,this.renderCache=void 0,this.pendingHighlightResult=void 0}hydrate(e){this.file=e;let{options:t}=this.getRenderOptions(e),n=bz(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!eI(t,r.options)&&(r=void 0),this.renderCache??={file:e,hydrated:!0,options:t,highlighted:!n&&!iI(e),result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??rI(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??zw}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getFileRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{tokenizeMaxLineLength:e=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:e}})(),{renderCache:n}=this;return n?.result==null||!SR(e,n.file)||!eI(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getFileForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null)return e;let{renderCache:n}=this;if(n==null)return e;if(SR(n.file,e))return n.file;let r=uI(e.contents),i=e.contents.length===0||iI(e)||bz(r.length,this.getTokenizeMaxLength());return this.canRenderFile(e,t,i)?e:n.file}canRenderFile(e,t,n){let{renderCache:r}=this;return r==null||SR(r.file,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&CF(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&CF(t.theme)}getOrCreateLineCache(e){let{lineCache:t}=this;return(t==null||!_z(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:uI(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){let t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return;let{file:i,result:a}=r;if(a==null)return;let o=n?new Map:void 0;this.pendingStructuralRows=o;let s=this.lineCache!=null&&_z(this.lineCache,i)?this.lineCache:void 0;for(let[t,n]of e){if(o==null&&s!=null&&t<s.lines.length){let e=n.map(e=>e[2]).join(``);s.lines[t]=oz(s.lines[t]??``,e)}let e={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};o==null?a.code[t]=e:o.set(t,e)}a.baseThemeType=t,r.isDirty=!0,o==null&&s!=null&&(i.contents=s.lines.join(``),s.sourceContents=i.contents)}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;if(this.pendingStructuralRows=void 0,n==null)return;let{file:r,result:i}=n;if(i==null)return;let a=this.lineCache!=null&&_z(this.lineCache,r)?this.lineCache.lines:uI(r.contents),o=uI(e.getText());if(a.length!==o.length){let r=Math.min(a.length,o.length),s=0;for(;s<r&&a[s]===o[s];)s++;let c=0;for(;c<r-s&&a[a.length-1-c]===o[o.length-1-c];)c++;let l=i.code;i.code=Array(o.length);for(let e=0;e<s;e++)i.code[e]=l[e];for(let e=0;e<c;e++)i.code[o.length-1-e]=l[a.length-1-e];if(t!==void 0)for(let[e,n]of t)e<o.length&&(i.code[e]=n);for(let t=s;t<o.length-c;t++)i.code[t]??={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:e.getLineText(t)}]}]};for(let e=0;e<i.code.length;e++){let t=i.code[e];t?.type===`element`&&(t.properties[`data-line`]=e+1,t.properties[`data-line-index`]=e)}n.isDirty=!0}this.lineCache={cacheKey:r.cacheKey,file:r,sourceContents:r.contents,lines:o},this.textDocumentCache.set(r,e),r.contents=e.getText()}renderFile(e=this.file,t=qw){if(this.file=e,e==null){this.pendingHighlightResult=void 0;return}let{options:n,forceHighlight:r}=this.getRenderOptions(e),i=this.getReadyRenderResult(e,n);this.pendingHighlightResult=void 0,i!=null&&(this.renderCache={...i,file:e,renderRange:void 0},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let a=this.getOrCreateLineCache(e),o=e.contents.length>0,s=!o||iI(e)||bz(a.length,this.getTokenizeMaxLength()),c=this.canRenderFile(e,n,s),l=!SR(e,this.renderCache.file),u=!az(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let i=this.renderCache.result==null&&this.renderCache.highlighted&&!s&&!l&&gz(t);c&&!i&&(s||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e)}else{this.computedLang=e.lang??rI(e.name),this.highlighter??=XF();let t=this.highlighter!=null&&CF(n.theme),i=this.highlighter!=null&&cT(this.computedLang),a=!s&&i;if(c&&this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=qw){this.file=e;let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=bz(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??rI(e.name);let n=this.highlighter!=null&&$F(lT(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&cT(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:qI(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let a=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,s=[],c=hI(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=ER(t)?TR(this.lineAnnotations):void 0;d!=null&&(c.children.push(_I(`context`,`annotation`,1)),s.push(sz({type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:d.map(e=>this.annotationSlotName(e))})),u++);for(let r=t.startingLine;r<l;r++){let t=r+1,i=n[r];if(i==null){let n=`FileRenderer.processFileResult: Line doesnt exist`;throw console.error(n,{name:e.name,lineIndex:r,lineNumber:t}),Error(n)}c.children.push(gI(`context`,t,`${r}`)),s.push(i),u++;let a=this.lineAnnotations[t];a!=null&&(c.children.push(_I(`context`,`annotation`,1)),s.push(sz({type:`annotation`,hunkIndex:0,lineIndex:t,annotations:a.map(e=>this.annotationSlotName(e))})),u++)}return c.properties.style=`grid-row: span ${u}`,{file:e,gutterAST:c.children??[],contentAST:s,preAST:this.createPreElement(a),headerAST:o?void 0:this.renderHeader(e),totalLines:a,rowCount:u,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return uz({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return VA(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push($({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=hI();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,cz(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return VA(t?$({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await YF(hz(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{file:i,renderCache:a}=this;i!=null&&a!=null&&SR(e,i)&&eI(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&eI(a.options,n)&&SR(a.file,i)||(this.pendingHighlightResult={file:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getFileResultCache(e);if(n!=null&&eI(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&SR(n.file,e)&&eI(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{file:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&SR(e,n.file)&&eI(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return pz({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function bz(e,t){return e>t}var xz=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
197
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
198
+ <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
199
+ </symbol>
200
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
201
+ <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
202
+ </symbol>
203
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
204
+ <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
205
+ </symbol>
206
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
207
+ <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
208
+ </symbol>
209
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
210
+ <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
211
+ </symbol>
212
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
213
+ <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
214
+ </symbol>
215
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
216
+ <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
217
+ </symbol>
218
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
219
+ <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
220
+ </symbol>
221
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
222
+ <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
223
+ </symbol>
224
+ <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
225
+ <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
226
+ </symbol>
227
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
228
+ <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
229
+ </symbol>
230
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
231
+ <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
232
+ </symbol>
233
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
234
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
235
+ </symbol>
236
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
237
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
238
+ </symbol>
239
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
240
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
241
+ </symbol>
242
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
243
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
244
+ </symbol>
245
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
246
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
247
+ </symbol>
248
+ </svg>`;function Sz(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function Cz(e,t){return e==null||t==null?e===t:Tz(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var wz={};function Tz(e=wz,t=wz){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function Ez(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Dz(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function Oz(){let e=document.createElement(`style`);return e.setAttribute(Vw,``),e}var kz;function Az(e){if(kz!=null)return kz;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(Hw,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),kz=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),kz}function jz(e){return`${Uw}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var Mz=`@layer base {
249
+ :host {
250
+ --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
251
+ "Courier New", monospace;
252
+ --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
253
+ "Noto Sans", "Liberation Sans", Arial, sans-serif;
254
+ --diffs-mixer: light-dark(#000, #fff);
255
+ --diffs-gap-fallback: 8px;
256
+ --diffs-scrollbar-gutter-fallback: 6px;
257
+ --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
258
+ --diffs-added-light: #0dbe4e;
259
+ --diffs-added-dark: #5ecc71;
260
+ --diffs-modified-light: #009fff;
261
+ --diffs-modified-dark: #69b1ff;
262
+ --diffs-deleted-light: #ff2e3f;
263
+ --diffs-deleted-dark: #ff6762;
264
+ --diffs-warning-light: #d5a910;
265
+ --diffs-warning-dark: #ffd452;
266
+ color-scheme: light dark;
267
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
268
+ font-size: var(--diffs-font-size, 13px);
269
+ line-height: var(--diffs-line-height, 20px);
270
+ font-feature-settings: var(--diffs-font-features);
271
+ --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
272
+ --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
273
+ --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
274
+ --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
275
+ --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
276
+ --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
277
+ --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
278
+ --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
279
+ --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
280
+ --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
281
+ --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
282
+ --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
283
+ --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
284
+ --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
285
+ --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
286
+ --diffs-selection-base: var(--diffs-modified-base);
287
+ --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
288
+ background-color: var(--diffs-bg);
289
+ color: var(--diffs-fg);
290
+ display: block;
291
+ }
292
+
293
+ pre, code, [data-error-wrapper] {
294
+ isolation: isolate;
295
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
296
+ outline: none;
297
+ margin: 0;
298
+ padding: 0;
299
+ display: block;
300
+ }
301
+
302
+ pre, code {
303
+ background-color: var(--diffs-bg);
304
+ }
305
+
306
+ code {
307
+ contain: content;
308
+ }
309
+
310
+ input, button {
311
+ font-family: inherit;
312
+ font-size: inherit;
313
+ line-height: inherit;
314
+ }
315
+
316
+ *, :before, :after {
317
+ box-sizing: border-box;
318
+ }
319
+
320
+ [data-icon-sprite] {
321
+ display: none;
322
+ }
323
+
324
+ [data-diffs-header], [data-separator] {
325
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
326
+ }
327
+
328
+ [data-diffs-header][data-sticky] {
329
+ z-index: 1;
330
+ background-color: var(--diffs-bg);
331
+ position: sticky;
332
+ top: 0;
333
+ }
334
+
335
+ [data-file-info] {
336
+ color: var(--fg);
337
+ background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
338
+ border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
339
+ padding: 10px;
340
+ font-weight: 700;
341
+ }
342
+
343
+ [data-diff], [data-file] {
344
+ --diffs-grid-number-column-width: minmax(min-content, max-content);
345
+ --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
346
+
347
+ &[data-dehydrated] {
348
+ --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
349
+ }
350
+
351
+ &:hover [data-code]::-webkit-scrollbar-thumb {
352
+ background-color: var(--diffs-bg-context);
353
+ }
354
+ }
355
+
356
+ @supports (-webkit-touch-callout: none) {
357
+ :host {
358
+ --diffs-scrollbar-gutter-fallback: 0px;
359
+ }
360
+ }
361
+
362
+ [data-line] span, [data-edit-prediction-suffix] span {
363
+ color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
364
+ background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
365
+ font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
366
+ font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
367
+ text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
368
+ }
369
+
370
+ [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
371
+ --diffs-computed-decoration-bg: var(--diffs-bg);
372
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
373
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
374
+ --diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
375
+ --diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
376
+ --diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
377
+ --diffs-line-bg: var(--diffs-computed-hovered-line-bg);
378
+ color: var(--diffs-fg);
379
+ background-color: var(--diffs-line-bg, var(--diffs-bg));
380
+ }
381
+
382
+ [data-line], [data-no-newline] {
383
+ &[data-decoration-bg] {
384
+ --mix-deco-light: 92%;
385
+ --mix-deco-dark: 85%;
386
+
387
+ &[data-decoration-bg-depth="2"] {
388
+ --mix-deco-light: 88%;
389
+ --mix-deco-dark: 80%;
390
+ }
391
+
392
+ &[data-decoration-bg-depth="3"] {
393
+ --mix-deco-light: 85%;
394
+ --mix-deco-dark: 78%;
395
+ }
396
+
397
+ --diffs-hover-mix-target: var(--diffs-decoration-bg);
398
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
399
+ var(--diffs-bg) var(--mix-deco-light),
400
+ var(--diffs-decoration-bg)), color-mix(in lab,
401
+ var(--diffs-bg) var(--mix-deco-dark),
402
+ var(--diffs-decoration-bg)));
403
+ }
404
+ }
405
+
406
+ [data-line-annotation], [data-gutter-buffer="annotation"] {
407
+ --diffs-annotation-bg: var(--diffs-bg-context);
408
+ --diffs-computed-decoration-bg: var(--diffs-annotation-bg);
409
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
410
+ }
411
+
412
+ [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
413
+ --diffs-computed-decoration-bg: var(--diffs-bg-context);
414
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
415
+ }
416
+
417
+ [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
418
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
419
+ var(--diffs-bg) 78%,
420
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
421
+ var(--diffs-bg) 68%,
422
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
423
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
424
+ }
425
+
426
+ [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
427
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
428
+ var(--diffs-bg) 78%,
429
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
430
+ var(--diffs-bg) 68%,
431
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
432
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
433
+ }
434
+
435
+ [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
436
+ --diffs-computed-decoration-bg: var(--diffs-bg);
437
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
438
+ }
439
+
440
+ :where([data-background]) {
441
+ & [data-gutter-buffer], & [data-column-number] {
442
+ --mix-light: 91%;
443
+ --mix-dark: 85%;
444
+ }
445
+
446
+ & [data-line], & [data-no-newline] {
447
+ --mix-light: 88%;
448
+ --mix-dark: 80%;
449
+ }
450
+
451
+ & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
452
+ --diffs-diff-line-mix-target: var(--diffs-bg);
453
+
454
+ &[data-line-type="change-deletion"] {
455
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
456
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
457
+
458
+ &:where([data-gutter-buffer], [data-column-number]) {
459
+ color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
460
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
461
+ }
462
+
463
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
464
+ var(--diffs-computed-decoration-bg) var(--mix-light),
465
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
466
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
467
+ var(--diffs-diff-line-mix-target)));
468
+ }
469
+
470
+ &[data-line-type="change-addition"] {
471
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
472
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
473
+
474
+ &:where([data-gutter-buffer], [data-column-number]) {
475
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
476
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
477
+ }
478
+
479
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
480
+ var(--diffs-computed-decoration-bg) var(--mix-light),
481
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
482
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
483
+ var(--diffs-diff-line-mix-target)));
484
+ }
485
+
486
+ &[data-merge-conflict="current"] {
487
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
488
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
489
+
490
+ &:where([data-gutter-buffer], [data-column-number]) {
491
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
492
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
493
+ }
494
+
495
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
496
+ var(--diffs-computed-decoration-bg) var(--mix-light),
497
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
498
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
499
+ var(--diffs-diff-line-mix-target)));
500
+ }
501
+
502
+ &[data-merge-conflict="incoming"] {
503
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
504
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
505
+
506
+ &:where([data-gutter-buffer], [data-column-number]) {
507
+ color: var(--diffs-modified-base);
508
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
509
+ }
510
+
511
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
512
+ var(--diffs-computed-decoration-bg) var(--mix-light),
513
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
514
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
515
+ var(--diffs-diff-line-mix-target)));
516
+ }
517
+ }
518
+ }
519
+
520
+ [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
521
+ --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
522
+ --diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
523
+
524
+ &:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
525
+ --mix-selection-light: 82%;
526
+ --mix-selection-dark: 75%;
527
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
528
+ }
529
+
530
+ &:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
531
+ --mix-selection-light: 75%;
532
+ --mix-selection-dark: 60%;
533
+ --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
534
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
535
+ }
536
+
537
+ &:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
538
+ --diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
539
+ var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
540
+ var(--mix-selection-light),
541
+ var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
542
+ }
543
+
544
+ &:where([data-editor-overlay]), &[data-selected-line] {
545
+ --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
546
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
547
+ var(--diffs-selection-mix-target)), color-mix(in lab,
548
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
549
+ var(--diffs-selection-mix-target)));
550
+ }
551
+ }
552
+
553
+ [data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
554
+ --diffs-computed-editor-active-line-bg: color-mix(in lab,
555
+ var(--diffs-computed-selected-line-bg)
556
+ var(--diffs-editor-active-line-source-mix, 100%),
557
+ var(--diffs-selection-emphasis-mix-target));
558
+ }
559
+
560
+ @media (pointer: fine) {
561
+ [data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
562
+ --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
563
+ var(--diffs-computed-editor-active-line-bg) 97%,
564
+ var(--diffs-hover-mix-target)), color-mix(in lab,
565
+ var(--diffs-computed-editor-active-line-bg) 91%,
566
+ var(--diffs-hover-mix-target)));
567
+ }
568
+ }
569
+
570
+ [data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
571
+ color: var(--diffs-selection-number-fg);
572
+ }
573
+
574
+ [data-no-newline] {
575
+ user-select: none;
576
+
577
+ & span {
578
+ opacity: .6;
579
+ }
580
+ }
581
+
582
+ [data-diff-type="split"][data-overflow="scroll"] {
583
+ grid-template-columns: 1fr 1fr;
584
+ display: grid;
585
+
586
+ & [data-additions] {
587
+ border-left: 1px solid var(--diffs-bg);
588
+ }
589
+
590
+ & [data-deletions] {
591
+ border-right: 1px solid var(--diffs-bg);
592
+ }
593
+ }
594
+
595
+ [data-code] {
596
+ grid-auto-flow: dense;
597
+ grid-template-columns: var(--diffs-code-grid);
598
+ overflow: var(--diffs-overflow-override, scroll) clip;
599
+ overscroll-behavior-x: none;
600
+ tab-size: var(--diffs-tab-size, 2);
601
+ padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
602
+ padding-bottom: max(0px,
603
+ calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
604
+ var(--diffs-scrollbar-gutter)));
605
+ scrollbar-gutter: stable;
606
+ align-self: flex-start;
607
+ display: grid;
608
+ }
609
+
610
+ [data-diffs-scrollbar-measure] {
611
+ opacity: 0;
612
+ pointer-events: none;
613
+ scrollbar-gutter: auto;
614
+ grid-template-columns: none;
615
+ width: 100px;
616
+ height: 100px;
617
+ padding: 0;
618
+ position: absolute;
619
+ top: -200px;
620
+ left: -200px;
621
+ }
622
+
623
+ [data-container-size] {
624
+ container-type: inline-size;
625
+ }
626
+
627
+ [data-code]::-webkit-scrollbar {
628
+ width: 0;
629
+ height: var(--diffs-scrollbar-gutter);
630
+ }
631
+
632
+ [data-code]::-webkit-scrollbar-track {
633
+ background: none;
634
+ }
635
+
636
+ [data-code]::-webkit-scrollbar-thumb {
637
+ background-color: #0000;
638
+ background-clip: content-box;
639
+ border: 1px solid #0000;
640
+ border-radius: 3px;
641
+ }
642
+
643
+ [data-code]::-webkit-scrollbar-corner {
644
+ background-color: #0000;
645
+ }
646
+
647
+ @supports ((-moz-appearance: none)) {
648
+ [data-code] {
649
+ scrollbar-width: thin;
650
+ scrollbar-color: var(--diffs-bg-context) transparent;
651
+ padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
652
+ }
653
+ }
654
+
655
+ [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
656
+ & [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
657
+ padding-top: 0;
658
+ }
659
+ }
660
+
661
+ [data-gutter] {
662
+ grid-template-rows: subgrid;
663
+ grid-template-columns: subgrid;
664
+ z-index: 3;
665
+ background-color: var(--diffs-bg);
666
+ grid-column: 1;
667
+ display: grid;
668
+ position: relative;
669
+
670
+ & [data-gutter-buffer], & [data-column-number] {
671
+ border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
672
+ }
673
+ }
674
+
675
+ [data-content] {
676
+ grid-template-rows: subgrid;
677
+ grid-template-columns: subgrid;
678
+ background-color: var(--diffs-bg);
679
+ grid-column: 2;
680
+ min-width: 0;
681
+ display: grid;
682
+ }
683
+
684
+ [data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
685
+ grid-auto-flow: dense;
686
+ grid-template-columns: repeat(2, var(--diffs-code-grid));
687
+ padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
688
+ display: grid;
689
+
690
+ & [data-code] {
691
+ display: contents;
692
+ }
693
+
694
+ & [data-deletions] {
695
+ & [data-gutter] {
696
+ grid-column: 1;
697
+ }
698
+
699
+ & [data-content] {
700
+ border-right: 1px solid var(--diffs-bg);
701
+ grid-column: 2;
702
+ }
703
+ }
704
+
705
+ & [data-additions] {
706
+ & [data-gutter] {
707
+ border-left: 1px solid var(--diffs-bg);
708
+ grid-column: 3;
709
+ }
710
+
711
+ & [data-content] {
712
+ grid-column: 4;
713
+ }
714
+ }
715
+ }
716
+
717
+ [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
718
+ overflow: clip;
719
+ }
720
+
721
+ [data-overflow="scroll"] [data-gutter] {
722
+ position: sticky;
723
+ left: 0;
724
+ }
725
+
726
+ [data-interactive-lines] [data-line] {
727
+ cursor: pointer;
728
+ }
729
+
730
+ [data-interactive-line-numbers] [data-column-number] {
731
+ cursor: pointer;
732
+ touch-action: none;
733
+ }
734
+
735
+ [data-content-buffer], [data-gutter-buffer] {
736
+ user-select: none;
737
+ min-height: 1lh;
738
+ position: relative;
739
+ }
740
+
741
+ [data-gutter-buffer] {
742
+ padding-left: 2ch;
743
+ padding-right: 1ch;
744
+
745
+ &:before {
746
+ content: "";
747
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
748
+ display: block;
749
+ }
750
+ }
751
+
752
+ [data-gutter-buffer="annotation"] {
753
+ --diffs-annotation-bg: var(--diffs-bg-context-gutter);
754
+ min-height: 0;
755
+ }
756
+
757
+ [data-gutter-buffer="buffer"] {
758
+ --diffs-line-bg: var(--diffs-bg-context-gutter);
759
+ }
760
+
761
+ [data-content-buffer] {
762
+ background-position: 5px 0;
763
+ background-size: 8px 8px;
764
+ background-origin: border-box;
765
+ background-image: repeating-linear-gradient(-45deg,
766
+ transparent,
767
+ transparent calc(3px * 1.414),
768
+ var(--diffs-bg-buffer) calc(3px * 1.414),
769
+ var(--diffs-bg-buffer) calc(4px * 1.414));
770
+ grid-column: 1;
771
+ }
772
+
773
+ [data-separator] {
774
+ box-sizing: content-box;
775
+ background-color: var(--diffs-bg);
776
+ }
777
+
778
+ [data-separator="simple"] {
779
+ min-height: 4px;
780
+ }
781
+
782
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
783
+ background-color: var(--diffs-bg-separator);
784
+ }
785
+
786
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
787
+ height: 32px;
788
+ position: relative;
789
+ }
790
+
791
+ [data-separator-wrapper] {
792
+ user-select: none;
793
+ fill: currentColor;
794
+ background-color: var(--diffs-bg);
795
+ align-items: center;
796
+ height: 100%;
797
+ display: flex;
798
+ position: absolute;
799
+ inset-inline: 0;
800
+ }
801
+
802
+ [data-content] [data-separator-wrapper] {
803
+ display: none;
804
+ }
805
+
806
+ [data-separator="metadata"] [data-separator-wrapper] {
807
+ background-color: var(--diffs-bg-separator);
808
+ height: 100%;
809
+ color: var(--diffs-fg-number);
810
+ white-space: nowrap;
811
+ text-overflow: ellipsis;
812
+ min-width: min-content;
813
+ padding-inline: 1ch;
814
+ inset-inline: 100% auto;
815
+ overflow: hidden;
816
+ }
817
+
818
+ [data-separator="line-info"] {
819
+ margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
820
+
821
+ & [data-separator-wrapper] {
822
+ min-width: 16px;
823
+ }
824
+ }
825
+
826
+ [data-separator="line-info-basic"], [data-separator="metadata"] {
827
+ margin-block: 0;
828
+ }
829
+
830
+ [data-separator="line-info"][data-separator-first] {
831
+ margin-top: 0;
832
+ }
833
+
834
+ [data-separator="line-info"][data-separator-last] {
835
+ margin-bottom: 0;
836
+ }
837
+
838
+ [data-expand-index] [data-separator-wrapper] {
839
+ grid-template-columns: 32px auto;
840
+ display: grid;
841
+ }
842
+
843
+ [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
844
+ grid-template-columns: 32px 32px auto;
845
+ }
846
+
847
+ [data-expand-button], [data-separator-content] {
848
+ background-color: var(--diffs-bg-separator);
849
+ flex: none;
850
+ align-items: center;
851
+ display: flex;
852
+ }
853
+
854
+ [data-expand-index] [data-separator-content]:hover {
855
+ cursor: pointer;
856
+ text-decoration: underline;
857
+ }
858
+
859
+ [data-expand-button] {
860
+ cursor: pointer;
861
+ min-width: 32px;
862
+ color: var(--diffs-fg-number);
863
+ border-right: 2px solid var(--diffs-bg);
864
+ flex-shrink: 0;
865
+ justify-content: center;
866
+ align-self: stretch;
867
+
868
+ &:hover {
869
+ color: var(--diffs-fg);
870
+ }
871
+
872
+ &[data-expand-all-button] {
873
+ display: none;
874
+ }
875
+ }
876
+
877
+ [data-expand-down] [data-icon] {
878
+ transform: scaleY(-1);
879
+ }
880
+
881
+ [data-separator-content] {
882
+ height: 100%;
883
+ color: var(--diffs-fg-number);
884
+ flex: auto;
885
+ justify-content: flex-start;
886
+ padding: 0 1ch;
887
+ overflow: hidden;
888
+ }
889
+
890
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
891
+ & [data-separator-content] {
892
+ user-select: none;
893
+ height: 100%;
894
+ overflow: clip;
895
+ }
896
+ }
897
+
898
+ [data-unmodified-lines] {
899
+ text-overflow: ellipsis;
900
+ white-space: nowrap;
901
+ flex: 0 auto;
902
+ min-width: 0;
903
+ display: block;
904
+ overflow: hidden;
905
+ }
906
+
907
+ @supports (width: 1cqi) {
908
+ [data-unified] {
909
+ & [data-separator="line-info"] [data-separator-wrapper] {
910
+ padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
911
+ width: 100cqi;
912
+
913
+ & [data-separator-content] {
914
+ border-radius: 6px;
915
+ }
916
+ }
917
+
918
+ & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
919
+ border-top-left-radius: unset;
920
+ border-bottom-left-radius: unset;
921
+ }
922
+ }
923
+
924
+ [data-gutter] {
925
+ & [data-separator="line-info"] [data-separator-wrapper] {
926
+ padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
927
+ }
928
+
929
+ & [data-separator="line-info"] [data-separator-content] {
930
+ border-top-left-radius: 6px;
931
+ border-bottom-left-radius: 6px;
932
+ }
933
+
934
+ & [data-separator="line-info"][data-expand-index] [data-separator-content] {
935
+ border-top-left-radius: unset;
936
+ border-bottom-left-radius: unset;
937
+ }
938
+ }
939
+
940
+ [data-additions] {
941
+ & [data-content] [data-separator="line-info"] {
942
+ background-color: var(--diffs-bg);
943
+
944
+ & [data-separator-wrapper] {
945
+ display: none;
946
+ }
947
+ }
948
+
949
+ & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
950
+ background-color: var(--diffs-bg-separator);
951
+ border-top-right-radius: 6px;
952
+ border-bottom-right-radius: 6px;
953
+ height: 100%;
954
+ display: block;
955
+
956
+ & [data-separator-content], & [data-expand-button] {
957
+ display: none;
958
+ }
959
+ }
960
+ }
961
+
962
+ [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
963
+ width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
964
+ }
965
+
966
+ [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
967
+ background-color: var(--diffs-bg-separator);
968
+ height: 100%;
969
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
970
+ border-top-right-radius: 6px;
971
+ border-bottom-right-radius: 6px;
972
+ display: block;
973
+
974
+ & [data-separator-content], & [data-expand-button] {
975
+ display: none;
976
+ }
977
+ }
978
+
979
+ [data-separator="line-info"] [data-separator-wrapper] {
980
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
981
+ border-top-left-radius: 6px;
982
+ border-bottom-left-radius: 6px;
983
+ }
984
+ }
985
+
986
+ @media (pointer: fine) {
987
+ [data-separator="line-info"] [data-separator-wrapper] {
988
+ &[data-separator-multi-button] {
989
+ & [data-expand-up] {
990
+ border-top-left-radius: 6px;
991
+ border-bottom-left-radius: unset;
992
+ }
993
+
994
+ & [data-expand-down] {
995
+ border-bottom-left-radius: 6px;
996
+ border-top-left-radius: unset;
997
+ }
998
+ }
999
+ }
1000
+ }
1001
+ }
1002
+
1003
+ @media (pointer: coarse) {
1004
+ [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
1005
+ grid-template-columns: 34px 34px auto;
1006
+
1007
+ & [data-separator-content] {
1008
+ grid-column: unset;
1009
+ grid-row: unset;
1010
+ }
1011
+ }
1012
+
1013
+ @supports (width: 1cqi) {
1014
+ [data-separator="line-info"] [data-separator-wrapper] {
1015
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
1016
+ border-top-left-radius: 6px;
1017
+ border-bottom-left-radius: 6px;
1018
+ }
1019
+
1020
+ &[data-separator-multi-button] {
1021
+ & [data-expand-up] {
1022
+ border-top-left-radius: 6px;
1023
+ border-bottom-left-radius: 6px;
1024
+ }
1025
+
1026
+ & [data-expand-down] {
1027
+ border-bottom-left-radius: unset;
1028
+ border-top-left-radius: unset;
1029
+ }
1030
+ }
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ @media (pointer: fine) {
1036
+ [data-separator-wrapper][data-separator-multi-button] {
1037
+ grid-template-rows: 50% 50%;
1038
+ display: grid;
1039
+
1040
+ & [data-separator-content] {
1041
+ grid-area: 1 / 2 / -1;
1042
+ min-width: min-content;
1043
+ }
1044
+
1045
+ & [data-expand-button] {
1046
+ grid-column: 1;
1047
+ }
1048
+ }
1049
+
1050
+ [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
1051
+ grid-template-columns: 34px auto;
1052
+ }
1053
+
1054
+ [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
1055
+ grid-template-columns: 100% auto;
1056
+ }
1057
+
1058
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
1059
+ & [data-separator-multi-button] {
1060
+ & [data-expand-up] {
1061
+ border-bottom: 1px solid var(--diffs-bg);
1062
+ border-right: 2px solid var(--diffs-bg);
1063
+ }
1064
+
1065
+ & [data-expand-down] {
1066
+ border-top: 1px solid var(--diffs-bg);
1067
+ border-right: 2px solid var(--diffs-bg);
1068
+ }
1069
+ }
1070
+ }
1071
+ }
1072
+
1073
+ [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
1074
+ display: none;
1075
+ }
1076
+
1077
+ [data-line-annotation] {
1078
+ min-height: var(--diffs-annotation-min-height, 0);
1079
+ z-index: 2;
1080
+ }
1081
+
1082
+ [data-merge-conflict-actions] {
1083
+ z-index: 2;
1084
+ }
1085
+
1086
+ [data-separator="custom"] {
1087
+ grid-template-columns: subgrid;
1088
+ display: grid;
1089
+ }
1090
+
1091
+ [data-line], [data-column-number], [data-no-newline] {
1092
+ padding-inline: 1ch;
1093
+ position: relative;
1094
+ }
1095
+
1096
+ [data-indicators="classic"] [data-line] {
1097
+ padding-inline-start: 2ch;
1098
+ }
1099
+
1100
+ [data-indicators="classic"] {
1101
+ & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
1102
+ &[data-no-newline], &[data-line] {
1103
+ &:before {
1104
+ user-select: none;
1105
+ width: 1ch;
1106
+ height: 1lh;
1107
+ display: inline-block;
1108
+ position: absolute;
1109
+ top: 0;
1110
+ left: 0;
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ & [data-line-type="change-addition"] {
1116
+ &[data-line], &[data-no-newline] {
1117
+ &:before {
1118
+ content: "+";
1119
+ color: var(--diffs-addition-base);
1120
+ }
1121
+ }
1122
+ }
1123
+
1124
+ & [data-line-type="change-deletion"] {
1125
+ &[data-line], &[data-no-newline] {
1126
+ &:before {
1127
+ content: "-";
1128
+ color: var(--diffs-deletion-base);
1129
+ }
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ [data-indicators="bars"] {
1135
+ & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
1136
+ &[data-column-number] {
1137
+ &:before {
1138
+ content: "";
1139
+ user-select: none;
1140
+ contain: strict;
1141
+ width: 4px;
1142
+ height: 100%;
1143
+ display: block;
1144
+ position: absolute;
1145
+ top: 0;
1146
+ left: 0;
1147
+ }
1148
+ }
1149
+ }
1150
+
1151
+ & [data-line-type="change-deletion"] {
1152
+ &[data-column-number] {
1153
+ &:before {
1154
+ background-image: linear-gradient(0deg,
1155
+ var(--diffs-bg-deletion) 50%,
1156
+ var(--diffs-deletion-base) 50%);
1157
+ background-repeat: repeat;
1158
+ background-size: 2px 2px;
1159
+ background-size: calc(1lh / round(1lh / 2px))
1160
+ calc(1lh / round(1lh / 2px));
1161
+ }
1162
+ }
1163
+ }
1164
+
1165
+ & [data-line-type="change-addition"] {
1166
+ &[data-column-number] {
1167
+ &:before {
1168
+ background-color: var(--diffs-addition-base);
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+
1174
+ [data-overflow="wrap"] {
1175
+ & [data-line] {
1176
+ white-space: pre-wrap;
1177
+ word-break: break-word;
1178
+ }
1179
+
1180
+ & [data-annotation-content] {
1181
+ word-break: break-word;
1182
+ }
1183
+ }
1184
+
1185
+ [data-overflow="scroll"] [data-line] {
1186
+ white-space: pre;
1187
+ min-height: 1lh;
1188
+ }
1189
+
1190
+ [data-column-number] {
1191
+ box-sizing: content-box;
1192
+ text-align: right;
1193
+ user-select: none;
1194
+ color: var(--diffs-fg-number);
1195
+ padding-left: 2ch;
1196
+ }
1197
+
1198
+ [data-line-number-content] {
1199
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
1200
+ z-index: 1;
1201
+ display: inline-block;
1202
+ position: relative;
1203
+ }
1204
+
1205
+ [data-disable-line-numbers] {
1206
+ & [data-gutter-buffer], & [data-column-number] {
1207
+ min-width: 4px;
1208
+ padding: 0;
1209
+
1210
+ &:before {
1211
+ min-width: 0;
1212
+ }
1213
+ }
1214
+
1215
+ & [data-line-number-content] {
1216
+ display: none;
1217
+ }
1218
+
1219
+ & [data-gutter-utility-slot] {
1220
+ right: unset;
1221
+ justify-content: flex-start;
1222
+ left: 0;
1223
+ }
1224
+
1225
+ &[data-indicators="bars"] [data-gutter-utility-slot] {
1226
+ left: 6px;
1227
+ }
1228
+ }
1229
+
1230
+ [data-file][data-disable-line-numbers] {
1231
+ & [data-gutter-buffer], & [data-column-number] {
1232
+ border-right: 0;
1233
+ min-width: 0;
1234
+ }
1235
+ }
1236
+
1237
+ [data-diff-span] {
1238
+ box-decoration-break: clone;
1239
+ border-radius: 3px;
1240
+ }
1241
+
1242
+ [data-line-type="change-addition"] [data-diff-span] {
1243
+ background-color: var(--diffs-bg-addition-emphasis);
1244
+ }
1245
+
1246
+ [data-line-type="change-deletion"] [data-diff-span] {
1247
+ background-color: var(--diffs-bg-deletion-emphasis);
1248
+ }
1249
+
1250
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
1251
+ color: var(--diffs-fg);
1252
+ padding-left: 1ch;
1253
+ }
1254
+
1255
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
1256
+ align-items: center;
1257
+ display: flex;
1258
+
1259
+ &:after {
1260
+ color: var(--diffs-fg-conflict-marker);
1261
+ font-size: .75rem;
1262
+ font-style: normal;
1263
+ line-height: 1.25rem;
1264
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1265
+ padding-left: 1ch;
1266
+ }
1267
+ }
1268
+
1269
+ [data-merge-conflict="marker-start"]:after {
1270
+ content: "(Current Change)";
1271
+ }
1272
+
1273
+ [data-merge-conflict="marker-end"]:after {
1274
+ content: "(Incoming Change)";
1275
+ }
1276
+
1277
+ [data-merge-conflict-actions-content] {
1278
+ min-height: 1.75rem;
1279
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1280
+ color: var(--diffs-fg);
1281
+ align-items: center;
1282
+ gap: .25rem;
1283
+ padding-inline: .5rem;
1284
+ font-size: .75rem;
1285
+ line-height: 1.2;
1286
+ display: flex;
1287
+ }
1288
+
1289
+ [data-merge-conflict-action] {
1290
+ appearance: none;
1291
+ color: var(--diffs-fg-number);
1292
+ font: inherit;
1293
+ cursor: pointer;
1294
+ background: none;
1295
+ border: 0;
1296
+ padding: 0;
1297
+ font-style: normal;
1298
+ }
1299
+
1300
+ [data-merge-conflict-action]:hover {
1301
+ color: var(--diffs-fg);
1302
+ }
1303
+
1304
+ [data-merge-conflict-action="current"]:hover {
1305
+ color: var(--diffs-addition-base);
1306
+ }
1307
+
1308
+ [data-merge-conflict-action="incoming"]:hover {
1309
+ color: var(--diffs-modified-base);
1310
+ }
1311
+
1312
+ [data-merge-conflict-action-separator] {
1313
+ color: var(--diffs-fg-number);
1314
+ opacity: .6;
1315
+ user-select: none;
1316
+ }
1317
+
1318
+ [data-diffs-header="default"] {
1319
+ background-color: var(--diffs-bg);
1320
+ justify-content: space-between;
1321
+ align-items: center;
1322
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1323
+ min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
1324
+ z-index: 2;
1325
+ flex-direction: row;
1326
+ padding-inline: 16px;
1327
+ display: flex;
1328
+ position: relative;
1329
+ top: 0;
1330
+ }
1331
+
1332
+ [data-header-content] {
1333
+ align-items: center;
1334
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1335
+ white-space: nowrap;
1336
+ flex-direction: row;
1337
+ min-width: 0;
1338
+ display: flex;
1339
+ }
1340
+
1341
+ [data-header-content] [data-prev-name], [data-header-content] [data-title] {
1342
+ text-overflow: ellipsis;
1343
+ white-space: nowrap;
1344
+ direction: rtl;
1345
+ min-width: 0;
1346
+ overflow: hidden;
1347
+ }
1348
+
1349
+ [data-prev-name] {
1350
+ opacity: .7;
1351
+ }
1352
+
1353
+ [data-rename-icon] {
1354
+ fill: currentColor;
1355
+ flex-grow: 0;
1356
+ flex-shrink: 0;
1357
+ }
1358
+
1359
+ [data-diffs-header="default"] [data-metadata] {
1360
+ white-space: nowrap;
1361
+ align-items: center;
1362
+ gap: 1ch;
1363
+ display: flex;
1364
+ }
1365
+
1366
+ [data-diffs-header="default"] [data-additions-count] {
1367
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1368
+ color: var(--diffs-addition-base);
1369
+ }
1370
+
1371
+ [data-diffs-header="default"] [data-deletions-count] {
1372
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1373
+ color: var(--diffs-deletion-base);
1374
+ }
1375
+
1376
+ [data-change-icon] {
1377
+ fill: currentColor;
1378
+ flex-shrink: 0;
1379
+ }
1380
+
1381
+ [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
1382
+ color: var(--diffs-modified-base);
1383
+ }
1384
+
1385
+ [data-change-icon="new"] {
1386
+ color: var(--diffs-addition-base);
1387
+ }
1388
+
1389
+ [data-change-icon="deleted"] {
1390
+ color: var(--diffs-deletion-base);
1391
+ }
1392
+
1393
+ [data-change-icon="file"] {
1394
+ opacity: .6;
1395
+ }
1396
+
1397
+ [data-annotation-content] {
1398
+ z-index: 2;
1399
+ isolation: isolate;
1400
+ white-space: normal;
1401
+ align-self: flex-start;
1402
+ min-width: 0;
1403
+ display: flow-root;
1404
+ position: relative;
1405
+ }
1406
+
1407
+ [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
1408
+ width: var(--diffs-column-content-width, auto);
1409
+ left: var(--diffs-column-number-width, 0);
1410
+ position: sticky;
1411
+ }
1412
+
1413
+ [data-annotation-slot] {
1414
+ text-wrap-mode: wrap;
1415
+ word-break: normal;
1416
+ white-space-collapse: collapse;
1417
+ }
1418
+
1419
+ [data-gutter-utility-slot] {
1420
+ touch-action: none;
1421
+ justify-content: flex-end;
1422
+ display: flex;
1423
+ position: absolute;
1424
+ top: 0;
1425
+ bottom: 0;
1426
+ right: 0;
1427
+ }
1428
+
1429
+ [data-utility-button] {
1430
+ appearance: none;
1431
+ cursor: pointer;
1432
+ width: 1lh;
1433
+ height: 1lh;
1434
+ font-size: var(--diffs-font-size, 13px);
1435
+ line-height: var(--diffs-line-height, 20px);
1436
+ background-color: var(--diffs-modified-base);
1437
+ color: var(--diffs-bg);
1438
+ fill: currentColor;
1439
+ z-index: 4;
1440
+ touch-action: none;
1441
+ border: none;
1442
+ border-radius: 4px;
1443
+ justify-content: center;
1444
+ align-items: center;
1445
+ margin-right: calc(-1lh + 1ch);
1446
+ padding: 0;
1447
+ display: flex;
1448
+ position: relative;
1449
+
1450
+ &:before {
1451
+ content: "";
1452
+ display: block;
1453
+ position: absolute;
1454
+ inset: 0 0 0 -4px;
1455
+ }
1456
+ }
1457
+
1458
+ [data-decoration-bar-stack] {
1459
+ pointer-events: none;
1460
+ isolation: isolate;
1461
+ z-index: 1;
1462
+ background-color: var(--diffs-decoration-bar-color, transparent);
1463
+ box-sizing: content-box;
1464
+ border-left: 2px solid var(--diffs-bg);
1465
+ border-right: 2px solid var(--diffs-bg);
1466
+ width: 6px;
1467
+ position: absolute;
1468
+ top: 0;
1469
+ bottom: 0;
1470
+ right: -2px;
1471
+
1472
+ [data-decoration-bar-depth="1"] & {
1473
+ background-color: color-mix(in lab,
1474
+ var(--diffs-bg) 20%,
1475
+ var(--diffs-decoration-bar-color, transparent));
1476
+ }
1477
+
1478
+ [data-decoration-bar-depth="2"] & {
1479
+ background-color: color-mix(in lab,
1480
+ var(--diffs-bg) 45%,
1481
+ var(--diffs-decoration-bar-color, transparent));
1482
+ }
1483
+
1484
+ [data-decoration-bar-depth="3"] & {
1485
+ background-color: color-mix(in lab,
1486
+ var(--diffs-bg) 65%,
1487
+ var(--diffs-decoration-bar-color, transparent));
1488
+ }
1489
+
1490
+ [data-decoration-bar-start] & {
1491
+ border-top-left-radius: 5px;
1492
+ border-top-right-radius: 5px;
1493
+ }
1494
+
1495
+ [data-decoration-bar-end] & {
1496
+ z-index: 3;
1497
+ border-bottom-right-radius: 5px;
1498
+ border-bottom-left-radius: 5px;
1499
+ }
1500
+ }
1501
+
1502
+ [data-placeholder] {
1503
+ contain: strict;
1504
+ }
1505
+
1506
+ [data-error-wrapper] {
1507
+ padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
1508
+ var(--diffs-gap-inline, var(--diffs-gap-fallback));
1509
+ scrollbar-width: none;
1510
+ max-height: 400px;
1511
+ overflow: auto;
1512
+
1513
+ & [data-error-message] {
1514
+ color: var(--diffs-deletion-base);
1515
+ font-size: 18px;
1516
+ font-weight: bold;
1517
+ }
1518
+
1519
+ & [data-error-stack] {
1520
+ color: var(--diffs-fg-number);
1521
+ }
1522
+ }
1523
+ }
1524
+
1525
+ @layer theme, rendered, unsafe;
1526
+ `,Nz=`@layer base, theme, rendered, unsafe;`,Pz=RegExp(`${Rz(Uw)}\\s*:\\s*[^;]+;`);function Fz(e){return`${Nz}
1527
+ @layer unsafe {
1528
+ ${e}
1529
+ }`}function Iz(e,t=`system`,n){return`${Nz}
1530
+ @layer rendered {
1531
+ :host {${t===`system`?``:`
1532
+ color-scheme: ${t};`}
1533
+ ${jz(n)}
1534
+ ${e}
1535
+ }
1536
+ }`}function Lz(e,t){let n=jz(t);return e.replace(Pz,n)}function Rz(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var zz=new WeakMap;function Bz(e){return zz.get(e)??e}function Vz(e,t,n){let r=new Map;for(let i of e){let e=Bz(i);r.set(e,n?.slotNames.get(e)??t(i))}return{provided:e,current:e,slotNames:r}}function Hz(e,t,n){for(let r of t){let t=Bz(r);e.slotNames.has(t)||e.slotNames.set(t,n(r))}e.provided=t,e.current=t}function Uz(e,t,n){if(e==null)return n(t);let r=Bz(t),i=e.slotNames.get(r);return i??(i=n(t),e.slotNames.set(r,i)),i}function Wz(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Gz(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Wz(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Kz({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function qz(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function Jz({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Yz(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Yz(){let e=document.createElement(`style`);return e.setAttribute(Bw,``),e}var Xz=void 0;function Zz(){return Xz??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Qz(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function $z(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Mz)),t.adoptedStyleSheets=[e]}connectedCallback(){Az(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(Dw,t)}var eB=[``];function tB(e){let t={...e};return delete t.cacheKey,t}var nB=-1,rB=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++nB}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;editSession;renderedFile;renderRange;enabled=!0;editor;constructor(e={theme:zw},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new yz(e,this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager),this.resizeManager=new ZR,this.interactionManager=new AR(`file`,jR(e)),this.workerManager?.subscribeToThemeChanges(this)}getAnnotationSlotName=e=>Uz(this.editSession?.annotations,e,Yw);handleHighlightRender=()=>{this.rerender()};rerender(){this.enabled&&this.file!=null&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}getTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??zw}getLatestFile(e=this.file){return this.editSession?.file??e}getRenderedFile(){return this.renderedFile}getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}updateExternalFile(e,t){if(SR(this.file,e))return!1;let n=this.editSession!=null;return this.file=e,n||this.editor!=null?this.installEditSession(e,n?void 0:this.editor?.__getDocumentContents(e),!0):this.editSession=void 0,this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=Vz(t,Yw,this.editSession.annotations)),!0}installEditSession(e,t,n=!1){let r=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===e.contents,i=tB(t??e);this.editSession={file:i,externalReplacement:n&&r,annotations:this.editSession?.annotations??Vz(this.lineAnnotations,Yw)},this.fileRenderer.beginEditSession(i,r?e:void 0)}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(jR(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!QF(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Hz(t,e,Yw))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.fileRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e===`wrap`,columnVariables:this.shouldApplyColumnVariables(e)?`apply`:`measure`}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e===`scroll`&&this.getLatestAnnotations().length>0}cleanUp(e=!1){let t=this.editor;this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0,this.editSession=void 0,this.renderedFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;if(!this.enabled)throw Error(`File.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`File.hydrate: hydrate can only be called before the instance has rendered or hydrated`);this.hydrateElements(t,n);let o=this.editor!=null;o||iB(this.pre,i,this.options.collapsed)||aB(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,forceRender:o||e.forceRender,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Qz(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(Gz(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderedFile=e,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.getLatestFile()){return e==null?eB:this.fileRenderer.getOrCreateLineCache(e)}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let{editor:e,fileContainer:t,renderRange:n}=this,r=this.getLatestAnnotations(),i=this.getLatestFile();if(e==null||t==null||i==null)return;let a=a=>{this.enabled&&this.editor===e&&this.fileContainer===t&&this.getLatestFile()===i&&e.__syncRenderView({highlighter:a,fileContainer:t,file:i,lineAnnotations:r,renderRange:n,externalDocument:this.editSession?.externalReplacement===!0})},o=this.getTheme(),s=i.lang??rI(i.name),c=XF({theme:o,lang:s});c==null?YF({themes:lT(o),langs:Array.from(new Set([`text`,s])),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.externalReplacement=!1)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(){}__attachEditor(e){if(this.editor!=null)throw Error(`File.__attachEditor: an editor is already attached`);this.editor=e;let t=()=>{this.editor=void 0,this.fileRenderer.endEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`File.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){this.editSession==null?this.file!=null&&this.installEditSession(this.file,e.__getDocumentContents(this.file)):this.fileRenderer.beginEditSession(this.editSession.file);let t=this.editSession?.file;this.fileRenderer.editorRenderReady()?(this.fileRenderer.fileCache===t&&(this.renderedFile=t),this.syncRenderViewToEditor()):this.rerender()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,file:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{file:a,annotations:o}=n;if(this.editor!=null)throw Error(`File.__completeEditSession: detach the editor before completing the session`);let s=o?.current,c,l=!1,u;if(t==null)throw Error(`File.__completeEditSession: editor is required for completion`);let d={...a},f={file:d,editor:t,originalFile:r,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(f);try{if(t.__emitEditComplete(f),this.options.onEditComplete?.(f)===`accept`){if(d.cacheKey!=null&&d.cacheKey===r.cacheKey)throw Error(`File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey`);c=d}}catch(e){l=!0,u=e}e&&c!=null&&(this.file=c,s!=null&&(this.lineAnnotations=s)),this.editSession=void 0;let{renderedFile:p,file:m}=this;if(this.fileRenderer.endEditSession(m),p!=null&&m!=null&&p!==m&&SR(p,m)&&(this.renderedFile=m),e&&this.fileContainer!=null&&this.rerender(),l)throw u}applyDocumentChange(e,t){let n=this.editSession?.file;if(n==null)throw Error(`File.applyDocumentChange: requires an active edit session`);this.fileRenderer.beginEditSession(n),this.fileRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}updateRenderCache(e,t,n){let r=this.editSession?.file;if(r==null)throw Error(`File.updateRenderCache: requires an active edit session`);this.fileRenderer.beginEditSession(r),this.fileRenderer.updateRenderCache(e,t,n?.lineCountChangeInFlight)}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:c=!1,themeType:l=`system`}=this.options,u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(o),m=!SR(this.file,e);m&&this.updateExternalFile(e,o);let h=this.getLatestFile(e)??e;if(!c&&!n&&az(u,this.renderRange)&&!m&&!p&&!f){let e=this.applyCachedThemeState(l);return e&&this.finalizeRender(),e}this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.fileRenderer.setOptions(Gz(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:g=!1,disableFileHeader:_=!1}=this.options;if(_&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.fileRenderer.renderFile(h,Jw);e!=null&&this.applyThemeState(t,e.themeStyles,l,e.baseThemeType),e?.headerAST!=null&&this.applyHeaderToDOM(e.headerAST,t,e.file),this.renderedFile=e?.file??h,this.injectUnsafeCSS()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f||!SR(this.renderedFile,h))||!this.applyPartialRender(h,d,u)){let n=this.fileRenderer.renderFile(h,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t,n.file),this.applyFullRender(n,e),this.renderedFile=n.file}this.applyBuffers(e,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,a||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(this.placeHolder.style.setProperty(`height`,`${e}px`),!0)}async primeHighlightCache(e=this.file){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||iI(e))return;let n=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>n||await t.primeFileHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!Sz(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Ez(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Dz();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Oz(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Fz(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=Az(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Jz({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Iz(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Lz(this.themeCSSStyle.textContent??``,Az(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Zz()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=Kz({code:this.code}),r=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();let i=()=>{if(n.childElementCount>=2)for(let e=0;e<2;e++){let t=n.children[e],i=r[e];t.innerHTML=VA(i.children),t.style.cssText=i.properties.style}else n.innerHTML=VA(r);t.contains(n)||t.replaceChildren(n)};this.shouldGuardRebuildScroll()?qz(t,i):i(),this.lastRowCount=e.rowCount}applyPartialRender(e,t,n){if(t==null||n==null)return!1;let{code:r}=this,i=r==null?void 0:this.getColumns(r);if(r==null||i==null)return!1;let a=t.startingLine,o=n.startingLine,s=t.totalLines===1/0?1/0:a+t.totalLines,c=n.totalLines===1/0?1/0:o+n.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l)return!1;if(!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))throw Error(`File.applyPartialRender: failed to trim to overlap`);let{length:d}=i.content.children,f=(t,n)=>{if(!(n<=0))return this.fileRenderer.renderFile(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},p=o<l?f(o,l-o):void 0;if(p===void 0&&o<l)return!1;let m=c===1/0?1/0:Math.max(0,c-u),h=c>u?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&t.dataset.gutter!=null&&n.dataset.content!=null)return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;a===0&&(r.set(0,0),i+=1,a=n[i]);for(let e=0;e<o.length;e+=1){let t=o[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(s!=null){for(;a!=null&&s>=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??VA(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:i,renderHeaderFilenameSuffix:a,renderCustomHeader:o,renderHeaderMetadata:s}=this.options;if(o!=null){let e=o(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Rw,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let e=i?.(n)??void 0,r=a?.(n)??void 0,o=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Fw,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Iw,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Lw,o),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:xR(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):xR(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=xz;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};Cz(i,this.appliedPreAttributes)||($z(e,i),this.appliedPreAttributes=i)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function iB(e,t,n=!1){return!n&&e==null&&t!=null}function aB(e,t,n=!1){return e==null&&t!=null&&!n}var oB=5e3,sB=new Map,cB=-1;function lB(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var uB=class extends rB{virtualizer;metrics;__id=`virtualized-file:${++cB}`;renderType=`virtualized`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0,ghostTextRows:sB};pendingRender;isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=Gw,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){let n=eL(e);(t||!fR(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.resetLayoutCache(),!0):!1}hasLineAnnotations(){return this.getLatestAnnotations().some(e=>e.lineNumber>0)}hasUniformLineHeights(){let{overflow:e=`scroll`}=this.options;return e===`scroll`&&!this.hasLineAnnotations()&&this.cache.heights.size===0}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!pR(t,e),r=lB(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.ghostTextRows=sB,this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}applyGhostTextRows(e){let{heights:t,ghostTextRows:n}=this.cache;if(n===e)return!1;let{lineHeight:r}=this.metrics,i=!1;for(let a of new Set([...n.keys(),...e.keys()])){let o=n.get(a)??0,s=e.get(a)??0;if(s===o)continue;let c=(t.get(a)??r)-o*r+s*r;c===r?t.delete(a):t.set(a,c),i=!0}return this.cache.ghostTextRows=e,i}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.getLayoutFile()==null)return this.height!==0&&(e=!0),this.height=0,e;let{overflow:t=`scroll`}=this.options;this.top=this.getVirtualizedTop();let n=this.editor?.__getGhostTextRows()??sB;if(e=this.applyGhostTextRows(n),this.placeHolder!=null||t===`scroll`&&this.getLatestAnnotations().length===0&&!this.isResizeDebuggingEnabled())return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let{lineHeight:r}=this.metrics;if(this.code==null)return e;let i=this.code.children[1];if(!(i instanceof HTMLElement))return e;let a=wR(this.getLatestAnnotations());if(this.renderRange!=null&&a&&ER(this.renderRange)){let t=dB(i)??0;t!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=t,e=!0)}else!a&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(i==null)continue;let a=Number(i),o=t.getBoundingClientRect().height+(n.get(a)??0)*r,s=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(s=!0),o+=t.nextElementSibling.getBoundingClientRect().height);let c=this.getLineHeight(a,s);o!==c&&(e=!0,o===this.metrics.lineHeight*(s?2:1)?this.cache.heights.delete(a):this.cache.heights.set(a,o))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));updateCodeViewLayout(e,t,n,r){let i=!SR(this.file,e);i&&this.updateExternalFile(e,r);let{pendingRenderFile:a,layoutFileChanged:o,renderedFileChanged:s,annotationsChanged:c}=this.updatePendingRender(e,r),l=n?.resetFileLayoutCache===!0||o||c;n?.metrics!=null&&(this.metrics=n.metrics,l=!0);let{collapsed:u=!1}=this.options;return this.currentCollapsed!==u&&(this.currentCollapsed=u,l=!0),l&&this.resetLayoutCache(),i&&(this.layoutDirty=!0),!this.forceRenderOverride&&(i||s||c)&&(this.forceRenderOverride=!0),this.top=t,this.computeApproximateSize(!1,a),this.height}getLayoutFile(){return this.pendingRender?.file??this.getRenderedFile()}getLinePosition(e){let t=this.getLayoutFile();if(t==null||e<1)return;let{disableFileHeader:n=!1,collapsed:r=!1}=this.options,i=this.fileRenderer.getLineCount(t)-1,a=tL(this.metrics,n);if(r||i<0)return{top:a,height:0};let o=Math.min(Math.max(e-1,0),i),{lineHeight:s}=this.metrics;if(a+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())return{top:a+o*s,height:s};let c=this.getLayoutCheckpointBeforeLineIndex(o);a=c?.top??a;for(let e=c?.lineIndex??0;e<o;e++)a+=this.getLineHeight(e,!1);return{top:a,height:this.getLineHeight(o,!1)}}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutFile();if(t==null||this.renderRange==null)return;let{disableFileHeader:n=!1,collapsed:r=!1}=this.options;if(r||this.renderRange.totalLines<=0)return;let i=this.fileRenderer.getLineCount(t)-1;if(i<0)return;let a=tL(this.metrics,n),o=Math.min(this.renderRange.startingLine,i),s=Math.min(o+this.renderRange.totalLines-1,i);if(s<o)return;let{fileAnnotationHeight:c}=this.cache;if(this.hasUniformLineHeights()){let{lineHeight:t}=this.metrics,n=a+(o===0?c:this.renderRange.bufferBefore),r=o+Math.max(Math.ceil((e-n)/t),0);return r>s?void 0:{lineNumber:r+1,top:a+c+r*t}}let l=a+(o===0?c:this.renderRange.bufferBefore);for(let t=o;t<=s;t++){if(l>=e)return{lineNumber:t+1,top:l};l+=this.getLineHeight(t)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutFile();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!SR(this.getRenderedFile(),this.getLatestFile()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutFile()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(this.editor?.__getGhostTextRows()??sB);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,{lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(t),c=tL(this.metrics,i),l=rL(this.metrics);if(this.height+=c,a){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())this.height+=s*o;else for(let e=0;e<s;e++)this.addLayoutCheckpoint(e,this.height),this.height+=this.getLineHeight(e,!1);if(s>0&&(this.height+=l),this.fileContainer!=null&&n&&!r){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFile.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFile.computeApproximateSize: computed height doesnt match`,{name:t.name,elementHeight:e.height,computedHeight:this.height})}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.file==null)return;let e=this.getLatestFile(),t=e==null?void 0:this.fileRenderer.getFileForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!SR(this.getRenderedFile(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1);let i=this.getRenderedFile();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...i}){let a=!SR(this.file,t);a&&(this.updateExternalFile(t,r),this.cachedHeaderHTML=void 0);let{pendingRenderFile:o,layoutFileChanged:s,renderedFileChanged:c,annotationsChanged:l}=this.pendingRender!=null&&this.pendingRender.latestFile===(this.getLatestFile(t)??t)?{pendingRenderFile:this.pendingRender.file,layoutFileChanged:!1,renderedFileChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(t,r),{forceRenderOverride:u,isSetup:d}=this;if(this.forceRenderOverride=void 0,(l||s)&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),d)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,o));else{this.computeApproximateSize(!1,o);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFile.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!a||!d))return this.renderPlaceholder(this.height);let f=this.virtualizer.getWindowSpecs(),p=this.top??0,m=this.computeRenderRangeFromWindow(o,p,f);return super.render({file:t,fileContainer:e,renderRange:m,lineAnnotations:r,forceRender:(u??n)||l||c||a,...i})}finalizeRender(){if(this.getRenderedFile()!==this.pendingRender?.file)throw Error(`VirtualizedFile.render: rendered a different file than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestFile(e)??e,r=this.getRenderedFile(),i=this.pendingRender?.file??r,a=this.fileRenderer.getFileForNextRender(n);return this.pendingRender={latestFile:n,file:a},{pendingRenderFile:a,annotationsChanged:this.syncLineAnnotations(t),layoutFileChanged:!SR(i,a),renderedFileChanged:!SR(r,a)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}addLayoutCheckpoint(e,t){e%oB===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFile: invalid checkpoint index`);if(n.lineIndex%t===0)return n}}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1}=this.options,{hunkLineCount:a,lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(e),c=this.height,l=tL(this.metrics,i),u=s>0?rL(this.metrics):0,{fileAnnotationHeight:d}=this.cache,f=l+d,p=Math.max(0,c-l-d-u),m=wR(this.getLatestAnnotations()),h=t+l,g=d>0&&m&&h<r&&h+d>n;if(t<n-c||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u};if(s<=a)return{startingLine:0,totalLines:a,bufferBefore:0,bufferAfter:0};let _=Math.ceil(Math.max(r-n,0)/o),v=Math.ceil(_/a)*a+a,y=v/a,b=(n+r)/2;if(this.hasUniformLineHeights()){let e=t+f,i=e+p;if(!g&&!(e<r&&i>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u};let m=Math.floor(g&&b<t+f?0:(b-(t+f))/o),h=Math.floor(m/a)-Math.floor(y/2),_=Math.ceil(s/a),x=Math.max(0,Math.min(h,_))*a,S=h<0?v+h*a:v,C=x===0?0:d+x*o,w=Math.min(S,s-x);return{startingLine:x,totalLines:S,bufferBefore:C,bufferAfter:Math.max(0,(s-x-w)*o)}}let x=y,S=[],C=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-v*o*2),a),w=t+(C?.top??f),T=C?.lineIndex??0,E,D,O,ee=C?.lineIndex??0;for(let e=ee;e<s;e++){let i=T%a===0,o=Math.floor(T/a);if(i&&(S[o]=w-(t+f),O!=null)){if(O<=0)break;O--}let s=this.getLineHeight(e,!1);w>n-s&&w<r&&(E??=o),w+s>b&&(D??=o),O==null&&w>=r&&i&&(O=x),T++,w+=s}if(E==null){if(g)E=0,D=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u}}D??=E;let te=Math.round(D-y/2),ne=Math.max(0,Math.ceil(s/a)-y),re=Math.max(0,Math.min(te,ne)),ie=re*a,k=te<0?v+te*a:v,ae=S[re]??0,oe=ie===0?0:d+ae,se=re+k/a,A=se<S.length?p-S[se]:p-(w-t-f);return{startingLine:ie,totalLines:k,bufferBefore:oe,bufferAfter:Math.max(0,A)}}};function dB(e){let t;for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===CR&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}async function fB(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function pB({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=tL(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=oL({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=gL({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=mB(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?lL({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=_L({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=_L({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=rL(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function mB(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return hB(e,t)}function hB(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}function gB({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function _B(e){return e.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))}))}function vB(e){return{...e,hunks:_B(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}var yB=1;function bB(e,...t){return`ck${yB}:${JSON.stringify([e,...t])}`}function xB(e){return e===``?[]:e.split(Aw)}function SB(e,t,n){let r=e===`clone`?vB(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return CB(r,TB(r,n),EB(r,n));case`rename-pure`:{let e=EB(r,n);DB(r,n);let t=xB(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,kB(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function CB(e,t,n){let r=xB(t.contents),i=xB(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=wB(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,kB(e,t,n),e}function wB(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Zw(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=Qw(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=Qw(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function TB(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function EB(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function DB(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function OB(e,t,n){return e.cacheKey==null?AB(t,n):`${e.cacheKey}:hydrated`}function kB(e,t,n){let r=OB(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function AB(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?bB(`hydrated-files`,e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}var jB=new TextEncoder,MB=new TextDecoder(`utf-8`,{ignoreBOM:!0}),NB=/[\uD800-\uDFFF]/,PB=1024,FB=new Uint8Array(PB);function IB(){FB.length!==PB&&(FB=new Uint8Array(PB))}function LB(e){if(e.length===0)return e;if(NB.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;FB.length<t&&(FB=new Uint8Array(t));let{written:n}=jB.encodeInto(e,FB);return MB.decode(FB.subarray(0,n))}var RB=4096,zB=.5;function BB(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=HB(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}VB(t,e)}}function VB(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function HB(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>RB)return null;let c=[];for(let t=0;t<n;t++)c.push(WB(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(WB(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=GB(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*zB:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var UB=/\s+/g;function WB(e){return e.replace(UB,``)}function GB(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function KB(e,t,n=!1,r){let i=uV(e),a=i?$B(e):eV(e),o,s=[];for(let e of a){if(i&&!kw.test(e)){if(o==null)o=LB(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!i&&!tV(e)){if(o==null)o=LB(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let a=JB(e,{cacheKey:t==null?void 0:r==null?bB(`patch-file`,t,String(s.length)):bB(`patch-file`,t,String(r),String(s.length)),isGitDiff:i,throwOnError:n});a!=null&&s.push(a)}return{patchMetadata:o,files:s}}function qB(e,t){try{return JB(e,t)}finally{IB()}}function JB(e,{cacheKey:t,isGitDiff:n=kw.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=dV(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=QB(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=sV(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?ZB(i.contents):[],deletionLines:!l&&r!=null&&i!=null?ZB(r.contents):[],cacheKey:pV(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Nw),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=LB(r.trim()),n!==r&&(c.prevName=LB(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?Mw:jw):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=LB(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=LB(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=LB(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=LB(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=LB(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=LB(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Pw)??[];t!=null&&(c.prevObjectId=LB(t)),n!=null&&(c.newObjectId=LB(n)),r!=null&&(c.mode=LB(r))}e.startsWith(`rename from `)&&(c.prevName=LB(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=LB(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
1537
+ `||s[s.length-1]===`\r`||s[s.length-1]===`\r
1538
+ `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:pV(p.hunkContext),hunkSpecs:LB(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(!aV(t)||oV(t))break;if(a)throw Error(`parsePatchContent: hunk has more lines than expected`)}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=mV(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=hV(t);(g==null||g.type!==`change`)&&(g=gV(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=hV(t);(g==null||g.type!==`change`)&&(g=gV(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=hV(t);(g==null||g.type!==`context`)&&(g=gV(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=TL(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=TL(c.deletionLines[e]))}}}if(x!==b.additionCount||S!==b.deletionCount){if(a)throw Error(`parsePatchContent: hunk line count mismatch`);console.error(`parsePatchContent: hunk line count mismatch: "${f.trimEnd()}", declared old/new ${b.deletionCount}/${b.additionCount}, parsed old/new ${S}/${x}`);let e=Zw(b.additionStart,b.additionCount)+(x===0?0:1),t=Zw(b.deletionStart,b.deletionCount)+(S===0?0:1);if(!l){let n=e-b.additionStart,r=t-b.deletionStart;b.additionLineIndex+=n,b.deletionLineIndex+=r;for(let e of b.hunkContent)e.additionLineIndex+=n,e.deletionLineIndex+=r}b.additionStart=e,b.deletionStart=t,b.additionCount=x,b.deletionCount=S}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Zw(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Qw(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=Qw(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),BB(c),c}}function YB(e,t,n=!1){let r=[],i=XB(e)?e.split(Ow):[e];for(let e of i)try{r.push(KB(e,t,n,t==null?void 0:r.length))}catch(e){if(n)throw e;console.error(e)}finally{IB()}return r}function XB(e){return e.startsWith(`From `)||e.includes(`
1539
+ From `)}function ZB(e){let t=QB(e);for(let e=0;e<t.length;e++)t[e]=LB(t[e]);return t}function QB(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
1540
+ `,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function $B(e){return dV(e,`diff --git`)}function eV(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=iV(e,r);if(i<=0&&a<=0){if(nV(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=iV(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=sV(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function tV(e){return nV(e,0)}function nV(e,t){let n=iV(e,t);return rV(e,t,`---`)&&rV(e,n,`+++`)}function rV(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
1541
+ `||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function iV(e,t){let n=e.indexOf(`
1542
+ `,t);return n===-1?e.length:n+1}function aV(e){let t=e[0];return t===`+`||t===`-`||t===` `}function oV(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
1543
+ `&&n!==`\r`)return!1}return!0}function sV(e){if(!e.startsWith(`@@ -`))return;let t=4,n=cV(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=cV(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=cV(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=cV(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=lV(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function cV(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function lV(e){return e.endsWith(`\r
1544
+ `)?e.slice(0,-2):e.endsWith(`
1545
+ `)?e.slice(0,-1):e}function uV(e){return e.startsWith(`diff --git`)||e.includes(`
1546
+ diff --git`)}function dV(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:fV(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=fV(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function fV(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function pV(e){return e==null?e:LB(e)}function mV(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function hV(e){let t=e.slice(1);return LB(t===``?`
1547
+ `:t)}function gV(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var _V=`/dev/null`;function vV(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??yV(),a=t??yV(),o=qB(nR(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey,r=t?.cacheKey;return n!=null&&r!=null?bB(`diff`,n,r):void 0})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function yV(){return{name:_V,contents:``}}var bV=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function xV(e,t){let n=vV({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function SV(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function CV(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function wV(e,t){return t.length>0&&t.length<e.deletionLines.length&&CV(t)}function TV(e,t,n){let r=e.deletionLines.join(``),i=SV(t.length,r),a=vV({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function EV(e,t){return TV(e,[``],t)}function DV(e,t){if(e.additionLines.length===0)return EV(e,t);if(wV(e,e.additionLines))return TV(e,e.additionLines,t);let n=e.additionLines,r=xV(e,t);return kV(r,n),r}function OV(e){return e.length>1&&e.at(-1)===``}function kV(e,t){if(!OV(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&Qw(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,zV(e);return}}}function AV(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return jV(e,xV(e,n));let r=Array.from(t);if(r.length===0)return jV(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||TL(r)===TL(i))return jV(e,xV(e,n))}let i=MV(e,r);if(i.size===0)return jV(e,xV(e,n));for(let t of i)if(!PV(e,t,n))return jV(e,xV(e,n));return zV(e),sL(e)?jV(e,xV(e,n)):jV(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function jV(e,t){return Object.assign(e,t),t}function MV(e,t){let n=new Set;for(let r of t){let t=NV(e,r);if(t==null)return new Set;n.add(t)}return n}function NV(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function PV(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=vV({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(IV(r,s),FV(e,t),!0)}function FV(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
1548
+ `),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
1549
+ `)}function IV(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>LV(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,RV(e)}function LV(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function RV(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function zV(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Zw(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,RV(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=Qw(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-Qw(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var BV=new WeakMap;function VV(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function HV(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function UV(e,t){let n=e.hunks,r=e.additionLines,i=VV(r),a=i===r?e:{...e,additionLines:i},o=$V(n,QV(a,t),e.deletionLines.length),s=nH(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,fH(e),kV(e,r),aH(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function WV(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<cH(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:cH(r);if(i==null||t<i||o!=null&&o!==s)return UV(e,n);o=s}if(o!=null){if(GV(e,i,o,r,n)){e.editSessionDirty=!0;return}return UV(e,n)}}function GV(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=KV(e),o=e.hunks[n];if(o.hunkContent.some(qV))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function KV(e){let t=BV.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return BV.set(e,{lines:e.deletionLines,set:n}),n}function qV(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function JV(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function YV(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=oL({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=lH(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=lL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=lH(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function XV(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=lH(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,lH(i)+i.deletionCount,e.deletionLines.length),n}function ZV(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?xV(e,t):DV(e,t)),!0)}function QV(e,t){if(HV(e.deletionLines,e.additionLines)==null)return[];let n=vV({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=LV(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function $V(e,t,n){let r=e.map((e,t)=>{let n=lH(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&eH(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=tH(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function eH(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function tH(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function nH(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);iH(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);iH(s,c,i,r),r+=c,i+=c,n.push(rH(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function rH(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:uH(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:dH(t.additionStart,r),deletionStart:uH(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:dH(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${uH(t.deletionStart,i)},${i} +${uH(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return RV(s),s}function iH(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function aH(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(lH(r)!==lH(i)||r.deletionCount!==i.deletionCount||cH(r)!==cH(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!oH(r,i))return!0}return!1}function oH(e,t){let n=sH(e),r=sH(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*sH(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function cH(e){return Zw(e.additionStart,e.additionCount)}function lH(e){return Zw(e.deletionStart,e.deletionCount)}function uH(e,t){return t===0?e:e+1}function dH(e,t){return t===0?e-1:e}function fH(e){zV(e);for(let t=0;t<e.hunks.length;t++)FV(e,t)}function pH(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function mH(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[fI(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function hH(e){return $({tagName:`div`,children:[pI({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function gH({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push($({tagName:`div`,children:[fI(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(hH(`up`)),s++),o||(e.push(hH(`down`)),s++)):(e.push(hH(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[fI(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[fI(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push($({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push($({tagName:`slot`,properties:{name:i}})),$({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function _H(e,t){return`hunk-separator-${e}-${t}`}function vH(e){let t=e.at(-1);return t==null?0:Math.max(Qw(t.additionStart,t.additionCount),Qw(t.deletionStart,t.deletionCount))}var yH=-1,bH=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++yH}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=[`text`];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:zw},t=Yw,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=CF(e.theme??zw)?XF():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(e,t){let{editSessionActive:n,renderCache:r}=this;if(this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.diff=e,!e.isPartial&&e.additionLines.length===0){Object.assign(e,EV(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(r==null||n&&r.diff===e)return;let{options:i}=this.getRenderOptions(e),a=r.diff===e,o=t!=null&&XI(r.diff,t),{result:s}=r;if(!r.highlighted||s==null||!QI(r.options,i)||!a&&!o){this.clearRenderCache();return}a||(this.renderCache={diff:e,options:i,highlighted:!0,result:{...s,code:{...s.code,additionLines:[...s.code.additionLines]}},renderRange:r.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!XI(t.diff,e)||$I(e)||NH(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(e).then(t=>this.applyRefreshedResult(e,t)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){let{diff:n,renderCache:r}=this;if(t==null||n==null||r==null||!XI(n,e)||!XI(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);QI(i,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Kw}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return!1;let{result:i,diff:a}=r;if(i==null)return!1;if(a.isPartial)throw Error(`Could not update render cache for partial diff`);let o=i.code.additionLines,s=this.pendingStructuralRows=n?new Map:void 0,c=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},r=n.map(e=>e[2]).join(``),i=t<a.additionLines.length,u=i?a.additionLines[t]??``:``,d=TL(u);s==null&&i&&(a.additionLines[t]=oz(u,r),d!==r&&(c.push(t),l.set(t,u)));let f={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};s==null?o[t]=f:s.set(t,f)}let u=!1;if(c.length>0){if(this.editSessionActive){if(a.additionLines.length<=1&&a.additionLines.join(``)===``)this.applyRecomputePreservingSessionType(a,EV(a,this.options.parseDiffOptions)),u=!0;else if(wV(a,a.additionLines))this.applyRecomputePreservingSessionType(a,TV(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=WV(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,AV(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=JV(this.expandedHunks,e))}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;if(this.pendingStructuralRows=void 0,n==null)return;let{diff:r,result:i}=n;if(i==null)return;if(r.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:a}=r;if(r.additionLines=jH(e),i.code.additionLines=kH(a,r.additionLines,i.code.additionLines,e),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,EV(r,this.options.parseDiffOptions)),i.code.additionLines[0]=AH(0,e.getLineText(0))):this.editSessionActive?this.applySessionDocumentChange(r):Object.assign(r,DV(r,this.options.parseDiffOptions)),t!=null)for(let[e,n]of t)e<i.code.additionLines.length&&(i.code.additionLines[e]=n);n.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(wV(e,n)){this.applyRecomputePreservingSessionType(e,TV(e,n,t));return}this.applyExpansionRemap(UV(e,t))}applyRecomputePreservingSessionType(e,t){let n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>sz(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=zw,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Ww,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await YF(hz(this.computedLangs,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=NH(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!QI(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!$I(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLangs=MH(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??zw}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!XI(e,n.diff)||!QI(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(XI(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||$I(e)||NH(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||XI(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&CF(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&CF(t.theme)}renderDiff(e=this.diff,t=qw){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getReadyRenderResult(e,i);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||$I(e)||NH(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!XI(e,this.renderCache.diff),d=!az(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&gz(t);l&&!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(u||d))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||d||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,gz(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=MH(e),this.highlighter??=XF();let t=this.highlighter!=null&&CF(i.theme),n=this.highlighter!=null&&cT(this.computedLangs),r=!c&&n;if(l&&this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=qw){this.diff=e;let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return pz({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=NH(e,this.getTokenizeMaxLength());this.computedLangs=t?[`text`]:MH(e);let n=this.highlighter!=null&&CF(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&cT(this.computedLangs);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=sR(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(vL({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=AH(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{diff:i,renderCache:a}=this;i!=null&&a!=null&&XI(i,e)&&QI(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&QI(a.options,n)&&XI(a.diff,i)||(this.pendingHighlightResult={diff:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(n!=null&&QI(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&XI(n.diff,e)&&QI(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&XI(e,n.diff)&&QI(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1,f=a===`unified`,p=PH(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:hI(),deletionsGutterAST:hI(),additionsGutterAST:hI(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=cL({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,_I(void 0,`buffer`,this.size)),h?.push(pH(this.size))):(x.pushToGutter(`deletions`,_I(void 0,`buffer`,this.size)),g?.push(pH(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,gI(t,n,r,i))};function T(e){C.flush(),a===`unified`?EH(`unified`,e,x):(EH(`deletions`,e,x),EH(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),vL({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&T({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&CH(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=DH(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=DH(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),TH({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&CH(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&wH(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=DH(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=DH(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}TH({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&wH(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),E=_?n.noEOFCRDeletions:!1,D=_?n.noEOFCRAdditions:!1,O=(s?.noEOFCR??!1)||E,ee=(o?.noEOFCR??!1)||D;if(ee||O){if(a===`split`&&C.flush(),O){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(mH(e)),x.pushToGutter(`unified`,_I(e,`metadata`,1))):(x.deletionsContentAST.push(mH(e)),x.pushToGutter(`deletions`,_I(e,`metadata`,1)),ee||(x.pushToGutter(`additions`,_I(void 0,`buffer`,1)),x.additionsContentAST.push(pH(1))))}if(ee){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(mH(e)),x.pushToGutter(`unified`,_I(e,`metadata`,1))):(x.additionsContentAST.push(mH(e)),x.pushToGutter(`additions`,_I(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,_I(void 0,`buffer`,1)),x.deletionsContentAST.push(pH(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let E=Math.max(vH(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),D=t.bufferBefore>0||t.bufferAfter>0,O=!f&&e.type!==`deleted`,ee=!f&&e.type!==`new`,te=x.rowCount>0||D;h=O&&te?h:void 0,g=ee&&te?g:void 0,_=f&&te?_:void 0;let ne=this.createPreElement(g!=null&&h!=null,E);return{fileDiff:e,unifiedGutterAST:f&&te?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:ee&&te?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:O&&te?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:ne,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(e),totalLines:E,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=hI(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,cz(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push($({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push($({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push($({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return VA(this.renderFullAST(e,t))}renderPartialHTML(e,t){return VA(t==null?e:$({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!ER(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(TR(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(TR(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){TH({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}TH({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(this.annotationSlotName(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(this.annotationSlotName(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}getAnnotationNames(e){return e?.map(e=>this.annotationSlotName(e))??[]}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return uz({fileOrDiff:e,mode:t,stickyHeader:n})}},xH=new Intl.PluralRules(`en-US`);function SH(e){return`${e} unmodified line${xH.select(e)===`one`?``:`s`}`}function CH(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function wH(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function TH({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,_I(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,_I(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,_I(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function EH(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,gH({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(gH({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,gH({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(gH({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=_H(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?SH(n):`More unchanged context may be available`;c.pushToGutter(e,gH({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(gH({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function DH(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function OH(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function kH(e,t,n,r){let i=OH(e),a=OH(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let e=s;e<t.length;e++)l[e]??=AH(e,r.getLineText(e));return l}function AH(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function jH(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function MH(e){if(e.lang!=null)return[e.lang];let t=rI(e.prevName??e.name),n=rI(e.name);return t===n?[n]:[t,n]}function NH(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function PH(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function FH(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function IH(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function LH(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Wz(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function RH(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function zH(e){let t={...e};return delete t.cacheKey,t}function BH(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??rI(e.name),r=t.lang??rI(t.name),i=e.type!==`new`,a=t.type!==`new`;return e.name!==t.name||n!==r||i!==a||e.deletionLines.length!==t.deletionLines.length||e.deletionLines.some((e,n)=>e!==t.deletionLines[n])}function VH(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function HH(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&VH(n.lines,t.deletionLines)}var UH=-1,WH=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++UH}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:zw},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new ZR,this.scrollSyncManager=new bV,this.interactionManager=new AR(`diff`,jR(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??zw}getHunksRendererOptions(e){return LH(e)}createHunksRenderer(e){return new bH(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;let r=e.hunks.at(-1),i,a;hunkIterator:for(let o of e.hunks){let e=n===`deletions`?o.deletionStart:o.additionStart,s=n===`deletions`?o.deletionCount:o.additionCount,c=Zw(e,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(t<c){let e=c-t;i=Math.max(u-e,0),a=Math.max(l-e,0);break hunkIterator}if(t>=c+s){if(o===r){let e=t-(c+s);i=u+o.unifiedLineCount+e,a=l+o.splitLineCount+e;break hunkIterator}continue}for(let e of o.hunkContent)if(e.type===`context`){if(t<c+e.lines){let e=t-c;a=l+e,i=u+e;break hunkIterator}c+=e.lines,l+=e.lines,u+=e.lines}else{let r=n===`deletions`?e.deletions:e.additions;if(t<c+r){let r=t-c;i=u+(n===`additions`?e.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(e.deletions,e.additions),u+=e.deletions+e.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(jR(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!QF(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Uz(this.editSession?.annotations,e,Yw);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Hz(t,e,Yw))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.getLatestAnnotations().length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){let{editor:t}=this;vR(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSession=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=gB(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||YH(this.pre,qH({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||XH(this.headerElement,JH({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,forceRender:l||a.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Qz(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)e instanceof HTMLElement&&e.tagName.toLowerCase()===`code`&&(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?vV(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=this.fileDiff,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||t==null||!RH(e)||this.pendingFiles?.fileDiff===e)return;let n=this.loadFilesForDiff(e,t),r=this.pendingFiles={fileDiff:e,promise:n};r.promise=n.finally(()=>{this.pendingFiles===r&&(this.pendingFiles=void 0)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}}async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(SB(`merge`,e,t),this.setHydratedState(t),this.startHydratedEditSession(e)){this.rerender();return}await fB(()=>this.primeHighlightCache(e)),this.enabled&&this.fileDiff===e&&this.rerender()}}startHydratedEditSession(e){if(e.isPartial)throw Error(`FileDiff.startHydratedEditSession: diffs cannot be partial for editing`);if(this.fileDiff!==e)return!1;let{editor:t}=this;return this.editSession?.outgoingDiff==null?t==null||this.editSession!=null?!1:(this.installEditSession(e,t.__getDocumentContents(GH(e)),t.__getDocumentSessionState()),!0):(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(XI(this.fileDiff,e))return!1;let n=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,n==null?this.editor!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e,this.editor.__getDocumentContents(GH(e)),this.editor.__getDocumentSessionState())):(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=n)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=Vz(t,Yw,this.editSession.annotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:xB(t.contents),a=n!=null&&HH(n,e);if(n!=null&&!a)throw Error(`FileDiff: retained session cannot resume against a different old file`);if(t!=null&&t.contents!==r&&!a)throw Error(`FileDiff: retained edits are missing their diff session state`);let o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===r,s=zH(e);t!=null&&i!=null&&!o&&(s.name=t.name,s.lang=t.lang),a&&n!=null&&i!=null&&(s.additionLines=i,s.type=n.type,s.hunks=n.hunks,s.editSessionDirty=!0,zV(s)),this.editSession={diff:s,annotations:this.editSession?.annotations??Vz(this.lineAnnotations,Yw),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(s,o&&!a?e:void 0)}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let l=gB(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!KH(u,this.deletionFile)||!KH(d,this.additionFile)),y=e!=null&&!XI(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&az(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&!y||e==null&&!v)){let e=this.applyCachedThemeState(p);return e&&this.finalizeRender(),e}let x;e==null&&_&&(v||this.fileDiff==null)&&(x=vV(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,i):x!=null&&(y=!0,this.updateExternalDiff(x,i)),y&&this.clearReusableHeader(),i!=null&&this.setLineAnnotations(i);let C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(ZV(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:w=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(C,Jw);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a,e.fileDiff),this.renderSeparators([]),this.renderedDiff=e?.fileDiff??C,this.injectUnsafeCSS()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g||!XI(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(C,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a,t.fileDiff),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData),this.renderedDiff=t.fileDiff}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){let{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),r=this.computeEditorRenderRange(this.renderRange),i=this.getLatestDiff();if(e==null||t==null||i==null||i.isPartial)return;let a=a=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==i)return;let o=this.editSession?.outgoingDiff,s=this.fileDiff,c=o!=null&&s!=null&&o!==i,l=c?BH(o,s):!1;e.__syncRenderView({highlighter:a,fileContainer:t,fileDiff:i,lineAnnotations:n,renderRange:r,externalDocument:c,resetHistory:l})},o=this.getTheme(),s=i.lang??rI(i.name),c=XF({theme:o,lang:s});c==null?YF({themes:lT(o),langs:[`text`,s],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}computeEditorRenderRange(e){let t=this.getLatestDiff();if(e==null||t==null||gz(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return vL({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:n,outgoingDiff:r}={}}=this;if(r!=null&&t!=null){if(!t.isPartial&&BH(r,t))return;n=r}if(!(n==null||n.isPartial))return{diffSession:{oldFile:n.type===`new`?null:{name:n.prevName??n.name,lines:e?[...n.deletionLines]:n.deletionLines},type:n.type,hunks:e?_B(n.hunks):n.hunks},hasChanges:n.editSessionDirty===!0}}__attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw Error(`FileDiff.__attachEditor: an editor is already attached`);let t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`FileDiff.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){let{fileDiff:t}=this,n=this.editSession?.outgoingDiff;n!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===n&&this.installEditSession(t);let r=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;r==null?this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff):this.installEditSession(r,e.__getDocumentContents(GH(r)),e.__getDocumentSessionState()),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();let i=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(i!=null&&this.hunksRenderer.diffCache===i&&(this.renderedDiff=i),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,fileDiff:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{diff:a,annotations:o}=n;if(this.editor!=null)throw Error(`FileDiff.__completeEditSession: detach the editor before completing the session`);this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();let s=o?.current,c,l=null,u=null,d=!1,f;if(t==null)throw Error(`FileDiff.__completeEditSession: editor is required for completion`);let p=vB(a),m={name:p.name,contents:p.additionLines.join(``)};p.lang!=null&&(m.lang=p.lang);let h={fileDiff:p,editor:t,originalFileDiff:r,oldFile:p.type===`new`?null:{name:p.prevName??p.name,contents:p.deletionLines.join(``)},newFile:m,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(h);try{if(t.__emitEditComplete(h),this.options.onEditComplete?.(h)===`accept`){if(p.cacheKey!=null&&p.cacheKey===r.cacheKey)throw Error(`FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey`);c=p,l=h.oldFile,u=h.newFile}}catch(e){d=!0,f=e}if(e&&c!=null&&(this.fileDiff=c,this.additionFile!=null&&(this.deletionFile=l,this.additionFile=u),s!=null&&(this.lineAnnotations=s)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),d)throw f}finalizeEditSessionHunks(){let e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=YV(e,this.hunksRenderer.getExpandedHunksMap(),t);return ZV(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(XV(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){let n=this.editSession?.diff;if(n==null)throw Error(`FileDiff.applyDocumentChange: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let r=this.editSession?.diff;if(r==null)throw Error(`FileDiff.updateRenderCache: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(r);let{shouldRefreshDiffsView:i,lineCountChangeInFlight:a}=n;if(this.hunksRenderer.updateRenderCache(e,t,a)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){let e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){let t=this.getRenderedDiff();if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return uL({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.getRenderedDiff();if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return dL({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.getRenderedDiff(),{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=aL(o);if(e<s){let c=oL({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=lL({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=aL(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){_R(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(this.placeHolder.style.setProperty(`height`,`${e}px`),!0)}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||$I(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!IH(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!FH(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Ez(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Dz();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:xR(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):xR(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=xz;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{headerCache:{fileDiff:r,html:i,lastRenderedHTML:a}}=this,o=(n!==this.editSession?.diff&&XI(r,n)?i:void 0)??VA(e);if(this.headerCache.html=o,this.headerCache.fileDiff=n,o!==a){let e=document.createElement(`div`);e.innerHTML=o;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.headerCache.lastRenderedHTML=o}if(this.isContainerManaged)return;let{renderCustomHeader:s,renderHeaderPrefix:c,renderHeaderFilenameSuffix:l,renderHeaderMetadata:u}=this.options;if(s!=null){let e=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Rw,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let d=c?.(n)??void 0,f=l?.(n)??void 0,p=u?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Fw,d),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Iw,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Lw,p),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Oz(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Fz(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=Az(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Jz({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Iz(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Lz(this.themeCSSStyle.textContent??``,Az(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Zz()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?qz(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ZH(t[0]),a=ZH(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=VA(i),r.content.innerHTML=VA(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Kz({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Kz({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=Kz({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:n}){let{pre:r,codeUnified:i,codeAdditions:a,codeDeletions:o,options:{diffStyle:s=`split`}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;let c=this.getCodeColumns(s,i,o,a);if(c==null)return!1;let l=t.startingLine,u=n.startingLine,d=l+t.totalLines,f=u+n.totalLines,p=Math.max(l,u),m=Math.min(d,f);if(m<=p)return!1;let h=Math.max(0,p-l),g=Math.max(0,d-m),_=this.trimColumns({columns:c,trimStart:h,trimEnd:g,previousStart:l,overlapStart:p,overlapEnd:m,diffStyle:s});if(_<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<_)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let v=this.lastRowCount-_,y=(t,n)=>{if(!(n<=0))return this.hunksRenderer.renderDiff(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},b=y(u,Math.max(p-u,0));if(b==null&&u<p)return!1;let x=y(m,Math.max(f-m,0));if(x==null&&f>m)return!1;let S=(e,t)=>{if(e!=null){if(s===`unified`&&!Array.isArray(c))this.insertPartialHTML(s,c,e,t);else if(s===`split`&&Array.isArray(c))this.insertPartialHTML(s,c,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);v+=e.rowCount,this.renderedDiff=e.fileDiff}};return this.cleanupErrorWrapper(),S(b,`afterbegin`),S(x,`beforeend`),this.lastRowCount!==v&&(this.applyRowSpan(s,c,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`split`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;let r=(e,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(e,t),i=ZH(r?.[0]),a=ZH(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};r(`deletions`,n[0]),r(`additions`,n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`unified`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;let r=this.hunksRenderer.renderCodeAST(`unified`,t),i=ZH(r?.[0]),a=ZH(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=VA(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?qz(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ZH(t[0]),i=ZH(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&t.dataset.gutter!=null&&n.dataset.content!=null)return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};Cz(u,this.appliedPreAttributes)||($z(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function GH(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function KH(e,t){return e==null||t==null?e==null&&t==null:ZI(e,t)}function qH({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function JH({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function YH(e,t,n=!1){return!n&&e==null&&t}function XH(e,t,n=!1){return e==null&&t&&!n}function ZH(e){if(e!=null&&e.type===`element`)return e.children??[]}var QH=3e3,$H=new Map,eU=-1,tU=class extends WH{__id=`little-virtualized-file-diff:${++eU}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:$H,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=eL(n)}setMetrics(e,t=!1){let n=eL(e);(t||!fR(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.resetLayoutCache({includeEstimatedHeights:!1}),!0):!1}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){let t=this.getLatestAnnotations();return wR(t)?t.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!pR(t,e),r=n&&lU(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:uU(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=$H,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){let{cache:{heightDeltas:n,ghostTextRows:r,ghostTextRowsByIndex:i},metrics:{lineHeight:a}}=this;if(r===t)return!1;let o=this.getDiffStyle(),s=new Map;for(let[n,r]of t){let t=this.getLineIndexForDiff(e,n+1,`additions`);t!=null&&s.set(o===`split`?t[1]:t[0],r)}let c=!1;for(let e of new Set([...i.keys(),...s.keys()])){let t=((s.get(e)??0)-(i.get(e)??0))*a;if(t===0)continue;let r=(n.get(e)??0)+t;r===0?n.delete(e):n.set(e,r),this.cache.measuredHeightDeltaTotal+=t,c=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=s,c}reconcileHeights(){let e=!1,{options:{overflow:t=`scroll`},cache:{ghostTextRowsByIndex:n},metrics:{lineHeight:r}}=this,i=this.placeHolder==null?this.getRenderedDiff():this.getLayoutDiff();if(this.fileContainer==null||i==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(i,this.editor?.__getGhostTextRows()??$H);let a=this.getLatestAnnotations();if(this.placeHolder!=null||t===`scroll`&&a.length===0&&!this.isResizeDebuggingEnabled())return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let o=this.getDiffStyle(),s=o===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],c=this.hasFileAnnotations(i);if(this.renderRange!=null&&c&&ER(this.renderRange)){let t=nU(s)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!c&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of s){if(t==null)continue;let i=t.children[1];if(!(i instanceof HTMLElement))continue;let a=o===`split`&&t===this.codeDeletions;for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(i==null)continue;let s=mU(i,o),c=n.get(s)??0;if(a&&c>0)continue;let l=t.getBoundingClientRect().height+c*r,u=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(u=!0),l+=t.nextElementSibling.getBoundingClientRect().height);let d=this.getEstimatedLineHeight(u),f=this.cache.heightDeltas.get(s)??0,p=l-d;p!==f&&(e=!0,this.cache.measuredHeightDeltaTotal+=p-f,p===0?this.cache.heightDeltas.delete(s):this.cache.heightDeltas.set(s,p))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,r){let i=!1,a=!1,{pendingExpansions:o,pendingHydratedDiff:s,options:{collapsed:c=!1}}=this;if(s!=null&&(this.pendingHydratedDiff=void 0,s.expectedDiff===e&&(Object.assign(e,s.nextDiff),this.setHydratedState(s.files),this.startHydratedEditSession(e),this.forceRenderOverride=!0,i=!0,a=!0)),o!=null){this.pendingExpansions=void 0;for(let{hunkIndex:e,direction:t,expansionLineCountOverride:n}of o)this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,a=!0}let l=this.updateExternalDiff(e,r),{pendingRenderDiff:u,layoutDiffChanged:d,renderedDiffChanged:f,annotationsChanged:p}=this.updatePendingRender(e,r);return!this.forceRenderOverride&&(l||f||p)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||d||p)&&(i=!0),(d||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(a=!0),n?.metrics!=null&&(this.metrics=eL(n.metrics),i=!0,a=!0),this.currentCollapsed!==c&&(this.currentCollapsed=c,i=!0),i?this.resetLayoutCache({includeEstimatedHeights:a}):a&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t=`additions`){let n=this.getLayoutDiff();if(n==null||e<1)return;let r=this.getLineIndexForDiff(n,e,t);if(r==null)return;let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,c=this.getDiffStyle(),l=this.getHunkSeparatorType(),u=c===`split`?r[1]:r[0];this.approximateLayoutCheckpoints(n);let d=tL(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return vL({diff:n,diffStyle:c,startingLine:f?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=c===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=gL({type:l,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(p+=r.gapBefore,u>=o-n&&u<o)return m={top:p,height:r.height},!0;p+=r.height+r.gapAfter}}let s=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===u)return m={top:p,height:s},!0;if(p+=s,r>0){let e=_L({type:l,metrics:this.metrics});if(e!=null){if(u>o&&u<=o+r)return m={top:p+e.gapBefore,height:e.height},!0;p+=e.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutDiff();if(t==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);let c=this.getLayoutCheckpointBeforeTop(e),l=c?.top??tL(this.metrics,n)+this.cache.fileAnnotationHeight,u;return vL({diff:t,diffStyle:o,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:a,additionLine:c})=>{let d=o===`split`?c?.splitLineIndex??a?.splitLineIndex:c?.unifiedLineIndex??a?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=gL({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(l+=e.totalHeight)}if(l>=e&&(a==null?c!=null&&(u={lineNumber:c.lineNumber,side:`additions`,top:l}):u={lineNumber:a.lineNumber,side:`deletions`,top:l},u!=null))return!0;let f=this.getLineHeight(d,(c?.noEOFCR??!1)||(a?.noEOFCR??!1));if(l+=f,i>0){let e=_L({type:s,metrics:this.metrics});e!=null&&(l+=e.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!XI(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(this.isAdvancedMode()){let n=SB(`clone`,e,t);if(await fB(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(SB(`merge`,e,t),this.setHydratedState(t),!this.startHydratedEditSession(e)&&(await fB(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return uL({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),this.enabled&&this.fileDiff!=null&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;let e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!XI(this.getRenderedDiff(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});let i=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??$H);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=tL(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=pB({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:dU(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=gB(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!pU(s,this.deletionFile)||!pU(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=vV(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!XI(this.fileDiff,u),m=p||l;if(e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;p&&this.updateExternalDiff(u,r);let{pendingRenderDiff:h,layoutDiffChanged:g,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(u,r);if((v||g)&&this.resetLayoutCache({includeEstimatedHeights:g}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,h));else{this.computeApproximateSize(!1,h);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return a!=null&&(this.deletionFile=s,this.additionFile=c),p&&this.clearReusableHeader(),this.renderPlaceholder(this.height);let y=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(h,b,y);return super.render({fileDiff:u,fileContainer:e,renderRange:x,lineAnnotations:r,forceRender:(d??n)||v||_||p,...a,...i})}finalizeRender(){if(this.getRenderedDiff()!==this.pendingRender?.diff)throw Error(`VirtualizedFileDiff.render: rendered a different diff than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestDiff(e)??e,r=this.getRenderedDiff(),{pendingRender:i}=this,a=i?.diff??r,o=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!XI(a,o),renderedDiffChanged:!XI(r,o)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return fU(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=dU(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=rU(this.cache.heightDeltas),u=tL(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=oU(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+sU(i,e)*this.metrics.lineHeight+iU(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=QH}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+iU(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=oL({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?gL({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?lL({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?_L({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:cU({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=oL({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=lL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=dU(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=tL(this.metrics,i),h=e.hunks.length>0?rL(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,T=w,E=[],D=(n+r)/2,O=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),ee=t+(O?.top??_),te=O?.renderedLineIndex??0,ne,re,ie;if(vL({diff:e,diffStyle:l,startingLine:O?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?gL({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;ee+=y;let b=te%s===0,x=Math.floor(te/s);if(b&&(E[x]=ee-(t+_+y),ie!=null)){if(ie<=0)return!0;ie--}let S=this.getLineHeight(l===`split`?m:h,g);if(ee>n-S&&ee<r&&(ne??=x),re==null&&ee+S>D&&(re=x),ie==null&&ee>=r&&b&&(ie=T),te++,ee+=S,c>0||v&&d){let e=_L({type:u,metrics:this.metrics});e!=null&&(ee<r&&ee+e.totalHeight>n&&(ne??=x),re==null&&ee+e.totalHeight>D&&(re=x),ee+=e.totalHeight)}return!1}}),ne==null){if(x)ne=0,re=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}re??=ne;let k=Math.round(re-w/2),ae=Math.max(0,Math.ceil(p/s)-w),oe=Math.max(0,Math.min(k,ae)),se=oe*s,A=k<0?C+k*s:C,ce=E[oe]??0,le=se===0?0:g+ce,ue=oe+A/s,de=ue<E.length?v-E[ue]:v-(ee-t-_);return{startingLine:se,totalLines:A,bufferBefore:le,bufferAfter:Math.max(0,de)}}};function nU(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===CR&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function rU(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function iU({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=aU(e,n);return(t[aU(e,r)]??0)-(t[i]??0)}function aU(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function oU(e){return Math.ceil(e/QH)*QH}function sU(e,t){let n=0;for(let r of e)r<t&&n++;return n}function cU({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function lU(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function uU(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function dU(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function fU(e){return typeof e==`function`?`custom`:e??`line-info`}function pU(e,t){return e==null||t==null?e==null&&t==null:ZI(e,t)}function mU(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function hU(e,t){return typeof window>`u`&&t!=null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,J.jsx)(J.Fragment,{children:e})}var gU=(0,q.createContext)(void 0);function _U(){return(0,q.useContext)(gU)}var vU=typeof window>`u`?q.useEffect:q.useLayoutEffect;function yU({file:e,options:t,editorOptions:n,editStateKey:r,lineAnnotations:i,selectedLines:a,prerenderedHTML:o,metrics:s,hasGutterRenderUtility:c,hasCustomHeader:l,disableWorkerPool:u,edit:d,onEditChange:f,onEditComplete:p}){let m=_U(),h=a!==void 0,g=(0,q.useContext)(dR),_=Cw(),v=bw(e=>f?.(e)),y=f==null?void 0:v,b=(0,q.useRef)(null),x=bw(e=>{let t=p?.(e)??`reject`;return t===`accept`&&(b.current={file:{installed:e.file,stale:e.originalFile},annotations:{installed:e.lineAnnotations,stale:e.originalLineAnnotations}}),t}),S=p==null?void 0:x,C=(0,q.useRef)(null),w=(0,q.useRef)(null),T=bw(()=>{if(_==null)throw Error(`File: EditContext is not attached`);return _(`file`,n??{},r)}),E=bw(n=>{if(n!=null){if(C.current!=null)throw Error(`File: An instance should not already exist when a node is created`);m==null?C.current=new rB(xU({controlledSelection:h,hasCustomHeader:l,hasGutterRenderUtility:c,onEditChange:y,onEditComplete:S,options:t}),u?void 0:g,!0):C.current=new uB(xU({controlledSelection:h,hasCustomHeader:l,hasGutterRenderUtility:c,onEditChange:y,onEditComplete:S,options:t}),m,s,u?void 0:g,!0),d&&w.current==null&&(w.current=SU(C.current,T)),C.current.hydrate({file:e,fileContainer:n,lineAnnotations:i,prerenderedHTML:o})}else{if(C.current==null)throw Error(`File: A File instance should exist when unmounting`);C.current.cleanUp(),C.current=null,w.current=null}});return vU(()=>{let{current:n}=C;if(n==null)return;let r=xU({controlledSelection:h,hasCustomHeader:l,hasGutterRenderUtility:c,onEditChange:y,onEditComplete:S,options:t}),o=r!==void 0&&!pR(n.options,r);if(n.setOptions(r),!d&&w.current!=null){let{current:e}=w;w.current=null,e()}let s=bU(e,i,b);n.render({file:s.file,lineAnnotations:s.lineAnnotations,forceRender:o}),a!==void 0&&n.setSelectedLines(a),d&&w.current==null&&(w.current=SU(n,T))}),{ref:E,getHoveredLine:(0,q.useCallback)(()=>C.current?.getHoveredLine(),[]),getAnnotationSlotName:(0,q.useCallback)(e=>C.current?.getAnnotationSlotName(e)??Yw(e),[])}}function bU(e,t,n){let{current:r}=n;if(r==null)return{file:e,lineAnnotations:t};let{file:i,annotations:a}=r,o=e;i!=null&&(SR(e,i.stale)?o=i.installed:r.file=null);let s=t;return a!=null&&(t===a.stale?s=a.installed:r.annotations=null),r.file==null&&r.annotations==null&&(n.current=null),{file:o,lineAnnotations:s}}function xU({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r,onEditChange:i,onEditComplete:a}){return t||r||n||i!=null||a!=null?{...e,controlledSelection:t,renderCustomHeader:n?Ew:e?.renderCustomHeader,renderGutterUtility:r?Ew:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}:e}function SU(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function CU({file:e,lineAnnotations:t,selectedLines:n,options:r,editorOptions:i,editStateKey:a,metrics:o,className:s,style:c,renderAnnotation:l,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,prerenderedHTML:m,renderGutterUtility:h,disableWorkerPool:g=!1,edit:_=!1,onEditChange:v,onEditComplete:y}){let{ref:b,getHoveredLine:x,getAnnotationSlotName:S}=yU({file:e,options:r,editorOptions:i,editStateKey:a,metrics:o,lineAnnotations:t,selectedLines:n,prerenderedHTML:m,hasGutterRenderUtility:h!=null,hasCustomHeader:u!=null,disableWorkerPool:g,edit:_,onEditChange:v,onEditComplete:y}),C=rT({file:e,renderAnnotation:l,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderGutterUtility:h,lineAnnotations:t,getHoveredLine:x,getAnnotationSlotName:S});return(0,J.jsx)(Dw,{ref:b,className:s,style:c,children:hU(C,m)})}var wU=typeof window>`u`?q.useEffect:q.useLayoutEffect;function TU({fileDiff:e,oldFile:t,newFile:n,options:r,editorOptions:i,editStateKey:a,lineAnnotations:o,selectedLines:s,prerenderedHTML:c,metrics:l,hasGutterRenderUtility:u,hasCustomHeader:d,disableWorkerPool:f,edit:p,onEditChange:m,onEditComplete:h}){let g=_U(),_=s!==void 0,v=(0,q.useContext)(dR),y=Cw(),b=bw(e=>m?.(e)),x=m==null?void 0:b,S=(0,q.useRef)(null),C=bw(r=>{let i=h?.(r)??`reject`;return i===`accept`&&(S.current={fileDiff:{installed:r.fileDiff,stale:r.originalFileDiff},filePair:e==null?{fileDiff:r.fileDiff,installed:{oldFile:r.oldFile,newFile:r.newFile},stale:{oldFile:t??null,newFile:n??null}}:null,annotations:{installed:r.lineAnnotations,stale:r.originalLineAnnotations}}),i}),w=h==null?void 0:C,T=EU({acceptedCache:S,fileDiff:e,newFile:n,oldFile:t,parseDiffOptions:r?.parseDiffOptions}),E=(0,q.useRef)(null),D=(0,q.useRef)(null),O=bw(()=>{if(y==null)throw Error(`FileDiff: EditContext is not attached`);return y(`file-diff`,i??{},a)}),ee=bw(e=>{if(e!=null){if(E.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);g==null?E.current=new WH(kU({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),f?void 0:v,!0):E.current=new tU(kU({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),g,l,f?void 0:v,!0),p&&D.current==null&&(D.current=AU(E.current,O)),E.current.hydrate({fileDiff:T,fileContainer:e,lineAnnotations:o,prerenderedHTML:c})}else{if(E.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);E.current.cleanUp(),E.current=null,D.current=null}});return wU(()=>{let{current:e}=E;if(e==null)return;let t=kU({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),n=t!==void 0&&!pR(e.options,t);if(e.setOptions(t),!p&&D.current!=null){let{current:e}=D;D.current=null,e()}let i=OU(T,o,S);e.render({forceRender:n,fileDiff:i.fileDiff,lineAnnotations:i.lineAnnotations}),s!==void 0&&e.setSelectedLines(s),p&&D.current==null&&(D.current=AU(e,O))}),{fileDiff:T,ref:ee,getHoveredLine:(0,q.useCallback)(()=>E.current?.getHoveredLine(),[]),getAnnotationSlotName:(0,q.useCallback)(e=>E.current?.getAnnotationSlotName(e)??Yw(e),[])}}function EU({acceptedCache:e,fileDiff:t,newFile:n,oldFile:r,parseDiffOptions:i}){return(0,q.useMemo)(()=>{if(t!=null)return t;let{current:a}=e,o=a?.filePair;if(a!=null&&o!=null){if(DU(r,n,o.stale)||DU(r,n,o.installed))return o.fileDiff;a.filePair=null}return vV(r??null,n??null,i)},[e,t,r,n,i])}function DU(e,t,n){return SR(e??void 0,n.oldFile??void 0)&&SR(t??void 0,n.newFile??void 0)}function OU(e,t,n){let{current:r}=n;if(r==null)return{fileDiff:e,lineAnnotations:t};let{fileDiff:i,annotations:a}=r,o=e;i!=null&&(XI(e,i.stale)?o=i.installed:r.fileDiff=null);let s=t;return a!=null&&(t===a.stale?s=a.installed:r.annotations=null),r.fileDiff==null&&r.annotations==null&&r.filePair==null&&(n.current=null),{fileDiff:o,lineAnnotations:s}}function kU({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r,onEditChange:i,onEditComplete:a}){return t||r||n||i!=null||a!=null?{...e,controlledSelection:t,renderCustomHeader:n?Ew:e?.renderCustomHeader,renderGutterUtility:r?Ew:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}:e}function AU(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function jU(e){let t=YB(e);if(t.length!==1)throw console.error(t),Error(`PatchDiff: Provided patch must include only 1 patch, with 1 diff`);let{files:n}=t[0];if(n.length!==1)throw console.error(n),Error(`FileDiff: Provided patch must contain exactly 1 file diff`);return n[0]}function MU({patch:e,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,className:s,style:c,prerenderedHTML:l,renderAnnotation:u,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderGutterUtility:h,disableWorkerPool:g=!1,edit:_=!1,onEditChange:v,onEditComplete:y}){let b=NU(e),{ref:x,getHoveredLine:S,getAnnotationSlotName:C}=TU({fileDiff:b,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,prerenderedHTML:l,hasGutterRenderUtility:h!=null,hasCustomHeader:d!=null,disableWorkerPool:g,edit:_,onEditChange:v,onEditComplete:y}),w=tT({fileDiff:b,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderAnnotation:u,lineAnnotations:a,renderGutterUtility:h,getHoveredLine:S,getAnnotationSlotName:C});return(0,J.jsx)(Dw,{ref:x,className:s,style:c,children:hU(w,l)})}function NU(e){return(0,q.useMemo)(()=>jU(e),[e])}var PU=`~effect/PrimaryKey`,FU=`~effect/rpc/RpcSchema/StreamSchema`;function IU(e){return A(e,FU)}function LU(e){return IU(e)?Xn({success:e.success,error:e.error}):Yn()}var RU=qb(Mh);function zU(e,t){return sx(RU.ast,{[FU]:FU,success:e,error:t})}var BU=`~effect/rpc/Rpc`,VU={[BU]:BU,pipe(){return u(this,arguments)},setSuccess(e){return HU({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return HU({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return HU({_tag:this._tag,payloadSchema:cx(e)?e:bx(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return HU({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return HU({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return HU({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Ar(this.annotations,e,t)})},annotateMerge(e){return HU({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Br(this.annotations,e)})}},HU=e=>{function t(){}return Object.setPrototypeOf(t,VU),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},UU=(e,t)=>{let n=t?.success??vx,r=t?.error??fx,i=t?.defect??Kx(),a;return a=t?.primaryKey?class extends iS(`effect/rpc/Rpc/${e}`)(t.payload){[PU](){return t.primaryKey(this)}}:cx(t?.payload)?t?.payload:t?.payload?bx(t?.payload):vx,HU({_tag:e,payloadSchema:a,successSchema:t?.stream?zU(n,r):n,errorSchema:t?.stream?fx:r,defectSchema:i,annotations:Dr(),middlewares:new Set})},WU=new WeakMap,GU=e=>{if(WU.has(e))return WU.get(e);let t=e,n=new Set([t.errorSchema]),r=LU(t.successSchema);$n(r)&&n.add(r.value.error);for(let e of t.middlewares)n.add(e.error);let i=Yx($n(r)?vx:t.successSchema,wx([...n]),t.defectSchema);return WU.set(e,i),i},KU=`~effect/rpc/Rpc/Wrapper`,qU=e=>KU in e,JU=`~effect/http/HttpClientError`,YU=class e extends aS(JU)({_tag:Ax(`HttpError`),kind:Tx([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:ux(Kx())}){static fromHttpClientError(t){return new e({_tag:`HttpError`,kind:t.reason._tag,cause:t.reason})}},XU=`~effect/socket/Socket`,ZU=lr(`effect/socket/Socket`),QU=e=>ZU.of({[XU]:XU,reader:e.reader,writer:e.writer}),$U=new TextEncoder,eW=`~effect/socket/Socket/CloseEvent`,tW=e=>A(e,eW),nW=`~effect/socket/Socket/SocketError`,rW=e=>A(e,nW),iW=class extends aS(`effect/socket/Socket/SocketReadError`)({_tag:Ax(`SocketReadError`),cause:Kx()}){message=`An error occurred during Read`},aW=class extends aS(`effect/socket/Socket/SocketWriteError`)({_tag:Ax(`SocketWriteError`),cause:Kx()}){message=`An error occurred during Write`},oW=class extends aS(`effect/socket/Socket/SocketOpenError`)({_tag:Ax(`SocketOpenError`),kind:Tx([`Unknown`,`Timeout`]),cause:Kx()}){get message(){return this.kind===`Timeout`?`timeout waiting for "open"`:`An error occurred during Open`}},sW=class e extends aS(`effect/socket/Socket/SocketUpgradeError`)({_tag:Ax(`SocketUpgradeError`),cause:ux(Kx())}){static unsupported=()=>H(new uW({reason:new e({})}));get message(){return this.cause===void 0?`Socket does not support TLS upgrade`:`An error occurred during TLS upgrade`}},cW=class extends aS(`effect/socket/Socket/SocketCloseError`)({_tag:Ax(`SocketCloseError`),code:zx,closeReason:ux(K)}){get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}},lW=wx([iW,aW,oW,sW,cW]),uW=class extends oS(nW)(`SocketError`,{_tag:Ax(`SocketError`),reason:lW}){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[nW]=nW;static is(e){return rW(e)}message=this.reason.message},dW=(e,t)=>new uW({reason:new cW({code:e,closeReason:t})}),fW=class extends lr()(`@effect/platform/Socket/WebSocketConstructor`){},pW=z(fW)((e,t)=>{if(t!==void 0&&typeof t!=`string`&&!Array.isArray(t))throw TypeError(`WebSocket client options are not supported by the global WebSocket constructor`);return new globalThis.WebSocket(e,t)}),mW=(e,t)=>fW.use(n=>gW(Vf((typeof e==`string`?V(e):e).pipe(mf(e=>n(e,t?.protocols))),e=>ef(()=>e.close(1e3))),t)),hW=e=>`pause`in e&&typeof e.pause==`function`,gW=(e,t)=>lf(n=>{let r,i=bp(!1),a=n.context,o=af(function*(){let n=yield*Rf,a=yield*Vu(e,n);`binaryType`in a&&(a.binaryType=`arraybuffer`);let o=hW(a),s=t?.highWaterMark??(o?_W:void 0),c=a.readyState===1,l=o&&`isPaused`in a&&a.isPaused===!0,u=[],d=0,f,p,m;function h(){o&&!l&&(a.pause(),l=!0)}function g(){o&&l&&(a.resume(),l=!1)}function _(){let e=u;return u=[],d=0,f===void 0&&g(),e}function v(){if(p===void 0||u.length===0)return;let e=p;p=void 0,e(V(_()))}function y(e){u.push(e),s!==void 0&&(d+=typeof e==`string`?$U.encode(e).byteLength:e.byteLength),p!==void 0&&v(),o&&d>=s?h():!o&&!p&&s!==void 0&&d>s&&b(new uW({reason:new iW({cause:Error(`Socket highWaterMark of ${s} bytes exceeded`)})}))}function b(e){if(f===void 0&&(f=e),m!==void 0){let{cleanup:e,resume:t}=m;m=void 0,e(),t(H(f))}if(p!==void 0){let e=p;p=void 0,e(u.length>0?V(_()):H(f))}}function x(e){let t=e.data;if(typeof Blob<`u`&&t instanceof Blob){t.arrayBuffer().then(e=>y(new Uint8Array(e)),e=>{b(new uW({reason:new iW({cause:e})}))});return}y(t instanceof ArrayBuffer?new Uint8Array(t):t)}function S(e){b(new uW({reason:c?new iW({cause:e}):new oW({kind:`Unknown`,cause:e})}))}function C(e){b(dW(typeof e.code==`number`?e.code:1006,e.reason))}return a.addEventListener(`message`,x),a.addEventListener(`error`,S,{once:!0}),a.addEventListener(`close`,C,{once:!0}),yield*Uu(n,ef(()=>{if(b(dW(1006)),a.removeEventListener(`message`,x),a.removeEventListener(`error`,S),a.removeEventListener(`close`,C),o)try{g()}catch{}i.closeUnsafe(),r=void 0})),a.readyState>=2?yield*H(f??dW(1006)):(c||=(yield*nf(e=>{let t=()=>{m?.resume===e&&(m=void 0,a.removeEventListener(`open`,t),e(tf))},n=()=>a.removeEventListener(`open`,t);return m={resume:e,cleanup:n},a.addEventListener(`open`,t,{once:!0}),ef(()=>{m?.resume===e&&(m=void 0),n()})}).pipe(Ef({duration:t?.openTimeout??1e4,orElse:()=>H(new uW({reason:new oW({kind:`Timeout`,cause:Error(`timeout waiting for "open"`)})}))})),!0),f===void 0&&d<s&&g(),r=a,i.openUnsafe(),{pull:nf(e=>u.length>0?e(V(_())):f===void 0?(p=e,ef(()=>{p===e&&(p=void 0)})):e(H(f))),upgrade:sW.unsupported})}).pipe(If(e=>Br(a,e))),s=e=>$d(()=>{let t=r;if(t===void 0)return i.whenOpen(s(e));try{return tW(e)?t.close(e.code,e.reason):t.send(e),tf}catch(e){return H(new uW({reason:new aW({cause:e})}))}}),c=e=>$d(()=>{let t=r;if(t===void 0)return i.whenOpen(c(e));try{for(let n=0;n<e.length;n++)t.send(e[n]);return tf}catch(e){return H(new uW({reason:new aW({cause:e})}))}});return V(QU({reader:o,writer:V({write:s,writeAll:c})}))}),_W=65536,vW=class extends lr()(`effect/workers/Transferable/Collector`){},yW=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return vW.of({addAllUnsafe:t,addAll:e=>ef(()=>t(e)),readUnsafe:n,read:ef(n),clearUnsafe:r,clear:ef(r)})},bW=wx([class extends aS(`effect/workers/WorkerError/WorkerSpawnError`)({_tag:Ax(`WorkerSpawnError`),message:K,cause:ux(Kx())}){},class extends aS(`effect/workers/WorkerError/WorkerSendError`)({_tag:Ax(`WorkerSendError`),message:K,cause:ux(Kx())}){},class extends aS(`effect/workers/WorkerError/WorkerReceiveError`)({_tag:Ax(`WorkerReceiveError`),message:K,cause:ux(Kx())}){},class extends aS(`effect/workers/WorkerError/WorkerUnknownError`)({_tag:Ax(`WorkerUnknownError`),message:K,cause:ux(Kx())}){}]),xW=`~effect/rpc/RpcClientError`,SW=class extends aS(`effect/rpc/RpcClientError/RpcClientDefect`)({_tag:Ax(`RpcClientDefect`),message:K,cause:Kx()}){},CW=class extends aS(xW)({_tag:Ax(`RpcClientError`),reason:wx([bW,lW,YU,SW])}){[xW]=xW;get message(){return`${this.reason._tag}: ${this.reason.message}`}},wW=e=>e,TW={_tag:`Ping`},EW=sS,DW=class extends lr()(`effect/rpc/RpcSerialization`){},OW=class extends ua(`MaxBufferSizeExceeded`){get message(){return`RPC serialization buffer exceeded the maximum size of ${this.maxBufferSize}`}},kW=16777216,AW=(e,t)=>t!==`unbounded`&&e>t,jW=(e=>{let t=e?.maxBufferSize??kW;return DW.of({contentType:`application/ndjson`,includesFraming:!0,codecFor:EW,makeUnsafe:()=>{let e,n=``,r=e=>{throw n=``,new OW({maxBufferSize:e})};return{decode:i=>{n+=typeof i==`string`?i:(e??=new TextDecoder).decode(i,{stream:!0});let a=0,o=n.indexOf(`
1550
+ `,a),s=[];for(;o!==-1;){AW(o-a,t)&&r(t);let e=n.slice(a,o);a=o+1;try{s.push(JSON.parse(e))}catch{}o=n.indexOf(`
1551
+ `,a)}return n=n.slice(a),AW(n.length,t)&&r(t),s},encode:e=>{if(Array.isArray(e)){if(e.length===0)return;let t=``;for(let n=0;n<e.length;n++)t+=JSON.stringify(e[n])+`
1552
+ `;return t}return JSON.stringify(e)+`
1553
+ `}}}})})(),MW=z(DW)(jW),NW=e=>$d(()=>{let t=new Set,n=new Map,r=new Map,i=(e,t)=>Mf(r=>{let i=n.get(e);return i||(i=[],n.set(e,i)),i.push([t,r]),tf});return mf(e((e,t)=>{let n=r.get(e);return n?n(t):i(e,t)},t),e=>({...e,run(e,i){return af(function*(){t.add(e),r.set(e,i);let a=n.get(e);if(a){n.delete(e);for(let[e,t]of a)yield*Pf($d(()=>i(e)),t)}return yield*Wf(rf,()=>(t.delete(e),r.delete(e),tf))})}}))}),PW=0,FW=sp(function*(e,t){let n=t?.spanPrefix??`RpcClient`,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>PW++),o=yield*jf(),s=Fr(o,zu),c=new Map,l=!1;yield*Uu(s,lf(e=>(l=!0,u(Eu(e.id)))));let u=sp(function*(e){for(let[t,n]of c)c.delete(t),n._tag===`Queue`?yield*e._tag===`Success`?am(n.queue):rm(n.queue,e.cause):n.resume(e)}),d=e=>{let r=IU(e.successSchema),a=h(e);return(o,s)=>{let c=s?.headers?Og(s.headers):Dg,l=s?.context??Dr();if(!r){let r=t=>f(e,a,t,e.payloadSchema.make(o),c,l,s?.discard??!1);return i?r(void 0):Xf(`${n}.${e._tag}`,{attributes:t.spanAttributes},r)}let u=p(e,a,e.payloadSchema.make(o),c,s?.streamBufferSize??16,l);return s?.asQueue?u:Vh(mf(u,zh))}},f=(e,n,r,i,o,s,u)=>lf(d=>{if(l)return Gf;let f=a(),p=n(e=>t.onFromClient({message:e,context:s,discard:u}),{_tag:`Request`,id:f,tag:e._tag,payload:i,...r?{traceId:r.traceId,spanId:r.spanId,sampled:r.sampled}:{},headers:kg(d.getRef(zW),o)});if(u)return p;let h;return W(nf(t=>{let n={_tag:`Effect`,rpc:e,context:s,resume(e){t(e),h&&!h.pollUnsafe()&&d.currentDispatcher.scheduleTask(()=>{h.interruptUnsafe(d.id)},0)}};c.set(f,n),h=p.pipe(r?Zf(r,{captureStackTrace:!1}):m,tp(d.context)),h.addObserver(e=>{if(e._tag===`Failure`)return t(e)})}),e=>(c.delete(f),df(_p(h),g(f,Array.from(e),s))))}),p=sp(function*(e,r,o,s,u,d){if(l)return yield*Gf;let f=i?void 0:yield*Yf(`${n}.${e._tag}`,{attributes:t.spanAttributes}),p=vp(),h=a(),_=Pr(p.context,zu);yield*Hu(_,e=>c.has(h)?(c.delete(h),g(h,ku(e)?Array.from(_u(e.cause)):[],d)):tf);let v=yield*Qp(u);return c.set(h,{_tag:`Queue`,rpc:e,queue:v,scope:_,context:d}),yield*r(e=>t.onFromClient({message:e,context:d,discard:!1}),{_tag:`Request`,id:h,tag:e._tag,payload:o,...f?{traceId:f.traceId,spanId:f.spanId,sampled:f.sampled}:{},headers:kg(p.getRef(zW),s)}).pipe(f?Zf(f,{captureStackTrace:!1}):m,Uf(e=>rm(v,e)),Kf,Qf(_,{startImmediately:!0})),v}),h=e=>{let t=[];for(let n of e.middlewares.values()){let e=Nr(o,`${n.key}/Client`);e&&t.push(e)}return t.length===0?(e,t)=>e(t):function n(r,i,a=t.length-1){return a===-1?r(i):t[a]({rpc:e,request:i,next(e){return n(r,e,a-1)}})}},g=(e,n,r)=>nf(i=>{let a=vp();t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r,discard:!1}).pipe(Tf(1e3),tp(a.context)).addObserver(()=>{i(tf)})}),_=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Queue`?tf:tm(i.queue,e.values).pipe(r?U(()=>t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context,discard:!1})):m,_f(e=>rm(i.queue,e)))}case`Exit`:{let t=e.requestId,n=c.get(t);return n?(c.delete(t),n._tag===`Effect`?(n.resume(e.exit),tf):e.exit._tag===`Success`?am(n.queue):rm(n.queue,e.exit.cause)):tf}case`Defect`:return u(Tu(e.defect));case`ClientEnd`:return tf}},v;if(t.flatten){let t=new Map;v=function(n,r,i){let a=t.get(n);return a||(a=d(e.requests.get(n)),t.set(n,a)),a(r,i)}}else v={},e.requests.forEach(e=>{gt(v,e._tag,d(e))});return{client:v,write:_}}),IW=0,LW=sp(function*(e,t){let n=IW++,{codecFor:r,run:i,send:a,supportsAck:o,supportsTransferables:s}=yield*BW,c=RW(r),l=nx(r(Kx())),u=new Map,{client:d,write:f}=yield*FW(e,{...t,supportsAck:o,onFromClient({message:t}){switch(t._tag){case`Request`:{let r=e.requests.get(t.tag),i=s?yW():void 0,o=vp(),l={rpc:r,context:i?Ar(o.context,vW,i):o.context,schemas:c(r)};return u.set(t.id,l),l.schemas.encodePayload(t.payload).pipe(Pf(l.context),vf,U(e=>a(n,{...t,id:t.id,payload:e,headers:Object.entries(t.headers)},i&&i.readUnsafe())))}case`Ack`:return u.get(t.requestId)?a(n,{_tag:`Ack`,requestId:t.requestId}):tf;case`Interrupt`:return u.get(t.requestId)?(u.delete(t.requestId),a(n,{_tag:`Interrupt`,requestId:t.requestId})):tf;case`Eof`:return tf}}});return yield*i(n,e=>{switch(e._tag){case`Chunk`:{let t=wW(e.requestId),n=u.get(t);return!n||Qn(n.schemas.decodeChunk)?tf:n.schemas.decodeChunk.value(e.values).pipe(Pf(n.context),vf,U(t=>f({_tag:`Chunk`,clientId:0,requestId:wW(e.requestId),values:t})),Uf(t=>f({_tag:`Exit`,clientId:0,requestId:wW(e.requestId),exit:Cu(t)})))}case`Exit`:{let t=wW(e.requestId),n=u.get(t);return n?(u.delete(t),n.schemas.decodeExit(e.exit).pipe(Pf(n.context),vf,Af({onSuccess:e=>f({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>f({_tag:`Exit`,clientId:0,requestId:t,exit:Cu(e)})}))):tf}case`Defect`:return f({_tag:`Defect`,clientId:0,defect:l(e.defect)});case`ClientProtocolError`:{let t=wu(e.error);return Xd(u.keys(),e=>f({_tag:`Exit`,clientId:0,requestId:e,exit:t}))}default:return tf}}).pipe(_f(cp),Kf,$f),d}),RW=e=>{let t=new WeakMap;return n=>{let r=t.get(n);return r===void 0?(r={decodeChunk:ar(LU(n.successSchema),t=>ex(e(Sx(t.success)))),encodePayload:ix(e(n.payloadSchema)),decodeExit:ex(e(GU(n)))},t.set(n,r),r):r}},zW=Hr(`effect/rpc/RpcClient/CurrentHeaders`,{defaultValue:()=>Dg}),BW=class extends lr()(`effect/rpc/RpcClient/Protocol`){static make=NW},VW=e=>BW.make(sp(function*(t,n){let r=yield*ZU,i=yield*DW,a=yield*Ff(GW),o=new Map,s=yield*r.writer,c=i.makeUnsafe(),l=yield*UW($d(()=>s.write(c.encode(TW)))),u,d=e=>Xd(n,n=>t(n,e)),f=e=>(u=e,d({_tag:`ClientProtocolError`,error:e})),p=e=>{try{let n=c.decode(e);if(n.length===0)return tf;let r=0;return Zd({while:()=>r<n.length,body:()=>{let e=n[r++];if(e._tag===`Pong`)return l.onPong(),tf;if(Object.hasOwn(e,`requestId`)){let n=e.requestId,r=o.get(n);if(r!==void 0)return e._tag===`Exit`&&o.delete(n),t(r,e)}return d(e)},step:y})}catch(e){return d({_tag:`ClientProtocolError`,error:new CW({reason:new SW({message:`Error decoding message`,cause:e})})})}};return yield*$d(()=>(c=i.makeUnsafe(),l.reset(),af(function*(){let{pull:e}=yield*r.reader;for(u=void 0,$n(a)&&(yield*a.value.onConnect);;){let t=yield*e;for(let e=0;e<t.length;e++)yield*p(t[e])}}).pipe(zf,Of(U(l.timeout,()=>H(new uW({reason:new oW({kind:`Timeout`,cause:Error(`ping timeout`)})}))))))).pipe($n(a)?Hf(a.value.onDisconnect):m,bf(t=>{let n=gu(t),r=Jr(n),i=new CW({reason:r?n.success.reason:new SW({message:`Unknown socket error`,cause:hu(t)})});return e?.retryTransientErrors&&r&&n.success.reason._tag===`SocketOpenError`?(e.onTransientError?.(i)??tf).pipe(wf({log:!0,message:`RpcClient onTransientError hook failed`})):f(i)}),Sf(e?.retryPolicy??HW,e=>f(new CW({reason:e.reason}))),lp({module:`RpcClient`,method:`makeProtocolSocket`}),$f),{send(e,t){if(u)return H(u);t._tag===`Request`&&o.set(t.id,e);let n=c.encode(t);return n===void 0?tf:vf(s.write(n))},supportsAck:!0,supportsTransferables:!1,codecFor:i.codecFor}})),HW=Id([Rd(500,1.5),Bd(5e3)]),UW=sp(function*(e){let t=!0,n=bp();return yield*$d(()=>t?(t=!1,e):n.open).pipe(Df(`5 seconds`),Cf,Jf,Kf,$f),{timeout:n.await,reset:()=>{t=!0,n.closeUnsafe()},onPong:()=>{t=!0}}}),WW=e=>od(BW)(VW(e)),GW=class extends lr()(`effect/rpc/RpcClient/ConnectionHooks`){},KW={add(...e){let t=new Map(this.requests);for(let n of e)t.set(n._tag,n);return qW({requests:t,annotations:this.annotations})},merge(...e){let t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(let r of e){for(let[e,n]of r.requests)t.set(e,n);for(let[e,t]of r.annotations.mapUnsafe)n.set(e,t)}return qW({requests:t,annotations:Sr(n)})},omit(...e){let t=new Map(this.requests);for(let n of e)t.delete(n);return qW({requests:t,annotations:this.annotations})},middleware(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.middleware(e));return qW({requests:t,annotations:this.annotations})},toHandlers(e){let t=this;return af(function*(){let n=yield*jf(),r=Yd(e)?yield*e:e,i=new Map;return t.requests.forEach((e,t)=>{i.set(e.key,{tag:e._tag,handler:r[t],context:n})}),Sr(i)})},prefix(e){let t=new Map;for(let n of this.requests.values()){let r=n.prefix(e);t.set(r._tag,r)}return qW({requests:t,annotations:this.annotations})},toLayer(e){return cd(this.toHandlers(e))},of:m,toLayerHandler(e,t){let n=this;return cd(af(function*(){let r=yield*jf(),i=Yd(t)?yield*t:t,a=new Map,o=n.requests.get(e);return a.set(o.key,{handler:i,context:r}),Sr(a)}))},accessHandler(e){return Mf(t=>{let n=this.requests.get(e),{handler:r,context:i}=Nr(t,n.key);return V((e,t)=>{t.rpc=n;let a=r(e,t),o=qU(a)?a.value:a;return Yd(o)?Nf(o,i):Xh(o,i)})})},annotate(e,t){return qW({requests:this.requests,annotations:Ar(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(kr(e,t))},annotateMerge(e){return qW({requests:this.requests,annotations:Br(this.annotations,e)})},annotateRpcsMerge(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.annotateMerge(Br(e,r.annotations)));return qW({requests:t,annotations:this.annotations})}},qW=e=>Object.assign(function(){},KW,{requests:e.requests,annotations:e.annotations}),JW=(...e)=>qW({requests:new Map(e.map(e=>[e._tag,e])),annotations:Dr()}),YW=yw(),XW=Tx([`additions`,`deletions`]),ZW=zx.check(Lx(0)),QW=Tx([`annotation`,`comment`]),$W=e=>e.kind===`comment`,eG=bx({id:K,author:K,body:Hx,createdAt:K}),tG=bx({id:K,filePath:K,side:XW,line:ZW,summary:K,rationale:lx(K),author:K,createdAt:K,replies:lx(xx(eG)),resolved:lx(_x),kind:lx(QW)}),nG=bx({filePath:Hx,newLine:lx(ZW),oldLine:lx(ZW),summary:Hx,rationale:lx(K),author:lx(K),kind:lx(QW)});wx([xx(nG),bx({comments:xx(nG)})]);var rG=bx({repo:K,branch:K,range:xx(K),patch:K,notes:xx(tG),version:K,diffVersion:K,watching:_x,updatedAt:K}),iG={file:K,start:lx(ZW),end:lx(ZW),side:XW,text:lx(K)};bx(iG);var aG={...iG,title:lx(K),body:lx(K)};bx(aG);var oG=wx([bx({type:dx(`show`),...iG}),bx({type:dx(`highlight`),...iG}),bx({type:dx(`explain`),speak:lx(_x),...aG}),bx({type:dx(`say`),text:K,speak:lx(_x)}),bx({type:dx(`clear`)})]),sG=xx(oG),cG=wx([oG,bx({type:dx(`tour`),steps:sG}),bx({type:dx(`next`)}),bx({type:dx(`back`)}),bx({type:dx(`goto`),index:zx})]),lG=bx({file:Ex(K),activeNote:Ex(K),tourStep:Ex(zx),explaining:Ex(K)}),uG=bx({id:zx,text:K,at:K,handled:_x}),dG=bx({seq:zx,kind:Tx([`thread`,`reply`,`resolved`,`reopened`,`converted`]),noteId:K,filePath:K,side:XW,line:ZW,author:K,body:K,at:K}),fG=class extends oS()(`NoteMissing`,{id:K}){get message(){return`no note ${this.id}`}},pG=class extends oS()(`NoteUnsaved`,{reason:K}){get message(){return this.reason}},mG=class extends oS()(`FileMissing`,{side:Tx([`old`,`new`]),path:K}){},hG=JW(UU(`Snapshots`,{success:rG,stream:!0}),UU(`File`,{payload:{side:Tx([`old`,`new`]),path:Hx},success:K,error:mG}),UU(`Send`,{payload:{command:cG},success:bx({delivered:zx})}),UU(`Commands`,{success:cG,stream:!0}),UU(`ReportView`,{payload:{view:lG}}),UU(`View`,{success:Ex(lG)}),UU(`Utter`,{payload:{text:Hx,handled:_x},success:uG}),UU(`Listen`,{payload:{after:lx(zx)},success:xx(uG),stream:!0}),UU(`StartThread`,{payload:{filePath:Hx,side:XW,line:ZW,body:Hx},success:tG,error:pG}),UU(`Reply`,{payload:{noteId:Hx,body:Hx,author:lx(K)},success:tG,error:wx([fG,pG])}),UU(`ToComment`,{payload:{noteId:Hx},success:tG,error:wx([fG,pG])}),UU(`Resolve`,{payload:{noteId:Hx,resolved:_x,author:lx(K)},success:tG,error:wx([fG,pG])}),UU(`Refresh`,{}),UU(`ListNotes`,{success:xx(tG)}),UU(`AddNotes`,{payload:{notes:xx(nG)},success:xx(tG),error:pG}),UU(`RemoveNote`,{payload:{id:Hx},error:pG}),UU(`ClearNotes`,{payload:{filePath:lx(K)},success:zx,error:pG}),UU(`Threads`,{payload:{after:lx(zx)},success:xx(dG),stream:!0})),gG=(e,t)=>od(ZU,mW(e,t)).pipe(fd(_G)),_G=pW,vG=()=>(e,t)=>{let n=lr()(e),r=od(n,t.makeEffect??LW(t.group,{...t,flatten:!0}));n.runtime=(t.runtime??PC)(typeof t.protocol==`function`?e=>fd(r,md(t.protocol(e))):fd(r,md(t.protocol))),n.mutation=WC(e=>{let r=t.group.requests.get(e);return n.runtime.fn()(sp(function*({headers:t,payload:r,reactivityKeys:i}){let a=(yield*n)(e,r,{headers:t});return yield*i?pS(a,i):a})).pipe(ZC({key:`AtomRpc:mutation:${e}`,schema:US({success:r.successSchema,error:yG(r)})}))});let i=WC(e=>{let{headers:r,payload:i,reactivityKeys:a,tag:o,timeToLive:s}=e,c=t.group.requests.get(o),l=IU(c.successSchema),u=l?n.runtime.pull(Vh(n.use(e=>V(e(o,i,{headers:r}))))):n.runtime.atom(n.use(e=>e(o,i,{headers:r})));return a&&(u=n.runtime.factory.withReactivity(a)(u)),!l&&e.serializationKey&&(u=ZC(u,{key:`AtomRpc:${e.tag}:${e.serializationKey}`,schema:US({success:c.successSchema,error:yG(c)})})),s&&(u=ji(s)?hC(u,s):GC(u)),u});return n.query=(e,t,n)=>{let r={tag:e,payload:t,headers:n?.headers?Og(n.headers):void 0,reactivityKeys:n?.reactivityKeys,timeToLive:n?.timeToLive===void 0?void 0:Ci(n.timeToLive),serializationKey:n?.serializationKey};return i(r)},n},yG=e=>wx([e.errorSchema,...Array.from(e.middlewares,e=>e.error),CW]),bG=`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/rpc`,xG=KS(),SG=TC(!1).pipe(GC),CG=z(GW,{onConnect:ef(()=>xG.set(SG,!0)),onDisconnect:ef(()=>xG.set(SG,!1))}),wG=class extends vG()(`SidediffClient`,{group:hG,protocol:WW({retryTransientErrors:!0}).pipe(fd([gG(bG),MW,CG]))}){},TG=e=>e.pipe(Hh(e=>({kind:`value`,value:e})),qh(()=>Lh({kind:`lost`})),Wh(Bd(Bi(1)))),EG=wG.runtime.atom(TG(Vh(wG.use(e=>V(e(`Snapshots`,void 0))))).pipe(Jh(()=>null,(e,t)=>t.kind===`value`?t.value:e))).pipe(GC),DG=wG.runtime.atom(TG(Vh(wG.use(e=>V(e(`Commands`,void 0))))).pipe(Kh(e=>e.kind===`value`),Hh(e=>e.value),Gh,Hh(([e,t])=>({command:e,sequence:t})))),OG=(e,t,n)=>JSON.stringify([e,t,n]),kG=WC(e=>{let[,t,n]=JSON.parse(e);return wG.runtime.atom(wG.use(e=>e(`File`,{side:t,path:n}))).pipe(hC(Vi(10)))}),AG=()=>{let e=xG.get(EG);return e._tag===`Success`?e.value?.diffVersion??``:``},jG=e=>ce(e,`FileMissing`),MG=(e,t)=>{let n=kG(OG(AG(),e,t));return rp(JS(xG,n).pipe(yf(()=>ef(()=>xG.refresh(n))),xf({schedule:Rd(zi(250)),times:6,while:e=>!jG(e)})))},NG=(e,t)=>MG(t===`deletions`?`old`:`new`,e).catch(()=>null),PG=TC(``),FG=GC(wG.mutation(`ReportView`)),IG=GC(wG.mutation(`Utter`)),LG=GC(wG.mutation(`StartThread`)),RG=GC(wG.mutation(`Reply`)),zG=GC(wG.mutation(`Resolve`)),BG=GC(wG.mutation(`ToComment`)),VG=e=>xG.set(LG,{payload:e}),HG=(e,t)=>xG.set(RG,{payload:{noteId:e,body:t}}),UG=(e,t)=>xG.set(zG,{payload:{noteId:e,resolved:t}}),WG=e=>xG.set(FG,{payload:{view:e}}),GG=(e,t)=>e.trim().length===0?void 0:xG.set(IG,{payload:{text:e.trim(),handled:t}}),KG=e=>xG.set(BG,{payload:{noteId:e}});function qG(e,t){try{let n=wF({name:e,load:t});xT.registerTheme(n.name,n.load)}catch(t){if(t instanceof _T){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}throw t}}var JG={"base16-tomorrow-night":{name:`base16-tomorrow-night`,base00:`#1d1f21`,code:`#101112`,base01:`#282a2e`,base02:`#373b41`,base03:`#969896`,base04:`#b4b7b4`,base05:`#c5c8c6`,base08:`#cc6666`,base09:`#de935f`,base0A:`#f0c674`,base0B:`#b5bd68`,base0C:`#8abeb7`,base0D:`#81a2be`,base0E:`#b294bb`,base0F:`#a3685a`},"base16-tomorrow-night-eighties":{name:`base16-tomorrow-night-eighties`,base00:`#2d2d2d`,code:`#111111`,base01:`#393939`,base02:`#515151`,base03:`#999999`,base04:`#b4b7b4`,base05:`#cccccc`,base08:`#f2777a`,base09:`#f99157`,base0A:`#ffcc66`,base0B:`#99cc99`,base0C:`#66cccc`,base0D:`#6699cc`,base0E:`#cc99cc`,base0F:`#a3685a`}},YG=e=>({name:e.name,type:`dark`,colors:{"editor.background":e.code,"editor.foreground":e.base05},tokenColors:[{settings:{foreground:e.base05,background:e.code}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:e.base03,fontStyle:`italic`}},{scope:[`string`,`string.template`,`markup.inserted`],settings:{foreground:e.base0B}},{scope:[`constant.numeric`,`constant.language`,`constant.character`,`support.constant`],settings:{foreground:e.base09}},{scope:[`keyword`,`storage`,`storage.type`,`storage.modifier`,`keyword.control`],settings:{foreground:e.base0E}},{scope:[`keyword.operator`,`punctuation`,`meta.brace`,`punctuation.separator`],settings:{foreground:e.base05}},{scope:[`entity.name.function`,`support.function`,`meta.function-call`,`variable.function`],settings:{foreground:e.base0D}},{scope:[`entity.name.type`,`entity.name.class`,`support.type`,`support.class`,`entity.other.inherited-class`],settings:{foreground:e.base0A}},{scope:[`variable`,`variable.other`,`variable.parameter`,`meta.definition.variable`],settings:{foreground:e.base05}},{scope:[`variable.other.property`,`meta.object-literal.key`,`support.variable.property`,`entity.other.attribute-name`],settings:{foreground:e.base08}},{scope:[`entity.name.tag`,`meta.tag.sgml`,`markup.deleted`],settings:{foreground:e.base08}},{scope:[`string.regexp`,`constant.character.escape`],settings:{foreground:e.base0C}},{scope:[`variable.language`,`variable.language.this`],settings:{foreground:e.base08}},{scope:[`entity.name.namespace`,`entity.name.module`],settings:{foreground:e.base0A}},{scope:[`markup.heading`,`entity.name.section`],settings:{foreground:e.base0D,fontStyle:`bold`}}]}),XG=e=>({"--bg":e.base00,"--code":e.code,"--canvas":`color-mix(in srgb, ${e.base00} 85%, black)`,"--panel":`color-mix(in srgb, ${e.base00} 60%, ${e.base01})`,"--panel-2":e.base01,"--border":e.base02,"--border-muted":`color-mix(in srgb, ${e.base01} 50%, ${e.base02})`,"--text":e.base05,"--text-strong":`color-mix(in srgb, ${e.base05} 70%, white)`,"--muted":e.base03,"--accent":e.base0D,"--add":e.base0B,"--del":e.base08,"--note":e.base0A,"--viewed":e.base0C}),ZG=()=>Object.values(JG).forEach(e=>qG(e.name,()=>Promise.resolve(YG(e)))),QG=e=>`
1554
+ :host {
1555
+ --diffs-dark-bg: ${e.code};
1556
+ --diffs-bg-context-override: ${e.code};
1557
+ --diffs-bg-context-gutter-override: ${e.code};
1558
+ --diffs-bg-buffer-override: color-mix(in lab, ${e.code} 94%, ${e.base05});
1559
+ --diffs-bg-separator-override: color-mix(in lab, ${e.code} 90%, ${e.base05});
1560
+ --diffs-addition-color: ${e.base0B};
1561
+ --diffs-deletion-color: ${e.base08};
1562
+ --diffs-bg-addition-override: color-mix(in lab, ${e.code} 88%, ${e.base0B});
1563
+ --diffs-bg-deletion-override: color-mix(in lab, ${e.code} 88%, ${e.base08});
1564
+ --diffs-bg-addition-emphasis-override: color-mix(in lab, ${e.code} 76%, ${e.base0B});
1565
+ --diffs-bg-deletion-emphasis-override: color-mix(in lab, ${e.code} 76%, ${e.base08});
1566
+ --diffs-font-size: 12px;
1567
+ --diffs-line-height: 20px;
1568
+ --diffs-font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
1569
+ --diffs-selection-color-override: ${e.base0A};
1570
+ }
1571
+ [data-sidediff-flash] {
1572
+ animation: sidediff-flash 1.4s ease-out;
1573
+ }
1574
+ @keyframes sidediff-flash {
1575
+ from { box-shadow: inset 4px 0 0 ${e.base0A}, inset 0 0 0 999px color-mix(in srgb, ${e.base0A} 22%, transparent); }
1576
+ to { box-shadow: inset 4px 0 0 transparent, inset 0 0 0 999px transparent; }
1577
+ }
1578
+ ::highlight(sidediff-text) {
1579
+ background-color: color-mix(in srgb, ${e.base0A} 45%, transparent);
1580
+ color: ${e.base07??`#ffffff`};
1581
+ }
1582
+ `,$G=8,eK=MG,tK=async e=>{let t=e.previousPath??e.path,[n,r]=await Promise.all([eK(`old`,t),eK(`new`,e.path)]);return{oldFile:{name:t,contents:n},newFile:{name:e.path,contents:r}}},nK=({additions:e,deletions:t})=>{let n=e+t,r=e=>n===0?0:Math.round(e/n*5),i=r(e),a=Math.min(5-i,r(t));return(0,J.jsxs)(`span`,{className:`diffstat`,"aria-label":`${e} additions, ${t} deletions`,children:[(0,J.jsxs)(`span`,{className:`add`,children:[`+`,e]}),(0,J.jsxs)(`span`,{className:`del`,children:[`-`,t]}),(0,J.jsx)(`span`,{className:`blocks`,children:Array.from({length:5},(e,t)=>(0,J.jsx)(`span`,{className:t<i?`block add`:t<i+a?`block del`:`block`},t))})]})},rK=`composer`,iK=(e,t,n)=>e.map((e,n)=>({id:e.id,desired:t(e.id)??n*24})).toSorted((e,t)=>e.desired-t.desired).reduce((e,{id:t,desired:r})=>{let i=e.at(-1),a=i===void 0?0:i.top+n(i.id)+$G;return[...e,{id:t,top:Math.max(r,a)}]},[]),aK=e=>t=>{t.key===`Enter`&&(t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e()))},oK=({note:e})=>{let[t,n]=(0,q.useState)(``),r=e.replies??[],i=()=>{t.trim()!==``&&(HG(e.id,t.trim()),n(``))};return(0,J.jsxs)(`div`,{className:e.resolved===!0?`inline-thread resolved`:`inline-thread`,children:[(0,J.jsxs)(`div`,{className:`comment`,children:[(0,J.jsx)(`span`,{className:`comment-author`,children:e.author}),(0,J.jsx)(`p`,{children:e.summary}),e.rationale&&e.rationale!==e.summary&&(0,J.jsx)(`p`,{className:`comment-detail`,children:e.rationale})]}),r.map(e=>(0,J.jsxs)(`div`,{className:`comment`,children:[(0,J.jsx)(`span`,{className:`comment-author`,children:e.author}),(0,J.jsx)(`p`,{children:e.body})]},e.id)),(0,J.jsx)(`textarea`,{className:`comment-input`,placeholder:`Reply`,rows:2,value:t,onChange:e=>n(e.target.value),onKeyDown:aK(i)}),(0,J.jsxs)(`div`,{className:`comment-actions`,children:[(0,J.jsx)(`button`,{className:`primary`,disabled:t.trim()===``,onClick:i,children:`Reply`}),(0,J.jsx)(`button`,{onClick:()=>UG(e.id,e.resolved!==!0),children:e.resolved===!0?`Reopen`:`Resolve`})]})]})},sK=({onSubmit:e,onCancel:t})=>{let[n,r]=(0,q.useState)(``),i=(0,q.useRef)(null),a=()=>{n.trim()!==``&&e(n.trim())};return(0,q.useEffect)(()=>{let e=requestAnimationFrame(()=>i.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,J.jsxs)(`div`,{className:`inline-thread composing`,children:[(0,J.jsx)(`textarea`,{ref:i,className:`comment-input`,placeholder:`Leave a comment`,rows:3,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Escape`&&t(),aK(a)(e)}}),(0,J.jsxs)(`div`,{className:`comment-actions`,children:[(0,J.jsx)(`button`,{className:`primary`,disabled:n.trim()===``,onClick:a,children:`Comment`}),(0,J.jsx)(`button`,{onClick:t,children:`Cancel`})]})]})},cK=({note:e,top:t,active:n,onFocus:r,measureRef:i})=>(0,J.jsxs)(`article`,{ref:t=>i(e.id,t),className:n?`note active`:`note`,style:{top:t},onMouseEnter:()=>r(e.id),onClick:()=>r(e.id),children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(`span`,{className:`note-author`,children:e.author}),(0,J.jsxs)(`span`,{className:`note-line`,children:[e.side===`deletions`?`L`:`R`,e.line]})]}),(0,J.jsx)(`h4`,{children:e.summary}),e.rationale&&e.rationale!==e.summary&&(0,J.jsx)(`p`,{children:e.rationale}),(0,J.jsx)(`button`,{className:`annotation-comment`,onClick:t=>{t.stopPropagation(),KG(e.id)},children:`Comment`})]}),lK=(0,q.memo)(function({file:e,notes:t,diffStyle:n,palette:r,showNotes:i,showComments:a,collapsed:o,viewed:s,activeNote:c,selection:l,pinned:u,onToggle:d,onViewed:f,onFocusNote:p}){let m=(0,q.useRef)(null),h=(0,q.useRef)(null),g=(0,q.useRef)(new Map),[_,v]=(0,q.useState)([]),[y,b]=(0,q.useState)(null),x=(0,q.useMemo)(()=>t.filter(e=>!$W(e)),[t]),S=(0,q.useMemo)(()=>t.filter($W),[t]),[C,w]=(0,q.useState)(!1),T=(0,q.useRef)(null),E=(0,q.useRef)(null),D=C||u;(0,q.useEffect)(()=>{let e=m.current;if(e===null)return;let t=new IntersectionObserver(([e])=>{e!==void 0&&(!e.isIntersecting&&E.current&&(T.current=E.current.offsetHeight),w(e.isIntersecting))},{root:e.closest(`main`),rootMargin:`1800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let O=T.current??Math.max(80,(e.additions+e.deletions+12)*20),ee=(0,q.useMemo)(()=>({diffStyle:n,theme:r,themeType:`dark`,disableFileHeader:!0,overflow:`wrap`,lineDiffType:`word-alt`,diffIndicators:`classic`,unsafeCSS:QG(JG[r]),hunkSeparators:`line-info`,expansionLineCount:20,loadDiffFiles:()=>tK(e),enableGutterUtility:!0,onGutterUtilityClick:e=>b({side:e.side===`deletions`?`deletions`:`additions`,line:e.end})}),[n,r,e]),te=y===null?null:(0,J.jsx)(sK,{onCancel:()=>b(null),onSubmit:t=>{VG({filePath:e.path,side:y.side,line:y.line,body:t}),b(null)}}),ne=(0,q.useMemo)(()=>[...i?x.map(e=>({side:e.side,lineNumber:e.line,metadata:{id:e.id,type:`anchor`}})):[],...a?S.map(e=>({side:e.side,lineNumber:e.line,metadata:{id:e.id,type:`comment`}})):[],...y===null?[]:[{side:y.side,lineNumber:y.line,metadata:{id:rK,type:`composer`}}]],[x,S,i,a,y]),re=(0,q.useCallback)((e,t)=>{t?g.current.set(e,t):g.current.delete(e)},[]),ie=(0,q.useCallback)(()=>{let e=m.current,t=h.current;if(e===null||t===null)return;let n=t.getBoundingClientRect().top,r=iK(x,t=>{let r=e.querySelector(`[data-note-anchor="${t}"]`);return r===null?null:r.getBoundingClientRect().top-n},e=>g.current.get(e)?.offsetHeight??64);v(e=>e.length===r.length&&e.every((e,t)=>e.id===r[t]?.id&&e.top===r[t]?.top)?e:r)},[x]);(0,q.useLayoutEffect)(()=>{let e=m.current;if(e===null||!i||o||!D)return;ie();let t=new ResizeObserver(()=>ie()),n=new MutationObserver(()=>ie());return t.observe(e),n.observe(e,{childList:!0}),()=>{t.disconnect(),n.disconnect()}},[ie,i,o,D]);let k=e=>_.find(t=>t.id===e)?.top??0,ae=_.reduce((e,t)=>Math.max(e,t.top+(g.current.get(t.id)?.offsetHeight??64)),0);return(0,J.jsxs)(`section`,{ref:m,className:`file`,id:`file-${e.path}`,children:[(0,J.jsxs)(`div`,{className:s?`file-header viewed`:`file-header`,children:[(0,J.jsx)(`button`,{className:`chevron`,"aria-label":o?`Expand file`:`Collapse file`,onClick:()=>d(e.path),children:o?`▸`:`▾`}),(0,J.jsx)(nK,{additions:e.additions,deletions:e.deletions}),(0,J.jsx)(`span`,{className:`file-path`,onClick:()=>d(e.path),children:e.previousPath?`${e.previousPath} → ${e.path}`:e.path}),(0,J.jsx)(`button`,{className:`icon-button`,title:`Copy path`,onClick:()=>void navigator.clipboard.writeText(e.path),children:`⧉`}),e.status!==`modified`&&(0,J.jsx)(`span`,{className:`badge badge-${e.status}`,children:e.status}),(0,J.jsx)(`span`,{className:`spacer`}),S.length>0&&(0,J.jsxs)(`span`,{className:`note-count`,children:[S.length,` `,S.length===1?`comment`:`comments`]}),x.length>0&&(0,J.jsxs)(`span`,{className:`note-count`,children:[x.length,` notes`]}),(0,J.jsxs)(`label`,{className:s?`viewed-toggle checked`:`viewed-toggle`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:s,onChange:t=>f(e,t.target.checked)}),`Viewed`]})]}),!o&&!D&&(0,J.jsx)(`div`,{className:`file-placeholder`,style:{height:O}}),!o&&D&&(0,J.jsxs)(`div`,{ref:E,className:i?`file-body with-notes`:`file-body`,children:[(0,J.jsx)(`div`,{className:`diff`,children:(0,J.jsx)(MU,{patch:e.patch,disableWorkerPool:!0,options:ee,lineAnnotations:ne,selectedLines:l,renderAnnotation:e=>{let{id:t,type:n}=e.metadata,r=S.find(e=>e.id===t);return n===`composer`?te:n===`comment`?r===void 0?null:(0,J.jsx)(oK,{note:r}):(0,J.jsx)(`div`,{className:t===c?`anchor active`:`anchor`,"data-note-anchor":t,onClick:()=>p(t)})}})}),i&&(0,J.jsx)(`div`,{ref:h,className:`notes-column`,style:{minHeight:ae},children:x.map(e=>(0,J.jsx)(cK,{note:e,top:k(e.id),active:e.id===c,onFocus:p,measureRef:re},e.id))})]})]})}),uK={highlight:null,explanation:null,caption:null,tour:null},dK=e=>{`speechSynthesis`in window&&e.trim().length!==0&&(window.speechSynthesis.cancel(),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)))},fK=e=>document.getElementById(`file-${e}`)?.querySelector(`diffs-container`)?.shadowRoot??null,pK=e=>{let t=fK(e.file);if(t===null||e.start===void 0)return[];let n=e.end??e.start,r=t.querySelector(`code[data-${e.side}]`)??t.querySelector(`code[data-unified]`)??t;return Array.from({length:n-e.start+1},(t,n)=>e.start+n).flatMap(e=>{let t=r.querySelector(`[data-line="${e}"]`);return t===null?[]:[t]})},mK=(e,t)=>e.flatMap(e=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);return Array.from({length:1e4},()=>n.nextNode()).filter(e=>e instanceof Text).flatMap(e=>{let n=e.data;return Array.from(n.matchAll(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`g`))).map(n=>{let r=new Range;return r.setStart(e,n.index??0),r.setEnd(e,(n.index??0)+t.length),r})})}),hK=e=>{if(!(`highlights`in CSS))return;if(e===null||e.text===void 0||e.text.length===0){CSS.highlights.delete(`sidediff-text`);return}let t=mK(pK(e),e.text);CSS.highlights.set(`sidediff-text`,new Highlight(...t))},gK=e=>{e.forEach(e=>e.removeAttribute(`data-sidediff-flash`)),requestAnimationFrame(()=>e.forEach(e=>e.setAttribute(`data-sidediff-flash`,``)))},_K=e=>{let t=pK(e),n=t[0];return n===void 0?(document.getElementById(`file-${e.file}`)?.scrollIntoView({behavior:`instant`,block:`start`}),!1):(n.scrollIntoView({behavior:`instant`,block:`center`}),gK(t),!0)},vK=NG,yK=e=>{let[t,n]=(0,q.useState)(uK),r=(0,q.useRef)(t);r.current=t;let i=(0,q.useCallback)(t=>{e(t.file);let n=e=>requestAnimationFrame(()=>{let i=_K(t);hK(r.current.highlight),!i&&e>0&&setTimeout(()=>n(e-1),150)});n(20)},[e]),a=(0,q.useCallback)(e=>e.type===`clear`?(hK(null),window.speechSynthesis?.cancel(),n(e=>({...uK,tour:e.tour}))):e.type===`say`?(e.speak&&dK(e.text),n(t=>({...t,caption:e.text}))):e.type===`show`?(n(e=>({...e,explanation:null})),i(e)):e.type===`highlight`?(n(t=>({...t,highlight:e,explanation:null})),i(e)):(n(t=>({...t,highlight:e,explanation:e,caption:e.speak?e.body??null:t.caption})),e.speak&&dK([e.title,e.body].filter(Boolean).join(`. `)),i(e)),[i]),o=(0,q.useCallback)(e=>{let t=r.current.tour,i=t?.steps[e];t!==null&&i!==void 0&&(n(n=>({...n,tour:{...t,index:e}})),a(i))},[a]),s=(0,q.useCallback)(e=>{let t=r.current.tour;if(e.type===`next`)return t?o(t.index+1):void 0;if(e.type===`back`)return t?o(t.index-1):void 0;if(e.type===`goto`)return o(e.index);if(e.type!==`tour`)return a(e);e.steps.forEach(e=>{e.type===`explain`&&vK(e.file,e.side)}),n(t=>({...t,tour:{steps:e.steps,index:0}}));let i=e.steps[0];i!==void 0&&a(i)},[a,o]),c=(0,q.useRef)(s);c.current=s;let l=(0,q.useCallback)(e=>{e._tag===`Success`&&c.current(e.value.command)},[]);return fw(DG),pw(DG,l),(0,q.useEffect)(()=>{let e=setTimeout(()=>hK(t.highlight),300);return()=>clearTimeout(e)},[t.highlight]),{state:t,run:s,goTo:o,dismiss:(0,q.useCallback)(()=>n(e=>({...e,explanation:null})),[]),endTour:(0,q.useCallback)(()=>n(()=>uK),[])}},bK=()=>{let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null},xK=e=>xG.set(PG,e),SK=()=>uw(PG),CK=e=>{let t=(0,q.useRef)(e);t.current=e;let n=bK()!==null,[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),s=(0,q.useRef)(null),c=(0,q.useRef)(!1),l=(0,q.useCallback)(()=>{let e=bK();if(e===null)return;let n=new e;n.continuous=!0,n.interimResults=!0,n.lang=navigator.language||`en-US`,n.onresult=e=>{let n=Array.from(e.results).slice(e.resultIndex),r=n.filter(e=>e.isFinal).map(e=>e[0].transcript),i=n.filter(e=>!e.isFinal).map(e=>e[0].transcript);r.filter(e=>e.trim().length>0).forEach(e=>t.current(e.trim())),xK(i.join(` `))},n.onerror=e=>{e.error!==`no-speech`&&e.error!==`aborted`&&o(e.error)},n.onend=()=>{c.current?n.start():i(!1)},c.current=!0,s.current=n,o(null),n.start(),i(!0)},[]),u=(0,q.useCallback)(()=>{c.current=!1,s.current?.stop(),xK(``),i(!1)},[]);return(0,q.useEffect)(()=>u,[u]),{supported:n,listening:r,error:a,start:l,stop:u}},wK=e=>{let[t,n]=(0,q.useState)(null);return(0,q.useEffect)(()=>{if(e===null)return n(null);let t={value:!1};return vK(e.file,e.side).then(e=>{t.value||n(e)}),()=>{t.value=!0}},[e]),t},TK=({explanation:e,palette:t,onClose:n})=>{let r=wK(e),i=(0,q.useRef)(null),a=e.start,o=e.end??a;return(0,q.useEffect)(()=>{if(r===null||a===void 0)return;let e=t=>setTimeout(()=>{let n=(i.current?.querySelector(`diffs-container`)?.shadowRoot)?.querySelector(`[data-line="${a}"]`);n?n.scrollIntoView({behavior:`instant`,block:`center`}):t>0&&e(t-1)},30);e(60)},[r,a]),(0,J.jsx)(`div`,{className:`guide-backdrop`,onClick:n,children:(0,J.jsxs)(`section`,{className:`guide-popover`,onClick:e=>e.stopPropagation(),children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`guide-location`,children:[e.file,a!==void 0&&`:${a}${o===a?``:`-${o}`}`]}),e.title&&(0,J.jsx)(`h2`,{children:e.title})]}),(0,J.jsx)(`button`,{className:`icon-button`,onClick:n,"aria-label":`Close`,children:`✕`})]}),e.body&&(0,J.jsx)(`p`,{className:`guide-body`,children:e.body}),(0,J.jsx)(`div`,{className:`guide-code`,ref:i,children:r===null?(0,J.jsx)(`div`,{className:`empty`,children:`Loading code…`}):(0,J.jsx)(CU,{file:{name:e.file,contents:r},disableWorkerPool:!0,selectedLines:a===void 0?null:{start:a,end:o??a},options:{theme:t,themeType:`dark`,disableFileHeader:!0,overflow:`wrap`,unsafeCSS:`${QG(JG[t])} :host { --diffs-font-size: 15px; --diffs-line-height: 24px; }`}})})]})})},EK=({state:e,palette:t,voice:n,onDismiss:r,onStep:i,onEndTour:a,onClearCaption:o})=>{let s=SK();return(0,J.jsxs)(J.Fragment,{children:[e.explanation&&(0,J.jsx)(TK,{explanation:e.explanation,palette:t,onClose:r}),(e.caption||e.tour||n.listening&&s)&&(0,J.jsxs)(`footer`,{className:`guide-bar`,children:[e.tour&&(0,J.jsxs)(`div`,{className:`tour-controls`,children:[(0,J.jsx)(`button`,{disabled:e.tour.index===0,onClick:()=>i(e.tour.index-1),children:`← Back`}),(0,J.jsxs)(`span`,{children:[`Step `,e.tour.index+1,` of `,e.tour.steps.length]}),(0,J.jsx)(`button`,{disabled:e.tour.index>=e.tour.steps.length-1,onClick:()=>i(e.tour.index+1),children:`Next →`}),(0,J.jsx)(`button`,{onClick:a,children:`End tour`})]}),e.caption&&(0,J.jsx)(`div`,{className:`caption`,onClick:o,children:e.caption}),n.listening&&s&&(0,J.jsxs)(`div`,{className:`interim`,children:[`🎙 `,s]})]})]})},DK=e=>{let t=/^diff --git a\/(.+?) b\/(.+)$/.exec(e);return{previousPath:t?.[1]??e,path:t?.[2]??e}},OK=e=>{let t=e.split(`
1583
+ `),{path:n,previousPath:r}=DK(t[0]??``),i=t.filter(e=>!e.startsWith(`+++`)&&!e.startsWith(`---`)),a=t.some(e=>e.startsWith(`new file mode`))?`added`:t.some(e=>e.startsWith(`deleted file mode`))?`deleted`:t.some(e=>e.startsWith(`rename from`))?`renamed`:`modified`;return{path:n,previousPath:a===`renamed`?r:null,status:a,patch:e,additions:i.filter(e=>e.startsWith(`+`)).length,deletions:i.filter(e=>e.startsWith(`-`)).length}},kK=e=>e.split(/^(?=diff --git )/m).filter(e=>e.startsWith(`diff --git `)).map(e=>OK(e.endsWith(`
1584
+ `)?e:`${e}\n`)),AK={added:`+`,deleted:`−`,renamed:`→`,modified:`•`},jK=({node:e,depth:t,notesByFile:n,isViewed:r,currentFile:i,onSelect:a})=>{let[o,s]=(0,q.useState)(!0),c=(0,q.useRef)(null),l=e.kind===`file`&&e.file.path===i;(0,q.useEffect)(()=>{l&&c.current?.scrollIntoView({block:`nearest`})},[l]);let u={paddingLeft:8+t*14};if(e.kind===`file`){let t=n[e.file.path]?.length??0;return(0,J.jsxs)(`button`,{ref:c,"aria-current":l?`true`:void 0,className:[`tree-file`,r(e.file)?`viewed`:``,l?`current`:``].join(` `).trim(),style:u,title:e.file.path,onClick:()=>a(e.file.path),children:[(0,J.jsx)(`span`,{className:`glyph status-${e.file.status}`,children:AK[e.file.status]}),(0,J.jsx)(`span`,{className:`tree-name`,children:e.name}),t>0&&(0,J.jsx)(`span`,{className:`note-count`,children:t}),r(e.file)&&(0,J.jsx)(`span`,{className:`tick`,children:`✓`})]})}return(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`button`,{className:`tree-dir`,style:u,onClick:()=>s(!o),children:[(0,J.jsx)(`span`,{className:`chevron-small`,children:o?`▾`:`▸`}),(0,J.jsx)(`span`,{className:`folder`,children:`▭`}),(0,J.jsx)(`span`,{className:`tree-name`,children:e.name})]}),o&&e.children.map(e=>(0,J.jsx)(jK,{node:e,depth:t+1,notesByFile:n,isViewed:r,currentFile:i,onSelect:a},e.kind===`file`?e.file.path:e.path))]})},MK=({tree:e,filter:t,onFilter:n,notesByFile:r,isViewed:i,currentFile:a,onSelect:o})=>(0,J.jsxs)(`aside`,{className:`sidebar`,children:[(0,J.jsx)(`input`,{className:`filter`,placeholder:`Filter changed files`,value:t,onChange:e=>n(e.target.value)}),(0,J.jsx)(`nav`,{className:`tree`,children:e.map(e=>(0,J.jsx)(jK,{node:e,depth:0,notesByFile:r,isViewed:i,currentFile:a,onSelect:o},e.kind===`file`?e.file.path:e.path))})]}),NK={directories:new Map,files:[]},PK=(e,t,n)=>{let[r,...i]=t;if(r===void 0||i.length===0)return{...e,files:[...e.files,n]};let a=e.directories.get(r)??NK;return{...e,directories:new Map([...e.directories,[r,PK(a,i,n)]])}},FK=(e,t)=>[...[...e.directories.entries()].toSorted(([e],[t])=>e.localeCompare(t)).map(([e,n])=>IK(e,n,t===``?e:`${t}/${e}`)),...e.files.toSorted((e,t)=>e.path.localeCompare(t.path)).map(e=>({kind:`file`,name:e.path.split(`/`).at(-1)??e.path,file:e}))],IK=(e,t,n)=>{let r=t.files.length===0&&t.directories.size===1?[...t.directories][0]:void 0;return r===void 0?{kind:`directory`,name:e,path:n,children:FK(t,n)}:IK(`${e}/${r[0]}`,r[1],`${n}/${r[0]}`)},LK=e=>FK(e.reduce((e,t)=>PK(e,t.path.split(`/`),t),NK),``),RK=e=>e.flatMap(e=>e.kind===`file`?[e.file]:RK(e.children)),zK=e=>Array.from(e).reduce((e,t)=>Math.imul(e,31)+t.charCodeAt(0)|0,7).toString(36),BK=e=>`sidediff:viewed:${e}`,VK=e=>{let t=localStorage.getItem(BK(e));if(t===null)return{};let n=JSON.parse(t);return typeof n==`object`&&n?n:{}},HK=e=>{let[t,n]=(0,q.useState)(()=>VK(e));return{isViewed:(0,q.useCallback)(e=>t[e.path]===zK(e.patch),[t]),setViewed:(0,q.useCallback)((t,r)=>n(n=>{let i=r?{...n,[t.path]:zK(t.patch)}:Object.fromEntries(Object.entries(n).filter(([e])=>e!==t.path));return localStorage.setItem(BK(e),JSON.stringify(i)),i}),[e])}},UK={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90},WK=e=>{let t=e.find(e=>/^\d+$/.test(e));if(t!==void 0)return Number(t);let n=e.map(e=>UK[e]).filter(e=>e!==void 0);return n.length===0?null:n.reduce((e,t)=>e+t,0)},GK=e=>e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(e=>e.length>0),KK=e=>(e.split(`/`).at(-1)??e).replace(/\.(vitest\.)?(test\.)?[a-z]+$/,``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).toLowerCase().split(/[\s._-]+/).filter(e=>e.length>0),qK=e=>e.replace(/s$/,``),JK=(e,t)=>{let n=new Set(e.map(qK)),r=t.filter(e=>!/\.(vitest\.)?test\.|\.stories\./.test(e)).map(e=>{let t=KK(e).map(qK),r=e.split(`/`).slice(0,-1).flatMap(e=>e.toLowerCase().split(/[-_.]/)).map(qK),i=t.filter(e=>n.has(e)).length,a=r.filter(e=>n.has(e)).length;return{path:e,nameScore:i===t.length?i+1:i,score:(i===t.length?i+1:i)*2+a,size:t.length}}).filter(e=>e.nameScore>=Math.min(2,e.size)).toSorted((e,t)=>t.score-e.score||e.size-t.size)[0]?.path;if(r!==void 0)return r;let i=new Set([`open`,`show`,`go`,`to`,`the`,`jump`,`file`,`me`,`a`,`please`]),a=t.filter(e=>!/\.(vitest\.)?test\.|\.stories\./.test(e)).filter(e=>KK(e).map(qK).some(e=>n.has(e)&&!i.has(e)));return a.length===1?a[0]??null:null},YK=(e,...t)=>e.join(` `).includes(t.join(` `)),XK=(e,t)=>{let n=GK(e);if(n.length===0||n.length>8)return null;let r=n[0];if(n.length<=4&&YK(n,`stop`,`listening`))return{kind:`stop`};if(n.length<=4&&(YK(n,`mark`,`viewed`)||YK(n,`mark`,`as`,`viewed`)||YK(n,`mark`,`reviewed`)))return{kind:`viewed`,value:!0};if(n.length<=4&&(YK(n,`unmark`)||YK(n,`not`,`viewed`)))return{kind:`viewed`,value:!1};if(n.length<=3&&YK(n,`next`,`note`))return{kind:`note`,direction:1};if(n.length<=3&&(YK(n,`previous`,`note`)||YK(n,`last`,`note`)))return{kind:`note`,direction:-1};if(n.length<=3&&(YK(n,`split`)||YK(n,`side`,`by`,`side`)))return{kind:`layout`,style:`split`};if(n.length<=3&&(YK(n,`unified`)||YK(n,`inline`)))return{kind:`layout`,style:`unified`};if(n.length<=3&&YK(n,`hide`,`notes`))return{kind:`notes`,visible:!1};if(n.length<=3&&YK(n,`show`,`notes`))return{kind:`notes`,visible:!0};if(n.length<=4&&(YK(n,`expand`)||YK(n,`show`,`more`)))return{kind:`expand`};let i=n.slice(-3).join(` `);if(n.length<=3&&(YK(n,`next`)||YK(n,`move`,`on`)||YK(n,`continue`))||/(^| )(next( one| step| please)?|move on|go on|keep going)( please)?$/.test(i))return{kind:`next`};if(n.length<=3&&(YK(n,`back`)||YK(n,`previous`)||YK(n,`go`,`back`))||/(^| )(go back|previous( step)?|back one)( please)?$/.test(i))return{kind:`back`};if(n.length<=3&&(YK(n,`close`)||YK(n,`dismiss`)||YK(n,`hide`,`that`)))return{kind:`close`};if(n.length<=4&&YK(n,`scroll`,`down`))return{kind:`scroll`,direction:1,amount:`page`};if(n.length<=4&&YK(n,`scroll`,`up`))return{kind:`scroll`,direction:-1,amount:`page`};if(n.length<=3&&(YK(n,`top`)||YK(n,`beginning`)))return{kind:`top`};if(YK(n,`line`)){let e=WK(n.slice(n.indexOf(`line`)+1));if(e!==null)return{kind:`line`,line:e}}if(r===`open`||r===`show`||YK(n,`go`,`to`)||r===`jump`){let e=JK(n,t);if(e!==null)return{kind:`file`,path:e}}return null},ZK=e=>requestAnimationFrame(()=>requestAnimationFrame(()=>{let t=document.getElementById(`file-${e}`),n=document.querySelector(`main.files`);t!==null&&n!==null&&(t.getBoundingClientRect().top>=n.getBoundingClientRect().top||t.scrollIntoView({block:`start`,behavior:`instant`}))})),QK=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,$K=()=>{let e=uw(EG),t=uw(SG);return{snapshot:e._tag===`Success`?e.value:null,connected:t}},eq=e=>document.querySelector(`[data-note-anchor="${e}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}),tq=[],nq=()=>{let e=localStorage.getItem(`sidediff:palette`);return e!==null&&e in JG?e:`base16-tomorrow-night-eighties`},rq=()=>{let{snapshot:e,connected:t}=$K();return e===null?(0,J.jsx)(`div`,{className:`empty`,children:`Loading diff…`}):(0,J.jsx)(iq,{snapshot:e,connected:t})},iq=({snapshot:e,connected:t})=>{let[n,r]=(0,q.useState)(nq),{isViewed:i,setViewed:a}=HK(e.repo),[o,s]=(0,q.useState)(`split`),[c,l]=(0,q.useState)(!0),[u,d]=(0,q.useState)(!0),[f,p]=(0,q.useState)(new Map),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(``),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null);(0,q.useEffect)(()=>{let e=document.querySelector(`main.files`);if(e===null)return;let t=new Map,n=()=>{let t=e.getBoundingClientRect().top,n=[...e.querySelectorAll(`section.file`)].find(e=>e.getBoundingClientRect().bottom>t+48);y(n?.id.replace(/^file-/,``)??null)},r=()=>{let e=t.get(`f`);e!==void 0&&cancelAnimationFrame(e),t.set(`f`,requestAnimationFrame(n))};return n(),e.addEventListener(`scroll`,r,{passive:!0}),()=>e.removeEventListener(`scroll`,r)},[]);let S=(0,q.useMemo)(()=>kK(e.patch),[e.patch]),C=(0,q.useMemo)(()=>LK(S.filter(e=>e.path.toLowerCase().includes(g.trim().toLowerCase()))),[S,g]),w=(0,q.useMemo)(()=>RK(LK(S)),[S]),T=(0,q.useMemo)(()=>RK(C),[C]),E=(0,q.useMemo)(()=>e.notes.reduce((e,t)=>({...e,[t.filePath]:[...e[t.filePath]??[],t]}),{}),[e.notes]),D=(0,q.useMemo)(()=>w.flatMap(e=>E[e.path]??[]),[w,E]),O=(0,q.useCallback)(e=>f.get(e.path)??!i(e),[f,i]),ee=(e,t)=>p(n=>new Map([...n,[e,t]])),te=(0,q.useCallback)(e=>{let t=S.find(t=>t.path===e);t!==void 0&&ee(e,!O(t))},[S,O]),ne=(0,q.useCallback)(e=>h(e),[]),re=(0,q.useCallback)((e,t)=>{a(e,t),p(t=>new Map([...t].filter(([t])=>t!==e.path))),t&&ZK(e.path)},[a]),ie=(0,q.useCallback)(e=>{ee(e,!0),x(e),requestAnimationFrame(()=>document.getElementById(`file-${e}`)?.scrollIntoView({behavior:`instant`,block:`start`}))},[]),k=yK((0,q.useCallback)(e=>{ee(e,!0),x(e)},[]));(0,q.useEffect)(()=>{let e=document.querySelector(`main.files`);if(e===null)return;let t=new Map,n=()=>{let t=e.getBoundingClientRect().top;WG({file:[...e.querySelectorAll(`section.file`)].find(e=>e.getBoundingClientRect().bottom>t+40)?.id.replace(/^file-/,``)??null,activeNote:m,tourStep:k.state.tour?.index??null,explaining:k.state.explanation?.file??null})},r=()=>{let e=t.get(`t`);e&&clearTimeout(e),t.set(`t`,setTimeout(n,250))};return n(),e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)},[m,k.state.tour?.index,k.state.explanation]);let ae=e=>{localStorage.setItem(`sidediff:palette`,e),r(e)},oe=(0,q.useCallback)(e=>{let t=D.findIndex(e=>e.id===m),n=D.at((t+e+D.length)%D.length);n!==void 0&&(h(n.id),eq(n.id))},[D,m]),se=(0,q.useCallback)(e=>{let t=XK(e,S.map(e=>e.path)),n=document.querySelector(`main.files`),r=k.state.tour;if(t===null||(t.kind===`next`||t.kind===`back`)&&r===null)return GG(e,!1);if(t.kind===`stop`&&ce.current?.stop(),t.kind===`note`&&oe(t.direction),t.kind===`layout`&&s(t.style),t.kind===`notes`&&l(t.visible),t.kind===`viewed`||t.kind===`expand`){let e=[...document.querySelectorAll(`section.file`)].find(e=>e.getBoundingClientRect().bottom>(n?.getBoundingClientRect().top??0)+40),r=S.find(t=>`file-${t.path}`===e?.id);r&&t.kind===`viewed`&&re(r,t.value),e&&t.kind===`expand`&&e.querySelector(`diffs-container`)?.shadowRoot?.querySelectorAll(`[data-expand-button]`).forEach(e=>{let t=e.getBoundingClientRect();t.bottom>0&&t.top<window.innerHeight&&e.click()})}if(t.kind===`next`&&r&&k.goTo(r.index+1),t.kind===`back`&&r&&k.goTo(r.index-1),t.kind===`close`&&k.dismiss(),t.kind===`scroll`&&n?.scrollBy({top:t.direction*n.clientHeight*.8,behavior:`instant`}),t.kind===`top`&&n?.scrollTo({top:0,behavior:`instant`}),t.kind===`file`&&(k.dismiss(),ie(t.path)),t.kind===`line`){let e=[...document.querySelectorAll(`section.file`)].find(e=>e.getBoundingClientRect().bottom>(n?.getBoundingClientRect().top??0)+40)?.id.replace(/^file-/,``);e&&k.run({type:`highlight`,file:e,start:t.line,end:t.line,side:`additions`})}GG(e,!0)},[S,k,ie,oe,re]),A=CK(se),ce=(0,q.useRef)(A);ce.current=A,(0,q.useEffect)(()=>{window.sidediffHear=se},[se]),(0,q.useEffect)(()=>{let e=e=>{QK(e.target)||(e.key===`n`&&oe(1),e.key===`p`&&oe(-1),e.key===`s`&&s(e=>e===`split`?`unified`:`split`),e.key===`a`&&l(e=>!e),e.key===`i`&&d(e=>!e),e.key===`Escape`&&k.dismiss(),e.key===`]`&&k.state.tour&&k.goTo(k.state.tour.index+1),e.key===`[`&&k.state.tour&&k.goTo(k.state.tour.index-1),e.key===`m`&&(A.listening?A.stop:A.start)())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[oe,k,A]);let le=w.filter(i).length,ue=w.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0});return(0,J.jsxs)(`div`,{className:`app`,style:XG(JG[n]),children:[(0,J.jsxs)(`header`,{className:`topbar`,children:[(0,J.jsxs)(`div`,{className:`title`,children:[(0,J.jsx)(`strong`,{children:e.repo.split(`/`).at(-1)}),(0,J.jsx)(`span`,{className:`branch`,children:e.branch}),(0,J.jsx)(`code`,{children:e.range.length>0?e.range.join(` `):`working tree`})]}),(0,J.jsx)(`span`,{className:t?`live on`:`live`,children:t?e.watching?`Watching`:`Connected`:`Disconnected`})]}),(0,J.jsxs)(`div`,{className:`toolbar`,children:[(0,J.jsxs)(`div`,{className:`tabs`,children:[(0,J.jsxs)(`span`,{className:`tab active`,children:[`Files changed `,(0,J.jsx)(`span`,{className:`counter`,children:w.length})]}),(0,J.jsxs)(`span`,{className:`tab`,children:[`Notes `,(0,J.jsx)(`span`,{className:`counter`,children:e.notes.length})]})]}),(0,J.jsxs)(`div`,{className:`summary`,children:[(0,J.jsxs)(`span`,{className:`add`,children:[`+`,ue.additions]}),(0,J.jsxs)(`span`,{className:`del`,children:[`−`,ue.deletions]})]}),(0,J.jsxs)(`div`,{className:`progress`,title:`Files marked as viewed`,children:[(0,J.jsxs)(`span`,{children:[le,` / `,w.length,` files viewed`]}),(0,J.jsx)(`span`,{className:`bar`,children:(0,J.jsx)(`span`,{style:{width:`${w.length===0?0:le/w.length*100}%`}})})]}),(0,J.jsxs)(`div`,{className:`controls`,children:[(0,J.jsxs)(`div`,{className:`segmented`,children:[(0,J.jsx)(`button`,{className:o===`split`?`on`:``,onClick:()=>s(`split`),children:`Split`}),(0,J.jsx)(`button`,{className:o===`unified`?`on`:``,onClick:()=>s(`unified`),children:`Unified`})]}),(0,J.jsxs)(`button`,{onClick:()=>l(!c),children:[c?`Hide notes`:`Show notes`,` `,(0,J.jsx)(`kbd`,{children:`a`})]}),(0,J.jsxs)(`button`,{onClick:()=>d(!u),children:[u?`Hide comments`:`Show comments`,` `,(0,J.jsx)(`kbd`,{children:`i`})]}),(0,J.jsxs)(`button`,{onClick:()=>oe(-1),children:[`↑ `,(0,J.jsx)(`kbd`,{children:`p`})]}),(0,J.jsxs)(`button`,{onClick:()=>oe(1),children:[`↓ `,(0,J.jsx)(`kbd`,{children:`n`})]}),A.supported&&(0,J.jsxs)(`button`,{className:A.listening?`mic on`:`mic`,onClick:A.listening?A.stop:A.start,children:[A.listening?`● Listening`:`Talk`,` `,(0,J.jsx)(`kbd`,{children:`m`})]}),(0,J.jsx)(`select`,{value:n,onChange:e=>ae(e.target.value),children:Object.keys(JG).map(e=>(0,J.jsx)(`option`,{value:e,children:e.replace(`base16-`,``)},e))})]})]}),(0,J.jsx)(MK,{tree:C,filter:g,onFilter:_,notesByFile:E,isViewed:i,currentFile:v,onSelect:ie}),(0,J.jsxs)(`main`,{className:`files`,children:[w.length===0&&(0,J.jsx)(`div`,{className:`empty`,children:`No changes in this range.`}),T.map(e=>(0,J.jsx)(lK,{file:e,notes:E[e.path]??tq,diffStyle:o,palette:n,showNotes:c,showComments:u,collapsed:!O(e),viewed:i(e),activeNote:m,pinned:e.path===b||k.state.highlight?.file===e.path,selection:k.state.highlight?.file===e.path&&k.state.highlight.start!==void 0?{start:k.state.highlight.start,end:k.state.highlight.end??k.state.highlight.start,side:k.state.highlight.side}:null,onToggle:te,onViewed:re,onFocusNote:ne},e.path))]}),(0,J.jsx)(EK,{state:k.state,palette:n,voice:A,onDismiss:k.dismiss,onStep:k.goTo,onEndTour:k.endTour,onClearCaption:()=>k.run({type:`say`,text:``})})]})};ZG();var aq=document.getElementById(`root`);aq!==null&&(0,YW.createRoot)(aq).render((0,J.jsx)(q.StrictMode,{children:(0,J.jsx)(ow.Provider,{value:xG,children:(0,J.jsx)(rq,{})})}));export{s as t};