@nuxt/devtools 4.0.0-alpha.1 → 4.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +84 -5
  2. package/dist/chunks/module-main.mjs +174 -220
  3. package/dist/client/200.html +1 -1
  4. package/dist/client/404.html +1 -1
  5. package/dist/client/_nuxt/__blank-hkoz1rvj.js +1 -0
  6. package/dist/client/_nuxt/analyze-build-kqtn42f3.js +1 -0
  7. package/dist/client/_nuxt/assets-pdpavuv7.js +6 -0
  8. package/dist/client/_nuxt/auth-required-panel-eykuzska.js +1 -0
  9. package/dist/client/_nuxt/builds/latest.json +1 -1
  10. package/dist/client/_nuxt/builds/meta/424f9fd7-bd33-4b1e-8498-929c14b6ad71.json +1 -0
  11. package/dist/client/_nuxt/{client-im47u3kz.js → client-coqmopwz.js} +1 -1
  12. package/dist/client/_nuxt/{code-diff-idsu3m0z.js → code-diff-o5b2z2ie.js} +3 -3
  13. package/dist/client/_nuxt/code-snippets-lje00rjy.js +1 -0
  14. package/dist/client/_nuxt/components-mkmd03mc.js +1 -0
  15. package/dist/client/_nuxt/composable-item-lw4aqry9.js +1 -0
  16. package/dist/client/_nuxt/custom-_name_-h2d0kmts.js +1 -0
  17. package/dist/client/_nuxt/data-schema-button-g6gxhvpu.js +1 -0
  18. package/dist/client/_nuxt/data-schema-drawer-h229qgae.js +2 -0
  19. package/dist/client/_nuxt/debug-ezvak7q9.js +1 -0
  20. package/dist/client/_nuxt/{default-jvhm51ri.js → default-f17ja76u.js} +1 -1
  21. package/dist/client/_nuxt/dev-auth-h6radlhi.js +1 -0
  22. package/dist/client/_nuxt/duration-display-lgba3ul7.js +1 -0
  23. package/dist/client/_nuxt/entry.css-d9crsfkn.css +1 -0
  24. package/dist/client/_nuxt/error-404-j6bw0i0a.js +1 -0
  25. package/dist/client/_nuxt/error-404.css-op0yx84h.css +1 -0
  26. package/dist/client/_nuxt/error-500-oozftcqy.js +1 -0
  27. package/dist/client/_nuxt/error-500.css-f169vd1x.css +1 -0
  28. package/dist/client/_nuxt/error-knm3fbzu.js +9 -0
  29. package/dist/client/_nuxt/filepath-item-o7vxzdbh.js +1 -0
  30. package/dist/client/_nuxt/full-h1zczfpi.js +1 -0
  31. package/dist/client/_nuxt/h9sdxxta.js +4 -0
  32. package/dist/client/_nuxt/help-fab-ekagn9f2.js +1 -0
  33. package/dist/client/_nuxt/hooks-k3agmywq.js +1 -0
  34. package/dist/client/_nuxt/imports-gw4s306d.js +1 -0
  35. package/dist/client/_nuxt/launch-page-jvtn5jef.js +1 -0
  36. package/dist/client/_nuxt/modules-b3ta2mlp.js +1 -0
  37. package/dist/client/_nuxt/nbadge-ia2sg78l.js +1 -0
  38. package/dist/client/_nuxt/ncard-bpchuz30.js +1 -0
  39. package/dist/client/_nuxt/ncheckbox-dqqmiqln.js +1 -0
  40. package/dist/client/_nuxt/ncode-block-lbvhz228.js +2 -0
  41. package/dist/client/_nuxt/ndrawer-pdhwqkg2.js +1 -0
  42. package/dist/client/_nuxt/ndropdown-o0hg8oi1.js +1 -0
  43. package/dist/client/_nuxt/nicon-o8vtl3nv.js +1 -0
  44. package/dist/client/_nuxt/nicon-title-f04kekaa.js +1 -0
  45. package/dist/client/_nuxt/nlink-flm1s7uj.js +1 -0
  46. package/dist/client/_nuxt/nmarkdown-cu68ujlp.js +1 -0
  47. package/dist/client/_nuxt/nnavbar-iwf1qrzf.js +1 -0
  48. package/dist/client/_nuxt/none-b8do2yyn.js +1 -0
  49. package/dist/client/_nuxt/nsection-block-oc6icst0.js +1 -0
  50. package/dist/client/_nuxt/nselect-k14i70o0.js +1 -0
  51. package/dist/client/_nuxt/nselect-tabs-gmel1seg.js +1 -0
  52. package/dist/client/_nuxt/nswitch-kprd7bwp.js +1 -0
  53. package/dist/client/_nuxt/ntip-erjk5wo4.js +1 -0
  54. package/dist/client/_nuxt/{nuxt-otp6bp04.js → nuxt-bl8ryhiw.js} +1 -1
  55. package/dist/client/_nuxt/{nuxt-link-bumooa9d.js → nuxt-link-h8a2u03t.js} +1 -1
  56. package/dist/client/_nuxt/open-graph-ipvg6gyk.js +3 -0
  57. package/dist/client/_nuxt/overview-fbg2mjz1.js +1 -0
  58. package/dist/client/_nuxt/pages-jx3r1z1o.js +1 -0
  59. package/dist/client/_nuxt/pages-nqnq5f5t.js +1 -0
  60. package/dist/client/_nuxt/payload-f7ar9blu.js +1 -0
  61. package/dist/client/_nuxt/pinia-in67b2ff.js +1 -0
  62. package/dist/client/_nuxt/plugins-foc4m9cu.js +1 -0
  63. package/dist/client/_nuxt/{ready-dadbdj5i.js → ready-nmtplnq5.js} +1 -1
  64. package/dist/client/_nuxt/render-tree-mzpnvjww.js +1 -0
  65. package/dist/client/_nuxt/rpc-ga26o8l5.js +1 -0
  66. package/dist/client/_nuxt/runtime-configs-f691dtpr.js +1 -0
  67. package/dist/client/_nuxt/server-discovery-fa3lq0oe.js +1 -0
  68. package/dist/client/_nuxt/server-route-inputs-kx5eivj6.js +1 -0
  69. package/dist/client/_nuxt/server-routes-ozsawrbd.js +7 -0
  70. package/dist/client/_nuxt/server-tasks-sykxh8ji.js +1 -0
  71. package/dist/client/_nuxt/settings-eufw79s0.js +1 -0
  72. package/dist/client/_nuxt/{splitpanes.es-bxyirks2.js → splitpanes.es-krbzt5ww.js} +1 -1
  73. package/dist/client/_nuxt/stacktrace-list-ilvbql3y.js +1 -0
  74. package/dist/client/_nuxt/state-components-pfh0w3gz.js +1 -0
  75. package/dist/client/_nuxt/state-editor-c9yn0k8x.js +1 -0
  76. package/dist/client/_nuxt/state-modules-c35cpfly.js +1 -0
  77. package/dist/client/_nuxt/{state-tabs-etl5jr30.js → state-tabs-0wkipn6s.js} +1 -1
  78. package/dist/client/_nuxt/storage-dqgie6yp.js +1 -0
  79. package/dist/client/_nuxt/storage-options-fmhmng6m.js +1 -0
  80. package/dist/client/_nuxt/terminals-o5xyk44w.js +1 -0
  81. package/dist/client/_nuxt/timeline-hwj8vazt.js +31 -0
  82. package/dist/client/_nuxt/unocss-runtime-fghua2d1.js +1 -0
  83. package/dist/client/_nuxt/utils-c43quyky.js +2 -0
  84. package/dist/client/_nuxt/vendor/{json-editor-vue-eojr4v24.js → json-editor-vue-mpqfj7dd.js} +5 -5
  85. package/dist/client/_nuxt/vendor/{quicktype-core-k4qx3809.js → quicktype-core-bxh3g3c2.js} +2 -2
  86. package/dist/client/_nuxt/vendor/{shiki-lqo1hg2n.js → shiki-ildq90cv.js} +3 -3
  87. package/dist/client/_nuxt/vendor/{unocss-k727ub0h.js → unocss-hiscr44j.js} +1 -1
  88. package/dist/client/_nuxt/vendor/{vis-id8udisj.js → vis-obscvyyi.js} +2 -2
  89. package/dist/client/_nuxt/vendor/{xterm-ed0pys2e.js → xterm-g6v3jqah.js} +1 -1
  90. package/dist/client/_nuxt/virtual-files-ld5g0ep3.js +1 -0
  91. package/dist/client/_nuxt/vue-devtools-mcimudqm.js +4 -0
  92. package/dist/client/_nuxt/{vue-router-jbnxw7nb.js → vue-router-imuzx5c1.js} +1 -1
  93. package/dist/client/index.html +1 -1
  94. package/dist/module.json +1 -1
  95. package/dist/module.mjs +1 -1
  96. package/dist/shared/{devtools.COlX0Gls.mjs → devtools.DClER4Dv.mjs} +1 -2
  97. package/package.json +15 -15
  98. package/dist/client/_nuxt/__blank-cpzbm3dn.js +0 -1
  99. package/dist/client/_nuxt/analyze-build-e7v5vkef.js +0 -1
  100. package/dist/client/_nuxt/assets-b5c187l4.js +0 -6
  101. package/dist/client/_nuxt/builds/meta/25fc8778-785e-4df1-8047-b131fc1cd4b2.json +0 -1
  102. package/dist/client/_nuxt/code-snippets-k81hoi4s.js +0 -1
  103. package/dist/client/_nuxt/components-bmictfph.js +0 -1
  104. package/dist/client/_nuxt/composable-item-cza22cup.js +0 -1
  105. package/dist/client/_nuxt/copkoh3j.js +0 -4
  106. package/dist/client/_nuxt/custom-_name_-gqm5kr56.js +0 -1
  107. package/dist/client/_nuxt/data-schema-button-b308wyi0.js +0 -1
  108. package/dist/client/_nuxt/data-schema-drawer-lr34uwsh.js +0 -2
  109. package/dist/client/_nuxt/debug-kgc8fptp.js +0 -1
  110. package/dist/client/_nuxt/dev-auth-ojiqold5.js +0 -1
  111. package/dist/client/_nuxt/duration-display-f7ucshmo.js +0 -1
  112. package/dist/client/_nuxt/entry.css-me26coxn.css +0 -1
  113. package/dist/client/_nuxt/error-404-nggtc73s.js +0 -1
  114. package/dist/client/_nuxt/error-404.css-j1aav08u.css +0 -1
  115. package/dist/client/_nuxt/error-500-dym2gzqx.js +0 -1
  116. package/dist/client/_nuxt/error-500.css-eu9fz4va.css +0 -1
  117. package/dist/client/_nuxt/error-fqinfa1x.js +0 -9
  118. package/dist/client/_nuxt/filepath-item-e1s52fbh.js +0 -1
  119. package/dist/client/_nuxt/full-et0weok9.js +0 -1
  120. package/dist/client/_nuxt/help-fab-hz6r2oxa.js +0 -1
  121. package/dist/client/_nuxt/hooks-i7nsduqp.js +0 -1
  122. package/dist/client/_nuxt/imports-9o2qs53q.js +0 -1
  123. package/dist/client/_nuxt/launch-page-hpkkqhit.js +0 -1
  124. package/dist/client/_nuxt/modules-jok0opuq.js +0 -1
  125. package/dist/client/_nuxt/nbadge-m66xoquo.js +0 -1
  126. package/dist/client/_nuxt/nbutton-gygn07c2.js +0 -1
  127. package/dist/client/_nuxt/ncard-mqcl8pso.js +0 -1
  128. package/dist/client/_nuxt/ncheckbox-c0r45qtu.js +0 -1
  129. package/dist/client/_nuxt/ncode-block-figzf35k.js +0 -2
  130. package/dist/client/_nuxt/ndrawer-bgqyrlmt.js +0 -1
  131. package/dist/client/_nuxt/ndropdown-cip8lboe.js +0 -1
  132. package/dist/client/_nuxt/nicon-m1crov2l.js +0 -1
  133. package/dist/client/_nuxt/nicon-title-tqdvw0w0.js +0 -1
  134. package/dist/client/_nuxt/nlink-od4lllbl.js +0 -1
  135. package/dist/client/_nuxt/nmarkdown-hw0hmqw7.js +0 -1
  136. package/dist/client/_nuxt/nnavbar-lpozm5fj.js +0 -1
  137. package/dist/client/_nuxt/none-bdxkqeml.js +0 -1
  138. package/dist/client/_nuxt/npanel-grids-dd23ifsw.js +0 -1
  139. package/dist/client/_nuxt/nsection-block-lqrohs9v.js +0 -1
  140. package/dist/client/_nuxt/nselect-gczoit0g.js +0 -1
  141. package/dist/client/_nuxt/nselect-tabs-bsw5fg3d.js +0 -1
  142. package/dist/client/_nuxt/nswitch-ke379yjx.js +0 -1
  143. package/dist/client/_nuxt/ntext-input-cygthohl.js +0 -1
  144. package/dist/client/_nuxt/ntip-ke63ovgc.js +0 -1
  145. package/dist/client/_nuxt/open-graph-lumhcitx.js +0 -3
  146. package/dist/client/_nuxt/overview-c1ufrox9.js +0 -1
  147. package/dist/client/_nuxt/pages-cf1hvns3.js +0 -1
  148. package/dist/client/_nuxt/pages-lgihsvbt.js +0 -1
  149. package/dist/client/_nuxt/payload-fvgw4hh9.js +0 -1
  150. package/dist/client/_nuxt/pinia-lmrgyjxw.js +0 -1
  151. package/dist/client/_nuxt/plugins-ccaip8nh.js +0 -1
  152. package/dist/client/_nuxt/render-tree-corj3giw.js +0 -1
  153. package/dist/client/_nuxt/rpc-ez4fzlum.js +0 -1
  154. package/dist/client/_nuxt/runtime-configs-im0uu24n.js +0 -1
  155. package/dist/client/_nuxt/server-discovery-ffkkczqi.js +0 -1
  156. package/dist/client/_nuxt/server-route-inputs-lspeoiem.js +0 -1
  157. package/dist/client/_nuxt/server-routes-dhvqrowz.js +0 -7
  158. package/dist/client/_nuxt/server-tasks-mr9ezn8q.js +0 -1
  159. package/dist/client/_nuxt/settings-issronwn.js +0 -1
  160. package/dist/client/_nuxt/stacktrace-list-hiui24c3.js +0 -1
  161. package/dist/client/_nuxt/state-components-fbls8ka7.js +0 -1
  162. package/dist/client/_nuxt/state-editor-c7e04uj2.js +0 -1
  163. package/dist/client/_nuxt/state-modules-inqbwd7z.js +0 -1
  164. package/dist/client/_nuxt/state-routes-jln33b1m.js +0 -1
  165. package/dist/client/_nuxt/storage-husj5pg6.js +0 -1
  166. package/dist/client/_nuxt/storage-options-cth3coln.js +0 -1
  167. package/dist/client/_nuxt/telemetry-eqv6a0hn.js +0 -1
  168. package/dist/client/_nuxt/terminals-kitd8oja.js +0 -1
  169. package/dist/client/_nuxt/timeline-gr4tcvcz.js +0 -31
  170. package/dist/client/_nuxt/unocss-runtime-cpug61u1.js +0 -1
  171. package/dist/client/_nuxt/utils-nbkl6byi.js +0 -2
  172. package/dist/client/_nuxt/virtual-files-ky9cc4av.js +0 -1
  173. package/dist/client/_nuxt/vue-devtools-dunhx2nz.js +0 -4
  174. /package/dist/client/_nuxt/{color-b9xoe9j2.js → color-bh8526bd.js} +0 -0
  175. /package/dist/client/_nuxt/{composables-b2ccklz4.js → composables-f0oa0ya0.js} +0 -0
  176. /package/dist/client/_nuxt/{constants-ih922r91.js → constants-g7ujya00.js} +0 -0
  177. /package/dist/client/_nuxt/{dist-m49wlq01.js → dist-f16b9vaq.js} +0 -0
  178. /package/dist/client/_nuxt/{mitt.es-fjx0h8xe.js → mitt.es-pc7qwi6p.js} +0 -0
  179. /package/dist/client/_nuxt/vendor/{markdown-it-ckeo8pwp.js → markdown-it-liuu8zo7.js} +0 -0
