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.
- package/README.md +16 -1
- package/dist/cli.js +59 -14
- package/dist/git.js +0 -1
- package/dist/notes.js +50 -18
- package/dist/protocol.js +58 -0
- package/dist/repo.js +5 -3
- package/dist/server.js +91 -23
- package/dist/web/assets/{angular-html-KvMUz706.js → angular-html-dpkqgbRV.js} +1 -1
- package/dist/web/assets/{angular-ts-NlM5GifH.js → angular-ts-CsmXxkwl.js} +1 -1
- package/dist/web/assets/{apl-BXWiWEVo.js → apl-Cb01Bf5P.js} +1 -1
- package/dist/web/assets/{astro-Bhx06L1l.js → astro-C66OEn5O.js} +1 -1
- package/dist/web/assets/{blade-BlUBx0PC.js → blade-El75k66R.js} +1 -1
- package/dist/web/assets/{c-C0eQNQNW.js → c-Bhdr_xah.js} +1 -1
- package/dist/web/assets/{chapel-CKFpmDLJ.js → chapel-C5KQsiHG.js} +1 -1
- package/dist/web/assets/{cobol-DwsyCr9b.js → cobol-BRb1H5HB.js} +1 -1
- package/dist/web/assets/{coffee-C4hkhraW.js → coffee-NR0si6Vq.js} +1 -1
- package/dist/web/assets/{cpp-Bs3Ktq9r.js → cpp-DVyXcCha.js} +1 -1
- package/dist/web/assets/{crystal-DMpaaMhJ.js → crystal-0irrWVMC.js} +1 -1
- package/dist/web/assets/{css-DtPqiQGm.js → css-B69tIC5-.js} +1 -1
- package/dist/web/assets/{edge-ZfatZ85-.js → edge-Dfies4ns.js} +1 -1
- package/dist/web/assets/{elixir-F3RMzoCL.js → elixir-CkHYLBMl.js} +1 -1
- package/dist/web/assets/{elm-BGJ0PgxU.js → elm-BM3XZF_H.js} +1 -1
- package/dist/web/assets/{erb-C7WsHgWS.js → erb-ibsMVJQV.js} +1 -1
- package/dist/web/assets/{git-rebase-hktnMhXh.js → git-rebase-v0T8i51i.js} +1 -1
- package/dist/web/assets/{glimmer-js-DajRjYwP.js → glimmer-js-DLkiF188.js} +1 -1
- package/dist/web/assets/{glimmer-ts-dnv4My2j.js → glimmer-ts-C1MfSiD_.js} +1 -1
- package/dist/web/assets/{glsl-BVmpNKLS.js → glsl-DmJpMzIS.js} +1 -1
- package/dist/web/assets/{graphql-DCDJyx6a.js → graphql-Bx_gWPNL.js} +1 -1
- package/dist/web/assets/{hack-bEVwbA5b.js → hack-zuzo4z8C.js} +1 -1
- package/dist/web/assets/{haml-CdgCZHNu.js → haml-2O-haJVu.js} +1 -1
- package/dist/web/assets/{handlebars-BgotjozU.js → handlebars-DW9-jkUL.js} +1 -1
- package/dist/web/assets/{html-DSG7GFxE.js → html-4b-UbCWm.js} +1 -1
- package/dist/web/assets/{html-derivative-CYDMDI-0.js → html-derivative-lCJLFQ95.js} +1 -1
- package/dist/web/assets/{http-XatvGKBy.js → http-CkqYUsMn.js} +1 -1
- package/dist/web/assets/{hurl-BCQmW8qD.js → hurl-BpcUpblR.js} +1 -1
- package/dist/web/assets/index-BxMmt431.js +1584 -0
- package/dist/web/assets/{index-BQY0pgMH.css → index-Vivty9_l.css} +1 -1
- package/dist/web/assets/{java-Dm2W5EfJ.js → java-p9UcnYwP.js} +1 -1
- package/dist/web/assets/{javascript-C2_AZCD8.js → javascript-Dlz1Uo-L.js} +1 -1
- package/dist/web/assets/{jinja-CwzMoVwz.js → jinja-Bpg33dsD.js} +1 -1
- package/dist/web/assets/{jison-DsBwpiNe.js → jison-By-VToHw.js} +1 -1
- package/dist/web/assets/{json-jdIt9h50.js → json-BxAha_TD.js} +1 -1
- package/dist/web/assets/{jsx-Btu-zt-Q.js → jsx-DSiXkHRj.js} +1 -1
- package/dist/web/assets/{julia-CZUYdDvB.js → julia-D0yc7GFR.js} +1 -1
- package/dist/web/assets/{just-D532zIY8.js → just-C2DI3pUP.js} +1 -1
- package/dist/web/assets/{latex-D2J5-TH0.js → latex-DMT_f-3C.js} +1 -1
- package/dist/web/assets/{liquid-WY7D0fMm.js → liquid-DiASchGu.js} +1 -1
- package/dist/web/assets/{lua-Baa_WEf0.js → lua-BafzqdQU.js} +1 -1
- package/dist/web/assets/{marko-DsygGl2f.js → marko-oJq8ByTy.js} +1 -1
- package/dist/web/assets/{mdc-BcGy04Fp.js → mdc-RuZg9ymz.js} +1 -1
- package/dist/web/assets/{nginx-B86ZxrAw.js → nginx-B4H34M9v.js} +1 -1
- package/dist/web/assets/{nim-BM686CfU.js → nim-Cw8zuJky.js} +1 -1
- package/dist/web/assets/{org-RvFkgp46.js → org-hVregGpI.js} +1 -1
- package/dist/web/assets/{perl-C6U9yGM0.js → perl-CwTUPbAz.js} +1 -1
- package/dist/web/assets/{php-uAYB-Mtd.js → php-gQC_Fmii.js} +1 -1
- package/dist/web/assets/{pug-6ncXSInX.js → pug-D6dZj3jJ.js} +1 -1
- package/dist/web/assets/{qml-BE1B7Quf.js → qml-E4rdecj4.js} +1 -1
- package/dist/web/assets/{r-BZJcu9wg.js → r-DR6ad8yZ.js} +1 -1
- package/dist/web/assets/{razor-BKwfOyyl.js → razor-D8M2A4M7.js} +1 -1
- package/dist/web/assets/{regexp-Dih_I1qs.js → regexp-DSjZ8XWG.js} +1 -1
- package/dist/web/assets/{rst-DHEdAr-V.js → rst-DQnNZTXl.js} +1 -1
- package/dist/web/assets/{ruby-BbWx5B9V.js → ruby-BJSAqM9X.js} +1 -1
- package/dist/web/assets/{sas-Df5EO-Nu.js → sas-cMF9FoL4.js} +1 -1
- package/dist/web/assets/{scss-XJX16h32.js → scss-D1ikNPGF.js} +1 -1
- package/dist/web/assets/{shellscript-Dxd4inRL.js → shellscript-D4nS65SB.js} +1 -1
- package/dist/web/assets/{shellsession-Df2uEcSZ.js → shellsession-BX-bfrSn.js} +1 -1
- package/dist/web/assets/{soy-B9Ytzufd.js → soy-B8DHGyol.js} +1 -1
- package/dist/web/assets/{sql-Eeo1bdO9.js → sql-BXnvc70Q.js} +1 -1
- package/dist/web/assets/{stata-DJp7s67I.js → stata-i4_4KZkj.js} +1 -1
- package/dist/web/assets/{surrealql-CDYi7ARY.js → surrealql-CJYktgMP.js} +1 -1
- package/dist/web/assets/{svelte-BjXPUNXf.js → svelte-DkTFRfzJ.js} +1 -1
- package/dist/web/assets/{templ-CfTV__LG.js → templ-DR-sPCuW.js} +1 -1
- package/dist/web/assets/{tex-yGzDqfiz.js → tex-Bm81cpcu.js} +1 -1
- package/dist/web/assets/{ts-tags-H73Fp8-B.js → ts-tags-8o0M5w05.js} +1 -1
- package/dist/web/assets/{tsx-D0NsN8tR.js → tsx-DPlNg7Ry.js} +1 -1
- package/dist/web/assets/{twig-BxcdexCK.js → twig-Cteaw1dL.js} +1 -1
- package/dist/web/assets/{typescript-CTohDgGQ.js → typescript-CZO0lWCV.js} +1 -1
- package/dist/web/assets/{typst-BHhe5E0i.js → typst-BFzy4EUn.js} +1 -1
- package/dist/web/assets/{vue-xxrWY3vq.js → vue-Cvhq1cTP.js} +1 -1
- package/dist/web/assets/{vue-html-DZJ0eUb2.js → vue-html-BTAnySQ7.js} +1 -1
- package/dist/web/assets/{vue-vine-b741IG4q.js → vue-vine-BLuytsGS.js} +1 -1
- package/dist/web/assets/{xml-CVHrHsRm.js → xml-HIAzbxU_.js} +1 -1
- package/dist/web/assets/{xsl-Bo14RTqx.js → xsl-ZYoNgca3.js} +1 -1
- package/dist/web/assets/{yaml-769gRZTS.js → yaml-Bc5rHCoM.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-C7UosTBH.js +0 -1584
|
@@ -1,1584 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-KvMUz706.js","assets/html-DSG7GFxE.js","assets/javascript-C2_AZCD8.js","assets/css-DtPqiQGm.js","assets/angular-ts-NlM5GifH.js","assets/scss-XJX16h32.js","assets/apl-BXWiWEVo.js","assets/xml-CVHrHsRm.js","assets/java-Dm2W5EfJ.js","assets/json-jdIt9h50.js","assets/astro-Bhx06L1l.js","assets/typescript-CTohDgGQ.js","assets/postcss-BXeXVLqQ.js","assets/tsx-D0NsN8tR.js","assets/blade-BlUBx0PC.js","assets/html-derivative-CYDMDI-0.js","assets/sql-Eeo1bdO9.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-CKFpmDLJ.js","assets/c-C0eQNQNW.js","assets/cobol-DwsyCr9b.js","assets/coffee-C4hkhraW.js","assets/cpp-Bs3Ktq9r.js","assets/regexp-Dih_I1qs.js","assets/glsl-BVmpNKLS.js","assets/crystal-DMpaaMhJ.js","assets/shellscript-Dxd4inRL.js","assets/edge-ZfatZ85-.js","assets/elixir-F3RMzoCL.js","assets/elm-BGJ0PgxU.js","assets/erb-C7WsHgWS.js","assets/ruby-BbWx5B9V.js","assets/haml-CdgCZHNu.js","assets/graphql-DCDJyx6a.js","assets/jsx-Btu-zt-Q.js","assets/lua-Baa_WEf0.js","assets/yaml-769gRZTS.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-hktnMhXh.js","assets/glimmer-js-DajRjYwP.js","assets/glimmer-ts-dnv4My2j.js","assets/hack-bEVwbA5b.js","assets/handlebars-BgotjozU.js","assets/http-XatvGKBy.js","assets/hurl-BCQmW8qD.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-CwzMoVwz.js","assets/jison-DsBwpiNe.js","assets/julia-CZUYdDvB.js","assets/r-BZJcu9wg.js","assets/just-D532zIY8.js","assets/perl-C6U9yGM0.js","assets/latex-D2J5-TH0.js","assets/tex-yGzDqfiz.js","assets/liquid-WY7D0fMm.js","assets/marko-DsygGl2f.js","assets/less-DVTAwKKz.js","assets/mdc-BcGy04Fp.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-B86ZxrAw.js","assets/nim-BM686CfU.js","assets/org-RvFkgp46.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-uAYB-Mtd.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-Bo14RTqx.js","assets/pug-6ncXSInX.js","assets/qml-BE1B7Quf.js","assets/razor-BKwfOyyl.js","assets/rst-DHEdAr-V.js","assets/cmake-Bj61d0ZC.js","assets/sas-Df5EO-Nu.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-Df2uEcSZ.js","assets/soy-B9Ytzufd.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-DJp7s67I.js","assets/surrealql-CDYi7ARY.js","assets/svelte-BjXPUNXf.js","assets/templ-CfTV__LG.js","assets/ts-tags-H73Fp8-B.js","assets/twig-BxcdexCK.js","assets/typst-BHhe5E0i.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-xxrWY3vq.js","assets/vue-html-DZJ0eUb2.js","assets/vue-vine-b741IG4q.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 k(e){return typeof e==`function`}function re(e){return e!=null}function ie(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||k(e)}var A=p(2,(e,t)=>se(e)&&t in e);function ce(e){return e instanceof Error}function le(e){return A(e,Symbol.iterator)||ee(e)}var ue=`~effect/Hash`,de=e=>{switch(typeof e){case`number`:return j(e);case`bigint`:return M(e.toString(10));case`string`:return M(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?M(`Invalid Date`):M(e.toISOString());if(e instanceof RegExp)return M(e.toString());{if(T.has(e))return fe(e);let t=Te.get(e);if(t!==void 0)return t;if(Ee.has(e))return O(),M(`[Circular]`);Ee.add(e);let n=D,r;try{r=`~effect/Hash`in e?e[ue]():typeof e==`function`?fe(e):e instanceof DataView?be(E(e)):Array.isArray(e)||ArrayBuffer.isView(e)?be(e):e instanceof Map?xe(e):e instanceof Set?Ce(e):ve(e)}finally{Ee.delete(e)}return n===D&&Te.set(e,r),r}}return he(pe(M(String(e))))},fe=e=>(we.has(e)||we.set(e,he(Math.random()*4294967296|0)),we.get(e)),pe=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),me=p(2,(e,t)=>pe(Math.imul(e,2654435761)+Math.imul(t,2246822507))),he=e=>e&3221225471|e>>>1&1073741824,ge=new DataView(new ArrayBuffer(8)),j=e=>{let t=e|0;return t===e?he(t):(ge.setFloat64(0,e===e?e:NaN),he(me(ge.getInt32(0),ge.getInt32(4))))},M=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return he(t)},_e=(e,t)=>{let n=12289;for(let r of t)n^=me(de(r),de(e[r]));return he(n)},ve=e=>_e(e,w(e)),ye=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return he(r)},be=e=>{let t=6151;for(let n of e)t=me(t,de(n));return he(t)},xe=ye(M(`Map`),([e,t])=>me(de(e),de(t))),Se=M(`Set`),Ce=ye(Se,e=>me(Se,de(e))),we=new WeakMap,Te=new WeakMap,Ee=new WeakSet,De=`~effect/Equal`;function Oe(){return arguments.length===1?e=>ke(e,arguments[0]):ke(arguments[0],arguments[1])}function ke(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:Ae(e,t):!1}function Ae(e,t){let n=Me.length;for(let r=n;r-->0;)if(Me[r]===e&&Ne[r]===t)return!0;if(n)return je(e,t);let r=Pe.get(e);r||Pe.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=je(e,t)),i}function je(e,t){Me.push(e),Ne.push(t);try{return Fe(e,t)}finally{Me.pop(),Ne.pop()}}var Me=[],Ne=[],Pe=new WeakMap;function Fe(e,t){if(de(e)!==de(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=He(e);if(n!==He(t)||typeof e==`function`&&!n)return!1;if(n)return e[De](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Ie(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?Le(E(e),E(t)):Le(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:ze(e,t,Be,Ve):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:ze(e,t,de,ke):Re(e,t)}function Ie(e,t){for(let n=0;n<e.length;n++)if(!ke(e[n],t[n]))return!1;return!0}function Le(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 Re(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)||!ke(e[i],t[i]))return!1;return!0}function ze(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 Be=e=>de(e[0]),Ve=(e,t)=>ke(e[0],t[0])&&ke(e[1],t[1]),He=e=>A(e,De),Ue=()=>Oe,We=Symbol.for(`~effect/Redactable`),Ge=e=>A(e,We);function Ke(e){return Ge(e)?qe(e):e}function qe(e){return e[We](globalThis[`~effect/Fiber/currentFiber`]?.context??Xe)}var Je=`~effect/Fiber/currentFiber`,Ye=new Map,Xe={"~effect/Context":{},base:Ye,depth:0,mapUnsafe:Ye,pipe(){return u(this,arguments)}};function Ze(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 Qe;r.add(e);let l;if(We in e)l=c(qe(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=tt(e);else if(!t?.ignoreToString&&A(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=nt(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=>`${$e(t)}:${c(rt(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${$e(t)}: ${c(rt(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 Qe=`[Circular]`;function $e(e){return typeof e==`string`?JSON.stringify(e):String(e)}function et(e){return e.map(e=>`[${$e(e)}]`).join(``)}function tt(e){try{return e.toISOString()}catch{return`Invalid Date`}}function nt(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function rt(e,t){try{return e[t]}catch{return`[property access threw]`}}function it(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=A(r,We)?Ke(r):Ke(t);if(typeof i==`bigint`)return Ze(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 at=Symbol.for(`nodejs.util.inspect.custom`),ot=e=>{try{return e=Ke(e),A(e,`toJSON`)&&k(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(ot):e}catch{return`[toJSON threw]`}},st=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?it(e,{space:t}):Ze(e,{space:t})}catch{return String(e)}},ct={toJSON(){return ot(this)},[at](){return this.toJSON()},toString(){return Ze(this.toJSON())}},lt=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),ut=()=>Error.stackTraceLimit,dt=e=>{lt&&(Error.stackTraceLimit=e)},ft=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})}},pt=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return ut()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function mt(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function ht(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&mt(e,n,t[n])}var gt=`~effect/Effect`,_t=`~effect/Exit`,vt={_A:m,_E:m,_R:m},yt=`${gt}/identifier`,N=`${gt}/args`,bt=`${gt}/evaluate`,xt=`${gt}/successCont`,St=`${gt}/failureCont`,Ct=`${gt}/ensureCont`,wt=Symbol.for(`effect/Effect/Yield`),Tt={pipe(){return u(this,arguments)},toJSON(){return{...this}},toString(){return Ze(this.toJSON(),{ignoreToString:!0,space:2})},[at](){return this.toJSON()}},Et={[gt]:vt,...Tt,[Symbol.iterator](){return new ft(this)},toJSON(){return{_id:`Effect`,op:this[yt],...N in this?{args:this[N]}:void 0}}},Dt=e=>A(e,gt),Ot=e=>A(e,_t),kt=`~effect/Cause`,At=`~effect/Cause/Reason`,jt=e=>A(e,kt),Mt=e=>A(e,At),Nt=class{constructor(e){this[kt]=kt,this.reasons=e}pipe(){return u(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Ze(this.reasons)})`}[at](){return this.toJSON()}[De](e){return jt(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Oe(t,e.reasons[n]))}[ue](){return be(this.reasons)}},Pt=new WeakMap,Ft=class{[At];annotations;_tag;constructor(e,t,n){if(this[At]=At,this._tag=e,t!==It&&typeof n==`object`&&n&&t.size>0){let e=Pt.get(n);e&&(t=new Map([...e,...t])),Pt.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 Ze(this)}[at](){return this.toString()}},It=new Map,Lt=class extends Ft{constructor(e,t=It){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Ze(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[De](e){return Wt(e)&&Oe(this.error,e.error)&&Oe(this.annotations,e.annotations)}[ue](){return me(M(this._tag))(me(de(this.error))(de(this.annotations)))}},Rt=e=>new Nt(e),zt=new Nt([]),Bt=e=>new Nt([new Lt(e)]),Vt=class extends Ft{constructor(e,t=It){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Ze(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[De](e){return Gt(e)&&Oe(this.defect,e.defect)&&Oe(this.annotations,e.annotations)}[ue](){return me(M(this._tag))(me(de(this.defect))(de(this.annotations)))}},Ht=e=>new Nt([new Vt(e)]),Ut=p(e=>jt(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Nt(e.reasons.map(e=>e.annotate(t,n)))),Wt=e=>e._tag===`Fail`,Gt=e=>e._tag===`Die`,Kt=e=>e._tag===`Interrupt`;function qt(e){return tn(`Effect.evaluate: Not implemented`)}var P=e=>({...Et,[yt]:e.op,[bt]:e[bt]??qt,[xt]:e[xt],[St]:e[St],[Ct]:e[Ct]}),Jt=e=>{let t=P(e),n=function(e){this[N]=e};return n.prototype=t,function(e){return new n(e)}},Yt=e=>{let t={[_t]:_t,_tag:e.op,get[e.prop](){return this[N]},...P(e),toString(){return`${e.op}(${Ze(this[N])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[N]}},[De](e){return Ot(e)&&e._tag===this._tag&&Oe(this[N],e[N])},[ue](){return me(M(e.op),de(this[N]))}},n=function(e){this[N]=e};return n.prototype=t,function(e){return new n(e)}},Xt=Yt({op:`Success`,prop:`value`,[bt](e){let t=e.getCont(xt);return t?t[xt](this[N],e,this):e.yieldWith(this)}}),Zt={key:`effect/Cause/StackTrace`},Qt={key:`effect/Cause/InterruptorStackTrace`},$t=Yt({op:`Failure`,prop:`cause`,[bt](e){let t=this[N],n=!1;e.cache.stackFrame&&(t=Ut(t,{mapUnsafe:new Map([[Zt.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(St);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(St);return r?r[St](t,e,n?void 0:this):e.yieldWith(n?$t(t):this)}}),en=e=>$t(Bt(e)),tn=e=>$t(Ht(e)),nn=Jt({op:`WithFiber`,[bt](e){return this[N](e)}}),rn=function(){class e extends globalThis.Error{}let t=P({op:`YieldableError`,[bt](){return en(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),an=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends rn{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(ht(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),on=e=>{class t extends an{_tag=e}return t.prototype.name=e,t},sn=`~effect/Cause/NoSuchElementError`,cn=class extends on(`NoSuchElementError`){[sn]=sn;constructor(e){super({message:e})}},ln=`~effect/Cause/Done`,un=e=>A(e,ln),dn={[ln]:ln,_tag:`Done`,value:void 0},fn=e=>e===void 0?dn:{[ln]:ln,_tag:`Done`,value:e},pn=en(dn),mn=e=>e===void 0?pn:en(fn(e)),hn=e=>P({op:e.label,[bt]:e.evaluate}),gn=(e,t)=>e===t,_n=()=>gn,vn=`~effect/Option`,yn={[vn]:{_A:e=>e},...Tt,[Symbol.iterator](){return new ft(this)}},bn=Object.defineProperty(Object.assign(Object.create(yn),{_tag:`Some`,_op:`Some`,[De](e){return Cn(e)&&Tn(e)&&Oe(this.value,e.value)},[ue](){return me(de(this._tag))(de(this.value))},toString(){return`some(${Ze(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:ot(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),xn=de(`None`),Sn=Object.assign(Object.create(yn),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[De](e){return Cn(e)&&wn(e)},[ue](){return xn},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Cn=e=>A(e,vn),wn=e=>e._tag===`None`,Tn=e=>e._tag===`Some`,En=Object.create(Sn),Dn=function(e){this.value=e};Dn.prototype=bn;var On=e=>new Dn(e),kn=`~effect/Result`,An={[kn]:{_A:e=>e,_E:e=>e},...Tt,[Symbol.iterator](){return new ft(this)}},jn=Object.assign(Object.create(An),{_tag:`Success`,_op:`Success`,[De](e){return Nn(e)&&Fn(e)&&Oe(this.success,e.success)},[ue](){return me(de(this._tag))(de(this.success))},toString(){return`success(${Ze(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:ot(this.success)}}}),Mn=Object.assign(Object.create(An),{_tag:`Failure`,_op:`Failure`,[De](e){return Nn(e)&&Pn(e)&&Oe(this.failure,e.failure)},[ue](){return me(de(this._tag))(de(this.failure))},toString(){return`failure(${Ze(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:ot(this.failure)}}}),Nn=e=>A(e,kn),Pn=e=>e._tag===`Failure`,Fn=e=>e._tag===`Success`,In=function(e){this.failure=e};In.prototype=Mn;var Ln=e=>new In(e),Rn=function(e){this.success=e};Rn.prototype=jn;var zn=e=>new Rn(e);function Bn(e){return(t,n)=>t===n?0:e(t,n)}var Vn=Bn((e,t)=>e<t?-1:1),Hn=Bn((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),Un=p(2,(e,t)=>Bn((n,r)=>e(t(n),t(r)))),Wn=e=>p(2,(t,n)=>e(t,n)===1),Gn=e=>p(2,(t,n)=>t===n||e(t,n)<1?t:n),Kn=()=>En,qn=On,Jn=Cn,Yn=wn,Xn=Tn,Zn=p(2,(e,{onNone:t,onSome:n})=>Yn(e)?t():n(e.value)),Qn=p(2,(e,t)=>Yn(e)?t():e.value),$n=e=>e==null?Kn():qn(e),er=Qn(v),tr=p(2,(e,t)=>{if(Xn(e))return e.value;throw t()}),nr=p(2,(e,t)=>Yn(e)?Kn():qn(t(e.value))),rr=p(2,(e,t)=>Yn(e)?Kn():t(e.value)),ir=p(2,(e,t)=>Yn(e)?Kn():$n(t(e.value))),ar=`~effect/Context/Service`,or=function(){function e(){}let t=e;Object.setPrototypeOf(t,sr);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[lr]=lr,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&cr.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},sr={[ar]:ar,...hn({label:`Service`,evaluate(e){return Xt(Mr(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Er(this,e)},use(e){return nn(t=>e(Mr(t.context,this)))},useSync(e){return nn(t=>Xt(e(Mr(t.context,this))))}},cr=new Set,lr=`~effect/Context/Reference`,ur=`~effect/Context`,dr=8,fr=8,pr=(e,t,n,r)=>{let i=Object.create(br);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},mr=(e,t)=>{t&&(mr(e,t.parent),e.set(t.key,t.value))},hr=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return mr(t,e.overlay),e._flat=t},gr=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),yr(n)},_r=Symbol(),vr=(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)?_r:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=fr&&(n.base=hr(n),n.overlay=void 0,n.depth=0),r)},yr=e=>pr(void 0,e,void 0,0),br={get mapUnsafe(){return hr(this)},...Tt,[ur]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[De](e){if(!Sr(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)||!Oe(r,n.get(e)))return!1;return!0},[ue](){return j(this.mapUnsafe.size)}},xr=(e,t)=>e.cacheRoot===t.cacheRoot,Sr=e=>A(e,ur),Cr=e=>!!e[lr],wr=()=>Tr,Tr=yr(new Map),Er=(e,t)=>yr(new Map([[e.key,t]])),Dr=p(3,(e,t,n)=>Or(e,t.key,n)),Or=(e,t,n)=>{let r=e,i=cr.has(t)?void 0:r.cacheRoot;if(r.depth>=dr){let e=new Map(r.mapUnsafe);return e.set(t,n),pr(i,e,void 0,0)}return pr(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},kr=p(2,(e,t)=>Ar(e,t.key)),Ar=(e,t)=>{let n=vr(e,t);return n===_r?void 0:n},jr=p(2,(e,t)=>{let n=vr(e,t.key);if(n===_r){if(Cr(t))return Pr(t);throw Fr(t)}return n}),Mr=jr,Nr=`~effect/Context/defaultValue`,Pr=e=>Nr in e?e[Nr]:e[Nr]=e.defaultValue(),Fr=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},Ir=p(2,(e,t)=>{let n=vr(e,t.key);return n===_r?Cr(t)?qn(Pr(t)):Kn():qn(n)}),Lr=p(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:gr(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Rr=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((e,n)=>{t.set(n,e)});return yr(t)},zr=or,Br=e=>e.length>0,Vr=e=>e>0?Math.floor(e):0,Hr=zn,Ur=Ln,Wr=Pn,Gr=Fn,Kr=p(2,(e,t)=>Object.hasOwn(e,t)),qr=e=>Object.keys(e),Jr=e=>p(2,(t,n)=>{for(let r of qr(t))if(!Kr(n,r)||!e(t[r],n[r]))return!1;return!0}),Yr=e=>{let t=Jr(e);return(e,n)=>t(e,n)&&t(n,e)},Xr=globalThis.Array,Zr=e=>Xr.isArray(e)?e:Xr.from(e),Qr=p(2,(e,t)=>[...e,t]),$r=p(2,(e,t)=>Zr(e).concat(Zr(t))),ei=Xr.isArray,ti=Br,ni=Br,ri=e=>e[e.length-1],ii=()=>[],ai=e=>[e],oi=p(2,(e,t)=>e.map(t)),si=`~effect/Duration`,ci=BigInt(0),li=BigInt(1),ui=BigInt(2),di=BigInt(10),fi=BigInt(24),pi=BigInt(60),mi=BigInt(1e3),hi=BigInt(1e6),gi=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),_i=e=>gi(e*1e6),vi=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=di**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*ui>=a?li:ci);return r?-s:s},yi=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,bi=e=>{switch(typeof e){case`number`:return Ii(e);case`bigint`:return Fi(e);case`string`:{if(e===`Infinity`)return Ni;if(e===`-Infinity`)return Pi;let t=yi.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return Fi(vi(r,li));if(i===`micro`||i===`micros`)return Fi(vi(r,mi));let a=Number(r);switch(i){case`milli`:case`millis`:return Ii(a);case`second`:case`seconds`:return Li(a);case`minute`:case`minutes`:return Ri(a);case`hour`:case`hours`:return zi(a);case`day`:case`days`:return Bi(a);case`week`:case`weeks`:return Vi(a)}break}case`object`:{if(e===null)break;if(si in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(te)?xi(e):Number.isNaN(e[0])||Number.isNaN(e[1])?Mi:e[0]===-1/0||e[1]===-1/0?Pi:e[0]===1/0||e[1]===1/0?Ni:Ei(gi(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?Ei(n):Ei(gi(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return xi(e)},xi=e=>{throw Error(`Invalid Input: ${e}`)},Si={_tag:`Millis`,millis:0},Ci={_tag:`Infinity`},wi={_tag:`NegativeInfinity`},Ti={[si]:si,[ue](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?de(gi(e)):j(this.value.millis)}case`Nanos`:return de(this.value.nanos);default:return ve(this.value)}},[De](e){return Di(e)&&Yi(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`}}},[at](){return this.toJSON()},pipe(){return u(this,arguments)}},Ei=e=>{let t=Object.create(Ti);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Si:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:_i(e)}:e>0?Ci:wi:e===ci?Si:{_tag:`Nanos`,nanos:e},t},Di=e=>A(e,si),Oi=e=>e.value._tag!==`Infinity`&&e.value._tag!==`NegativeInfinity`,ki=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===ci;case`Infinity`:case`NegativeInfinity`:return!1}},Ai=e=>{switch(e.value._tag){case`Millis`:return e.value.millis<0;case`Nanos`:return e.value.nanos<ci;case`NegativeInfinity`:return!0;case`Infinity`:return!1}},ji=e=>{switch(e.value._tag){case`Infinity`:case`NegativeInfinity`:return Ni;case`Millis`:return e.value.millis<0?Ei(-e.value.millis):e;case`Nanos`:return e.value.nanos<ci?Ei(-e.value.nanos):e}},Mi=Ei(0),Ni=Ei(1/0),Pi=Ei(-1/0),Fi=e=>Ei(e),Ii=e=>Ei(e),Li=e=>Ei(e*1e3),Ri=e=>Ei(e*6e4),zi=e=>Ei(e*36e5),Bi=e=>Ei(e*864e5),Vi=e=>Ei(e*6048e5),Hi=e=>Wi(bi(e),{onMillis:m,onNanos:e=>Number(e)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Ui=e=>{let t=bi(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 _i(t.value.millis)}},Wi=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)()}}),Gi=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(Ui(e),t.value.nanos):n.onNanos(e.value.nanos,Ui(t))),Ki=Bn((e,t)=>Gi(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})),qi=(e,t)=>Gi(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Ji=Gn(Ki),Yi=p(2,(e,t)=>qi(e,t)),Xi=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=Ui(e),n=t<ci,r=n?-t:t,i=r/hi,a=i/mi,o=a/pi,s=o/pi,c=s/fi,l=n?-1:1;return{days:l*Number(c),hours:l*Number(s%fi),minutes:l*Number(o%pi),seconds:l*Number(a%pi),millis:l*Number(i%mi),nanos:l*Number(r%hi)}},Zi=e=>{if(e.value._tag===`Infinity`)return`Infinity`;if(e.value._tag===`NegativeInfinity`)return`-Infinity`;if(ki(e))return`0`;if(Ai(e))return`-`+Zi(ji(e));let t=Xi(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(` `)},Qi=zr(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new ra}),$i=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},ea=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},ta=e=>{try{return ea(e)}catch{return $i(e)}},na=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}},ra=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?$i:ta)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new ia(this.setImmediate)}},ia=class{tasks=new na;running=void 0;setImmediate;constructor(e=ta){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()}},aa=zr(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),oa=zr(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),F=class extends f{constructor(e){super(),e&&ht(this,e)}},sa=on,ca=e=>{switch(e){case 16:return da();case 32:return fa();default:{let t=``;for(let n=e>>>3;n>0;n--)t+=ua();return t}}},I=Uint8Array.from(`0123456789abcdef`,e=>e.charCodeAt(0)),la=()=>Math.random()*4294967296>>>0,ua=()=>{let e=la();return String.fromCharCode(I[e>>>28],I[e>>>24&15],I[e>>>20&15],I[e>>>16&15],I[e>>>12&15],I[e>>>8&15],I[e>>>4&15],I[e&15])},da=()=>{let e=la(),t=la();return String.fromCharCode(I[e>>>28],I[e>>>24&15],I[e>>>20&15],I[e>>>16&15],I[e>>>12&15],I[e>>>8&15],I[e>>>4&15],I[e&15],I[t>>>28],I[t>>>24&15],I[t>>>20&15],I[t>>>16&15],I[t>>>12&15],I[t>>>8&15],I[t>>>4&15],I[t&15])},fa=()=>{let e=la(),t=la(),n=la(),r=la();return String.fromCharCode(I[e>>>28],I[e>>>24&15],I[e>>>20&15],I[e>>>16&15],I[e>>>12&15],I[e>>>8&15],I[e>>>4&15],I[e&15],I[t>>>28],I[t>>>24&15],I[t>>>20&15],I[t>>>16&15],I[t>>>12&15],I[t>>>8&15],I[t>>>4&15],I[t&15],I[n>>>28],I[n>>>24&15],I[n>>>20&15],I[n>>>16&15],I[n>>>12&15],I[n>>>8&15],I[n>>>4&15],I[n&15],I[r>>>28],I[r>>>24&15],I[r>>>20&15],I[r>>>16&15],I[r>>>12&15],I[r>>>8&15],I[r>>>4&15],I[r&15])},pa=`effect/Tracer/ParentSpan`,ma=class extends or()(pa,{fiberCached:!0}){},ha=e=>e,ga=zr(`effect/Tracer/DisablePropagation`,{defaultValue:_}),_a=zr(`effect/Tracer/CurrentTraceLevel`,{defaultValue:()=>`Info`}),va=zr(`effect/Tracer/MinimumTraceLevel`,{defaultValue:()=>`All`}),ya=`effect/Tracer`,ba=ha({span:e=>new xa(e)}),xa=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??=er(this.parent)?.traceId??ca(32)}get spanId(){return this._spanId??=ca(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)}},Sa=`effect/Metric/FiberRuntimeMetrics`,Ca=zr(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:v}),wa=zr(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:g}),Ta=zr(`effect/References/TracerTimingEnabled`,{defaultValue:g}),Ea=zr(`effect/References/TracerSpanAnnotations`,{defaultValue:()=>({})}),Da=zr(`effect/References/TracerSpanLinks`,{defaultValue:()=>[]}),Oa=zr(`effect/References/CurrentLogAnnotations`,{defaultValue:()=>({})}),ka=zr(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Aa=zr(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ja=zr(`effect/References/CurrentLogSpans`,{defaultValue:()=>[]}),Ma=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=ut();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};dt(3);let n=Error();return dt(t),{...e,captureStackTrace:Na(()=>n.stack)}},Na=(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),Pa=class extends Ft{constructor(e,t=It){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[De](e){return Kt(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[ue](){return me(M(`${this._tag}:${this.fiberId}`))(fe(this.annotations))}},Fa=e=>new Pa(e),Ia=e=>new Nt([new Pa(e)]),La=e=>{let t=e.reasons.find(Wt);return t?Hr(t):Ur(e)},Ra=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Hr(n.error)}return Ur(e)},za=e=>e.reasons.some(Kt),Ba=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?Hr(t):Ur(e)},Va=e=>{let t=Ba(e);return Wr(t)?Ha:t.success},Ha=new Set,Ua=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=de(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>Oe(e,i)))continue;else t.push(i);r.push(i)}return r},Wa=p(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Nt(Ua(e.reasons,t.reasons));return Oe(e,n)?e:n}),Ga=p(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Wt(e)?(n=!0,new Lt(t(e.error),e.annotations)):e);return n?Rt(r):e}),Ka=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},qa=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=ut();i!==0&&dt(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Ja(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=$a(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(Ja(i,r[0].annotations,t))}}finally{i!==0&&dt(i)}return n},Ja=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(Ya(e),{cause:e.cause?Ja(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Za(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Qa(e,t):e}n?.includeCauseInStack&&(i.stack=no(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else i=new globalThis.Error(e?r===`string`?e:it(e):`Unknown error: ${e}`);return i},Ya=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 it(e)},Xa=/\((.*)\)/g,Za=(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?Qa(a.join(`
|
|
9
|
-
`),n):a.join(`
|
|
10
|
-
`)},Qa=(e,t)=>{let n=t?.get(Zt.key);return n&&(e=`${e}\n${eo(n)}`),e},$a=(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(Qt.key);n.push(` at fiber (${t})`),r&&n.push(eo(r))}return n.join(`
|
|
11
|
-
`)},eo=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(Xa),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
|
-
`)},to=e=>qa(e).map(no).join(`
|
|
13
|
-
`),no=e=>e.cause?`${e.stack} {\n${ro(e.cause,` `)}\n}`:e.stack,ro=(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${ro(e.cause,`${t} `)}\n${t}}`),r},io=`~effect/Fiber`,ao={_A:m,_E:m},oo={id:0},so=()=>globalThis[Je],co=class{constructor(e,t=!0){this.setContext(e),this.id=++oo.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[io](){return ao}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Mr(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=Ia(e);this.cache.stackFrame&&(n=Ut(n,Er(Zt,this.cache.stackFrame))),t&&(n=Ut(n,t)),this._interruptedCause=this._interruptedCause?Wa(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(So(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===wt)return;let n=po.interruptChildren&&po.interruptChildren(this);if(n!==void 0)return this.evaluate(is(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=wr()}runLoop(e){let t=globalThis[Je];globalThis[Je]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=So(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=is(Eo,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[bt](this),i===wt){let e=this._yielded;if(_t in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return wt}}}catch(e){return A(i,bt)?this.runLoop(tn(e)):tn(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Je]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,uo;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Ct];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&fo-1))return Xt(e);let t=this.getCont(xt);return t?t[xt](e,this):this.yieldWith(Xt(e))}yieldWith(e){return this._yielded=e,wt}children(){return this._children??=new Set}pipe(){return u(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&xr(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=lo(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}},lo=e=>{let t=Ar(e,ya);return{scheduler:Mr(e,Qi),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Mr(e,wa),span:Ar(e,pa),logLevel:Mr(e,ka),minimumLogLevel:Mr(e,Aa),stackFrame:Mr(e,Ca),runtimeMetrics:Ar(e,Sa),maxOpsBeforeYield:Mr(e,aa),preventYield:Mr(e,oa)}},uo={[xt](e,t){return So(t._interruptedCause)},[St](e,t){return So(t._interruptedCause)}},fo=32,po={interruptChildren:void 0},mo=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Qt.key,e.cache.stackFrame),yr(t)},ho=e=>{let t=e;return t._exit?L(t._exit):Po(n=>t._exit?n(L(t._exit)):wo(e.addObserver(e=>n(L(e)))))},go=e=>Po(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(L(r))}return a(),wo(()=>i?.())}),_o=e=>{let t=e;return t._exit?t._exit:Po(n=>t._exit?n(t._exit):wo(e.addObserver(n)))},vo=e=>Po(t=>{let n=Array.from(e);if(n.length===0)return t(L(ii()));let r=Array(n.length),i=ii(),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(L(r))};i.push(c),n[e].addObserver(c)}return wo(()=>{s=!0,a()})}),yo=e=>nn(t=>bo(e,t.id)),bo=p(e=>A(e[0],io),(e,t,n)=>nn(r=>{let i=mo(r);return i=i&&n?Lr(i,n):i??n,e.interruptUnsafe(t,i),ts(ho(e))})),xo=e=>nn(t=>{let n=mo(t),r=ii();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return ts(go(r))}),L=Xt,So=$t,Co=en,wo=Jt({op:`Sync`,[bt](e){let t=this[N](),n=e.getCont(xt);return n?n[xt](t,e):e.yieldWith(Xt(t))}}),To=Jt({op:`Suspend`,[bt](e){return this[N]()}}),Eo=Jt({op:`Yield`,[bt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(gs)},this[N]??0),e.yieldWith(()=>{t=!0})}})(0),Do=L(Kn()),Oo=e=>To(()=>So(e())),ko=e=>tn(e),Ao=e=>To(()=>Co(e())),R=L(void 0),jo=e=>nn(t=>e(t.id)),Mo=function(){let e=P({op:`Async`,[bt](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(No(()=>(t=!0,r?.abort(),i??gs))),wt):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),No=Jt({op:`AsyncFinalizer`,[Ct](e){e.interruptible&&(e.interruptible=!1,e._stack.push(zc))},[St](e,t){return za(e)?is(this[N](),()=>So(e)):So(e)}}),Po=e=>Mo(e,e.length>=2),Fo=Po(y),Io=(...e)=>{if(e.length===1){let t=e[0];return To(()=>Vo(t()))}let[t,n]=e;return To(()=>Vo(n.call(t.self)))},Lo=(e,...t)=>{let n=t.length===0?function(){return To(()=>Vo(e.apply(this,arguments)))}:function(){let n=To(()=>Vo(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return Ro(e.length,n)},Ro=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),zo=(e,...t)=>Ro(e.length,t.length===0?function(){return Bo(()=>e.apply(this,arguments))}:function(){let n=Bo(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Bo=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return L(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 To(()=>n?(n=!1,is(r.value,e=>Vo(t,e))):To(()=>Vo(e())))}}}catch(e){return ko(e)}},Vo=function(){let e=P({op:`Iterator`,[xt](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return L(r.value);if(!as(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[bt](e){return this[xt](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)}}(),z=p(2,(e,t)=>new Wo(e,Go,L(t))),Ho=function(e){return e._stack.push(this),this[N]},Uo=P({op:`OnSuccess`,[bt]:Ho}),Wo=function(e,t,n){this[N]=e,this[xt]=t,this.payload=n};Wo.prototype=Uo;var Go=function(){return this.payload},Ko=function(e,t){return t.succeedWith(this.payload)},qo=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Jo=function(e,t){let n=this.payload;return t.succeedWith(qo?n(e):pt(()=>n(e)))},Yo=function(e){let t=this.payload;return t(e)},Xo=function(e){let t=this.payload;return new Wo(t(e),Ko,e)},Zo=function(e){return new Wo(this.payload,Ko,e)},Qo=e=>cs(e,qn),$o=p(2,(e,t)=>new Wo(e,Dt(t)?Go:Yo,t)),es=p(2,(e,t)=>new Wo(e,Dt(t)?Zo:Xo,t)),ts=e=>new Wo(e,Go,gs),ns=(e,t)=>nn(n=>Po(r=>{let i=!1,a=new Set,o=e=>{i=!0,r(a.size===0?e:is(Lc(xo(a)),()=>e))},s=0;for(let r of e){if(i)break;let e=s++,c=el(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 xo(a)})),rs=p(e=>Dt(e[1]),(e,t,n)=>ns([e,t],n)),is=p(2,(e,t)=>new Wo(e,Yo,t)),as=e=>e[_t]!==void 0,os=p(2,(e,t)=>as(e)?e._tag===`Success`?t(e.value):e:is(e,t)),ss=e=>is(e,m),cs=p(2,(e,t)=>new Wo(e,Jo,t)),ls=p(2,(e,t)=>as(e)?_s(e,t):cs(e,t)),us=p(2,(e,t)=>as(e)?vs(e,t):zs(e,t)),ds=p(2,(e,t)=>as(e)?ys(e,t):Bs(e,t)),fs=e=>$t(Ia(e)),ps=e=>e._tag===`Success`,ms=e=>e._tag===`Failure`,hs=e=>e._tag===`Failure`?Hr(e.cause):Ur(e),gs=Xt(void 0),_s=p(2,(e,t)=>e._tag===`Success`?Xt(t(e.value)):e),vs=p(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Ra(e.cause);return Wr(n)?e:en(t(n.success))}),ys=p(2,(e,t)=>{if(e._tag===`Success`)return Xt(t.onSuccess(e.value));let n=Ra(e.cause);return Wr(n)?e:en(t.onFailure(n.success))}),bs=p(2,(e,t)=>ps(e)?t:e),xs=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?gs:$t(Rt(t))},Ss=e=>nn(t=>L(Ir(t.context,e))),Cs=p(2,(e,t)=>nn(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),kc(n,()=>{n.setContext(r)}),e)})),ws=p(3,(e,t,n)=>Cs(e,e=>{let r=jr(e,t),i=n(r);return r===i?e:Dr(e,t,i)})),Ts=()=>Es,Es=nn(e=>L(e.context)),Ds=e=>nn(t=>e(t.context)),Os=p(2,(e,t)=>as(e)?e:Cs(e,Lr(t))),ks=function(){return arguments.length===1?p(2,(e,t)=>As(e,arguments[0],t)):p(3,(e,t,n)=>As(e,t,n)).apply(this,arguments)},As=(e,t,n)=>Cs(e,Dr(t,n)),js=p(2,(e,t)=>is(t,t=>t?Qo(e):Do)),Ms=p(e=>Dt(e[0]),(e,t)=>Kc({while:g,body:h(t?.disableYield?e:is(e,e=>Eo)),step:y})),Ns=p(2,(e,t)=>new Fs(e,t.length===1?t:e=>t(e))),Ps=P({op:`OnFailure`,[bt]:Ho}),Fs=function(e,t){this[N]=e,this[St]=t};Fs.prototype=Ps;var Is=p(3,(e,t,n)=>Ns(e,e=>{let r=t(e);return Wr(r)?So(r.failure):n(r.success,e)})),Ls=p(2,(e,t)=>Is(e,Ra,e=>t(e))),Rs=p(2,(e,t)=>Ns(e,e=>$o(t(e),So(e)))),zs=p(2,(e,t)=>Ls(e,e=>Ao(()=>t(e)))),Bs=p(2,(e,t)=>Xs(e,{onFailure:e=>Ao(()=>t.onFailure(e)),onSuccess:e=>wo(()=>t.onSuccess(e))})),Vs=e=>Ls(e,ko),Hs=p(e=>Dt(e[0]),(e,t)=>{if(!t?.log)return Xs(e,{onFailure:e=>R,onSuccess:e=>R});let n=Jl(t.log===!0?void 0:t.log);return Gs(e,{onFailure(e){let r=La(e);return Wr(r)?So(r.failure):t.message===void 0?n(e):n(t.message,e)},onSuccess:e=>R})}),Us=p(e=>Dt(e[0]),(e,t)=>{if(!t?.log)return Gs(e,{onFailure:e=>R,onSuccess:e=>R});let n=Jl(t.log===!0?void 0:t.log);return Gs(e,{onFailure:e=>t.message===void 0?n(e):n(t.message,e),onSuccess:e=>R})}),Ws=e=>Qs(e,{onFailure:Ur,onSuccess:Hr}),Gs=p(2,(e,t)=>new qs(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),Ks=P({op:`OnSuccessAndFailure`,[bt]:Ho}),qs=function(e,t,n){this[N]=e,this[xt]=t,this[St]=n};qs.prototype=Ks;var Js=function(e,t){let n=this.payload;return t.succeedWith(qo?n.onSuccess(e):pt(()=>n.onSuccess(e)))},Ys=((e,t)=>{let n=P({op:e,[bt]:Ho,[xt]:Js,[St]:t}),r=function(e,t){this[N]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Wt);if(n===void 0)return So(e);let r=this.payload;return t.succeedWith(qo?r.onFailure(n.error):pt(()=>r.onFailure(n.error)))}),Xs=p(2,(e,t)=>Gs(e,{onFailure:e=>{let n=e.reasons.find(Wt);return n?t.onFailure(n.error):So(e)},onSuccess:t.onSuccess})),Zs=p(2,(e,t)=>new Ys(e,t)),Qs=p(2,(e,t)=>{if(as(e)){if(e._tag===`Success`)return Xt(t.onSuccess(e.value));let n=Ra(e.cause);return Wr(n)?e:Xt(t.onFailure(n.success))}return Zs(e,t)}),$s=e=>as(e)?Xt(e):ec(e),ec=Jt({op:`Exit`,[bt](e){return e._stack.push(this),this[N]},[xt](e,t,n){return t.succeedWith(n??Xt(e))},[St](e,t,n){return t.succeedWith(n??$t(e))}}),tc=p(2,(e,t)=>$o(Fl(t),e)),nc=p(2,(e,t)=>is(ac(e,t.duration),e=>Yn(e)?t.orElse():L(e.value))),rc=e=>new Ll(`Operation timed out after '${Zi(e)}'`),ic=p(2,(e,t)=>{let n=bi(t);return nc(e,{duration:n,orElse:()=>Co(rc(n))})}),ac=p(2,(e,t)=>rs(Qo(e),z(Fl(t),Kn()))),oc=`~effect/Scope`,sc=`~effect/Scope/Closeable`,cc=or(`effect/Scope`),lc=(e,t)=>nn(n=>{let r=uc(e,t);return r===void 0?R:(Hc(n),r)}),uc=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&vc(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return dc(n.finalizer,t);let r=n.finalizers;return r.size===1?dc(r.values().next().value,t):pc(e,r,t)},dc=(e,t)=>{try{return e(t)}catch(e){return tn(e)}},fc=(e,t)=>ps(e)?t:Ns(t,t=>So(Wa(e.cause,t))),pc=Lo(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=so();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*$s(dc(s,n))):i.push(el(o,dc(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*go(i)),yield*xs(r)}),mc=(e,t)=>{let n=bc(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(_c(e,n,e=>lc(n,e)),n)},hc=(e,t)=>To(()=>e.state._tag===`Closed`?t(e.state.exit):(_c(e,{},t),R)),gc=(e,t)=>hc(e,h(t)),_c=(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))}},vc=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=xc:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=xc))},yc=e=>bc(e,void 0),bc=(e=`sequential`,t)=>({[sc]:sc,[oc]:oc,strategy:e,parent:t,state:xc}),xc={_tag:`Empty`},Sc=cc,Cc=ks(cc),wc=e=>nn(t=>{let n=t.context,r=yc();return t.setContext(Dr(t.context,cc,r)),kc(t,e=>(t.setContext(n),uc(r,e))),e}),Tc=e=>To(()=>{let t=yc();return Ac(e(t),e=>To(()=>uc(t,e)??R))}),Ec=(e,t,n)=>Ds(r=>Wc(i=>is(Sc,a=>es(n?.interruptible?i(e):e,e=>hc(a,n=>Os(t(e,n),r)))))),Dc=function(){let e=P({op:`OnExit`,[bt](e){return e._stack.push(this),this.effect},[Ct](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(zc),e.interruptible=!1)},[xt](e,t,n){n??=Xt(e);let r;try{r=this.onExit(n)}catch(e){r=tn(e)}return r?is(r,e=>n):n},[St](e,t,n){n??=$t(e);let r;try{r=this.onExit(n)}catch(e){r=tn(e)}return r?is(fc(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),Oc=(e,t,n)=>new Dc(e,t,n),kc=(e,t)=>{e._stack.push(new Dc(void 0,t,void 0))},Ac=p(2,Oc),jc=p(2,(e,t)=>Ac(e,e=>t)),Mc=p(3,(e,t,n)=>Ac(e,e=>{let r=t(e);return Wr(r)?R:n(r.success,e)})),Nc=p(2,(e,t)=>Mc(e,hs,t)),Pc=p(3,(e,t,n)=>Ac(e,e=>{if(e._tag!==`Failure`)return R;let r=t(e.cause);return Wr(r)?R:n(r.success,e.cause)})),Fc=p(2,(e,t)=>Pc(Ba,t)(e)),Ic=nn(e=>So(Ia(e.id))),Lc=e=>nn(t=>t.interruptible?(t.interruptible=!1,t._stack.push(zc),e):e),Rc=Jt({op:`SetInterruptible`,[Ct](e){if(e.interruptible=this[N],e._interruptedCause&&e.interruptible)return()=>So(e._interruptedCause)}}),zc=Rc(!0),Bc=Rc(!1),Vc=e=>{if(e.interruptible=!0,e._stack.push(Bc),e._interruptedCause)return So(e._interruptedCause)},Hc=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(zc))},Uc=e=>nn(t=>t.interruptible?e:Vc(t)??e),Wc=e=>nn(t=>t.interruptible?(t.interruptible=!1,t._stack.push(zc),e(Uc)):e(m)),Gc=(e,t)=>le(e)?t?.mode===`result`?qc(e,Ws,t):qc(e,m,t):t?.discard?t.mode===`result`?qc(Object.values(e),Ws,t):qc(Object.values(e),m,t):To(()=>{let n={};return z(qc(Object.entries(e),([e,r])=>cs(t?.mode===`result`?Ws(r):r,t=>{mt(n,e,t)}),{discard:!0,concurrency:t?.concurrency}),n)}),Kc=Jt({op:`While`,[xt](e,t){return this[N].step(e),this[N].while()?(t._stack.push(this),this[N].body()):gs},[bt](e){return this[N].while()?(e._stack.push(this),this[N].body()):gs}}),qc=p(e=>typeof e[1]==`function`,(e,t,n)=>To(()=>{let r=Yc(n?.concurrency);if(r===1)return Jc(e,t,n);let i=Zr(e),a=i.length;if(a===0)return n?.discard?R:L([]);let o=n?.discard?void 0:Array(a),s=$c({f:t,out:o},i,{concurrency:r});return s?z(s,o):L(o)})),Jc=(e,t,n)=>To(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return z(Kc({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),Yc=e=>e===`unbounded`?1/0:Math.max(1,e??1),Xc=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>is($s(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??R),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!as(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},Zc=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=tn(e);return p=t,c=!0,f=!0,u&&u.size>0?is(Lc(xo(Array.from(u))),()=>t):t},g=()=>{let i=!1;for(;!p&&a<o;a++){let o=r[a],_=m??t(e,o,a);if(as(_)){if(p=n(e,o,_,a),p)break}else if(l){m=void 0;let t=el(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=$t(Rt([e]))}else{let t=n(e,o,a,r);t&&(p=t._tag===`Failure`?$t(Rt(t.cause.reasons.slice())):t,g())}if(i){let e=g();e&&d(e)}else c&&u.size===0&&d(p??R)}catch(e){d(h(e))}}),u.size<s)continue;i=!0,a++;return}else return Po(e=>{l=so(),u=new Set,m=_,d=e;let t;try{t=g()}catch(t){return e(h(t))}return t?e(t):To(()=>(p=gs,f=!0,u?xo(u):R))})}if(c=!0,p){if(u&&u.size>0){let e=mo(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(R);else return gs}};return g()}},Qc=()=>e=>Zc(e),$c=Zc({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)}}),el=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new co(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},tl=p(e=>Dt(e[0]),(e,t)=>nn(n=>L(el(n,e,t?.startImmediately,!0,t?.uninterruptible)))),nl=p(e=>Dt(e[0]),(e,t,n)=>nn(r=>{let i=el(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!i._exit){if(t.state._tag!==`Closed`){let e={};_c(t,e,()=>jo(e=>e===i.id?R:yo(i))),i.addObserver(()=>vc(t,e))}else i.interruptUnsafe(r.id,mo(r))}return L(i)})),rl=p(e=>Dt(e[0]),(e,t)=>is(Sc,n=>nl(e,n,t))),il=e=>(t,n)=>{let r=new co(n?.scheduler?Dr(e,Qi,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},al=p(2,(e,t)=>{if(e._exit)return e;if(t.state._tag===`Closed`)return e.interruptUnsafe(e.id),e;let n={};return _c(t,n,()=>yo(e)),e.addObserver(()=>vc(t,n)),e}),ol=e=>{let t=il(e);return(e,n)=>{let r=t(e,n);return n?.onExit&&r.addObserver(n.onExit),e=>r.interruptUnsafe(e)}},sl=e=>{let t=il(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},cl=(e=>{let t=sl(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw Ka(e.cause);return e.value})})(wr()),ll=e=>{let t=il(e);return e=>{if(as(e))return e;let n=new ra(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??tn(new zl(r))}},ul=ll(wr()),dl=e=>{let t=ll(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw Ka(n.cause);return n.value}},fl=dl(wr()),pl=L(!0),ml=L(!1),hl=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return pl;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=[],pl}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](gs)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](gs)}open=nn(e=>this._isOpen?ml:(this._isOpen=!0,this.scheduleUnsafe(e)));release=nn(e=>this._isOpen?ml:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=Po(e=>this._isOpen?e(R):(this.waiters.push(e),wo(()=>{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=wo(()=>this.closeUnsafe());whenOpen=e=>is(this.await,()=>e);isOpen(){return this._isOpen}},gl=e=>new hl(e??!1),_l=BigInt(0),vl={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:_l,endTime:_l,exit:gs},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}},yl=e=>Object.assign(Object.create(vl),e),bl=e=>e?Mr(e.annotations,ga)?e._tag===`Span`?bl(er(e.parent)):Kn():qn(e):Kn(),xl=(e,t,n)=>{let r=!e.cache.tracerEnabled||n?.annotations&&Mr(n.annotations,ga),i=n?.parent===void 0?n?.root?Kn():bl(e.cache.span):qn(n.parent),a;if(r)a=yl({name:t,parent:i,annotations:Dr(n?.annotations??wr(),ga,!0)});else{let r=e.cache.tracer??ba,o=e.getRef(Ol),s=e.getRef(Ta),c=e.getRef(Ea),l=e.getRef(Da),u=n?.level??e.getRef(_a),d=n?.links===void 0?l.length===0?[]:l.slice():[...l,...n.links];a=r.span({name:t,parent:i,annotations:n?.annotations??wr(),links:d,startTime:s?o.currentTimeNanosUnsafe():_l,kind:n?.kind??`internal`,root:n?.root??Yn(i),sampled:n?.sampled??(Xn(i)&&i.value.sampled===!1?!1:!Vl(e.getRef(va),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},Sl=(e,t)=>Lc(nn(n=>{let r=jr(n.context,cc),i=xl(n,e,t??{}),a=n.getRef(Ol),o=n.getRef(Ta);return z(hc(r,e=>wl(i,e,a,o)),i)})),Cl=(e,t)=>(t=typeof t==`function`?t:v,ws(Ca,n=>({name:e,stack:t,parent:n}))),wl=(e,t,n,r)=>wo(()=>{e.status._tag!==`Ended`&&e.end(r?n.currentTimeNanosUnsafe():_l,t)}),Tl=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return nn(t=>{let i=xl(t,e,n),a=t.getRef(Ol),o=t.getRef(Ta);return kc(t,e=>wl(i,e,a,o)),r(i)})},El=ks(ma),Dl=function(){let e=Dt(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=m;return t._tag===`Span`&&(n=Ma(n),r=Cl(t.name,n?.captureStackTrace)),e?El(r(arguments[0]),t):e=>El(r(e),t)},Ol=zr(`effect/Clock`,{defaultValue:()=>new Al}),kl=2**31-1,Al=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=wo(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Nl()}currentTimeNanos=wo(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Ml()}monotonicTimeNanos=wo(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Hi(e))}sleepMillis(e){return e<=0?Eo:Number.isFinite(e)?Po(t=>{let n=e>kl?this.sleepMillis(e-kl):R,r=setTimeout(()=>t(n),Math.min(e,kl));return wo(()=>clearTimeout(r))}):Fo}},jl=BigInt(1e6),Ml=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())*jl;return e>t&&(t=e),t}}(),Nl=function(){let e=BigInt(1e9),t;return()=>{let n=Ml(),r=BigInt(Date.now())*jl;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}}(),Pl=e=>nn(t=>e(t.getRef(Ol))),Fl=e=>Pl(t=>t.sleep(bi(e))),Il=`~effect/Cause/TimeoutError`,Ll=class extends on(`TimeoutError`){[Il]=Il;constructor(e){super({message:e})}},Rl=`~effect/Cause/AsyncFiberError`,zl=class extends on(`AsyncFiberError`){[Rl]=Rl;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Bl=zr(`effect/Console`,{defaultValue:()=>globalThis.console}),Vl=Wn(Un(Hn,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}})),Hl=zr(`effect/Logger/CurrentLoggers`,{defaultValue:()=>new Set([Zl,Ql])}),Ul=zr(`effect/Logger/LogToStderr`,{defaultValue:_}),Wl={"~effect/Logger":{_Message:m,_Output:m},pipe(){return u(this,arguments)}},Gl=e=>{let t=Object.create(Wl);return t.log=e,t},Kl=e=>e.replace(/[\s="]/g,`_`),ql=(e,t)=>`${Kl(e[0])}=${t-e[1]}ms`,Jl=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];jt(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?Rt(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=zt),nn(r=>{let i=e??r.cache.logLevel;if(Vl(r.cache.minimumLogLevel,i))return R;let a=r.getRef(Ol),o=r.getRef(Hl);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 R})},Yl={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Yl.gray,Yl.blue,Yl.green,Yl.yellow,Yl.red,Yl.bgBrightRed,Yl.black;var Xl=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`)}`,Zl=Gl(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(to(e));let o=t.getTime(),s=n.getRef(ja),c=``;for(let e of s)c+=` ${ql(e,o)}`;let l=n.getRef(Oa);Object.keys(l).length>0&&a.push(l);let u=n.getRef(Bl);(n.getRef(Ul)?u.error:u.log)(`[${Xl(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),Ql=Gl(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(Ol),a=t.getRef(Oa),o=t.cache.span;if(o===void 0||o._tag===`ExternalSpan`)return;let s={};for(let[e,t]of Object.entries(a))mt(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=to(e)),o.event(st(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)}),$l=L(void 0),eu=jt,tu=Mt,nu=Wt,ru=Rt,iu=Bt,au=Ht,ou=Ia,su=e=>new Lt(e),cu=e=>new Vt(e),lu=Fa,uu=Ga,du=Ka,fu=Ra,pu=Va,mu=cn,hu=un,gu=mn,_u=Ot,vu=Xt,yu=$t,bu=en,xu=tn,Su=fs,Cu=gs,wu=ps,Tu=ms,Eu={"~effect/Deferred":{_A:m,_E:m},pipe(){return u(this,arguments)}},Du=function(){this.resumes=void 0,this.effect=void 0};Du.prototype=Eu;var Ou=()=>new Du,ku=e=>Po(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),wo(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),Au=p(2,(e,t)=>wo(()=>Nu(e,t))),ju=p(2,(e,t)=>Au(e,$t(t))),Mu=p(2,(e,t)=>ju(e,Ia(t))),Nu=(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},Pu=Oa,Fu=cc,Iu=yc,Lu=Cc,Ru=hc,zu=gc,Bu=mc,Vu=lc,Hu=`~effect/Layer`,Uu=`~effect/Layer/MemoMap`,Wu=(e,t)=>{let n={observers:0,deferred:Ou(),scope:Iu(),finalizer:r=>To(()=>--n.observers>0?R:(e.map.delete(t),Vu(n.scope,r)))};return n},Gu=(e,t)=>t.state._tag!==`Closed`&&(e.observers++,_c(t,{},e.finalizer),!0),Ku={[Hu]:{_ROut:m,_E:m,_RIn:m},pipe(){return u(this,arguments)}},qu=e=>{let t=Object.create(Ku);return t.build=e,t},Ju=e=>qu((t,n)=>{let r=Bu(n);return Ac(e(t,r),e=>e._tag===`Failure`?Vu(r,e):R)}),Yu=e=>{let t=Ju((n,r)=>n.getOrElseMemoize(t,r,e));return t},Xu=class{get[Uu](){return Uu}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?(Gu(n,t),n.deferred.effect??ku(n.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return To(()=>{let r;return Oc(To(()=>{let i=this.get(e,t);if(i)return i;let a=Wu(this,e);return Gu(a,t)?(r=a.deferred,this.map.set(e,a),n(this,a.scope)):n(this,t)}),e=>{r&&Nu(r,e)})})}},Zu=()=>new Xu,Qu=e=>new Xu(e),$u=class e extends or()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=kr(t,e);return n?Qu(n):Zu()}},ed=p(3,(e,t,n)=>ks(cs(e.build(t,n),Dr($u,t)),$u,t)),td=p(2,(e,t)=>nn(n=>ed(e,$u.forkOrCreate(n.context),t))),nd=function(){return arguments.length===1?e=>rd(Er(arguments[0],e)):rd(Er(arguments[0],arguments[1]))},rd=e=>qu(h(L(e))),id=function(){return arguments.length===1?e=>B(arguments[0],e):B(arguments[0],arguments[1])},B=(e,t)=>V(cs(t,t=>Er(e,t))),V=e=>Yu((t,n)=>Lu(e,n)),ad=(e,t,n)=>{let r=Bu(n,`parallel`);return qc(e,e=>e.build(t,Bu(r,`sequential`)),{concurrency:e.length}).pipe(cs(e=>Rr(...e)))},od=(...e)=>Ju((t,n)=>ad(e,t,n)),sd=(e,t,n)=>Ju((r,i)=>is(Array.isArray(t)?ad(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(Os(t),cs(e=>n(e,t))))),cd=p(2,(e,t)=>sd(e,t,m)),ld=p(2,(e,t)=>sd(e,t,(e,t)=>Lr(t,e))),ud=e=>qu((t,n)=>Vs(e.build(t,n))),dd=`~effect/DateTime`,fd=`~effect/DateTime/TimeZone`,pd={[dd]:dd,pipe(){return u(this,arguments)},[at](){return this.toString()},toJSON(){return hd(this).toJSON()}};({...pd}),{...pd};var md={[fd]:fd,[at](){return this.toString()}};({...md}),{...md};var hd=e=>new Date(e.epochMilliseconds),gd=p(2,(e,t)=>Is(e,bd,e=>t(e))),_d=e=>e.reasons.some(vd),vd=e=>e._tag===`Fail`&&hu(e.error),yd=e=>{let t,n=!1;for(let r of e.reasons)vd(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?Ur(e):n?Ur(ru(e.reasons.filter(e=>!vd(e)))):Hr(t)},bd=e=>{let t=yd(e);return Wr(t)?t:Hr(t.success.value)},xd=e=>{let t=yd(e);return Wr(t)?yu(t.failure):vu(t.success.value)},Sd=p(2,(e,t)=>Gs(e,{onSuccess:t.onSuccess,onFailure:e=>{let n=yd(e);return Wr(n)?t.onFailure(n.failure):t.onDone(n.success.value)}})),Cd=`~effect/Schedule`,wd=zr(`effect/Schedule/CurrentMetadata`,{defaultValue:h({input:void 0,output:void 0,duration:Mi,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),Td={[Cd]:{_Out:m,_In:m,_Env:m},pipe(){return u(this,arguments)}},Ed=e=>{let t=Object.create(Td);return t.step=e,t},Dd=()=>{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}}},Od=e=>Ed(cs(e,e=>{let t=Dd();return(n,r)=>e(t(n,r))})),kd=e=>Ns(e.step,e=>L(()=>So(e))),Ad=e=>Pl(t=>cs(kd(e),e=>{let n=Dd();return r=>To(()=>{let i=t.currentTimeMillisUnsafe();return is(e(i,r),([e,t])=>{let a=n(i,r);return a.output=e,a.duration=t,z(Fl(t),a)})})})),jd=e=>Ed(cs(Gc(e.map(kd)),e=>(t,n)=>is(qc(e,e=>Sd(e(t,n),{onSuccess:e=>L(e[1]),onDone:()=>$l,onFailure:So})),e=>{let t=Md(e);return t===void 0?gu(Mi):L([t,t])}))),Md=e=>{let t;for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(t=t===void 0?r:Ji(t,r))}return t},Nd=(e,t=2)=>{let n=Hi(bi(e));return Od(L(e=>{let r=Ii(n*t**(e.attempt-1));return L([r,r])}))},Pd=e=>{let t=bi(e);return Od(L(e=>L([e.attempt-1,t])))},Fd=(e,t,n)=>Tc(r=>is(n?.local?ed(t,Zu(),r):td(t,r),t=>Os(e,t))),Id=p(e=>Dt(e[0]),(e,t,n)=>Sr(t)?Os(e,t):Fd(e,Array.isArray(t)?od(...t):t,n)),Ld=p(3,(e,t,n)=>is(Ad(t),t=>{let r=wd.defaultValue(),i,a=Ls(To(()=>ks(e,wd,r)),e=>(i=e,is(t(e),e=>(r=e,a))));return gd(a,e=>pt(()=>n(i,e)))})),Rd=Dt,zd=qc,Bd=Kc,H=L,Vd=Do,Hd=To,Ud=wo,Wd=R,Gd=Po,Kd=Fo,qd=Io,U=Co,Jd=So,Yd=Oo,Xd=ko,Zd=nn,W=is,Qd=ss,$d=$o,ef=es,tf=$s,nf=cs,rf=z,af=ts,of=Ns,sf=Vs,cf=Rs,lf=Ld,uf=Hs,df=Us,ff=ic,pf=nc,mf=tc,hf=rs,gf=js,_f=Gs,vf=Ts,yf=Ds,bf=Id,xf=Os,Sf=Ss,Cf=Cs,wf=ks,Tf=Sc,Ef=wc,Df=Tc,Of=Ec,kf=jc,Af=Nc,jf=Ac,Mf=Ic,Nf=Uc,Pf=Fc,Ff=Lc,If=Ms,Lf=Sl,Rf=Tl,zf=Dl,Bf=nl,Vf=rl,Hf=tl,Uf=il,Wf=ol,Gf=cl,G=fl,Kf=dl,qf=ul,Jf=Lo,Yf=Jl(`Error`),Xf=p(e=>Rd(e[0]),(e,...t)=>ws(e,Pu,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||mt(n,t[0],t[1]),n})),Zf=ls,Qf=us,$f=ds,ep=os,tp=zo,np=_o,rp=vo,ip=yo,ap=so,op=al,sp=gl,cp=`~effect/MutableRef`,lp={[cp]:cp,...Tt,toJSON(){return{_id:`MutableRef`,current:ot(this.current)}}},up=e=>{let t=Object.create(lp);return t.current=e,t},dp=p(2,(e,t)=>(e.current=t,e)),fp=Symbol.for(`effect/MutableList/Empty`),pp=()=>({head:void 0,tail:void 0,length:0}),mp=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})},hp=()=>({array:[],mutable:!0,offset:0,next:void 0}),gp=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=hp(),e.tail=e.tail.next):e.head=e.tail=hp(),e.tail.array.push(t),e.length++},_p=(e,t)=>vp(e,Zr(t),!Array.isArray(t)),vp=(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},yp=e=>{e.head=e.tail=void 0,e.length=0},bp=(e,t)=>{if(t=Vr(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 yp(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?yp(e):mp(e),n;i=i.next}return yp(e),n},xp=e=>bp(e,e.length),Sp=e=>{if(!e.head)return fp;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:yp(e):mp(e),t},Cp=(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){yp(e);return}e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length},wp=(e,t)=>Cp(e,e=>e!==t),Tp=`~effect/PubSub/Subscription`,Ep=p(2,(e,t)=>e.shutdownFlag.current||Xn(e.ended.current)?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),Dp=e=>Ff(yf(t=>{let n=Mr(t,Fu),r=Bu(e.scope),i=jp(e.pubsub,e.subscribers,e.strategy,e.ended);return zu(r,Op(i)).pipe($d(Ru(n,e=>Vu(r,e))),rf(i))})),Op=e=>Ff(Zd(t=>(dp(e.shutdownFlag,!0),zd(xp(e.pollers),e=>Mu(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(ef(()=>Ud(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),gf(e.shutdownHook.open),af)))),kp=e=>Hd(function t(n){if(e.shutdownFlag.current)return Mf;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?H(e.replayWindow.takeAll().concat(r)):ti(r)?H(r):W(Ap(e),e=>t([e]))}),Ap=e=>Gd(t=>{if(e.shutdownFlag.current)return t(Mf);if(Xn(e.ended.current))return t(H(e.ended.current.value));let n=Ou(),r=e.subscribers.get(e.subscription);return r||(r=new Set,e.subscribers.set(e.subscription,r)),r.add(e.pollers),gp(e.pollers,n),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),n.effect?t(n.effect):(n.resumes=[t],Ud(()=>wp(e.pollers,n)))}),jp=(e,t,n,r)=>new Mp(e,t,e.subscribe(),pp(),sp(!1),up(!1),n,e.replayWindow(),r),Mp=class{[Tp]={_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)}},Np=`~effect/Queue`,Pp=`~effect/Queue/Enqueue`,Fp=`~effect/Queue/Dequeue`,Ip={_A:m,_E:m},Lp={[Np]:Ip,[Pp]:Ip,[Fp]:Ip,...Tt,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:$p(this)}}},Rp=e=>nn(t=>{let n=Object.create(Lp);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=pp(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},L(n)}),zp=e=>Rp({capacity:e}),Bp=p(2,(e,t)=>To(()=>Vp(e,t)?tm:e.state._tag===`Open`&&e.strategy===`suspend`?lm(e,t):em)),Vp=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(Sp(e.messages),gp(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(gp(e.messages,t),im(e),!0):(gp(e.messages,t),am(e),!0):!1,Hp=p(2,(e,t)=>Po(n=>{let r=Up(e,t);return r.length===0||e.strategy===`dropping`?n(Xt(r)):um(e,{_tag:`Array`,remaining:r,offset:0,resume:n})})),Up=(e,t)=>{if(e.state._tag!==`Open`)return Zr(t);if(e.capacity===1/0||e.strategy===`sliding`)return _p(e.messages,t),e.strategy===`sliding`&&bp(e.messages,e.messages.length-e.capacity),am(e),[];let n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return Zr(t);let r=[],i=0;for(let a of t)i<n?gp(e.messages,a):r.push(a),i++;return am(e),r},Wp=p(2,(e,t)=>wo(()=>Gp(e,t))),Gp=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=bs($t(t),nm);return e.state.offers.size===0&&e.messages.length===0?(mm(e,n),!0):(e.state={...e.state,_tag:`Closing`,exit:n},am(e),!0)},Kp=e=>Wp(e,Bt(fn())),qp=e=>wo(()=>Jp(e)),Jp=e=>{if(e.state._tag===`Done`)return!1;yp(e.messages);let t=e.state.offers;mm(e,e.state._tag===`Open`?rm:e.state.exit);for(let e of t)dm(e);return!0},Yp=e=>Xp(e,1,1/0),Xp=p(3,(e,t,n)=>(t=Vr(t),n=Vr(n),To(()=>om(e,t,n)??$o(cm(e,()=>sm(e,t)),Xp(e,t,n))))),Zp=e=>To(()=>Qp(e)??$o(cm(e,()=>sm(e,1)),Zp(e))),Qp=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=Sp(e.messages);return pm(e),Xt(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=fm(e.state.offers);return pm(e),Xt(t)}},$p=e=>e.state._tag===`Done`?0:e.messages.length,em=Xt(!1),tm=Xt(!0),nm=en(fn()),rm=fs(),im=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(gs),e.messages.length===0)break}},am=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,im(e)},0))},om=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Xt([]);if(!sm(e,t))return;let r=e.messages.length>0?bp(e.messages,n):[fm(e.state.offers)];return pm(e),Xt(r)},sm=(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,cm=(e,t)=>Po(n=>e.state._tag===`Done`?n(e.state.exit):t()?n(gs):(e.state.takers.add(n),wo(()=>{e.state._tag!==`Done`&&e.state.takers.delete(n)}))),lm=(e,t)=>Po(n=>Vp(e,t)?n(tm):um(e,{_tag:`Single`,message:t,resume:n})),um=(e,t)=>{if(e.state._tag!==`Open`)return dm(t);let n=e.state.offers;return n.add(t),wo(()=>{e.state._tag!==`Done`&&(n.delete(t),e.state._tag===`Closing`&&n.size===0&&e.messages.length===0&&mm(e,e.state.exit))})},dm=e=>e._tag===`Single`?e.resume(em):e.resume(Xt(e.remaining.slice(e.offset))),fm=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(tm),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(Xt([]))),n},pm=e=>{if(e.state._tag===`Done`)return _d(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(mm(e,e.state.exit),_d(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`)gp(e.messages,t.message),e.state.offers.delete(t),t.resume(tm);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;gp(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(Xt([]))}}return!1},mm=(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()},hm=e=>new _m(e),gm=(e,t,n)=>Po(r=>{if(e.free>=t)return r(n);let i=()=>{e.free<t||(e.waiters.delete(i),r(n))};return e.waiters.add(i),wo(()=>{e.waiters.delete(i)})}),_m=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=To(()=>this.free<e?gm(this,e,t):(this.taken+=e,L(e)));return t}takeIfAvailable(e){return To(()=>this.free<e?L(!1):(this.taken+=e,L(!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 nn(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),R))}release(e){return nn(t=>L(this.releaseUnsafe(t,e)))}get releaseAll(){return nn(e=>L(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>Wc(n=>{let r=To(()=>this.free<e?is(n(gm(this,e,R)),()=>r):(this.taken+=e,Oc(n(t),()=>{this.releaseUnsafe(so(),e)},!0)));return r})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Wc(n=>this.free<e?Do:(this.taken+=e,Oc(n(Qo(t)),()=>{this.releaseUnsafe(so(),e)},!0)))}},vm=`~effect/Channel`,ym=e=>A(e,vm),bm={[vm]:{_Env:m,_InErr:m,_InElem:m,_OutErr:m,_OutElem:m},pipe(){return u(this,arguments)}},xm=e=>{let t=Object.create(bm);return t.transform=(t,n)=>of(e(t,n),e=>H(Jd(e))),t},Sm=(e,t)=>xm((n,r)=>W(Tm(e)(n,r),e=>t(e,r))),Cm=e=>xm((t,n)=>e),wm=e=>xm(Jf(function*(t,n){let r=Bu(n),i=e=>Vu(r,xd(e));return Af(yield*Af(e(t,n,r),i),i)})),Tm=e=>e.transform,Em=(e,t,n)=>Rp({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(ef(t=>zu(e,qp(t))),ef(n=>Bf(Lu(t(n),e),e))),Dm=(e,t)=>xm((n,r)=>nf(Em(r,e,t),Yp)),Om=e=>xm((t,n)=>Hd(()=>Tm(e())(t,n))),km=e=>jm(H(e)),Am=Cm(H(gu())),jm=e=>Cm(Ud(()=>{let t=!1;return Hd(()=>t?gu():(t=!0,e))})),Mm=e=>Cm(H(Yp(e))),Nm=e=>Cm(H(Pf(kp(e),()=>gu()))),Pm=e=>Km(nf(Dp(e),Nm)),Fm=p(2,(e,t)=>Sm(e,e=>Ud(()=>{let n=0;return nf(e,e=>t(e,n++))}))),Im=e=>e===void 0||e!==`unbounded`&&e<=1,Lm=p(e=>ym(e[0]),(e,t,n)=>Im(n?.concurrency)?Rm(e,t):zm(e,t,n)),Rm=(e,t)=>xm((n,r)=>{let i=0;return nf(Tm(e)(n,r),W(e=>t(e,i++)))}),zm=(e,t,n)=>wm(Jf(function*(r,i,a){let o=0,s=yield*Tm(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:n.concurrency,l=yield*zp(0);yield*zu(a,qp(l));let u=Uf(yield*vf()),d=op(a);if(n.unordered){let e=hm(c),n=h(e.release(1)),r=_f({onFailure:e=>W(Wp(l,e),n),onSuccess:e=>W(Bp(l,e),n)});yield*e.take(1).pipe(W(()=>s),W(e=>{let n=o++;return d(u(r(Hd(()=>t(e,n))))),Wd}),If({disableYield:!0}),of(t=>e.withPermits(c-1)(Wp(l,t))),Bf(a))}else{let e=yield*zp(c-2);yield*zu(a,qp(e)),yield*Zp(e).pipe(Qd,W(e=>Bp(l,e)),If({disableYield:!0}),of(e=>Wp(l,e)),Bf(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,Gp(l,e.cause))};yield*s.pipe(W(i=>{if(n)return Jd(n);let a=o++,s=u(Hd(()=>t(i,a)));return d(s),s.addObserver(r),Bp(e,np(s))}),If({disableYield:!0}),of(t=>Bp(e,yu(t)).pipe($d(Wp(e,t)))),Bf(a))}return Zp(l)})),Bm=e=>Sm(e,e=>{let t,n=0;return H(Hd(function r(){if(t===void 0)return W(e,e=>{switch(e.length){case 0:return r();case 1:return H(e[0]);default:return t=e,H(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),H(i)}))}),Vm=p(2,(e,t)=>Ad(typeof t==`function`?t(m):t).pipe(nf(t=>{let n=wd.defaultValue();return Hm(Qm(e,wd,Ud(()=>n)),e=>t(e).pipe(nf(e=>{n=e}),gd(()=>gu(e))))}),Km)),Hm=(e,t)=>xm((n,r)=>Ud(()=>{let i,a=()=>{let o=Bu(r);return W(Tm(e)(n,o),e=>(i=gd(e,e=>Vu(o,Cu).pipe(W(()=>t(e)),W(a))),i))};return Hd(()=>i??a())})),Um=p(2,(e,t)=>Sm(e,e=>H(W(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return ni(i)?H(i):W(e,n)})))),Wm=p(e=>ym(e[0]),(e,t,n,r)=>xm((i,a)=>nf(Tm(e)(i,a),e=>{let i=t(),a,o=0,s,c=_f(e,{onFailure(e){s=e;let t=r?.onHalt&&r.onHalt(i);return t&&t.length>0?H([i,t]):Jd(e)},onSuccess(e){let t=n(i,e);return ei(t)?H(t):t}});return Hd(function e(){if(a===void 0)return s?Jd(s):W(c,([t,n])=>(i=t,n.length===0?e():n.length===1?H(n[0]):(a=n,e())));let t=a[o++];return o>=a.length&&(a=void 0,o=0),H(t)})}))),Gm=p(2,(e,t)=>xm((n,r)=>{let i=Bu(r);return nf(Tm(e)(n,i),e=>{let a=e.pipe(of(e=>{if(_d(e))return Jd(e);let o=i;return i=Bu(r),Vu(o,yu(e)).pipe($d(Tm(t(e))(n,i)),W(e=>(a=e,e)))}));return Hd(()=>a)})})),Km=e=>xm((t,n)=>{let r;return H(Hd(()=>r||e.pipe(Lu(n),W(e=>Tm(e)(t,n)),W(e=>r=e))))}),qm=p(2,(e,t)=>wm((n,r,i)=>Ru(i,t).pipe($d(Tm(e)(n,r))))),Jm=p(2,(e,t)=>qm(e,e=>t)),Ym=(e,t,n)=>Hd(()=>{let r=Iu();return gd(W(Tm(e)(gu(),r),t),n||H).pipe(jf(e=>Vu(r,e)))}),Xm=p(2,(e,t)=>xm((n,r)=>nf(xf(Tm(e)(n,r),t),xf(t)))),Zm=p(3,(e,t,n)=>xm((r,i)=>nf(wf(Tm(e)(r,i),t,n),wf(t,n)))),Qm=p(3,(e,t,n)=>xm((r,i)=>W(n,n=>Tm(Zm(e,t,n))(r,i)))),$m=p(2,(e,t)=>Ym(e,e=>If(W(e,t),{disableYield:!0}))),eh=Jf(function*(e){let t=hm(1),n=yield*vf(),r=Mr(n,Fu);return(yield*Tm(e)(gu(),r)).pipe(xf(n),t.withPermits(1))},of(e=>H(Jd(e)))),th=(e,t)=>Tm(e)(gu(),t),nh=`~effect/MutableHashMap`,rh={[nh]:nh,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${Ze(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:ot(Array.from(this))}},[at](){return this.toJSON()},pipe(){return u(this,arguments)}},ih=()=>{let e=Object.create(rh);return e.backing=new Map,e.buckets=new Map,e},ah=p(2,(e,t)=>{if(e.backing.has(t))return qn(e.backing.get(t));if(sh(t))return Kn();let n=oh.get(t);if(n!==void 0&&e.backing.has(n))return qn(e.backing.get(n));let r=de(t),i=e.buckets.get(r);return i===void 0?Kn():ch(e,i,t)}),oh=new WeakMap,sh=e=>typeof e!=`object`&&typeof e!=`function`,ch=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(Oe(n,t[r])){let i=t[r];return oh.set(n,i),qn(e.backing.get(i))}return Kn()},lh=p(3,(e,t,n)=>{if(e.backing.has(t)||sh(t))return e.backing.set(t,n),e;let r=oh.get(t);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=de(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=uh(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),uh=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(Oe(t,e[n]))return oh.set(t,e[n]),e[n]},dh=p(2,(e,t)=>{if(sh(t))return e.backing.delete(t),e;let n=oh.get(t)??t,r=de(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||Oe(n,r)){e.backing.delete(r),i.splice(t,1);break}}return i.length===0&&e.buckets.delete(r),e}),fh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ph=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)ph[fh.charCodeAt(e)]=e;ph[61]=0;var mh=`~effect/Stream`,hh={_R:m,_E:m,_A:m},gh=function(e){this.channel=e};gh.prototype={[mh]:hh,pipe(){return u(this,arguments)}};var _h=e=>new gh(e),vh=`~effect/Stream`,yh=e=>A(e,vh),bh=_h,xh=e=>e.channel,Sh=(e,t)=>bh(Dm(e,t)),Ch=bh(Am),wh=e=>bh(km(ai(e))),Th=e=>bh(Om(()=>e().channel)),Eh=e=>bh(Mm(e)),Dh=e=>bh(Pm(e)),Oh=e=>bh(Km(nf(e,xh))),kh=p(2,(e,t)=>Th(()=>{let n=0;return bh(Fm(e.channel,oi(e=>t(e,n++))))})),Ah=p(e=>yh(e[0]),(e,t,n)=>e.channel.pipe(Bm,Lm(t,n),Fm(ai),bh)),jh=p(2,(e,t)=>bh(Vm(e.channel,t))),Mh=e=>kh(e,(e,t)=>[e,t]),Nh=p(2,(e,t)=>bh(Um(xh(e),t))),Ph=p(2,(e,t)=>e.channel.pipe(Gm(e=>t(e).channel),bh)),Fh=p(3,(e,t,n)=>Th(()=>{let r=!0;return bh(Wm(e.channel,t,(e,t)=>{let i=ii();r&&(r=!1,i.push(e));for(let r=0;r<t.length;r++)e=n(e,t[r]),i.push(e);return[e,ai(i)]}))})),Ih=p(2,(e,t)=>bh(Jm(e.channel,t))),Lh=p(2,(e,t)=>bh(Xm(e.channel,t))),Rh=p(2,(e,t)=>$m(e.channel,t)),zh=e=>eh(e.channel),Bh=`~effect/BigDecimal`,Vh={[Bh]:Bh,[ue](){let e=Yh(this);return me(M(String(e.value)),j(e.scale))},[De](e){return Hh(e)&&eg(this,e)===0},toString(){return`BigDecimal(${ng(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[at](){return this.toJSON()},pipe(){return u(this,arguments)}},Hh=e=>A(e,Bh),Uh=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Vh);return n.value=e,n.scale=t,n},Wh=(e,t)=>{let n=Uh(e,t);return n.normalized=n,n},Gh=BigInt(0),Kh=BigInt(1),qh=BigInt(10),Jh=Wh(Gh,0),Yh=e=>{if(e.normalized===void 0){if(e.value===Gh)e.normalized=Jh;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Wh(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},Xh=100,Zh=[Kh],Qh=(e,t)=>e===t?0:e<t?-1:1,$h=(e,t)=>{let n=`${e.value<Gh?-e.value:e.value}`,r=`${t.value<Gh?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Gh)return i<Gh?-1:1;let a=Math.max(n.length,r.length);return Vn(n.padEnd(a,`0`),r.padEnd(a,`0`))},eg=(e,t)=>{if(e.scale===t.scale)return Qh(e.value,t.value);let n=tg(e),r=tg(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>Xh)return n===-1?$h(t,e):$h(e,t);let o=Zh[a]??=qh**BigInt(a);return i>0?Qh(e.value,t.value*o):Qh(e.value*o,t.value)},tg=e=>e.value===Gh?0:e.value<Gh?-1:1,ng=e=>{let t=Yh(e);if(Math.abs(t.scale)>=16)return rg(t);let n=t.value<Gh,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},rg=e=>{if(ig(e))return`0e+0`;let t=Yh(e),n=`${t.value}`,r=t.value<Gh?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},ig=e=>e.value===Gh;({...ct}),{...ct};var ag=new WeakMap,og=`~effect/Redacted`,sg=e=>A(e,og),cg=(e,t)=>{let n=Object.create(lg);return t?.label&&(n.label=t.label),ag.set(n,e),n},lg={[og]:{_A:e=>e},label:void 0,...Tt,toJSON(){return this.toString()},toString(){return`<redacted${ee(this.label)?`:`+this.label:``}>`},[ue](){return de(ag.get(this))},[De](e){return sg(e)&&Oe(ag.get(this),ag.get(e))}},ug=Symbol.for(`~effect/http/Headers`),dg=Object.defineProperties(Object.create(null),{[ug]:{value:ug},[We]:{value(e){return _g(this,Mr(e,vg))}},toJSON:{value(){return Ke(this)}},[De]:{value(e){return pg(this,e)}},[ue]:{value(){return ve(this)}},toString:{value:ct.toString},[at]:{value:ct[at]}}),fg=e=>Object.assign(Object.create(dg),e),pg=Yr(_n()),mg=Object.create(dg),hg=e=>{if(e===void 0)return mg;if(Symbol.iterator in e){let t=Object.create(dg);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(dg);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},gg=p(2,(e,t)=>{let n=fg(e);return Object.assign(n,t),n}),_g=p(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=cg(e[r]))}else for(let r in e)r.search(t)!==-1&&(n[r]=cg(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),vg=zr(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]});({...Tt});function yg(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var bg=`~structural`,xg=`~sentinels`,Sg=`~constructor`,Cg=S(e=>{let t=yg(e)?.identifier;return typeof t==`string`?t:e.getExpected(Cg)}),K=Symbol(),wg=vu,Tg=wg(K),Eg=wg(K),Dg=e=>e===K?Kn():qn(e),Og=e=>e._tag===`None`?Tg:wg(e.value),kg=`~effect/SchemaIssue/Issue`;function Ag(e){return A(e,kg)&&e[kg]===kg}function jg(e){return Object.hasOwn(e,`input`)}var Mg=class{[kg]=kg;constructor(e,t){t?.reportInput===!0&&e!==K&&(this.input=e)}},Ng=class extends Mg{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Pg=class extends Mg{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Fg=class extends Mg{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Ig=class extends Mg{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Lg=class extends Mg{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Rg=class extends Mg{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},zg=class extends Mg{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Bg=class extends Mg{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}};function Vg(e,t,n,r,i){return new Rg(e,[new Fg([t],n)],r,i)}var Hg=class extends Mg{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Ug=class extends Mg{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Wg(e,t,n){if(Ag(e))return e;if(typeof e==`string`)return new Bg({message:e},t,n);let r=typeof e.issue==`string`?new Bg({message:e.issue},t,n):e.issue;return new Fg(e.path,r)}function Gg(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Bg(void 0,t,n):Wg(e,t,n)}function Kg(e,t,n,r){return Array.isArray(t)?ni(t)?t.length===1?Wg(t[0],n,r):new Rg(e,oi(t,e=>Wg(e,n,r)),n,r):void 0:Gg(t,n,r)}var qg=e=>{let t=n_(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Zg(Cg(e.ast),e);case`InvalidValue`:{let t=Xg(e);if(t!==void 0)return Zg(t,e);let n=Yg(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Yg(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Yg(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Jg=e=>n_(e.issue)??n_(e);function Yg(e){return jg(e)?Ze(e.input):void 0}function Xg(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Zg(e,t){let n=Yg(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Qg(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=>Qg(e)).join(` & `)}}function $g(){return e=>t_(e,``)}var e_=$g();function t_(e,t){let n;switch(e._tag){case`Filter`:{let r=Jg(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return t_(e.issue,t);let r=Xg(e.issue);n=r===void 0?Zg(Qg(e.filter),e):Zg(r,e.issue)}break}case`Encoding`:return t_(e.issue,t);case`Pointer`:return t_(e.issue,t+et(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>t_(e,t)).join(`
|
|
15
|
-
`);n=n_(e)??Zg(Cg(e.ast),e);break;default:n=qg(e)}return t?`${n}\n at ${t}`:n}function n_(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return n_(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 r_(e){let t;for(let n of e.reasons){if(!nu(n)||!Ag(n.error))return;t??=n.error}return t}function i_(e,t){let n=r_(e);if(n===void 0)throw Error(t,{cause:e});return n}var a_=e=>Object.assign(Object.create(d),e),o_=a_({_tag:`Passthrough`});function s_(){return o_}function c_(e){return a_({_tag:`Transform`,transform:e})}function l_(){return c_(globalThis.String)}function u_(){return c_(globalThis.Number)}var d_=class extends f{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new d_(this.encode,this.decode)}},f_=`~effect/SchemaTransformation/Transformation`,p_=class extends f{[f_]=f_;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new p_(this.encode,this.decode)}};function m_(e){return A(e,f_)&&e[f_]===f_}var h_=e=>m_(e)?e:new p_(e.decode,e.encode);function g_(e){return new p_(c_(e.decode),c_(e.encode))}var __=new p_(s_(),s_());function v_(){return __}var y_=new p_(u_(),l_()),b_=e=>oe(e)&&typeof e.message==`string`,x_=e=>{let t=Object.hasOwn(e,`cause`)?Error(e.message,{cause:T_(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},S_=e=>{try{let t=it(e);return t===void 0?Ze(e):JSON.parse(t)}catch{return Ze(e)}},C_=(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},w_=e=>{let t=new WeakSet,n=r=>{if(ce(r)){if(t.has(r))return`[Circular]`;t.add(r);let i=C_(r,e,n);return t.delete(r),i}return S_(r)};return n},T_=e=>b_(e)?x_(e):e,E_=e=>g_({decode:T_,encode:w_(e)});function D_(e){return t=>t._tag===e}var O_=D_(`Declaration`),k_=D_(`Never`),A_=D_(`Literal`),j_=D_(`UniqueSymbol`),M_=D_(`Arrays`),N_=D_(`Objects`),P_=D_(`Suspend`),F_=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},I_={},L_=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}},R_=`~effect/Schema`,z_=class{[R_]=R_;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}>`}},B_=class extends z_{_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===K?Tg:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=sy(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new B_(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>`}},V_=new class extends z_{_tag=`Null`;getParser(){return Sy(this,null)}getExpected(){return`null`}},H_=class extends z_{_tag=`Undefined`;getParser(){return Sy(this,void 0)}toCodecJson(){return Yv(this,[U_])}getExpected(){return`undefined`}},U_=new F_(V_,new p_(c_(()=>void 0),c_(()=>null))),W_=new H_,G_=new class extends z_{_tag=`Void`;getParser(){let e=wg(void 0);return t=>t===K?Tg:e}toCodecJson(){return Yv(this,[U_])}getExpected(){return`void`}},K_=new class extends z_{_tag=`Never`;getParser(){return Cy(this,ie)}getExpected(){return`never`}},q_=new class extends z_{_tag=`Unknown`;getParser(){return Cy(this,ae)}getExpected(){return`unknown`}},J_=class extends z_{_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 ${Ze(e)}`);this.literal=e}getParser(){return Sy(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Y_(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Y_(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Y_(e){let t=globalThis.String(e.literal);return Yv(e,[new F_(new J_(t),new p_(c_(()=>e.literal),c_(()=>t)))])}var X_=new class extends z_{_tag=`String`;getParser(){return Cy(this,ee)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&My(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},Z_=class extends z_{_tag=`Number`;getParser(){return Cy(this,te)}matchKey(e,t){return this._match(Dy,e,t)}matchPart(e,t){return this._match(Ey,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:My(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Q_(this.checks,`effect/schema/isFinite`)||Q_(this.checks,`effect/schema/isInt`))?this:Yv(this,[Wv])}toCodecStringTree(){return this.toCodecJson()===this?Yv(this,[Ay]):Yv(this,[jy])}getExpected(){return`number`}};function Q_(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Q_(e.checks,t))}var $_=new Z_,ev=new class extends z_{_tag=`Boolean`;getParser(){return Cy(this,ne)}getExpected(){return`boolean`}},tv=class extends z_{_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(my(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(my(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 Lg(n,t[o],i),a=new Fg([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return U(new Rg(n,[a],t,i))}return e.issues?U(new Rg(n,e.issues,t,i)):wg(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:Yc(t.concurrency),f=d===1?iv(i,e,0,u):av(i,e,{concurrency:d,end:u});if(!f)return c(i);if(as(f))return ep(f,()=>c(i));let p=!0;return Hd(()=>p?(p=!1,W(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===K)return Tg;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)):U(new zg(n,e,a))}catch(e){return Xd(e)}}}_rebuild(e,t,n){let r=sy(this.elements,e),i=sy(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new tv(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 nv(e,t,n,r){if(n._tag===`Failure`)return ov(e,e.ast,r,n);let i=n===Eg?t:n[N];if(i!==K)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(my(t.ast))return;let n=new Fg([r],new Ig(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return bu(new Rg(e.ast,[n],e.input,e.options))}}var rv={onItem(e,t,n){let r=n<e.len?t:K;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:nv},iv=Xc()(rv),av=Qc()(rv),ov=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=r_(r.cause);if(i===void 0)return yu(uu(r.cause,r=>new Rg(t,[new Fg([n],r)],e.input,e.options)));let a=new Fg([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return bu(new Rg(t,[a],e.input,e.options))},sv=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function cv(e,t,n=I_){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(wy(vy(t)))}var lv=class{name;type;constructor(e,t){this.name=e,this.type=t}};function uv(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(uv);default:return!1}}function dv(e){let t=Zv(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(dv);default:return!1}}function fv(e){return uv(e)&&dv(e)}var pv=class{parameter;type;constructor(e,t){if(!fv(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,my(t)&&!xy(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},mv=class extends z_{_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 Cy(n,re);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(wy(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 ov(t,n,i,s)??Cu;let c=s===Eg?o:s[N];if(a!==K&&c!==K){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Cu;mt(t.out,a,c)}return Cu},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!as(t))return W(tf(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return ov(e,n,r,a)??Cu;let o=a===Eg?r:a[N],s=e.input[r],l=i.parserValue(s,e.options);return as(l)?t(e,r,o,s,l):W(tf(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return as(a)?t(e,n,n,i,a):W(tf(a),r=>t(e,n,n,i,r))},u=i?Qc()({onItem:(e,[t,n])=>n.is.parameter===X_?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return tp(function*(t,d){if(t===K)return K;if(typeof t!=`object`||!t||Array.isArray(t))return yield*U(new zg(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:Yc(d.concurrency),v=i&&g?n.indexSignatures.map(e=>cv(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 Lg(n,f[a],d),r=new Fg([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*U(new Rg(n,[r],t,d))}}}if(r){let e=_===1?_v(m,a):vv(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===X_?l:c,r=v?.[e]??(t.is.parameter===X_?Object.keys(f):cv(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!as(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=ii();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===X_?Object.keys(f):cv(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*U(new Rg(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return W(tf(n),n=>{let i=hv(e,r,n);if(i)return i;let o=()=>wg(e.out),s=_v(e,a.slice(t+1));return s?ep(s,o):o()})};return(e,t)=>{if(e===K)return Tg;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&Yc(t.concurrency)!==1)return(l??=c())(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return U(new zg(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=kv(i,s),l=c?i[s]:K,d=n.parser(l,t);if(!as(d))return u(o,e,d);if(d===Eg){c&&mt(a,s,l);continue}let f=hv(o,n,d);if(f)return f}}catch(e){return Xd(e)}return wg(a)}}_rebuild(e,t,n,r){let i=sy(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new lv(t.name,n)}),a=sy(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new pv(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new mv(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 hv(e,t,n){if(n._tag===`Failure`)return ov(e,e.ast,t.name,n);if(n===Eg)return;let r=n[N];if(r!==K){mt(e.out,t.name,r);return}if(delete e.out[t.name],!my(t.type)){let n=new Fg([t.name],new Ig(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return bu(new Rg(e.ast,[n],e.input,e.options))}}var gv={onItem(e,t){if(!kv(e.input,t.name))return t.parser(K,e.options);let n=e.input[t.name];return mt(e.out,t.name,n),t.parser(n,e.options)},step:hv},_v=Xc()(gv),vv=Qc()(gv);function yv(e,t){return e?t?[...e,...t]:e:t}function bv(e,t,n){return new mv(Reflect.ownKeys(e).map(t=>new lv(t,e[t].ast)),[],n,t)}function xv(e){return e.ast}function Sv(e,t,n){return new Nv(e.map(xv),t,void 0,n)}var Cv=C(e=>{for(;;){if(P_(e))return q_;let t=e.encoding;if(!t)return e.recur?.(Cv,m)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==m))return q_;e=t[t.length-1].to}});function wv(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(wv)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Tv(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[xg];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!my(t)){if(A_(t))return[{key:e.name,literal:t.literal}];if(j_(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!my(e)){if(A_(e))return[{key:t,literal:e.literal}];if(j_(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Tv(Cv(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Tv(e.thunk())}}var Ev=new WeakMap,Dv=Object.freeze([]),Ov=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,kv=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function Av(e){let t=Ev.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=Cv(s);if(k_(c))continue;if(A_(c)||j_(c)){a??=new Map;let e=A_(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1;let l=Tv(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=wv(c);for(let n of e)(i[n]??=[]).push(t)}}let s={},c=t=>s[t]??=Object.freeze((i?.[t]??Dv).map(t=>e[t]));if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Dv;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=kv(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Dv;if(n)return e}return Dv}}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=Ov(t);if(!se(t))return c(o);let s=new Set(i?.[o]),l;if(a){let[e,[n]]=a,i=kv(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=kv(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=kv(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(Ov(e));return a?t.filter(jv(e)):t};return Ev.set(e,t),t}function jv(e){return t=>{let n=Cv(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Mv(e,t,n=!1){return Av(t)(e,n)}var Nv=class extends z_{_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===K)return Tg;let a=Mv(r,n.types,t!==void 0);if(a.length===0)return U(new Hg(n,[],r,i));if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:as(t)?Pv(n,t.cause,r,i):of(t,e=>Pv(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=Fv(o,a);return s?ep(s,e=>o.out===Eg?H(r):o.out?o.out:U(new Hg(n,o.issues??[],r,i))):o.out?o.out:U(new Hg(n,o.issues??[],r,i))}}_rebuild(e,t,n){let r=sy(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new Nv(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=vy(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(A_);if(t.length>0)return`${Lv(n.isMutable)}[ ${t.map(t=>e(t)+Rv(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>A_(e.type));if(t.length>0)return`{ ${t.map(t=>`${Lv(t.type.context?.isMutable)}${$e(t.name)}${Rv(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Pv(e,t,n,r){let i=r_(t);return i?bu(new Hg(e,[i],n,r)):yu(t)}var Fv=Xc()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=r_(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),bu(new Ug(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Cu}}}),Iv=new Nv([new J_(`Infinity`),new J_(`-Infinity`),new J_(`NaN`)]);function Lv(e){return e?``:`readonly `}function Rv(e){return e?`?`:``}var zv=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 zv(this.run,{...this.annotations,...e},this.aborted)}abort(){return new zv(this.run,this.annotations,!0)}and(e,t){return new Bv([this,e],t)}},Bv=class extends f{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new Bv(this.checks,{...this.annotations,...e})}and(e,t){return new Bv([this,e],t)}};function Vv(e,t,n=!1){return new zv((t,n,r)=>Kg(n,e(t,n,r),t,r),t,n)}function Hv(e){return Vv(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 Uv=ey($_,[Hv()]),Wv=new F_(new Nv([Uv,Iv]),new p_(u_(),c_(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function Gv(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return Vv(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 Kv(e){return Object.assign(Object.create(Object.getPrototypeOf(e)),e)}var qv=new WeakMap;function Jv(e){return qv.get(e)??e}function Yv(e,t){if(e.encoding===t)return e;let n=Kv(e);return n.encoding=t,n}function Xv(e,t){if(e.context===t)return e;let n=Jv(e);if(n.context===t)return n;let r=Kv(e);return r.context=t,qv.set(r,n),r}function Zv(e){return e.encoding?Zv(e.encoding[e.encoding.length-1].to):e}function Qv(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return $v(e,Qr(e.checks.slice(0,-1),n.annotate(t)))}let n=Kv(e);return n.annotations={...e.annotations,...t},n}function $v(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);if(e.checks===t)return e;let n=Kv(e);return n.checks=t,n}function ey(e,t){return $v(e,yv(e.checks,t))}function ty(e,t){let n=t(e.to);return n===e.to?e:new F_(n,e.transformation)}function ny(e,t){let n=e,r=n[n.length-1],i=ty(r,t);return i===r?e:Qr(e.slice(0,e.length-1),i)}function ry(e){return t=>t.encoding?Yv(t,ny(t.encoding,e)):t}function iy(e,t){return ry(e=>Xv(e,t))(e)}function ay(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Yv(r,ny(r.encoding,n))}return e(r)}return C(n)}function oy(e,t,n){let r=new F_(e,t);return Yv(n,n.encoding?[...n.encoding,r]:[r])}function sy(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 cy(e,t){return Xv(e,e.context?new L_(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new L_(!1,!1,void 0,t))}var ly=C(e=>uy(Xv(e,e.context?e.context.isOptional===!1?new L_(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new L_(!0,!1)))),uy=ry(ly),dy=S(e=>ly(new Nv([e,W_])));function fy(e,t){return Xv(e,e.context?new L_(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new L_(!1,!1,t))}function py(e,t,n){return oy(e,n,t)}function my(e){return e.context?.isOptional??!1}function hy(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(hy)}function gy(e){function t(e){return hy(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return ti(n)?n:void 0}var _y=C(e=>{let t=e,n=t.recur?.(_y)??t,r=n.encodingChecks;if(r){let t=n===e?r:M_(n)||N_(n)||O_(n)&&n.typeParameters.length>0?gy(r):void 0,i=Kv(n);return i.encoding=void 0,i.encodingChecks=void 0,i.checks=yv(n.checks,t),i}return n.encoding?Yv(n,void 0):n}),vy=C(e=>_y(by(e)));function yy(e,t){let n=t,r=n.length,i=n[r-1],a=[new F_(by(Yv(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new F_(by(n[e-1].to),n[e].transformation.flip()));let o=by(i.to);return o.encoding?Yv(o,[...o.encoding,...a]):Yv(o,a)}var by=S(e=>{if(e.encoding)return yy(e,e.encoding);let t=e;return t.flip?.(by)??t.recur?.(by)??t});function xy(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(xy);default:return!1}}function Sy(e,t){let n=t===0?Eg:wg(t);return(r,i)=>r===K?Tg:r===t?n:U(new zg(e,r,i))}function Cy(e,t){return(n,r)=>n===K?Tg:t(n)?Eg:U(new zg(e,n,r))}var wy=ay(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(wy)}}),Ty=ay(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Ty)}}),Ey=new globalThis.RegExp(`^${sv}$`),Dy=new globalThis.RegExp(`^(?:${sv}|Infinity|-Infinity|NaN)$`);function Oy(e){return Gv(Ey,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Ey.source}),...e})}var ky=ey(X_,[Oy()]),Ay=new F_(ky,y_),jy=new F_(new Nv([ky,Iv]),y_);function My(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=My(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 Ng(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Ny(e){if(!O_(e))return;let t=e.annotations?.[Sg];return k(t)?t(e.typeParameters):void 0}function Py(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Fy(e){return e===void 0||typeof e==`string`}function Iy(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 Ly(e){return Iy(e,Py)}var Ry=new B_([],()=>(e,t,n)=>Ly(e)?Eg:U(new zg(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>Hy}),zy=new F_(Ry,v_()),By=new F_(new Nv([new tv(!1,[],[Ry]),new mv([],[new pv(X_,Ry)])]),v_());function Vy(e){return Iy(e,Fy)}var Hy=new F_(new B_([],()=>(e,t,n)=>Vy(e)?Eg:U(new zg(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),v_()),Uy=(e,t,n)=>e===Eg?n(t):ep(e,n);function Wy(e){if(e._tag===`Middleware`)return(t,n,r)=>Gy(t===Eg?e.decode(wg(Dg(n)),r):e.decode(Zf(t,Dg),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===Eg?wg(t):e;case`Transform`:{let e=e=>e===K?Tg:wg(t.transform(e));return(t,n)=>Uy(t,n,e)}case`TransformOptional`:{let e=e=>Og(t.transform(Dg(e)));return(t,n)=>Uy(t,n,e)}case`TransformEffect`:return(e,n,r)=>Uy(e,n,e=>e===K?Tg:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>Uy(e,n,e=>Gy(t.transform(Dg(e),r)))}}var Gy=e=>ep(e,Og),Ky=(e,t,n,r)=>of(r,r=>Yd(()=>uu(r,r=>new Pg(e,r,t,n))));function qy(e,t){let n=Wy(e.link.transformation),r;return(i,a)=>{if(i===K)return Tg;if(e.isConstructed(i))return Eg;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function Jy(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==K&&r!==void 0)return t(r,i);let a=n;if(as(a)&&a._tag===`Success`){let e=t(a[N],i);return e===Eg?a:e}return ep(Ky(e,r,i,a),e=>{let n=t(e,i);return n===Eg?wg(e):n})}}function Yy(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:Jy(e,n)}function Xy(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Ny(e):void 0,o=a?qy(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>Wy(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(as(r)){if(r._tag===`Success`){let i=r===Eg?t:r[N];if(t!==K&&i!==K){let i=My(u,t,void 0,e,n);i&&(r=U(new Rg(e,i,t,n)))}}}else r=W(r,r=>{if(t!==K&&r!==K){let r=My(u,t,void 0,e,n);if(r)return U(new Rg(e,r,t,n))}return H(r)})}if(s&&!n.disableChecks){if(as(r)){if(r._tag===`Success`){let i=r===Eg?t:r[N];if(i===K)return r;let a=My(s,i,void 0,e,n);a&&(r=U(new Rg(e,a,i,n)))}}else r=W(r,t=>{if(t!==K){let r=My(s,t,void 0,e,n);if(r)return U(new Rg(e,r,t,n))}return H(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[N],o=t(a,r)):o=ep(o,e=>{let n=t(e,r);return n===Eg?wg(e):n})}if(o._tag===`Success`){let e=o[N],t=p(e,r);return t===Eg?o:t}return o=Ky(e,n,r,o),ep(o,e=>{let t=p(e,r);return t===Eg?wg(e):t})}:p}var Zy=Symbol(),Qy=new WeakMap,$y=e=>rb(e).parser,eb=e=>rb(e).makeEffect,tb=e=>Yy(e,eb),nb=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=Xy(this.ast,$y)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=Xy(this.ast,eb,tb)}};function rb(e){let t=Qy.get(e);if(t!==void 0)return t;let n=new nb(e);return Qy.set(e,n),n}function ib(e){let t=e.ast,n;return(e,r)=>(n??=pb(_b,_y(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function ab(e){let t=ib(e);return(e,n)=>{let r=qf(t(e,n));return wu(r)?qn(r.value):(i_(r.cause,`Option adapter can only return none for schema issues`),Kn())}}function ob(e){return hb(_y(e.ast))}function sb(e,t){let n=db(e.ast);return t===void 0?n:(e,r)=>n(e,lb(t,r))}function cb(e,t){let n=db(by(e.ast));return t===void 0?n:(e,r)=>n(e,lb(t,r))}var lb=(e,t)=>t?{...e,...t}:e,ub=e=>e===K?U(new Bg):H(e);function db(e){return pb(gb,e)}function fb(e,t){return e===Eg?H(t):as(e)?e[N]===K?ub(K):e:ep(e,ub)}function pb(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??I_);return a===Eg?H(r):as(a)?a[N]===K?ub(K):a:ep(a,ub)}}function mb(e,t){let n=qf(e);if(wu(n))return n.value;let r=i_(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function hb(e){let t,n;return(r,i)=>{t??=rb(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??I_,o=t.make;if(o!==void 0&&r!==K){let e;try{e=o(r,a)}catch(e){throw i_(au(e),`Constructor adapter can only throw schema issues`),e}if(e!==Zy&&e!==K)return e}return mb(fb((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var gb=e=>rb(e).parser,_b=e=>rb(e).makeEffect,vb=`~effect/Schema/Schema`,yb=Symbol(),bb={[vb]:vb,get make(){let e=ob(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=ib(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=ab(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return u(this,arguments)},annotate(e){return this.rebuild(Qv(this.ast,e))},annotateKey(e){return this.rebuild(cy(this.ast,e))},check(...e){return this.rebuild(ey(this.ast,e))},rebuild(e){return xb(e,this[yb])}};function xb(e,t){function n(){}let r=Object.setPrototypeOf(n,bb);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[yb]=t,r.ast=e,r}function Sb(e){return xb(Cb(e.ast),{schema:e})}var Cb=ay(e=>{let t=Ob(e,Cb),n=e.context;return t===e||n===void 0?t:iy(t,wb(n))});function wb(e){return e.constructorDefault===void 0?e:new L_(e.isOptional,e.isMutable,void 0,e.annotations)}function Tb(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function Eb(e){return t=>{let n=new Map;for(let e=0;e<t.length;e++)n.set(vy(t[e]),e);let r=[...t].sort((t,r)=>{t=vy(t),r=vy(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 Db=Eb(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function Ob(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!k(n))return Yv(e,[zy]);let r=n(e.typeParameters.map(e=>xb(vy(e))));return r===void 0?e:Yv(e,[ty(r,t)])}case`Unknown`:return Yv(e,[zy]);case`ObjectKeyword`:return Yv(e,[By]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return Tb(e),e.recur(t,Ty);case`Union`:{let n=Db(e.types);return n===e.types?e.recur(t):new Nv(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 kb=e=>e,Ab=`~effect/Schema/SchemaError`;function jb(e){return A(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}var Mb=vb;function Nb(){return(e,t,n)=>Jb(new B_(e.map(xv),e=>t(e.map(e=>Jb(e))),n))}function Pb(e,t){return Nb()([],()=>(t,n,r)=>e(t)?H(t):U(new zg(n,t,r)),t)}var Fb=class extends sa(`SchemaError`){[Ab]=Ab;constructor(e){let t=ut();dt(0);try{super({issue:e})}finally{dt(t)}}get message(){return e_(this.issue)}toString(){return`SchemaError(${this.message})`}};function Ib(e){return jb(e)}function Lb(e){return as(e)?Rb(e):of(e,e=>Yd(()=>uu(e,e=>new Fb(e))))}function Rb(e){return wu(e)?e:yu(uu(e.cause,e=>new Fb(e)))}function zb(e,t){let n;for(let r of e.reasons){if(!nu(r)||!Ib(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 Bb(e){let t=qf(e);if(wu(t))return t.value;throw zb(t.cause,`Sync adapter can only throw schema errors`)}function Vb(e,t){let n=sb(e,t);return(e,t)=>Lb(n(e,t))}function Hb(e,t){let n=Vb(e,t);return(e,t)=>Bb(n(e,t))}var Ub=Hb;function Wb(e,t){let n=cb(e,t);return(e,t)=>Lb(n(e,t))}var Gb=Wb;function Kb(e,t){let n=Wb(e,t);return(e,t)=>Bb(n(e,t))}var qb=Kb,Jb=xb;function Yb(e){return A(e,Mb)&&e[Mb]===Mb}var Xb=kb(e=>Jb(ly(e.ast),{schema:e})),Zb=kb(e=>{let t=hx(e);return Jb(dy(e.ast),{schema:t})});function Qb(e){let t=Jb(new J_(e),{literal:e,transform(n){return t.pipe(gx(Qb(n),{decode:c_(()=>n),encode:c_(()=>e)}))}});return t}var $b=Jb(K_),ex=Jb(q_),tx=Jb(V_),nx=Jb(W_),rx=Jb(X_),ix=Jb($_),ax=Jb(ev),ox=Jb(G_);function sx(e,t){return Jb(e,{fields:t,mapFields(e,t){let n=e(this.fields);return sx(bv(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function cx(e){return sx(bv(e,void 0),e)}var lx=kb(e=>Jb(new tv(!1,[],[e.ast]),{value:e})),ux=kb(e=>Jb(new tv(!1,[e.ast],[e.ast]),{value:e}));function dx(e,t){return Jb(e,{members:t,mapMembers(e,t){let n=e(this.members);return dx(Sv(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function fx(e,t){return dx(Sv(e,t,void 0),e)}function px(e){let t=e.map(Qb);return Jb(Sv(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return fx(e(this.members))},pick(e){return px(e)},transform(e){return fx(t.map((t,n)=>t.transform(e[n])))}})}var mx=kb(e=>fx([e,tx])),hx=kb(e=>fx([e,nx]));function gx(e,t){return n=>Jb(py(n.ast,e.ast,t?h_(t):v_()),{from:n,to:e})}function _x(e){return t=>Jb(fy(t.ast,e),{schema:t})}function vx(e){return Qb(e).pipe(_x(H(e)))}function yx(e,t){return cx({_tag:vx(e),...t})}function bx(){return(e,t)=>new F_(e.ast,h_(t))}var xx=Vv,Sx=Jb(Uv);function Cx(e){let t=Wn(e.order),n=e.formatter??Ze;return(r,i)=>xx(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function wx(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${Ze(e)}`);return e}var Tx=Cx({order:Hn,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:wx(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${Ze(e)})`})})});function Ex(e){return xx(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 Dx=ix.check(Ex());function Ox(e,t,n){return xx(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})`}),[bg]:!0,arbitraryConstraint:{minLength:e},...n})}function kx(e){return Ox(1,1,e)}var Ax=rx.check(kx()),jx=e=>+(e?.includeStack===!0)|(e?.excludeCause===!0?2:0),Mx=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},Nx=[];function Px(e){let t=jx(e),n=Nx[t];if(n!==void 0)return n;let r=Xx.pipe(gx(ex,E_(Mx(t))));return Nx[t]=r,r}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;function Fx(e,t){return Jb(Nb()([e,t],([e,t])=>(n,r,i)=>{if(!tu(n))return U(new zg(r,n,i));switch(n._tag){case`Fail`:return $f(sb(e)(n.error,i),{onSuccess:su,onFailure:e=>Vg(r,`error`,e,n,i)});case`Die`:return $f(sb(t)(n.defect,i),{onSuccess:cu,onFailure:e=>Vg(r,`defect`,e,n,i)});case`Interrupt`:return H(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])=>bx()(fx([cx({_tag:Qb(`Fail`),error:e}),cx({_tag:Qb(`Die`),defect:t}),cx({_tag:Qb(`Interrupt`),fiberId:hx(Sx)})]),g_({decode:e=>{switch(e._tag){case`Fail`:return su(e.error);case`Die`:return cu(e.defect);case`Interrupt`:return lu(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 Ix(e,t){return Jb(Nb()([e,t],([e,t])=>{let n=lx(Fx(e,t));return(e,t,r)=>eu(e)?$f(sb(n)(e.reasons,r),{onSuccess:ru,onFailure:n=>Vg(t,`failures`,n,e,r)}):U(new zg(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])=>bx()(lx(Fx(e,t)),g_({decode:ru,encode:({reasons:e})=>e}))}).ast,{error:e,defect:t})}function Lx(e,t,n){return Jb(Nb()([e,t,n],([e,t,n])=>{let r=Ix(t,n);return(t,n,i)=>{if(!_u(t))return U(new zg(n,t,i));switch(t._tag){case`Success`:return $f(sb(e)(t.value,i),{onSuccess:vu,onFailure:e=>Vg(n,`value`,e,t,i)});case`Failure`:return $f(sb(r)(t.cause,i),{onSuccess:yu,onFailure:e=>Vg(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])=>bx()(fx([cx({_tag:Qb(`Success`),value:e}),cx({_tag:Qb(`Failure`),cause:Ix(t,n)})]),g_({decode:e=>e._tag===`Success`?vu(e.value):yu(e.cause),encode:e=>wu(e)?{_tag:`Success`,value:e.value}:{_tag:`Failure`,cause:e.cause}}))}).ast,{value:e,error:t,defect:n})}function Rx(e){return Jb(Nb()([e],([e])=>(t,n,r)=>Jn(t)?Yn(t)?Vd:$f(sb(e)(t.value,r),{onSuccess:qn,onFailure:e=>Vg(n,`value`,e,t,r)}):U(new zg(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])=>bx()(fx([cx({_tag:Qb(`Some`),value:e}),cx({_tag:Qb(`None`)})]),g_({decode:e=>e._tag===`None`?Kn():qn(e.value),encode:e=>Xn(e)?{_tag:`Some`,value:e.value}:{_tag:`None`}}))}).ast,{value:e})}var zx=globalThis.Symbol.for(`immer-draftable`),Bx={};function Vx(e,t,n,r,i){let a=Wx(n,t,r),o=Ux(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Bx?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Bx,value:i}})}static[Mb]=Mb;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 ob(a(this))(e??{},t)}static makeOption(e,t){return ab(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(Qv(this.ast,e))}static annotateKey(e){return this.rebuild(cy(this.ast,e))}static check(...e){return this.rebuild(ey(this.ast,e))}static extend(e){return(t,r)=>{let a=Gx(t)?t:cx(t),o={...n.fields,...a.fields},s=bv(o,n.ast.checks,{identifier:e});return Vx(this,e,sx(ey(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 Hx(e){return new p_(c_(t=>new e(t,{"~payload":{token:Bx,value:t}})),s_())}function Ux(e){return`~effect/Schema/Class/${e}`}function Wx(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=Ux(t),o=e=>e instanceof i||A(e,a),s=Hx(i);return r=gx(Jb(new B_([e.ast],()=>(e,t,n)=>o(e)?H(e):U(new zg(t,e,n)),{identifier:t,[Sg]:([e])=>({isConstructed:o,link:new F_(e,s)}),toCodec:([e])=>new F_(e.ast,s),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[xg]:Tv(e.ast),...n})),s)(e)}}function Gx(e){return Yb(e)}var Kx=e=>(t,n)=>Vx(F,e,Gx(t)?t:cx(t),n,e=>({toString(){return`${e}(${Ze({...this})})`}})),qx=e=>(t,n)=>Vx(an,e,Gx(t)?t:cx(t),n,e=>({name:e})),Jx=e=>(t,n,r)=>{let i=Gx(n)?n.mapFields(e=>({_tag:vx(t),...e}),{unsafePreserveChecks:!0}):yx(t,n);return qx(e??t)(i,r)},Yx=Sb,Xx=Jb(Qv(Ry,{toCode:()=>({runtime:`Schema.Json`,Type:`Schema.Json`})})),Zx=`~effect/reactivity/Reactivity`,Qx=or(`effect/reactivity/Reactivity`),$x=Ud(()=>{let e=new Map,t=t=>{aS(t,t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})},n=e=>yf(n=>{let r=kr(n,eS);return r?aS(e,e=>{r.add(e)}):t(e),Wd}),r=(e,t)=>ef(t,n(e)),i=(t,n)=>{let r=[];return aS(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)=>qd(function*(){let n=yield*vf(),r=Mr(n,Fu),a=yield*Rp(),o=x(Uf(n),op(r)),s=!1,c=!1,l=e=>{e._tag===`Failure`?Gp(a,e.cause):Vp(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*zu(r,Ud(i(e,u))),u(),a}),o=(e,t)=>a(e,t).pipe(nf(Eh),Oh),s=t=>Hd(()=>{let n=new Set;return t.pipe(wf(eS,n),jf(t=>Ud(()=>{n.forEach(t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})})))});return Qx.of({[Zx]:Zx,mutation:r,query:a,stream:o,invalidateUnsafe:t,invalidate:n,registerUnsafe:i,withBatch:s})}),eS=class extends or()(`effect/reactivity/Reactivity/PendingInvalidation`){},tS=p(2,(e,t)=>Qx.use(n=>n.mutation(t,e))),nS=e=>Qx.use(t=>t.invalidate(e)),rS=id(Qx)($x);function iS(e){switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:return String(e);default:return de(e)}}var aS=(e,t)=>{if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(iS(e[n]));return}for(let n in e){t(n);let r=e[n];for(let e=0;e<r.length;e++)t(`${n}:${iS(r[e])}`)}},oS=`~effect/SubscriptionRef`,sS=e=>A(e,oS);({...Tt});var cS=e=>Dh(e.pubsub),lS=e=>Ud(()=>e.value),uS=(e,t)=>{e.value=t,Ep(e.pubsub,t)},dS=p(2,(e,t)=>e.semaphore.withPermit(Ud(()=>uS(e,t)))),fS=`~effect/reactivity/AsyncResult`,pS=e=>A(e,fS),mS={[fS]:{E:m,A:m},pipe(){return u(this,arguments)},[De](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return Oe(this.value,e.value);case`Failure`:return Oe(this.cause,e.cause)}},[ue](){let e=M(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:me(e)(this._tag===`Success`?de(this.value):de(this.cause))}},hS=(e,t)=>e._tag===`Success`?bS(e.value):CS(e.cause,{previous:t}),gS=e=>e._tag===`None`?vS(!0):TS(e.value),_S=e=>e._tag!==`Initial`,vS=(e=!1)=>{let t=Object.create(mS);return t._tag=`Initial`,t.waiting=e,t},yS=e=>e._tag===`Success`,bS=(e,t)=>{let n=Object.create(mS);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},xS=e=>e._tag===`Failure`,SS=(e,t)=>{let n=Object.create(mS);return n._tag=`Failure`,n.cause=e,n.previousSuccess=t?.previousSuccess??Kn(),n.waiting=t?.waiting??!1,n},CS=(e,t)=>SS(e,{previousSuccess:rr(t.previous,e=>yS(e)?qn(e):xS(e)?e.previousSuccess:Kn()),waiting:t.waiting}),wS=(e,t)=>CS(iu(e),t),TS=p(e=>pS(e[0]),(e,t)=>{if(e.waiting)return t?.touch?ES(e):e;let n=Object.assign(Object.create(mS),e);return n.waiting=!0,t?.touch&&yS(n)&&(n.timestamp=Date.now()),n}),ES=e=>yS(e)?bS(e.value,{waiting:e.waiting}):e,DS=p(2,(e,t)=>e._tag===`Failure`?CS(e.cause,{previous:t,waiting:e.waiting}):e),OS=e=>e._tag===`Success`?qn(e.value):e._tag===`Failure`?nr(e.previousSuccess,e=>e.value):Kn(),kS=e=>tr(OS(e),()=>new mu(`AsyncResult.getOrThrow: no value found`)),AS=e=>{switch(e._tag){case`Success`:return vu(e.value);case`Failure`:return yu(e.cause);default:return bu(new mu)}},jS=e=>{let t=e.success??$b,n=e.error??$b,r=Nb()([t,Ix(n,Px())],([e,t])=>(n,r,i)=>{if(!pS(n))return U(new zg(r,n,i));switch(n._tag){case`Initial`:return H(n);case`Success`:return $f(sb(e)(n.value,i),{onSuccess:e=>bS(e,n),onFailure:e=>Vg(r,`value`,e,n,i)});case`Failure`:{let a=n.previousSuccess.pipe(nr(t=>$f(sb(e)(t.value,i),{onSuccess:e=>qn(bS(e,t)),onFailure:e=>new Rg(r,[new Fg([`previousSuccess`,`value`],e)],n,i)})),Qn(()=>Vd)),o=Qf(sb(t)(n.cause,i),e=>Vg(r,`cause`,e,n,i));return ep(a,e=>Zf(o,t=>SS(t,{previousSuccess:e,waiting:n.waiting})))}}},{expected:`AsyncResult`,toCodec([e,t]){let n=yx(`Success`,{value:e,waiting:ax,timestamp:Dx});return bx()(fx([yx(`Initial`,{waiting:ax}),n,yx(`Failure`,{cause:t,previousSuccess:Rx(n),waiting:ax})]),g_({decode:e=>{switch(e._tag){case`Initial`:return vS(e.waiting);case`Success`:return bS(e.value,{waiting:e.waiting,timestamp:e.timestamp});case`Failure`:return SS(e.cause,{previousSuccess:nr(e.previousSuccess,e=>bS(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:Ue,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})},MS=`~effect/reactivity/AtomRegistry`,NS=e=>A(e,MS),PS=e=>new US(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),FS=or(MS),IS=p(e=>NS(e[0]),(e,t,n)=>{let r=n?.suspendOnWaiting??!1;return Gd(n=>{let i=e.get(t);if(i._tag!==`Initial`&&!(r&&i.waiting))return n(AS(i));let a=e.subscribe(t,e=>{e._tag!==`Initial`&&!(r&&e.waiting)&&(n(AS(e)),a())});return Ud(a)})}),LS={immediate:!0},RS=e=>{e()},zS={};function BS(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 VS=`~effect-atom/atom/Atom/Serializable`,HS=e=>VS in e?e[VS].key:e,US=class{[MS];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;dispatcher;onNodeAdded;onNodeRemoved;constructor(e,t,n,r){if(this[MS]=MS,this.scheduler=new ra(`sync`,t),this.schedulerAsync=new ra(`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===GS.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,LS)}atomHasTtl(e){return!e.keepAlive&&e.idleTTL!==0&&(e.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(e){let t=HS(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[VS].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 KS(this,e)}invalidateAtom=e=>{this.ensureNode(e).invalidate()};scheduleAtomRemoval(e){this.dispatcher.scheduleTask(()=>{let t=this.nodes.get(HS(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(HS(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(HS(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),BS(t,this.removeIdleNode)}removeIdleNode=e=>{if(this.nodeTimeoutBucket.delete(e),e.canBeRemoved){this.nodes.delete(HS(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=GS.removed;BS(e,this.destroyNode)}destroyNode=e=>{e.remove(),this.onNodeRemoved?.(e)};dispose(){this.disposed=!0,this.reset()}},WS={alive:1,initialized:2,waitingForValue:4},GS={uninitialized:WS.alive|WS.waitingForValue,stale:WS.alive|WS.initialized|WS.waitingForValue,valid:WS.alive|WS.initialized,removed:0},KS=class{constructor(e,t){this.registry=e,this.atom=t,this.writeContext=new YS(e,this)}registry;atom;state=GS.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 GS.uninitialized:return`uninitialized`;case GS.stale:return`stale`;case GS.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&WS.waitingForValue)!==0;)this.build();return this._value}build(){this.disposeLifetime(),this.invalidatedDuringBuild=!1;let e=JS(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&WS.waitingForValue)!==0&&(this.preserveInitialValueOnBuild?(this.preserveInitialValueOnBuild=!1,this.failed=!1,this.state=GS.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!==GS.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&WS.initialized)===0?Kn():qn(this._value)}setInitialValue(e){if((this.state&WS.initialized)===0){this.preserveInitialValueOnBuild=!0,this.state=GS.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&WS.initialized)!==0;if(this.state=GS.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(){ZS.phase===XS.collect?ZS.notify.add(this):this.notify()}invalidate(){if(this.state===GS.valid){this.state=GS.stale;try{this.disposeLifetime()}finally{this.propagate()}}else this.building&&ZS.phase!==XS.collect?this.build():this.propagate()}propagate(){ZS.phase===XS.collect?(this.building&&(this.invalidatedDuringBuild=!0),ZS.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===GS.valid)return!0;let t=this.lifetime?.reads;return t===void 0?this.isObserved&&e.state===GS.valid:t.has(e)}notify(){ZS.phase===XS.commit&&ZS.notify.delete(this),BS(this.listeners,RS)}disposeLifetime(){let e=this.lifetime;e!==void 0&&(this.lifetime=void 0,e.dispose())}remove(){let e=this.isObserved;this.state=GS.removed,this.listeners.clear();try{this.disposeLifetime()}finally{let t=Array.from(this.parents);this.parents.clear(),BS(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)}}},qS={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 Kd;switch(n._tag){case`Initial`:return Kd;case`Failure`:return yu(n.cause);case`Success`:return H(n.value)}},resultOnce(e,t){return Gd(n=>{let r=this.once(e);if(r._tag!==`Initial`&&!(t?.suspendOnWaiting&&r.waiting))return n(AS(r));let i=this.node.registry.subscribe(e,e=>{e._tag===`Initial`||t?.suspendOnWaiting&&e.waiting||(i(),n(AS(e)))},{immediate:!1});return Ud(i)})},setResult(e,t){return this.disposed?Kd:(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`?Kd:H(t.value)},someOnce(e){return Gd(t=>{let n=this.once(e);if(Xn(n))return t(H(n.value));let r=this.node.registry.subscribe(e,e=>{Yn(e)||(r(),t(H(e.value)))},{immediate:!1});return Ud(r)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?Kn():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?Ch:Sh(n=>Ud(()=>{this.subscribe(e,e=>Vp(n,e),{immediate:!t?.withoutInitialValue})}))},streamResult(e,t){return this.stream(e,t).pipe(Nh(_S),Ah(e=>e._tag===`Success`?H(e.value):Jd(e.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;let e=this.finalizers;this.finalizers=void 0,BS(e.reverse(),RS)}},JS=e=>{function t(n){return t.disposed||t.isFn?e.registry.get(n):e.readTracked(n,t)}return Object.setPrototypeOf(t,qS),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t.reads=new Set,t.failure=zS,t},YS=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()}},XS={disabled:0,collect:1,commit:2},ZS={phase:XS.disabled,depth:0,stale:[],notify:new Set};function QS(e){let t=ZS.phase;ZS.phase=XS.collect,ZS.depth++;let n=zS;try{e()}catch(e){n=e}if(ZS.depth===1){let{notify:e,stale:t}=ZS,r=0;do{for(ZS.phase=XS.collect;r<t.length;r++)try{$S(t[r])}catch(e){n===zS&&(n=e)}ZS.phase=XS.commit;for(let t of e)try{t.notify()}catch(e){n===zS&&(n=e)}}while(r<t.length);ZS.stale=[],e.clear()}if(ZS.depth--,ZS.phase=t,n!==zS)throw n}function $S(e){if(e.state===GS.valid){if(!e.invalidatedDuringBuild)return;e.invalidatedDuringBuild=!1,e.state=GS.stale,e.disposeLifetime()}e.value()}var eC=`~effect/reactivity/Atom`,tC=e=>A(e,eC),nC=`~effect/reactivity/Atom/Writable`,rC=p(2,(e,t)=>{let n=bi(t),r=Oi(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Hi(n):void 0})}),iC=rC(0),aC={[eC]:eC,equals:Object.is,...Tt,toJSON(){return{_id:`Atom`,keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},oC={...aC,atom(e,t){let n=mC(e,t);return uC(e=>{let t=e.self(),r=e(this);return r._tag===`Success`?n(e,r.value):DS(r,t)})},fn(e,t){return arguments.length===0?(e,t)=>sC(this,e,t):sC(this,e,t)},pull(e,t){let n=iC(_C(0));return jC(n,uC(r=>{let i=r.self(),a=r(this);return a._tag===`Success`?yC(r,AC(r,n,e,t),vS(!0),a.value):DS(a,i)}))},subscriptionRef(e){return EC(iC(uC(t=>{let n=t.self(),r=t(this);if(r._tag!==`Success`)return DS(r,n);let i=typeof e==`function`?e(t):e;return sS(i)?i:yC(t,i,vS(!0),r.value)})),(e,t)=>TC(e,t,kS(e(this))))}},sC=(e,t,n)=>{let[r,i,a]=kC(n?.reactivityKeys?(e,r)=>{let i=t(e,r);return Rd(i)?tS(i,n.reactivityKeys):Ih(i,nS(n.reactivityKeys))}:t,n);return dC(t=>{t.get(a);let n=t.self(),i=t.get(e);return i._tag===`Success`?r(t,i.value):DS(i,n)},i)},cC={...aC,[nC]:nC},lC=e=>nC in e,uC=(e,t)=>{let n=Object.create(aC);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},dC=(e,t,n)=>{let r=Object.create(cC);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function fC(e,t){e.setSelf(t)}var pC=(e,t)=>{let n=mC(e,t);return`~effect/reactivity/Atom`in n?n:uC(n)},mC=(e,t)=>{if(typeof e==`function`&&!Rd(e)&&!yh(e)){let n=e;return function(e,r){let i=n(e);switch(typeof i){case`function`:case`object`:return i===null?i:hC in i?vC(e,i,t,r):gC in i?CC(e,i,t,r):i;default:return i}}}return Rd(e)?function(n,r){return vC(n,e,t,r)}:yh(e)?function(n,r){return CC(n,e,t,r)}:_C(e)},hC=`~effect/Effect`,gC=`~effect/Stream`,_C=e=>dC(function(t){return e},fC),vC=(e,t,n,r)=>yC(e,t,n?.initialValue===void 0?vS():bS(n.initialValue),r,n?.uninterruptible);function yC(e,t,n,r=wr(),i=!1){let a=e.self(),o=Iu();e.addFinalizer(()=>{Uf(r)(Vu(o,Cu))});let s,c=!1,l=bC(r.pipe(Dr(Fu,o),Dr(FS,e.registry),Dr(Qi,e.registry.scheduler)),t,function(t){s=hS(t,a),c&&e.setSelf(s)},i);return c=!0,l!==void 0&&e.addFinalizer(l),s===void 0?a._tag===`Some`?gS(a):TS(n):s}function bC(e,t,n,r=!1){if(_u(t)){n(t);return}let i=Uf(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 xC(e){let t=e?.memoMap??iC(pC(()=>Zu())),n=e=>tC(t)?e(t):t,r=rS;function i(e){let t=Object.create(oC);t.keepAlive=!1,t.lazy=!0,t.refresh=void 0,t.factory=i;let a=NC(uC(typeof e==`function`?t=>ld(e(t),r):()=>ld(e,r)));return t.layer=a,t.read=function(e){let t=e(a);return vC(e,W(Tf,r=>ed(t,n(e),r)),{uninterruptible:!0})},t}i.memoMap=t,i.addGlobalLayer=e=>{r=ld(r,cd(e,rS))};let a=iC(pC(e=>yf(t=>ed(rS,n(e),Mr(t,Fu))).pipe(nf(Mr(Qx)))));return i.withReactivity=e=>t=>PC(t,n=>{let r=kS(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 SC=xC();SC.withReactivity;var CC=(e,t,n,r)=>wC(e,t,n?.initialValue===void 0?vS():bS(n.initialValue),r);function wC(e,t,n,r=wr()){let i=e.self();r=Dr(r,FS,e.registry);let a=Df(n=>W(th(t.channel,n),t=>Bd({while:g,body:()=>t,step(t){e.setSelf(bS(ri(t),{waiting:!0}))}}))).pipe(of(t=>(_d(t)?b(e.self(),rr(OS),Zn({onNone:()=>e.setSelf(wS(new mu,{previous:e.self()})),onSome:t=>e.setSelf(bS(t))})):e.setSelf(CS(t,{previous:e.self()})),Wd))),o=bC(r.pipe(Dr(FS,e.registry),Dr(Qi,e.registry.scheduler)),a,y,!1);return o!==void 0&&e.addFinalizer(o),i._tag===`Some`?gS(i):TS(n)}var TC=(e,t,n=wr())=>sS(t)?(e.addFinalizer(cS(t).pipe(Rh(t=>{for(let n=0;n<t.length;n++)e.setSelf(t[n]);return Wd}),Wf(n))),Kf(n)(lS(t))):t._tag===`Success`?wC(e,cS(t.value),vS(!0),n):t,EC=(e,t)=>{function n(t,n){let r=t.get(e);sS(r)?G(dS(r,n)):yS(r)&&G(dS(r.value,n))}return dC(n=>{let r=n(e);return sS(r)||yS(r)?t(n,r):r},n)},DC=Symbol.for(`effect/reactivity/atom/Atom/Reset`),OC=Symbol.for(`effect/reactivity/atom/Atom/Interrupt`);function kC(e,t){let n=iC(_C([0,void 0])),r=t?.initialValue===void 0?vS():bS(t.initialValue),i=t?.concurrent?iC(uC(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===OC)return CS(ou(),{previous:t.self()});let l=e(c,t);return hC in l?(o&&(l=W(Hf(l,{startImmediately:!0}),e=>(o.add(e),e.addObserver(()=>o.delete(e)),nf(rp(o),e=>e[0])))),yC(t,l,r,a,!1)):wC(t,l,r,a)}function o(e,t){LC(()=>{t===DC?e.set(n,[0,void 0]):t===OC?e.set(n,[e.get(n)[0]+1,OC]):e.set(n,[e.get(n)[0]+1,t]),e.refreshSelf()})}return[a,o,n]}var AC=(e,t,n,r)=>W(zh(typeof n==`function`?n(e):n),n=>{let i=ap().context,a=ii(),o=_f(n,{onFailure(e){return _d(e)?ni(a)?H({done:!0,items:a}):U(new mu(`Atom.pull: no items`)):Jd(e)},onSuccess(e){let t;return r?.disableAccumulation?t=e:(t=$r(a,e),a=t),H({done:!1,items:t})}}),s=new Set;return e.addFinalizer(()=>{for(let e of s)e()}),e.once(t),e.subscribe(t,()=>{e.setSelf(gS(e.self()));let t;t=bC(i,o,n=>{t&&s.delete(t);let r=hS(n,e.self()),i=s.size>0;e.setSelf(i?TS(r):r)}),t&&s.add(t)}),o}),jC=(e,t)=>dC(t.read,function(t,n){t.set(e,t.get(e)+1)}),MC=typeof WeakRef>`u`||typeof FinalizationRegistry>`u`?e=>{let t=ih();return function(n){let r=ah(t,n);if(r._tag===`Some`)return r.value;let i=e(n);return lh(t,n,i),i}}:e=>{let t=ih(),n=new FinalizationRegistry(e=>{dh(t,e)});return function(r){let i=ah(t,r).pipe(ir(e=>e.deref()));if(i._tag===`Some`)return i.value;let a=e(r);return lh(t,r,new WeakRef(a)),n.register(a,r),a}},NC=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),PC=p(e=>tC(e[0]),(e,t,n)=>{let r=iC(lC(e)?dC(n=>t(n,e),function(t,n){t.set(e,n)},e.refresh??function(t){t(e)}):uC(n=>t(n,e),e.refresh??function(t){t(e)}));return n?.initialValueTarget&&(r.initialValueTarget=FC(n.initialValueTarget)),r}),FC=e=>{let t=e;for(;t.initialValueTarget;)t=t.initialValueTarget;return t},IC=p(2,(e,t)=>PC(e,n=>t(n(e)))),LC=QS,RC=`~effect-atom/atom/Atom/Serializable`,zC=p(2,(e,t)=>{let n=Yx(t.schema);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:e.label??[t.key,ut()===0?``:Error().stack?.split(`
|
|
16
|
-
`)[5]??``],[RC]:{key:t.key,encode:qb(n),decode:Ub(n)}})}),BC=`~effect-atom/atom/Atom/ServerValue`,VC=p(2,(e,t)=>`~effect-atom/atom/Atom/ServerValue`in e?e[BC](e=>t.get(e)):t.get(e)),HC=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 k(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function re(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 ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ie(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+k(a,u),c+=ie(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+k(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 ie(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`})),UC=o(((e,t)=>{t.exports=HC()})),WC=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}}}})),GC=o(((e,t)=>{t.exports=WC()})),q=l(UC(),1),KC=l(GC(),1);function qC(e){let t=KC.unstable_scheduleCallback(4,e);return()=>KC.unstable_cancelCallback(t)}var JC=q.createContext(PS({scheduleTask:qC,defaultIdleTTL:400})),YC=new WeakMap;function XC(e,t){let n=YC.get(e);n===void 0&&(n=new WeakMap,YC.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 VC(t,e)}};return n.set(t,i),i}function ZC(e,t){let n=XC(e,t);return q.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}var QC=(e,t)=>{let n=q.useContext(JC);return t?ZC(n,q.useMemo(()=>IC(e,t),[e,t])):ZC(n,e)};function $C(e,t){q.useEffect(()=>e.mount(t),[t,e])}var ew=e=>{$C(q.useContext(JC),e)},tw=(e,t,n)=>{let r=q.useContext(JC);q.useEffect(()=>r.subscribe(e,t,n),[r,e,t,n?.immediate])},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()})),iw=o((e=>{var t=UC();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`})),aw=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=iw()})),ow=o((e=>{var t=rw(),n=UC(),r=aw();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`),k=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=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 ie: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 k:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case re: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,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hp(t),e=gp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(fh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=gp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),fh._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
17
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
18
|
-
`+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!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{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
22
|
-
Error generating stack: `+e.message+`
|
|
23
|
-
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:N(n),(n&(e.suspendedLanes|t))===0?n:0}function N(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 bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Oh(e.type)):e}function St(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_m(e);e!==null;){if(n=e[wt])return n;e=_m(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Re.call(Kt,e)?!0:Re.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var P=!1;function Jt(){var e=P;return P=!1,e}function Yt(e,t,n){if(qt(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 Xt(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 Zt(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 Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(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 tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(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=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(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=``+Qt(s):e.removeAttribute(`name`)}function sn(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)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(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),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(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=``+Qt(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 un(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function dn(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=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=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 mn(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||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(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]=``,P=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(mn(e,a,r),P=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(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 _n=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`]]),vn=/^[\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 yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(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="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));on(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&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(Wd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||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 kn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.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 Pn=i.slice(e,1<r?1-r:void 0)}function In(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 Ln(){return!0}function Rn(){return!1}function zn(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)?Ln:Rn,this.isPropagationStopped=Rn,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=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=w({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,Kn,qn=w({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Kn&&(Kn&&e.type===`mousemove`?(Wn=e.screenX-Kn.screenX,Gn=e.screenY-Kn.screenY):Gn=Wn=0,Kn=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),Jn=zn(qn),Yn=zn(w({},qn,{dataTransfer:0})),Xn=zn(w({},Hn,{relatedTarget:0})),Zn=zn(w({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Qn=zn(w({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),$n=zn(w({},Bn,{data:0})),er={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},tr={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`},nr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nr[e])?!!t[e]:!1}function ir(){return rr}var ar=zn(w({},Hn,{key:function(e){if(e.key){var t=er[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?tr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),or=zn(w({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),sr=zn(w({},Bn,{submitter:0})),cr=zn(w({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir})),lr=zn(w({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ur=zn(w({},qn,{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})),dr=zn(w({},Bn,{newState:0,oldState:0,source:0})),fr=[9,13,27,32],pr=kn&&`CompositionEvent`in window,mr=null;kn&&`documentMode`in document&&(mr=document.documentMode);var hr=kn&&`TextEvent`in window&&!mr,gr=kn&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Fn(),Pn=Nn=Mn=null,xr=!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 gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=Qf(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){Gf(e,0)}function Ar(e){if(nn(It(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(kn){var Nr;if(kn){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Sn(e)),Dn(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function Vr(e,t){if(e===`input`||e===`change`)return Ar(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(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(!Re.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(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 Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(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=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(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=Gr(e.document)}return t}function Xr(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 Zr=kn&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(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}),ei&&Wr(ei,r)||(ei=r,r=Qf($r,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};kn&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`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(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ht(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ed.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Pd;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 xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=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)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(e){if(50<Fd)throw Fd=0,Id=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Mi={};function Ni(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 Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(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 Li(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 Ri(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=Qm(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case A:return e=Pi(31,n,t,a),e.elementType=A,e.lanes=o,e;case O:return zi(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Pi(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Pi(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=Pi(19,n,t,a),e.elementType=ae,e.lanes=o,e;case ce:case ue:return e=a|32,e=Pi(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 k:s=10;break a;case ne:s=9;break a;case re: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=Pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,Zi=null,Qi=1,$i=``;function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ta(e,t,n){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Zi=e;var r=Qi;e=$i;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Qi=1<<32-tt(t)+i|n<<i|r,$i=a+e}else Qi=1<<a|n<<i|r,$i=e}function na(e){e.return!==null&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,$i=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null}function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Qi=t.id,$i=t.overflow,Zi=e}var aa=null,oa=null,F=!1,sa=null,ca=!1,I=Error(i(519));function la(e){throw ha(Wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),I}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:G(`cancel`,t),G(`close`,t);break;case`iframe`:case`object`:case`embed`:G(`load`,t);break;case`video`:case`audio`:for(n=0;n<Uf.length;n++)G(Uf[n],t);break;case`source`:G(`error`,t);break;case`img`:case`image`:case`link`:G(`error`,t),G(`load`,t);break;case`details`:G(`toggle`,t);break;case`input`:G(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:G(`invalid`,t);break;case`textarea`:G(`invalid`,t),dn(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||ip(t.textContent,n)?(r.popover!=null&&(G(`beforetoggle`,t),G(`toggle`,t)),r.onScroll!=null&&G(`scroll`,t),r.onScrollEnd!=null&&G(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||la(e,!0)}function da(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:aa=aa.return}}function fa(e){if(e!==aa)return!1;if(!F)return da(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||vp(e.type,e.memoizedProps)),n=!n),n&&oa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));oa=gm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));oa=gm(e)}else t===27?(t=oa,Dp(e.type)?(e=hm,hm=null,oa=e):oa=t):oa=aa?mm(e.stateNode.nextSibling):null;return!0}function pa(){oa=aa=null,F=!1}function ma(){var e=sa;return e!==null&&(vd===null?vd=e:vd.push.apply(vd,e),sa=null),e}function ha(e){sa===null?sa=[e]:sa.push(e)}var ga=be(null),_a=null,va=null;function ya(e,t,n){Se(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,xe(ga)}function xa(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 Sa(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),xa(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),xa(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),xa(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 Ca(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;Ur(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[fh]:e.push(fh))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=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()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(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 Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Rf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=j.S;j.S=function(e,t){if(xd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=wf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=wf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=be(null);function qa(){var e=Ka.current;return e===null?id.pooledCache:e}function Ja(e,t){t===null?Se(Ka,Ka.current):Se(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=id,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,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(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 fo(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=Ii(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=Bi(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),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===se&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),lo(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=Hi(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=zi(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=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Ri(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case D:return t=Hi(t,e.mode,n),t.return=e,t;case se:return t=no(t),f(e,t,n)}if(ge(t)||pe(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===k)return f(e,Da(e,t),n);uo(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=no(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,co(n),r);if(n.$$typeof===k)return p(e,t,Da(e,n),r);uo(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=no(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,co(r),i);if(r.$$typeof===k)return m(e,t,n,Da(t,r),i);uo(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),F&&ea(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 F&&ea(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)}),F&&ea(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),F&&ea(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 F&&ea(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)}),F&&ea(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),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===se&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(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=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case se:return o=no(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,co(o),c);if(o.$$typeof===k)return _(e,r,Da(e,o),c);uo(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=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(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 vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function bo(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,vt(e,n)}}function xo(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 L=!1;function So(){if(L){var e=Va;if(e!==null)throw e}}function Co(e,t,n,r){L=!1;var i=e.updateQueue;ho=!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?(V&f)===f:(r&f)===f){f!==0&&f===Ba&&(L=!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:ho=!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),fd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=be(null),Do=be(0);function Oo(e,t){e=ud,Se(Do,e),Se(Eo,t),ud=e|t.baseLanes}function ko(){Se(Do,ud),Se(Eo,Eo.current)}function Ao(){ud=Do.current,xe(Eo),xe(Do)}var R=be(null),jo=null;function Mo(e){var t=e.alternate;Se(Lo,Lo.current&1),Se(R,e),jo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){Se(Lo,Lo.current),Se(R,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(Se(Lo,Lo.current),Se(R,e),jo===null&&(jo=e)):Fo()}function Fo(){Se(Lo,Lo.current),Se(R,R.current)}function Io(e){xe(R),jo===e&&(jo=null),xe(Lo)}var Lo=be(0);function Ro(e,t){Se(R,R.current),Se(Lo,t)}function zo(e){xe(Lo),xe(R),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||dm(n)||fm(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 Vo=0,z=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Vo=a,z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){j.H=hc;var t=Ho!==null&&Ho.next!==null;if(Vo=0,Uo=Ho=z=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&wa(e)&&(Pc=!0))}function ts(e,t,n,r){z=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=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=vc,o=t(n,r)}while(Go);return o}function ns(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(z.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Vo=0,Uo=Ho=z=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?z.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=z.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?z.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw z.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?z.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=to(Yo,e,t),t=z,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===de)return;if(e.$$typeof===k)return Ea(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=z.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=cs(),z.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 fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(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?(Vo&f)===f:(V&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===Ba&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ba&&(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,z.lanes|=p,fd|=p;f=u.action,Ko&&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,z.lanes|=f,fd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Pc=!0,d&&(n=Va,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 hs(e){var t=ss(),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);Ur(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=z,a=ss(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ur((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||Vo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=z.updateQueue,t===null?(t=cs(),z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function xs(e){var t=ki(e,2);t!==null&&Bd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(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,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(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),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(F){var n=id.formState;if(n!==null){a:{var r=z;if(F){if(oa){b:{for(var i=oa,a=ca;i.nodeType!==8;){if(!a){i=null;break b}if(i=mm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){oa=mm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,z,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,z,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(z.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=z.updateQueue,t===null&&(t=cs(),z.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();z.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(z.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){z.flags|=4;var t=z.updateQueue;if(t===null)t=cs(),z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(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 qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Vo&1073741824&&!(V&261930)?e.memoizedState=t:(e.memoizedState=n,e=Rd(),z.lanes|=e,fd|=e,n)}function Qs(e,t,n,r){return Ur(n,t)?n:Eo.current===null?!(Vo&106)||Vo&1073741824&&!(V&261930)?(Pc=!0,e.memoizedState=n):(e=Rd(),z.lanes|=e,fd|=e,t):(e=Zs(e,n,r),Ur(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,dc(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Wa(c,r),Ld(e)):uc(e,t,r,Ld(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Ld())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,_e,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Ld())}function ic(){return Ea(fh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ld();e=vo(n);var r=yo(t,e,n);r!==null&&(Bd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Ld();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Oi(e,t,n,r),n!==null&&(Bd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Ld())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Ur(s,o))return Di(e,t,i,0),id===null&&Ei(),!1}catch{}if(n=Oi(e,t,i,r),n!==null)return Bd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Rf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Oi(e,n,r,2),t!==null&&Bd(t,e,2)}function fc(e){var t=e.alternate;return e===z||t!==null&&t===z}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var hc={readContext:Ea,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:Ea,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){et(!0);try{n(t)}finally{et(!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=cc.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,z,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,a=os();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));V&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=id.identifierPrefix;if(F){var n=$i,r=Qi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,z,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,z)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Ea,use:us,useCallback:Ys,useContext:Ea,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:Ea,use:us,useCallback:Ys,useContext:Ea,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(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 bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Bd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Bd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ld(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Bd(t,e,n),bo(t,e,n))}};function xc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(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 wc(e){Si(e)}function Tc(e){console.error(e)}function Ec(e){Si(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=vo(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(wd===null?wd=new Set([this]):wd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=R.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?Xd():n.alternate===null&&dd===0&&(dd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),vf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?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)),vf(e,r,a)),!1}throw Error(i(435,n.tag))}return vf(e,r,a),Xd(),!1}if(F)return t=R.current,t===null?(r!==I&&(t=Error(i(423),{cause:r}),ha(Wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Wi(r,n),a=kc(e.stateNode,r,a),xo(e,a),dd!==4&&(dd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==I&&(e=Error(i(422),{cause:r}),ha(Wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Wi(o,n),_d===null?_d=[o]:_d.push(o),dd!==4&&(dd=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),xo(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`&&(wd===null||!wd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(F&&s&&na(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Po(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),ko(),Fo()):(Ja(t,a.cachePool),Oo(t,a),Fo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),ko(),Po(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return po(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(No(t),(e=oa)?(e=um(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(Eo.current===null){if(r=id,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),Bd(r,e,s),Nc;Xd()}t=Uc(e,t,n)}else e=o.treeContext,oa=mm(s.nextSibling),aa=t,F=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 Kc(e,t,n,r,i){return Ta(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(F&&r&&na(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(F&&r&&na(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):Mi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Mi,typeof u==`object`&&u&&(o=Ea(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)&&Sc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=ho||xc(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,_o(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Ea(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)&&Sc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=ho||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(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,Gc(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=po(t,e.child,null,i),t.child=po(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return pa(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Ya()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=hd),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(F){if(i?Mo(t):Fo(),(e=oa)?(e=um(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw la(t);return t.lanes=fm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=zi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Mo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Ii(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 el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=Pi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return po(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=zi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),fm(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,ha({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(Eo.current!==null)return nl(e,t,c);if(r=id,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ki(e,a),Bd(r,e,a),Nc;return dm(o)||Xd(),nl(e,t,c)}return dm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,oa=mm(o.nextSibling),aa=t,F=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function ol(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 sl(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 cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=F?Ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(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=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(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&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(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=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function fl(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Mo(t),e=ul(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,F&&t.flags&1048576&&ta(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Fi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===k){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==a){a=Wi(Error(i(424)),t),ha(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(oa=mm(e.firstChild),aa=t,F=!0,sa=null,ca=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Rm(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=_p(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&F&&(r=t.stateNode=bm(t.type,t.pendingProps,Te.current),aa=t,ca=!0,a=oa,Dp(t.type)?(hm=a,oa=mm(r.firstChild)):oa=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=oa)&&(r=cm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,aa=t,oa=mm(r.firstChild),ca=!1,a=!0)),a||la(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,vp(a,o)?r=null:s!==null&&vp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),fh._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=oa)&&(n=lm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,aa=t,oa=null,e=!0)),e||la(t)),null;case 13:return $c(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=id,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Fc(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:F&&na(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?$m(t,r):$m(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(U())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t)){if(U())e.flags|=8192;else throw ro=$a,Za}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,gd|=t)}function vl(e,t){if(!F)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 yl(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 bl(e,t,n){var r=t.pendingProps;switch(ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,fa(t)?ua(t,e):(e=bm(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,fa(t))ua(t,o);else{var s=mp(Te.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[wt]=t,o[Tt]=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(sp(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&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=aa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ip(e.nodeValue,n)),e||la(t,!0)}else e=mp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(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[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(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[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(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),_l(t,t.updateQueue),yl(t),null);case 4:return Oe(),e===null&&Jf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return ba(t.type),yl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(dd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),F&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>Sd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return yl(t),null}else 2*Ue()-r.renderingStartTime>Sd&&n!==536870912&&(t.flags|=128,a=!0,vl(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=Ue(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Ro(t,o):(n=o,Se(R,t),Se(Lo,n),jo===null&&(jo=t)),F&&ea(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Io(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(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&&xe(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(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 Oe(),null;case 10:return ba(t.type),null;case 22:case 23:return Io(t),Ao(),e!==null&&xe(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(ra(t),t.tag){case 3:ba(Ma),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:ba(t.type);break;case 22:case 23:Io(t),Ao(),e!==null&&xe(Ka);break;case 24:ba(Ma)}}function Cl(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){_f(t,t.return,e)}}function wl(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){_f(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){_f(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){_f(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){_f(e,t,n)}}function Dl(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=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=zp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Bp(e);f(e.child,!1,rm,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){_f(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){_f(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){_f(e,t,n)}else n.current=null}}function kl(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++)am(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&am(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&om(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(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){_f(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;lp(r,e.type,n,t),r[Tt]=t}catch(t){_f(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Dp(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 Rl(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=bn)),kl(e,r),P=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Dp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),P=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Dp(e.type)&&(n=e.stateNode)),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);sp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){_f(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Np(o);r.push(s),s.view&&(a=!0)}else a||Np(o).view&&(a=!0);Vl=!0,Ap(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?jp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(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=xi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||zd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;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=xi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,zd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?zd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),zd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(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,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Np(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&&Ap(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Pp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||zd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,fp=xh,e=Yr(e),Xr(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(pp={focusedElem:e,selectionRange:r},xh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,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=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){_f(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)sm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:sm(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=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&ql(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,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){_f(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){_f(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(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{To(e,t)}catch(e){_f(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xf.bind(null,n),pm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(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){_f(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,P=!0}catch(t){_f(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?kp(s,!0):kp(e.stateNode,!1)}catch(t){_f(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(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 Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;Dp(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),xm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),P=!0}catch(e){_f(n,t,e)}else try{Cu.removeChild(n.stateNode),P=!0}catch(e){_f(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,Op(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qh(e)):Op(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qh(e)}catch(e){_f(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qh(e)}catch(e){_f(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Sf.bind(null,e,t);t.then(r,r)}})}function ju(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(Dp(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(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}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(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=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(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(ou)e.stateNode=_p(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[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),sp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Xm(`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),sp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Xm(`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),sp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||Zm(o,e.type,e.stateNode)}else e.stateNode=Gm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||Zm(o,e.type,e.stateNode):Gm(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),P=!0}catch(t){_f(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,P=!0}catch(t){_f(e,e.return,t)}}break;case 3:if(P=!1,Ym=null,o=Mu,Mu=Tm(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{qh(t.containerInfo)}catch(t){_f(e,e.return,t)}lu&&(lu=!1,Fu(e)),P=!1;break;case 4:a=cu,cu=ou,r=Jt(),o=Mu,Mu=Tm(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,P&&pu&&(mu=!0),P=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(bd=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=Jt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&xi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&P&&(e.flags|=4),pu=o,P=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){_f(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xh=!0,t.reset(),xh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];jp(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`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(zd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&xm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(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:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){_f(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++)wo(l[i],c)}catch(e){_f(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Zm(Tm(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(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&&Pa(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(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&&Pa(a)));break;case 12:if(a&2048){Uu(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){_f(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(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&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(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:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(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:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&nh(n,e)):rh(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&nh(n,e));break;case 3:case 4:var r=Mu;Mu=Tm(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(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 Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(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:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,B=null,V=0,ad=0,od=null,sd=!1,cd=!1,ld=!1,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=null,vd=null,yd=!1,bd=0,xd=0,Sd=1/0,Cd=null,wd=null,Td=0,Ed=null,Dd=null,Od=0,kd=0,Ad=null,jd=null,Md=null,Nd=null,Pd=null,Fd=0,Id=null;function Ld(){return rd&2&&V!==0?V&-V:j.T===null?xt():Rf()}function Rd(){if(hd===0){if(!(V&536870912)||F){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),hd=e}else hd=536870912}return e=R.current,e!==null&&(e.flags|=32),hd}function zd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=zp(yi(e.memoizedProps,n))),Nd===null&&(Nd=[]),Nd.push(t.bind(null,r))}}function Bd(e,t,n){(e===id&&(ad===2||ad===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,V,hd,!1)),ht(e,n),(!(rd&2)||e!==id)&&(e===id&&(!(rd&2)&&(pd|=n),dd===4&&Ud(e,V,hd,!1)),Af(e))}function H(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?Qd(e,t):Zd(e,t,!0),o=r;do{if(a===0){cd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Zd(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=_d;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(ld&&!l){c.errorRecoveryDisabledLanes|=o,pd|=o,a=4;break a}o=vd,vd=a,o!==null&&(vd===null?vd=o:vd.push.apply(vd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(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:Ud(r,t,hd,!sd);break a;case 2:vd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=bd+300-Ue(),10<a)){if(Ud(r,t,hd,!sd),lt(r,0,!0)!==0)break a;Od=t,r.timeoutHandle=xp(Vd.bind(null,r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,`Throttled`,-0,0),a);break a}Vd(r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,null,-0,0)}break}while(1);Af(e)}function Vd(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:bn},Hl=null,Yu(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=sh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?bd-Ue():(a&4194048)===a?xd-Ue():0,m=ah(d,m),m!==null)){Od=a,e.cancelPendingCommit=m(of.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}of(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(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(!Ur(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 Ud(e,t,n,r){t=dt(e,t),t&=~md,t&=~pd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Wd(){return rd&6?!0:(jf(0,!1),!1)}function Gd(){if(B!==null){if(ad===0)var e=B.return;else e=B,va=_a=null,as(e),oo=null,so=0,e=B;for(;e!==null;)Sl(e.alternate,e),e=e.return;B=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Sp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Od=0,Gd(),id=e,B=n=Ii(e.current,null),V=t,ad=0,od=null,sd=!1,cd=ut(e,t),ld=!1,gd=hd=md=pd=fd=dd=0,vd=_d=null,yd=!1,ud=dt(e,t),Ei(),n}function qd(e,t){z=null,j.H=hc,t===Xa||t===Qa?(t=io(),ad=3):t===Za?(t=io(),ad=4):ad=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,od=t,B===null&&(dd=1,Dc(e,Wi(t,e.current)))}function U(){var e=R.current;return e===null?!0:(V&4194048)===V?jo===null:(V&62914560)===V||V&536870912?e===jo:!1}function Jd(){var e=j.H;return j.H=hc,e===null?hc:e}function Yd(){var e=j.A;return j.A=td,e}function Xd(){dd=4,sd||(V&4194048)!==V&&R.current!==null||(cd=!0),!(fd&134217727)&&!(pd&134217727)||id===null||Ud(id,V,hd,!1)}function Zd(e,t,n){var r=rd;rd|=2;var i=Jd(),a=Yd();(id!==e||V!==t)&&(Cd=null,Kd(e,t)),t=!1;var o=dd;a:do try{if(ad!==0&&B!==null){var s=B,c=od;switch(ad){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:R.current===null&&(t=!0);var l=ad;if(ad=0,od=null,nf(e,s,c,l),n&&cd){o=0;break a}break;default:l=ad,ad=0,od=null,nf(e,s,c,l)}}W(),o=dd;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,rd=r,j.H=i,j.A=a,B===null&&(id=null,V=0,Ei()),o}function W(){for(;B!==null;)ef(B)}function Qd(e,t){var n=rd;rd|=2;var r=Jd(),a=Yd();id!==e||V!==t?(Cd=null,Sd=Ue()+500,Kd(e,t)):cd=ut(e,t);a:do try{if(ad!==0&&B!==null){t=B;var o=od;b:switch(ad){case 1:ad=0,od=null,nf(e,t,o,1);break;case 2:case 9:if(eo(o)){ad=0,od=null,tf(t);break}t=function(){ad!==2&&ad!==9||id!==e||(ad=7),Af(e)},o.then(t,t);break a;case 3:ad=7;break a;case 4:ad=5;break a;case 7:eo(o)?(ad=0,od=null,tf(t)):(ad=0,od=null,nf(e,t,o,7));break;case 5:var s=null;switch(B.tag){case 26:s=B.memoizedState;case 5:case 27:var c=B;if(s?eh(s):c.stateNode.complete){ad=0,od=null;var l=c.sibling;if(l!==null)B=l;else{var u=c.return;u===null?B=null:(B=u,rf(u))}break b}}ad=0,od=null,nf(e,t,o,5);break;case 6:ad=0,od=null,nf(e,t,o,6);break;case 8:Gd(),dd=6;break a;default:throw Error(i(462))}}$d();break}catch(t){qd(e,t)}while(1);return va=_a=null,j.H=r,j.A=a,rd=n,B===null?(id=null,V=0,Ei(),dd):0}function $d(){for(;B!==null&&!Ve();)ef(B)}function ef(e){var t=pl(e.alternate,e,ud);e.memoizedProps=e.pendingProps,t===null?rf(e):B=t}function tf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,V);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,V);break;case 5:as(t);var r=t;r===aa&&(F?(da(r),r.tag===5&&r.stateNode!=null&&(oa=r.stateNode)):(da(r),F=!0));default:Sl(n,t),t=B=Li(t,ud),t=pl(n,t,ud)}e.memoizedProps=e.pendingProps,t===null?rf(e):B=t}function nf(e,t,n,r){va=_a=null,as(t),oo=null,so=0;var i=t.return;try{if(Mc(e,i,t,n,V)){dd=1,Dc(e,Wi(n,e.current)),B=null;return}}catch(t){if(i!==null)throw B=i,t;dd=1,Dc(e,Wi(n,e.current)),B=null;return}t.flags&32768?(F||r===1?e=!0:cd||V&536870912?e=!1:(sd=e=!0,(r===2||r===9||r===3||r===6)&&(r=R.current,r!==null&&r.tag===13&&(r.flags|=16384))),af(t,e)):rf(t)}function rf(e){var t=e;do{if(t.flags&32768){af(t,sd);return}e=t.return;var n=bl(t.alternate,t,ud);if(n!==null){B=n;return}if(t=t.sibling,t!==null){B=t;return}B=t=e}while(t!==null);dd===0&&(dd=5)}function af(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,B=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){B=e;return}B=e=n}while(e!==null);dd=6,B=null}function of(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do mf();while(Td!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(B=id=null,V=0),Dd=t,Ed=e,Od=n,Ad=a,jd=r,sf(e,t,n,s,c,l,f)}}function sf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(kd=s,s|=Ti,gt(e,n,s,r,i,a),Nd=null,(n&335544064)===n?(Pd=La(e),r=10262):(Pd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Cf(qe,function(){return hf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=j.T,j.T=null,i=M.p,M.p=2,a=rd,rd|=4;try{gu(e,t,n)}finally{rd=a,M.p=i,j.T=r}}Td=1,Vl?Md=Lp(o,e.containerInfo,Pd,uf,df,lf,ff,hf,cf,null,null):(uf(),df(),ff())}function cf(e){if(Td!==0){var t=Ed.onRecoverableError;t(e,{componentStack:null})}}function lf(){Td===3&&(Td=0,Lu(Dd,Ed),Td=4)}function uf(){if(Td===1){Td=0;var e=Ed,t=Dd,n=Od,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=j.T,j.T=null;var i=M.p;M.p=2;var a=rd;rd|=4;try{pu=mu=!1,Nu(t,e,n),n=pp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(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 _=qr(s,h),v=qr(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}}xh=!!fp,pp=fp=null}finally{rd=a,M.p=i,j.T=r}}e.current=t,Td=2}}function df(){if(Td===2){Td=0;var e=Ed,t=Dd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=rd;rd|=4;try{vu(e,t.alternate,t)}finally{rd=i,M.p=r,j.T=n}}Td=3}}function ff(){if(Td===4||Td===3){Td=0;var e=Md;Md=null,He();var t=Ed,n=Dd,r=Od,i=jd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Td=5:(Td=0,Dd=Ed=null,pf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(wd=null),bt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=j.T,a=M.p,M.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,M.p=a}}if(i=Nd,o=Pd,Pd=null,i!==null&&(Nd=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);Od&3&&mf(),Af(t),a=t.pendingLanes,r&261930&&a&42?t===Id?Fd++:(Fd=0,Id=t):(Fd=0,Id=null),jf(0,!1)}}function pf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function mf(){return Md!==null&&(Md.skipTransition(),Md=null),uf(),df(),ff(),hf()}function hf(){if(Td!==5)return!1;var e=Ed,t=kd;kd=0;var n=bt(Od),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=Ad,Ad=null;var o=Ed,s=Od;if(Td=0,Dd=Ed=null,Od=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,jf(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{M.p=a,j.T=r,pf(e,t)}}function gf(e,t,n){t=Wi(n,t),t=kc(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(ht(e,2),Af(e))}function _f(e,t,n){if(e.tag===3)gf(e,e,n);else for(;t!==null;){if(t.tag===3){gf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(wd===null||!wd.has(r))){e=Wi(n,e),n=Ac(2),r=yo(t,n,2),r!==null&&(jc(n,r,t,e),ht(r,2),Af(r));break}}t=t.return}}function vf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;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)||(ld=!0,i.add(n),e=yf.bind(null,e,t,n),t.then(e,e))}function yf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(V&n)===n&&(dd===4||dd===3&&(V&62914560)===V&&300>Ue()-bd?rd&2?md|=n:Kd(e,0):md|=n,gd===V&&(gd=0)),Af(e)}function bf(e,t){t===0&&(t=pt()),e=ki(e,t),e!==null&&(ht(e,t),Af(e))}function xf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bf(e,n)}function Sf(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),bf(e,n)}function Cf(e,t){return ze(e,t)}var wf=null,Tf=null,Ef=!1,Df=!1,Of=!1,kf=0;function Af(e){e!==Tf&&e.next===null&&(Tf===null?wf=Tf=e:Tf=Tf.next=e),Df=!0,Ef||(Ef=!0,Lf())}function jf(e,t){if(!Of&&Df){Of=!0;do for(var n=!1,r=wf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,If(r,a))}else a=V,a=lt(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,If(r,a))}r=r.next}while(n);Of=!1}}function Mf(){Nf()}function Nf(){Df=Ef=!1;var e=0;kf!==0&&bp()&&(e=kf);for(var t=Ue(),n=null,r=wf;r!==null;){var i=r.next,a=Pf(r,t);a===0?(r.next=null,n===null?wf=i:n.next=i,i===null&&(Tf=n)):(n=r,(e!==0||a&3)&&(Df=!0)),r=i}Td!==0&&Td!==5||jf(e,!1),kf!==0&&(kf=0)}function Pf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=V,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ad===2||ad===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),bt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=Ff.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function Ff(e,t){if(Td!==0&&Td!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(mf()&&e.callbackNode!==n)return null;var r=V;return r=lt(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(H(e,r,t),Pf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?Ff.bind(null,e):null)}function If(e,t){if(mf())return null;H(e,t,!0)}function Lf(){Tp(function(){rd&6?ze(Ge,Mf):Nf()})}function Rf(){if(kf===0){var e=Ba;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),kf=e}return kf}function zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function Bf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=zf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(kf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Vf=0;Vf<gi.length;Vf++){var Hf=gi[Vf];_i(Hf.toLowerCase(),`on`+(Hf[0].toUpperCase()+Hf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Uf=`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(` `),Wf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Uf));function Gf(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){Si(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){Si(e)}i.currentTarget=null,a=c}}}}function G(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Yf(t,e,2,!1),n.add(r))}function Kf(e,t,n){var r=0;t&&(r|=4),Yf(n,e,r,t)}var qf=`_reactListening`+Math.random().toString(36).slice(2);function Jf(e){if(!e[qf]){e[qf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Wf.has(t)||Kf(t,!1,e),Kf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qf]||(t[qf]=!0,Kf(`selectionchange`,!1,t))}}function Yf(e,t,n,r){switch(Oh(t)){case 2:var i=Sh;break;case 8:i=Ch;break;default:i=wh}n=i.bind(null,t,n,e),i=void 0,!An||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 Xf(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=Pt(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}Dn(function(){var r=a,i=Sn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ar;break;case`focusin`:u=`focus`,l=Xn;break;case`focusout`:u=`blur`,l=Xn;break;case`beforeblur`:case`afterblur`:l=Xn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=cr;break;case ci:case li:case ui:l=Zn;break;case mi:l=lr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=ur;break;case`copy`:case`cut`:case`paste`:l=Qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=or;break;case`submit`:l=sr;break;case`toggle`:case`beforetoggle`:l=dr}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=On(m,p),g!=null&&d.push(Zf(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!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))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?Pt(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=Jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=or,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(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,$f):null,c!==null&&ep(s,u,c,d,!1),l!==null&&f!==null&&ep(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Tr(c)){if(Mr)_=Vr;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&gn(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Er(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Tr(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(pr)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 xr?yr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(gr&&n.locale!==`ko`&&(xr||b!==`onCompositionStart`?b===`onCompositionEnd`&&xr&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,xr=!0)),v=Qf(r,b),0<v.length&&(b=new $n(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=br(n),y!==null&&(b.data=y)))),(y=hr?Sr(e,n):Cr(e,n))&&(b=Qf(r,`onBeforeInput`),0<b.length&&(v=new $n(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Bf(s,e,r,n,i)}Gf(s,t)})}function Zf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qf(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=On(e,n),i!=null&&r.unshift(Zf(e,i,a)),i=On(e,t),i!=null&&r.push(Zf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function $f(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ep(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=On(n,a),l!=null&&o.unshift(Zf(n,l,c))):i||(l=On(n,a),l!=null&&o.push(Zf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var tp=/\r\n?/g,np=/\u0000|\uFFFD/g;function rp(e){return(typeof e==`string`?e:``+e).replace(tp,`
|
|
24
|
-
`).replace(np,``)}function ip(e,t){return t=rp(t),rp(e)===t}function ap(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(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=yn(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`&&ap(e,t,`name`,a.name,a,null),ap(e,t,`formEncType`,a.formEncType,a,null),ap(e,t,`formMethod`,a.formMethod,a,null),ap(e,t,`formTarget`,a.formTarget,a,null)):(ap(e,t,`encType`,a.encType,a,null),ap(e,t,`method`,a.method,a,null),ap(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&G(`scroll`,e);return;case`onScrollEnd`:r!=null&&G(`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=yn(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`:G(`beforetoggle`,e),G(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(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=_n.get(n)||n,Yt(e,n,r);else return}P=!0}function op(e,t,n,r,a,o){switch(n){case`style`:hn(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`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&G(`scroll`,e);return;case`onScrollEnd`:r!=null&&G(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.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[Tt]||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}P=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}P=!0}function sp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:G(`error`,e),G(`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:ap(e,t,o,s,n,null)}}a&&ap(e,t,`srcSet`,n.srcSet,n,null),r&&ap(e,t,`src`,n.src,n,null);return;case`input`:G(`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:ap(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in G(`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:ap(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in G(`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:ap(e,t,s,c,n,null)}dn(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:ap(e,t,l,r,n,null)}return;case`dialog`:G(`beforetoggle`,e),G(`toggle`,e),G(`cancel`,e),G(`close`,e);break;case`iframe`:case`object`:G(`load`,e);break;case`video`:case`audio`:for(r=0;r<Uf.length;r++)G(Uf[r],e);break;case`image`:G(`error`,e),G(`load`,e);break;case`details`:G(`toggle`,e);break;case`embed`:case`source`:case`link`:G(`error`,e),G(`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:ap(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&op(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ap(e,t,c,r,n,null))}var cp={};function lp(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)||ap(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&&(P=!0),o=m;break;case`name`:m!==f&&(P=!0),a=m;break;case`checked`:m!==f&&(P=!0),u=m;break;case`defaultChecked`:m!==f&&(P=!0),d=m;break;case`value`:m!==f&&(P=!0),s=m;break;case`defaultValue`:m!==f&&(P=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ap(e,t,p,m,r,f)}}on(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)||ap(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&&(P=!0),p=o;break;case`defaultValue`:o!==l&&(P=!0),c=o;break;case`multiple`:o!==l&&(P=!0),s=o;default:o!==l&&ap(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(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:ap(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&&(P=!0),p=a;break;case`defaultValue`:a!==o&&(P=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ap(e,t,s,a,r,o)}un(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:ap(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&&(P=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ap(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)&&ap(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:ap(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&op(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||op(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ap(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||ap(e,t,f,p,r,m)}function up(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function dp(){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&&up(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&&up(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 fp=null,pp=null;function mp(e){return e.nodeType===9?e:e.ownerDocument}function hp(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 gp(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 _p(e,t,n,r){return n=mp(n).createElement(e),n[wt]=r,n[Tt]=t,sp(n,e,t),Rt(n),n}function vp(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 yp=null;function bp(){var e=window.event;return e&&e.type===`popstate`?e!==yp&&(yp=e,!0):(yp=null,!1)}var xp=typeof setTimeout==`function`?setTimeout:void 0,Sp=typeof clearTimeout==`function`?clearTimeout:void 0,Cp=typeof Promise==`function`?Promise:void 0,wp=typeof requestAnimationFrame==`function`?requestAnimationFrame:xp,Tp=typeof queueMicrotask==`function`?queueMicrotask:Cp===void 0?xp:function(e){return Cp.resolve(null).then(e).catch(Ep)};function Ep(e){setTimeout(function(){throw e})}function Dp(e){return e===`head`}function Op(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),qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sm(e.ownerDocument.body)}n=i}while(n);qh(t)}function kp(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 Ap(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 jp(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 Mp(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 Np(e){return Mp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Pp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Mp(t,n,e)}function Fp(e){return e.documentElement.clientHeight}function Ip(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Lp(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`&&(Fp(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+=th(f),u>ih){s.length=o;break}f=new Promise(Ip.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 Rp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Rp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Rp.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},Rp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function zp(e){return{name:e,group:new Rp(`group`,e),imagePair:new Rp(`image-pair`,e),old:new Rp(`old`,e),new:new Rp(`new`,e)}}function Bp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bp.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(Gp(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=Up(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Vp,e,s,r)}this._eventListeners=a}};function Vp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Bp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Gp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Up(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Hp,e,n,i),r.splice(t,1),a!==null&&a()}};function Hp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Up(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Wp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Gp(e,t,n,r){if(e.length===0)return-1;r=Wp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Wp(a.optionsOrUseCapture)===r)return i}return-1}Bp.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,Up(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,Up(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Bp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag!==6&&(e=_(e),vm(e,t))}Bp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Kp(t[n],e);n--);};function qp(e,t){return t.push(e),!1}Bp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=mp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Jp,e,void 0,void 0))};function Jp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=_(e),t.observe(e),!1)}Bp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0);for(var n=t=0;n<Zp.length;n++){var r=Zp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Zp[t++]=r}Zp.length=t}};function Xp(e,t){return e.tag!==6&&(e=_(e),t.unobserve(e),!1)}var Zp=[],Qp=!1;function $p(e,t,n){Zp.push({fragmentInstance:e,observer:t,instance:n}),Qp||(Qp=!0,ym(function(){Qp=!1;var e=Zp;Zp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Bp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,em,e,void 0,void 0),e};function em(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}Bp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Bp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,qp,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||tm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function tm(e,t,n,r,i){var a=Pt(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 nm(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)}Bp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,qp,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),nm(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),nm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function rm(e,t){return e=_(e),im(e,t),!1}function im(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function am(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,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Zp.length;i++){var a=Zp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Zp[r++]=a)}Zp.length=r,n.observe(e)}),im(e,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.removeEventListener(i.type,i.attachedListener,Up(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?$p(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function sm(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`:sm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cm(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[jt])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=mm(e.nextSibling),e===null)break}return null}function lm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mm(e.nextSibling),e===null))return null;return e}function um(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mm(e.nextSibling),e===null))return null;return e}function dm(e){return e.data===`$?`||e.data===`$~`}function fm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pm(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 mm(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 hm=null;function gm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _m(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 vm(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 ym(e){wp(function(){wp(function(t){return e(t)})})}function bm(e,t,n){switch(t=mp(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 xm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ap(e,t,r,null,cp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function Sm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Cm=new Map,wm=new Set;function Tm(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 Em=M.d;M.d={f:Dm,r:Om,D:jm,C:Mm,L:Nm,m:Pm,X:Im,S:Fm,M:Lm};function Dm(){var e=Em.f(),t=Wd();return e||t}function Om(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Em.r(e)}var km=typeof document>`u`?null:document;function Am(e,t,n){var r=km;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wm.has(i)||(wm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),sp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function jm(e){Em.D(e),Am(`dns-prefetch`,e,null)}function Mm(e,t){Em.C(e,t),Am(`preconnect`,e,t)}function Nm(e,t,n){Em.L(e,t,n);var r=km;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=zm(e);break;case`script`:a=Um(e)}if(!(Cm.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bm(a))||t===`script`&&r.querySelector(Wm(a))))){var o=r.createElement(`link`);sp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Pm(e,t){Em.m(e,t);var n=km;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Um(e)}if(!Cm.has(a)&&(e=w({rel:`modulepreload`,href:e},t),Cm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wm(a)))return}r=n.createElement(`link`),sp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Fm(e,t,n){Em.S(e,t,n);var r=km;if(r&&e){var i=Lt(r).hoistableStyles,a=zm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bm(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cm.get(a))&&qm(e,n);var c=o=r.createElement(`link`);Rt(c),sp(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,Km(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Im(e,t){Em.X(e,t);var n=km;if(n&&e){var r=Lt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=w({src:e,async:!0},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Rt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t){Em.M(e,t);var n=km;if(n&&e){var r=Lt(n).hoistableScripts,i=Um(e),a=r.get(i);a||(a=n.querySelector(Wm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=Cm.get(i))&&Jm(e,t),a=n.createElement(`script`),Rt(a),sp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t,n,r){var a=(a=Te.current)?Tm(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=zm(n.href),t=Lt(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=zm(n.href);var o=Lt(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(Bm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Cm.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},Cm.set(e,o)),Hm(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=Um(n),t=Lt(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 zm(e){return`href="`+an(e)+`"`}function Bm(e){return`link[rel="stylesheet"][`+e+`]`}function Vm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Hm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),sp(t,`link`,n),Rt(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 Um(e){return`[src="`+an(e)+`"]`}function Wm(e){return`script[async]`+e}function Gm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Rt(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`),Rt(r),sp(r,`style`,a),Km(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zm(n.href);var o=e.querySelector(Bm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Vm(n),(a=Cm.get(a))&&qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),sp(o,`link`,r),t.state.loading|=4,Km(o,n.precedence,e),t.instance=o;case`script`:return o=Um(n.src),(a=e.querySelector(Wm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Cm.get(o))&&(r=w({},n),Jm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),sp(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,Km(r,n.precedence,e));return t.instance}function Km(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 qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Ym=null;function Xm(e,t,n){if(Ym===null){var r=new Map,i=Ym=new Map;i.set(n,r)}else i=Ym,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[jt]||a[wt]||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 Zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qm(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 $m(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function eh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function th(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function nh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=th(t),e.suspenseyImages.push(t)),e=ch.bind(e),t.decode().then(e,e))}function rh(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=zm(r.href),a=t.querySelector(Bm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Vm(r),(i=Cm.get(i))&&qm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),sp(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=sh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ih=0;function ah(e,t){return e.stylesheets&&e.count===0&&uh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ih===0&&(ih=62500*dp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ih?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function oh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)uh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function sh(){this.count--,oh(this)}function ch(){this.imgCount--,oh(this)}var lh=null;function uh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lh=new Map,t.forEach(dh,e),lh=null,sh.call(e))}function dh(e,t){if(!(t.state.loading&4)){var n=lh.get(e);if(n)var r=n.get(null);else{n=new Map,lh.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=sh.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 fh={$$typeof:k,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function ph(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 mh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ph(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function hh(e){return e?(e=Mi,e):Mi}function gh(e,t,n,r,i,a){i=hh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Bd(n,e,t),bo(n,e,t))}function _h(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vh(e,t){_h(e,t),(e=e.alternate)&&_h(e,t)}function yh(e){if(e.tag===13||e.tag===31){var t=ki(e,67108864);t!==null&&Bd(t,e,67108864),vh(e,67108864)}}function bh(e){if(e.tag===13||e.tag===31){var t=Ld();t=N(t);var n=ki(e,t);n!==null&&Bd(n,e,t),vh(e,t)}}var xh=!0;function Sh(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,wh(e,t,n,r)}finally{M.p=a,j.T=i}}function Ch(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,wh(e,t,n,r)}finally{M.p=a,j.T=i}}function wh(e,t,n,r){if(xh){var i=Th(r);if(i===null)Xf(e,t,r,Eh,n),Lh(e,r);else if(zh(i,e,t,n,r))r.stopPropagation();else if(Lh(e,r),t&4&&-1<Ih.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Af(a),!(rd&6)&&(Sd=Ue()+500,jf(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Bd(s,a,2),Wd(),vh(a,2)}if(a=Th(r),a===null&&Xf(e,t,r,Eh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Xf(e,t,r,null,n)}}function Th(e){return e=Sn(e),Dh(e)}var Eh=null;function Dh(e){if(Eh=null,e=Pt(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 Eh=e,null}function Oh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var kh=!1,Ah=null,jh=null,Mh=null,Nh=new Map,Ph=new Map,Fh=[],Ih=`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 Lh(e,t){switch(e){case`focusin`:case`focusout`:Ah=null;break;case`dragenter`:case`dragleave`:jh=null;break;case`mouseover`:case`mouseout`:Mh=null;break;case`pointerover`:case`pointerout`:Nh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ph.delete(t.pointerId)}}function Rh(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=Ft(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zh(e,t,n,r,i){switch(t){case`focusin`:return Ah=Rh(Ah,e,t,n,r,i),!0;case`dragenter`:return jh=Rh(jh,e,t,n,r,i),!0;case`mouseover`:return Mh=Rh(Mh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Nh.set(a,Rh(Nh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ph.set(a,Rh(Ph.get(a)||null,e,t,n,r,i)),!0}return!1}function Bh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){bh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){bh(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 Vh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(n),t!==null&&yh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hh(e,t,n){Vh(e)&&n.delete(t)}function Uh(){kh=!1,Ah!==null&&Vh(Ah)&&(Ah=null),jh!==null&&Vh(jh)&&(jh=null),Mh!==null&&Vh(Mh)&&(Mh=null),Nh.forEach(Hh),Ph.forEach(Hh)}function Wh(e,n){e.blockedOn===n&&(e.blockedOn=null,kh||(kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Uh)))}var Gh=null;function Kh(e){Gh!==e&&(Gh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===e&&(Gh=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(Dh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qh(e){function t(t){return Wh(t,e)}Ah!==null&&Wh(Ah,e),jh!==null&&Wh(jh,e),Mh!==null&&Wh(Mh,e),Nh.forEach(t),Ph.forEach(t);for(var n=0;n<Fh.length;n++){var r=Fh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fh.length&&(n=Fh[0],n.blockedOn===null);)Bh(n),n.blockedOn===null&&Fh.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[Tt]||null;if(typeof a==`function`)o||Kh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Dh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kh(n)}}}function Jh(){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 Yh(e){this._internalRoot=e}Xh.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;gh(n,Ld(),e,t,null,null)},Xh.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gh(e.current,2,null,e,null,null),Wd(),t[Et]=null}};function Xh(e){this._internalRoot=e}Xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fh.length&&t!==0&&t<Fh[n].priority;n++);Fh.splice(n,0,e),n===0&&Bh(e)}};var Zh=n.version;if(Zh!==`19.3.0`)throw Error(i(527,Zh,`19.3.0`));M.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 Qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Qe=$h.inject(Qh),$e=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;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=mh(e,1,!1,null,null,n,r,null,o,s,c,Jh),e[Et]=t.current,Jf(e),new Yh(t)}})),sw=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=ow()}));function cw(e){let t=(0,q.useRef)(e);return(0,q.useInsertionEffect)(()=>void(t.current=e)),(0,q.useCallback)((...e)=>t.current(...e),[])}var lw=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=lw()}))(),uw=(0,q.createContext)(void 0);function dw(){return(0,q.useContext)(uw)}var fw={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},pw={display:`contents`};function mw(){return null}var hw=`diffs-container`,gw=/(?=^From [a-f0-9]+ .+$)/m,_w=/(?=^diff --git)/gm,vw=/(?<=\n)/,yw=/^(---|\+\+\+)\s+([^\t\r\n]+)/,bw=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,xw=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Sw=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Cw=`header-prefix`,ww=`header-filename-suffix`,Tw=`header-metadata`,Ew=`header-custom`,Dw={dark:`pierre-dark`,light:`pierre-light`},Ow=`data-theme-css`,kw=`data-unsafe-css`,Aw=`data-diffs-scrollbar-measure`,jw=`--diffs-scrollbar-gutter-measured`,Mw=1e5,Nw={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Nw});var Pw=Object.freeze({fromStart:0,fromEnd:0}),Fw={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Iw={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Lw(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Rw({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function zw(e,t){return e-(t===0?0:1)}function Bw(e,t){return zw(e,t)+t}function Vw(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Hw(n,e.startContentIndex)}}function Hw(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 Uw({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=Lw}){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:Ew,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=Ww(t,e);return(0,J.jsx)(`div`,{slot:n,style:pw,children:c(t,d)},n)}),s!=null&&(0,J.jsx)(`div`,{slot:`gutter-utility-slot`,style:fw,children:s(u)})]})}function Ww(e,t){let n=Vw(e,t);return n==null?void 0:Rw({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function Gw({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c,getAnnotationSlotName:l=Lw}){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:Ew,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:fw,children:s(c)})]})}var Kw=new Map,qw=new Map,Jw=new Map,Yw=new Set;function Xw(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Yw.has(t))return!1;return!0}function Zw(e=Dw){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Qw=new Set;function $w(e){let t=[],n=new Set;for(let r of eT(e.themes)){let e=rT(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 $w({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 $w({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function eT(e){return tT(e)?[e]:e}function tT(e){return rT(e)||nT(e)}function nT(e){return typeof e.name==`string`&&typeof e.load==`function`}function rT(e){return typeof e.getThemes==`function`}function iT(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var aT=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},oT=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},sT=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function cT(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new aT(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 oT(i));let c=r,l=s().then(e=>{let a=iT(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 sT(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 lT=cT();function uT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=lT.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,lT.getResolvedTheme(n)??lT.seedResolvedTheme(n,e);Qw.has(n)||(Qw.add(n),t.loadThemeSync(e))}}function dT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Yw.has(n.name))continue;let e=Kw.get(n.name);e??(e=n,Kw.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.`)}Yw.add(e.name)}}function fT(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var pT=Object.defineProperty,mT=Object.getOwnPropertyDescriptor,hT=Object.getOwnPropertyNames,gT=Object.prototype.hasOwnProperty,_T=(e,t)=>{let n={};for(var r in e)pT(n,r,{get:e[r],enumerable:!0});return t||pT(n,Symbol.toStringTag,{value:`Module`}),n},vT=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=hT(t),a=0,o=i.length,s;a<o;a++)s=i[a],!gT.call(e,s)&&s!==n&&pT(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=mT(t,s))||r.enumerable});return e},yT=(e,t,n)=>(vT(e,t,`default`),n&&vT(n,t,`default`)),bT=`modulepreload`,xT=function(e){return`/`+e},ST={},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=xT(t,n),t=s(t),t in ST)return;ST[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`:bT,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)})},CT=[{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-KvMUz706.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Y(()=>import(`./angular-ts-NlM5GifH.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-BXWiWEVo.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-Bhx06L1l.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-BlUBx0PC.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-C0eQNQNW.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-CKFpmDLJ.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-DwsyCr9b.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-C4hkhraW.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-Bs3Ktq9r.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>Y(()=>import(`./crystal-DMpaaMhJ.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-DtPqiQGm.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-ZfatZ85-.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Y(()=>import(`./elixir-F3RMzoCL.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Y(()=>import(`./elm-BGJ0PgxU.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-C7WsHgWS.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-hktnMhXh.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-DajRjYwP.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Y(()=>import(`./glimmer-ts-dnv4My2j.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Y(()=>import(`./glsl-BVmpNKLS.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-DCDJyx6a.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-bEVwbA5b.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Y(()=>import(`./haml-CdgCZHNu.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Y(()=>import(`./handlebars-BgotjozU.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-DSG7GFxE.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Y(()=>import(`./html-derivative-CYDMDI-0.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Y(()=>import(`./http-XatvGKBy.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>Y(()=>import(`./hurl-BCQmW8qD.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-Dm2W5EfJ.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Y(()=>import(`./javascript-C2_AZCD8.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Y(()=>import(`./jinja-CwzMoVwz.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Y(()=>import(`./jison-DsBwpiNe.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>Y(()=>import(`./json-jdIt9h50.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-Btu-zt-Q.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Y(()=>import(`./julia-CZUYdDvB.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>Y(()=>import(`./just-D532zIY8.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-D2J5-TH0.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-WY7D0fMm.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-Baa_WEf0.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-DsygGl2f.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-BcGy04Fp.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-B86ZxrAw.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>Y(()=>import(`./nim-BM686CfU.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-RvFkgp46.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-C6U9yGM0.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Y(()=>import(`./php-uAYB-Mtd.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-6ncXSInX.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-BE1B7Quf.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-BZJcu9wg.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-BKwfOyyl.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-Dih_I1qs.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-DHEdAr-V.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-BbWx5B9V.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-Df5EO-Nu.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-XJX16h32.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-Dxd4inRL.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Y(()=>import(`./shellsession-Df2uEcSZ.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-B9Ytzufd.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-Eeo1bdO9.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-DJp7s67I.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-CDYi7ARY.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Y(()=>import(`./svelte-BjXPUNXf.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-CfTV__LG.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-yGzDqfiz.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-H73Fp8-B.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-D0NsN8tR.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Y(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Y(()=>import(`./twig-BxcdexCK.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-CTohDgGQ.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-BHhe5E0i.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-xxrWY3vq.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Y(()=>import(`./vue-html-DZJ0eUb2.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Y(()=>import(`./vue-vine-b741IG4q.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-CVHrHsRm.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Y(()=>import(`./xsl-Bo14RTqx.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Y(()=>import(`./yaml-769gRZTS.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`),[]))}],wT=Object.fromEntries(CT.map(e=>[e.id,e.import])),TT=Object.fromEntries(CT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ET={...wT,...TT},DT=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])),OT=s({createOnigurumaEngine:()=>nE,getDefaultWasmLoader:()=>tE,loadWasm:()=>YT,setDefaultWasmLoader:()=>eE}),kT=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function AT(){return 2147483648}function jT(){return typeof performance<`u`?performance.now():Date.now()}var MT=(e,t)=>e+(t-e%t)%t;async function NT(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=AT();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,MT(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:jT,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 PT=Object.defineProperty,FT=(e,t,n)=>t in e?PT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IT=(e,t,n)=>FT(e,typeof t==`symbol`?t:t+``,n),LT=null;function RT(e){throw new kT(e.UTF8ToString(e.getLastOnigError()))}var zT=class e{constructor(t){IT(this,`utf16Length`),IT(this,`utf8Length`),IT(this,`utf16Value`),IT(this,`utf8Value`),IT(this,`utf16OffsetToUtf8`),IT(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}},BT=class e{constructor(t){if(IT(this,`id`,++e.LAST_ID),IT(this,`_onigBinding`),IT(this,`content`),IT(this,`utf16Length`),IT(this,`utf8Length`),IT(this,`utf16OffsetToUtf8`),IT(this,`utf8OffsetToUtf16`),IT(this,`ptr`),!LT)throw new kT(`Must invoke loadWasm first.`);this._onigBinding=LT,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||=LT.omalloc(1e4),e._sharedPtrInUse=!0,LT.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(LT)}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)}};IT(BT,`LAST_ID`,0),IT(BT,`_sharedPtr`,0),IT(BT,`_sharedPtrInUse`,!1);var VT=BT,HT=class{constructor(e){if(IT(this,`_onigBinding`),IT(this,`_ptr`),!LT)throw new kT(`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(LT),n[r]=i.utf8Length}let r=LT.omalloc(4*e.length);LT.HEAPU32.set(t,r/4);let i=LT.omalloc(4*e.length);LT.HEAPU32.set(n,i/4);let a=LT.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)LT.ofree(t[n]);LT.ofree(i),LT.ofree(r),a===0&&RT(LT),this._onigBinding=LT,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 VT(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 UT(e){return typeof e.instantiator==`function`}function WT(e){return typeof e.default==`function`}function GT(e){return e.data!==void 0}function KT(e){return typeof Response<`u`&&e instanceof Response}function qT(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 JT;function YT(e){if(JT)return JT;async function t(){LT=await NT(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),UT(n)?n=await n.instantiator(t):WT(n)?n=await n.default(t):(GT(n)&&(n=n.data),KT(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await ZT(n)(t):await QT(n)(t):qT(n)||n instanceof WebAssembly.Module?n=await XT(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await XT(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return JT=t(),JT}function XT(e){return t=>WebAssembly.instantiate(e,t)}function ZT(e){return t=>WebAssembly.instantiateStreaming(e,t)}function QT(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var $T;function eE(e){$T=e}function tE(){return $T}async function nE(e){return e&&await YT(e),{createScanner(e){return new HT(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new VT(e)}}}var rE=_T({});yT(rE,OT);var iE=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function aE(e){return oE(e)}function oE(e){return Array.isArray(e)?sE(e):e instanceof RegExp?e:typeof e==`object`?cE(e):e}function sE(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=oE(e[n]);return t}function cE(e){let t={};for(let n in e)t[n]=oE(e[n]);return t}function lE(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function uE(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?uE(e.substring(0,e.length-1)):e.substr(~t+1)}var dE=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fE=class{static hasCaptures(e){return e!==null&&(dE.lastIndex=0,dE.test(e))}static replaceCaptures(e,t,n){return e.replace(dE,(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 pE(e,t){return e<t?-1:+(e>t)}function mE(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=pE(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function hE(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 gE(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var _E=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}},vE=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(CE(e),t)}static createFromParsedTheme(e,t){return EE(e,t)}_cachedMatchRoot=new _E(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=>bE(e.parent,t.parentScopes));return n?new SE(n.fontStyle,n.foreground,n.background):null}},yE=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 bE(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&&!xE(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function xE(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var SE=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function CE(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`&&hE(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&hE(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 wE(l,u,e,o,s,c)}}return n}var wE=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}},TE=(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))(TE||{});function EE(e,t){e.sort((e,t)=>{let n=pE(e.scope,t.scope);return n!==0||(n=mE(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 DE(t),o=new SE(n,a.getId(r),a.getId(i)),s=new AE(new kE(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 vE(a,o,s)}var DE=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)}},OE=Object.freeze([]),kE=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||OE,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)}},AE=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(),kE.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(mE(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 kE(e,t,n,r,i))}},jE=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=NE(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 ME(e){return e}function NE(e){return e}function PE(e,t){let n=[],r=IE(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(FE(i)){let e=[];do e.push(i),i=r.next();while(FE(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 FE(e){return!!e&&!!e.match(/[\w\.:]+/)}function IE(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 LE(e){typeof e.dispose==`function`&&e.dispose()}var RE=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}`}},BE=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))}},VE=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new RE(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new BE;for(let n of e)HE(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof RE){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 HE(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 RE?WE({baseGrammar:a,selfGrammar:i},r):UE(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 RE(e))}function UE(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];GE([r],t,n)}}function WE(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&GE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&GE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function GE(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?lE({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&GE(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=ZE(i);switch(a.kind){case 0:WE({...t,selfGrammar:t.baseGrammar},n);break;case 1:WE(t,n);break;case 2:UE(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?UE(a.ruleName,i,n):WE(i,n)}else a.kind===4?n.add(new zE(a.scopeName,a.ruleName)):n.add(new RE(a.scopeName))}}}var KE=class{kind=0},qE=class{kind=1},JE=class{constructor(e){this.ruleName=e}kind=2},YE=class{constructor(e){this.scopeName=e}kind=3},XE=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ZE(e){if(e===`$base`)return new KE;if(e===`$self`)return new qE;let t=e.indexOf(`#`);return t===-1?new YE(e):t===0?new JE(e.substring(1)):new XE(e.substring(0,t),e.substring(t+1))}var QE=/\\(\d+)/,$E=/\\(\d+)/g,eD=-1,tD=-2;function nD(e){return e}function rD(e){return e}var iD=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=fE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${uE(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:fE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:fE.replaceCaptures(this._contentName,e,t)}},aD=class extends iD{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!`)}},oD=class extends iD{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new dD(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 fD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},sD=class extends iD{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 fD,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},cD=class extends iD{_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 dD(i,this.id),this.beginCaptures=a,this._end=new dD(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 fD;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}},lD=class extends iD{_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 dD(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new dD(o,tD),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 fD;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 fD,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},uD=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new aD(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new oD(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=lE({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new sD(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new lD(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 cD(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=ZE(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 sD||e instanceof cD||e instanceof lD)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},dD=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`&&QE.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 $E.lastIndex=0,this.source.replace($E,(e,t)=>gE(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}},fD=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 pD(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 pD(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},pD=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}},mD=class{constructor(e,t){this.languageId=e,this.tokenType=t}},hD=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new mD(e,8),this._embeddedLanguagesMatcher=new gD(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 mD(0,0);_getBasicScopeAttributes=new _E(e=>new mD(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/},gD=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])=>gE(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 _D=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function vD(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=yD(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 _D(i,!0);f()}return new _D(i,!1);function f(){let o=bD(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===eD){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),TD(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 cD){let r=o;TD(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 lD){let r=o;TD(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(TD(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 yD(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 lD&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=wD(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==tD){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),TD(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 bD(e,t,n,r,i,a){let o=xD(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=SD(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 xD(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=CD(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 SD(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}=CD(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 CD(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function wD(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function TD(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));vD(e,p,n&&d.start===0,d.start,f,i,!1,0),LE(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 ED(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ED=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function DD(e,t,n,r,i,a,o,s){return new jD(e,t,n,r,i,a,o,s)}function OD(e,t,n,r,i){let a=PE(t,kD),o=uD.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 kD(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(AD(t[r],e))return n=r+1,!0;return!1})}function AD(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 jD=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new hD(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=MD(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=PE(e,kD);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)OD(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&&OD(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(nD(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[rD(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]=MD(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=uD.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===PD.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=jE.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ND.createRootAndLookUpScopeName(a,r,this):ND.createRoot(`unknown`,r),t=new PD(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 ID(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=vD(this,a,i,0,t,s,!0,r);return LE(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function MD(e,t){return e=aE(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 ND=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=yE.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new yE(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new yE(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),jE.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}},PD=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)?ND.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:rD(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=ND.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,nD(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ND.fromExtension(r,n.contentNameScopesList))}},FD=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):PE(e,kD).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>PE(e,kD).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}},ID=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=jE.set(n,0,ME(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=jE.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}},LD=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,DD(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},RD=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new LD(vE.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(vE.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 FD(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new VE(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=PD.NULL;function BD(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 VD(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function HD(e){return Array.isArray(e)?e:[e]}async function UD(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function WD(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function GD(e){return e===`ansi`||WD(e)}function KD(e){return e===`none`}function qD(e){return KD(e)}var JD=/(\r?\n)/g;function YD(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(JD),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 XD={light:`#333333`,dark:`#bbbbbb`},ZD={light:`#fffffe`,dark:`#1e1e1e`},QD=`__shiki_resolved`;function $D(e){if(e?.[QD])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`?XD.light:XD.dark,n||=t.type===`light`?ZD.light:ZD.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,QD,{enumerable:!1,writable:!1,value:!0}),t}async function eO(e){return[...new Set((await Promise.all(e.filter(e=>!GD(e)).map(async e=>await UD(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function tO(e){return(await Promise.all(e.map(async e=>qD(e)?null:$D(await UD(e))))).filter(e=>!!e)}function nO(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 iE(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var rO=class extends RD{_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=$D(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=vE.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=nO(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 iE(`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))}},iO=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}},aO=0;function oO(e){aO+=1,e.warnings!==!1&&aO>=10&&aO%10==0&&console.warn(`[Shiki] ${aO} 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 iE("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map($D),i=new rO(new iO(e.engine,n),r,n,e.langAlias),a;function o(t){return nO(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new iE(`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 iE(`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 eO(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await tO(e))}function g(){if(t)throw new iE(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--aO)}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 sO(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([tO(e.themes||[]),eO(e.langs||[]),e.engine]);return oO({...e,themes:t,langs:n,engine:r})}var cO=new WeakMap;function lO(e,t){cO.set(e,t)}function uO(e){return cO.get(e)}var dO=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(HD(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 fO(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fO(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 pO(e,t){if(!(e instanceof dO))throw new iE(`Invalid grammar state`);return e.getInternalStack(t)}var mO=/,/,hO=/ /;function gO(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(WD(e.resolveLangAlias(n.lang||`text`))||KD(r))return YD(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 iE(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new iE(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return vO(t,o,i,a,n)}function _O(...e){if(e.length===2)return uO(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(WD(i)||KD(a))throw new iE(`Plain language does not have grammar state`);if(i===`ansi`)throw new iE(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new dO(yO(n,c,o,s,r).stateStack,c.name,o.name)}function vO(e,t,n,r,i){let a=yO(e,t,n,r,i),o=new dO(a.stateStack,t.name,n.name);return lO(a.tokens,o),a.tokens}function yO(e,t,n,r,i){let a=BD(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=YD(e),u=i.grammarState?pO(i.grammarState,n.name)??zD:i.grammarContextCode==null?zD:yO(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=VD(r[jE.getForeground(s)],a),u=jE.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=jE.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(mO).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(hO))})}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`?bO(t.scopes):xO(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function bO(e){return e.map(e=>({scopeName:e}))}function xO(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:wO(e,i,t.slice(0,r))}}return n}function SO(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function CO(e,t,n){if(!SO(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)SO(e[r],n[i])&&--r,--i;return r===-1}function wO(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(CO(e,t,n)){r.push(a);break}return r}function TO(e,t,n,r=gO){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:uO(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=EO(...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 dO(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&lO(s,c),s}function EO(...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 DO=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],OO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};OO.prototype.normal={},OO.prototype.property={},OO.prototype.space=void 0;function kO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new OO(n,r,t)}function AO(e){return e.toLowerCase()}var jO=class{constructor(e,t){this.attribute=t,this.property=e}};jO.prototype.attribute=``,jO.prototype.booleanish=!1,jO.prototype.boolean=!1,jO.prototype.commaOrSpaceSeparated=!1,jO.prototype.commaSeparated=!1,jO.prototype.defined=!1,jO.prototype.mustUseProperty=!1,jO.prototype.number=!1,jO.prototype.overloadedBoolean=!1,jO.prototype.property=``,jO.prototype.spaceSeparated=!1,jO.prototype.space=void 0;var MO=s({boolean:()=>X,booleanish:()=>PO,commaOrSpaceSeparated:()=>RO,commaSeparated:()=>LO,number:()=>Z,overloadedBoolean:()=>FO,spaceSeparated:()=>IO}),NO=0,X=zO(),PO=zO(),FO=zO(),Z=zO(),IO=zO(),LO=zO(),RO=zO();function zO(){return 2**++NO}var BO=Object.keys(MO),VO=class extends jO{constructor(e,t,n,r){let i=-1;if(super(e,t),HO(this,`space`,r),typeof n==`number`)for(;++i<BO.length;){let e=BO[i];HO(this,BO[i],(n&MO[e])===MO[e])}}};VO.prototype.defined=!0;function HO(e,t,n){n&&(e[t]=n)}function UO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new VO(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[AO(r)]=r,n[AO(a.attribute)]=r}return new OO(t,n,e.space)}var WO=UO({properties:{ariaActiveDescendant:null,ariaAtomic:PO,ariaAutoComplete:null,ariaBusy:PO,ariaChecked:PO,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:IO,ariaCurrent:null,ariaDescribedBy:IO,ariaDetails:null,ariaDisabled:PO,ariaDropEffect:IO,ariaErrorMessage:null,ariaExpanded:PO,ariaFlowTo:IO,ariaGrabbed:PO,ariaHasPopup:null,ariaHidden:PO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:IO,ariaLevel:Z,ariaLive:null,ariaModal:PO,ariaMultiLine:PO,ariaMultiSelectable:PO,ariaOrientation:null,ariaOwns:IO,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:PO,ariaReadOnly:PO,ariaRelevant:null,ariaRequired:PO,ariaRoleDescription:IO,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:PO,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 GO(e,t){return t in e?e[t]:t}function KO(e,t){return GO(e,t.toLowerCase())}var qO=UO({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:LO,acceptCharset:IO,accessKey:IO,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:IO,autoFocus:X,autoPlay:X,blocking:IO,capture:null,charSet:null,checked:X,cite:null,className:IO,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:PO,controls:X,controlsList:IO,coords:Z|LO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:FO,draggable:PO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:IO,height:Z,hidden:FO,high:Z,href:null,hrefLang:null,htmlFor:IO,httpEquiv:IO,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:IO,itemRef:IO,itemScope:X,itemType:IO,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:IO,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:IO,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:IO,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:PO,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:PO,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:IO,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:PO,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:LO,part:IO,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:KO}),JO=UO({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:RO,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:IO,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:LO,g2:LO,glyphName:LO,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:RO,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:IO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:RO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:RO,rev:RO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:RO,requiredFeatures:RO,requiredFonts:RO,requiredFormats:RO,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:RO,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:RO,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:RO,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:GO}),YO=UO({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()}}),XO=UO({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:KO}),ZO=UO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),QO=/[A-Z]/g,$O=/-[a-z]/g,ek=/^data[-\w.:]+$/i;function tk(e,t){let n=AO(t),r=t,i=jO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ek.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace($O,rk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!$O.test(e)){let n=e.replace(QO,nk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=VO}return new i(r,t)}function nk(e){return`-`+e.toLowerCase()}function rk(e){return e.charAt(1).toUpperCase()}var ik=kO([WO,qO,YO,XO,ZO],`html`),ak=kO([WO,JO,YO,XO,ZO],`svg`),ok={}.hasOwnProperty;function sk(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&ok.call(t,e)){let n=String(t[e]);i=ok.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 ck=/["&'<>`]/g,lk=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,uk=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,dk=/[|\\{}()[\]^$+*?.]/g,fk=new WeakMap;function pk(e,t){return e=e.replace(t.subset?mk(t.subset):ck,r),t.subset||t.escapeOnly?e:e.replace(lk,n).replace(uk,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 mk(e){let t=fk.get(e);return t||(t=hk(e),fk.set(e,t)),t}function hk(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(dk,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var gk=/[\dA-Fa-f]/;function _k(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!gk.test(String.fromCharCode(t))?r:r+`;`}var vk=/\d/;function yk(e,t,n){let r=`&#`+String(e);return n&&t&&!vk.test(String.fromCharCode(t))?r:r+`;`}var bk=`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(`.`),xk={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:`€`},Sk=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ck={}.hasOwnProperty,wk={},Tk;for(Tk in xk)Ck.call(xk,Tk)&&(wk[xk[Tk]]=Tk);var Ek=/[^\dA-Za-z]/;function Dk(e,t,n,r){let i=String.fromCharCode(e);if(Ck.call(wk,i)){let e=wk[i],a=`&`+e;return n&&bk.includes(e)&&!Sk.includes(e)&&(!r||t&&t!==61&&Ek.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ok(e,t,n){let r=_k(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Dk(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=yk(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function kk(e,t){return pk(e,Object.assign({format:Ok},t))}var Ak=/^>|^->|<!--|-->|--!>|<!-$/g,jk=[`>`],Mk=[`<`,`>`];function Nk(e,t,n,r){return r.settings.bogusComments?`<?`+kk(e.value,Object.assign({},r.settings.characterReferences,{subset:jk}))+`>`:`<!--`+e.value.replace(Ak,i)+`-->`;function i(e){return kk(e,Object.assign({},r.settings.characterReferences,{subset:Mk}))}}function Pk(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Fk(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 Ik(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Lk(e){return e.join(` `).trim()}var Rk=/[ \t\n\f\r]/g;function zk(e){return typeof e==`object`?e.type===`text`&&Bk(e.value):Bk(e)}function Bk(e){return e.replace(Rk,``)===``}var Vk=Wk(1),Hk=Wk(-1),Uk=[];function Wk(e){return t;function t(t,n,r){let i=t?t.children:Uk,a=(n||0)+e,o=i[a];if(!r)for(;o&&zk(o);)a+=e,o=i[a];return o}}var Gk={}.hasOwnProperty;function Kk(e){return t;function t(t,n,r){return Gk.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var qk=Kk({body:Xk,caption:Jk,colgroup:Jk,dd:eA,dt:$k,head:Jk,html:Yk,li:Qk,optgroup:nA,option:rA,p:Zk,rp:tA,rt:tA,tbody:aA,td:cA,tfoot:oA,th:cA,thead:iA,tr:sA});function Jk(e,t,n){let r=Vk(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&zk(r.value.charAt(0)))}function Yk(e,t,n){let r=Vk(n,t);return!r||r.type!==`comment`}function Xk(e,t,n){let r=Vk(n,t);return!r||r.type!==`comment`}function Zk(e,t,n){let r=Vk(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 Qk(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&r.tagName===`li`}function $k(e,t,n){let r=Vk(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function eA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function tA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function nA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function rA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function iA(e,t,n){let r=Vk(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function aA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function oA(e,t,n){return!Vk(n,t)}function sA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function cA(e,t,n){let r=Vk(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var lA=Kk({body:fA,colgroup:pA,head:dA,html:uA,tbody:mA});function uA(e){let t=Vk(e,-1);return!t||t.type!==`comment`}function dA(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 fA(e){let t=Vk(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 pA(e,t,n){let r=Hk(n,t),i=Vk(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&qk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function mA(e,t,n){let r=Hk(n,t),i=Vk(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&qk(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var hA={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 gA(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=ak);let l=_A(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!lA(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||!qk(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function _A(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=vA(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 vA(e,t,n){let r=tk(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=kk(r.attribute,Object.assign({},e.settings.characterReferences,{subset:hA.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ik:Lk)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=kk(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:hA.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Fk(n,o)>Fk(n,e.alternative)&&(o=e.alternative),s=o+kk(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?hA.single:hA.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var yA=[`<`,`&`];function bA(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:kk(e.value,Object.assign({},r.settings.characterReferences,{subset:yA}))}function xA(e,t,n,r){return r.settings.allowDangerousHtml?e.value:bA(e,t,n,r)}function SA(e,t,n,r){return r.all(e)}var CA=sk(`type`,{invalid:wA,unknown:TA,handlers:{comment:Nk,doctype:Pk,element:gA,raw:xA,root:SA,text:bA}});function wA(e){throw Error("Expected node, not `"+e+"`")}function TA(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var EA={},DA={},OA=[];function kA(e,t){let n=t||EA,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:AA,all:jA,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||DO,characterReferences:n.characterReferences||DA,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ak:ik,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function AA(e,t,n){return CA(e,t,n,this)}function jA(e){let t=[],n=e&&e.children||OA,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var MA=/\s+/g;function NA(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(MA)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(MA);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var PA=/:?lang=["']([^"']+)["']/g,FA=/(?:```|~~~)([\w-]+)/g,IA=/\\begin\{([\w-]+)\}/g,LA=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,RA=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function zA(e){let t=YD(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 BA(e,t,n){let r=new Set;for(let t of e.matchAll(PA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(FA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(IA)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(LA)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(RA.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var VA=[`color`,`background-color`];function HA(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 UA(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 WA(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=UA(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 HA(e,a)})):e}function GA(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>KA(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&&VA.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 iE('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 KA(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&TE.Italic&&(t[`font-style`]=`italic`),e.fontStyle&TE.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&TE.Underline&&n.push(`underline`),e.fontStyle&TE.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function qA(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function JA(){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 iE(`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 iE(`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 iE(`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)}));YA(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 WA(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 iE(`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+=XA(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new iE(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new iE(`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&&NA(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 YA(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new iE(`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 iE(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function XA(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(XA).join(``):``}var ZA=[JA()];function QA(e){let t=$A(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ZA]}function $A(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 ej=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],tj={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function nj(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 rj(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 ij(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)tj[r]&&t.push({type:`setDecoration`,value:tj[r]});else if(r<=29){let e=tj[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:ej[r-30]}});else if(r===38){let n=rj(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:ej[r-40]}});else if(r===48){let n=rj(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:ej[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:ej[r-100+8]}})}}return t}function aj(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=nj(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=ij(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 oj={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 sj(e=oj){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<ej.length;e++)r.push(t(ej[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 cj=/#([0-9a-f]{3,8})/i,lj=/var\((--[\w-]+-ansi-[\w-]+)\)/,uj={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 dj(e,t,n){let r=BD(e,n),i=YD(t),a=sj(Object.fromEntries(ej.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||uj[t]]}))),o=aj();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=VD(i,r),o=VD(o,r),n.decorations.has(`dim`)&&(i=fj(i));let s=TE.None;return n.decorations.has(`bold`)&&(s|=TE.Bold),n.decorations.has(`italic`)&&(s|=TE.Italic),n.decorations.has(`underline`)&&(s|=TE.Underline),n.decorations.has(`strikethrough`)&&(s|=TE.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function fj(e){let t=e.match(cj);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(lj);return n?`var(${n[1]}-dim)`:e}function pj(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!WD(r)&&!KD(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return dj(r,t,n)}return gO(e,t,n)}function mj(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 iE("`themes` option must not be empty");let p=TO(e,t,n,pj);if(c=uO(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new iE(`\`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=>GA(e,h,u,l,d))),c&&lO(a,c);let g=f.map(e=>BD(e.theme,n));i=hj(f,m,g,u,l,`fg`,d),r=hj(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=BD(n.theme,n);a=pj(e,t,n);let l=e.getTheme(n.theme);r=VD(l.bg,s),i=VD(l.fg,s),o=l.name,c=uO(a)}else throw new iE("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function hj(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=VD(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 iE('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${VD(t[r][a],n[r])||`inherit`}, ${VD(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var gj=/^\s+$/,_j=/^(\s*)(.*?)(\s*)$/;function vj(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>vj(e,t,n),codeToTokens:(t,n)=>mj(e,t,n)}){let i=t;for(let e of QA(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=mj(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=bj(a):d===`never`&&(a=xj(a)),f&&(a=Sj(a));let p={...r,get source(){return i}};for(let e of QA(n))a=e.tokens?.call(p,a)||a;return yj(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function yj(e,t,n,r=uO(e)){let i=QA(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:NA,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=qA(a.htmlStyle||KA(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&&lO(m,r),m}function bj(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&TE.Underline||i.fontStyle&TE.Strikethrough));o&&gj.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 xj(e){return e.map(e=>e.flatMap(e=>{if(gj.test(e.content))return e;let t=e.content.match(_j);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 Sj(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=qA(e.htmlStyle||KA(e)),i=qA(n.htmlStyle||KA(n)),a=e.fontStyle&&(e.fontStyle&TE.Underline||e.fontStyle&TE.Strikethrough),o=n.fontStyle&&(n.fontStyle&TE.Underline||n.fontStyle&TE.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Cj=kA;function wj(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>vj(e,t,n),codeToTokens:(t,n)=>mj(e,t,n)},i=Cj(vj(e,t,n,r));for(let e of QA(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Tj(e){let t=await sO(e);return{getLastGrammarState:(...e)=>_O(t,...e),codeToTokensBase:(e,n)=>pj(t,e,n),codeToTokensWithThemes:(e,n)=>TO(t,e,n),codeToTokens:(e,n)=>mj(t,e,n),codeToHast:(e,n)=>vj(t,e,n),codeToHtml:(e,n)=>wj(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Ej(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,GD(n))return[];let r=t[n];if(!r)throw new iE(`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(qD(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new iE(`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 Tj({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 Dj(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 Oj(e,t){let n=Dj(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 kj=Ej({langs:ET,themes:DT,engine:()=>(0,rE.createOnigurumaEngine)(Y(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:Aj,codeToHast:jj,codeToTokens:Mj,codeToTokensBase:Nj,codeToTokensWithThemes:Pj,getSingletonHighlighter:Fj,getLastGrammarState:Ij}=Oj(kj,{guessEmbeddedLanguages:BA}),Lj=4294967295,Rj=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:Lj,end:Lj,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 Bj(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Vj=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Hj=String.raw;function Uj(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Wj=Hj`\[\^?`,Gj=`c.? | C(?:-.?)?|${Hj`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Hj`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Hj`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Hj`o\{[^\}]*\}?`}|${Hj`\d{1,3}`}`,Kj=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,qj=new RegExp(Hj`
|
|
36
|
-
\\ (?:
|
|
37
|
-
${Gj}
|
|
38
|
-
| [gk]<[^>]*>?
|
|
39
|
-
| [gk]'[^']*'?
|
|
40
|
-
| .
|
|
41
|
-
)
|
|
42
|
-
| \( (?:
|
|
43
|
-
\? (?:
|
|
44
|
-
[:=!>({]
|
|
45
|
-
| <[=!]
|
|
46
|
-
| <[^>]*>
|
|
47
|
-
| '[^']*'
|
|
48
|
-
| ~\|?
|
|
49
|
-
| #(?:[^)\\]|\\.?)*
|
|
50
|
-
| [^:)]*[:)]
|
|
51
|
-
)?
|
|
52
|
-
| \*[^\)]*\)?
|
|
53
|
-
)?
|
|
54
|
-
| (?:${Kj.source})+
|
|
55
|
-
| ${Wj}
|
|
56
|
-
| .
|
|
57
|
-
`.replace(/\s+/g,``),`gsu`),Jj=new RegExp(Hj`
|
|
58
|
-
\\ (?:
|
|
59
|
-
${Gj}
|
|
60
|
-
| .
|
|
61
|
-
)
|
|
62
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
63
|
-
| ${Wj}
|
|
64
|
-
| &&
|
|
65
|
-
| .
|
|
66
|
-
`.replace(/\s+/g,``),`gsu`);function Yj(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=TM(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(qj.lastIndex=0;s=qj.exec(e);){let t=Xj(a,e,s[0],qj.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(qj.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`?DM(e,u):e).flat(),flags:r}}function Xj(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Zj(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:tM(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:hM(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:nM(n)}}if(a===`K`)return{token:lM(`keep`,n)};if(a===`N`||a===`R`)return{token:cM(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:cM(`any`,n)};if(a===`X`)return{token:cM(`text_segment`,n)};let e=$j(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:bM(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:yM(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:fM(`group`,n)};if(n===`(?>`)return{token:fM(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:fM(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:fM(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:fM(`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:dM(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:cM(`dot`,n)}:n===`^`||n===`$`?{token:tM(e.singleline?{"^":Hj`\A`,$:Hj`\Z`}[n]:n,n)}:n===`|`?{token:eM(n)}:Kj.test(n)?{tokens:OM(n)}:{token:rM(zj(n),n)}}function Zj(e,t,n){let r=[sM(t[1]===`^`,t)],i=1,a;for(Jj.lastIndex=n;a=Jj.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(sM(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(rM(93,e));else if(i--,r.push(iM(e)),!i)break}else{let t=Qj(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Jj.lastIndex||e.length}}function Qj(e){if(e[0]===`\\`)return $j(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Vj.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return cM(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?aM(e):e===`&&`?oM(e):rM(zj(e),e)}function $j(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return vM(e);if(`dDhHsSwW`.includes(n))return SM(e);if(e.startsWith(Hj`\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 CM(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 rM(zj(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return rM(EM(e),e);if(_M.has(n))return rM(_M.get(n),e);if(/\d/.test(n))return uM(t,e);if(e===`\\`)throw Error(Hj`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return rM(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function eM(e){return{type:`Alternator`,raw:e}}function tM(e,t){return{type:`Assertion`,kind:e,raw:t}}function nM(e){return{type:`Backreference`,raw:e}}function rM(e,t){return{type:`Character`,value:e,raw:t}}function iM(e){return{type:`CharacterClassClose`,raw:e}}function aM(e){return{type:`CharacterClassHyphen`,raw:e}}function oM(e){return{type:`CharacterClassIntersector`,raw:e}}function sM(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function cM(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function lM(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Uj(n.flags),raw:t}}function uM(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function dM(e){return{type:`GroupClose`,raw:e}}function fM(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function pM(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function mM(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function hM(e){return{type:`Subroutine`,raw:e}}var gM=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),_M=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function vM(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return rM(zj(t.toUpperCase())-64,e)}function yM(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=wM(n),o=wM(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),lM(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,fM(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function bM(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=gM.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 pM(l,r??null,i?.split(`,`)??null,e)}function xM(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 mM(t,n,r,e)}function SM(e){let t=e[1].toLowerCase();return cM({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function CM(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return cM(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function wM(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 TM(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 EM(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 DM(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[nM(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(Hj`Octal encoded byte above 177 unsupported "${n}"`)}else r=zj(t);a.push(rM(r,(e===0?`\\`:``)+t))}return a}function OM(e){let t=[],n=new RegExp(Kj,`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(xM(e.slice(0,-1)));continue}}}t.push(xM(e))}return t}function kM(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 AM(e){return jM.has(e.type)}var jM=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function MM(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Yj(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 HM();case`Assertion`:return NM(n);case`Backreference`:return PM(n,a);case`Character`:return KM(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return FM(n,a,t);case`CharacterClassOpen`:return IM(n,a,t);case`CharacterSet`:return LM(n,a);case`Directive`:return XM(n.kind,{flags:n.flags});case`GroupOpen`:return RM(n,a,t);case`NamedCallout`:return eN(n.kind,n.tag,n.arguments);case`Quantifier`:return zM(n,a);case`Subroutine`:return BM(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=rN(ZM(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(Hj`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Hj`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function NM({kind:e}){return UM(Uj({"^":`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===Hj`\B`||e===Hj`\Y`})}function PM({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,WM(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 WM(r)}return i(+r)}function FM(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(),JM(o,e);throw Error(`Invalid character class range`)}return KM(zj(`-`))}function IM({negate:e},t,n){let{tokens:r,walk:i}=t,a=[qM()],o=r[t.nextIndex],s=mN(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(qM()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=mN(r[t.nextIndex],o)}let c=qM({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 LM({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=pN(n);if(Vj.has(r)&&!o?.has(r))e=`posix`,n=r;else return aN(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?tN(n,{negate:t}):YM(e,{negate:t})}function RM(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=oN(e),l=c.type===`AbsenceFunction`,u=uN(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Bj(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=hN(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(HM()),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(lN(t)||t.type===`CapturingGroup`)throw Error(e)}else if(lN(t)||uN(t)&&t.negate)throw Error(e)}}f=hN(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||!AM(a))throw Error(`Quantifier requires a repeatable token`);let o=nN(e,t,n,a);return i.body.pop(),o}function BM({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=iN(i);return r.push(o),o}function VM(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:sN(t?.body)}}function HM(e){return{type:`Alternative`,body:cN(e?.body)}}function UM(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function WM(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function GM(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!dN(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:sN(t?.body)}}function KM(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 qM(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:cN(e?.body)}}function JM(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function YM(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 XM(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:Uj(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function ZM(e){return{type:`Flags`,...e}}function QM(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:sN(e?.body)}}function $M(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:sN(e?.body)}}function eN(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function tN(e,t){let n=!!t?.negate;if(!Vj.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function nN(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 rN(e,t){return{type:`Regex`,body:sN(t?.body),flags:e}}function iN(e){return{type:`Subroutine`,ref:e}}function aN(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(pN(e));if(!r){if(n.normalizeUnknownPropertyNames)r=fN(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Hj`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function oN({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return VM(`repeater`);case`atomic`:return QM({atomic:!0});case`capturing`:return GM(i,{name:n});case`group`:return QM({flags:e});case`lookahead`:case`lookbehind`:return $M({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function sN(e){if(e===void 0)e=[HM()];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 cN(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 lN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function uN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function dN(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function fN(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 pN(e){return e.replace(/[- _]+/g,``).toLowerCase()}function mN(e,t){let n=t;return Uj(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function hN(e){return Uj(e,`Unclosed group`)}function gN(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(){_N(c).splice(Math.max(0,vN(s)+l),1),l--,u=!0},removeAllNextSiblings(){return _N(c).splice(vN(s)+1)},removeAllPrevSiblings(){let e=vN(s)+l;return l-=e,_N(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,vN(s)+l)]=e:Uj(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(_N(c).splice(Math.max(0,vN(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,vN(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 _N(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function vN(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var yN=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function bN(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function xN(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var SN=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function CN(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===SN.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?SN.CHAR_CLASS:SN.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 wN(e,t,n,r){CN(e,t,n,r)}function TN(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===SN.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function EN(e,t,n){return!!TN(e,t,0,n)}function DN(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 ON=new RegExp(String.raw`(?<noncapturingStart>${yN})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function kN(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(ON.lastIndex=Number.isNaN(c)?0:c+7;f=ON.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),bN(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=CN(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}`},SN.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var AN=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,jN=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>${AN})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
81
|
-
| \\?.
|
|
82
|
-
`.replace(/\s+/g,``),`gsu`);function MN(e){if(!RegExp(`${AN}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(jN.lastIndex=0;o=jN.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=xN(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}jN.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var NN=String.raw,PN=NN`\(\?R=(?<rDepth>[^\)]+)\)|${NN`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,FN=NN`\(\?<(?![=!])(?<captureName>[^>]+)>`,IN=NN`${FN}|(?<unnamed>\()(?!\?)`,LN=new RegExp(NN`${FN}|${PN}|\(\?|\\?.`,`gsu`),RN=`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(PN,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&EN(e,NN`\(\?\(DEFINE\)`,SN.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=EN(e,NN`\\[1-9]`,SN.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(LN.lastIndex=0;f=LN.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(BN(m),l)throw Error(RN);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(LN.lastIndex);if(EN(s,PN,SN.DEFAULT))throw Error(RN);let c=m-1;e=VN(t,s,c,!1,n,a,d),i=WN(i,t,c,a.length,0,d);break}if(h){BN(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(RN);break}if(!u)throw Error(NN`Recursive \g cannot be used outside the referenced group "${r===`external`?h:NN`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=DN(e,p);if(o&&EN(m,NN`${FN}|\((?!\?)`,SN.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=VN(_,v,b,!0,n,a,d);i=WN(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,LN.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),LN.lastIndex),s.set(p,LN.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),LN.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function BN(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 VN(e,t,n,r,i,a,o){let s=new Set;r&&wN(e+t,FN,({groups:{captureName:e}})=>{s.add(e)},SN.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${HN(`(?:${e}`,`forward`,...c)}(?:)${HN(`${t})`,`backward`,...c)}${t}`}function HN(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+=CN(e,NN`${IN}|\\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),UN(i,n),s?e:`(?<${t}${l}>`}return NN`\k<${c}${l}>`},SN.DEFAULT)}return c}function UN(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function WN(e,t,n,r,i,a){if(e.size&&r){let o=0;wN(t,IN,()=>o++,SN.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 GN=String.fromCodePoint,Q=String.raw,KN={},qN=globalThis.RegExp;KN.flagGroups=(()=>{try{new qN(`(?i:)`)}catch{return!1}return!0})(),KN.unicodeSets=(()=>{try{new qN(`[[]]`,`v`)}catch{return!1}return!0})(),KN.bugFlagVLiteralHyphenIsRange=KN.unicodeSets?(()=>{try{new qN(Q`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,KN.bugNestedClassIgnoresNegation=KN.unicodeSets&&new qN(`[[^a]]`,`v`).test(`a`);function JN(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function YN(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function XN(e,t){return QN[e]>=QN[t]}function ZN(e,t){if(e==null)throw Error(t??`Value expected`);return e}var QN={ES2025:2025,ES2024:2024,ES2018:2018},$N={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function eP(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!$N[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=KN.flagGroups?`ES2025`:KN.unicodeSets?`ES2024`:`ES2018`),t}var tP=`[ -\r ]`,nP=new Set([GN(304),GN(305)]),rP=Q`[\p{L}\p{M}\p{N}\p{Pc}]`;function iP(e){if(nP.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=cP.get(n),a=oP.get(n),o=sP.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 aP=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=>[pN(e),e])),oP=new Map([[`s`,GN(383)],[GN(383),`s`]]),sP=new Map([[GN(223),GN(7838)],[GN(107),GN(8490)],[GN(229),GN(8491)],[GN(969),GN(8486)]]),cP=new Map([dP(453),dP(456),dP(459),dP(498),...fP(8072,8079),...fP(8088,8095),...fP(8104,8111),dP(8124),dP(8140),dP(8188)]),lP=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 uP(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function dP(e){let t=GN(e);return[t.toLowerCase(),t]}function fP(e,t){return uP(e,t).map(e=>dP(e))}var pP=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function mP(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};vP(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:XN(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};gN(e,hP,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 gN(e,gP,a),gN(e,_P,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var hP={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=QM();e.body[0].body.push($M({negate:!0,body:r}),aN(`Any`));let i=QM();i.body[0].body.push(nN(`greedy`,0,1/0,e)),n(LP(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];YN(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=TP(t.get(e));if(n){let t=QM({flags:n});t.body[0].body=e.body,e.body=[LP(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(LP($M({body:[HM({body:[UM(`string_end`)]}),HM({body:[KM(10)]})]}),t));else if(c===`line_start`)o(LP(PP(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&&jP(e))o(LP($M({negate:!0}),t));else if(d)throw Error(Q`Uses "\G" in a way that requires a subclass`);else o(IP(UM(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(LP(PP(Q`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${rP})(?!${rP})|(?<!${rP})(?=${rP}))`,n=`(?:(?<=${rP})(?=${rP})|(?<!${rP})(?!${rP}))`;o(LP(PP(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!NP(n)&&(n=wP(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!NP(r)&&(r=wP(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(LP(qM({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(IP(YM(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(LP(FP(PP(tP),l),t));return}if(s&&(c===`word`||u===`word`)){n(IP(YM(`word`,{negate:l}),t));return}if(c===`any`)n(IP(aN(`Any`),t));else if(c===`digit`)n(IP(aN(`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(LP(PP(Q`(?>\r\n|${i?Q`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(IP(aN(`AHex`,{negate:l}),t));else if(c===`newline`)n(LP(PP(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-${GN(e.codePointAt(0)-1)}${GN(e.codePointAt(2)+1)}-\u{10FFFF}`),n(LP(PP(`[${e}]`),t))}else n(LP(FP(PP(lP.get(u)),l),t))}else if(c===`property`)aP.has(pN(u))||(e.key=`sc`);else if(c===`space`)n(IP(aN(`space`,{negate:l}),t));else if(c===`word`)n(LP(FP(PP(rP),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=QM({flags:c});e.body[0].body=o(),i(LP(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&kM(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=$M({behind:!0});o.body[0].body=a(),i(LP(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(LP($M({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=QM();t.body[0].body.push(e.body),e.body=LP(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=OP(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`&&!NP(n)&&(n=wP(n,t),e.ref=n)}},gP={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=IP(SP(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&YN(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=YN(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=JN(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?SP(0):xP(o,r.groupOriginByCopy,null),l=c;if(!s){let e=TP(CP(o,e=>e.type===`Group`&&!!e.flags)),t=e?JN(r.globalFlags,e):r.globalFlags;yP(t,r.currentFlags)||(l=QM({flags:EP(t)}),l.body[0].body.push(c))}n(LP(l,t),{traverse:!s})}},_P={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=>bP(t,e));i.length?i.length>1?n(LP(QM({atomic:!0,body:i.reverse().map(e=>HM({body:[WM(e.number)]}))}),t)):e.ref=i[0].number:n(LP($M({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=GM();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vP(e){gN(e,{"*"({node:e,parent:t}){e.parent=t}})}function yP(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function bP(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=DP(n.parent);for(let r of t){if(r===n)break;if(r===e||kP(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function xP(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]=xP(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function SP(e){let t=iN(e);return t.isRecursive=!0,t}function CP(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wP(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 TP(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 EP({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 DP(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function OP(e){let t=e.find(e=>e.kind===`search_start`||MP(e,{negate:!1})||!AP(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=OP(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function kP(e,t){let n=DP(e)??[];for(let e of n)if(e===t||kP(e,t))return!0;return!1}function AP({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function jP(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function MP(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&kM(e.body[0],{type:`Assertion`,kind:`search_start`})}function NP(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function PP(e,t){let n=MM(e,{...t,unicodePropertyMap:aP}).body;return n.length>1||n[0].body.length>1?QM({body:n}):n[0].body[0]}function FP(e,t){return e.negate=t,e}function IP(e,t){return e.parent=t,e}function LP(e,t){return vP(e),e.parent=t,e}function RP(e,t){let n=eP(t),r=XN(n.target,`ES2024`),i=XN(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];gN(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,ZN(BP[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&&YN(f._captureTransfers,e.transferTo,[]).push(t)}),f}var zP={"*":{enter({node:e},t){if(QP(e)){let n=t.getCurrentModI();t.pushModI(e.flags?JN({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){QP(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){KP(GN(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),qP(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&pP.has(e.value)&&t.setHasCasedChar()}},BP={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=GN(e),r=JP(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&KP(n)){let e=iP(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`);KN.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(eF)&&(o=[KM(45),...o.filter(e=>!eF(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||KN.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=QM(),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=HM({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`&&!(KN.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=JP(n,i),o=JP(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&YP(qP(e)).forEach(e=>{s.add(Array.isArray(e)?`${JP(e[0],i)}-${JP(e[1],i)}`:JP(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&&pP.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=JN(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${XP(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)+ZP(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}>`}},VP=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),HP=new Set([`-`,`\\`,`]`,`^`,`[`]),UP=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),WP=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`]]),GP=/^\p{Cased}$/u;function KP(e){return GP.test(e)}function qP(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=GN(e);if(!KP(t))continue;let o=iP(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function JP(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(WP.has(e))return WP.get(e);if(e<32||e>126&&e<160||e>262143||t&&$P(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?UP:HP:VP,a=GN(e);return(i.has(a)?`\\`:``)+a}function YP(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 XP(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 ZP({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 QP({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function $P(e){return e>47&&e<58}function eF({type:e,value:t}){return e===`Character`&&t===45}var tF=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=rF(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&&(nF(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||=iF(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 nF(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 rF(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)YN(n,t,{}).transferTo=e;return n}function iF(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 aF(e,t){let n=oF(e,t);return n.options?new tF(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function oF(e,t){let n=eP(t),r=mP(MM(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:aP}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=RP(r,n),a=zN(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=kN(MN(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 sF(e,t){return aF(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function cF(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>sF(e,{target:t.target}),{createScanner(e){return new Rj(e,t)},createString(e){return{content:e}}}}async function lF(e){if(fT())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=qw.get(e);if(t!=null)return t;try{let t=Jw.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(ET,e)&&(t=ET[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 Kw.has(e)||Kw.set(e,n),n});return qw.set(e,n),await n}finally{qw.delete(e)}}function uF(e){return Kw.get(e)??lF(e)}function dF(e){for(let t of Zw(e))if(!Qw.has(t))return!1;return!0}function fF({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:pF(t)}}function pF(e){return async()=>$D(iT(await e()))}var mF=`pierre`,hF=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],gF=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],_F=[...gF,...hF],vF=new Set(gF);function yF(e){return vF.has(e)?`light`:`dark`}var bF={"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`},xF={"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 SF(e){return fF({name:e,collection:mF,colorScheme:yF(e),displayName:bF[e],load:xF[e]})}var CF=$w({themes:_F.map(e=>SF(e))}),wF=`shiki`,TF=[`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`],EF=`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(`.`),DF=new Set(TF);function OF(e){return DF.has(e)?`light`:`dark`}var kF={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 AF(e){return fF({name:e,collection:wF,colorScheme:OF(e),load:kF[e]})}var jF=$w({themes:Object.freeze([...TF.map(e=>AF(e)),...EF.map(e=>AF(e))])});function MF(e){if(fT())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(lT.hasRegisteredTheme(e))return;let t=jF.getTheme(e);if(t!=null){lT.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function NF(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function PF(e){MF(e);let t=await lT.resolveTheme(e);return NF(e,t),t}function FF(e){return lT.getResolvedTheme(e)??PF(e)}var IF;async function LF({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){IF??=kj({themes:[],langs:[`text`],engine:n===`shiki-wasm`?nE(Y(()=>import(`./wasm-BnjxR4X6.js`),[])):cF()});let r=zF(IF)?await IF:IF;IF=r;let i=[];for(let e of Array.from(new Set(t))){if(e===`text`||e===`ansi`)continue;let t=uF(e);`then`in t?i.push(t):dT(t,r)}let a=[];for(let t of e){let e=FF(t);`then`in e?a.push(e):uT(e,IF)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{dT(e,r)}),Promise.all(a).then(e=>{uT(e,r)})]),r}function RF(e){if(!(IF==null||`then`in IF)&&(e==null||dF(e.theme)&&Xw(e.lang)))return IF}function zF(e=IF){return e!=null&&`then`in e}for(let e of CF.getThemes())lT.registerThemeIfAbsent(e.name,e.load);function BF(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function VF(e){return lT.hasResolvedThemes(e)}function HF(e,t){return BF(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}var UF=new Map,WF={"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 GF(e){if(UF.has(e))return UF.get(e)??`text`;if(WF[e]!=null)return WF[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(UF.has(t[1]))return UF.get(t[1])??`text`;if(WF[t[1]]!=null)return WF[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return UF.has(n)?UF.get(n)??`text`:WF[n]??`text`}function KF(e){return(e.lang??GF(e.name))===`text`}var qF=10,JF=13,YF=4,XF=40;function ZF(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===YF){if(o-i<=XF){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===qF||r===JF)&&(r===JF&&n+1<e.length&&e.charCodeAt(n+1)===qF&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function QF(e){let t=ZF(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 $F(e,t){for(let n of t)e.push(n)}function eI(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function tI({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 nI(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 rI(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function iI(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:[eI(`${t}`)]})]})}function aI(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 oI(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(eI(`
|
|
179
|
-
`)),e}var sI=Symbol(`no-token`),cI=Symbol(`multiple-tokens`);function lI(e){let t=uI(e);if(t!=null)return t;let n=sI,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`){fI(e,a);for(let t of e.children)dI(t)}else dI(e);r.push(e),i=[],a=void 0;return}for(let e of i)dI(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==sI){if(e===cI){n=cI;return}if(n===sI){n=e;return}n!==e&&(n=cI)}};for(let t of e.children){let e=t.type===`element`?lI(t):sI;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 uI(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function dI(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)dI(t)}}function fI(e,t){e.properties[`data-char`]=t}function pI(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+mI(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 mI(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 hI(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=nI(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&lI(a),i.push(oI(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(_I,gI),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:gI}}var gI=pI({classPrefix:`hl-`}),_I={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 vI(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var yI=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,bI=/^0(?:\.0+)?%?$/;function xI(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 SI(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 CI(e){if(e==null)return null;let t=SI(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 wI(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||yI.test(t))return!0;let n=xI(t);return n!=null&&bI.test(n)}function TI(e,t,n){if(t==null||n==null)return!1;let r=CI(e),i=CI(t),a=CI(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var EI=new WeakMap;function DI(e){let t=EI.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;OI(r,`editor.background`,i),OI(r,`editor.foreground`,a),OI(r,`sideBar.background`,o),OI(r,`sideBar.foreground`,s),OI(r,`input.background`,n[`input.background`]??o),OI(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),OI(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),OI(r,`gitDecoration.addedResourceForeground`,kI(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),OI(r,`gitDecoration.modifiedResourceForeground`,kI(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),OI(r,`gitDecoration.deletedResourceForeground`,kI(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(wI(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(wI(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(AI(l,o)||TI(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return EI.set(e,u),u}function OI(e,t,n){n!=null&&n!==``&&(e[t]=n)}function kI(...e){for(let t of e)if(t!=null&&t!==``)return t}function AI(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function jI({theme:e=Dw,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=DI(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${vI(`global`)}fg:${a.fg};`,r+=`${vI(`global`)}bg:${a.bg};`,r+=MI(i,n)}else{let n=t.getTheme(e.dark),i=DI(n);r+=`${vI(`global`)}dark:${i.fg};`,r+=`${vI(`global`)}dark-bg:${i.bg};`,r+=MI(n,`dark`),n=t.getTheme(e.light),i=DI(n),r+=`${vI(`global`)}light:${i.fg};`,r+=`${vI(`global`)}light-bg:${i.bg};`,r+=MI(n,`light`)}return r}function MI(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${vI(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${vI(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${vI(`global`)}${t}modified-color:${a};`),n}function NI(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 PI={forcePlainText:!1};function FI(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=PI){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=hI(i),f=a?`text`:e.lang??GF(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=jI({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:vI(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:vI(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=NI(t.codeToHast(II(l?LI(c??QF(e.contents),o,s):e.contents),h)),_=l?Array(o):g;return l&&$F(_,g),{code:_,themeStyles:m,baseThemeType:p}}function II(e){return e.replace(/\r(?!\n)/g,`
|
|
180
|
-
`)}function LI(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}function RI(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 BI(e,t){return BF(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function VI(e){let t=e.lang??GF(e.name),n=e.lang??(e.prevName==null?`text`:GF(e.prevName));return t===`text`&&n===`text`}function HI(e){return{...Nw,...e}}function UI(e,t){let n=WI(e,t);return t?n:e.diffHeaderHeight+n}function WI(e,t){return e.paddingTop??(t?e.spacing:0)}function GI(e){return e.paddingBottom??e.spacing}function KI(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function qI(e){return[zw(e.additionStart,e.additionCount)+1,Bw(e.additionStart,e.additionCount)+1]}function JI({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 YI(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-Bw(t.additionStart,t.additionCount),r=e.deletionLines.length-Bw(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function XI({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-Bw(n.additionStart,n.additionCount),i=e.deletionLines.length-Bw(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 ZI({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=XI({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 QI({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]=qI(a);if(t<o){let s=JI({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=ZI({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]=qI(a);return t<o+i.fromStart||t>=o+i.rangeSize}function $I({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]=qI(n),l=JI({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=ZI({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 eL({type:e,metrics:t}){return t.hunkSeparatorHeight??KI(e)}function tL({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function nL({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 rL(e){return e!==`simple`&&e!==`metadata`}function iL({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!nL({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=eL({type:e,metrics:t}),a=tL({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function aL({type:e,metrics:t}){if(!rL(e))return;let n=eL({type:e,metrics:t}),r=tL({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function oL({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=sL({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=JI({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?ZI({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(uL(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,uL(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(uL(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=dL(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(fL({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(uL(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 sL({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=cL({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 cL({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=JI({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?ZI({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 lL(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 uL(e,t,n,r,i,a){let[o,s]=lL(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 dL(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 fL({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 pL(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var mL=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}},hL=new class extends mL{};function gL(e,t,n){return hL.diff(e,t,n)}function _L(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 vL(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 yL(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 bL(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 xL(e,t){return yL(e,t,``)}function SL(e,t){return bL(e,t,``)}function CL(e,t){return t.slice(0,wL(e,t))}function wL(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 TL(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 EL(e,t){if(t)return OL(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function DL(e,t){if(t)return OL(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function OL(e,t){if(!t)return[DL(e),EL(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=TL(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var kL=`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}`,AL=RegExp(`[${kL}]+|\\s+|[^${kL}]`,`ug`);new class extends mL{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=TL(e,r)}else n=e.match(AL)||[];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)&&jL(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&jL(n,i,r,null,t.intlSegmenter),e}};function jL(e,t,n,r,i){if(t&&n){let[a,o]=OL(t.value,i),[s,c]=OL(n.value,i);if(e){let r=_L(a,s);e.value=bL(e.value,s,r),t.value=xL(t.value,r),n.value=xL(n.value,r)}if(r){let e=vL(o,c);r.value=yL(r.value,c,e),t.value=SL(t.value,e),n.value=SL(n.value,e)}}else if(n){if(e){let e=DL(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=DL(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=DL(r.value,i),[a,o]=OL(t.value,i),s=_L(n,a);t.value=xL(t.value,s);let c=vL(xL(n,s),o);t.value=SL(t.value,c),r.value=yL(r.value,n,c),e.value=bL(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=DL(r.value,i),n=CL(EL(t.value,i),e);t.value=SL(t.value,n)}else if(e){let n=CL(EL(e.value,i),DL(t.value,i));t.value=xL(t.value,n)}}var ML=new class extends mL{tokenize(e){let t=RegExp(`(\\r?\\n)|[${kL}]+|[^\\S\\n\\r]+|[^${kL}]`,`ug`);return e.match(t)||[]}};function NL(e,t,n){return ML.diff(e,t,n)}var PL=new class extends mL{constructor(){super(...arguments),this.tokenize=IL}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 FL(e,t,n){return PL.diff(e,t,n)}function IL(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 LL(e){return e==`.`||e==`!`||e==`?`}new class extends mL{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(LL(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 mL{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends mL{constructor(){super(...arguments),this.tokenize=IL}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(RL(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 RL(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]=RL(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]=RL(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends mL{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 BL(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 VL={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function HL(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;FL(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(FL(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||GL(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 UL(e,t){if(t||=VL,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=>UL(e,t)).join(`
|
|
187
|
-
`)}let n=[];if(e.isGit){if(t=VL,!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 `+BL(r)+` `+BL(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 `+BL((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+BL((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+BL((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+BL((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(`--- `+BL(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+BL(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 WL(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;HL(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?UL(e,o.headerOptions):void 0)}}))}else{let s=HL(e,t,n,r,i,a,o);return s?UL(s,o?.headerOptions):void 0}}function GL(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 KL({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 qL({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 JL={forcePlainText:!1};function YL(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=JL){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=jI({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)??ZL();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)}oL({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&&XL({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}=QL({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 $F(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 $F(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function XL({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=pL(e),t=pL(t),e.length>s||t.length>s))return;let c=o===`char`?gL(e,t):NL(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?(qL({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),qL({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?qL({item:e,arr:l,enableJoin:d,isLastItem:t}):qL({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(KL({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(KL({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function ZL(){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 QL({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??GF(e.name),d=s??GF(t.name),{state:f,transformers:p}=hI(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:vI(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:vI(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,NI(i.codeToHast(pL(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,NI(i.codeToHast(pL(t.contents),m)))}}var $L=(0,q.createContext)(void 0);function eR(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 tR(e,t){let n=e?.theme??Dw,r=t?.theme??Dw,i=nR(e),a=nR(t);return BF(n,r)&&eR(e,t,[`theme`,`parseDiffOptions`])&&eR(i,a)}function nR(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var rR=new Set,iR=null;function aR(e){rR.add(e),iR??=requestAnimationFrame(sR)}function oR(e){rR.delete(e)&&rR.size===0&&iR!=null&&(cancelAnimationFrame(iR),iR=null)}function sR(e){let t=new Set(rR);rR.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}iR=rR.size>0?requestAnimationFrame(sR):null}function cR(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function lR(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function uR(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 dR=`-1,-1`;function fR(e){return e?.some(e=>e.lineNumber===0)??!1}function pR(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function mR(e){return e.startingLine===0&&e.totalLines>0}function hR(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function gR(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[tI({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function _R(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 vR=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(),oR(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||cR(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&&_R(e.composedPath())||(RR(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)&&(RR(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(RR(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){RR(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();RR(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);RR(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=CR(i)&&this.hoveredLine?.lineElement===i.lineElement;SR(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),SR(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),CR(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(TR(i)&&p!=null){p(i);break}if(wR(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!CR(i))break;SR(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,RR(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})()),RR(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),RR(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();_R(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(hR(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=kA(gR());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);xR(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(OR(t));if(xR(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(xR(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(xR(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&&_R(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=OR(e);if(t&&_R(n))return;let r=kR(e);return r==null?this.pathFromAnnotationSlot(e):OR(r)}pathFromAnnotationSlot(e){let t=AR(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return OR(t);let n=MR(jR(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:OR(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=NR(t)?t:NR(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)}cR(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,aR(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=()=>{oR(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!FR(this.renderedSelectedLinesState,n),i=!FR(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);ER(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=LR(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=LR(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:DR(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:DR(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:IR(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:IR(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 yR({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:bR({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 bR({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 xR(e){return e!=null&&`kind`in e&&e.kind===`line`}function SR(e){return e!=null&&`kind`in e&&e.kind===`token`}function CR(e){return xR(e)||SR(e)}function wR(e){return`type`in e&&e.type===`line-info`}function TR(e){return`kind`in e&&e.kind===`merge-conflict-action`}function ER(e){return e===`current`||e===`incoming`||e===`both`}function DR(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function OR(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function kR(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 AR(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 jR(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 MR(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 NR(e){return e!=null&&typeof e.elementFromPoint==`function`}function PR(e,t){return e===t||cR(e??void 0,t??void 0)}function FR(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&PR(e?.range??null,t.range)}function IR(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function LR(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 RR(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),HR(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`?GR(t):KR(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:BR(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:VR(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&UR(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 BR(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function VR(e){return Math.max(Math.ceil(e),0)}function HR(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?UR(e,{codeWidthChanged:!0,numberWidthChanged:!0}):WR(e))}function UR(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 WR(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 GR(e){e.codeElement.isConnected&&WR(e)}function KR(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 qR(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 JR(e,t){return e.endsWith(`\r
|
|
193
|
-
`)?t+`\r
|
|
194
|
-
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
195
|
-
`)?t+`
|
|
196
|
-
`:t}function YR(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 XR(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function ZR(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 QR({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:Ew}}):$R({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[ez(r)]],properties:i})}function $R({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:Cw}}),tI({name:ZR(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[eI(t)]})],properties:{"data-prev-name":``}})),r.push(tI({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[eI(e)]})],properties:{"data-title":``}})),r.push($({tagName:`slot`,properties:{name:ww}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function ez(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:[eI(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[eI(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:Tw}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function tz(e){return $({tagName:`pre`,properties:nz(e)})}function nz({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 rz(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:Array.isArray(e)?e:[e??`text`],themes:Zw(t),preferredHighlighter:n}}function iz(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function az(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var oz=-1,sz=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`file-renderer:${++oz}`;highlighter;file;renderCache;pendingHighlightResult;computedLang=`text`;lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;get fileCache(){return this.renderCache?.file}constructor(e={theme:Dw},t=Lw,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=dF(e.theme??Dw)?RF():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&&uR(r.file,t),{result:s}=r;if(!r.highlighted||s==null||!HF(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&&az(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&&uR(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=cz(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!HF(t,r.options)&&(r=void 0),this.renderCache??={file:e,hydrated:!0,options:t,highlighted:!n&&!KF(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??GF(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??Dw}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||!uR(e,n.file)||!HF(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(uR(n.file,e))return n.file;let r=QF(e.contents),i=e.contents.length===0||KF(e)||cz(r.length,this.getTokenizeMaxLength());return this.canRenderFile(e,t,i)?e:n.file}canRenderFile(e,t,n){let{renderCache:r}=this;return r==null||uR(r.file,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&dF(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&dF(t.theme)}getOrCreateLineCache(e){let{lineCache:t}=this;return(t==null||!az(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:QF(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&&az(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]=JR(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&&az(this.lineCache,r)?this.lineCache.lines:QF(r.contents),o=QF(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=Fw){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||KF(e)||cz(a.length,this.getTokenizeMaxLength()),c=this.canRenderFile(e,n,s),l=!uR(e,this.renderCache.file),u=!qR(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let i=this.renderCache.result==null&&this.renderCache.highlighted&&!s&&!l&&iz(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??GF(e.name),this.highlighter??=RF();let t=this.highlighter!=null&&dF(n.theme),i=this.highlighter!=null&&Xw(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=Fw){this.file=e;let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=cz(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??GF(e.name);let n=this.highlighter!=null&&VF(Zw(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&Xw(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:FI(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=rI(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=mR(t)?pR(this.lineAnnotations):void 0;d!=null&&(c.children.push(aI(`context`,`annotation`,1)),s.push(YR({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(iI(`context`,t,`${r}`)),s.push(i),u++;let a=this.lineAnnotations[t];a!=null&&(c.children.push(aI(`context`,`annotation`,1)),s.push(YR({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 QR({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return kA(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=rI();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,XR(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return kA(t?$({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await LF(rz(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&&uR(e,i)&&HF(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&HF(a.options,n)&&uR(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&&HF(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&uR(n.file,e)&&HF(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&&uR(e,n.file)&&HF(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 tz({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function cz(e,t){return e>t}var lz=`<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 uz(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function dz(e,t){return e==null||t==null?e===t:pz(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 fz={};function pz(e=fz,t=fz){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 mz(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function hz(){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 gz(){let e=document.createElement(`style`);return e.setAttribute(kw,``),e}var _z;function vz(e){if(_z!=null)return _z;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(Aw,`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),_z=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),_z}function yz(e){return`${jw}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var bz=`@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
|
-
`,xz=`@layer base, theme, rendered, unsafe;`,Sz=RegExp(`${Ez(jw)}\\s*:\\s*[^;]+;`);function Cz(e){return`${xz}
|
|
1527
|
-
@layer unsafe {
|
|
1528
|
-
${e}
|
|
1529
|
-
}`}function wz(e,t=`system`,n){return`${xz}
|
|
1530
|
-
@layer rendered {
|
|
1531
|
-
:host {${t===`system`?``:`
|
|
1532
|
-
color-scheme: ${t};`}
|
|
1533
|
-
${yz(n)}
|
|
1534
|
-
${e}
|
|
1535
|
-
}
|
|
1536
|
-
}`}function Tz(e,t){let n=yz(t);return e.replace(Sz,n)}function Ez(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var Dz=new WeakMap;function Oz(e){return Dz.get(e)??e}function kz(e,t,n){let r=new Map;for(let i of e){let e=Oz(i);r.set(e,n?.slotNames.get(e)??t(i))}return{provided:e,current:e,slotNames:r}}function Az(e,t,n){for(let r of t){let t=Oz(r);e.slotNames.has(t)||e.slotNames.set(t,n(r))}e.provided=t,e.current=t}function jz(e,t,n){if(e==null)return n(t);let r=Oz(t),i=e.slotNames.get(r);return i??(i=n(t),e.slotNames.set(r,i)),i}function Mz(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Nz(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:Mz(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Pz({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 Fz(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 Iz({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Lz(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Lz(){let e=document.createElement(`style`);return e.setAttribute(Ow,``),e}var Rz=void 0;function zz(){return Rz??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Bz(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Vz(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(bz)),t.adoptedStyleSheets=[e]}connectedCallback(){vz(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(hw,t)}var Hz=[``];function Uz(e){let t={...e};return delete t.cacheKey,t}var Wz=-1,Gz=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++Wz}`;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:Dw},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new sz(e,this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager),this.resizeManager=new zR,this.interactionManager=new vR(`file`,yR(e)),this.workerManager?.subscribeToThemeChanges(this)}getAnnotationSlotName=e=>jz(this.editSession?.annotations,e,Lw);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??Dw}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(uR(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=kz(t,Lw,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=Uz(t??e);this.editSession={file:i,externalReplacement:n&&r,annotations:this.editSession?.annotations??kz(this.lineAnnotations,Lw)},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(yR(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&&!BF(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,Az(t,e,Lw))}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||Kz(this.pre,i,this.options.collapsed)||qz(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),Bz(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(Nz(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?Hz: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??GF(i.name),c=RF({theme:o,lang:s});c==null?LF({themes:Zw(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&&uR(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=!uR(this.file,e);m&&this.updateExternalFile(e,o);let h=this.getLatestFile(e)??e;if(!c&&!n&&qR(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(Nz(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,Iw);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||!uR(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||KF(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||!uz(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:mz(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=hz();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??=gz(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Cz(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=vz(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=Iz({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:wz(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=Tz(this.themeCSSStyle.textContent??``,vz(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&zz()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=Pz({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=kA(i.children),t.style.cssText=i.properties.style}else n.innerHTML=kA(r);t.contains(n)||t.replaceChildren(n)};this.shouldGuardRebuildScroll()?Fz(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??kA(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,Ew,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,Cw,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,ww,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Tw,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:lR(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):lR(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=lz;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};dz(i,this.appliedPreAttributes)||(Vz(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 Kz(e,t,n=!1){return!n&&e==null&&t!=null}function qz(e,t,n=!1){return e==null&&t!=null&&!n}var Jz=5e3,Yz=new Map,Xz=-1;function Zz(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 Qz=class extends Gz{virtualizer;metrics;__id=`virtualized-file:${++Xz}`;renderType=`virtualized`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0,ghostTextRows:Yz};pendingRender;isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=Nw,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){let n=HI(e);(t||!eR(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=!tR(t,e),r=Zz(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=Yz,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()??Yz;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=fR(this.getLatestAnnotations());if(this.renderRange!=null&&a&&mR(this.renderRange)){let t=$z(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=!uR(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=UI(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=UI(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||!uR(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()??Yz);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,{lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(t),c=UI(this.metrics,i),l=GI(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,!uR(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=!uR(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:!uR(i,a),renderedFileChanged:!uR(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%Jz===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=UI(this.metrics,i),u=s>0?GI(this.metrics):0,{fileAnnotationHeight:d}=this.cache,f=l+d,p=Math.max(0,c-l-d-u),m=fR(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),k=Math.max(0,Math.min(te,ne)),re=k*a,ie=te<0?v+te*a:v,ae=S[k]??0,oe=re===0?0:d+ae,se=k+ie/a,A=se<S.length?p-S[se]:p-(w-t-f);return{startingLine:re,totalLines:ie,bufferBefore:oe,bufferAfter:Math.max(0,A)}}};function $z(e){let t;for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===dR&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}async function eB(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function tB({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=UI(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=JI({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=iL({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=nB(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?ZI({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=aL({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=aL({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=GI(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function nB(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 rB(e,t)}function rB(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 iB({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 aB(e){return e.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))}))}function oB(e){return{...e,hunks:aB(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}var sB=1;function cB(e,...t){return`ck${sB}:${JSON.stringify([e,...t])}`}function lB(e){return e===``?[]:e.split(vw)}function uB(e,t,n){let r=e===`clone`?oB(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return dB(r,pB(r,n),mB(r,n));case`rename-pure`:{let e=mB(r,n);hB(r,n);let t=lB(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,_B(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function dB(e,t,n){let r=lB(t.contents),i=lB(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=fB(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,_B(e,t,n),e}function fB(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=Bw(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=Bw(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function pB(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function mB(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function hB(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function gB(e,t,n){return e.cacheKey==null?vB(t,n):`${e.cacheKey}:hydrated`}function _B(e,t,n){let r=gB(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function vB(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?cB(`hydrated-files`,e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}var yB=new TextEncoder,bB=new TextDecoder(`utf-8`,{ignoreBOM:!0}),xB=/[\uD800-\uDFFF]/,SB=1024,CB=new Uint8Array(SB);function wB(){CB.length!==SB&&(CB=new Uint8Array(SB))}function TB(e){if(e.length===0)return e;if(xB.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;CB.length<t&&(CB=new Uint8Array(t));let{written:n}=yB.encodeInto(e,CB);return bB.decode(CB.subarray(0,n))}var EB=4096,DB=.5;function OB(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=AB(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}kB(t,e)}}function kB(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 AB(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)>EB)return null;let c=[];for(let t=0;t<n;t++)c.push(MB(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(MB(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+=NB(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*DB: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 jB=/\s+/g;function MB(e){return e.replace(jB,``)}function NB(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 PB(e,t,n=!1,r){let i=QB(e),a=i?VB(e):HB(e),o,s=[];for(let e of a){if(i&&!_w.test(e)){if(o==null)o=TB(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!i&&!UB(e)){if(o==null)o=TB(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let a=IB(e,{cacheKey:t==null?void 0:r==null?cB(`patch-file`,t,String(s.length)):cB(`patch-file`,t,String(r),String(s.length)),isGitDiff:i,throwOnError:n});a!=null&&s.push(a)}return{patchMetadata:o,files:s}}function FB(e,t){try{return IB(e,t)}finally{wB()}}function IB(e,{cacheKey:t,isGitDiff:n=_w.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=$B(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=BB(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=YB(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:tV(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(xw),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=TB(r.trim()),n!==r&&(c.prevName=TB(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?bw:yw):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=TB(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=TB(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=TB(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=TB(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=TB(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=TB(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(Sw)??[];t!=null&&(c.prevObjectId=TB(t)),n!=null&&(c.newObjectId=TB(n)),r!=null&&(c.mode=TB(r))}e.startsWith(`rename from `)&&(c.prevName=TB(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=TB(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:tV(p.hunkContext),hunkSpecs:TB(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(!qB(t)||JB(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=nV(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=rV(t);(g==null||g.type!==`change`)&&(g=iV(`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=rV(t);(g==null||g.type!==`change`)&&(g=iV(`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=rV(t);(g==null||g.type!==`context`)&&(g=iV(`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]=pL(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=pL(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=Bw(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=Bw(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),OB(c),c}}function LB(e,t,n=!1){let r=[],i=RB(e)?e.split(gw):[e];for(let e of i)try{r.push(PB(e,t,n,t==null?void 0:r.length))}catch(e){if(n)throw e;console.error(e)}finally{wB()}return r}function RB(e){return e.startsWith(`From `)||e.includes(`
|
|
1539
|
-
From `)}function zB(e){let t=BB(e);for(let e=0;e<t.length;e++)t[e]=TB(t[e]);return t}function BB(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 VB(e){return $B(e,`diff --git`)}function HB(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=KB(e,r);if(i<=0&&a<=0){if(WB(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=KB(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=YB(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 UB(e){return WB(e,0)}function WB(e,t){let n=KB(e,t);return GB(e,t,`---`)&&GB(e,n,`+++`)}function GB(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 KB(e,t){let n=e.indexOf(`
|
|
1542
|
-
`,t);return n===-1?e.length:n+1}function qB(e){let t=e[0];return t===`+`||t===`-`||t===` `}function JB(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 YB(e){if(!e.startsWith(`@@ -`))return;let t=4,n=XB(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=XB(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=XB(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=XB(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=ZB(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function XB(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 ZB(e){return e.endsWith(`\r
|
|
1544
|
-
`)?e.slice(0,-2):e.endsWith(`
|
|
1545
|
-
`)?e.slice(0,-1):e}function QB(e){return e.startsWith(`diff --git`)||e.includes(`
|
|
1546
|
-
diff --git`)}function $B(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:eV(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=eV(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function eV(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function tV(e){return e==null?e:TB(e)}function nV(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function rV(e){let t=e.slice(1);return TB(t===``?`
|
|
1547
|
-
`:t)}function iV(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 aV=`/dev/null`;function oV(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??sV(),a=t??sV(),o=FB(WL(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?cB(`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 sV(){return{name:aV,contents:``}}var cV=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 lV(e,t){let n=oV({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 uV(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 dV(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function fV(e,t){return t.length>0&&t.length<e.deletionLines.length&&dV(t)}function pV(e,t,n){let r=e.deletionLines.join(``),i=uV(t.length,r),a=oV({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 mV(e,t){return pV(e,[``],t)}function hV(e,t){if(e.additionLines.length===0)return mV(e,t);if(fV(e,e.additionLines))return pV(e,e.additionLines,t);let n=e.additionLines,r=lV(e,t);return _V(r,n),r}function gV(e){return e.length>1&&e.at(-1)===``}function _V(e,t){if(!gV(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&&Bw(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,DV(e);return}}}function vV(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return yV(e,lV(e,n));let r=Array.from(t);if(r.length===0)return yV(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||pL(r)===pL(i))return yV(e,lV(e,n))}let i=bV(e,r);if(i.size===0)return yV(e,lV(e,n));for(let t of i)if(!SV(e,t,n))return yV(e,lV(e,n));return DV(e),YI(e)?yV(e,lV(e,n)):yV(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function yV(e,t){return Object.assign(e,t),t}function bV(e,t){let n=new Set;for(let r of t){let t=xV(e,r);if(t==null)return new Set;n.add(t)}return n}function xV(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 SV(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=oV({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:(wV(r,s),CV(e,t),!0)}function CV(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 wV(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>TV(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,EV(e)}function TV(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function EV(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 DV(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,EV(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=Bw(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-Bw(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var OV=new WeakMap;function kV(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function AV(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 jV(e,t){let n=e.hunks,r=e.additionLines,i=kV(r),a=i===r?e:{...e,additionLines:i},o=VV(n,BV(a,t),e.deletionLines.length),s=WV(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,eH(e),_V(e,r),qV(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function MV(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<XV(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:XV(r);if(i==null||t<i||o!=null&&o!==s)return jV(e,n);o=s}if(o!=null){if(NV(e,i,o,r,n)){e.editSessionDirty=!0;return}return jV(e,n)}}function NV(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=PV(e),o=e.hunks[n];if(o.hunkContent.some(FV))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 PV(e){let t=OV.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return OV.set(e,{lines:e.deletionLines,set:n}),n}function FV(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function IV(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 LV(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=JI({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=ZV(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=ZI({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=ZV(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function RV(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=ZV(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,ZV(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(``)===``?lV(e,t):hV(e,t)),!0)}function BV(e,t){if(AV(e.deletionLines,e.additionLines)==null)return[];let n=oV({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=TV(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 VV(e,t,n){let r=e.map((e,t)=>{let n=ZV(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&&HV(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=UV(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 HV(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function UV(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 WV(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`);KV(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`);KV(s,c,i,r),r+=c,i+=c,n.push(GV(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 GV(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:QV(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:$V(t.additionStart,r),deletionStart:QV(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:$V(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${QV(t.deletionStart,i)},${i} +${QV(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return EV(s),s}function KV(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function qV(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(ZV(r)!==ZV(i)||r.deletionCount!==i.deletionCount||XV(r)!==XV(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!JV(r,i))return!0}return!1}function JV(e,t){let n=YV(e),r=YV(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*YV(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 XV(e){return zw(e.additionStart,e.additionCount)}function ZV(e){return zw(e.deletionStart,e.deletionCount)}function QV(e,t){return t===0?e:e+1}function $V(e,t){return t===0?e-1:e}function eH(e){DV(e);for(let t=0;t<e.hunks.length;t++)CV(e,t)}function tH(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function nH(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[eI(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function rH(e){return $({tagName:`div`,children:[tI({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 iH({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:[eI(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(rH(`up`)),s++),o||(e.push(rH(`down`)),s++)):(e.push(rH(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[eI(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[eI(`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 aH(e,t){return`hunk-separator-${e}-${t}`}function oH(e){let t=e.at(-1);return t==null?0:Math.max(Bw(t.additionStart,t.additionCount),Bw(t.deletionStart,t.deletionCount))}var sH=-1,cH=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++sH}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=[`text`];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:Dw},t=Lw,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=dF(e.theme??Dw)?RF():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,mV(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&&RI(r.diff,t),{result:s}=r;if(!r.highlighted||s==null||!BI(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||!RI(t.diff,e)||VI(e)||xH(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||!RI(n,e)||!RI(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);BI(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)??Pw}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=pL(u);s==null&&i&&(a.additionLines[t]=JR(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,mV(a,this.options.parseDiffOptions)),u=!0;else if(fV(a,a.additionLines))this.applyRecomputePreservingSessionType(a,pV(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=MV(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,vV(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=IV(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=yH(e),i.code.additionLines=_H(a,r.additionLines,i.code.additionLines,e),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,mV(r,this.options.parseDiffOptions)),i.code.additionLines[0]=vH(0,e.getLineText(0))):this.editSessionActive?this.applySessionDocumentChange(r):Object.assign(r,hV(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(fV(e,n)){this.applyRecomputePreservingSessionType(e,pV(e,n,t));return}this.applyExpansionRemap(jV(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=>YR(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=Dw,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Mw,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 LF(rz(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=xH(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!BI(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!VI(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=bH(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??Dw}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||!RI(e,n.diff)||!BI(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(RI(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||VI(e)||xH(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||RI(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&dF(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&dF(t.theme)}renderDiff(e=this.diff,t=Fw){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||VI(e)||xH(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!RI(e,this.renderCache.diff),d=!qR(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&iz(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,iz(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=bH(e),this.highlighter??=RF();let t=this.highlighter!=null&&dF(i.theme),n=this.highlighter!=null&&Xw(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=Fw){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 tz({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=xH(e,this.getTokenizeMaxLength());this.computedLangs=t?[`text`]:bH(e);let n=this.highlighter!=null&&dF(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Xw(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=YL(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(oL({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]=vH(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&&RI(i,e)&&BI(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&BI(a.options,n)&&RI(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&&BI(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&RI(n.diff,e)&&BI(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&&RI(e,n.diff)&&BI(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=SH(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:rI(),deletionsGutterAST:rI(),additionsGutterAST:rI(),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=XI({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`,aI(void 0,`buffer`,this.size)),h?.push(tH(this.size))):(x.pushToGutter(`deletions`,aI(void 0,`buffer`,this.size)),g?.push(tH(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,iI(t,n,r,i))};function T(e){C.flush(),a===`unified`?mH(`unified`,e,x):(mH(`deletions`,e,x),mH(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),oL({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&&dH(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=hH(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=hH(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),pH({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&&dH(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&fH(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=hH(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=hH(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)}pH({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&fH(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(nH(e)),x.pushToGutter(`unified`,aI(e,`metadata`,1))):(x.deletionsContentAST.push(nH(e)),x.pushToGutter(`deletions`,aI(e,`metadata`,1)),ee||(x.pushToGutter(`additions`,aI(void 0,`buffer`,1)),x.additionsContentAST.push(tH(1))))}if(ee){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(nH(e)),x.pushToGutter(`unified`,aI(e,`metadata`,1))):(x.additionsContentAST.push(nH(e)),x.pushToGutter(`additions`,aI(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,aI(void 0,`buffer`,1)),x.deletionsContentAST.push(tH(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(oH(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=rI(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,XR(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 kA(this.renderFullAST(e,t))}renderPartialHTML(e,t){return kA(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(!mR(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(pR(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(pR(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){pH({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}pH({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 QR({fileOrDiff:e,mode:t,stickyHeader:n})}},lH=new Intl.PluralRules(`en-US`);function uH(e){return`${e} unmodified line${lH.select(e)===`one`?``:`s`}`}function dH(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function fH(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 pH({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`,aI(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`,aI(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`,aI(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function mH(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,iH({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(iH({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,iH({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(iH({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=aH(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?uH(n):`More unchanged context may be available`;c.pushToGutter(e,iH({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(iH({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 hH(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function gH(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function _H(e,t,n,r){let i=gH(e),a=gH(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]??=vH(e,r.getLineText(e));return l}function vH(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 yH(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function bH(e){if(e.lang!=null)return[e.lang];let t=GF(e.prevName??e.name),n=GF(e.name);return t===n?[n]:[t,n]}function xH(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function SH(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function CH(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function wH(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 TH(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:Mz(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 EH(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function DH(e){let t={...e};return delete t.cacheKey,t}function OH(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??GF(e.name),r=t.lang??GF(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 kH(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function AH(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&kH(n.lines,t.deletionLines)}var jH=-1,MH=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++jH}`;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:Dw},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new zR,this.scrollSyncManager=new cV,this.interactionManager=new vR(`diff`,yR(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??Dw}getHunksRendererOptions(e){return TH(e)}createHunksRenderer(e){return new cH(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(yR(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&&!BF(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>jz(this.editSession?.annotations,e,Lw);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,Az(t,e,Lw))}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;oR(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=iB(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||LH(this.pre,FH({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||RH(this.headerElement,IH({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),Bz(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?oV(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||!EH(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(uB(`merge`,e,t),this.setHydratedState(t),this.startHydratedEditSession(e)){this.rerender();return}await eB(()=>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(NH(e)),t.__getDocumentSessionState()),!0):(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(RI(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(NH(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=kz(t,Lw,this.editSession.annotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:lB(t.contents),a=n!=null&&AH(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=DH(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,DV(s)),this.editSession={diff:s,annotations:this.editSession?.annotations??kz(this.lineAnnotations,Lw),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=iB(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=_&&(!PH(u,this.deletionFile)||!PH(d,this.additionFile)),y=e!=null&&!RI(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&qR(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=oV(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,Iw);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||!RI(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?OH(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??GF(i.name),c=RF({theme:o,lang:s});c==null?LF({themes:Zw(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||iz(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return oL({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&&OH(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?aB(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(NH(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=oB(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=LV(e,this.hunksRenderer.getExpandedHunksMap(),t);return zV(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(RV(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 QI({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 $I({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]=qI(o);if(e<s){let c=JI({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=ZI({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]=qI(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(){aR(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||VI(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||!wH(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||!CH(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:mz(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=hz();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:lR(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):lR(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=lz;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&&RI(r,n)?i:void 0)??kA(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,Ew,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,Cw,d),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,ww,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Tw,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??=gz(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Cz(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=vz(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=Iz({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:wz(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=Tz(this.themeCSSStyle.textContent??``,vz(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&zz()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Fz(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=kA(i),r.content.innerHTML=kA(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=Pz({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=Pz({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=Pz({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=kA(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?Fz(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};dz(u,this.appliedPreAttributes)||(Vz(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 NH(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function PH(e,t){return e==null||t==null?e==null&&t==null:zI(e,t)}function FH({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function IH({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function LH(e,t,n=!1){return!n&&e==null&&t}function RH(e,t,n=!1){return e==null&&t&&!n}function zH(e){if(e!=null&&e.type===`element`)return e.children??[]}var BH=3e3,VH=new Map,HH=-1,UH=class extends MH{__id=`little-virtualized-file-diff:${++HH}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:VH,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=HI(n)}setMetrics(e,t=!1){let n=HI(e);(t||!eR(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 fR(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=!tR(t,e),r=n&&ZH(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:QH(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=VH,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()??VH);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&&mR(this.renderRange)){let t=WH(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=nU(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=HI(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=UI(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return oL({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=iL({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=aL({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??UI(this.metrics,n)+this.cache.fileAnnotationHeight,u;return oL({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=iL({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=aL({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||!RI(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=uB(`clone`,e,t);if(await eB(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(uB(`merge`,e,t),this.setHydratedState(t),!this.startHydratedEditSession(e)&&(await eB(()=>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 QI({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,!RI(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()??VH);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=UI(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}=tB({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:$H(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=iB(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!tU(s,this.deletionFile)||!tU(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=oV(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!RI(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:!RI(a,o),renderedDiffChanged:!RI(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 eU(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=$H(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=GH(this.cache.heightDeltas),u=UI(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=JH(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+YH(i,e)*this.metrics.lineHeight+KH(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=BH}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+KH(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=JI({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?iL({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?ZI({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?aL({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:XH({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}=JI({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=ZI({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=$H(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=UI(this.metrics,i),h=e.hunks.length>0?GI(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,k,re;if(oL({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?iL({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),re!=null)){if(re<=0)return!0;re--}let S=this.getLineHeight(l===`split`?m:h,g);if(ee>n-S&&ee<r&&(ne??=x),k==null&&ee+S>D&&(k=x),re==null&&ee>=r&&b&&(re=T),te++,ee+=S,c>0||v&&d){let e=aL({type:u,metrics:this.metrics});e!=null&&(ee<r&&ee+e.totalHeight>n&&(ne??=x),k==null&&ee+e.totalHeight>D&&(k=x),ee+=e.totalHeight)}return!1}}),ne==null){if(x)ne=0,k=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}k??=ne;let ie=Math.round(k-w/2),ae=Math.max(0,Math.ceil(p/s)-w),oe=Math.max(0,Math.min(ie,ae)),se=oe*s,A=ie<0?C+ie*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 WH(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===dR&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function GH(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 KH({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=qH(e,n);return(t[qH(e,r)]??0)-(t[i]??0)}function qH(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 JH(e){return Math.ceil(e/BH)*BH}function YH(e,t){let n=0;for(let r of e)r<t&&n++;return n}function XH({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 ZH(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 QH(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 $H(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function eU(e){return typeof e==`function`?`custom`:e??`line-info`}function tU(e,t){return e==null||t==null?e==null&&t==null:zI(e,t)}function nU(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function rU(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 iU=(0,q.createContext)(void 0);function aU(){return(0,q.useContext)(iU)}var oU=typeof window>`u`?q.useEffect:q.useLayoutEffect;function sU({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=aU(),h=a!==void 0,g=(0,q.useContext)($L),_=dw(),v=cw(e=>f?.(e)),y=f==null?void 0:v,b=(0,q.useRef)(null),x=cw(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=cw(()=>{if(_==null)throw Error(`File: EditContext is not attached`);return _(`file`,n??{},r)}),E=cw(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 Gz(lU({controlledSelection:h,hasCustomHeader:l,hasGutterRenderUtility:c,onEditChange:y,onEditComplete:S,options:t}),u?void 0:g,!0):C.current=new Qz(lU({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=uU(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 oU(()=>{let{current:n}=C;if(n==null)return;let r=lU({controlledSelection:h,hasCustomHeader:l,hasGutterRenderUtility:c,onEditChange:y,onEditComplete:S,options:t}),o=r!==void 0&&!tR(n.options,r);if(n.setOptions(r),!d&&w.current!=null){let{current:e}=w;w.current=null,e()}let s=cU(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=uU(n,T))}),{ref:E,getHoveredLine:(0,q.useCallback)(()=>C.current?.getHoveredLine(),[]),getAnnotationSlotName:(0,q.useCallback)(e=>C.current?.getAnnotationSlotName(e)??Lw(e),[])}}function cU(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&&(uR(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 lU({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?mw:e?.renderCustomHeader,renderGutterUtility:r?mw:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}:e}function uU(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function dU({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}=sU({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=Gw({file:e,renderAnnotation:l,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderGutterUtility:h,lineAnnotations:t,getHoveredLine:x,getAnnotationSlotName:S});return(0,J.jsx)(hw,{ref:b,className:s,style:c,children:rU(C,m)})}var fU=typeof window>`u`?q.useEffect:q.useLayoutEffect;function pU({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=aU(),_=s!==void 0,v=(0,q.useContext)($L),y=dw(),b=cw(e=>m?.(e)),x=m==null?void 0:b,S=(0,q.useRef)(null),C=cw(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=mU({acceptedCache:S,fileDiff:e,newFile:n,oldFile:t,parseDiffOptions:r?.parseDiffOptions}),E=(0,q.useRef)(null),D=(0,q.useRef)(null),O=cw(()=>{if(y==null)throw Error(`FileDiff: EditContext is not attached`);return y(`file-diff`,i??{},a)}),ee=cw(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 MH(_U({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),f?void 0:v,!0):E.current=new UH(_U({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),g,l,f?void 0:v,!0),p&&D.current==null&&(D.current=vU(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 fU(()=>{let{current:e}=E;if(e==null)return;let t=_U({controlledSelection:_,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:x,onEditComplete:w,options:r}),n=t!==void 0&&!tR(e.options,t);if(e.setOptions(t),!p&&D.current!=null){let{current:e}=D;D.current=null,e()}let i=gU(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=vU(e,O))}),{fileDiff:T,ref:ee,getHoveredLine:(0,q.useCallback)(()=>E.current?.getHoveredLine(),[]),getAnnotationSlotName:(0,q.useCallback)(e=>E.current?.getAnnotationSlotName(e)??Lw(e),[])}}function mU({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(hU(r,n,o.stale)||hU(r,n,o.installed))return o.fileDiff;a.filePair=null}return oV(r??null,n??null,i)},[e,t,r,n,i])}function hU(e,t,n){return uR(e??void 0,n.oldFile??void 0)&&uR(t??void 0,n.newFile??void 0)}function gU(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&&(RI(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 _U({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?mw:e?.renderCustomHeader,renderGutterUtility:r?mw:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}:e}function vU(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function yU(e){let t=LB(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 bU({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=xU(e),{ref:x,getHoveredLine:S,getAnnotationSlotName:C}=pU({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=Uw({fileDiff:b,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderAnnotation:u,lineAnnotations:a,renderGutterUtility:h,getHoveredLine:S,getAnnotationSlotName:C});return(0,J.jsx)(hw,{ref:x,className:s,style:c,children:rU(w,l)})}function xU(e){return(0,q.useMemo)(()=>yU(e),[e])}var SU=`~effect/http/HttpClientError`,CU=class e extends qx(SU)({_tag:vx(`HttpError`),kind:px([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:Zb(Px())}){static fromHttpClientError(t){return new e({_tag:`HttpError`,kind:t.reason._tag,cause:t.reason})}},wU=`~effect/PrimaryKey`,TU=`~effect/socket/Socket`,EU=or(`effect/socket/Socket`),DU=e=>EU.of({[TU]:TU,reader:e.reader,writer:e.writer}),OU=new TextEncoder,kU=`~effect/socket/Socket/CloseEvent`,AU=e=>A(e,kU),jU=`~effect/socket/Socket/SocketError`,MU=e=>A(e,jU),NU=class extends qx(`effect/socket/Socket/SocketReadError`)({_tag:vx(`SocketReadError`),cause:Px()}){message=`An error occurred during Read`},PU=class extends qx(`effect/socket/Socket/SocketWriteError`)({_tag:vx(`SocketWriteError`),cause:Px()}){message=`An error occurred during Write`},FU=class extends qx(`effect/socket/Socket/SocketOpenError`)({_tag:vx(`SocketOpenError`),kind:px([`Unknown`,`Timeout`]),cause:Px()}){get message(){return this.kind===`Timeout`?`timeout waiting for "open"`:`An error occurred during Open`}},IU=class e extends qx(`effect/socket/Socket/SocketUpgradeError`)({_tag:vx(`SocketUpgradeError`),cause:Zb(Px())}){static unsupported=()=>U(new zU({reason:new e({})}));get message(){return this.cause===void 0?`Socket does not support TLS upgrade`:`An error occurred during TLS upgrade`}},LU=class extends qx(`effect/socket/Socket/SocketCloseError`)({_tag:vx(`SocketCloseError`),code:Dx,closeReason:Zb(rx)}){get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}},RU=fx([NU,PU,FU,IU,LU]),zU=class extends Jx(jU)(`SocketError`,{_tag:vx(`SocketError`),reason:RU}){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[jU]=jU;static is(e){return MU(e)}message=this.reason.message},BU=(e,t)=>new zU({reason:new LU({code:e,closeReason:t})}),VU=class extends or()(`@effect/platform/Socket/WebSocketConstructor`){},HU=nd(VU)((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)}),UU=(e,t)=>VU.use(n=>GU(Of((typeof e==`string`?H(e):e).pipe(nf(e=>n(e,t?.protocols))),e=>Ud(()=>e.close(1e3))),t)),WU=e=>`pause`in e&&typeof e.pause==`function`,GU=(e,t)=>Zd(n=>{let r,i=sp(!1),a=n.context,o=qd(function*(){let n=yield*Tf,a=yield*Lu(e,n);`binaryType`in a&&(a.binaryType=`arraybuffer`);let o=WU(a),s=t?.highWaterMark??(o?KU: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(H(_()))}function y(e){u.push(e),s!==void 0&&(d+=typeof e==`string`?OU.encode(e).byteLength:e.byteLength),p!==void 0&&v(),o&&d>=s?h():!o&&!p&&s!==void 0&&d>s&&b(new zU({reason:new NU({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(U(f))}if(p!==void 0){let e=p;p=void 0,e(u.length>0?H(_()):U(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 zU({reason:new NU({cause:e})}))});return}y(t instanceof ArrayBuffer?new Uint8Array(t):t)}function S(e){b(new zU({reason:c?new NU({cause:e}):new FU({kind:`Unknown`,cause:e})}))}function C(e){b(BU(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*zu(n,Ud(()=>{if(b(BU(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*U(f??BU(1006)):(c||=(yield*Gd(e=>{let t=()=>{m?.resume===e&&(m=void 0,a.removeEventListener(`open`,t),e(Wd))},n=()=>a.removeEventListener(`open`,t);return m={resume:e,cleanup:n},a.addEventListener(`open`,t,{once:!0}),Ud(()=>{m?.resume===e&&(m=void 0),n()})}).pipe(pf({duration:t?.openTimeout??1e4,orElse:()=>U(new zU({reason:new FU({kind:`Timeout`,cause:Error(`timeout waiting for "open"`)})}))})),!0),f===void 0&&d<s&&g(),r=a,i.openUnsafe(),{pull:Gd(e=>u.length>0?e(H(_())):f===void 0?(p=e,Ud(()=>{p===e&&(p=void 0)})):e(U(f))),upgrade:IU.unsupported})}).pipe(Cf(e=>Lr(a,e))),s=e=>Hd(()=>{let t=r;if(t===void 0)return i.whenOpen(s(e));try{return AU(e)?t.close(e.code,e.reason):t.send(e),Wd}catch(e){return U(new zU({reason:new PU({cause:e})}))}}),c=e=>Hd(()=>{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 Wd}catch(e){return U(new zU({reason:new PU({cause:e})}))}});return H(DU({reader:o,writer:H({write:s,writeAll:c})}))}),KU=65536,qU=(e,t)=>id(EU,UU(e,t)).pipe(cd(JU)),JU=HU,YU=fx([class extends qx(`effect/workers/WorkerError/WorkerSpawnError`)({_tag:vx(`WorkerSpawnError`),message:rx,cause:Zb(Px())}){},class extends qx(`effect/workers/WorkerError/WorkerSendError`)({_tag:vx(`WorkerSendError`),message:rx,cause:Zb(Px())}){},class extends qx(`effect/workers/WorkerError/WorkerReceiveError`)({_tag:vx(`WorkerReceiveError`),message:rx,cause:Zb(Px())}){},class extends qx(`effect/workers/WorkerError/WorkerUnknownError`)({_tag:vx(`WorkerUnknownError`),message:rx,cause:Zb(Px())}){}]),XU=class extends or()(`effect/workers/Transferable/Collector`){},ZU=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return XU.of({addAllUnsafe:t,addAll:e=>Ud(()=>t(e)),readUnsafe:n,read:Ud(n),clearUnsafe:r,clear:Ud(r)})},QU=`~effect/rpc/RpcSchema/StreamSchema`;function $U(e){return A(e,QU)}function eW(e){return $U(e)?qn({success:e.success,error:e.error}):Kn()}var tW=Pb(yh);function nW(e,t){return Jb(tW.ast,{[QU]:QU,success:e,error:t})}var rW=`~effect/rpc/Rpc`,iW={[rW]:rW,pipe(){return u(this,arguments)},setSuccess(e){return aW({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return aW({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return aW({_tag:this._tag,payloadSchema:Yb(e)?e:cx(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return aW({_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 aW({_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 aW({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Dr(this.annotations,e,t)})},annotateMerge(e){return aW({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Lr(this.annotations,e)})}},aW=e=>{function t(){}return Object.setPrototypeOf(t,iW),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},oW=(e,t)=>{let n=t?.success??ox,r=t?.error??$b,i=t?.defect??Px(),a;return a=t?.primaryKey?class extends Kx(`effect/rpc/Rpc/${e}`)(t.payload){[wU](){return t.primaryKey(this)}}:Yb(t?.payload)?t?.payload:t?.payload?cx(t?.payload):ox,aW({_tag:e,payloadSchema:a,successSchema:t?.stream?nW(n,r):n,errorSchema:t?.stream?$b:r,defectSchema:i,annotations:wr(),middlewares:new Set})},sW=new WeakMap,cW=e=>{if(sW.has(e))return sW.get(e);let t=e,n=new Set([t.errorSchema]),r=eW(t.successSchema);Xn(r)&&n.add(r.value.error);for(let e of t.middlewares)n.add(e.error);let i=Lx(Xn(r)?ox:t.successSchema,fx([...n]),t.defectSchema);return sW.set(e,i),i},lW=`~effect/rpc/Rpc/Wrapper`,uW=e=>lW in e,dW=`~effect/rpc/RpcClientError`,fW=class extends qx(`effect/rpc/RpcClientError/RpcClientDefect`)({_tag:vx(`RpcClientDefect`),message:rx,cause:Px()}){},pW=class extends qx(dW)({_tag:vx(`RpcClientError`),reason:fx([YU,RU,CU,fW])}){[dW]=dW;get message(){return`${this.reason._tag}: ${this.reason.message}`}},mW=e=>e,hW={_tag:`Ping`},gW=Yx,_W=class extends or()(`effect/rpc/RpcSerialization`){},vW=class extends sa(`MaxBufferSizeExceeded`){get message(){return`RPC serialization buffer exceeded the maximum size of ${this.maxBufferSize}`}},yW=16777216,bW=(e,t)=>t!==`unbounded`&&e>t,xW=(e=>{let t=e?.maxBufferSize??yW;return _W.of({contentType:`application/ndjson`,includesFraming:!0,codecFor:gW,makeUnsafe:()=>{let e,n=``,r=e=>{throw n=``,new vW({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;){bW(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),bW(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
|
-
`}}}})})(),SW=nd(_W)(xW),CW=e=>Hd(()=>{let t=new Set,n=new Map,r=new Map,i=(e,t)=>yf(r=>{let i=n.get(e);return i||(i=[],n.set(e,i)),i.push([t,r]),Wd});return nf(e((e,t)=>{let n=r.get(e);return n?n(t):i(e,t)},t),e=>({...e,run(e,i){return qd(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*xf(Hd(()=>i(e)),t)}return yield*jf(Kd,()=>(t.delete(e),r.delete(e),Wd))})}}))}),wW=0,TW=Jf(function*(e,t){let n=t?.spanPrefix??`RpcClient`,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>wW++),o=yield*vf(),s=Mr(o,Fu),c=new Map,l=!1;yield*zu(s,Zd(e=>(l=!0,u(Su(e.id)))));let u=Jf(function*(e){for(let[t,n]of c)c.delete(t),n._tag===`Queue`?yield*e._tag===`Success`?Kp(n.queue):Wp(n.queue,e.cause):n.resume(e)}),d=e=>{let r=$U(e.successSchema),a=h(e);return(o,s)=>{let c=s?.headers?hg(s.headers):mg,l=s?.context??wr();if(!r){let r=t=>f(e,a,t,e.payloadSchema.make(o),c,l,s?.discard??!1);return i?r(void 0):Rf(`${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:Oh(nf(u,Eh))}},f=(e,n,r,i,o,s,u)=>Zd(d=>{if(l)return Mf;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:gg(d.getRef(kW),o)});if(u)return p;let h;return Pf(Gd(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,Uf(d.context)),h.addObserver(e=>{if(e._tag===`Failure`)return t(e)})}),e=>(c.delete(f),$d(ip(h),g(f,Array.from(e),s))))}),p=Jf(function*(e,r,o,s,u,d){if(l)return yield*Mf;let f=i?void 0:yield*Lf(`${n}.${e._tag}`,{attributes:t.spanAttributes}),p=ap(),h=a(),_=jr(p.context,Fu);yield*Ru(_,e=>c.has(h)?(c.delete(h),g(h,Tu(e)?Array.from(pu(e.cause)):[],d)):Wd);let v=yield*zp(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:gg(p.getRef(kW),s)}).pipe(f?zf(f,{captureStackTrace:!1}):m,Af(e=>Wp(v,e)),Nf,Bf(_,{startImmediately:!0})),v}),h=e=>{let t=[];for(let n of e.middlewares.values()){let e=Ar(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)=>Gd(i=>{let a=ap();t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r,discard:!1}).pipe(ff(1e3),Uf(a.context)).addObserver(()=>{i(Wd)})}),_=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Queue`?Wd:Hp(i.queue,e.values).pipe(r?W(()=>t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context,discard:!1})):m,of(e=>Wp(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),Wd):e.exit._tag===`Success`?Kp(n.queue):Wp(n.queue,e.exit.cause)):Wd}case`Defect`:return u(xu(e.defect));case`ClientEnd`:return Wd}},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=>{mt(v,e._tag,d(e))});return{client:v,write:_}}),EW=0,DW=Jf(function*(e,t){let n=EW++,{codecFor:r,run:i,send:a,supportsAck:o,supportsTransferables:s}=yield*AW,c=OW(r),l=Ub(r(Px())),u=new Map,{client:d,write:f}=yield*TW(e,{...t,supportsAck:o,onFromClient({message:t}){switch(t._tag){case`Request`:{let r=e.requests.get(t.tag),i=s?ZU():void 0,o=ap(),l={rpc:r,context:i?Dr(o.context,XU,i):o.context,schemas:c(r)};return u.set(t.id,l),l.schemas.encodePayload(t.payload).pipe(xf(l.context),sf,W(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}):Wd;case`Interrupt`:return u.get(t.requestId)?(u.delete(t.requestId),a(n,{_tag:`Interrupt`,requestId:t.requestId})):Wd;case`Eof`:return Wd}}});return yield*i(n,e=>{switch(e._tag){case`Chunk`:{let t=mW(e.requestId),n=u.get(t);return!n||Yn(n.schemas.decodeChunk)?Wd:n.schemas.decodeChunk.value(e.values).pipe(xf(n.context),sf,W(t=>f({_tag:`Chunk`,clientId:0,requestId:mW(e.requestId),values:t})),Af(t=>f({_tag:`Exit`,clientId:0,requestId:mW(e.requestId),exit:yu(t)})))}case`Exit`:{let t=mW(e.requestId),n=u.get(t);return n?(u.delete(t),n.schemas.decodeExit(e.exit).pipe(xf(n.context),sf,_f({onSuccess:e=>f({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>f({_tag:`Exit`,clientId:0,requestId:t,exit:yu(e)})}))):Wd}case`Defect`:return f({_tag:`Defect`,clientId:0,defect:l(e.defect)});case`ClientProtocolError`:{let t=bu(e.error);return zd(u.keys(),e=>f({_tag:`Exit`,clientId:0,requestId:e,exit:t}))}default:return Wd}}).pipe(of(Yf),Nf,Vf),d}),OW=e=>{let t=new WeakMap;return n=>{let r=t.get(n);return r===void 0?(r={decodeChunk:nr(eW(n.successSchema),t=>Vb(e(ux(t.success)))),encodePayload:Gb(e(n.payloadSchema)),decodeExit:Vb(e(cW(n)))},t.set(n,r),r):r}},kW=zr(`effect/rpc/RpcClient/CurrentHeaders`,{defaultValue:()=>mg}),AW=class extends or()(`effect/rpc/RpcClient/Protocol`){static make=CW},jW=e=>AW.make(Jf(function*(t,n){let r=yield*EU,i=yield*_W,a=yield*Sf(FW),o=new Map,s=yield*r.writer,c=i.makeUnsafe(),l=yield*NW(Hd(()=>s.write(c.encode(hW)))),u,d=e=>zd(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 Wd;let r=0;return Bd({while:()=>r<n.length,body:()=>{let e=n[r++];if(e._tag===`Pong`)return l.onPong(),Wd;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 pW({reason:new fW({message:`Error decoding message`,cause:e})})})}};return yield*Hd(()=>(c=i.makeUnsafe(),l.reset(),qd(function*(){let{pull:e}=yield*r.reader;for(u=void 0,Xn(a)&&(yield*a.value.onConnect);;){let t=yield*e;for(let e=0;e<t.length;e++)yield*p(t[e])}}).pipe(Ef,hf(W(l.timeout,()=>U(new zU({reason:new FU({kind:`Timeout`,cause:Error(`ping timeout`)})}))))))).pipe(Xn(a)?kf(a.value.onDisconnect):m,cf(t=>{let n=fu(t),r=Gr(n),i=new pW({reason:r?n.success.reason:new fW({message:`Unknown socket error`,cause:du(t)})});return e?.retryTransientErrors&&r&&n.success.reason._tag===`SocketOpenError`?(e.onTransientError?.(i)??Wd).pipe(df({log:!0,message:`RpcClient onTransientError hook failed`})):f(i)}),lf(e?.retryPolicy??MW,e=>f(new pW({reason:e.reason}))),Xf({module:`RpcClient`,method:`makeProtocolSocket`}),Vf),{send(e,t){if(u)return U(u);t._tag===`Request`&&o.set(t.id,e);let n=c.encode(t);return n===void 0?Wd:sf(s.write(n))},supportsAck:!0,supportsTransferables:!1,codecFor:i.codecFor}})),MW=jd([Nd(500,1.5),Pd(5e3)]),NW=Jf(function*(e){let t=!0,n=sp();return yield*Hd(()=>t?(t=!1,e):n.open).pipe(mf(`5 seconds`),uf,If,Nf,Vf),{timeout:n.await,reset:()=>{t=!0,n.closeUnsafe()},onPong:()=>{t=!0}}}),PW=e=>id(AW)(jW(e)),FW=class extends or()(`effect/rpc/RpcClient/ConnectionHooks`){},IW=()=>(e,t)=>{let n=or()(e),r=id(n,t.makeEffect??DW(t.group,{...t,flatten:!0}));n.runtime=(t.runtime??SC)(typeof t.protocol==`function`?e=>cd(r,ud(t.protocol(e))):cd(r,ud(t.protocol))),n.mutation=MC(e=>{let r=t.group.requests.get(e);return n.runtime.fn()(Jf(function*({headers:t,payload:r,reactivityKeys:i}){let a=(yield*n)(e,r,{headers:t});return yield*i?tS(a,i):a})).pipe(zC({key:`AtomRpc:mutation:${e}`,schema:jS({success:r.successSchema,error:LW(r)})}))});let i=MC(e=>{let{headers:r,payload:i,reactivityKeys:a,tag:o,timeToLive:s}=e,c=t.group.requests.get(o),l=$U(c.successSchema),u=l?n.runtime.pull(Oh(n.use(e=>H(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:jS({success:c.successSchema,error:LW(c)})})),s&&(u=Oi(s)?rC(u,s):NC(u)),u});return n.query=(e,t,n)=>{let r={tag:e,payload:t,headers:n?.headers?hg(n.headers):void 0,reactivityKeys:n?.reactivityKeys,timeToLive:n?.timeToLive===void 0?void 0:bi(n.timeToLive),serializationKey:n?.serializationKey};return i(r)},n},LW=e=>fx([e.errorSchema,...Array.from(e.middlewares,e=>e.error),pW]),RW={add(...e){let t=new Map(this.requests);for(let n of e)t.set(n._tag,n);return zW({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 zW({requests:t,annotations:yr(n)})},omit(...e){let t=new Map(this.requests);for(let n of e)t.delete(n);return zW({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 zW({requests:t,annotations:this.annotations})},toHandlers(e){let t=this;return qd(function*(){let n=yield*vf(),r=Rd(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})}),yr(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 zW({requests:t,annotations:this.annotations})},toLayer(e){return V(this.toHandlers(e))},of:m,toLayerHandler(e,t){let n=this;return V(qd(function*(){let r=yield*vf(),i=Rd(t)?yield*t:t,a=new Map,o=n.requests.get(e);return a.set(o.key,{handler:i,context:r}),yr(a)}))},accessHandler(e){return yf(t=>{let n=this.requests.get(e),{handler:r,context:i}=Ar(t,n.key);return H((e,t)=>{t.rpc=n;let a=r(e,t),o=uW(a)?a.value:a;return Rd(o)?bf(o,i):Lh(o,i)})})},annotate(e,t){return zW({requests:this.requests,annotations:Dr(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(Er(e,t))},annotateMerge(e){return zW({requests:this.requests,annotations:Lr(this.annotations,e)})},annotateRpcsMerge(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.annotateMerge(Lr(e,r.annotations)));return zW({requests:t,annotations:this.annotations})}},zW=e=>Object.assign(function(){},RW,{requests:e.requests,annotations:e.annotations}),BW=(...e)=>zW({requests:new Map(e.map(e=>[e._tag,e])),annotations:wr()}),VW=sw(),HW=px([`additions`,`deletions`]),UW=Dx.check(Tx(0)),WW=cx({id:rx,filePath:rx,side:HW,line:UW,summary:rx,rationale:Xb(rx),author:rx,createdAt:rx}),GW=cx({filePath:Ax,newLine:Xb(UW),oldLine:Xb(UW),summary:Ax,rationale:Xb(rx),author:Xb(rx)});fx([lx(GW),cx({comments:lx(GW)})]);var KW=cx({repo:rx,branch:rx,range:lx(rx),patch:rx,notes:lx(WW),version:rx,watching:ax,updatedAt:rx}),qW={file:rx,start:Xb(UW),end:Xb(UW),side:HW,text:Xb(rx)};cx(qW);var JW={...qW,title:Xb(rx),body:Xb(rx)};cx(JW);var YW=fx([cx({type:Qb(`show`),...qW}),cx({type:Qb(`highlight`),...qW}),cx({type:Qb(`explain`),speak:Xb(ax),...JW}),cx({type:Qb(`say`),text:rx,speak:Xb(ax)}),cx({type:Qb(`clear`)})]),XW=lx(YW),ZW=fx([YW,cx({type:Qb(`tour`),steps:XW}),cx({type:Qb(`next`)}),cx({type:Qb(`back`)}),cx({type:Qb(`goto`),index:Dx})]),QW=cx({file:mx(rx),activeNote:mx(rx),tourStep:mx(Dx),explaining:mx(rx)}),$W=cx({id:Dx,text:rx,at:rx,handled:ax}),eG=class extends Jx()(`FileMissing`,{side:px([`old`,`new`]),path:rx}){},tG=BW(oW(`Snapshots`,{success:KW,stream:!0}),oW(`File`,{payload:{side:px([`old`,`new`]),path:Ax},success:rx,error:eG}),oW(`Send`,{payload:{command:ZW},success:cx({delivered:Dx})}),oW(`Commands`,{success:ZW,stream:!0}),oW(`ReportView`,{payload:{view:QW}}),oW(`View`,{success:mx(QW)}),oW(`Utter`,{payload:{text:Ax,handled:ax},success:$W}),oW(`Listen`,{payload:{after:Xb(Dx)},success:lx($W),stream:!0})),nG=`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/rpc`,rG=PS(),iG=pC(!1).pipe(NC),aG=nd(FW,{onConnect:Ud(()=>rG.set(iG,!0)),onDisconnect:Ud(()=>rG.set(iG,!1))}),oG=class extends IW()(`SidediffClient`,{group:tG,protocol:PW({retryTransientErrors:!0}).pipe(cd([qU(nG),SW,aG]))}){},sG=e=>e.pipe(kh(e=>({kind:`value`,value:e})),Ph(()=>wh({kind:`lost`})),jh(Pd(Li(1)))),cG=oG.runtime.atom(sG(Oh(oG.use(e=>H(e(`Snapshots`,void 0))))).pipe(Fh(()=>null,(e,t)=>t.kind===`value`?t.value:e))).pipe(NC),lG=oG.runtime.atom(sG(Oh(oG.use(e=>H(e(`Commands`,void 0))))).pipe(Nh(e=>e.kind===`value`),kh(e=>e.value),Mh,kh(([e,t])=>({command:e,sequence:t})))),uG=(e,t,n)=>JSON.stringify([e,t,n]),dG=MC(e=>{let[,t,n]=JSON.parse(e);return oG.runtime.atom(oG.use(e=>e(`File`,{side:t,path:n}))).pipe(rC(Ri(10)))}),fG=()=>{let e=rG.get(cG);return e._tag===`Success`?e.value?.version??``:``},pG=(e,t)=>Gf(IS(rG,dG(uG(fG(),e,t)))),mG=(e,t)=>pG(t===`deletions`?`old`:`new`,e).catch(()=>null),hG=pC(``),gG=oG.mutation(`ReportView`),_G=oG.mutation(`Utter`),vG=e=>rG.set(gG,{payload:{view:e}}),yG=(e,t)=>e.trim().length===0?void 0:rG.set(_G,{payload:{text:e.trim(),handled:t}});function bG(e,t){try{let n=fF({name:e,load:t});lT.registerTheme(n.name,n.load)}catch(t){if(t instanceof aT){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}throw t}}var xG={"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`}},SG=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`}}]}),CG=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}),wG=()=>Object.values(xG).forEach(e=>bG(e.name,()=>Promise.resolve(SG(e)))),TG=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
|
-
`,EG=8,DG=pG,OG=async e=>{let t=e.previousPath??e.path,[n,r]=await Promise.all([DG(`old`,t),DG(`new`,e.path)]);return{oldFile:{name:t,contents:n},newFile:{name:e.path,contents:r}}},kG=({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))})]})},AG=(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)+EG;return[...e,{id:t,top:Math.max(r,a)}]},[]),jG=({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})]}),MG=(0,q.memo)(function({file:e,notes:t,diffStyle:n,palette:r,showNotes:i,collapsed:a,viewed:o,activeNote:s,selection:c,pinned:l,onToggle:u,onViewed:d,onFocusNote:f}){let p=(0,q.useRef)(null),m=(0,q.useRef)(null),h=(0,q.useRef)(new Map),[g,_]=(0,q.useState)([]),[v,y]=(0,q.useState)(!1),b=(0,q.useRef)(null),x=(0,q.useRef)(null),S=v||l;(0,q.useEffect)(()=>{let e=p.current;if(e===null)return;let t=new IntersectionObserver(([e])=>{e!==void 0&&(!e.isIntersecting&&x.current&&(b.current=x.current.offsetHeight),y(e.isIntersecting))},{root:e.closest(`main`),rootMargin:`1800px 0px`});return t.observe(e),()=>t.disconnect()},[]);let C=b.current??Math.max(80,(e.additions+e.deletions+12)*20),w=(0,q.useMemo)(()=>({diffStyle:n,theme:r,themeType:`dark`,disableFileHeader:!0,overflow:`wrap`,lineDiffType:`word-alt`,diffIndicators:`classic`,unsafeCSS:TG(xG[r]),hunkSeparators:`line-info`,expansionLineCount:20,loadDiffFiles:()=>OG(e)}),[n,r,e]),T=(0,q.useMemo)(()=>i?t.map(e=>({side:e.side,lineNumber:e.line,metadata:{id:e.id}})):[],[t,i]),E=(0,q.useCallback)((e,t)=>{t?h.current.set(e,t):h.current.delete(e)},[]),D=(0,q.useCallback)(()=>{let e=p.current,n=m.current;if(e===null||n===null)return;let r=n.getBoundingClientRect().top,i=AG(t,t=>{let n=e.querySelector(`[data-note-anchor="${t}"]`);return n===null?null:n.getBoundingClientRect().top-r},e=>h.current.get(e)?.offsetHeight??64);_(e=>e.length===i.length&&e.every((e,t)=>e.id===i[t]?.id&&e.top===i[t]?.top)?e:i)},[t]);(0,q.useLayoutEffect)(()=>{let e=p.current;if(e===null||!i||a||!S)return;D();let t=new ResizeObserver(()=>D()),n=new MutationObserver(()=>D());return t.observe(e),n.observe(e,{childList:!0}),()=>{t.disconnect(),n.disconnect()}},[D,i,a,S]);let O=e=>g.find(t=>t.id===e)?.top??0,ee=g.reduce((e,t)=>Math.max(e,t.top+(h.current.get(t.id)?.offsetHeight??64)),0);return(0,J.jsxs)(`section`,{ref:p,className:`file`,id:`file-${e.path}`,children:[(0,J.jsxs)(`div`,{className:o?`file-header viewed`:`file-header`,children:[(0,J.jsx)(`button`,{className:`chevron`,"aria-label":a?`Expand file`:`Collapse file`,onClick:()=>u(e.path),children:a?`▸`:`▾`}),(0,J.jsx)(kG,{additions:e.additions,deletions:e.deletions}),(0,J.jsx)(`span`,{className:`file-path`,onClick:()=>u(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`}),t.length>0&&(0,J.jsxs)(`span`,{className:`note-count`,children:[t.length,` notes`]}),(0,J.jsxs)(`label`,{className:o?`viewed-toggle checked`:`viewed-toggle`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:o,onChange:t=>d(e,t.target.checked)}),`Viewed`]})]}),!a&&!S&&(0,J.jsx)(`div`,{className:`file-placeholder`,style:{height:C}}),!a&&S&&(0,J.jsxs)(`div`,{ref:x,className:i?`file-body with-notes`:`file-body`,children:[(0,J.jsx)(`div`,{className:`diff`,children:(0,J.jsx)(bU,{patch:e.patch,disableWorkerPool:!0,options:w,lineAnnotations:T,selectedLines:c,renderAnnotation:e=>(0,J.jsx)(`div`,{className:e.metadata.id===s?`anchor active`:`anchor`,"data-note-anchor":e.metadata.id,onClick:()=>f(e.metadata.id)})})}),i&&(0,J.jsx)(`div`,{ref:m,className:`notes-column`,style:{minHeight:ee},children:t.map(e=>(0,J.jsx)(jG,{note:e,top:O(e.id),active:e.id===s,onFocus:f,measureRef:E},e.id))})]})]})}),NG={highlight:null,explanation:null,caption:null,tour:null},PG=e=>{`speechSynthesis`in window&&e.trim().length!==0&&(window.speechSynthesis.cancel(),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)))},FG=e=>document.getElementById(`file-${e}`)?.querySelector(`diffs-container`)?.shadowRoot??null,IG=e=>{let t=FG(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]})},LG=(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})})}),RG=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=LG(IG(e),e.text);CSS.highlights.set(`sidediff-text`,new Highlight(...t))},zG=e=>{e.forEach(e=>e.removeAttribute(`data-sidediff-flash`)),requestAnimationFrame(()=>e.forEach(e=>e.setAttribute(`data-sidediff-flash`,``)))},BG=e=>{let t=IG(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`}),zG(t),!0)},VG=mG,HG=e=>{let[t,n]=(0,q.useState)(NG),r=(0,q.useRef)(t);r.current=t;let i=(0,q.useCallback)(t=>{e(t.file);let n=e=>requestAnimationFrame(()=>{let i=BG(t);RG(r.current.highlight),!i&&e>0&&setTimeout(()=>n(e-1),150)});n(20)},[e]),a=(0,q.useCallback)(e=>e.type===`clear`?(RG(null),window.speechSynthesis?.cancel(),n(e=>({...NG,tour:e.tour}))):e.type===`say`?(e.speak&&PG(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&&PG([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`&&VG(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 ew(lG),tw(lG,l),(0,q.useEffect)(()=>{let e=setTimeout(()=>RG(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(()=>NG),[])}},UG=()=>{let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null},WG=e=>rG.set(hG,e),GG=()=>QC(hG),KG=e=>{let t=(0,q.useRef)(e);t.current=e;let n=UG()!==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=UG();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())),WG(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(),WG(``),i(!1)},[]);return(0,q.useEffect)(()=>u,[u]),{supported:n,listening:r,error:a,start:l,stop:u}},qG=e=>{let[t,n]=(0,q.useState)(null);return(0,q.useEffect)(()=>{if(e===null)return n(null);let t={value:!1};return VG(e.file,e.side).then(e=>{t.value||n(e)}),()=>{t.value=!0}},[e]),t},JG=({explanation:e,palette:t,onClose:n})=>{let r=qG(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)(dU,{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:`${TG(xG[t])} :host { --diffs-font-size: 15px; --diffs-line-height: 24px; }`}})})]})})},YG=({state:e,palette:t,voice:n,onDismiss:r,onStep:i,onEndTour:a,onClearCaption:o})=>{let s=GG();return(0,J.jsxs)(J.Fragment,{children:[e.explanation&&(0,J.jsx)(JG,{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]})]})]})},XG=e=>{let t=/^diff --git a\/(.+?) b\/(.+)$/.exec(e);return{previousPath:t?.[1]??e,path:t?.[2]??e}},ZG=e=>{let t=e.split(`
|
|
1583
|
-
`),{path:n,previousPath:r}=XG(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}},QG=e=>e.split(/^(?=diff --git )/m).filter(e=>e.startsWith(`diff --git `)).map(e=>ZG(e.endsWith(`
|
|
1584
|
-
`)?e:`${e}\n`)),$G={added:`+`,deleted:`−`,renamed:`→`,modified:`•`},eK=({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:$G[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)(eK,{node:e,depth:t+1,notesByFile:n,isViewed:r,currentFile:i,onSelect:a},e.kind===`file`?e.file.path:e.path))]})},tK=({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)(eK,{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:[]},rK=(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,rK(a,i,n)]])}},iK=(e,t)=>[...[...e.directories.entries()].toSorted(([e],[t])=>e.localeCompare(t)).map(([e,n])=>aK(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}))],aK=(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:iK(t,n)}:aK(`${e}/${r[0]}`,r[1],`${n}/${r[0]}`)},oK=e=>iK(e.reduce((e,t)=>rK(e,t.path.split(`/`),t),nK),``),sK=e=>e.flatMap(e=>e.kind===`file`?[e.file]:sK(e.children)),cK=e=>Array.from(e).reduce((e,t)=>Math.imul(e,31)+t.charCodeAt(0)|0,7).toString(36),lK=e=>`sidediff:viewed:${e}`,uK=e=>{let t=localStorage.getItem(lK(e));if(t===null)return{};let n=JSON.parse(t);return typeof n==`object`&&n?n:{}},dK=e=>{let[t,n]=(0,q.useState)(()=>uK(e));return{isViewed:(0,q.useCallback)(e=>t[e.path]===cK(e.patch),[t]),setViewed:(0,q.useCallback)((t,r)=>n(n=>{let i=r?{...n,[t.path]:cK(t.patch)}:Object.fromEntries(Object.entries(n).filter(([e])=>e!==t.path));return localStorage.setItem(lK(e),JSON.stringify(i)),i}),[e])}},fK={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},pK=e=>{let t=e.find(e=>/^\d+$/.test(e));if(t!==void 0)return Number(t);let n=e.map(e=>fK[e]).filter(e=>e!==void 0);return n.length===0?null:n.reduce((e,t)=>e+t,0)},mK=e=>e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(e=>e.length>0),hK=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),gK=e=>e.replace(/s$/,``),_K=(e,t)=>{let n=new Set(e.map(gK)),r=t.filter(e=>!/\.(vitest\.)?test\.|\.stories\./.test(e)).map(e=>{let t=hK(e).map(gK),r=e.split(`/`).slice(0,-1).flatMap(e=>e.toLowerCase().split(/[-_.]/)).map(gK),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=>hK(e).map(gK).some(e=>n.has(e)&&!i.has(e)));return a.length===1?a[0]??null:null},vK=(e,...t)=>e.join(` `).includes(t.join(` `)),yK=(e,t)=>{let n=mK(e);if(n.length===0||n.length>8)return null;let r=n[0];if(n.length<=4&&vK(n,`stop`,`listening`))return{kind:`stop`};if(n.length<=4&&(vK(n,`mark`,`viewed`)||vK(n,`mark`,`as`,`viewed`)||vK(n,`mark`,`reviewed`)))return{kind:`viewed`,value:!0};if(n.length<=4&&(vK(n,`unmark`)||vK(n,`not`,`viewed`)))return{kind:`viewed`,value:!1};if(n.length<=3&&vK(n,`next`,`note`))return{kind:`note`,direction:1};if(n.length<=3&&(vK(n,`previous`,`note`)||vK(n,`last`,`note`)))return{kind:`note`,direction:-1};if(n.length<=3&&(vK(n,`split`)||vK(n,`side`,`by`,`side`)))return{kind:`layout`,style:`split`};if(n.length<=3&&(vK(n,`unified`)||vK(n,`inline`)))return{kind:`layout`,style:`unified`};if(n.length<=3&&vK(n,`hide`,`notes`))return{kind:`notes`,visible:!1};if(n.length<=3&&vK(n,`show`,`notes`))return{kind:`notes`,visible:!0};if(n.length<=4&&(vK(n,`expand`)||vK(n,`show`,`more`)))return{kind:`expand`};let i=n.slice(-3).join(` `);if(n.length<=3&&(vK(n,`next`)||vK(n,`move`,`on`)||vK(n,`continue`))||/(^| )(next( one| step| please)?|move on|go on|keep going)( please)?$/.test(i))return{kind:`next`};if(n.length<=3&&(vK(n,`back`)||vK(n,`previous`)||vK(n,`go`,`back`))||/(^| )(go back|previous( step)?|back one)( please)?$/.test(i))return{kind:`back`};if(n.length<=3&&(vK(n,`close`)||vK(n,`dismiss`)||vK(n,`hide`,`that`)))return{kind:`close`};if(n.length<=4&&vK(n,`scroll`,`down`))return{kind:`scroll`,direction:1,amount:`page`};if(n.length<=4&&vK(n,`scroll`,`up`))return{kind:`scroll`,direction:-1,amount:`page`};if(n.length<=3&&(vK(n,`top`)||vK(n,`beginning`)))return{kind:`top`};if(vK(n,`line`)){let e=pK(n.slice(n.indexOf(`line`)+1));if(e!==null)return{kind:`line`,line:e}}if(r===`open`||r===`show`||vK(n,`go`,`to`)||r===`jump`){let e=_K(n,t);if(e!==null)return{kind:`file`,path:e}}return null},bK=()=>{let e=QC(cG),t=QC(iG);return{snapshot:e._tag===`Success`?e.value:null,connected:t}},xK=e=>document.querySelector(`[data-note-anchor="${e}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}),SK=[],CK=()=>{let e=localStorage.getItem(`sidediff:palette`);return e!==null&&e in xG?e:`base16-tomorrow-night-eighties`},wK=()=>{let{snapshot:e,connected:t}=bK();return e===null?(0,J.jsx)(`div`,{className:`empty`,children:`Loading diff…`}):(0,J.jsx)(TK,{snapshot:e,connected:t})},TK=({snapshot:e,connected:t})=>{let[n,r]=(0,q.useState)(CK),{isViewed:i,setViewed:a}=dK(e.repo),[o,s]=(0,q.useState)(`split`),[c,l]=(0,q.useState)(!0),[u,d]=(0,q.useState)(new Map),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(null),[v,y]=(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);_(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 b=(0,q.useMemo)(()=>QG(e.patch),[e.patch]),x=(0,q.useMemo)(()=>oK(b.filter(e=>e.path.toLowerCase().includes(m.trim().toLowerCase()))),[b,m]),S=(0,q.useMemo)(()=>sK(oK(b)),[b]),C=(0,q.useMemo)(()=>sK(x),[x]),w=(0,q.useMemo)(()=>e.notes.reduce((e,t)=>({...e,[t.filePath]:[...e[t.filePath]??[],t]}),{}),[e.notes]),T=(0,q.useMemo)(()=>S.flatMap(e=>w[e.path]??[]),[S,w]),E=(0,q.useCallback)(e=>u.get(e.path)??!i(e),[u,i]),D=(e,t)=>d(n=>new Map([...n,[e,t]])),O=(0,q.useCallback)(e=>{let t=b.find(t=>t.path===e);t!==void 0&&D(e,!E(t))},[b,E]),ee=(0,q.useCallback)(e=>p(e),[]),te=(0,q.useCallback)((e,t)=>{a(e,t),d(t=>new Map([...t].filter(([t])=>t!==e.path)))},[a]),ne=(0,q.useCallback)(e=>{D(e,!0),y(e),requestAnimationFrame(()=>document.getElementById(`file-${e}`)?.scrollIntoView({behavior:`instant`,block:`start`}))},[]),k=HG((0,q.useCallback)(e=>{D(e,!0),y(e)},[]));(0,q.useEffect)(()=>{let e=document.querySelector(`main.files`);if(e===null)return;let t=new Map,n=()=>{let t=e.getBoundingClientRect().top;vG({file:[...e.querySelectorAll(`section.file`)].find(e=>e.getBoundingClientRect().bottom>t+40)?.id.replace(/^file-/,``)??null,activeNote:f,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)},[f,k.state.tour?.index,k.state.explanation]);let re=e=>{localStorage.setItem(`sidediff:palette`,e),r(e)},ie=(0,q.useCallback)(e=>{let t=T.findIndex(e=>e.id===f),n=T.at((t+e+T.length)%T.length);n!==void 0&&(p(n.id),xK(n.id))},[T,f]),ae=(0,q.useCallback)(e=>{let t=yK(e,b.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 yG(e,!1);if(t.kind===`stop`&&se.current?.stop(),t.kind===`note`&&ie(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=b.find(t=>`file-${t.path}`===e?.id);r&&t.kind===`viewed`&&te(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(),ne(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`})}yG(e,!0)},[b,k,ne,ie,te]),oe=KG(ae),se=(0,q.useRef)(oe);se.current=oe,(0,q.useEffect)(()=>{window.sidediffHear=ae},[ae]),(0,q.useEffect)(()=>{let e=e=>{e.target instanceof HTMLInputElement||(e.key===`n`&&ie(1),e.key===`p`&&ie(-1),e.key===`s`&&s(e=>e===`split`?`unified`:`split`),e.key===`a`&&l(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`&&(oe.listening?oe.stop:oe.start)())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ie,k,oe]);let A=S.filter(i).length,ce=S.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:CG(xG[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:S.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:[`+`,ce.additions]}),(0,J.jsxs)(`span`,{className:`del`,children:[`−`,ce.deletions]})]}),(0,J.jsxs)(`div`,{className:`progress`,title:`Files marked as viewed`,children:[(0,J.jsxs)(`span`,{children:[A,` / `,S.length,` files viewed`]}),(0,J.jsx)(`span`,{className:`bar`,children:(0,J.jsx)(`span`,{style:{width:`${S.length===0?0:A/S.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:()=>ie(-1),children:[`↑ `,(0,J.jsx)(`kbd`,{children:`p`})]}),(0,J.jsxs)(`button`,{onClick:()=>ie(1),children:[`↓ `,(0,J.jsx)(`kbd`,{children:`n`})]}),oe.supported&&(0,J.jsxs)(`button`,{className:oe.listening?`mic on`:`mic`,onClick:oe.listening?oe.stop:oe.start,children:[oe.listening?`● Listening`:`Talk`,` `,(0,J.jsx)(`kbd`,{children:`m`})]}),(0,J.jsx)(`select`,{value:n,onChange:e=>re(e.target.value),children:Object.keys(xG).map(e=>(0,J.jsx)(`option`,{value:e,children:e.replace(`base16-`,``)},e))})]})]}),(0,J.jsx)(tK,{tree:x,filter:m,onFilter:h,notesByFile:w,isViewed:i,currentFile:g,onSelect:ne}),(0,J.jsxs)(`main`,{className:`files`,children:[S.length===0&&(0,J.jsx)(`div`,{className:`empty`,children:`No changes in this range.`}),C.map(e=>(0,J.jsx)(MG,{file:e,notes:w[e.path]??SK,diffStyle:o,palette:n,showNotes:c,collapsed:!E(e),viewed:i(e),activeNote:f,pinned:e.path===v||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:O,onViewed:te,onFocusNote:ee},e.path))]}),(0,J.jsx)(YG,{state:k.state,palette:n,voice:oe,onDismiss:k.dismiss,onStep:k.goTo,onEndTour:k.endTour,onClearCaption:()=>k.run({type:`say`,text:``})})]})};wG();var EK=document.getElementById(`root`);EK!==null&&(0,VW.createRoot)(EK).render((0,J.jsx)(q.StrictMode,{children:(0,J.jsx)(JC.Provider,{value:rG,children:(0,J.jsx)(wK,{})})}));export{s as t};
|