@@ -8,7 +8,7 @@ import{r as e}from"../rolldown-runtime-oipoa1or.js";var t=class extends Error{co
8
8
  \f\r &>`.split(``),`\0
9
9
  \f\r "&'<=>\``.split(``)],[`\0
10
10
  \f\r "&'<=>\``.split(``),`\0
11
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ir(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1: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=Dn);let l=Lr(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!kr(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||!pr(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Lr(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Rr(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 Rr(e,t,n){let r=Cn(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,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=j(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Fr.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?rr:ir)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=j(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Fr.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&nr(n,o)>nr(n,e.alternative)&&(o=e.alternative),s=o+j(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Fr.single:Fr.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var zr=[`<`,`&`];function Br(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:j(e.value,Object.assign({},r.settings.characterReferences,{subset:zr}))}function Vr(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Br(e,t,n,r)}function Hr(e,t,n,r){return r.all(e)}var Ur=kn(`type`,{invalid:Wr,unknown:Gr,handlers:{comment:er,doctype:tr,element:Ir,raw:Vr,root:Hr,text:Br}});function Wr(e){throw Error("Expected node, not `"+e+"`")}function Gr(e){let t=e;throw Error("Cannot compile unknown node `"+t.type+"`")}var Kr={},qr={},Jr=[];function Yr(e,t){let n=t||Kr,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Xr,all:Zr,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||tn,characterReferences:n.characterReferences||qr,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Dn:En,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Xr(e,t,n){return Ur(e,t,n,this)}function Zr(e){let t=[],n=e&&e.children||Jr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Qr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function $r(e){let t=Tt(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-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}}var ei=`light-dark()`,ti=[`color`,`background-color`];function ni(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 ri(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?ni(e,t):e})):e}function ii(e,n,r,i,a=`css-vars`){let o={content:e.content,explanation:e.explanation,offset:e.offset},s=n.map(t=>ai(e.variants[t])),c=new Set(s.flatMap(e=>Object.keys(e))),l={},u=(e,t)=>{let i=t===`color`?``:t===`background-color`?`-bg`:`-${t}`;return r+n[e]+(t===`color`?``:i)};return s.forEach((e,r)=>{for(let o of c){let c=e[o]||`inherit`;if(r===0&&i&&ti.includes(o))if(i===ei&&s.length>1){let e=n.findIndex(e=>e===`light`),i=n.findIndex(e=>e===`dark`);if(e===-1||i===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[o]=`light-dark(${s[e][o]||`inherit`}, ${s[i][o]||`inherit`})`,a===`css-vars`&&(l[u(r,o)]=c)}else l[o]=c;else a===`css-vars`&&(l[u(r,o)]=c)}}),o.htmlStyle=l,o}function ai(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&y.Italic&&(t[`font-style`]=`italic`),e.fontStyle&y.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&y.Underline&&n.push(`underline`),e.fontStyle&y.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function oi(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function si(){let e=new WeakMap;function n(n){if(!e.has(n.meta)){let r=$r(n.source);function i(e){if(typeof e==`number`){if(e<0||e>n.source.length)throw new t(`Invalid decoration offset: ${e}. Code length: ${n.source.length}`);return{...r.indexToPos(e),offset:e}}else{let n=r.lines[e.line];if(n===void 0)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let i=e.character;if(i<0&&(i=n.length+i),i<0||i>n.length)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${n.length}`);return{...e,character:i,offset:r.posToIndex(e.line,i)}}}let a=(n.options.decorations||[]).map(e=>({...e,start:i(e.start),end:i(e.end)}));ci(a),e.set(n.meta,{decorations:a,converter:r,source:n.source})}return e.get(n.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return ri(e,n(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let r=n(this),i=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(i.length!==r.converter.lines.length)throw new t(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(e,n,r,a){let o=i[e],c=``,l=-1,u=-1;if(n===0&&(l=0),r===0&&(u=0),r===1/0&&(u=o.children.length),l===-1||u===-1)for(let e=0;e<o.children.length;e++)c+=li(o.children[e]),l===-1&&c.length===n&&(l=e+1),u===-1&&c.length===r&&(u=e+1);if(l===-1)throw new t(`Failed to find start index for decoration ${JSON.stringify(a.start)}`);if(u===-1)throw new t(`Failed to find end index for decoration ${JSON.stringify(a.end)}`);let d=o.children.slice(l,u);if(!a.alwaysWrap&&d.length===o.children.length)s(o,a,`line`);else if(!a.alwaysWrap&&d.length===1&&d[0].type===`element`)s(d[0],a,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};s(e,a,`wrapper`),o.children.splice(l,d.length,e)}}function o(e,t){i[e]=s(i[e],t,`line`)}function s(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&&Qr(e,t.properties.class),e=i(e,n)||e,e}let c=[],l=r.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of l){let{start:t,end:n}=e;if(t.line===n.line)a(t.line,t.character,n.character,e);else if(t.line<n.line){a(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)c.unshift(()=>o(r,e));a(n.line,0,n.character,e)}}c.forEach(e=>e())}}}function ci(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.start.offset>r.end.offset)throw new t(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let i=n+1;i<e.length;i++){let n=e[i],a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,o=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset,s=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,c=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset;if(a||o||s||c){if(a&&o||s&&c||s&&r.start.offset===r.end.offset||o&&n.start.offset===n.end.offset)continue;throw new t(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(n.start)} intersect.`)}}}}function li(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(li).join(``):``}var ui=[si()];function di(e){let t=fi(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ui]}function fi(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 N=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],pi={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function mi(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 hi(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}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function gi(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)pi[r]&&t.push({type:`setDecoration`,value:pi[r]});else if(r<=29){let e=pi[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:N[r-30]}});else if(r===38){let n=hi(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:N[r-40]}});else if(r===48){let n=hi(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:N[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:N[r-100+8]}})}return t}function _i(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=mi(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=gi(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 vi={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 yi(e=vi){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<N.length;e++)r.push(t(N[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 bi={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 xi(e,t,n){let r=vt(e,n),i=Tt(t),a=yi(Object.fromEntries(N.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||bi[t]]}))),o=_i();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=x(i,r),o=x(o,r),n.decorations.has(`dim`)&&(i=Si(i));let s=y.None;return n.decorations.has(`bold`)&&(s|=y.Bold),n.decorations.has(`italic`)&&(s|=y.Italic),n.decorations.has(`underline`)&&(s|=y.Underline),n.decorations.has(`strikethrough`)&&(s|=y.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Si(e){let t=e.match(/#([0-9a-f]{3,8})/i);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}`}else if(e.length===6)return`#${e}80`;else 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`)}`}else 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(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Ci(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xt(r)&&!Ct(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return xi(r,t,n)}return Wt(e,t,n)}function wi(e,n,r){let i,a,o,s,c,l;if(`themes`in r){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=r,p=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:t.color===u?1:0);if(p.length===0)throw new t("`themes` option must not be empty");let m=$t(e,n,r,Ci);if(l=Bt(m),u&&ei!==u&&!p.find(e=>e.color===u))throw new t(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);o=m.map(e=>e.map(e=>ii(e,g,d,u,f))),l&&zt(o,l);let _=p.map(e=>vt(e.theme,r));a=Ti(p,h,_,d,u,`fg`,f),i=Ti(p,h,_,d,u,`bg`,f),s=`shiki-themes ${h.map(e=>e.name).join(` `)}`,c=u?void 0:[a,i].join(`;`)}else if(`theme`in r){let t=vt(r.theme,r);o=Ci(e,n,r);let c=e.getTheme(r.theme);i=x(c.bg,t),a=x(c.fg,t),s=c.name,l=Bt(o)}else throw new t("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:a,bg:i,themeName:s,rootStyle:c,grammarState:l}}function Ti(e,n,r,i,a,o,s){return e.map((c,l)=>{let u=x(n[l][o],r[l])||`inherit`,d=`${i+c.color}${o===`bg`?`-bg`:``}:${u}`;if(l===0&&a){if(a===ei&&e.length>1){let i=e.findIndex(e=>e.color===`light`),a=e.findIndex(e=>e.color===`dark`);if(i===-1||a===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${x(n[i][o],r[i])||`inherit`}, ${x(n[a][o],r[a])||`inherit`});${d}`}return u}return s===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}function Ei(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ei(e,t,n),codeToTokens:(t,n)=>wi(e,t,n)}){let i=t;for(let e of di(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=wi(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Oi(a):d===`never`&&(a=ki(a)),f&&(a=Ai(a));let p={...r,get source(){return i}};for(let e of di(n))a=e.tokens?.call(p,a)||a;return Di(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Di(e,t,n,r=Bt(e)){let i=di(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=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:Qr,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:`
11
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ir(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1: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=Dn);let l=Lr(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!kr(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||!pr(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Lr(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Rr(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 Rr(e,t,n){let r=Cn(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,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=j(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Fr.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?rr:ir)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=j(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Fr.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&nr(n,o)>nr(n,e.alternative)&&(o=e.alternative),s=o+j(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Fr.single:Fr.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var zr=[`<`,`&`];function Br(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:j(e.value,Object.assign({},r.settings.characterReferences,{subset:zr}))}function Vr(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Br(e,t,n,r)}function Hr(e,t,n,r){return r.all(e)}var Ur=kn(`type`,{invalid:Wr,unknown:Gr,handlers:{comment:er,doctype:tr,element:Ir,raw:Vr,root:Hr,text:Br}});function Wr(e){throw Error("Expected node, not `"+e+"`")}function Gr(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Kr={},qr={},Jr=[];function Yr(e,t){let n=t||Kr,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Xr,all:Zr,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||tn,characterReferences:n.characterReferences||qr,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Dn:En,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Xr(e,t,n){return Ur(e,t,n,this)}function Zr(e){let t=[],n=e&&e.children||Jr,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Qr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function $r(e){let t=Tt(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-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}}var ei=`light-dark()`,ti=[`color`,`background-color`];function ni(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 ri(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?ni(e,t):e})):e}function ii(e,n,r,i,a=`css-vars`){let o={content:e.content,explanation:e.explanation,offset:e.offset},s=n.map(t=>ai(e.variants[t])),c=new Set(s.flatMap(e=>Object.keys(e))),l={},u=(e,t)=>{let i=t===`color`?``:t===`background-color`?`-bg`:`-${t}`;return r+n[e]+(t===`color`?``:i)};return s.forEach((e,r)=>{for(let o of c){let c=e[o]||`inherit`;if(r===0&&i&&ti.includes(o))if(i===ei&&s.length>1){let e=n.findIndex(e=>e===`light`),i=n.findIndex(e=>e===`dark`);if(e===-1||i===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[o]=`light-dark(${s[e][o]||`inherit`}, ${s[i][o]||`inherit`})`,a===`css-vars`&&(l[u(r,o)]=c)}else l[o]=c;else a===`css-vars`&&(l[u(r,o)]=c)}}),o.htmlStyle=l,o}function ai(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&y.Italic&&(t[`font-style`]=`italic`),e.fontStyle&y.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&y.Underline&&n.push(`underline`),e.fontStyle&y.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function oi(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function si(){let e=new WeakMap;function n(n){if(!e.has(n.meta)){let r=$r(n.source);function i(e){if(typeof e==`number`){if(e<0||e>n.source.length)throw new t(`Invalid decoration offset: ${e}. Code length: ${n.source.length}`);return{...r.indexToPos(e),offset:e}}else{let n=r.lines[e.line];if(n===void 0)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let i=e.character;if(i<0&&(i=n.length+i),i<0||i>n.length)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${n.length}`);return{...e,character:i,offset:r.posToIndex(e.line,i)}}}let a=(n.options.decorations||[]).map(e=>({...e,start:i(e.start),end:i(e.end)}));ci(a),e.set(n.meta,{decorations:a,converter:r,source:n.source})}return e.get(n.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return ri(e,n(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let r=n(this),i=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(i.length!==r.converter.lines.length)throw new t(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(e,n,r,a){let o=i[e],c=``,l=-1,u=-1;if(n===0&&(l=0),r===0&&(u=0),r===1/0&&(u=o.children.length),l===-1||u===-1)for(let e=0;e<o.children.length;e++)c+=li(o.children[e]),l===-1&&c.length===n&&(l=e+1),u===-1&&c.length===r&&(u=e+1);if(l===-1)throw new t(`Failed to find start index for decoration ${JSON.stringify(a.start)}`);if(u===-1)throw new t(`Failed to find end index for decoration ${JSON.stringify(a.end)}`);let d=o.children.slice(l,u);if(!a.alwaysWrap&&d.length===o.children.length)s(o,a,`line`);else if(!a.alwaysWrap&&d.length===1&&d[0].type===`element`)s(d[0],a,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};s(e,a,`wrapper`),o.children.splice(l,d.length,e)}}function o(e,t){i[e]=s(i[e],t,`line`)}function s(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&&Qr(e,t.properties.class),e=i(e,n)||e,e}let c=[],l=r.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of l){let{start:t,end:n}=e;if(t.line===n.line)a(t.line,t.character,n.character,e);else if(t.line<n.line){a(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)c.unshift(()=>o(r,e));a(n.line,0,n.character,e)}}c.forEach(e=>e())}}}function ci(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.start.offset>r.end.offset)throw new t(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let i=n+1;i<e.length;i++){let n=e[i],a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,o=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset,s=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,c=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset;if(a||o||s||c){if(a&&o||s&&c||s&&r.start.offset===r.end.offset||o&&n.start.offset===n.end.offset)continue;throw new t(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(n.start)} intersect.`)}}}}function li(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(li).join(``):``}var ui=[si()];function di(e){let t=fi(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ui]}function fi(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 N=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],pi={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function mi(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 hi(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}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function gi(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)pi[r]&&t.push({type:`setDecoration`,value:pi[r]});else if(r<=29){let e=pi[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:N[r-30]}});else if(r===38){let n=hi(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:N[r-40]}});else if(r===48){let n=hi(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:N[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:N[r-100+8]}})}return t}function _i(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=mi(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=gi(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 vi={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 yi(e=vi){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<N.length;e++)r.push(t(N[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 bi={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 xi(e,t,n){let r=vt(e,n),i=Tt(t),a=yi(Object.fromEntries(N.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||bi[t]]}))),o=_i();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=x(i,r),o=x(o,r),n.decorations.has(`dim`)&&(i=Si(i));let s=y.None;return n.decorations.has(`bold`)&&(s|=y.Bold),n.decorations.has(`italic`)&&(s|=y.Italic),n.decorations.has(`underline`)&&(s|=y.Underline),n.decorations.has(`strikethrough`)&&(s|=y.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Si(e){let t=e.match(/#([0-9a-f]{3,8})/i);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}`}else if(e.length===6)return`#${e}80`;else 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`)}`}else 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(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Ci(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xt(r)&&!Ct(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return xi(r,t,n)}return Wt(e,t,n)}function wi(e,n,r){let i,a,o,s,c,l;if(`themes`in r){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=r,p=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:t.color===u?1:0);if(p.length===0)throw new t("`themes` option must not be empty");let m=$t(e,n,r,Ci);if(l=Bt(m),u&&ei!==u&&!p.find(e=>e.color===u))throw new t(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);o=m.map(e=>e.map(e=>ii(e,g,d,u,f))),l&&zt(o,l);let _=p.map(e=>vt(e.theme,r));a=Ti(p,h,_,d,u,`fg`,f),i=Ti(p,h,_,d,u,`bg`,f),s=`shiki-themes ${h.map(e=>e.name).join(` `)}`,c=u?void 0:[a,i].join(`;`)}else if(`theme`in r){let t=vt(r.theme,r);o=Ci(e,n,r);let c=e.getTheme(r.theme);i=x(c.bg,t),a=x(c.fg,t),s=c.name,l=Bt(o)}else throw new t("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:a,bg:i,themeName:s,rootStyle:c,grammarState:l}}function Ti(e,n,r,i,a,o,s){return e.map((c,l)=>{let u=x(n[l][o],r[l])||`inherit`,d=`${i+c.color}${o===`bg`?`-bg`:``}:${u}`;if(l===0&&a){if(a===ei&&e.length>1){let i=e.findIndex(e=>e.color===`light`),a=e.findIndex(e=>e.color===`dark`);if(i===-1||a===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${x(n[i][o],r[i])||`inherit`}, ${x(n[a][o],r[a])||`inherit`});${d}`}return u}return s===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}function Ei(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ei(e,t,n),codeToTokens:(t,n)=>wi(e,t,n)}){let i=t;for(let e of di(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=wi(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Oi(a):d===`never`&&(a=ki(a)),f&&(a=Ai(a));let p={...r,get source(){return i}};for(let e of di(n))a=e.tokens?.call(p,a)||a;return Di(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Di(e,t,n,r=Bt(e)){let i=di(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=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:Qr,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:`
12
12
  `}));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=oi(a.htmlStyle||ai(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&&zt(m,r),m}function Oi(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&y.Underline||i.fontStyle&y.Strikethrough));o&&i.content.match(/^\s+$/)&&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 ki(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);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 Ai(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=oi(e.htmlStyle||ai(e)),i=oi(n.htmlStyle||ai(n)),a=e.fontStyle&&(e.fontStyle&y.Underline||e.fontStyle&y.Strikethrough),o=n.fontStyle&&(n.fontStyle&y.Underline||n.fontStyle&y.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var ji=Yr;function Mi(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ei(e,t,n),codeToTokens:(t,n)=>wi(e,t,n)},i=ji(Ei(e,t,n,r));for(let e of di(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Ni(e){let t=await Lt(e);return{getLastGrammarState:(...e)=>Gt(t,...e),codeToTokensBase:(e,n)=>Ci(t,e,n),codeToTokensWithThemes:(e,n)=>$t(t,e,n),codeToTokens:(e,n)=>wi(t,e,n),codeToHast:(e,n)=>Ei(t,e,n),codeToHtml:(e,n)=>Mi(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Pi(e){let n=e.langs,r=e.themes,i=e.engine;async function a(e){function a(r){if(typeof r==`string`){if(r=e.langAlias?.[r]||r,St(r))return[];let i=n[r];if(!i)throw new t(`Language \`${r}\` is not included in this bundle. You may want to load it from external source.`);return i}return r}function o(e){if(wt(e))return`none`;if(typeof e==`string`){let n=r[e];if(!n)throw new t(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return n}return e}let s=(e.themes??[]).map(e=>o(e)),c=(e.langs??[]).map(e=>a(e)),l=await Ni({engine:e.engine??i(),...e,themes:s,langs:c});return{...l,loadLanguage(...e){return l.loadLanguage(...e.map(a))},loadTheme(...e){return l.loadTheme(...e.map(o))},getBundledLanguages(){return n},getBundledThemes(){return r}}}return a}function Fi(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}else{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 Ii(e,t){let n=Fi(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 Li=4294967295,Ri=class{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:Li,end:Li,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 zi(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Bi(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Vi=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),P=String.raw;function Hi(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ui=P`\[\^?`,Wi=`c.? | C(?:-.?)?|${P`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${P`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${P`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${P`o\{[^\}]*\}?`}|${P`\d{1,3}`}`,Gi=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ki=new RegExp(P`
13
13
  \\ (?:
14
14
  ${Wi}
@@ -40,8 +40,8 @@ import{r as e}from"../rolldown-runtime-oipoa1or.js";var t=class extends Error{co
40
40
  | ${Ui}
41
41
  | &&
42
42
  | .
43
- `.replace(/\s+/g,``),`gsu`);function Ji(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=Sa(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(Ki.lastIndex=0;s=Ki.exec(e);){let t=Yi(a,e,s[0],Ki.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Ki.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`?wa(e,u):e).flat(),flags:r}}function Yi(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Xi(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:ea(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:fa(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:ta(n)}}if(a===`K`)return{token:oa(`keep`,n)};if(a===`N`||a===`R`)return{token:I(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:I(`any`,n)};if(a===`X`)return{token:I(`text_segment`,n)};let e=Qi(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:_a(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:ga(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:la(`group`,n)};if(n===`(?>`)return{token:la(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:la(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:la(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:la(`absence_repeater`,n)}}throw n===`(?(`?Error(`Unsupported conditional "${n}"`):Error(`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:ca(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
44
- `,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:I(`dot`,n)}:n===`^`||n===`$`?{token:ea(e.singleline?{"^":P`\A`,$:P`\Z`}[n]:n,n)}:n===`|`?{token:$i(n)}:Gi.test(n)?{tokens:Ta(n)}:{token:F(zi(n),n)}}function Xi(e,t,n){let r=[aa(t[1]===`^`,t)],i=1,a;for(qi.lastIndex=n;a=qi.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(aa(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(F(93,e));else if(i--,r.push(na(e)),!i)break}else{let t=Zi(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:qi.lastIndex||e.length}}function Zi(e){if(e[0]===`\\`)return Qi(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Vi.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return I(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?ra(e):e===`&&`?ia(e):F(zi(e),e)}function Qi(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return ha(e);if(`dDhHsSwW`.includes(n))return ya(e);if(e.startsWith(P`\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 ba(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 F(zi(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return F(Ca(e),e);if(ma.has(n))return F(ma.get(n),e);if(/\d/.test(n))return sa(t,e);if(e===`\\`)throw Error(P`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return F(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function $i(e){return{type:`Alternator`,raw:e}}function ea(e,t){return{type:`Assertion`,kind:e,raw:t}}function ta(e){return{type:`Backreference`,raw:e}}function F(e,t){return{type:`Character`,value:e,raw:t}}function na(e){return{type:`CharacterClassClose`,raw:e}}function ra(e){return{type:`CharacterClassHyphen`,raw:e}}function ia(e){return{type:`CharacterClassIntersector`,raw:e}}function aa(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function I(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function oa(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Hi(n.flags),raw:t}}function sa(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function ca(e){return{type:`GroupClose`,raw:e}}function la(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function ua(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function da(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function fa(e){return{type:`Subroutine`,raw:e}}var pa=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),ma=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function ha(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return F(zi(t.toUpperCase())-64,e)}function ga(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=xa(n),o=xa(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),oa(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,la(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function _a(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=pa.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 ua(l,r??null,i?.split(`,`)??null,e)}function va(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]===`+`?1:0,r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return da(t,n,r,e)}function ya(e){let t=e[1].toLowerCase();return I({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function ba(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return I(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function xa(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 Sa(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 Ca(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 wa(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[ta(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(P`Octal encoded byte above 177 unsupported "${n}"`)}else r=zi(t);a.push(F(r,(e===0?`\\`:``)+t))}return a}function Ta(e){let t=[],n=new RegExp(Gi,`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(va(e.slice(0,-1)));continue}}}t.push(va(e))}return t}function Ea(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 Da(e){return Oa.has(e.type)}var Oa=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function ka(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Ji(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 L();case`Assertion`:return Aa(n);case`Backreference`:return ja(n,a);case`Character`:return Ha(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Ma(n,a,t);case`CharacterClassOpen`:return Na(n,a,t);case`CharacterSet`:return Pa(n,a);case`Directive`:return Ka(n.kind,{flags:n.flags});case`GroupOpen`:return Fa(n,a,t);case`NamedCallout`:return Ja(n.kind,n.tag,n.arguments);case`Quantifier`:return Ia(n,a);case`Subroutine`:return La(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=Za(qa(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(P`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(P`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Aa({kind:e}){return za(Hi({"^":`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===P`\B`||e===P`\Y`})}function ja({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,Ba(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 Ba(r)}return i(+r)}function Ma(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(),Wa(o,e);throw Error(`Invalid character class range`)}return Ha(zi(`-`))}function Na({negate:e},t,n){let{tokens:r,walk:i}=t,a=r[t.nextIndex],o=[Ua()],s=co(a);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)o.push(Ua()),t.nextIndex++;else{let e=o.at(-1);e.body.push(i(e,n))}s=co(r[t.nextIndex],a)}let c=Ua({negate:e});return o.length===1?c.body=o[0].body:(c.kind=`intersection`,c.body=o.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Pa({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=so(n);if(Vi.has(r)&&!o?.has(r))e=`posix`,n=r;else return $a(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Ya(n,{negate:t}):Ga(e,{negate:t})}function Fa(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=eo(e),l=c.type===`AbsenceFunction`,u=io(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Bi(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=lo(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(L()),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(ro(t)||t.type===`CapturingGroup`)throw Error(e)}else if(ro(t)||io(t)&&t.negate)throw Error(e)}}f=lo(r[t.nextIndex])}return t.nextIndex++,c}function Ia({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Da(a))throw Error(`Quantifier requires a repeatable token`);let o=Xa(e,t,n,a);return i.body.pop(),o}function La({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=Qa(i);return r.push(o),o}function Ra(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:to(t?.body)}}function L(e){return{type:`Alternative`,body:no(e?.body)}}function za(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Ba(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Va(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ao(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:to(t?.body)}}function Ha(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${t}}"`):Error(`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Ua(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:no(e?.body)}}function Wa(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function Ga(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 Ka(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:Hi(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function qa(e){return{type:`Flags`,...e}}function R(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:to(e?.body)}}function z(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:to(e?.body)}}function Ja(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Ya(e,t){let n=!!t?.negate;if(!Vi.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Xa(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 Za(e,t){return{type:`Regex`,body:to(t?.body),flags:e}}function Qa(e){return{type:`Subroutine`,ref:e}}function $a(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(so(e));if(!r){if(n.normalizeUnknownPropertyNames)r=oo(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(P`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function eo({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Ra(`repeater`);case`atomic`:return R({atomic:!0});case`capturing`:return Va(i,{name:n});case`group`:return R({flags:e});case`lookahead`:case`lookbehind`:return z({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function to(e){if(e===void 0)e=[L()];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 no(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 ro(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function io(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function ao(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function oo(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 so(e){return e.replace(/[- _]+/g,``).toLowerCase()}function co(e,t){return Hi(e,`${t?.type===`Character`&&t.value===93?`Empty`:`Unclosed`} character class`)}function lo(e){return Hi(e,`Unclosed group`)}function uo(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(){fo(c).splice(Math.max(0,po(s)+l),1),l--,u=!0},removeAllNextSiblings(){return fo(c).splice(po(s)+1)},removeAllPrevSiblings(){let e=po(s)+l;return l-=e,fo(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,po(s)+l)]=e:Hi(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(fo(c).splice(Math.max(0,po(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,po(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`CapturingGroup`:case`Group`:r(a.body,a);break;case`Alternative`:case`CharacterClass`: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`LookaroundAssertion`:r(a.body,a);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 fo(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function po(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var mo=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ho(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function go(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var B=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function _o(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===B.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?B.CHAR_CLASS:B.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 vo(e,t,n,r){_o(e,t,n,r)}function yo(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===B.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function bo(e,t,n){return!!yo(e,t,0,n)}function xo(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 So=new RegExp(String.raw`(?<noncapturingStart>${mo})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Co(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(So.lastIndex=Number.isNaN(c)?0:c+7;f=So.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),ho(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=_o(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}`},B.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var wo=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,To=new RegExp(String.raw`
43
+ `.replace(/\s+/g,``),`gsu`);function Ji(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=Sa(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(Ki.lastIndex=0;s=Ki.exec(e);){let t=Yi(a,e,s[0],Ki.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Ki.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`?wa(e,u):e).flat(),flags:r}}function Yi(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Xi(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:ea(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:fa(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:ta(n)}}if(a===`K`)return{token:oa(`keep`,n)};if(a===`N`||a===`R`)return{token:I(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:I(`any`,n)};if(a===`X`)return{token:I(`text_segment`,n)};let e=Qi(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:_a(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:ga(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:la(`group`,n)};if(n===`(?>`)return{token:la(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:la(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:la(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:la(`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:ca(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
44
+ `,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:I(`dot`,n)}:n===`^`||n===`$`?{token:ea(e.singleline?{"^":P`\A`,$:P`\Z`}[n]:n,n)}:n===`|`?{token:$i(n)}:Gi.test(n)?{tokens:Ta(n)}:{token:F(zi(n),n)}}function Xi(e,t,n){let r=[aa(t[1]===`^`,t)],i=1,a;for(qi.lastIndex=n;a=qi.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(aa(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(F(93,e));else if(i--,r.push(na(e)),!i)break}else{let t=Zi(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:qi.lastIndex||e.length}}function Zi(e){if(e[0]===`\\`)return Qi(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Vi.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return I(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?ra(e):e===`&&`?ia(e):F(zi(e),e)}function Qi(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return ha(e);if(`dDhHsSwW`.includes(n))return ya(e);if(e.startsWith(P`\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 ba(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 F(zi(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return F(Ca(e),e);if(ma.has(n))return F(ma.get(n),e);if(/\d/.test(n))return sa(t,e);if(e===`\\`)throw Error(P`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return F(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function $i(e){return{type:`Alternator`,raw:e}}function ea(e,t){return{type:`Assertion`,kind:e,raw:t}}function ta(e){return{type:`Backreference`,raw:e}}function F(e,t){return{type:`Character`,value:e,raw:t}}function na(e){return{type:`CharacterClassClose`,raw:e}}function ra(e){return{type:`CharacterClassHyphen`,raw:e}}function ia(e){return{type:`CharacterClassIntersector`,raw:e}}function aa(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function I(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function oa(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Hi(n.flags),raw:t}}function sa(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function ca(e){return{type:`GroupClose`,raw:e}}function la(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function ua(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function da(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function fa(e){return{type:`Subroutine`,raw:e}}var pa=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),ma=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function ha(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return F(zi(t.toUpperCase())-64,e)}function ga(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=xa(n),o=xa(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),oa(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,la(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function _a(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=pa.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 ua(l,r??null,i?.split(`,`)??null,e)}function va(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]===`+`?1:0,r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return da(t,n,r,e)}function ya(e){let t=e[1].toLowerCase();return I({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function ba(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return I(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function xa(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 Sa(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 Ca(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 wa(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[ta(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(P`Octal encoded byte above 177 unsupported "${n}"`)}else r=zi(t);a.push(F(r,(e===0?`\\`:``)+t))}return a}function Ta(e){let t=[],n=new RegExp(Gi,`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(va(e.slice(0,-1)));continue}}}t.push(va(e))}return t}function Ea(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 Da(e){return Oa.has(e.type)}var Oa=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function ka(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Ji(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 L();case`Assertion`:return Aa(n);case`Backreference`:return ja(n,a);case`Character`:return Ha(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Ma(n,a,t);case`CharacterClassOpen`:return Na(n,a,t);case`CharacterSet`:return Pa(n,a);case`Directive`:return Ka(n.kind,{flags:n.flags});case`GroupOpen`:return Fa(n,a,t);case`NamedCallout`:return Ja(n.kind,n.tag,n.arguments);case`Quantifier`:return Ia(n,a);case`Subroutine`:return La(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=Za(qa(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(P`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(P`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Aa({kind:e}){return za(Hi({"^":`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===P`\B`||e===P`\Y`})}function ja({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,Ba(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 Ba(r)}return i(+r)}function Ma(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(),Wa(o,e);throw Error(`Invalid character class range`)}return Ha(zi(`-`))}function Na({negate:e},t,n){let{tokens:r,walk:i}=t,a=r[t.nextIndex],o=[Ua()],s=co(a);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)o.push(Ua()),t.nextIndex++;else{let e=o.at(-1);e.body.push(i(e,n))}s=co(r[t.nextIndex],a)}let c=Ua({negate:e});return o.length===1?c.body=o[0].body:(c.kind=`intersection`,c.body=o.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Pa({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=so(n);if(Vi.has(r)&&!o?.has(r))e=`posix`,n=r;else return $a(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Ya(n,{negate:t}):Ga(e,{negate:t})}function Fa(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=eo(e),l=c.type===`AbsenceFunction`,u=io(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Bi(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=lo(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(L()),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(ro(t)||t.type===`CapturingGroup`)throw Error(e)}else if(ro(t)||io(t)&&t.negate)throw Error(e)}}f=lo(r[t.nextIndex])}return t.nextIndex++,c}function Ia({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Da(a))throw Error(`Quantifier requires a repeatable token`);let o=Xa(e,t,n,a);return i.body.pop(),o}function La({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=Qa(i);return r.push(o),o}function Ra(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:to(t?.body)}}function L(e){return{type:`Alternative`,body:no(e?.body)}}function za(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Ba(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Va(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ao(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:to(t?.body)}}function Ha(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 Ua(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:no(e?.body)}}function Wa(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function Ga(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 Ka(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:Hi(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function qa(e){return{type:`Flags`,...e}}function R(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:to(e?.body)}}function z(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:to(e?.body)}}function Ja(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Ya(e,t){let n=!!t?.negate;if(!Vi.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Xa(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 Za(e,t){return{type:`Regex`,body:to(t?.body),flags:e}}function Qa(e){return{type:`Subroutine`,ref:e}}function $a(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(so(e));if(!r){if(n.normalizeUnknownPropertyNames)r=oo(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(P`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function eo({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Ra(`repeater`);case`atomic`:return R({atomic:!0});case`capturing`:return Va(i,{name:n});case`group`:return R({flags:e});case`lookahead`:case`lookbehind`:return z({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function to(e){if(e===void 0)e=[L()];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 no(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 ro(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function io(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function ao(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function oo(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 so(e){return e.replace(/[- _]+/g,``).toLowerCase()}function co(e,t){return Hi(e,`${t?.type===`Character`&&t.value===93?`Empty`:`Unclosed`} character class`)}function lo(e){return Hi(e,`Unclosed group`)}function uo(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(){fo(c).splice(Math.max(0,po(s)+l),1),l--,u=!0},removeAllNextSiblings(){return fo(c).splice(po(s)+1)},removeAllPrevSiblings(){let e=po(s)+l;return l-=e,fo(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,po(s)+l)]=e:Hi(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(fo(c).splice(Math.max(0,po(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,po(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`CapturingGroup`:case`Group`:r(a.body,a);break;case`Alternative`:case`CharacterClass`: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`LookaroundAssertion`:r(a.body,a);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 fo(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function po(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var mo=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ho(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function go(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var B=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function _o(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===B.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?B.CHAR_CLASS:B.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 vo(e,t,n,r){_o(e,t,n,r)}function yo(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===B.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function bo(e,t,n){return!!yo(e,t,0,n)}function xo(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 So=new RegExp(String.raw`(?<noncapturingStart>${mo})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Co(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(So.lastIndex=Number.isNaN(c)?0:c+7;f=So.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),ho(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=_o(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}`},B.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var wo=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,To=new RegExp(String.raw`
45
45
  \\(?: \d+
46
46
  | c[A-Za-z]
47
47
  | [gk]<[^>]+>
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../dist-duc3zu0y.js","../rolldown-runtime-oipoa1or.js","../dist-mnod32r1.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./json-editor-vue-eojr4v24.js";var t=`default`,n=`preflights`,r=`shortcuts`,i={imports:-200,[n]:-100,[r]:-10,[t]:0},a=/[\\:]?[\s'"`;{}]+/g;function o(e){return e.split(a)}var s={name:`@unocss/core/extractor-split`,order:0,extract({code:e}){return o(e)}};function c(e=[]){return Array.isArray(e)?e:[e]}function l(e){return Array.from(new Set(e))}function u(e,t){return e.reduce((e,n)=>(e.findIndex(e=>t(n,e))===-1&&e.push(n),e),[])}function d(e){return typeof e==`string`}var f=class extends Set{constructor(e){if(super(),this._map=new Map,e)for(let t of e)this.add(t)}add(e){return this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.has(e)?(this._map.delete(e),super.delete(e)):!1}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,t){return this._map.set(e,t),super.add(e)}};function p(e){return e instanceof f}function m(e){let t=e.length,n=-1,r,i=``,a=e.charCodeAt(0);for(;++n<t;){if(r=e.charCodeAt(n),r===0){i+=`�`;continue}if(r===37){i+=`\\%`;continue}if(r===44){i+=`\\,`;continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&a===45){i+=`\\${r.toString(16)} `;continue}if(n===0&&t===1&&r===45){i+=`\\${e.charAt(n)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){i+=e.charAt(n);continue}i+=`\\${e.charAt(n)}`}return i}var h=m;function g(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(e=>e(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}}}function _(e){return typeof e==`function`?{match:e}:e}function v(e){return e.length===3}function y(e){return e!=null}function b(){}var x=class{constructor(){this._map=new Map}get(e,t){let n=this._map.get(e);if(n)return n.get(t)}getFallback(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.has(t)||r.set(t,n),r.get(t)}set(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.set(t,n),this}has(e,t){return this._map.get(e)?.has(t)}delete(e,t){return this._map.get(e)?.delete(t)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,n])=>Array.from(n.entries()).map(([n,r])=>e(r,t,n)))}},S=class extends Map{getFallback(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}map(e){let t=[];return this.forEach((n,r)=>{t.push(e(n,r))}),t}flatMap(e){let t=[];return this.forEach((n,r)=>{t.push(...e(n,r))}),t}};function C(e){return d(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(e=>e[1]!=null)}function w(e){return Array.isArray(e)?e.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?e.map(e=>C(e)):[e]:[C(e)]}function T(e){return e.filter(([t,n],r)=>{if(t.startsWith(`$$`))return!1;for(let i=r-1;i>=0;i--)if(e[i][0]===t&&e[i][1]===n)return!1;return!0})}var E=`__virtual_key__`;function D(e){return e==null?``:T(e).map(([e,t])=>t!=null&&typeof t!=`function`?e===`__virtual_key__`?t:`${e}:${t};`:void 0).filter(Boolean).join(``)}function O(e){return e&&typeof e==`object`&&!Array.isArray(e)}function k(e,t,n=!1){let r=e,i=t;if(Array.isArray(i))return n&&Array.isArray(i)?[...r,...i]:[...i];let a={...r};return O(r)&&O(i)&&Object.keys(i).forEach(e=>{O(r[e])&&O(i[e])||Array.isArray(r[e])&&Array.isArray(i[e])?a[e]=k(r[e],i[e],n):Object.assign(a,{[e]:i[e]})}),a}function A(e){let t,n,r;if(Array.isArray(e)){for(n=Array.from({length:t=e.length});t--;)n[t]=(r=e[t])&&typeof r==`object`?A(r):r;return n}if(Object.prototype.toString.call(e)===`[object Object]`){for(t in n={},e)t===`__proto__`?Object.defineProperty(n,t,{value:A(e[t]),configurable:!0,enumerable:!0,writable:!0}):n[t]=(r=e[t])&&typeof r==`object`?A(r):r;return n}return e}function ee(e){return d(e[0])}function te(e){return d(e[0])}var j={};function ne(e=[`-`,`:`]){let t=e.join(`|`);return j[t]||(j[t]=RegExp(`((?:[!@*<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${t})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,`gm`)),j[t].lastIndex=0,j[t]}function re(e,t=[`-`,`:`],n=5){let r=ne(t),i,a=e.toString(),o=new Set,s=new Map;do i=!1,a=a.replace(r,(e,n,r,a,c)=>{if(!t.includes(r))return e;i=!0,o.add(n+r);let l=c+n.length+r.length+1,u={length:e.length,items:[]};s.set(c,u);for(let e of[...a.matchAll(/\S+/g)]){let t=l+e.index,i=s.get(t)?.items;i?s.delete(t):i=[{offset:t,length:e[0].length,className:e[0]}];for(let e of i)e.className=e.className===`~`?r===`:`?`${n}${r}~`:n:e.className.replace(/^(!?)(.*)/,`$1${n}${r}$2`),u.items.push(e)}return`$`.repeat(e.length)}),--n;while(i&&n);let c;if(typeof e==`string`){c=``;let t=0;for(let[n,r]of s)c+=e.slice(t,n),c+=r.items.map(e=>e.className).join(` `),t=n+r.length;c+=e.slice(t)}else{c=e;for(let[e,t]of s)c.overwrite(e,e+t.length,t.items.map(e=>e.className).join(` `))}return{prefixes:Array.from(o),hasChanged:i,groupsByOffset:s,get expanded(){return c.toString()}}}function ie(e,t=[`-`,`:`],n=5){let r=re(e,t,n);return typeof e==`string`?r.expanded:e}var ae=new Set;function oe(e){ae.has(e)||(console.warn(`[unocss]`,e),ae.add(e))}function M(e){return c(e).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var N=`_uno_resolved`;async function se(e){let t=typeof e==`function`?await e():await e;if(N in t)return t;t={...t},Object.defineProperty(t,N,{value:!0,enumerable:!1});let n=t.shortcuts?M(t.shortcuts):void 0;if(t.shortcuts=n,t.prefix||t.layer){let e=e=>{e[2]||={};let n=e[2];n.prefix==null&&t.prefix&&(n.prefix=c(t.prefix)),n.layer==null&&t.layer&&(n.layer=t.layer)};n?.forEach(e),t.rules?.forEach(e)}return t}async function P(e){let t=await se(e);return t.presets?[t,...(await Promise.all((t.presets||[]).flatMap(c).flatMap(P))).flat()]:[t]}function ce(e){if(e.length===0)return{};let t=[],n=[],r=!1,i=[],a=[];for(let o of e){if(o.pipeline===!1){r=!0;break}else o.pipeline?.include&&t.push(o.pipeline.include),o.pipeline?.exclude&&n.push(o.pipeline.exclude);o.filesystem&&i.push(o.filesystem),o.inline&&a.push(o.inline)}let o={pipeline:r?!1:{include:l(I(...t)),exclude:l(I(...n))}};return i.length&&(o.filesystem=l(i.flat())),a.length&&(o.inline=l(a.flat())),o}async function F(e={},t={}){let n=Object.assign({},t,e),r=u((await Promise.all((n.presets||[]).flatMap(c).flatMap(P))).flat(),(e,t)=>e.name===t.name),a=[...r.filter(e=>e.enforce===`pre`),...r.filter(e=>!e.enforce),...r.filter(e=>e.enforce===`post`)],o=[...a,n],d=[...o].reverse(),f=Object.assign({},i,...o.map(e=>e.layers));function p(e){return l(o.flatMap(t=>c(t[e]||[])))}let m=p(`extractors`),h=d.find(e=>e.extractorDefault!==void 0)?.extractorDefault;h===void 0&&(h=s),h&&!m.includes(h)&&m.unshift(h),m.sort((e,t)=>(e.order||0)-(t.order||0));let g=p(`rules`),v=g.length,y={},b=[];for(let[e,t]of g.entries()){let n=t[2]??={};n.__index=e,ee(t)?c(n.prefix??``).forEach(e=>{y[e+t[0]]=t}):b.unshift(t)}let x={templates:l(o.flatMap(e=>c(e.autocomplete?.templates))),extractors:o.flatMap(e=>c(e.autocomplete?.extractors)).sort((e,t)=>(e.order||0)-(t.order||0)),shorthands:ue(o.map(e=>e.autocomplete?.shorthands||{}))},S=p(`separators`);S.length||(S=[`:`,`-`]);let C=ce(p(`content`)),w={mergeSelectors:!0,warn:!0,sortLayers:e=>e,...n,blocklist:p(`blocklist`),presets:a,envMode:n.envMode||`build`,shortcutsLayer:n.shortcutsLayer||`shortcuts`,layers:f,theme:le(o.map(e=>e.theme)),rules:g,rulesSize:v,rulesDynamic:b,rulesStaticMap:y,preprocess:p(`preprocess`),postprocess:p(`postprocess`),preflights:p(`preflights`),autocomplete:x,variants:p(`variants`).map(_).sort((e,t)=>(e.order||0)-(t.order||0)),shortcuts:M(p(`shortcuts`)).reverse(),extractors:m,safelist:p(`safelist`),separators:S,details:n.details??n.envMode===`dev`,content:C,transformers:u(p(`transformers`),(e,t)=>e.name===t.name)},T=p(`extendTheme`);for(let e of T)w.theme=e(w.theme,w)||w.theme;for(let e of o)e?.configResolved?.(w);return w}function le(e){return e.map(e=>e?A(e):{}).reduce((e,t)=>k(e,t),{})}function ue(e){return e.reduce((e,t)=>{let n={};for(let e in t){let r=t[e];Array.isArray(r)?n[e]=`(${r.join(`|`)})`:n[e]=r}return{...e,...n}},{})}function I(...e){return e.flatMap(de)}function de(e){return Array.isArray(e)?e:e?[e]:[]}function fe(e){return e}var pe=`66.6.6`,L={shortcutsNoMerge:`$$symbol-shortcut-no-merge`,noMerge:`$$symbol-no-merge`,noScope:`$$symbol-no-scope`,variants:`$$symbol-variants`,parent:`$$symbol-parent`,selector:`$$symbol-selector`,layer:`$$symbol-layer`,sort:`$$symbol-sort`,body:`$$symbol-body`},me=class e{constructor(e={},t={}){this.userConfig=e,this.defaults=t,this.version=pe,this.events=g(),this.config=void 0,this.cache=new Map,this.blocked=new Set,this.parentOrders=new Map,this.activatedRules=new Set,this.resolveCSSResult=(e,t,n,r)=>{let i=w(t).filter(e=>e.length);if(i.length){this.config.details&&r.rules.push(n),r.generator.activatedRules.add(n);let t=n[2];return i.map(n=>{if(d(n))return[t.__index,n,t];let i=r.variantHandlers,a=t,o=e=>{i=[e,...i]},s=e=>{a={...a,...e}};for(let e of n)switch(e[0]){case L.variants:i=typeof e[1]==`function`?e[1](i)||i:[...c(e[1]),...i];break;case L.parent:o({parent:e[1]});break;case L.selector:o({selector:e[1]});break;case L.layer:o({layer:e[1]});break;case L.sort:s({sort:e[1]});break;case L.noMerge:s({noMerge:e[1]});break;case L.noScope:s({noScope:e[1]});break;case L.body:e[0]=E;break}return[t.__index,e,n,a,i]})}}}static async create(t={},n={}){let r=new e(t,n);return r.config=await F(r.userConfig,r.defaults),r.events.emit(`config`,r.config),r}async setConfig(e,t){e&&(t&&(this.defaults=t),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await F(e,this.defaults),this.events.emit(`config`,this.config))}async applyExtractors(e,t,n=new Set){let r={original:e,code:e,id:t,extracted:n,envMode:this.config.envMode};for(let e of this.config.extractors){let t=await e.extract?.(r);if(t)if(p(t)&&p(n))for(let e of t)n.setCount(e,n.getCount(e)+t.getCount(e));else for(let e of t)n.add(e)}return n}makeContext(e,t){let n={rawSelector:e,currentSelector:t[1],theme:this.config.theme,generator:this,symbols:L,variantHandlers:t[2],constructCSS:(...e)=>this.constructCustomCSS(n,...e),variantMatch:t};return n}async parseToken(e,t){if(this.blocked.has(e))return;let n=`${e}${t?` ${t}`:``}`;if(this.cache.has(n))return this.cache.get(n);let r=this.config.preprocess.reduce((e,t)=>t(e)??e,e);if(this.isBlocked(r)){this.blocked.add(e),this.cache.set(n,null);return}let i=await this.matchVariants(e,r);if(i.every(e=>!e||this.isBlocked(e[1]))){this.blocked.add(e),this.cache.set(n,null);return}let a=async n=>{let r=this.makeContext(e,[t||n[0],n[1],n[2],n[3]]);this.config.details&&(r.variants=[...n[3]]);let i=await this.expandShortcut(r.currentSelector,r);return i?await this.stringifyShortcuts(r.variantMatch,r,i[0],i[1]):(await this.parseUtil(r.variantMatch,r))?.flatMap(e=>this.stringifyUtil(e,r)).filter(y)},o=(await Promise.all(i.map(e=>a(e)))).flat().filter(e=>!!e);if(o?.length)return this.cache.set(n,o),o;this.cache.set(n,null)}async generate(e,r={}){let{id:i,scope:a,preflights:o=!0,safelist:s=!0,minify:c=!1,extendedInfo:u=!1}=r,m=d(e)?await this.applyExtractors(e,i,u?new f:new Set):Array.isArray(e)?new Set(e):e;if(s){let e={generator:this,theme:this.config.theme};this.config.safelist.flatMap(t=>typeof t==`function`?t(e):t).forEach(e=>{let t=e.trim();t&&!m.has(t)&&m.add(t)})}let h=c?``:`
2
+ import{a as e}from"./json-editor-vue-mpqfj7dd.js";var t=`default`,n=`preflights`,r=`shortcuts`,i={imports:-200,[n]:-100,[r]:-10,[t]:0},a=/[\\:]?[\s'"`;{}]+/g;function o(e){return e.split(a)}var s={name:`@unocss/core/extractor-split`,order:0,extract({code:e}){return o(e)}};function c(e=[]){return Array.isArray(e)?e:[e]}function l(e){return Array.from(new Set(e))}function u(e,t){return e.reduce((e,n)=>(e.findIndex(e=>t(n,e))===-1&&e.push(n),e),[])}function d(e){return typeof e==`string`}var f=class extends Set{constructor(e){if(super(),this._map=new Map,e)for(let t of e)this.add(t)}add(e){return this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.has(e)?(this._map.delete(e),super.delete(e)):!1}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,t){return this._map.set(e,t),super.add(e)}};function p(e){return e instanceof f}function m(e){let t=e.length,n=-1,r,i=``,a=e.charCodeAt(0);for(;++n<t;){if(r=e.charCodeAt(n),r===0){i+=`�`;continue}if(r===37){i+=`\\%`;continue}if(r===44){i+=`\\,`;continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&a===45){i+=`\\${r.toString(16)} `;continue}if(n===0&&t===1&&r===45){i+=`\\${e.charAt(n)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){i+=e.charAt(n);continue}i+=`\\${e.charAt(n)}`}return i}var h=m;function g(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(e=>e(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}}}function _(e){return typeof e==`function`?{match:e}:e}function v(e){return e.length===3}function y(e){return e!=null}function b(){}var x=class{constructor(){this._map=new Map}get(e,t){let n=this._map.get(e);if(n)return n.get(t)}getFallback(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.has(t)||r.set(t,n),r.get(t)}set(e,t,n){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.set(t,n),this}has(e,t){return this._map.get(e)?.has(t)}delete(e,t){return this._map.get(e)?.delete(t)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,n])=>Array.from(n.entries()).map(([n,r])=>e(r,t,n)))}},S=class extends Map{getFallback(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}map(e){let t=[];return this.forEach((n,r)=>{t.push(e(n,r))}),t}flatMap(e){let t=[];return this.forEach((n,r)=>{t.push(...e(n,r))}),t}};function C(e){return d(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(e=>e[1]!=null)}function w(e){return Array.isArray(e)?e.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?e.map(e=>C(e)):[e]:[C(e)]}function T(e){return e.filter(([t,n],r)=>{if(t.startsWith(`$$`))return!1;for(let i=r-1;i>=0;i--)if(e[i][0]===t&&e[i][1]===n)return!1;return!0})}var E=`__virtual_key__`;function D(e){return e==null?``:T(e).map(([e,t])=>t!=null&&typeof t!=`function`?e===`__virtual_key__`?t:`${e}:${t};`:void 0).filter(Boolean).join(``)}function O(e){return e&&typeof e==`object`&&!Array.isArray(e)}function k(e,t,n=!1){let r=e,i=t;if(Array.isArray(i))return n&&Array.isArray(i)?[...r,...i]:[...i];let a={...r};return O(r)&&O(i)&&Object.keys(i).forEach(e=>{O(r[e])&&O(i[e])||Array.isArray(r[e])&&Array.isArray(i[e])?a[e]=k(r[e],i[e],n):Object.assign(a,{[e]:i[e]})}),a}function A(e){let t,n,r;if(Array.isArray(e)){for(n=Array.from({length:t=e.length});t--;)n[t]=(r=e[t])&&typeof r==`object`?A(r):r;return n}if(Object.prototype.toString.call(e)===`[object Object]`){for(t in n={},e)t===`__proto__`?Object.defineProperty(n,t,{value:A(e[t]),configurable:!0,enumerable:!0,writable:!0}):n[t]=(r=e[t])&&typeof r==`object`?A(r):r;return n}return e}function ee(e){return d(e[0])}function te(e){return d(e[0])}var j={};function ne(e=[`-`,`:`]){let t=e.join(`|`);return j[t]||(j[t]=RegExp(`((?:[!@*<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${t})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,`gm`)),j[t].lastIndex=0,j[t]}function re(e,t=[`-`,`:`],n=5){let r=ne(t),i,a=e.toString(),o=new Set,s=new Map;do i=!1,a=a.replace(r,(e,n,r,a,c)=>{if(!t.includes(r))return e;i=!0,o.add(n+r);let l=c+n.length+r.length+1,u={length:e.length,items:[]};s.set(c,u);for(let e of[...a.matchAll(/\S+/g)]){let t=l+e.index,i=s.get(t)?.items;i?s.delete(t):i=[{offset:t,length:e[0].length,className:e[0]}];for(let e of i)e.className=e.className===`~`?r===`:`?`${n}${r}~`:n:e.className.replace(/^(!?)(.*)/,`$1${n}${r}$2`),u.items.push(e)}return`$`.repeat(e.length)}),--n;while(i&&n);let c;if(typeof e==`string`){c=``;let t=0;for(let[n,r]of s)c+=e.slice(t,n),c+=r.items.map(e=>e.className).join(` `),t=n+r.length;c+=e.slice(t)}else{c=e;for(let[e,t]of s)c.overwrite(e,e+t.length,t.items.map(e=>e.className).join(` `))}return{prefixes:Array.from(o),hasChanged:i,groupsByOffset:s,get expanded(){return c.toString()}}}function ie(e,t=[`-`,`:`],n=5){let r=re(e,t,n);return typeof e==`string`?r.expanded:e}var ae=new Set;function oe(e){ae.has(e)||(console.warn(`[unocss]`,e),ae.add(e))}function M(e){return c(e).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var N=`_uno_resolved`;async function se(e){let t=typeof e==`function`?await e():await e;if(N in t)return t;t={...t},Object.defineProperty(t,N,{value:!0,enumerable:!1});let n=t.shortcuts?M(t.shortcuts):void 0;if(t.shortcuts=n,t.prefix||t.layer){let e=e=>{e[2]||={};let n=e[2];n.prefix==null&&t.prefix&&(n.prefix=c(t.prefix)),n.layer==null&&t.layer&&(n.layer=t.layer)};n?.forEach(e),t.rules?.forEach(e)}return t}async function P(e){let t=await se(e);return t.presets?[t,...(await Promise.all((t.presets||[]).flatMap(c).flatMap(P))).flat()]:[t]}function ce(e){if(e.length===0)return{};let t=[],n=[],r=!1,i=[],a=[];for(let o of e){if(o.pipeline===!1){r=!0;break}else o.pipeline?.include&&t.push(o.pipeline.include),o.pipeline?.exclude&&n.push(o.pipeline.exclude);o.filesystem&&i.push(o.filesystem),o.inline&&a.push(o.inline)}let o={pipeline:r?!1:{include:l(I(...t)),exclude:l(I(...n))}};return i.length&&(o.filesystem=l(i.flat())),a.length&&(o.inline=l(a.flat())),o}async function F(e={},t={}){let n=Object.assign({},t,e),r=u((await Promise.all((n.presets||[]).flatMap(c).flatMap(P))).flat(),(e,t)=>e.name===t.name),a=[...r.filter(e=>e.enforce===`pre`),...r.filter(e=>!e.enforce),...r.filter(e=>e.enforce===`post`)],o=[...a,n],d=[...o].reverse(),f=Object.assign({},i,...o.map(e=>e.layers));function p(e){return l(o.flatMap(t=>c(t[e]||[])))}let m=p(`extractors`),h=d.find(e=>e.extractorDefault!==void 0)?.extractorDefault;h===void 0&&(h=s),h&&!m.includes(h)&&m.unshift(h),m.sort((e,t)=>(e.order||0)-(t.order||0));let g=p(`rules`),v=g.length,y={},b=[];for(let[e,t]of g.entries()){let n=t[2]??={};n.__index=e,ee(t)?c(n.prefix??``).forEach(e=>{y[e+t[0]]=t}):b.unshift(t)}let x={templates:l(o.flatMap(e=>c(e.autocomplete?.templates))),extractors:o.flatMap(e=>c(e.autocomplete?.extractors)).sort((e,t)=>(e.order||0)-(t.order||0)),shorthands:ue(o.map(e=>e.autocomplete?.shorthands||{}))},S=p(`separators`);S.length||(S=[`:`,`-`]);let C=ce(p(`content`)),w={mergeSelectors:!0,warn:!0,sortLayers:e=>e,...n,blocklist:p(`blocklist`),presets:a,envMode:n.envMode||`build`,shortcutsLayer:n.shortcutsLayer||`shortcuts`,layers:f,theme:le(o.map(e=>e.theme)),rules:g,rulesSize:v,rulesDynamic:b,rulesStaticMap:y,preprocess:p(`preprocess`),postprocess:p(`postprocess`),preflights:p(`preflights`),autocomplete:x,variants:p(`variants`).map(_).sort((e,t)=>(e.order||0)-(t.order||0)),shortcuts:M(p(`shortcuts`)).reverse(),extractors:m,safelist:p(`safelist`),separators:S,details:n.details??n.envMode===`dev`,content:C,transformers:u(p(`transformers`),(e,t)=>e.name===t.name)},T=p(`extendTheme`);for(let e of T)w.theme=e(w.theme,w)||w.theme;for(let e of o)e?.configResolved?.(w);return w}function le(e){return e.map(e=>e?A(e):{}).reduce((e,t)=>k(e,t),{})}function ue(e){return e.reduce((e,t)=>{let n={};for(let e in t){let r=t[e];Array.isArray(r)?n[e]=`(${r.join(`|`)})`:n[e]=r}return{...e,...n}},{})}function I(...e){return e.flatMap(de)}function de(e){return Array.isArray(e)?e:e?[e]:[]}function fe(e){return e}var pe=`66.6.7`,L={shortcutsNoMerge:`$$symbol-shortcut-no-merge`,noMerge:`$$symbol-no-merge`,noScope:`$$symbol-no-scope`,variants:`$$symbol-variants`,parent:`$$symbol-parent`,selector:`$$symbol-selector`,layer:`$$symbol-layer`,sort:`$$symbol-sort`,body:`$$symbol-body`},me=class e{constructor(e={},t={}){this.userConfig=e,this.defaults=t,this.version=pe,this.events=g(),this.config=void 0,this.cache=new Map,this.blocked=new Set,this.parentOrders=new Map,this.activatedRules=new Set,this.resolveCSSResult=(e,t,n,r)=>{let i=w(t).filter(e=>e.length);if(i.length){this.config.details&&r.rules.push(n),r.generator.activatedRules.add(n);let t=n[2];return i.map(n=>{if(d(n))return[t.__index,n,t];let i=r.variantHandlers,a=t,o=e=>{i=[e,...i]},s=e=>{a={...a,...e}};for(let e of n)switch(e[0]){case L.variants:i=typeof e[1]==`function`?e[1](i)||i:[...c(e[1]),...i];break;case L.parent:o({parent:e[1]});break;case L.selector:o({selector:e[1]});break;case L.layer:o({layer:e[1]});break;case L.sort:s({sort:e[1]});break;case L.noMerge:s({noMerge:e[1]});break;case L.noScope:s({noScope:e[1]});break;case L.body:e[0]=E;break}return[t.__index,e,n,a,i]})}}}static async create(t={},n={}){let r=new e(t,n);return r.config=await F(r.userConfig,r.defaults),r.events.emit(`config`,r.config),r}async setConfig(e,t){e&&(t&&(this.defaults=t),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await F(e,this.defaults),this.events.emit(`config`,this.config))}async applyExtractors(e,t,n=new Set){let r={original:e,code:e,id:t,extracted:n,envMode:this.config.envMode};for(let e of this.config.extractors){let t=await e.extract?.(r);if(t)if(p(t)&&p(n))for(let e of t)n.setCount(e,n.getCount(e)+t.getCount(e));else for(let e of t)n.add(e)}return n}makeContext(e,t){let n={rawSelector:e,currentSelector:t[1],theme:this.config.theme,generator:this,symbols:L,variantHandlers:t[2],constructCSS:(...e)=>this.constructCustomCSS(n,...e),variantMatch:t};return n}async parseToken(e,t){if(this.blocked.has(e))return;let n=`${e}${t?` ${t}`:``}`;if(this.cache.has(n))return this.cache.get(n);let r=this.config.preprocess.reduce((e,t)=>t(e)??e,e);if(this.isBlocked(r)){this.blocked.add(e),this.cache.set(n,null);return}let i=await this.matchVariants(e,r);if(i.every(e=>!e||this.isBlocked(e[1]))){this.blocked.add(e),this.cache.set(n,null);return}let a=async n=>{let r=this.makeContext(e,[t||n[0],n[1],n[2],n[3]]);this.config.details&&(r.variants=[...n[3]]);let i=await this.expandShortcut(r.currentSelector,r);return i?await this.stringifyShortcuts(r.variantMatch,r,i[0],i[1]):(await this.parseUtil(r.variantMatch,r))?.flatMap(e=>this.stringifyUtil(e,r)).filter(y)},o=(await Promise.all(i.map(e=>a(e)))).flat().filter(e=>!!e);if(o?.length)return this.cache.set(n,o),o;this.cache.set(n,null)}async generate(e,r={}){let{id:i,scope:a,preflights:o=!0,safelist:s=!0,minify:c=!1,extendedInfo:u=!1}=r,m=d(e)?await this.applyExtractors(e,i,u?new f:new Set):Array.isArray(e)?new Set(e):e;if(s){let e={generator:this,theme:this.config.theme};this.config.safelist.flatMap(t=>typeof t==`function`?t(e):t).forEach(e=>{let t=e.trim();t&&!m.has(t)&&m.add(t)})}let h=c?``:`
3
3
  `,g=new Set([t]),_=u?new Map:new Set,v=new Map,b={},x=Array.from(m).map(async e=>{if(_.has(e))return;let t=await this.parseToken(e);if(t!=null){_ instanceof Map?_.set(e,{data:t,count:p(m)?m.getCount(e):-1}):_.add(e);for(let e of t){let t=e[3]||``,n=e[4]?.layer;v.has(t)||v.set(t,[]),v.get(t).push(e),n&&g.add(n)}}});await Promise.all(x),await(async()=>{if(!o)return;let e={generator:this,theme:this.config.theme},t=new Set([]);this.config.preflights.forEach(({layer:e=n})=>{g.add(e),t.add(e)}),b=Object.fromEntries(await Promise.all(Array.from(t).map(async t=>[t,(await Promise.all(this.config.preflights.filter(e=>(e.layer||`preflights`)===t).map(async t=>await t.getCSS(e)))).filter(Boolean).join(h)])))})();let S=e=>this.config.sortLayers(e.sort((e,t)=>(this.config.layers[e]??0)-(this.config.layers[t]??0)||e.localeCompare(t))),C=S(Array.from(g)),w={},T=this.config.outputToCssLayers,E=e=>{let t=e;return typeof T==`object`&&(t=T.cssLayerName?.(e)),t===null?null:t??e},D=(e=t)=>{if(w[e])return w[e];let n=Array.from(v).sort((e,t)=>(this.parentOrders.get(e[0])??0)-(this.parentOrders.get(t[0])??0)||e[0]?.localeCompare(t[0]||``)||0).map(([t,n])=>{let r=n.length,i=n.filter(t=>(t[4]?.layer||`default`)===e).sort((e,t)=>e[0]-t[0]||(e[4]?.sort||0)-(t[4]?.sort||0)||e[5]?.currentSelector?.localeCompare(t[5]?.currentSelector??``)||e[1]?.localeCompare(t[1]||``)||e[2]?.localeCompare(t[2]||``)||0).map(([,e,t,,n,,r])=>[[[(e&&!n?.noScope?_e(e,a):e)??``,n?.sort??0]],t,!!(r??n?.noMerge)]);if(!i.length)return;let o=i.reverse().map(([e,t,n],a)=>{if(!n&&this.config.mergeSelectors)for(let n=a+1;n<r;n++){let r=i[n];if(r&&!r[2]&&(e&&r[0]||e==null&&r[0]==null)&&r[1]===t)return e&&r[0]&&r[0].push(...e),null}let o=e?l(e.sort((e,t)=>e[1]-t[1]||e[0]?.localeCompare(t[0]||``)||0).map(e=>e[0]).filter(Boolean)):[];return o.length?`${o.join(`,${h}`)}{${t}}`:t}).filter(Boolean),s=Array.from(new Set(o)).reverse().join(h);if(!t)return s;let c=t.split(` $$ `);return`${c.join(`{`)}{${h}${s}${h}${`}`.repeat(c.length)}`}).filter(Boolean).join(h);o&&(n=[b[e],n].filter(Boolean).join(h));let r;T&&n&&(r=E(e),r!==null&&(n=`@layer ${r}{${h}${n}${h}}`));let i=c?``:`/* layer: ${e}${r&&r!==e?`, alias: ${r}`:``} */${h}`;return w[e]=n?i+n:``},O=(e=C,t)=>{let n=e.filter(e=>!t?.includes(e)),r=n.map(D).filter(Boolean);if(T){let e=n;typeof T==`object`&&T.allLayers&&(e=S(Object.keys(this.config.layers))),e.length>0&&r.unshift(`@layer ${e.map(E).filter(y).join(`, `)};`)}return r.join(h)};return{get css(){return O()},layers:C,matched:_,getLayers:O,getLayer:D,setLayer:async(e,t)=>{let n=await t(D(e));return w[e]=n,n}}}async matchVariants(e,t){let n={rawSelector:e,theme:this.config.theme,generator:this},r=async t=>{let i=!0,[,,a,o]=t;for(;i;){i=!1;let s=t[1];for(let e of this.config.variants){if(!e.multiPass&&o.has(e))continue;let c=await e.match(s,n);if(c){if(d(c)){if(c===s)continue;c={matcher:c}}if(Array.isArray(c)){if(!c.length)continue;if(c.length===1)c=c[0];else{if(e.multiPass)throw Error(`multiPass can not be used together with array return variants`);let n=c.map(n=>{let r=n.matcher??s,i=[n,...a],c=new Set(o);return c.add(e),[t[0],r,i,c]});return(await Promise.all(n.map(e=>r(e)))).flat()}}t[1]=c.matcher??s,a.unshift(c),o.add(e),i=!0;break}}if(!i)break;if(a.length>500)throw Error(`Too many variants applied to "${e}"`)}return[t]};return await r([e,t||e,[],new Set])}applyVariants(e,t=e[4],n=e[1]){let r=t.slice().sort((e,t)=>(e.order||0)-(t.order||0)).reduceRight((e,t)=>n=>{let r=t.body?.(n.entries)||n.entries,i=Array.isArray(t.parent)?t.parent:[t.parent,void 0],a=t.selector?.(n.selector,r);return(t.handle??ye)({...n,entries:r,selector:a||n.selector,parent:i[0]||n.parent,parentOrder:i[1]||n.parentOrder,layer:t.layer||n.layer,sort:t.sort||n.sort},e)},e=>e)({prefix:``,selector:ve(n),pseudo:``,entries:e[2]}),{parent:i,parentOrder:a}=r;i!=null&&a!=null&&this.parentOrders.set(i,a);let o={selector:[r.prefix,r.selector,r.pseudo].join(``),entries:r.entries,parent:i,layer:r.layer,sort:r.sort,noMerge:r.noMerge};return this.config.postprocess.reduce((e,t)=>{let n=[];for(let r of e){let e=t(r);Array.isArray(e)?n.push(...e.filter(y)):n.push(e||r)}return n},[o])}constructCustomCSS(e,t,n){let r=C(t);return d(r)?r:this.applyVariants([0,n||e.rawSelector,r,void 0,e.variantHandlers]).map(({selector:e,entries:t,parent:n})=>{let r=`${e}{${D(t)}}`;return n?`${n}{${r}}`:r}).join(``)}async parseUtil(e,t,n=!1,r){let i=d(e)?await this.matchVariants(e):[e],a=async([e,i,a])=>{this.config.details&&(t.rules=t.rules??[]);let o={...t,variantHandlers:a},s=this.config.rulesStaticMap[i];if(s&&s[1]&&(n||!s[2]?.internal))return this.resolveCSSResult(e,s[1],s,o);for(let t of this.config.rulesDynamic){let[a,s,l]=t;if(l?.internal&&!n)continue;let u=i;if(l?.prefix){let e=c(l.prefix);if(r){let t=c(r);if(!e.some(e=>t.includes(e)))continue}else{let t=e.find(e=>i.startsWith(e));if(t==null)continue;u=i.slice(t.length)}}let d=u.match(a);if(!d)continue;let f=await s(d,o);if(!f)continue;if(typeof f!=`string`)if(Symbol.asyncIterator in f){let e=[];for await(let t of f)t&&e.push(t);f=e}else Symbol.iterator in f&&!Array.isArray(f)&&(f=Array.from(f).filter(y));let p=this.resolveCSSResult(e,f,t,o);if(p)return p}},o=(await Promise.all(i.map(e=>a(e)))).flat().filter(e=>!!e);if(o.length)return o}stringifyUtil(e,t){if(!e)return;if(v(e))return[[e[0],void 0,e[1],void 0,e[2],this.config.details?t:void 0,void 0]];let n=this.applyVariants(e),r=[];for(let i of n){let{selector:n,entries:a,parent:o,layer:s,sort:c,noMerge:l}=i,u=D(a);if(!u)continue;let{layer:d,sort:f,...p}=e[3]??{},m={...p,layer:s??d,sort:c??f};r.push([e[0],n,u,o,m,this.config.details?t:void 0,l])}return r}async expandShortcut(e,t,n=5){if(n===0)return;let r=this.config.details?e=>{t.shortcuts=t.shortcuts??[],t.shortcuts.push(e)}:b,i,a,o,s;for(let n of this.config.shortcuts){let o=e;if(n[2]?.prefix){let t=c(n[2].prefix).find(t=>e.startsWith(t));if(t==null)continue;o=e.slice(t.length)}if(te(n)){if(n[0]===o){i||=n[2],a=n[1],r(n);break}}else{let e=o.match(n[0]);if(e&&(a=n[1](e,t)),a){i||=n[2],r(n);break}}}if(a&&(o=l(c(a).filter(d).map(e=>ie(e.trim()).split(/\s+/g)).flat()),s=c(a).filter(e=>!d(e)).map(e=>({handles:[],value:e}))),!a){let r=d(e)?await this.matchVariants(e):[e];for(let e of r){let[r,i,a]=e;if(r!==i){let e=await this.expandShortcut(i,t,n-1);e&&(o=e[0].filter(d).map(e=>r.replace(i,e)),s=e[0].filter(e=>!d(e)).map(e=>({handles:[...e.handles,...a],value:e.value})))}}}if(!(!o?.length&&!s?.length))return[[await Promise.all(c(o).map(async e=>(await this.expandShortcut(e,t,n-1))?.[0]||[e])),s].flat(2).filter(e=>!!e),i]}async stringifyShortcuts(e,t,n,r={layer:this.config.shortcutsLayer}){let i=new S,a=(await Promise.all(l(n).map(async n=>{let i=d(n)?await this.parseUtil(n,t,!0,r.prefix):[[1/0,`{inline}`,C(n.value),void 0,n.handles]];return!i&&this.config.warn&&oe(`unmatched utility "${n}" in shortcut "${e[1]}"`),i||[]}))).flat(1).filter(Boolean).sort((e,t)=>e[0]-t[0]),[o,,s]=e,c=[];for(let e of a){if(v(e)){c.push([e[0],void 0,e[1],void 0,e[2],t,void 0]);continue}let n=Object.fromEntries(e[2])[L.shortcutsNoMerge],a=[...e[4],...n?[]:s];for(let{selector:t,entries:n,parent:s,sort:c,noMerge:l,layer:u}of this.applyVariants(e,a,o))i.getFallback(u??r.layer,new x).getFallback(t,s,[[],e[0]])[0].push([n,!!(l??e[3]?.noMerge),c??0])}return c.concat(i.flatMap((e,n)=>e.map(([e,i],a,o)=>{let s=(e,s,c)=>{let l=Math.max(...c.map(e=>e[1])),u=c.map(e=>e[0]);return(e?[u.flat(1)]:u).map(e=>{let c=D(e);if(c)return[i,a,c,o,{...r,noMerge:s,sort:l,layer:n},t,void 0]})};return[[e.filter(([,e])=>e).map(([e,,t])=>[e,t]),!0],[e.filter(([,e])=>!e).map(([e,,t])=>[e,t]),!1]].map(([e,t])=>[...s(!1,t,e.filter(([e])=>e.some(e=>e[0]===L.shortcutsNoMerge))),...s(!0,t,e.filter(([e])=>e.every(e=>e[0]!==L.shortcutsNoMerge)))])}).flat(2).filter(Boolean)))}isBlocked(e){return!e||this.config.blocklist.map(e=>Array.isArray(e)?e[0]:e).some(t=>typeof t==`function`?t(e):d(t)?t===e:t.test(e))}getBlocked(e){let t=this.config.blocklist.find(t=>{let n=Array.isArray(t)?t[0]:t;return typeof n==`function`?n(e):d(n)?n===e:n.test(e)});return t?Array.isArray(t)?t:[t,void 0]:void 0}};async function he(e,t){return await me.create(e,t)}var R=/\s\$\$\s+/g;function ge(e){return R.test(e)}function _e(e,t){return ge(e)?e.replace(R,t?` ${t} `:` `):t?`${t} ${e}`:e}var z=/^\[(.+?)(~?=)"(.*)"\]$/;function ve(e){return z.test(e)?e.replace(z,(e,t,n,r)=>`[${h(t)}${n}"${h(r)}"]`):`.${h(e)}`}function ye(e,t){return t(e)}function be(e){return e.replace(/(['"])\s*\n\s*([^>\\/\s])/g,`$1 $2`).replace(/(["';{}><])\s*\n\s*/g,`$1`).replace(/\s*\n\s*/g,` `).replace(/\s+"/g,`"`).replace(/="\s+/g,`="`).replace(/(\s)+\/>/g,`/>`).trim()}var xe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Se=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function B(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(xe);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=Se.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}var Ce=Object.freeze({left:0,top:0,width:16,height:16}),V=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),H=Object.freeze({...Ce,...V}),we=Object.freeze({...H,body:``,hidden:!1}),Te=Object.freeze({width:null,height:null}),U=Object.freeze({...Te,...V});function Ee(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function De(e,t){return e?`<defs>`+e+`</defs>`+t:t}function Oe(e,t,n){let r=Ee(e);return De(r.defs,t+r.content+n)}var W=e=>e===`unset`||e===`undefined`||e===`none`;function ke(e,t){let n={...H,...e},r={...U,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=Oe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=B(d,c/l)):(u=o===`auto`?c:o,d=s===null?B(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{W(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Ae=/\swidth\s*=\s*["']([\w.]+)["']/,je=/\sheight\s*=\s*["']([\w.]+)["']/,G=/<svg\s+/;function Me(e,t,n){let r=e.slice(0,e.indexOf(`>`)),i=(e,i)=>{let a=i.exec(r),o=a!=null,s=t[e];return!s&&!W(s)&&(typeof n==`number`?n>0&&(t[e]=B(a?.[1]??`1em`,n)):a&&(t[e]=a[1])),o};return[i(`width`,Ae),i(`height`,je)]}async function K(e,t,n,r,i,a){let{scale:o,addXmlNs:s=!1}=r??{},{additionalProps:c={},iconCustomizer:l}=r?.customizations??{},u=await i?.()??{};await l?.(t,n,u),Object.keys(c).forEach(e=>{let t=c[e];t!=null&&(u[e]=t)}),a?.(u);let[d,f]=Me(e,u,o);s&&(!e.includes(`xmlns=`)&&!u.xmlns&&(u.xmlns=`http://www.w3.org/2000/svg`),!e.includes(`xmlns:xlink=`)&&e.includes(`xlink:`)&&!u[`xmlns:xlink`]&&(u[`xmlns:xlink`]=`http://www.w3.org/1999/xlink`));let p=Object.keys(u).map(e=>e===`width`&&d||e===`height`&&f?null:`${e}="${u[e]}"`).filter(e=>e!=null);if(p.length&&(e=e.replace(G,`<svg ${p.join(` `)} `)),r){let{defaultStyle:t,defaultClass:n}=r;n&&!e.includes(`class=`)&&(e=e.replace(G,`<svg class="${n}" `)),t&&!e.includes(`style=`)&&(e=e.replace(G,`<svg style="${t}" `))}let m=r?.usedProps;return m&&(Object.keys(c).forEach(e=>{let t=u[e];t!=null&&(m[e]=t)}),u.width!==void 0&&u.width!==null&&(m.width=u.width),u.height!==void 0&&u.height!==null&&(m.height=u.height)),e}async function q(e,t,n,r){let i;try{if(typeof e==`function`)i=await e(n);else{let t=e[n];i=typeof t==`function`?await t():t}}catch(e){console.warn(`Failed to load custom icon "${n}" in "${t}":`,e);return}if(i){let e=i.indexOf(`<svg`);e>0&&(i=i.slice(e));let{transform:a}=r?.customizations??{};return i=typeof a==`function`?await a(i,t,n):i,i.startsWith(`<svg`)?await K(r?.customizations?.trimCustomSvg===!0?be(i):i,t,n,r,void 0):(console.warn(`Custom icon "${n}" in "${t}" is not a valid SVG`),i)}}function Ne(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function J(e,t){let n=Ne(e,t);for(let r in we)r in V?r in e&&!(r in n)&&(n[r]=V[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Pe(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function Y(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=J(r[e]||i[e],a)}return o(t),n.forEach(o),J(e,a)}function Fe(e,t){if(e.icons[t])return Y(e,t,[]);let n=Pe(e,[t])[t];return n?Y(e,t,n):null}async function X(e,t,n,r){let i,{customize:a}=r?.customizations??{};for(let o of n)if(i=Fe(e,o),i){let e={...U};typeof a==`function`&&(i=Object.assign({},i),e=a(e,i,`${t}:${o}`)??e);let{attributes:{width:n,height:s,...c},body:l}=ke(i,e),u=r?.scale;return await K(`<svg >${l}</svg>`,t,o,r,()=>({...c}),e=>{let t=(t,n)=>{let r=e[t],i;if(!W(r)){if(r)return;typeof u==`number`?u&&(i=B(n??`1em`,u)):i=n}i?e[t]=i:delete e[t]};t(`width`,n),t(`height`,s)})}}var Z=async(e,t,n)=>{let r=n?.customCollections?.[e];if(r)if(typeof r==`function`){let i;try{i=await r(t)}catch(n){console.warn(`Failed to load custom icon "${t}" in "${e}":`,n);return}if(i){if(typeof i==`string`)return await q(()=>i,e,t,n);if(`icons`in i){let r=[t,t.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase(),t.replace(/([a-z])(\d+)/g,`$1-$2`)];return await X(i,e,r,n)}}}else return await q(r,e,t,n)};function Ie(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Q(e){let t=e.startsWith(`<svg>`)?e.replace(`<svg>`,`<svg >`):e;return!t.includes(` xmlns:xlink=`)&&t.includes(` xlink:`)&&(t=t.replace(`<svg `,`<svg xmlns:xlink="http://www.w3.org/1999/xlink" `)),t.includes(` xmlns=`)||(t=t.replace(`<svg `,`<svg xmlns="http://www.w3.org/2000/svg" `)),Ie(t)}function Le(){let e=typeof process<`u`&&process.stdout;return{isNode:e,isVSCode:e&&!!{}.VSCODE_CWD,isESLint:e&&!!{}.ESLINT}}var $=`academicons.akar-icons.ant-design.arcticons.basil.bi.bitcoin-icons.boxicons.bpmn.brandico.bubbles.bx.bxl.bxs.bytesize.carbon.catppuccin.cbi.charm.ci.cib.cif.cil.circle-flags.circum.clarity.codex.codicon.covid.cryptocurrency-color.cryptocurrency.cuida.dashicons.devicon-line.devicon-original.devicon-plain.devicon.dinkie-icons.duo-icons.ei.el.emblemicons.emojione-monotone.emojione-v1.emojione.entypo-social.entypo.eos-icons.ep.et.eva.f7.fa-brands.fa-regular.fa-solid.fa.fa6-brands.fa6-regular.fa6-solid.fa7-brands.fa7-regular.fa7-solid.fad.famicons.fe.feather.file-icons.flag.flagpack.flat-color-icons.flat-ui.flowbite.fluent-color.fluent-emoji-flat.fluent-emoji-high-contrast.fluent-emoji.fluent-mdl2.fluent.fontelico.fontisto.formkit.foundation.fxemoji.gala.game-icons.garden.geo.gg.gis.glyphs-poly.glyphs.gravity-ui.gridicons.grommet-icons.guidance.healthicons.heroicons-outline.heroicons-solid.heroicons.hugeicons.humbleicons.ic.icomoon-free.icon-park-outline.icon-park-solid.icon-park-twotone.icon-park.iconamoon.iconoir.icons8.il.ion.iwwa.ix.jam.la.lets-icons.line-md.lineicons.logos.ls.lsicon.lucide-lab.lucide.mage.majesticons.maki.map.marketeq.material-icon-theme.material-symbols-light.material-symbols.mdi-light.mdi.medical-icon.memory.meteocons.meteor-icons.mi.mingcute.mono-icons.mynaui.nimbus.nonicons.noto-v1.noto.nrk.octicon.oi.ooui.openmoji.oui.pajamas.pepicons-pencil.pepicons-pop.pepicons-print.pepicons.ph.picon.pixel.pixelarticons.prime.proicons.ps.qlementine-icons.quill.radix-icons.raphael.ri.rivet-icons.roentgen.si-glyph.si.sidekickicons.simple-icons.simple-line-icons.skill-icons.solar.stash.streamline-block.streamline-color.streamline-cyber-color.streamline-cyber.streamline-emojis.streamline-flex-color.streamline-flex.streamline-freehand-color.streamline-freehand.streamline-guidance.streamline-kameleon-color.streamline-logos.streamline-pixel.streamline-plump-color.streamline-plump.streamline-sharp-color.streamline-sharp.streamline-stickies-color.streamline-ultimate-color.streamline-ultimate.streamline.subway.svg-spinners.system-uicons.tabler.tdesign.teenyicons.temaki.token-branded.token.topcoat.twemoji.typcn.uil.uim.uis.uit.uiw.unjs.vaadin.vs.vscode-icons.websymbol.weui.whh.wi.wordpress.wpf.zmdi.zondicons`.split(`.`),Re=3;function ze(e){return fe((t={})=>{let{scale:n=1,mode:r=`auto`,prefix:i=`i-`,warn:a=!1,iconifyCollectionsNames:o,collections:s,extraProperties:c={},customizations:l={},autoInstall:u=!1,collectionsNodeResolvePath:d,layer:f=`icons`,unit:p,processor:m}=t,h=Le(),g={addXmlNs:!0,scale:n,customCollections:s,autoInstall:u,cwd:d,warn:void 0,customizations:{...l,additionalProps:{...c},trimCustomSvg:!0,async iconCustomizer(e,t,r){await l.iconCustomizer?.(e,t,r),p&&(r.width||=`${n}${p}`,r.height||=`${n}${p}`)}}},_;return{name:`@unocss/preset-icons`,enforce:`pre`,options:t,layers:{icons:-30},api:{encodeSvgForCss:Q,parseIconWithLoader:Ve},rules:[[/^([\w:-]+)(?:\?(mask|bg|auto))?$/,async n=>{let[i,s,c=r]=n;_||=await e(t);let l={},u=await Ve(s,_,{...g,usedProps:l},o);if(!u){a&&!h.isESLint&&oe(`failed to load icon "${i}"`);return}let d,f=`url("data:image/svg+xml;utf8,${Q(u.svg)}")`;return c===`auto`&&(c=u.svg.includes(`currentColor`)?`mask`:`bg`),d=c===`mask`?{"--un-icon":f,"-webkit-mask":`var(--un-icon) no-repeat`,mask:`var(--un-icon) no-repeat`,"-webkit-mask-size":`100% 100%`,"mask-size":`100% 100%`,"background-color":`currentColor`,color:`inherit`,...l}:{background:`${f} no-repeat`,"background-size":`100% 100%`,"background-color":`transparent`,...l},m?.(d,{...u,icon:u.name,mode:c}),d},{layer:f,prefix:i}]]}})}function Be(e,t,n=new Map){function r(r){if($.includes(r))return n.has(r)||n.set(r,e(`${t}@iconify-json/${r}/icons.json`)),n.get(r)}return async(e,t,n)=>{let i=await Z(e,t,n);if(i)return i;let a=await r(e);return a&&(i=await X(a,e,[t,t.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase(),t.replace(/([a-z])(\d+)/g,`$1-$2`)],n)),i}}async function Ve(e,t,n={},r=[]){let i=``,a=``,o,s=new Set([...$,...r,...Object.keys(n.customCollections||{})]);if(e.includes(`:`)){if([i,a]=e.split(`:`),!s.has(i))return;o=await t(i,a,n)}else{let r=e.split(/-/g);for(let e=Re;e>=1&&(i=r.slice(0,e).join(`-`),!(s.has(i)&&(a=r.slice(e).join(`-`),o=await t(i,a,n),o)));e--);}if(o)return{collection:i,name:a,svg:o}}async function He(t){let{$fetch:n}=await e(async()=>{let{$fetch:e}=await import(`../dist-duc3zu0y.js`).then(e=>e.n);return{$fetch:e}},__vite__mapDeps([0,1,2]),import.meta.url);return Be(n,t)}var Ue=ze(async e=>{let t=e?.customFetch,n=e?.cdn;return t&&n?Be(t,n):n?await He(n):Z});function We(e){return e.replace(/-(\w)/g,(e,t)=>t?t.toUpperCase():``)}function Ge(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ke(e){return e.replace(/(?:^|\B)([A-Z])/g,`-$1`).toLowerCase()}var qe=[`Webkit`,`Moz`,`ms`];function Je(e){let t={};function n(n){let r=t[n];if(r)return r;let i=We(n);if(i!==`filter`&&i in e)return t[n]=Ke(i);i=Ge(i);for(let r=0;r<qe.length;r++){let a=`${qe[r]}${i}`;if(a in e)return t[n]=Ke(Ge(a))}return n}return({entries:e})=>e.forEach(e=>{e[0].startsWith(`--`)||(e[0]=n(e[0]))})}function Ye(e){return e.replace(/&amp;/g,`&`).replace(/&gt;/g,`>`).replace(/&lt;/g,`<`)}async function Xe(e={}){if(typeof window>`u`){console.warn(`@unocss/runtime been used in non-browser environment, skipped.`);return}let t=window,n=window.document,r=()=>n.documentElement,i=t.__unocss||{},a=Object.assign({},e,i.runtime),o=a.defaults||{},s=a.cloakAttribute??`un-cloak`;a.autoPrefix&&(o.postprocess=c(o.postprocess)).unshift(Je(n.createElement(`div`).style)),a.configResolved?.(i,o);let l=await he(i,o),u=t=>{let n=e.rootElement?.();if(n){n.appendChild(t);return}a.inject?a.inject(t):r().prepend(t)},f=()=>a.rootElement?a.rootElement():n.body,p=new Map,m=!0,h=new Set,g,_,v=[],y=()=>new Promise(e=>{v.push(e),_!=null&&clearTimeout(_),_=setTimeout(()=>S().then(()=>{let e=v;v=[],e.forEach(e=>e())}),0)});function b(e,t=!1){if(e.nodeType!==1)return;let n=e;n.hasAttribute(s)&&n.removeAttribute(s),t&&n.querySelectorAll(`[${s}]`).forEach(e=>{e.removeAttribute(s)})}function x(e,t){let r=p.get(e);if(!r)if(r=n.createElement(`style`),r.setAttribute(`data-unocss-runtime-layer`,e),p.set(e,r),t==null)u(r);else{let e=x(t),n=e.parentNode;n?n.insertBefore(r,e.nextSibling):u(r)}return r}async function S(){let e=[...h],t=await l.generate(e);return t.layers.reduce((e,n)=>(x(n,e).innerHTML=t.getLayer(n)??``,n),void 0),e.filter(e=>!t.matched.has(e)).forEach(e=>h.delete(e)),{...t,getStyleElement:e=>p.get(e),getStyleElements:()=>p}}async function C(e){let t=h.size;await l.applyExtractors(e,void 0,h),t!==h.size&&await y()}async function w(e=f()){let t=e&&e.outerHTML;t&&(await C(`${t} ${Ye(t)}`),b(r()),b(e,!0))}let T=new MutationObserver(e=>{m||e.forEach(async e=>{if(e.target.nodeType!==1)return;let t=e.target;for(let e of p)if(t===e[1])return;if(e.type===`childList`)e.addedNodes.forEach(async e=>{if(e.nodeType!==1)return;let t=e;g&&!g(t)||(await C(t.outerHTML),b(t))});else{if(g&&!g(t))return;if(e.attributeName!==s){let e=Array.from(t.attributes).map(e=>e.value?`${e.name}="${e.value}"`:e.name).join(` `);await C(`<${t.tagName.toLowerCase()} ${e}>`)}b(t)}})}),E=!1;function D(){if(E)return;let e=a.observer?.target?a.observer.target():f();e&&(T.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:a.observer?.attributeFilter}),E=!0)}function O(){a.bypassDefined&&Ze(l.blocked),w(),D()}function k(){n.readyState===`loading`?t.addEventListener(`DOMContentLoaded`,O):O()}let A=t.__unocss_runtime=t.__unocss_runtime={version:l.version,uno:l,async extract(e){d(e)||(e.forEach(e=>h.add(e)),e=``),await C(e)},extractAll:w,inspect(e){g=e},toggleObserver(e){m=e===void 0?!m:!!e,!E&&!m&&k()},update:S,presets:t.__unocss_runtime?.presets??{}};a.ready?.(A)!==!1&&(m=!1,k())}function Ze(e=new Set){for(let t=0;t<document.styleSheets.length;t++){let n=document.styleSheets[t],r;try{if(r=n.cssRules||n.rules,!r)continue;Array.from(r).flatMap(e=>e.selectorText?.split(/,/g)||[]).forEach(t=>{t&&(t=t.trim(),t.startsWith(`.`)&&(t=t.slice(1)),e.add(t))})}catch{continue}}return e}export{Ue as n,Xe as t};