@caspian2026/agent-sdk 0.0.20 → 0.0.22

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 (427) hide show
  1. package/dist/{chunk-pqxyft7d.js → chunk-00zqn3kw.js} +8 -8
  2. package/dist/chunk-02gtfrd3.js +107 -0
  3. package/dist/{chunk-4v1mr2x2.js → chunk-06bqyk9d.js} +41 -41
  4. package/dist/{chunk-5gr6ekgm.js → chunk-07069jq1.js} +4 -4
  5. package/dist/{chunk-ckrs789w.js → chunk-0731m51q.js} +1 -1
  6. package/dist/{chunk-ytt8da3v.js → chunk-08trfyrw.js} +81 -81
  7. package/dist/{chunk-37j24srh.js → chunk-0ahep8z9.js} +6 -6
  8. package/dist/{chunk-ykvf93ft.js → chunk-0b6jjpk0.js} +79 -79
  9. package/dist/chunk-0bss629z.js +93 -0
  10. package/dist/chunk-0h6k0cy6.js +145 -0
  11. package/dist/{chunk-0f84wjjc.js → chunk-0j0sejeb.js} +79 -79
  12. package/dist/chunk-0nncz65r.js +50 -0
  13. package/dist/{chunk-qqc3b97c.js → chunk-0paqc2yw.js} +1 -1
  14. package/dist/{chunk-t83amzhd.js → chunk-0r5bb9j4.js} +12 -12
  15. package/dist/{chunk-e7j6g62d.js → chunk-0ra2vcq0.js} +10 -11
  16. package/dist/chunk-0t81d427.js +41 -0
  17. package/dist/{chunk-2mfzqkzn.js → chunk-0vkfrmqm.js} +29 -69
  18. package/dist/{chunk-bs9rn85s.js → chunk-0vp3wfab.js} +1 -1
  19. package/dist/{chunk-6rcf54zd.js → chunk-0xjaqda8.js} +27 -48
  20. package/dist/{chunk-1ycd7t0f.js → chunk-14ds3xfs.js} +88 -88
  21. package/dist/{chunk-y83gxqvc.js → chunk-1ae3nt9j.js} +3 -3
  22. package/dist/{chunk-yp64t9je.js → chunk-1dnqzr36.js} +8 -8
  23. package/dist/chunk-1dxyxpy9.js +87 -0
  24. package/dist/{chunk-qrgxbrs9.js → chunk-1fhzxfx8.js} +10198 -2850
  25. package/dist/chunk-1gwvnwwn.js +71 -0
  26. package/dist/{chunk-t3yc7m07.js → chunk-1gx78081.js} +1 -1
  27. package/dist/{chunk-d99k9r9g.js → chunk-1h2famwb.js} +1 -1
  28. package/dist/{chunk-9drwsb3g.js → chunk-1ksr550e.js} +80 -80
  29. package/dist/{chunk-h8n0a991.js → chunk-1q6eqjde.js} +79 -79
  30. package/dist/{chunk-ynx3fetd.js → chunk-26wtxbdc.js} +463 -1222
  31. package/dist/{chunk-tdf3ha9b.js → chunk-27efm5fz.js} +79 -79
  32. package/dist/{chunk-vwkb146r.js → chunk-27v1gta2.js} +90 -90
  33. package/dist/{chunk-k6cq3j7z.js → chunk-2fwze72g.js} +1 -1
  34. package/dist/chunk-2fx6b728.js +130 -0
  35. package/dist/{chunk-rrtpbztr.js → chunk-2gzv8nrw.js} +3 -4
  36. package/dist/{chunk-jwqveqpr.js → chunk-2savken4.js} +9 -9
  37. package/dist/chunk-37fzyqwf.js +89 -0
  38. package/dist/{chunk-7gbe6ftc.js → chunk-39rcyt8b.js} +10 -10
  39. package/dist/{chunk-1t3cyn1k.js → chunk-3c25bcsw.js} +1 -1
  40. package/dist/{chunk-xyzbgjpv.js → chunk-3ceahhx6.js} +2 -2
  41. package/dist/chunk-3mgywd32.js +8 -0
  42. package/dist/{chunk-568q88qz.js → chunk-3nk79af8.js} +1 -1
  43. package/dist/{chunk-vv84k232.js → chunk-3p5z2g5x.js} +5 -5
  44. package/dist/{chunk-vwt2fv6j.js → chunk-3qsqt3ax.js} +3 -3
  45. package/dist/{chunk-hgb8024k.js → chunk-3rrceyq7.js} +10 -10
  46. package/dist/chunk-3scqxh2m.js +97 -0
  47. package/dist/{chunk-8ady2sm4.js → chunk-3vy1jt9p.js} +8 -8
  48. package/dist/{chunk-62jrhytw.js → chunk-3y0c266d.js} +10 -10
  49. package/dist/{chunk-9b71sn2g.js → chunk-43khrn7t.js} +41 -41
  50. package/dist/chunk-43x8hwem.js +91 -0
  51. package/dist/chunk-468s1x8j.js +148 -0
  52. package/dist/{chunk-7ba45tqg.js → chunk-46ma6zye.js} +5 -5
  53. package/dist/chunk-48zqtxs2.js +114 -0
  54. package/dist/{chunk-c6gpdd2c.js → chunk-4deszpvs.js} +78 -78
  55. package/dist/{chunk-v8k67zfz.js → chunk-4hj8jmyj.js} +393 -1128
  56. package/dist/{chunk-pt6vj628.js → chunk-4jm5jme0.js} +9 -9
  57. package/dist/{chunk-m6vs965c.js → chunk-4jm600zv.js} +1 -1
  58. package/dist/{chunk-v2szqm5g.js → chunk-4k9d7gxv.js} +5 -5
  59. package/dist/{chunk-4fwzreqj.js → chunk-4ksvm5s7.js} +6 -6
  60. package/dist/{chunk-f79jyxwd.js → chunk-4pbx3g7s.js} +4 -4
  61. package/dist/{chunk-jrqjxhxj.js → chunk-4y7k2h9h.js} +2 -2
  62. package/dist/{chunk-tnpk0ne1.js → chunk-55raexh7.js} +935 -2391
  63. package/dist/{chunk-z9v4bxrj.js → chunk-5ccdsxgy.js} +3 -3
  64. package/dist/{chunk-bstyysxw.js → chunk-5drd7rwk.js} +3 -3
  65. package/dist/{chunk-zqajmq38.js → chunk-5ekyhb1w.js} +6 -6
  66. package/dist/chunk-5g8qaqg1.js +121 -0
  67. package/dist/{chunk-t8chhacb.js → chunk-5h5kx2jd.js} +2 -2
  68. package/dist/{chunk-5v6wr1z4.js → chunk-5n1jc02d.js} +2 -2
  69. package/dist/{chunk-fefs2xby.js → chunk-5ytn7v5f.js} +25 -25
  70. package/dist/{chunk-r585pc0g.js → chunk-5z28bqne.js} +3 -4
  71. package/dist/{chunk-j77g2v22.js → chunk-60ce3szr.js} +5 -5
  72. package/dist/{chunk-gbvmks09.js → chunk-64c1avct.js} +1 -1
  73. package/dist/{chunk-y8b45mt2.js → chunk-64r16v22.js} +4 -4
  74. package/dist/{chunk-f517h74h.js → chunk-66zry909.js} +1 -1
  75. package/dist/{chunk-kjx9a9p4.js → chunk-68ffk5qa.js} +2 -2
  76. package/dist/{chunk-5vavvf6y.js → chunk-69n11zng.js} +5 -5
  77. package/dist/{chunk-h1tv19q0.js → chunk-6avpcdbe.js} +80 -80
  78. package/dist/{chunk-q8t0ym9s.js → chunk-6b5s5f72.js} +83 -83
  79. package/dist/{chunk-7wegz81g.js → chunk-6dj5t602.js} +1 -1
  80. package/dist/{chunk-vnrevqdf.js → chunk-6dngjwkh.js} +4 -4
  81. package/dist/{chunk-7kp42hzq.js → chunk-6nsd9606.js} +2 -2
  82. package/dist/{chunk-xkra2684.js → chunk-6scn9735.js} +86 -85
  83. package/dist/chunk-6y07cns3.js +97 -0
  84. package/dist/{chunk-s13y3w7e.js → chunk-7as950yd.js} +37 -37
  85. package/dist/{chunk-fdwtd6s9.js → chunk-7aw745vx.js} +3 -3
  86. package/dist/{chunk-dzcb2ekz.js → chunk-7rs9fzac.js} +4 -4
  87. package/dist/chunk-7sedmr21.js +91 -0
  88. package/dist/{chunk-8q5fzyem.js → chunk-7sgtxrsc.js} +8 -10
  89. package/dist/{chunk-7yexhdjs.js → chunk-7wm5s02e.js} +1 -1
  90. package/dist/{chunk-wfh12nzh.js → chunk-7xyswgjh.js} +1 -1
  91. package/dist/{chunk-88k0rgdp.js → chunk-7yfh3wwz.js} +12 -12
  92. package/dist/{chunk-rfj6gjwh.js → chunk-82m3t5nh.js} +14 -14
  93. package/dist/{chunk-bdhdmkya.js → chunk-83hfzbx3.js} +1 -1
  94. package/dist/{chunk-eynfddhq.js → chunk-83w6dyg0.js} +144 -143
  95. package/dist/chunk-849nexnn.js +107 -0
  96. package/dist/chunk-86y5w3ke.js +155 -0
  97. package/dist/{chunk-0w2ntzwz.js → chunk-89s11ea0.js} +92 -92
  98. package/dist/{chunk-tevzn1xp.js → chunk-8g5pe1gr.js} +1 -1
  99. package/dist/chunk-8jjxcwmz.js +131 -0
  100. package/dist/chunk-8mjdbn31.js +140 -0
  101. package/dist/{chunk-d2cypdsx.js → chunk-8ndx7rp0.js} +23 -23
  102. package/dist/{chunk-xm9zf0tv.js → chunk-8t7qq403.js} +78 -78
  103. package/dist/{chunk-zp5nvg44.js → chunk-8w2vaewz.js} +2 -2
  104. package/dist/{chunk-25jhz0br.js → chunk-8w4g04yc.js} +16 -16
  105. package/dist/{chunk-xj8tk3d7.js → chunk-8yhf030a.js} +3 -3
  106. package/dist/{chunk-tnv92c5m.js → chunk-91zbgn3b.js} +81 -81
  107. package/dist/chunk-94g1qb3k.js +89 -0
  108. package/dist/chunk-9abgbs1c.js +105 -0
  109. package/dist/{chunk-26kp0k1t.js → chunk-9kkcnkk2.js} +80 -80
  110. package/dist/{chunk-tmye4d2k.js → chunk-9qnvh71r.js} +15 -15
  111. package/dist/{chunk-pp5zbnpr.js → chunk-9sx9zh8n.js} +80 -80
  112. package/dist/{chunk-7e9xcw77.js → chunk-9x5zgy22.js} +1 -1
  113. package/dist/{chunk-93hxjnkb.js → chunk-9ybyzj10.js} +78 -78
  114. package/dist/{chunk-ekewg3tj.js → chunk-9zj8gekt.js} +4 -4
  115. package/dist/{chunk-n9xhrzxs.js → chunk-9zv8zh4v.js} +82 -78
  116. package/dist/{chunk-vq4k182g.js → chunk-af93y3jj.js} +5 -5
  117. package/dist/chunk-apvcxgxf.js +81 -0
  118. package/dist/{chunk-s5arr49c.js → chunk-arhks25c.js} +200 -11
  119. package/dist/{chunk-5f57qtf9.js → chunk-ase86y73.js} +1 -1
  120. package/dist/chunk-az6hzm6z.js +121 -0
  121. package/dist/{chunk-6d05fvxz.js → chunk-b0kf00ff.js} +2 -2
  122. package/dist/{chunk-r055z03k.js → chunk-b1kcd3ss.js} +1 -1
  123. package/dist/{chunk-khwhppzs.js → chunk-b59cvw2j.js} +2 -2
  124. package/dist/{chunk-0tja7d1y.js → chunk-bg4x9ex0.js} +6 -6
  125. package/dist/chunk-bh5zqvyc.js +36 -0
  126. package/dist/{chunk-e22at2jn.js → chunk-bjz3q61f.js} +4 -4
  127. package/dist/{chunk-s7tq4e5g.js → chunk-bpxq62vv.js} +78 -78
  128. package/dist/chunk-bq9ct4w3.js +105 -0
  129. package/dist/{chunk-e01rphq3.js → chunk-bqksccfh.js} +841 -128
  130. package/dist/{chunk-zhnnzkzm.js → chunk-brjd9zmk.js} +14 -14
  131. package/dist/{chunk-p0n9ew4x.js → chunk-byfawrfx.js} +4 -4
  132. package/dist/{chunk-9rhy5vt7.js → chunk-c5vmbh6m.js} +9 -9
  133. package/dist/chunk-c6sjhj89.js +1284 -0
  134. package/dist/{chunk-0a8jb5c8.js → chunk-c7cg6yrj.js} +9 -9
  135. package/dist/{chunk-pyn4ry36.js → chunk-c7jwbe76.js} +57 -103
  136. package/dist/chunk-cdef9v7b.js +27 -0
  137. package/dist/{chunk-9029sbq1.js → chunk-cdz5yb0r.js} +1 -1
  138. package/dist/chunk-cg912f5t.js +90 -0
  139. package/dist/{chunk-4bcx2a3p.js → chunk-cgfdkzhb.js} +1 -1
  140. package/dist/{chunk-nsxw4b3j.js → chunk-cgqw4x5z.js} +8 -8
  141. package/dist/{chunk-p8hn07q2.js → chunk-cnsj3vq2.js} +1 -1
  142. package/dist/chunk-cs92y9rr.js +85 -0
  143. package/dist/{chunk-dmp3nd67.js → chunk-cw4ppsxg.js} +90 -90
  144. package/dist/{chunk-44bqv91d.js → chunk-cxrktb5g.js} +3 -3
  145. package/dist/chunk-czph0wbv.js +942 -0
  146. package/dist/{chunk-apjnwens.js → chunk-d4mdda98.js} +8 -8
  147. package/dist/{chunk-b1hygym1.js → chunk-ddsjkqs4.js} +8 -8
  148. package/dist/{chunk-bbhg7m1a.js → chunk-dfcdpbjy.js} +79 -79
  149. package/dist/{chunk-rx9ypbjy.js → chunk-dfzkwynj.js} +8 -8
  150. package/dist/{chunk-9re786wa.js → chunk-dgy5mjwc.js} +40 -40
  151. package/dist/{chunk-bw8y1msy.js → chunk-dww9yfzw.js} +5 -5
  152. package/dist/chunk-dxkravyv.js +107 -0
  153. package/dist/{chunk-k3gvjjm9.js → chunk-e0abab5b.js} +5 -5
  154. package/dist/{chunk-sthmb4xf.js → chunk-e4ndc6z9.js} +78 -78
  155. package/dist/{chunk-pg8asjpk.js → chunk-e9w9zc0g.js} +20 -20
  156. package/dist/{chunk-j0bfbce5.js → chunk-egjv0kzq.js} +36 -36
  157. package/dist/{chunk-p4e5ymdw.js → chunk-ehtwnxpg.js} +1 -1
  158. package/dist/{chunk-6twsw69m.js → chunk-emqz5wgc.js} +7 -7
  159. package/dist/{chunk-ysfam81t.js → chunk-eqp1rfft.js} +2 -2
  160. package/dist/{chunk-r27tskss.js → chunk-essjxccx.js} +9 -11
  161. package/dist/{chunk-h4tnp6dw.js → chunk-etaj82p2.js} +7 -7
  162. package/dist/{chunk-r4pq77kb.js → chunk-etdt1xz3.js} +3 -3
  163. package/dist/{chunk-dh01e4bp.js → chunk-ewadzrm8.js} +2 -2
  164. package/dist/{chunk-zat7q2e0.js → chunk-f5mqbb6w.js} +79 -79
  165. package/dist/{chunk-39r7sh1h.js → chunk-f5q7q1nv.js} +90 -90
  166. package/dist/{chunk-qbbf7rr5.js → chunk-fajg8x36.js} +727 -1818
  167. package/dist/{chunk-4yq5zz3m.js → chunk-fbq746tc.js} +9 -9
  168. package/dist/{chunk-snd4pbkp.js → chunk-fbv4apne.js} +1 -1
  169. package/dist/{chunk-8a1jee0e.js → chunk-fcynwjpm.js} +2 -2
  170. package/dist/{chunk-bq0wp28e.js → chunk-feyzykye.js} +1 -1
  171. package/dist/{chunk-cgzq4zww.js → chunk-ff85rwvc.js} +4 -4
  172. package/dist/{chunk-3xamk0n1.js → chunk-fhtkw6rg.js} +25 -25
  173. package/dist/{chunk-6qb753r5.js → chunk-fj0vdcb9.js} +79 -79
  174. package/dist/{chunk-dy8278wt.js → chunk-fqak69ft.js} +7 -7
  175. package/dist/{chunk-0zscb6c7.js → chunk-fyc5fepv.js} +1 -1
  176. package/dist/chunk-g1agxcr8.js +101 -0
  177. package/dist/{chunk-vxsad4bw.js → chunk-g9f19ttm.js} +2 -2
  178. package/dist/{chunk-638qz5y7.js → chunk-g9n6xvm8.js} +5 -5
  179. package/dist/{chunk-jw9zwgea.js → chunk-gczrhve6.js} +4 -4
  180. package/dist/chunk-gdwdqewd.js +19 -0
  181. package/dist/{chunk-3w4xq6cv.js → chunk-gg55fns0.js} +92 -92
  182. package/dist/{chunk-z7yj7dfh.js → chunk-gh9v06p0.js} +10 -10
  183. package/dist/{chunk-yvm9t98e.js → chunk-gnspkcgg.js} +18 -7
  184. package/dist/chunk-gqm4bnnt.js +123 -0
  185. package/dist/chunk-gs3f3gbk.js +92 -0
  186. package/dist/chunk-gt6c6fjt.js +52 -0
  187. package/dist/{chunk-w2bff8pq.js → chunk-gwfs8fjd.js} +12 -12
  188. package/dist/chunk-gz1e8y1w.js +33 -0
  189. package/dist/{chunk-m13ptmf2.js → chunk-h9n54swm.js} +2 -2
  190. package/dist/{chunk-7njkaxjp.js → chunk-hakdhagh.js} +120 -39
  191. package/dist/{chunk-93kvs6fh.js → chunk-hh19ag5z.js} +6 -6
  192. package/dist/{chunk-dg2k597k.js → chunk-hh5pyf66.js} +9 -9
  193. package/dist/{chunk-ma6x4ws8.js → chunk-hjxntwpr.js} +46 -46
  194. package/dist/{chunk-vd5dh925.js → chunk-hkxv5q2t.js} +78 -78
  195. package/dist/{chunk-3jbxhytz.js → chunk-hnf97vrx.js} +8 -8
  196. package/dist/{chunk-yteprw63.js → chunk-hryq61g4.js} +29 -29
  197. package/dist/chunk-hsgrk2cd.js +101 -0
  198. package/dist/{chunk-f9ybfyyp.js → chunk-hwfknpxv.js} +2 -2
  199. package/dist/{chunk-cx21etb2.js → chunk-hyy3n6h0.js} +2 -2
  200. package/dist/{chunk-kt25n52f.js → chunk-j5bth84e.js} +4 -4
  201. package/dist/{chunk-tkbwrjte.js → chunk-j64ga6ta.js} +284 -325
  202. package/dist/{chunk-et3jfht8.js → chunk-j6zz21nx.js} +16 -16
  203. package/dist/{chunk-x09aacvx.js → chunk-j7975pq5.js} +5 -5
  204. package/dist/{chunk-ccdh8eh2.js → chunk-j8t1pp00.js} +38 -38
  205. package/dist/{chunk-trm02xde.js → chunk-jd32zbps.js} +2 -2
  206. package/dist/{chunk-x4x3691j.js → chunk-jp1gae5d.js} +12 -12
  207. package/dist/{chunk-6fe0an4e.js → chunk-jytzzf9w.js} +79 -79
  208. package/dist/{chunk-fpq87r80.js → chunk-jzthz1bx.js} +1 -1
  209. package/dist/{chunk-taqr0qw1.js → chunk-k0p9w03v.js} +3 -3
  210. package/dist/{chunk-nwdpjkrw.js → chunk-k5gfbbkt.js} +78 -78
  211. package/dist/{chunk-vx28ztc7.js → chunk-k89awbsr.js} +20 -20
  212. package/dist/{chunk-a3qtafgw.js → chunk-k8vp0atq.js} +79 -79
  213. package/dist/{chunk-mbfzfg56.js → chunk-k9kd740z.js} +85 -85
  214. package/dist/chunk-kbwqxxwm.js +77 -0
  215. package/dist/{chunk-v9sy0cj3.js → chunk-kg5a4903.js} +10 -10
  216. package/dist/chunk-kh348y19.js +94 -0
  217. package/dist/{chunk-ycpdfeya.js → chunk-km8v7knf.js} +79 -79
  218. package/dist/{chunk-m82ketm1.js → chunk-kvyqrhq9.js} +78 -78
  219. package/dist/{chunk-0pbwcm8b.js → chunk-kwekc97v.js} +1 -1
  220. package/dist/{chunk-qs4stpt5.js → chunk-ky1z78ve.js} +14 -14
  221. package/dist/chunk-kys2hp6g.js +71 -0
  222. package/dist/{chunk-xygy5v97.js → chunk-m063ag19.js} +30 -30
  223. package/dist/{chunk-gm8ht8g9.js → chunk-m2vtryy5.js} +6 -6
  224. package/dist/chunk-m8b08env.js +90 -0
  225. package/dist/{chunk-6fx36a3s.js → chunk-m9hpdf8x.js} +5 -5
  226. package/dist/{chunk-q9y73cmh.js → chunk-mcws22k3.js} +1 -1
  227. package/dist/{chunk-2bk4jvse.js → chunk-mhng56vc.js} +7 -7
  228. package/dist/chunk-mhtw8kxn.js +105 -0
  229. package/dist/{chunk-ja23mty8.js → chunk-mkkwmeev.js} +83 -83
  230. package/dist/{chunk-4e1j46k0.js → chunk-mswx2nma.js} +3 -3
  231. package/dist/{chunk-n3vmrzcy.js → chunk-na6yr7s4.js} +5 -5
  232. package/dist/{chunk-pnc7q9rt.js → chunk-netzwgv1.js} +1 -1
  233. package/dist/chunk-nm6nf01b.js +113 -0
  234. package/dist/chunk-nmgj86tt.js +24 -0
  235. package/dist/{chunk-r1q9s5hs.js → chunk-ns7x6xam.js} +10 -13
  236. package/dist/chunk-nsnt3c2k.js +55 -0
  237. package/dist/chunk-nx0d6y32.js +111 -0
  238. package/dist/{chunk-4kfhh3aw.js → chunk-nx1sv5wb.js} +4 -4
  239. package/dist/{chunk-1ytng03p.js → chunk-nyh3g1b3.js} +12 -12
  240. package/dist/{chunk-ewsvbzhz.js → chunk-nzbekmwx.js} +3 -3
  241. package/dist/{chunk-6vp8zen2.js → chunk-p6t40f9y.js} +79 -79
  242. package/dist/{chunk-vbe1ersf.js → chunk-p7vkh4wx.js} +1 -1
  243. package/dist/{chunk-q74fcthe.js → chunk-p8na2wwp.js} +2 -2
  244. package/dist/{chunk-rzk001ay.js → chunk-pb1gnxp4.js} +85 -85
  245. package/dist/{chunk-6c22q39e.js → chunk-pbxnywa0.js} +78 -78
  246. package/dist/{chunk-pg4fbhbm.js → chunk-pe3rkfp2.js} +11 -11
  247. package/dist/{chunk-sbe9zd56.js → chunk-pgtnj1mt.js} +6 -6
  248. package/dist/{chunk-tyc5c0q4.js → chunk-ph1fd4je.js} +8 -8
  249. package/dist/chunk-phmmxe9q.js +121 -0
  250. package/dist/{chunk-wyyd1qfn.js → chunk-pka1t5js.js} +81 -81
  251. package/dist/{chunk-c2k1n6yb.js → chunk-pnz4aqcd.js} +16 -16
  252. package/dist/{chunk-5nqrdqz5.js → chunk-ppwjyveh.js} +1 -1
  253. package/dist/{chunk-7dc9d8fy.js → chunk-pqqxdk5f.js} +8 -8
  254. package/dist/{chunk-ja1nqz5q.js → chunk-ps49ymvj.js} +2 -2
  255. package/dist/chunk-ptd3dxtn.js +54 -0
  256. package/dist/{chunk-yh46f77t.js → chunk-pvyhc0rp.js} +78 -78
  257. package/dist/{chunk-2vc3fyp9.js → chunk-pwwa7s62.js} +2 -2
  258. package/dist/{chunk-z8b8f2n3.js → chunk-py3vq2xq.js} +79 -79
  259. package/dist/chunk-q2qqx53b.js +55 -0
  260. package/dist/{chunk-wwrswxg1.js → chunk-qajrkk97.js} +1 -1
  261. package/dist/{chunk-b610qrvk.js → chunk-qatfdxvd.js} +3 -3
  262. package/dist/{chunk-qka6pqrq.js → chunk-qb6k2afy.js} +11 -11
  263. package/dist/{chunk-j15xyew5.js → chunk-qed4v7zf.js} +4 -4
  264. package/dist/{chunk-m12e2wq3.js → chunk-qetppq4n.js} +80 -80
  265. package/dist/chunk-qh7pps9m.js +93 -0
  266. package/dist/{chunk-rgaedd84.js → chunk-qkczt8cr.js} +5 -5
  267. package/dist/chunk-qnfx3qtx.js +617 -0
  268. package/dist/{chunk-eta5aekm.js → chunk-qp2qdcda.js} +30 -9
  269. package/dist/{chunk-k8by1vfd.js → chunk-qsmchgra.js} +19 -19
  270. package/dist/chunk-qztsngwh.js +58 -0
  271. package/dist/chunk-r12af7fx.js +88 -0
  272. package/dist/{chunk-8m1gfrme.js → chunk-r3hbc8be.js} +26 -15
  273. package/dist/{chunk-cajjdb7j.js → chunk-r5zzw3gd.js} +8 -8
  274. package/dist/{chunk-a00gfn8e.js → chunk-rmbbmd3s.js} +2 -2
  275. package/dist/{chunk-xdxdztxa.js → chunk-rn0v1hk8.js} +1 -1
  276. package/dist/{chunk-cqb31tfg.js → chunk-rnxctq9p.js} +6 -6
  277. package/dist/{chunk-ngde5k9k.js → chunk-rwb59wra.js} +79 -79
  278. package/dist/{chunk-2bh7f2wa.js → chunk-rym3zxt1.js} +13 -13
  279. package/dist/{chunk-s201s689.js → chunk-s1v6e38t.js} +18 -18
  280. package/dist/{chunk-z8n8cjhz.js → chunk-s2ge1p9n.js} +2 -2
  281. package/dist/{chunk-w60c0dkw.js → chunk-s6880qqm.js} +5 -5
  282. package/dist/{chunk-fqr6n9z6.js → chunk-s8gy4ky9.js} +3 -3
  283. package/dist/{chunk-fr5s5ceq.js → chunk-s8kj6ajy.js} +2 -2
  284. package/dist/{chunk-7deqmrby.js → chunk-schh8p15.js} +6 -6
  285. package/dist/{chunk-6hs3wed5.js → chunk-scjnztz8.js} +7 -7
  286. package/dist/{chunk-nztayqyx.js → chunk-sd36yzx8.js} +1 -1
  287. package/dist/{chunk-ra9hbfyz.js → chunk-sf597ge7.js} +3 -3
  288. package/dist/chunk-sgpmpn90.js +35 -0
  289. package/dist/chunk-sh02d2qn.js +38 -0
  290. package/dist/chunk-spt9rqcc.js +114 -0
  291. package/dist/chunk-spwp2ta1.js +103 -0
  292. package/dist/{chunk-2qpy8kne.js → chunk-szj5wvdy.js} +1 -1
  293. package/dist/{chunk-4nqm22j3.js → chunk-t29a6zb5.js} +4 -6
  294. package/dist/{chunk-3hcfwedh.js → chunk-t4khqff1.js} +5 -5
  295. package/dist/{chunk-657k4mef.js → chunk-t53anaq5.js} +79 -79
  296. package/dist/chunk-t8es34hg.js +133 -0
  297. package/dist/{chunk-qrdbqeve.js → chunk-t9p85zff.js} +2 -2
  298. package/dist/chunk-tkb0e6pg.js +122 -0
  299. package/dist/{chunk-dv38yqdn.js → chunk-tmz33ftg.js} +3 -3
  300. package/dist/{chunk-s9906sac.js → chunk-tn7mry5v.js} +83 -83
  301. package/dist/{chunk-2b00k9ep.js → chunk-tpwt6hxa.js} +78 -78
  302. package/dist/{chunk-cfpnb7x4.js → chunk-tqsyxabk.js} +78 -78
  303. package/dist/chunk-trrfa0rb.js +146 -0
  304. package/dist/chunk-v11v91ka.js +100 -0
  305. package/dist/{chunk-zx9r7a23.js → chunk-v1kzp02e.js} +1 -1
  306. package/dist/{chunk-9p62r6he.js → chunk-v20bdr8x.js} +6 -6
  307. package/dist/{chunk-15f7ee0j.js → chunk-v4t6dyyh.js} +158 -245
  308. package/dist/{chunk-he9zw1gh.js → chunk-v78fj8by.js} +2 -2
  309. package/dist/{chunk-pt1jzmkv.js → chunk-v8kjswxt.js} +2 -2
  310. package/dist/{chunk-n9ne98cj.js → chunk-v9smspw2.js} +4 -5
  311. package/dist/{chunk-0b85d7q0.js → chunk-vbym8ean.js} +7 -7
  312. package/dist/{chunk-41wn5eqw.js → chunk-venns550.js} +10 -10
  313. package/dist/{chunk-wt799fvk.js → chunk-vf612n57.js} +34 -34
  314. package/dist/{chunk-myac8yfs.js → chunk-vkhrrvfq.js} +5 -5
  315. package/dist/chunk-vkk6k4k7.js +60 -0
  316. package/dist/{chunk-bktmgb4n.js → chunk-vyjeh50y.js} +39 -68
  317. package/dist/{chunk-a1mewckj.js → chunk-w23csbgp.js} +78 -78
  318. package/dist/{chunk-3hxr3x9d.js → chunk-w6m6trzq.js} +2 -2
  319. package/dist/{chunk-kcp41jcn.js → chunk-wa8yn2p0.js} +2 -2
  320. package/dist/{chunk-3k8ecscj.js → chunk-wfhg4z9j.js} +78 -78
  321. package/dist/{chunk-7tdk9ypw.js → chunk-wgk9sxk7.js} +10 -10
  322. package/dist/{chunk-k0dprbnn.js → chunk-wsh5y3wr.js} +78 -78
  323. package/dist/chunk-wt6maqqe.js +20 -0
  324. package/dist/chunk-wtw9yj4m.js +127 -0
  325. package/dist/{chunk-52pp0dbk.js → chunk-x0yg04f9.js} +4 -4
  326. package/dist/{chunk-jsvsnqkn.js → chunk-x47h283a.js} +2 -2
  327. package/dist/{chunk-rpta0rqz.js → chunk-x6r4v44b.js} +1 -1
  328. package/dist/{chunk-k6wmp81y.js → chunk-x7fdwq3d.js} +1 -1
  329. package/dist/{chunk-13pmg16e.js → chunk-x8d2ehd7.js} +1 -1
  330. package/dist/{chunk-ej882sb5.js → chunk-xc5ec77n.js} +26 -26
  331. package/dist/{chunk-pnrdvxhy.js → chunk-xeb6075z.js} +2 -2
  332. package/dist/{chunk-hbz8xggv.js → chunk-xeemr15m.js} +11 -11
  333. package/dist/{chunk-mtstpt1e.js → chunk-xenf437w.js} +43 -43
  334. package/dist/{chunk-7gte8zc4.js → chunk-xhfmdq1y.js} +1 -1
  335. package/dist/{chunk-gxsrvxjn.js → chunk-xv3era3s.js} +1 -1
  336. package/dist/{chunk-pqf2bjy1.js → chunk-xwcatdm5.js} +4 -4
  337. package/dist/{chunk-92wwx9vf.js → chunk-y1784krc.js} +2 -2
  338. package/dist/{chunk-1s9jxpjm.js → chunk-y1ac6e82.js} +7 -7
  339. package/dist/{chunk-q53kkzhr.js → chunk-y2saq66d.js} +80 -80
  340. package/dist/{chunk-ggk84sc5.js → chunk-y4ca9kqz.js} +4 -4
  341. package/dist/{chunk-m8qvkabg.js → chunk-y9bhjjdz.js} +4 -4
  342. package/dist/chunk-yb3bxv3w.js +30 -0
  343. package/dist/{chunk-1ehn6qdp.js → chunk-ykv67k5w.js} +13 -13
  344. package/dist/{chunk-0dwdg9bz.js → chunk-ypr3qcky.js} +9 -9
  345. package/dist/{chunk-5sd5fz78.js → chunk-yv2xdhcr.js} +78 -78
  346. package/dist/{chunk-bta8w8ge.js → chunk-yyex5gsf.js} +10 -10
  347. package/dist/{chunk-s9jxtj04.js → chunk-yyj1kzd4.js} +95 -94
  348. package/dist/{chunk-gt43z5zd.js → chunk-yzgbnmxv.js} +81 -81
  349. package/dist/{chunk-hhvf84fa.js → chunk-z2tpz1jw.js} +188 -186
  350. package/dist/{chunk-rzn9w8p2.js → chunk-z455w6jw.js} +3 -3
  351. package/dist/{chunk-eb4t4ehh.js → chunk-z6c323z5.js} +6 -6
  352. package/dist/{chunk-xggbj4j9.js → chunk-zesnyy41.js} +3 -3
  353. package/dist/{chunk-60a647ty.js → chunk-zg3nev62.js} +81 -81
  354. package/dist/{chunk-61x3akfa.js → chunk-zxh62ved.js} +2 -2
  355. package/dist/{chunk-8r1napm7.js → chunk-zzm33q8x.js} +1 -1
  356. package/dist/cli.js +12 -12
  357. package/dist/gateway/worker.js +170876 -172180
  358. package/dist/sdk/query.cjs +18 -8
  359. package/dist/sdk/query.js +1 -1
  360. package/package.json +128 -128
  361. package/dist/chunk-09nzqj0f.js +0 -9605
  362. package/dist/chunk-0fw1mz8s.js +0 -27
  363. package/dist/chunk-0pqv68xt.js +0 -133
  364. package/dist/chunk-0pv13fxq.js +0 -1684
  365. package/dist/chunk-0tgn1431.js +0 -38
  366. package/dist/chunk-0yshjsxt.js +0 -122
  367. package/dist/chunk-0z9s957c.js +0 -94
  368. package/dist/chunk-1gt45dyg.js +0 -101
  369. package/dist/chunk-3kx7brrn.js +0 -55
  370. package/dist/chunk-4kfs8ymb.js +0 -92
  371. package/dist/chunk-5rhmrt2j.js +0 -121
  372. package/dist/chunk-626watky.js +0 -50
  373. package/dist/chunk-6aqa0ec5.js +0 -145
  374. package/dist/chunk-6zfb4n08.js +0 -91
  375. package/dist/chunk-73bgy356.js +0 -90
  376. package/dist/chunk-7nphjzve.js +0 -105
  377. package/dist/chunk-7sp9dk6d.js +0 -20
  378. package/dist/chunk-8jmkpx1h.js +0 -123
  379. package/dist/chunk-9xq7ef8y.js +0 -100
  380. package/dist/chunk-9ydxqdhe.js +0 -121
  381. package/dist/chunk-ab6apbd2.js +0 -140
  382. package/dist/chunk-bdrsheny.js +0 -35
  383. package/dist/chunk-bvfqg3cg.js +0 -131
  384. package/dist/chunk-cj0j4n23.js +0 -71
  385. package/dist/chunk-cynnhyy3.js +0 -103
  386. package/dist/chunk-d0zx5hba.js +0 -85
  387. package/dist/chunk-e6s584g7.js +0 -77
  388. package/dist/chunk-e90dyenj.js +0 -127
  389. package/dist/chunk-em5s71j6.js +0 -89
  390. package/dist/chunk-eqcgr89w.js +0 -646
  391. package/dist/chunk-f9zvs66e.js +0 -105
  392. package/dist/chunk-gaf31961.js +0 -81
  393. package/dist/chunk-gkz2djp0.js +0 -121
  394. package/dist/chunk-gwktnbeg.js +0 -90
  395. package/dist/chunk-h0bgwz9v.js +0 -55
  396. package/dist/chunk-h3v46eky.js +0 -105
  397. package/dist/chunk-hycm92ss.js +0 -52
  398. package/dist/chunk-j3c5r08n.js +0 -87
  399. package/dist/chunk-j3q2sbhc.js +0 -107
  400. package/dist/chunk-k9h7kjf6.js +0 -8
  401. package/dist/chunk-karea2z2.js +0 -89
  402. package/dist/chunk-kra9y8qb.js +0 -97
  403. package/dist/chunk-mwzwm2z2.js +0 -60
  404. package/dist/chunk-n535j168.js +0 -131
  405. package/dist/chunk-p9nkqgej.js +0 -19
  406. package/dist/chunk-pgptefy1.js +0 -114
  407. package/dist/chunk-pjn0s3j1.js +0 -111
  408. package/dist/chunk-pkwv0q5q.js +0 -91
  409. package/dist/chunk-q6m9qgaa.js +0 -88
  410. package/dist/chunk-r82c7gfc.js +0 -58
  411. package/dist/chunk-rgshryeb.js +0 -93
  412. package/dist/chunk-rk2kb2ec.js +0 -101
  413. package/dist/chunk-s0p653k2.js +0 -93
  414. package/dist/chunk-skypjdyc.js +0 -147
  415. package/dist/chunk-tgayhxvz.js +0 -41
  416. package/dist/chunk-vr5vyt2h.js +0 -107
  417. package/dist/chunk-vvjhax8n.js +0 -114
  418. package/dist/chunk-vvsts2t9.js +0 -30
  419. package/dist/chunk-w287mz4p.js +0 -146
  420. package/dist/chunk-wa852b5b.js +0 -113
  421. package/dist/chunk-xbpt4dv8.js +0 -155
  422. package/dist/chunk-xj72jfpd.js +0 -33
  423. package/dist/chunk-xwbh3j1x.js +0 -107
  424. package/dist/chunk-xwrar1c5.js +0 -97
  425. package/dist/chunk-yt9mady7.js +0 -36
  426. package/dist/chunk-zfxp82tk.js +0 -24
  427. package/dist/chunk-zgkngrp4.js +0 -54
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  __commonJS
4
- } from "./chunk-eta5aekm.js";
4
+ } from "./chunk-qp2qdcda.js";
5
5
 
6
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/conventions.js
6
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/conventions.js
7
7
  var require_conventions = __commonJS((exports) => {
8
8
  function find(list, predicate, ac) {
9
9
  if (ac === undefined) {
@@ -13,7 +13,7 @@ var require_conventions = __commonJS((exports) => {
13
13
  return ac.find.call(list, predicate);
14
14
  }
15
15
  for (var i = 0;i < list.length; i++) {
16
- if (hasOwn(list, i)) {
16
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
17
17
  var item = list[i];
18
18
  if (predicate.call(undefined, item, i, list)) {
19
19
  return item;
@@ -25,108 +25,34 @@ var require_conventions = __commonJS((exports) => {
25
25
  if (oc === undefined) {
26
26
  oc = Object;
27
27
  }
28
- if (oc && typeof oc.getOwnPropertyDescriptors === "function") {
29
- object = oc.create(null, oc.getOwnPropertyDescriptors(object));
30
- }
31
28
  return oc && typeof oc.freeze === "function" ? oc.freeze(object) : object;
32
29
  }
33
- function hasOwn(object, key) {
34
- return Object.prototype.hasOwnProperty.call(object, key);
35
- }
36
30
  function assign(target, source) {
37
31
  if (target === null || typeof target !== "object") {
38
32
  throw new TypeError("target is not an object");
39
33
  }
40
34
  for (var key in source) {
41
- if (hasOwn(source, key)) {
35
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
42
36
  target[key] = source[key];
43
37
  }
44
38
  }
45
39
  return target;
46
40
  }
47
- var HTML_BOOLEAN_ATTRIBUTES = freeze({
48
- allowfullscreen: true,
49
- async: true,
50
- autofocus: true,
51
- autoplay: true,
52
- checked: true,
53
- controls: true,
54
- default: true,
55
- defer: true,
56
- disabled: true,
57
- formnovalidate: true,
58
- hidden: true,
59
- ismap: true,
60
- itemscope: true,
61
- loop: true,
62
- multiple: true,
63
- muted: true,
64
- nomodule: true,
65
- novalidate: true,
66
- open: true,
67
- playsinline: true,
68
- readonly: true,
69
- required: true,
70
- reversed: true,
71
- selected: true
72
- });
73
- function isHTMLBooleanAttribute(name) {
74
- return hasOwn(HTML_BOOLEAN_ATTRIBUTES, name.toLowerCase());
75
- }
76
- var HTML_VOID_ELEMENTS = freeze({
77
- area: true,
78
- base: true,
79
- br: true,
80
- col: true,
81
- embed: true,
82
- hr: true,
83
- img: true,
84
- input: true,
85
- link: true,
86
- meta: true,
87
- param: true,
88
- source: true,
89
- track: true,
90
- wbr: true
91
- });
92
- function isHTMLVoidElement(tagName) {
93
- return hasOwn(HTML_VOID_ELEMENTS, tagName.toLowerCase());
94
- }
95
- var HTML_RAW_TEXT_ELEMENTS = freeze({
96
- script: false,
97
- style: false,
98
- textarea: true,
99
- title: true
100
- });
101
- function isHTMLRawTextElement(tagName) {
102
- var key = tagName.toLowerCase();
103
- return hasOwn(HTML_RAW_TEXT_ELEMENTS, key) && !HTML_RAW_TEXT_ELEMENTS[key];
104
- }
105
- function isHTMLEscapableRawTextElement(tagName) {
106
- var key = tagName.toLowerCase();
107
- return hasOwn(HTML_RAW_TEXT_ELEMENTS, key) && HTML_RAW_TEXT_ELEMENTS[key];
108
- }
109
- function isHTMLMimeType(mimeType) {
110
- return mimeType === MIME_TYPE.HTML;
111
- }
112
- function hasDefaultHTMLNamespace(mimeType) {
113
- return isHTMLMimeType(mimeType) || mimeType === MIME_TYPE.XML_XHTML_APPLICATION;
114
- }
115
41
  var MIME_TYPE = freeze({
116
42
  HTML: "text/html",
43
+ isHTML: function(value) {
44
+ return value === MIME_TYPE.HTML;
45
+ },
117
46
  XML_APPLICATION: "application/xml",
118
47
  XML_TEXT: "text/xml",
119
48
  XML_XHTML_APPLICATION: "application/xhtml+xml",
120
49
  XML_SVG_IMAGE: "image/svg+xml"
121
50
  });
122
- var _MIME_TYPES = Object.keys(MIME_TYPE).map(function(key) {
123
- return MIME_TYPE[key];
124
- });
125
- function isValidMimeType(mimeType) {
126
- return _MIME_TYPES.indexOf(mimeType) > -1;
127
- }
128
51
  var NAMESPACE = freeze({
129
52
  HTML: "http://www.w3.org/1999/xhtml",
53
+ isHTML: function(uri) {
54
+ return uri === NAMESPACE.HTML;
55
+ },
130
56
  SVG: "http://www.w3.org/2000/svg",
131
57
  XML: "http://www.w3.org/XML/1998/namespace",
132
58
  XMLNS: "http://www.w3.org/2000/xmlns/"
@@ -134,344 +60,15 @@ var require_conventions = __commonJS((exports) => {
134
60
  exports.assign = assign;
135
61
  exports.find = find;
136
62
  exports.freeze = freeze;
137
- exports.HTML_BOOLEAN_ATTRIBUTES = HTML_BOOLEAN_ATTRIBUTES;
138
- exports.HTML_RAW_TEXT_ELEMENTS = HTML_RAW_TEXT_ELEMENTS;
139
- exports.HTML_VOID_ELEMENTS = HTML_VOID_ELEMENTS;
140
- exports.hasDefaultHTMLNamespace = hasDefaultHTMLNamespace;
141
- exports.hasOwn = hasOwn;
142
- exports.isHTMLBooleanAttribute = isHTMLBooleanAttribute;
143
- exports.isHTMLRawTextElement = isHTMLRawTextElement;
144
- exports.isHTMLEscapableRawTextElement = isHTMLEscapableRawTextElement;
145
- exports.isHTMLMimeType = isHTMLMimeType;
146
- exports.isHTMLVoidElement = isHTMLVoidElement;
147
- exports.isValidMimeType = isValidMimeType;
148
63
  exports.MIME_TYPE = MIME_TYPE;
149
64
  exports.NAMESPACE = NAMESPACE;
150
65
  });
151
66
 
152
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/errors.js
153
- var require_errors = __commonJS((exports) => {
154
- var conventions = require_conventions();
155
- function extendError(constructor, writableName) {
156
- constructor.prototype = Object.create(Error.prototype, {
157
- constructor: { value: constructor },
158
- name: { value: constructor.name, enumerable: true, writable: writableName }
159
- });
160
- }
161
- var DOMExceptionName = conventions.freeze({
162
- Error: "Error",
163
- IndexSizeError: "IndexSizeError",
164
- DomstringSizeError: "DomstringSizeError",
165
- HierarchyRequestError: "HierarchyRequestError",
166
- WrongDocumentError: "WrongDocumentError",
167
- InvalidCharacterError: "InvalidCharacterError",
168
- NoDataAllowedError: "NoDataAllowedError",
169
- NoModificationAllowedError: "NoModificationAllowedError",
170
- NotFoundError: "NotFoundError",
171
- NotSupportedError: "NotSupportedError",
172
- InUseAttributeError: "InUseAttributeError",
173
- InvalidStateError: "InvalidStateError",
174
- SyntaxError: "SyntaxError",
175
- InvalidModificationError: "InvalidModificationError",
176
- NamespaceError: "NamespaceError",
177
- InvalidAccessError: "InvalidAccessError",
178
- ValidationError: "ValidationError",
179
- TypeMismatchError: "TypeMismatchError",
180
- SecurityError: "SecurityError",
181
- NetworkError: "NetworkError",
182
- AbortError: "AbortError",
183
- URLMismatchError: "URLMismatchError",
184
- QuotaExceededError: "QuotaExceededError",
185
- TimeoutError: "TimeoutError",
186
- InvalidNodeTypeError: "InvalidNodeTypeError",
187
- DataCloneError: "DataCloneError",
188
- EncodingError: "EncodingError",
189
- NotReadableError: "NotReadableError",
190
- UnknownError: "UnknownError",
191
- ConstraintError: "ConstraintError",
192
- DataError: "DataError",
193
- TransactionInactiveError: "TransactionInactiveError",
194
- ReadOnlyError: "ReadOnlyError",
195
- VersionError: "VersionError",
196
- OperationError: "OperationError",
197
- NotAllowedError: "NotAllowedError",
198
- OptOutError: "OptOutError"
199
- });
200
- var DOMExceptionNames = Object.keys(DOMExceptionName);
201
- function isValidDomExceptionCode(value) {
202
- return typeof value === "number" && value >= 1 && value <= 25;
203
- }
204
- function endsWithError(value) {
205
- return typeof value === "string" && value.substring(value.length - DOMExceptionName.Error.length) === DOMExceptionName.Error;
206
- }
207
- function DOMException(messageOrCode, nameOrMessage) {
208
- if (isValidDomExceptionCode(messageOrCode)) {
209
- this.name = DOMExceptionNames[messageOrCode];
210
- this.message = nameOrMessage || "";
211
- } else {
212
- this.message = messageOrCode;
213
- this.name = endsWithError(nameOrMessage) ? nameOrMessage : DOMExceptionName.Error;
214
- }
215
- if (Error.captureStackTrace)
216
- Error.captureStackTrace(this, DOMException);
217
- }
218
- extendError(DOMException, true);
219
- Object.defineProperties(DOMException.prototype, {
220
- code: {
221
- enumerable: true,
222
- get: function() {
223
- var code = DOMExceptionNames.indexOf(this.name);
224
- if (isValidDomExceptionCode(code))
225
- return code;
226
- return 0;
227
- }
228
- }
229
- });
230
- var ExceptionCode = {
231
- INDEX_SIZE_ERR: 1,
232
- DOMSTRING_SIZE_ERR: 2,
233
- HIERARCHY_REQUEST_ERR: 3,
234
- WRONG_DOCUMENT_ERR: 4,
235
- INVALID_CHARACTER_ERR: 5,
236
- NO_DATA_ALLOWED_ERR: 6,
237
- NO_MODIFICATION_ALLOWED_ERR: 7,
238
- NOT_FOUND_ERR: 8,
239
- NOT_SUPPORTED_ERR: 9,
240
- INUSE_ATTRIBUTE_ERR: 10,
241
- INVALID_STATE_ERR: 11,
242
- SYNTAX_ERR: 12,
243
- INVALID_MODIFICATION_ERR: 13,
244
- NAMESPACE_ERR: 14,
245
- INVALID_ACCESS_ERR: 15,
246
- VALIDATION_ERR: 16,
247
- TYPE_MISMATCH_ERR: 17,
248
- SECURITY_ERR: 18,
249
- NETWORK_ERR: 19,
250
- ABORT_ERR: 20,
251
- URL_MISMATCH_ERR: 21,
252
- QUOTA_EXCEEDED_ERR: 22,
253
- TIMEOUT_ERR: 23,
254
- INVALID_NODE_TYPE_ERR: 24,
255
- DATA_CLONE_ERR: 25
256
- };
257
- var entries = Object.entries(ExceptionCode);
258
- for (i = 0;i < entries.length; i++) {
259
- key = entries[i][0];
260
- DOMException[key] = entries[i][1];
261
- }
262
- var key;
263
- var i;
264
- function ParseError(message, locator) {
265
- this.message = message;
266
- this.locator = locator;
267
- if (Error.captureStackTrace)
268
- Error.captureStackTrace(this, ParseError);
269
- }
270
- extendError(ParseError);
271
- exports.DOMException = DOMException;
272
- exports.DOMExceptionName = DOMExceptionName;
273
- exports.ExceptionCode = ExceptionCode;
274
- exports.ParseError = ParseError;
275
- });
276
-
277
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/grammar.js
278
- var require_grammar = __commonJS((exports) => {
279
- function detectUnicodeSupport(RegExpImpl) {
280
- try {
281
- if (typeof RegExpImpl !== "function") {
282
- RegExpImpl = RegExp;
283
- }
284
- var match = new RegExpImpl("\uD834\uDF06", "u").exec("\uD834\uDF06");
285
- return !!match && match[0].length === 2;
286
- } catch (error) {}
287
- return false;
288
- }
289
- var UNICODE_SUPPORT = detectUnicodeSupport();
290
- function chars(regexp) {
291
- if (regexp.source[0] !== "[") {
292
- throw new Error(regexp + " can not be used with chars");
293
- }
294
- return regexp.source.slice(1, regexp.source.lastIndexOf("]"));
295
- }
296
- function chars_without(regexp, search) {
297
- if (regexp.source[0] !== "[") {
298
- throw new Error("/" + regexp.source + "/ can not be used with chars_without");
299
- }
300
- if (!search || typeof search !== "string") {
301
- throw new Error(JSON.stringify(search) + " is not a valid search");
302
- }
303
- if (regexp.source.indexOf(search) === -1) {
304
- throw new Error('"' + search + '" is not is /' + regexp.source + "/");
305
- }
306
- if (search === "-" && regexp.source.indexOf(search) !== 1) {
307
- throw new Error('"' + search + '" is not at the first postion of /' + regexp.source + "/");
308
- }
309
- return new RegExp(regexp.source.replace(search, ""), UNICODE_SUPPORT ? "u" : "");
310
- }
311
- function reg(args) {
312
- var self = this;
313
- return new RegExp(Array.prototype.slice.call(arguments).map(function(part) {
314
- var isStr = typeof part === "string";
315
- if (isStr && self === undefined && part === "|") {
316
- throw new Error("use regg instead of reg to wrap expressions with `|`!");
317
- }
318
- return isStr ? part : part.source;
319
- }).join(""), UNICODE_SUPPORT ? "mu" : "m");
320
- }
321
- function regg(args) {
322
- if (arguments.length === 0) {
323
- throw new Error("no parameters provided");
324
- }
325
- return reg.apply(regg, ["(?:"].concat(Array.prototype.slice.call(arguments), [")"]));
326
- }
327
- var UNICODE_REPLACEMENT_CHARACTER = "\uFFFD";
328
- var Char = /[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;
329
- if (UNICODE_SUPPORT) {
330
- Char = reg("[", chars(Char), "\\u{10000}-\\u{10FFFF}", "]");
331
- }
332
- var InvalidChar = new RegExp("[^" + chars(Char) + "]", UNICODE_SUPPORT ? "u" : "");
333
- var _SChar = /[\x20\x09\x0D\x0A]/;
334
- var SChar_s = chars(_SChar);
335
- var S = reg(_SChar, "+");
336
- var S_OPT = reg(_SChar, "*");
337
- var NameStartChar = /[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
338
- if (UNICODE_SUPPORT) {
339
- NameStartChar = reg("[", chars(NameStartChar), "\\u{10000}-\\u{10FFFF}", "]");
340
- }
341
- var NameStartChar_s = chars(NameStartChar);
342
- var NameChar = reg("[", NameStartChar_s, chars(/[-.0-9\xB7]/), chars(/[\u0300-\u036F\u203F-\u2040]/), "]");
343
- var Name = reg(NameStartChar, NameChar, "*");
344
- var Nmtoken = reg(NameChar, "+");
345
- var EntityRef = reg("&", Name, ";");
346
- var CharRef = regg(/&#[0-9]+;|&#x[0-9a-fA-F]+;/);
347
- var Reference = regg(EntityRef, "|", CharRef);
348
- var PEReference = reg("%", Name, ";");
349
- var EntityValue = regg(reg('"', regg(/[^%&"]/, "|", PEReference, "|", Reference), "*", '"'), "|", reg("'", regg(/[^%&']/, "|", PEReference, "|", Reference), "*", "'"));
350
- var AttValue = regg('"', regg(/[^<&"]/, "|", Reference), "*", '"', "|", "'", regg(/[^<&']/, "|", Reference), "*", "'");
351
- var NCNameStartChar = chars_without(NameStartChar, ":");
352
- var NCNameChar = chars_without(NameChar, ":");
353
- var NCName = reg(NCNameStartChar, NCNameChar, "*");
354
- var QName = reg(NCName, regg(":", NCName), "?");
355
- var QName_exact = reg("^", QName, "$");
356
- var QName_group = reg("(", QName, ")");
357
- var SystemLiteral = regg(/"[^"]*"|'[^']*'/);
358
- var PI = reg(/^<\?/, "(", Name, ")", regg(S, "(", Char, "*?)"), "?", /\?>/);
359
- var PubidChar = /[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/;
360
- var PubidLiteral = regg('"', PubidChar, '*"', "|", "'", chars_without(PubidChar, "'"), "*'");
361
- var COMMENT_START = "<!--";
362
- var COMMENT_END = "-->";
363
- var Comment = reg(COMMENT_START, regg(chars_without(Char, "-"), "|", reg("-", chars_without(Char, "-"))), "*", COMMENT_END);
364
- var PCDATA = "#PCDATA";
365
- var Mixed = regg(reg(/\(/, S_OPT, PCDATA, regg(S_OPT, /\|/, S_OPT, QName), "*", S_OPT, /\)\*/), "|", reg(/\(/, S_OPT, PCDATA, S_OPT, /\)/));
366
- var _children_quantity = /[?*+]?/;
367
- var children2 = reg(/\([^>]+\)/, _children_quantity);
368
- var contentspec = regg("EMPTY", "|", "ANY", "|", Mixed, "|", children2);
369
- var ELEMENTDECL_START = "<!ELEMENT";
370
- var elementdecl = reg(ELEMENTDECL_START, S, regg(QName, "|", PEReference), S, regg(contentspec, "|", PEReference), S_OPT, ">");
371
- var NotationType = reg("NOTATION", S, /\(/, S_OPT, Name, regg(S_OPT, /\|/, S_OPT, Name), "*", S_OPT, /\)/);
372
- var Enumeration = reg(/\(/, S_OPT, Nmtoken, regg(S_OPT, /\|/, S_OPT, Nmtoken), "*", S_OPT, /\)/);
373
- var EnumeratedType = regg(NotationType, "|", Enumeration);
374
- var AttType = regg(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/, "|", EnumeratedType);
375
- var DefaultDecl = regg(/#REQUIRED|#IMPLIED/, "|", regg(regg("#FIXED", S), "?", AttValue));
376
- var AttDef = regg(S, Name, S, AttType, S, DefaultDecl);
377
- var ATTLIST_DECL_START = "<!ATTLIST";
378
- var AttlistDecl = reg(ATTLIST_DECL_START, S, Name, AttDef, "*", S_OPT, ">");
379
- var ABOUT_LEGACY_COMPAT = "about:legacy-compat";
380
- var ABOUT_LEGACY_COMPAT_SystemLiteral = regg('"' + ABOUT_LEGACY_COMPAT + '"', "|", "'" + ABOUT_LEGACY_COMPAT + "'");
381
- var SYSTEM = "SYSTEM";
382
- var PUBLIC = "PUBLIC";
383
- var ExternalID = regg(regg(SYSTEM, S, SystemLiteral), "|", regg(PUBLIC, S, PubidLiteral, S, SystemLiteral));
384
- var ExternalID_match = reg("^", regg(regg(SYSTEM, S, "(?<SystemLiteralOnly>", SystemLiteral, ")"), "|", regg(PUBLIC, S, "(?<PubidLiteral>", PubidLiteral, ")", S, "(?<SystemLiteral>", SystemLiteral, ")")));
385
- var PubidLiteral_match = reg("^", PubidLiteral, "$");
386
- var SystemLiteral_match = reg("^", SystemLiteral, "$");
387
- var NDataDecl = regg(S, "NDATA", S, Name);
388
- var EntityDef = regg(EntityValue, "|", regg(ExternalID, NDataDecl, "?"));
389
- var ENTITY_DECL_START = "<!ENTITY";
390
- var GEDecl = reg(ENTITY_DECL_START, S, Name, S, EntityDef, S_OPT, ">");
391
- var PEDef = regg(EntityValue, "|", ExternalID);
392
- var PEDecl = reg(ENTITY_DECL_START, S, "%", S, Name, S, PEDef, S_OPT, ">");
393
- var EntityDecl = regg(GEDecl, "|", PEDecl);
394
- var PublicID = reg(PUBLIC, S, PubidLiteral);
395
- var NotationDecl = reg("<!NOTATION", S, Name, S, regg(ExternalID, "|", PublicID), S_OPT, ">");
396
- var Eq = reg(S_OPT, "=", S_OPT);
397
- var VersionNum = /1[.]\d+/;
398
- var VersionInfo = reg(S, "version", Eq, regg("'", VersionNum, "'", "|", '"', VersionNum, '"'));
399
- var EncName = /[A-Za-z][-A-Za-z0-9._]*/;
400
- var EncodingDecl = regg(S, "encoding", Eq, regg('"', EncName, '"', "|", "'", EncName, "'"));
401
- var SDDecl = regg(S, "standalone", Eq, regg("'", regg("yes", "|", "no"), "'", "|", '"', regg("yes", "|", "no"), '"'));
402
- var XMLDecl = reg(/^<\?xml/, VersionInfo, EncodingDecl, "?", SDDecl, "?", S_OPT, /\?>/);
403
- var DOCTYPE_DECL_START = "<!DOCTYPE";
404
- var CDATA_START = "<![CDATA[";
405
- var CDATA_END = "]]>";
406
- var CDStart = /<!\[CDATA\[/;
407
- var CDEnd = /\]\]>/;
408
- var CData = reg(Char, "*?", CDEnd);
409
- var CDSect = reg(CDStart, CData);
410
- exports.chars = chars;
411
- exports.chars_without = chars_without;
412
- exports.detectUnicodeSupport = detectUnicodeSupport;
413
- exports.reg = reg;
414
- exports.regg = regg;
415
- exports.ABOUT_LEGACY_COMPAT = ABOUT_LEGACY_COMPAT;
416
- exports.ABOUT_LEGACY_COMPAT_SystemLiteral = ABOUT_LEGACY_COMPAT_SystemLiteral;
417
- exports.AttlistDecl = AttlistDecl;
418
- exports.CDATA_START = CDATA_START;
419
- exports.CDATA_END = CDATA_END;
420
- exports.CDSect = CDSect;
421
- exports.Char = Char;
422
- exports.Comment = Comment;
423
- exports.COMMENT_START = COMMENT_START;
424
- exports.COMMENT_END = COMMENT_END;
425
- exports.DOCTYPE_DECL_START = DOCTYPE_DECL_START;
426
- exports.elementdecl = elementdecl;
427
- exports.EntityDecl = EntityDecl;
428
- exports.EntityValue = EntityValue;
429
- exports.ExternalID = ExternalID;
430
- exports.ExternalID_match = ExternalID_match;
431
- exports.Name = Name;
432
- exports.NotationDecl = NotationDecl;
433
- exports.Reference = Reference;
434
- exports.PEReference = PEReference;
435
- exports.PI = PI;
436
- exports.PUBLIC = PUBLIC;
437
- exports.PubidLiteral = PubidLiteral;
438
- exports.PubidLiteral_match = PubidLiteral_match;
439
- exports.QName = QName;
440
- exports.QName_exact = QName_exact;
441
- exports.QName_group = QName_group;
442
- exports.S = S;
443
- exports.SChar_s = SChar_s;
444
- exports.S_OPT = S_OPT;
445
- exports.SYSTEM = SYSTEM;
446
- exports.SystemLiteral = SystemLiteral;
447
- exports.SystemLiteral_match = SystemLiteral_match;
448
- exports.InvalidChar = InvalidChar;
449
- exports.UNICODE_REPLACEMENT_CHARACTER = UNICODE_REPLACEMENT_CHARACTER;
450
- exports.UNICODE_SUPPORT = UNICODE_SUPPORT;
451
- exports.XMLDecl = XMLDecl;
452
- });
453
-
454
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/dom.js
67
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/dom.js
455
68
  var require_dom = __commonJS((exports) => {
456
69
  var conventions = require_conventions();
457
70
  var find = conventions.find;
458
- var hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;
459
- var hasOwn = conventions.hasOwn;
460
- var isHTMLMimeType = conventions.isHTMLMimeType;
461
- var isHTMLRawTextElement = conventions.isHTMLRawTextElement;
462
- var isHTMLVoidElement = conventions.isHTMLVoidElement;
463
- var MIME_TYPE = conventions.MIME_TYPE;
464
71
  var NAMESPACE = conventions.NAMESPACE;
465
- var PDC = Symbol();
466
- var errors = require_errors();
467
- var DOMException = errors.DOMException;
468
- var DOMExceptionName = errors.DOMExceptionName;
469
- var g = require_grammar();
470
- function checkSymbol(symbol) {
471
- if (symbol !== PDC) {
472
- throw new TypeError("Illegal constructor");
473
- }
474
- }
475
72
  function notEmptyString(input) {
476
73
  return input !== "";
477
74
  }
@@ -479,7 +76,7 @@ var require_dom = __commonJS((exports) => {
479
76
  return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : [];
480
77
  }
481
78
  function orderedSetReducer(current, element) {
482
- if (!hasOwn(current, element)) {
79
+ if (!current.hasOwnProperty(element)) {
483
80
  current[element] = true;
484
81
  }
485
82
  return current;
@@ -495,38 +92,9 @@ var require_dom = __commonJS((exports) => {
495
92
  return list && list.indexOf(element) !== -1;
496
93
  };
497
94
  }
498
- function validateQualifiedName(qualifiedName) {
499
- if (!g.QName_exact.test(qualifiedName)) {
500
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 'invalid character in qualified name "' + qualifiedName + '"');
501
- }
502
- }
503
- function validateAndExtract(namespace, qualifiedName) {
504
- validateQualifiedName(qualifiedName);
505
- namespace = namespace || null;
506
- var prefix = null;
507
- var localName = qualifiedName;
508
- if (qualifiedName.indexOf(":") >= 0) {
509
- var splitResult = qualifiedName.split(":");
510
- prefix = splitResult[0];
511
- localName = splitResult[1];
512
- }
513
- if (prefix !== null && namespace === null) {
514
- throw new DOMException(DOMException.NAMESPACE_ERR, "prefix is non-null and namespace is null");
515
- }
516
- if (prefix === "xml" && namespace !== conventions.NAMESPACE.XML) {
517
- throw new DOMException(DOMException.NAMESPACE_ERR, 'prefix is "xml" and namespace is not the XML namespace');
518
- }
519
- if ((prefix === "xmlns" || qualifiedName === "xmlns") && namespace !== conventions.NAMESPACE.XMLNS) {
520
- throw new DOMException(DOMException.NAMESPACE_ERR, 'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');
521
- }
522
- if (namespace === conventions.NAMESPACE.XMLNS && prefix !== "xmlns" && qualifiedName !== "xmlns") {
523
- throw new DOMException(DOMException.NAMESPACE_ERR, 'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');
524
- }
525
- return [namespace, prefix, localName];
526
- }
527
95
  function copy(src, dest) {
528
96
  for (var p in src) {
529
- if (hasOwn(src, p)) {
97
+ if (Object.prototype.hasOwnProperty.call(src, p)) {
530
98
  dest[p] = src[p];
531
99
  }
532
100
  }
@@ -534,11 +102,12 @@ var require_dom = __commonJS((exports) => {
534
102
  function _extends(Class, Super) {
535
103
  var pt = Class.prototype;
536
104
  if (!(pt instanceof Super)) {
537
- let t = function() {};
538
- t.prototype = Super.prototype;
539
- t = new t;
540
- copy(pt, t);
541
- Class.prototype = pt = t;
105
+ let t2 = function() {};
106
+ var t = t2;
107
+ t2.prototype = Super.prototype;
108
+ t2 = new t2;
109
+ copy(pt, t2);
110
+ Class.prototype = pt = t2;
542
111
  }
543
112
  if (pt.constructor != Class) {
544
113
  if (typeof Class != "function") {
@@ -560,51 +129,49 @@ var require_dom = __commonJS((exports) => {
560
129
  var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
561
130
  var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
562
131
  var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
563
- var DocumentPosition = conventions.freeze({
564
- DOCUMENT_POSITION_DISCONNECTED: 1,
565
- DOCUMENT_POSITION_PRECEDING: 2,
566
- DOCUMENT_POSITION_FOLLOWING: 4,
567
- DOCUMENT_POSITION_CONTAINS: 8,
568
- DOCUMENT_POSITION_CONTAINED_BY: 16,
569
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32
570
- });
571
- function commonAncestor(a, b) {
572
- if (b.length < a.length)
573
- return commonAncestor(b, a);
574
- var c = null;
575
- for (var n in a) {
576
- if (a[n] !== b[n])
577
- return c;
578
- c = a[n];
132
+ var ExceptionCode = {};
133
+ var ExceptionMessage = {};
134
+ var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1);
135
+ var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2);
136
+ var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3);
137
+ var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4);
138
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5);
139
+ var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6);
140
+ var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7);
141
+ var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8);
142
+ var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9);
143
+ var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10);
144
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11);
145
+ var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12);
146
+ var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13);
147
+ var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14);
148
+ var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15);
149
+ function DOMException(code, message) {
150
+ if (message instanceof Error) {
151
+ var error = message;
152
+ } else {
153
+ error = this;
154
+ Error.call(this, ExceptionMessage[code]);
155
+ this.message = ExceptionMessage[code];
156
+ if (Error.captureStackTrace)
157
+ Error.captureStackTrace(this, DOMException);
579
158
  }
580
- return c;
581
- }
582
- function docGUID(doc) {
583
- if (!doc.guid)
584
- doc.guid = Math.random();
585
- return doc.guid;
159
+ error.code = code;
160
+ if (message)
161
+ this.message = this.message + ": " + message;
162
+ return error;
586
163
  }
164
+ DOMException.prototype = Error.prototype;
165
+ copy(ExceptionCode, DOMException);
587
166
  function NodeList() {}
588
167
  NodeList.prototype = {
589
168
  length: 0,
590
169
  item: function(index) {
591
170
  return index >= 0 && index < this.length ? this[index] : null;
592
171
  },
593
- toString: function(options) {
594
- var opts;
595
- if (typeof options === "function") {
596
- opts = { requireWellFormed: false, splitCDATASections: true, nodeFilter: options };
597
- } else if (!!options) {
598
- opts = {
599
- requireWellFormed: !!options.requireWellFormed,
600
- splitCDATASections: options.splitCDATASections !== false,
601
- nodeFilter: options.nodeFilter || null
602
- };
603
- } else {
604
- opts = { requireWellFormed: false, splitCDATASections: true, nodeFilter: null };
605
- }
172
+ toString: function(isHTML, nodeFilter) {
606
173
  for (var buf = [], i = 0;i < this.length; i++) {
607
- serializeToString(this[i], buf, null, opts);
174
+ serializeToString(this[i], buf, isHTML, nodeFilter);
608
175
  }
609
176
  return buf.join("");
610
177
  },
@@ -615,29 +182,6 @@ var require_dom = __commonJS((exports) => {
615
182
  return Array.prototype.indexOf.call(this, item);
616
183
  }
617
184
  };
618
- NodeList.prototype[Symbol.iterator] = function() {
619
- var me = this;
620
- var index = 0;
621
- return {
622
- next: function() {
623
- if (index < me.length) {
624
- return {
625
- value: me[index++],
626
- done: false
627
- };
628
- } else {
629
- return {
630
- done: true
631
- };
632
- }
633
- },
634
- return: function() {
635
- return {
636
- done: true
637
- };
638
- }
639
- };
640
- };
641
185
  function LiveNodeList(node, refresh) {
642
186
  this._node = node;
643
187
  this._refresh = refresh;
@@ -650,7 +194,7 @@ var require_dom = __commonJS((exports) => {
650
194
  __set__(list, "length", ls.length);
651
195
  if (!list.$$length || ls.length < list.$$length) {
652
196
  for (var i = ls.length;i in list; i++) {
653
- if (hasOwn(list, i)) {
197
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
654
198
  delete list[i];
655
199
  }
656
200
  }
@@ -666,20 +210,18 @@ var require_dom = __commonJS((exports) => {
666
210
  _extends(LiveNodeList, NodeList);
667
211
  function NamedNodeMap() {}
668
212
  function _findNodeIndex(list, node) {
669
- var i = 0;
670
- while (i < list.length) {
213
+ var i = list.length;
214
+ while (i--) {
671
215
  if (list[i] === node) {
672
216
  return i;
673
217
  }
674
- i++;
675
218
  }
676
219
  }
677
220
  function _addNamedNode(el, list, newAttr, oldAttr) {
678
221
  if (oldAttr) {
679
222
  list[_findNodeIndex(list, oldAttr)] = newAttr;
680
223
  } else {
681
- list[list.length] = newAttr;
682
- list.length++;
224
+ list[list.length++] = newAttr;
683
225
  }
684
226
  if (el) {
685
227
  newAttr.ownerElement = el;
@@ -694,7 +236,7 @@ var require_dom = __commonJS((exports) => {
694
236
  var i = _findNodeIndex(list, attr);
695
237
  if (i >= 0) {
696
238
  var lastIndex = list.length - 1;
697
- while (i <= lastIndex) {
239
+ while (i < lastIndex) {
698
240
  list[i] = list[++i];
699
241
  }
700
242
  list.length = lastIndex;
@@ -702,110 +244,71 @@ var require_dom = __commonJS((exports) => {
702
244
  var doc = el.ownerDocument;
703
245
  if (doc) {
704
246
  _onRemoveAttribute(doc, el, attr);
247
+ attr.ownerElement = null;
705
248
  }
706
- attr.ownerElement = null;
707
249
  }
250
+ } else {
251
+ throw new DOMException(NOT_FOUND_ERR, new Error(el.tagName + "@" + attr));
708
252
  }
709
253
  }
710
254
  NamedNodeMap.prototype = {
711
255
  length: 0,
712
256
  item: NodeList.prototype.item,
713
- getNamedItem: function(localName) {
714
- if (this._ownerElement && this._ownerElement._isInHTMLDocumentAndNamespace()) {
715
- localName = localName.toLowerCase();
716
- }
717
- var i = 0;
718
- while (i < this.length) {
257
+ getNamedItem: function(key) {
258
+ var i = this.length;
259
+ while (i--) {
719
260
  var attr = this[i];
720
- if (attr.nodeName === localName) {
261
+ if (attr.nodeName == key) {
721
262
  return attr;
722
263
  }
723
- i++;
724
264
  }
725
- return null;
726
265
  },
727
266
  setNamedItem: function(attr) {
728
267
  var el = attr.ownerElement;
729
- if (el && el !== this._ownerElement) {
730
- throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR);
731
- }
732
- var oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);
733
- if (oldAttr === attr) {
734
- return attr;
268
+ if (el && el != this._ownerElement) {
269
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
735
270
  }
271
+ var oldAttr = this.getNamedItem(attr.nodeName);
736
272
  _addNamedNode(this._ownerElement, this, attr, oldAttr);
737
273
  return oldAttr;
738
274
  },
739
275
  setNamedItemNS: function(attr) {
740
- return this.setNamedItem(attr);
741
- },
742
- removeNamedItem: function(localName) {
743
- var attr = this.getNamedItem(localName);
744
- if (!attr) {
745
- throw new DOMException(DOMException.NOT_FOUND_ERR, localName);
276
+ var el = attr.ownerElement, oldAttr;
277
+ if (el && el != this._ownerElement) {
278
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
746
279
  }
280
+ oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);
281
+ _addNamedNode(this._ownerElement, this, attr, oldAttr);
282
+ return oldAttr;
283
+ },
284
+ removeNamedItem: function(key) {
285
+ var attr = this.getNamedItem(key);
747
286
  _removeNamedNode(this._ownerElement, this, attr);
748
287
  return attr;
749
288
  },
750
289
  removeNamedItemNS: function(namespaceURI, localName) {
751
290
  var attr = this.getNamedItemNS(namespaceURI, localName);
752
- if (!attr) {
753
- throw new DOMException(DOMException.NOT_FOUND_ERR, namespaceURI ? namespaceURI + " : " + localName : localName);
754
- }
755
291
  _removeNamedNode(this._ownerElement, this, attr);
756
292
  return attr;
757
293
  },
758
294
  getNamedItemNS: function(namespaceURI, localName) {
759
- if (!namespaceURI) {
760
- namespaceURI = null;
761
- }
762
- var i = 0;
763
- while (i < this.length) {
295
+ var i = this.length;
296
+ while (i--) {
764
297
  var node = this[i];
765
- if (node.localName === localName && node.namespaceURI === namespaceURI) {
298
+ if (node.localName == localName && node.namespaceURI == namespaceURI) {
766
299
  return node;
767
300
  }
768
- i++;
769
301
  }
770
302
  return null;
771
303
  }
772
304
  };
773
- NamedNodeMap.prototype[Symbol.iterator] = function() {
774
- var me = this;
775
- var index = 0;
776
- return {
777
- next: function() {
778
- if (index < me.length) {
779
- return {
780
- value: me[index++],
781
- done: false
782
- };
783
- } else {
784
- return {
785
- done: true
786
- };
787
- }
788
- },
789
- return: function() {
790
- return {
791
- done: true
792
- };
793
- }
794
- };
795
- };
796
305
  function DOMImplementation() {}
797
306
  DOMImplementation.prototype = {
798
307
  hasFeature: function(feature, version) {
799
308
  return true;
800
309
  },
801
310
  createDocument: function(namespaceURI, qualifiedName, doctype) {
802
- var contentType = MIME_TYPE.XML_APPLICATION;
803
- if (namespaceURI === NAMESPACE.HTML) {
804
- contentType = MIME_TYPE.XML_XHTML_APPLICATION;
805
- } else if (namespaceURI === NAMESPACE.SVG) {
806
- contentType = MIME_TYPE.XML_SVG_IMAGE;
807
- }
808
- var doc = new Document(PDC, { contentType });
311
+ var doc = new Document;
809
312
  doc.implementation = this;
810
313
  doc.childNodes = new NodeList;
811
314
  doc.doctype = doctype || null;
@@ -818,148 +321,29 @@ var require_dom = __commonJS((exports) => {
818
321
  }
819
322
  return doc;
820
323
  },
821
- createDocumentType: function(qualifiedName, publicId, systemId, internalSubset) {
822
- validateQualifiedName(qualifiedName);
823
- var node = new DocumentType(PDC);
324
+ createDocumentType: function(qualifiedName, publicId, systemId) {
325
+ var node = new DocumentType;
824
326
  node.name = qualifiedName;
825
327
  node.nodeName = qualifiedName;
826
328
  node.publicId = publicId || "";
827
329
  node.systemId = systemId || "";
828
- node.internalSubset = internalSubset || "";
829
- node.childNodes = new NodeList;
830
330
  return node;
831
- },
832
- createHTMLDocument: function(title) {
833
- var doc = new Document(PDC, { contentType: MIME_TYPE.HTML });
834
- doc.implementation = this;
835
- doc.childNodes = new NodeList;
836
- if (title !== false) {
837
- doc.doctype = this.createDocumentType("html");
838
- doc.doctype.ownerDocument = doc;
839
- doc.appendChild(doc.doctype);
840
- var htmlNode = doc.createElement("html");
841
- doc.appendChild(htmlNode);
842
- var headNode = doc.createElement("head");
843
- htmlNode.appendChild(headNode);
844
- if (typeof title === "string") {
845
- var titleNode = doc.createElement("title");
846
- titleNode.appendChild(doc.createTextNode(title));
847
- headNode.appendChild(titleNode);
848
- }
849
- htmlNode.appendChild(doc.createElement("body"));
850
- }
851
- return doc;
852
331
  }
853
332
  };
854
- function Node(symbol) {
855
- checkSymbol(symbol);
856
- }
333
+ function Node() {}
857
334
  Node.prototype = {
858
335
  firstChild: null,
859
336
  lastChild: null,
860
337
  previousSibling: null,
861
338
  nextSibling: null,
339
+ attributes: null,
862
340
  parentNode: null,
863
- get parentElement() {
864
- return this.parentNode && this.parentNode.nodeType === this.ELEMENT_NODE ? this.parentNode : null;
865
- },
866
341
  childNodes: null,
867
342
  ownerDocument: null,
868
343
  nodeValue: null,
869
344
  namespaceURI: null,
870
345
  prefix: null,
871
346
  localName: null,
872
- baseURI: "about:blank",
873
- get isConnected() {
874
- var rootNode = this.getRootNode();
875
- return rootNode && rootNode.nodeType === rootNode.DOCUMENT_NODE;
876
- },
877
- contains: function(other) {
878
- if (!other)
879
- return false;
880
- var parent = other;
881
- do {
882
- if (this === parent)
883
- return true;
884
- parent = parent.parentNode;
885
- } while (parent);
886
- return false;
887
- },
888
- getRootNode: function(options) {
889
- var parent = this;
890
- do {
891
- if (!parent.parentNode) {
892
- return parent;
893
- }
894
- parent = parent.parentNode;
895
- } while (parent);
896
- },
897
- isEqualNode: function(otherNode) {
898
- if (!otherNode)
899
- return false;
900
- var stack = [{ node: this, other: otherNode }];
901
- while (stack.length > 0) {
902
- var pair = stack.pop();
903
- var node = pair.node;
904
- var other = pair.other;
905
- if (node.nodeType !== other.nodeType)
906
- return false;
907
- switch (node.nodeType) {
908
- case node.DOCUMENT_TYPE_NODE:
909
- if (node.name !== other.name)
910
- return false;
911
- if (node.publicId !== other.publicId)
912
- return false;
913
- if (node.systemId !== other.systemId)
914
- return false;
915
- break;
916
- case node.ELEMENT_NODE:
917
- if (node.namespaceURI !== other.namespaceURI)
918
- return false;
919
- if (node.prefix !== other.prefix)
920
- return false;
921
- if (node.localName !== other.localName)
922
- return false;
923
- if (node.attributes.length !== other.attributes.length)
924
- return false;
925
- for (var i = 0;i < node.attributes.length; i++) {
926
- var attr = node.attributes.item(i);
927
- var otherAttr = other.getAttributeNodeNS(attr.namespaceURI, attr.localName);
928
- if (!otherAttr)
929
- return false;
930
- stack.push({ node: attr, other: otherAttr });
931
- }
932
- break;
933
- case node.ATTRIBUTE_NODE:
934
- if (node.namespaceURI !== other.namespaceURI)
935
- return false;
936
- if (node.localName !== other.localName)
937
- return false;
938
- if (node.value !== other.value)
939
- return false;
940
- break;
941
- case node.PROCESSING_INSTRUCTION_NODE:
942
- if (node.target !== other.target || node.data !== other.data)
943
- return false;
944
- break;
945
- case node.TEXT_NODE:
946
- case node.CDATA_SECTION_NODE:
947
- case node.COMMENT_NODE:
948
- if (node.data !== other.data)
949
- return false;
950
- break;
951
- }
952
- if (node.childNodes.length !== other.childNodes.length)
953
- return false;
954
- for (var i = node.childNodes.length - 1;i >= 0; i--) {
955
- stack.push({ node: node.childNodes[i], other: other.childNodes[i] });
956
- }
957
- }
958
- return true;
959
- },
960
- isSameNode: function(otherNode) {
961
- return this === otherNode;
962
- },
963
347
  insertBefore: function(newChild, refChild) {
964
348
  return _insertBefore(this, newChild, refChild);
965
349
  },
@@ -982,32 +366,31 @@ var require_dom = __commonJS((exports) => {
982
366
  return cloneNode(this.ownerDocument || this, this, deep);
983
367
  },
984
368
  normalize: function() {
985
- walkDOM(this, null, {
986
- enter: function(node) {
987
- var child = node.firstChild;
988
- while (child) {
989
- var next = child.nextSibling;
990
- if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
991
- node.removeChild(next);
992
- child.appendData(next.data);
993
- } else {
994
- child = next;
995
- }
996
- }
997
- return true;
369
+ var child = this.firstChild;
370
+ while (child) {
371
+ var next = child.nextSibling;
372
+ if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {
373
+ this.removeChild(next);
374
+ child.appendData(next.data);
375
+ } else {
376
+ child.normalize();
377
+ child = next;
998
378
  }
999
- });
379
+ }
1000
380
  },
1001
381
  isSupported: function(feature, version) {
1002
382
  return this.ownerDocument.implementation.hasFeature(feature, version);
1003
383
  },
384
+ hasAttributes: function() {
385
+ return this.attributes.length > 0;
386
+ },
1004
387
  lookupPrefix: function(namespaceURI) {
1005
388
  var el = this;
1006
389
  while (el) {
1007
390
  var map = el._nsMap;
1008
391
  if (map) {
1009
392
  for (var n in map) {
1010
- if (hasOwn(map, n) && map[n] === namespaceURI) {
393
+ if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
1011
394
  return n;
1012
395
  }
1013
396
  }
@@ -1021,7 +404,7 @@ var require_dom = __commonJS((exports) => {
1021
404
  while (el) {
1022
405
  var map = el._nsMap;
1023
406
  if (map) {
1024
- if (hasOwn(map, prefix)) {
407
+ if (Object.prototype.hasOwnProperty.call(map, prefix)) {
1025
408
  return map[prefix];
1026
409
  }
1027
410
  }
@@ -1032,72 +415,6 @@ var require_dom = __commonJS((exports) => {
1032
415
  isDefaultNamespace: function(namespaceURI) {
1033
416
  var prefix = this.lookupPrefix(namespaceURI);
1034
417
  return prefix == null;
1035
- },
1036
- compareDocumentPosition: function(other) {
1037
- if (this === other)
1038
- return 0;
1039
- var node1 = other;
1040
- var node2 = this;
1041
- var attr1 = null;
1042
- var attr2 = null;
1043
- if (node1 instanceof Attr) {
1044
- attr1 = node1;
1045
- node1 = attr1.ownerElement;
1046
- }
1047
- if (node2 instanceof Attr) {
1048
- attr2 = node2;
1049
- node2 = attr2.ownerElement;
1050
- if (attr1 && node1 && node2 === node1) {
1051
- for (var i = 0, attr;attr = node2.attributes[i]; i++) {
1052
- if (attr === attr1)
1053
- return DocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + DocumentPosition.DOCUMENT_POSITION_PRECEDING;
1054
- if (attr === attr2)
1055
- return DocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;
1056
- }
1057
- }
1058
- }
1059
- if (!node1 || !node2 || node2.ownerDocument !== node1.ownerDocument) {
1060
- return DocumentPosition.DOCUMENT_POSITION_DISCONNECTED + DocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + (docGUID(node2.ownerDocument) > docGUID(node1.ownerDocument) ? DocumentPosition.DOCUMENT_POSITION_FOLLOWING : DocumentPosition.DOCUMENT_POSITION_PRECEDING);
1061
- }
1062
- if (attr2 && node1 === node2) {
1063
- return DocumentPosition.DOCUMENT_POSITION_CONTAINS + DocumentPosition.DOCUMENT_POSITION_PRECEDING;
1064
- }
1065
- if (attr1 && node1 === node2) {
1066
- return DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;
1067
- }
1068
- var chain1 = [];
1069
- var ancestor1 = node1.parentNode;
1070
- while (ancestor1) {
1071
- if (!attr2 && ancestor1 === node2) {
1072
- return DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;
1073
- }
1074
- chain1.push(ancestor1);
1075
- ancestor1 = ancestor1.parentNode;
1076
- }
1077
- chain1.reverse();
1078
- var chain2 = [];
1079
- var ancestor2 = node2.parentNode;
1080
- while (ancestor2) {
1081
- if (!attr1 && ancestor2 === node1) {
1082
- return DocumentPosition.DOCUMENT_POSITION_CONTAINS + DocumentPosition.DOCUMENT_POSITION_PRECEDING;
1083
- }
1084
- chain2.push(ancestor2);
1085
- ancestor2 = ancestor2.parentNode;
1086
- }
1087
- chain2.reverse();
1088
- var ca = commonAncestor(chain1, chain2);
1089
- for (var n in ca.childNodes) {
1090
- var child = ca.childNodes[n];
1091
- if (child === node2)
1092
- return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;
1093
- if (child === node1)
1094
- return DocumentPosition.DOCUMENT_POSITION_PRECEDING;
1095
- if (chain2.indexOf(child) >= 0)
1096
- return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;
1097
- if (chain1.indexOf(child) >= 0)
1098
- return DocumentPosition.DOCUMENT_POSITION_PRECEDING;
1099
- }
1100
- return 0;
1101
418
  }
1102
419
  };
1103
420
  function _xmlEncoder(c) {
@@ -1105,49 +422,20 @@ var require_dom = __commonJS((exports) => {
1105
422
  }
1106
423
  copy(NodeType, Node);
1107
424
  copy(NodeType, Node.prototype);
1108
- copy(DocumentPosition, Node);
1109
- copy(DocumentPosition, Node.prototype);
1110
425
  function _visitNode(node, callback) {
1111
- walkDOM(node, null, {
1112
- enter: function(n) {
1113
- return callback(n) ? walkDOM.STOP : true;
1114
- }
1115
- });
1116
- }
1117
- function walkDOM(node, context, callbacks) {
1118
- var stack = [{ node, context, phase: walkDOM.ENTER }];
1119
- while (stack.length > 0) {
1120
- var frame = stack.pop();
1121
- if (frame.phase === walkDOM.ENTER) {
1122
- var childContext = callbacks.enter(frame.node, frame.context);
1123
- if (childContext === walkDOM.STOP) {
1124
- return walkDOM.STOP;
1125
- }
1126
- stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
1127
- if (childContext === null || childContext === undefined) {
1128
- continue;
1129
- }
1130
- var child = frame.node.lastChild;
1131
- while (child) {
1132
- stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
1133
- child = child.previousSibling;
1134
- }
1135
- } else {
1136
- if (callbacks.exit) {
1137
- callbacks.exit(frame.node, frame.context);
426
+ if (callback(node)) {
427
+ return true;
428
+ }
429
+ if (node = node.firstChild) {
430
+ do {
431
+ if (_visitNode(node, callback)) {
432
+ return true;
1138
433
  }
1139
- }
434
+ } while (node = node.nextSibling);
1140
435
  }
1141
436
  }
1142
- walkDOM.STOP = Symbol("walkDOM.STOP");
1143
- walkDOM.ENTER = 0;
1144
- walkDOM.EXIT = 1;
1145
- function Document(symbol, options) {
1146
- checkSymbol(symbol);
1147
- var opt = options || {};
437
+ function Document() {
1148
438
  this.ownerDocument = this;
1149
- this.contentType = opt.contentType || MIME_TYPE.XML_APPLICATION;
1150
- this.type = isHTMLMimeType(this.contentType) ? "html" : "xml";
1151
439
  }
1152
440
  function _onAddAttribute(doc, el, newAttr) {
1153
441
  doc && doc._inc++;
@@ -1163,51 +451,48 @@ var require_dom = __commonJS((exports) => {
1163
451
  delete el._nsMap[newAttr.prefix ? newAttr.localName : ""];
1164
452
  }
1165
453
  }
1166
- function _onUpdateChild(doc, parent, newChild) {
454
+ function _onUpdateChild(doc, el, newChild) {
1167
455
  if (doc && doc._inc) {
1168
456
  doc._inc++;
1169
- var childNodes = parent.childNodes;
1170
- if (newChild && !newChild.nextSibling) {
1171
- childNodes[childNodes.length++] = newChild;
457
+ var cs = el.childNodes;
458
+ if (newChild) {
459
+ cs[cs.length++] = newChild;
1172
460
  } else {
1173
- var child = parent.firstChild;
461
+ var child = el.firstChild;
1174
462
  var i = 0;
1175
463
  while (child) {
1176
- childNodes[i++] = child;
464
+ cs[i++] = child;
1177
465
  child = child.nextSibling;
1178
466
  }
1179
- childNodes.length = i;
1180
- delete childNodes[childNodes.length];
467
+ cs.length = i;
468
+ delete cs[cs.length];
1181
469
  }
1182
470
  }
1183
471
  }
1184
472
  function _removeChild(parentNode, child) {
1185
- if (parentNode !== child.parentNode) {
1186
- throw new DOMException(DOMException.NOT_FOUND_ERR, "child's parent is not parent");
1187
- }
1188
- var oldPreviousSibling = child.previousSibling;
1189
- var oldNextSibling = child.nextSibling;
1190
- if (oldPreviousSibling) {
1191
- oldPreviousSibling.nextSibling = oldNextSibling;
473
+ var previous = child.previousSibling;
474
+ var next = child.nextSibling;
475
+ if (previous) {
476
+ previous.nextSibling = next;
1192
477
  } else {
1193
- parentNode.firstChild = oldNextSibling;
478
+ parentNode.firstChild = next;
1194
479
  }
1195
- if (oldNextSibling) {
1196
- oldNextSibling.previousSibling = oldPreviousSibling;
480
+ if (next) {
481
+ next.previousSibling = previous;
1197
482
  } else {
1198
- parentNode.lastChild = oldPreviousSibling;
483
+ parentNode.lastChild = previous;
1199
484
  }
1200
- _onUpdateChild(parentNode.ownerDocument, parentNode);
1201
485
  child.parentNode = null;
1202
486
  child.previousSibling = null;
1203
487
  child.nextSibling = null;
488
+ _onUpdateChild(parentNode.ownerDocument, parentNode);
1204
489
  return child;
1205
490
  }
1206
491
  function hasValidParentNodeType(node) {
1207
492
  return node && (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE);
1208
493
  }
1209
494
  function hasInsertableNodeType(node) {
1210
- return node && (node.nodeType === Node.CDATA_SECTION_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.DOCUMENT_TYPE_NODE || node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE || node.nodeType === Node.TEXT_NODE);
495
+ return node && (isElementNode(node) || isTextNode(node) || isDocTypeNode(node) || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE);
1211
496
  }
1212
497
  function isDocTypeNode(node) {
1213
498
  return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
@@ -1239,13 +524,13 @@ var require_dom = __commonJS((exports) => {
1239
524
  }
1240
525
  function assertPreInsertionValidity1to5(parent, node, child) {
1241
526
  if (!hasValidParentNodeType(parent)) {
1242
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent.nodeType);
527
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent.nodeType);
1243
528
  }
1244
529
  if (child && child.parentNode !== parent) {
1245
- throw new DOMException(DOMException.NOT_FOUND_ERR, "child not in parent");
530
+ throw new DOMException(NOT_FOUND_ERR, "child not in parent");
1246
531
  }
1247
532
  if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE) {
1248
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Unexpected node type " + node.nodeType + " for parent node type " + parent.nodeType);
533
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Unexpected node type " + node.nodeType + " for parent node type " + parent.nodeType);
1249
534
  }
1250
535
  }
1251
536
  function assertPreInsertionValidityInDocument(parent, node, child) {
@@ -1254,27 +539,27 @@ var require_dom = __commonJS((exports) => {
1254
539
  if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1255
540
  var nodeChildElements = nodeChildNodes.filter(isElementNode);
1256
541
  if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
1257
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
542
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
1258
543
  }
1259
544
  if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
1260
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
545
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
1261
546
  }
1262
547
  }
1263
548
  if (isElementNode(node)) {
1264
549
  if (!isElementInsertionPossible(parent, child)) {
1265
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
550
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
1266
551
  }
1267
552
  }
1268
553
  if (isDocTypeNode(node)) {
1269
554
  if (find(parentChildNodes, isDocTypeNode)) {
1270
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
555
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
1271
556
  }
1272
557
  var parentElementChild = find(parentChildNodes, isElementNode);
1273
558
  if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
1274
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
559
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
1275
560
  }
1276
561
  if (!child && parentElementChild) {
1277
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
562
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
1278
563
  }
1279
564
  }
1280
565
  }
@@ -1284,27 +569,28 @@ var require_dom = __commonJS((exports) => {
1284
569
  if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1285
570
  var nodeChildElements = nodeChildNodes.filter(isElementNode);
1286
571
  if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
1287
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
572
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
1288
573
  }
1289
574
  if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
1290
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
575
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
1291
576
  }
1292
577
  }
1293
578
  if (isElementNode(node)) {
1294
579
  if (!isElementReplacementPossible(parent, child)) {
1295
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
580
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
1296
581
  }
1297
582
  }
1298
583
  if (isDocTypeNode(node)) {
1299
- let hasDoctypeChildThatIsNotChild = function(node2) {
584
+ let hasDoctypeChildThatIsNotChild2 = function(node2) {
1300
585
  return isDocTypeNode(node2) && node2 !== child;
1301
586
  };
1302
- if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
1303
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
587
+ var hasDoctypeChildThatIsNotChild = hasDoctypeChildThatIsNotChild2;
588
+ if (find(parentChildNodes, hasDoctypeChildThatIsNotChild2)) {
589
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
1304
590
  }
1305
591
  var parentElementChild = find(parentChildNodes, isElementNode);
1306
592
  if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
1307
- throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
593
+ throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
1308
594
  }
1309
595
  }
1310
596
  }
@@ -1341,22 +627,60 @@ var require_dom = __commonJS((exports) => {
1341
627
  }
1342
628
  do {
1343
629
  newFirst.parentNode = parent;
630
+ var targetDoc = parent.ownerDocument || parent;
631
+ _updateOwnerDocument(newFirst, targetDoc);
1344
632
  } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));
1345
- _onUpdateChild(parent.ownerDocument || parent, parent, node);
633
+ _onUpdateChild(parent.ownerDocument || parent, parent);
1346
634
  if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
1347
635
  node.firstChild = node.lastChild = null;
1348
636
  }
1349
637
  return node;
1350
638
  }
639
+ function _updateOwnerDocument(node, newOwnerDocument) {
640
+ if (node.ownerDocument === newOwnerDocument) {
641
+ return;
642
+ }
643
+ node.ownerDocument = newOwnerDocument;
644
+ if (node.nodeType === ELEMENT_NODE && node.attributes) {
645
+ for (var i = 0;i < node.attributes.length; i++) {
646
+ var attr = node.attributes.item(i);
647
+ if (attr) {
648
+ attr.ownerDocument = newOwnerDocument;
649
+ }
650
+ }
651
+ }
652
+ var child = node.firstChild;
653
+ while (child) {
654
+ _updateOwnerDocument(child, newOwnerDocument);
655
+ child = child.nextSibling;
656
+ }
657
+ }
658
+ function _appendSingleChild(parentNode, newChild) {
659
+ if (newChild.parentNode) {
660
+ newChild.parentNode.removeChild(newChild);
661
+ }
662
+ newChild.parentNode = parentNode;
663
+ newChild.previousSibling = parentNode.lastChild;
664
+ newChild.nextSibling = null;
665
+ if (newChild.previousSibling) {
666
+ newChild.previousSibling.nextSibling = newChild;
667
+ } else {
668
+ parentNode.firstChild = newChild;
669
+ }
670
+ parentNode.lastChild = newChild;
671
+ _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
672
+ var targetDoc = parentNode.ownerDocument || parentNode;
673
+ _updateOwnerDocument(newChild, targetDoc);
674
+ return newChild;
675
+ }
1351
676
  Document.prototype = {
1352
- implementation: null,
1353
677
  nodeName: "#document",
1354
678
  nodeType: DOCUMENT_NODE,
1355
679
  doctype: null,
1356
680
  documentElement: null,
1357
681
  _inc: 1,
1358
682
  insertBefore: function(newChild, refChild) {
1359
- if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
683
+ if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
1360
684
  var child = newChild.firstChild;
1361
685
  while (child) {
1362
686
  var next = child.nextSibling;
@@ -1366,22 +690,21 @@ var require_dom = __commonJS((exports) => {
1366
690
  return newChild;
1367
691
  }
1368
692
  _insertBefore(this, newChild, refChild);
1369
- newChild.ownerDocument = this;
693
+ _updateOwnerDocument(newChild, this);
1370
694
  if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
1371
695
  this.documentElement = newChild;
1372
696
  }
1373
697
  return newChild;
1374
698
  },
1375
699
  removeChild: function(oldChild) {
1376
- var removed = _removeChild(this, oldChild);
1377
- if (removed === this.documentElement) {
700
+ if (this.documentElement == oldChild) {
1378
701
  this.documentElement = null;
1379
702
  }
1380
- return removed;
703
+ return _removeChild(this, oldChild);
1381
704
  },
1382
705
  replaceChild: function(newChild, oldChild) {
1383
706
  _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
1384
- newChild.ownerDocument = this;
707
+ _updateOwnerDocument(newChild, this);
1385
708
  if (oldChild) {
1386
709
  this.removeChild(oldChild);
1387
710
  }
@@ -1404,15 +727,33 @@ var require_dom = __commonJS((exports) => {
1404
727
  });
1405
728
  return rtv;
1406
729
  },
730
+ getElementsByClassName: function(classNames) {
731
+ var classNamesSet = toOrderedSet(classNames);
732
+ return new LiveNodeList(this, function(base) {
733
+ var ls = [];
734
+ if (classNamesSet.length > 0) {
735
+ _visitNode(base.documentElement, function(node) {
736
+ if (node !== base && node.nodeType === ELEMENT_NODE) {
737
+ var nodeClassNames = node.getAttribute("class");
738
+ if (nodeClassNames) {
739
+ var matches = classNames === nodeClassNames;
740
+ if (!matches) {
741
+ var nodeClassNamesSet = toOrderedSet(nodeClassNames);
742
+ matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));
743
+ }
744
+ if (matches) {
745
+ ls.push(node);
746
+ }
747
+ }
748
+ }
749
+ });
750
+ }
751
+ return ls;
752
+ });
753
+ },
1407
754
  createElement: function(tagName) {
1408
- var node = new Element(PDC);
755
+ var node = new Element;
1409
756
  node.ownerDocument = this;
1410
- if (this.type === "html") {
1411
- tagName = tagName.toLowerCase();
1412
- }
1413
- if (hasDefaultHTMLNamespace(this.contentType)) {
1414
- node.namespaceURI = NAMESPACE.HTML;
1415
- }
1416
757
  node.nodeName = tagName;
1417
758
  node.tagName = tagName;
1418
759
  node.localName = tagName;
@@ -1422,56 +763,42 @@ var require_dom = __commonJS((exports) => {
1422
763
  return node;
1423
764
  },
1424
765
  createDocumentFragment: function() {
1425
- var node = new DocumentFragment(PDC);
766
+ var node = new DocumentFragment;
1426
767
  node.ownerDocument = this;
1427
768
  node.childNodes = new NodeList;
1428
769
  return node;
1429
770
  },
1430
771
  createTextNode: function(data) {
1431
- var node = new Text(PDC);
772
+ var node = new Text;
1432
773
  node.ownerDocument = this;
1433
- node.childNodes = new NodeList;
1434
774
  node.appendData(data);
1435
775
  return node;
1436
776
  },
1437
777
  createComment: function(data) {
1438
- var node = new Comment(PDC);
778
+ var node = new Comment;
1439
779
  node.ownerDocument = this;
1440
- node.childNodes = new NodeList;
1441
780
  node.appendData(data);
1442
781
  return node;
1443
782
  },
1444
783
  createCDATASection: function(data) {
1445
784
  if (data.indexOf("]]>") !== -1) {
1446
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 'data contains "]]>"');
785
+ throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
1447
786
  }
1448
- var node = new CDATASection(PDC);
787
+ var node = new CDATASection;
1449
788
  node.ownerDocument = this;
1450
- node.childNodes = new NodeList;
1451
789
  node.appendData(data);
1452
790
  return node;
1453
791
  },
1454
792
  createProcessingInstruction: function(target, data) {
1455
- var node = new ProcessingInstruction(PDC);
793
+ var node = new ProcessingInstruction;
1456
794
  node.ownerDocument = this;
1457
- node.childNodes = new NodeList;
1458
- node.nodeName = node.target = target;
795
+ node.tagName = node.nodeName = node.target = target;
1459
796
  node.nodeValue = node.data = data;
1460
797
  return node;
1461
798
  },
1462
799
  createAttribute: function(name) {
1463
- if (!g.QName_exact.test(name)) {
1464
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 'invalid character in name "' + name + '"');
1465
- }
1466
- if (this.type === "html") {
1467
- name = name.toLowerCase();
1468
- }
1469
- return this._createAttribute(name);
1470
- },
1471
- _createAttribute: function(name) {
1472
- var node = new Attr(PDC);
800
+ var node = new Attr;
1473
801
  node.ownerDocument = this;
1474
- node.childNodes = new NodeList;
1475
802
  node.name = name;
1476
803
  node.nodeName = name;
1477
804
  node.localName = name;
@@ -1479,93 +806,78 @@ var require_dom = __commonJS((exports) => {
1479
806
  return node;
1480
807
  },
1481
808
  createEntityReference: function(name) {
1482
- if (!g.Name.test(name)) {
1483
- throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 'not a valid xml name "' + name + '"');
1484
- }
1485
- if (this.type === "html") {
1486
- throw new DOMException("document is an html document", DOMExceptionName.NotSupportedError);
1487
- }
1488
- var node = new EntityReference(PDC);
809
+ var node = new EntityReference;
1489
810
  node.ownerDocument = this;
1490
- node.childNodes = new NodeList;
1491
811
  node.nodeName = name;
1492
812
  return node;
1493
813
  },
1494
814
  createElementNS: function(namespaceURI, qualifiedName) {
1495
- var validated = validateAndExtract(namespaceURI, qualifiedName);
1496
- var node = new Element(PDC);
815
+ var node = new Element;
816
+ var pl = qualifiedName.split(":");
1497
817
  var attrs = node.attributes = new NamedNodeMap;
1498
818
  node.childNodes = new NodeList;
1499
819
  node.ownerDocument = this;
1500
820
  node.nodeName = qualifiedName;
1501
821
  node.tagName = qualifiedName;
1502
- node.namespaceURI = validated[0];
1503
- node.prefix = validated[1];
1504
- node.localName = validated[2];
822
+ node.namespaceURI = namespaceURI;
823
+ if (pl.length == 2) {
824
+ node.prefix = pl[0];
825
+ node.localName = pl[1];
826
+ } else {
827
+ node.localName = qualifiedName;
828
+ }
1505
829
  attrs._ownerElement = node;
1506
830
  return node;
1507
831
  },
1508
832
  createAttributeNS: function(namespaceURI, qualifiedName) {
1509
- var validated = validateAndExtract(namespaceURI, qualifiedName);
1510
- var node = new Attr(PDC);
833
+ var node = new Attr;
834
+ var pl = qualifiedName.split(":");
1511
835
  node.ownerDocument = this;
1512
- node.childNodes = new NodeList;
1513
836
  node.nodeName = qualifiedName;
1514
837
  node.name = qualifiedName;
838
+ node.namespaceURI = namespaceURI;
1515
839
  node.specified = true;
1516
- node.namespaceURI = validated[0];
1517
- node.prefix = validated[1];
1518
- node.localName = validated[2];
840
+ if (pl.length == 2) {
841
+ node.prefix = pl[0];
842
+ node.localName = pl[1];
843
+ } else {
844
+ node.localName = qualifiedName;
845
+ }
1519
846
  return node;
1520
847
  }
1521
848
  };
1522
849
  _extends(Document, Node);
1523
- function Element(symbol) {
1524
- checkSymbol(symbol);
1525
- this._nsMap = Object.create(null);
850
+ function Element() {
851
+ this._nsMap = {};
1526
852
  }
1527
853
  Element.prototype = {
1528
854
  nodeType: ELEMENT_NODE,
1529
- attributes: null,
1530
- getQualifiedName: function() {
1531
- return this.prefix ? this.prefix + ":" + this.localName : this.localName;
1532
- },
1533
- _isInHTMLDocumentAndNamespace: function() {
1534
- return this.ownerDocument.type === "html" && this.namespaceURI === NAMESPACE.HTML;
1535
- },
1536
- hasAttributes: function() {
1537
- return !!(this.attributes && this.attributes.length);
1538
- },
1539
855
  hasAttribute: function(name) {
1540
- return !!this.getAttributeNode(name);
856
+ return this.getAttributeNode(name) != null;
1541
857
  },
1542
858
  getAttribute: function(name) {
1543
859
  var attr = this.getAttributeNode(name);
1544
- return attr ? attr.value : null;
860
+ return attr && attr.value || "";
1545
861
  },
1546
862
  getAttributeNode: function(name) {
1547
- if (this._isInHTMLDocumentAndNamespace()) {
1548
- name = name.toLowerCase();
1549
- }
1550
863
  return this.attributes.getNamedItem(name);
1551
864
  },
1552
865
  setAttribute: function(name, value) {
1553
- if (this._isInHTMLDocumentAndNamespace()) {
1554
- name = name.toLowerCase();
1555
- }
1556
- var attr = this.getAttributeNode(name);
1557
- if (attr) {
1558
- attr.value = attr.nodeValue = "" + value;
1559
- } else {
1560
- attr = this.ownerDocument._createAttribute(name);
1561
- attr.value = attr.nodeValue = "" + value;
1562
- this.setAttributeNode(attr);
1563
- }
866
+ var attr = this.ownerDocument.createAttribute(name);
867
+ attr.value = attr.nodeValue = "" + value;
868
+ this.setAttributeNode(attr);
1564
869
  },
1565
870
  removeAttribute: function(name) {
1566
871
  var attr = this.getAttributeNode(name);
1567
872
  attr && this.removeAttributeNode(attr);
1568
873
  },
874
+ appendChild: function(newChild) {
875
+ if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
876
+ return this.insertBefore(newChild, null);
877
+ } else {
878
+ return _appendSingleChild(this, newChild);
879
+ }
880
+ },
1569
881
  setAttributeNode: function(newAttr) {
1570
882
  return this.attributes.setNamedItem(newAttr);
1571
883
  },
@@ -1584,64 +896,22 @@ var require_dom = __commonJS((exports) => {
1584
896
  },
1585
897
  getAttributeNS: function(namespaceURI, localName) {
1586
898
  var attr = this.getAttributeNodeNS(namespaceURI, localName);
1587
- return attr ? attr.value : null;
899
+ return attr && attr.value || "";
1588
900
  },
1589
901
  setAttributeNS: function(namespaceURI, qualifiedName, value) {
1590
- var validated = validateAndExtract(namespaceURI, qualifiedName);
1591
- var localName = validated[2];
1592
- var attr = this.getAttributeNodeNS(namespaceURI, localName);
1593
- if (attr) {
1594
- attr.value = attr.nodeValue = "" + value;
1595
- } else {
1596
- attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
1597
- attr.value = attr.nodeValue = "" + value;
1598
- this.setAttributeNode(attr);
1599
- }
902
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
903
+ attr.value = attr.nodeValue = "" + value;
904
+ this.setAttributeNode(attr);
1600
905
  },
1601
906
  getAttributeNodeNS: function(namespaceURI, localName) {
1602
907
  return this.attributes.getNamedItemNS(namespaceURI, localName);
1603
908
  },
1604
- getElementsByClassName: function(classNames) {
1605
- var classNamesSet = toOrderedSet(classNames);
1606
- return new LiveNodeList(this, function(base) {
1607
- var ls = [];
1608
- if (classNamesSet.length > 0) {
1609
- _visitNode(base, function(node) {
1610
- if (node !== base && node.nodeType === ELEMENT_NODE) {
1611
- var nodeClassNames = node.getAttribute("class");
1612
- if (nodeClassNames) {
1613
- var matches = classNames === nodeClassNames;
1614
- if (!matches) {
1615
- var nodeClassNamesSet = toOrderedSet(nodeClassNames);
1616
- matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));
1617
- }
1618
- if (matches) {
1619
- ls.push(node);
1620
- }
1621
- }
1622
- }
1623
- });
1624
- }
1625
- return ls;
1626
- });
1627
- },
1628
- getElementsByTagName: function(qualifiedName) {
1629
- var isHTMLDocument = (this.nodeType === DOCUMENT_NODE ? this : this.ownerDocument).type === "html";
1630
- var lowerQualifiedName = qualifiedName.toLowerCase();
909
+ getElementsByTagName: function(tagName) {
1631
910
  return new LiveNodeList(this, function(base) {
1632
911
  var ls = [];
1633
912
  _visitNode(base, function(node) {
1634
- if (node === base || node.nodeType !== ELEMENT_NODE) {
1635
- return;
1636
- }
1637
- if (qualifiedName === "*") {
913
+ if (node !== base && node.nodeType == ELEMENT_NODE && (tagName === "*" || node.tagName == tagName)) {
1638
914
  ls.push(node);
1639
- } else {
1640
- var nodeQualifiedName = node.getQualifiedName();
1641
- var matchingQName = isHTMLDocument && node.namespaceURI === NAMESPACE.HTML ? lowerQualifiedName : qualifiedName;
1642
- if (nodeQualifiedName === matchingQName) {
1643
- ls.push(node);
1644
- }
1645
915
  }
1646
916
  });
1647
917
  return ls;
@@ -1659,21 +929,13 @@ var require_dom = __commonJS((exports) => {
1659
929
  });
1660
930
  }
1661
931
  };
1662
- Document.prototype.getElementsByClassName = Element.prototype.getElementsByClassName;
1663
932
  Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
1664
933
  Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
1665
934
  _extends(Element, Node);
1666
- function Attr(symbol) {
1667
- checkSymbol(symbol);
1668
- this.namespaceURI = null;
1669
- this.prefix = null;
1670
- this.ownerElement = null;
1671
- }
935
+ function Attr() {}
1672
936
  Attr.prototype.nodeType = ATTRIBUTE_NODE;
1673
937
  _extends(Attr, Node);
1674
- function CharacterData(symbol) {
1675
- checkSymbol(symbol);
1676
- }
938
+ function CharacterData() {}
1677
939
  CharacterData.prototype = {
1678
940
  data: "",
1679
941
  substringData: function(offset, count) {
@@ -1687,6 +949,9 @@ var require_dom = __commonJS((exports) => {
1687
949
  insertData: function(offset, text) {
1688
950
  this.replaceData(offset, 0, text);
1689
951
  },
952
+ appendChild: function(newChild) {
953
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);
954
+ },
1690
955
  deleteData: function(offset, count) {
1691
956
  this.replaceData(offset, count, "");
1692
957
  },
@@ -1699,9 +964,7 @@ var require_dom = __commonJS((exports) => {
1699
964
  }
1700
965
  };
1701
966
  _extends(CharacterData, Node);
1702
- function Text(symbol) {
1703
- checkSymbol(symbol);
1704
- }
967
+ function Text() {}
1705
968
  Text.prototype = {
1706
969
  nodeName: "#text",
1707
970
  nodeType: TEXT_NODE,
@@ -1719,73 +982,45 @@ var require_dom = __commonJS((exports) => {
1719
982
  }
1720
983
  };
1721
984
  _extends(Text, CharacterData);
1722
- function Comment(symbol) {
1723
- checkSymbol(symbol);
1724
- }
985
+ function Comment() {}
1725
986
  Comment.prototype = {
1726
987
  nodeName: "#comment",
1727
988
  nodeType: COMMENT_NODE
1728
989
  };
1729
990
  _extends(Comment, CharacterData);
1730
- function CDATASection(symbol) {
1731
- checkSymbol(symbol);
1732
- }
991
+ function CDATASection() {}
1733
992
  CDATASection.prototype = {
1734
993
  nodeName: "#cdata-section",
1735
994
  nodeType: CDATA_SECTION_NODE
1736
995
  };
1737
- _extends(CDATASection, Text);
1738
- function DocumentType(symbol) {
1739
- checkSymbol(symbol);
1740
- }
996
+ _extends(CDATASection, CharacterData);
997
+ function DocumentType() {}
1741
998
  DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
1742
999
  _extends(DocumentType, Node);
1743
- function Notation(symbol) {
1744
- checkSymbol(symbol);
1745
- }
1000
+ function Notation() {}
1746
1001
  Notation.prototype.nodeType = NOTATION_NODE;
1747
1002
  _extends(Notation, Node);
1748
- function Entity(symbol) {
1749
- checkSymbol(symbol);
1750
- }
1003
+ function Entity() {}
1751
1004
  Entity.prototype.nodeType = ENTITY_NODE;
1752
1005
  _extends(Entity, Node);
1753
- function EntityReference(symbol) {
1754
- checkSymbol(symbol);
1755
- }
1006
+ function EntityReference() {}
1756
1007
  EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
1757
1008
  _extends(EntityReference, Node);
1758
- function DocumentFragment(symbol) {
1759
- checkSymbol(symbol);
1760
- }
1009
+ function DocumentFragment() {}
1761
1010
  DocumentFragment.prototype.nodeName = "#document-fragment";
1762
1011
  DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
1763
1012
  _extends(DocumentFragment, Node);
1764
- function ProcessingInstruction(symbol) {
1765
- checkSymbol(symbol);
1766
- }
1013
+ function ProcessingInstruction() {}
1767
1014
  ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
1768
- _extends(ProcessingInstruction, CharacterData);
1015
+ _extends(ProcessingInstruction, Node);
1769
1016
  function XMLSerializer() {}
1770
- XMLSerializer.prototype.serializeToString = function(node, options) {
1771
- return nodeSerializeToString.call(node, options);
1017
+ XMLSerializer.prototype.serializeToString = function(node, isHtml, nodeFilter) {
1018
+ return nodeSerializeToString.call(node, isHtml, nodeFilter);
1772
1019
  };
1773
1020
  Node.prototype.toString = nodeSerializeToString;
1774
- function nodeSerializeToString(options) {
1775
- var opts;
1776
- if (typeof options === "function") {
1777
- opts = { requireWellFormed: false, splitCDATASections: true, nodeFilter: options };
1778
- } else if (options != null) {
1779
- opts = {
1780
- requireWellFormed: !!options.requireWellFormed,
1781
- splitCDATASections: options.splitCDATASections !== false,
1782
- nodeFilter: options.nodeFilter || null
1783
- };
1784
- } else {
1785
- opts = { requireWellFormed: false, splitCDATASections: true, nodeFilter: null };
1786
- }
1021
+ function nodeSerializeToString(isHtml, nodeFilter) {
1787
1022
  var buf = [];
1788
- var refNode = this.nodeType === DOCUMENT_NODE && this.documentElement || this;
1023
+ var refNode = this.nodeType == 9 && this.documentElement || this;
1789
1024
  var prefix = refNode.prefix;
1790
1025
  var uri = refNode.namespaceURI;
1791
1026
  if (uri && prefix == null) {
@@ -1796,7 +1031,7 @@ var require_dom = __commonJS((exports) => {
1796
1031
  ];
1797
1032
  }
1798
1033
  }
1799
- serializeToString(this, buf, visibleNamespaces, opts);
1034
+ serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces);
1800
1035
  return buf.join("");
1801
1036
  }
1802
1037
  function needNamespaceDefine(node, isHTML, visibleNamespaces) {
@@ -1820,293 +1055,237 @@ var require_dom = __commonJS((exports) => {
1820
1055
  function addSerializedAttribute(buf, qualifiedName, value) {
1821
1056
  buf.push(" ", qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
1822
1057
  }
1823
- function serializeToString(node, buf, visibleNamespaces, opts) {
1058
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) {
1824
1059
  if (!visibleNamespaces) {
1825
1060
  visibleNamespaces = [];
1826
1061
  }
1827
- var nodeFilter = opts.nodeFilter;
1828
- var requireWellFormed = opts.requireWellFormed;
1829
- var splitCDATASections = opts.splitCDATASections;
1830
- var doc = node.nodeType === DOCUMENT_NODE ? node : node.ownerDocument;
1831
- var isHTML = doc.type === "html";
1832
- walkDOM(node, { ns: visibleNamespaces }, {
1833
- enter: function(n, ctx) {
1834
- var namespaces = ctx.ns;
1835
- if (nodeFilter) {
1836
- n = nodeFilter(n);
1837
- if (n) {
1838
- if (typeof n == "string") {
1839
- buf.push(n);
1840
- return null;
1841
- }
1842
- } else {
1843
- return null;
1844
- }
1062
+ if (nodeFilter) {
1063
+ node = nodeFilter(node);
1064
+ if (node) {
1065
+ if (typeof node == "string") {
1066
+ buf.push(node);
1067
+ return;
1845
1068
  }
1846
- switch (n.nodeType) {
1847
- case ELEMENT_NODE:
1848
- var attrs = n.attributes;
1849
- var len = attrs.length;
1850
- var nodeName = n.tagName;
1851
- var prefixedNodeName = nodeName;
1852
- if (!isHTML && !n.prefix && n.namespaceURI) {
1853
- var defaultNS;
1854
- for (var ai = 0;ai < attrs.length; ai++) {
1855
- if (attrs.item(ai).name === "xmlns") {
1856
- defaultNS = attrs.item(ai).value;
1857
- break;
1858
- }
1859
- }
1860
- if (!defaultNS) {
1861
- for (var nsi = namespaces.length - 1;nsi >= 0; nsi--) {
1862
- var nsEntry = namespaces[nsi];
1863
- if (nsEntry.prefix === "" && nsEntry.namespace === n.namespaceURI) {
1864
- defaultNS = nsEntry.namespace;
1865
- break;
1866
- }
1867
- }
1868
- }
1869
- if (defaultNS !== n.namespaceURI) {
1870
- for (var nsi = namespaces.length - 1;nsi >= 0; nsi--) {
1871
- var nsEntry = namespaces[nsi];
1872
- if (nsEntry.namespace === n.namespaceURI) {
1873
- if (nsEntry.prefix) {
1874
- prefixedNodeName = nsEntry.prefix + ":" + nodeName;
1875
- }
1876
- break;
1877
- }
1878
- }
1879
- }
1880
- }
1881
- buf.push("<", prefixedNodeName);
1882
- var childNamespaces = namespaces.slice();
1883
- for (var i = 0;i < len; i++) {
1884
- var attr = attrs.item(i);
1885
- if (attr.prefix == "xmlns") {
1886
- childNamespaces.push({
1887
- prefix: attr.localName,
1888
- namespace: attr.value
1889
- });
1890
- } else if (attr.nodeName == "xmlns") {
1891
- childNamespaces.push({ prefix: "", namespace: attr.value });
1892
- }
1069
+ } else {
1070
+ return;
1071
+ }
1072
+ }
1073
+ switch (node.nodeType) {
1074
+ case ELEMENT_NODE:
1075
+ var attrs = node.attributes;
1076
+ var len = attrs.length;
1077
+ var child = node.firstChild;
1078
+ var nodeName = node.tagName;
1079
+ isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
1080
+ var prefixedNodeName = nodeName;
1081
+ if (!isHTML && !node.prefix && node.namespaceURI) {
1082
+ var defaultNS;
1083
+ for (var ai = 0;ai < attrs.length; ai++) {
1084
+ if (attrs.item(ai).name === "xmlns") {
1085
+ defaultNS = attrs.item(ai).value;
1086
+ break;
1893
1087
  }
1894
- for (var i = 0;i < len; i++) {
1895
- var attr = attrs.item(i);
1896
- if (needNamespaceDefine(attr, isHTML, childNamespaces)) {
1897
- var attrPrefix = attr.prefix || "";
1898
- var uri = attr.namespaceURI;
1899
- addSerializedAttribute(buf, attrPrefix ? "xmlns:" + attrPrefix : "xmlns", uri);
1900
- childNamespaces.push({ prefix: attrPrefix, namespace: uri });
1901
- }
1902
- var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
1903
- if (filteredAttr) {
1904
- if (typeof filteredAttr === "string") {
1905
- buf.push(filteredAttr);
1906
- } else {
1907
- addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
1908
- }
1088
+ }
1089
+ if (!defaultNS) {
1090
+ for (var nsi = visibleNamespaces.length - 1;nsi >= 0; nsi--) {
1091
+ var namespace = visibleNamespaces[nsi];
1092
+ if (namespace.prefix === "" && namespace.namespace === node.namespaceURI) {
1093
+ defaultNS = namespace.namespace;
1094
+ break;
1909
1095
  }
1910
1096
  }
1911
- if (nodeName === prefixedNodeName && needNamespaceDefine(n, isHTML, childNamespaces)) {
1912
- var nodePrefix = n.prefix || "";
1913
- var uri = n.namespaceURI;
1914
- addSerializedAttribute(buf, nodePrefix ? "xmlns:" + nodePrefix : "xmlns", uri);
1915
- childNamespaces.push({ prefix: nodePrefix, namespace: uri });
1916
- }
1917
- var canCloseTag = !n.firstChild;
1918
- if (canCloseTag && (isHTML || n.namespaceURI === NAMESPACE.HTML)) {
1919
- canCloseTag = isHTMLVoidElement(nodeName);
1920
- }
1921
- if (canCloseTag) {
1922
- buf.push("/>");
1923
- return null;
1924
- }
1925
- buf.push(">");
1926
- if (isHTML && isHTMLRawTextElement(nodeName)) {
1927
- var child = n.firstChild;
1928
- while (child) {
1929
- if (child.data) {
1930
- buf.push(child.data);
1931
- } else {
1932
- serializeToString(child, buf, childNamespaces.slice(), opts);
1097
+ }
1098
+ if (defaultNS !== node.namespaceURI) {
1099
+ for (var nsi = visibleNamespaces.length - 1;nsi >= 0; nsi--) {
1100
+ var namespace = visibleNamespaces[nsi];
1101
+ if (namespace.namespace === node.namespaceURI) {
1102
+ if (namespace.prefix) {
1103
+ prefixedNodeName = namespace.prefix + ":" + nodeName;
1933
1104
  }
1934
- child = child.nextSibling;
1935
- }
1936
- buf.push("</", prefixedNodeName, ">");
1937
- return null;
1938
- }
1939
- return { ns: childNamespaces, tag: prefixedNodeName };
1940
- case DOCUMENT_NODE:
1941
- case DOCUMENT_FRAGMENT_NODE:
1942
- if (requireWellFormed && n.nodeType === DOCUMENT_NODE && n.documentElement == null) {
1943
- throw new DOMException("The Document has no documentElement", DOMExceptionName.InvalidStateError);
1944
- }
1945
- return { ns: namespaces };
1946
- case ATTRIBUTE_NODE:
1947
- addSerializedAttribute(buf, n.name, n.value);
1948
- return null;
1949
- case TEXT_NODE:
1950
- if (requireWellFormed && g.InvalidChar.test(n.data)) {
1951
- throw new DOMException("The Text node data contains characters outside the XML Char production", DOMExceptionName.InvalidStateError);
1952
- }
1953
- buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
1954
- return null;
1955
- case CDATA_SECTION_NODE:
1956
- if (requireWellFormed && n.data.indexOf("]]>") !== -1) {
1957
- throw new DOMException('The CDATASection data contains "]]>"', DOMExceptionName.InvalidStateError);
1958
- }
1959
- if (splitCDATASections) {
1960
- buf.push(g.CDATA_START, n.data.replace(/]]>/g, "]]]]><![CDATA[>"), g.CDATA_END);
1961
- } else {
1962
- buf.push(g.CDATA_START, n.data, g.CDATA_END);
1963
- }
1964
- return null;
1965
- case COMMENT_NODE:
1966
- if (requireWellFormed) {
1967
- if (g.InvalidChar.test(n.data)) {
1968
- throw new DOMException("The comment node data contains characters outside the XML Char production", DOMExceptionName.InvalidStateError);
1969
- }
1970
- if (n.data.indexOf("--") !== -1 || n.data[n.data.length - 1] === "-") {
1971
- throw new DOMException('The comment node data contains "--" or ends with "-"', DOMExceptionName.InvalidStateError);
1972
- }
1973
- }
1974
- buf.push(g.COMMENT_START, n.data, g.COMMENT_END);
1975
- return null;
1976
- case DOCUMENT_TYPE_NODE:
1977
- var pubid = n.publicId;
1978
- var sysid = n.systemId;
1979
- if (requireWellFormed) {
1980
- if (pubid && !g.PubidLiteral_match.test(pubid)) {
1981
- throw new DOMException("DocumentType publicId is not a valid PubidLiteral", DOMExceptionName.InvalidStateError);
1982
- }
1983
- if (sysid && sysid !== "." && !g.SystemLiteral_match.test(sysid)) {
1984
- throw new DOMException("DocumentType systemId is not a valid SystemLiteral", DOMExceptionName.InvalidStateError);
1985
- }
1986
- if (n.internalSubset && n.internalSubset.indexOf("]>") !== -1) {
1987
- throw new DOMException('DocumentType internalSubset contains "]>"', DOMExceptionName.InvalidStateError);
1105
+ break;
1988
1106
  }
1989
1107
  }
1990
- buf.push(g.DOCTYPE_DECL_START, " ", n.name);
1991
- if (pubid) {
1992
- buf.push(" ", g.PUBLIC, " ", pubid);
1993
- if (sysid && sysid !== ".") {
1994
- buf.push(" ", sysid);
1108
+ }
1109
+ }
1110
+ buf.push("<", prefixedNodeName);
1111
+ for (var i = 0;i < len; i++) {
1112
+ var attr = attrs.item(i);
1113
+ if (attr.prefix == "xmlns") {
1114
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
1115
+ } else if (attr.nodeName == "xmlns") {
1116
+ visibleNamespaces.push({ prefix: "", namespace: attr.value });
1117
+ }
1118
+ }
1119
+ for (var i = 0;i < len; i++) {
1120
+ var attr = attrs.item(i);
1121
+ if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) {
1122
+ var prefix = attr.prefix || "";
1123
+ var uri = attr.namespaceURI;
1124
+ addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
1125
+ visibleNamespaces.push({ prefix, namespace: uri });
1126
+ }
1127
+ serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces);
1128
+ }
1129
+ if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
1130
+ var prefix = node.prefix || "";
1131
+ var uri = node.namespaceURI;
1132
+ addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
1133
+ visibleNamespaces.push({ prefix, namespace: uri });
1134
+ }
1135
+ if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
1136
+ buf.push(">");
1137
+ if (isHTML && /^script$/i.test(nodeName)) {
1138
+ while (child) {
1139
+ if (child.data) {
1140
+ buf.push(child.data);
1141
+ } else {
1142
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1995
1143
  }
1996
- } else if (sysid && sysid !== ".") {
1997
- buf.push(" ", g.SYSTEM, " ", sysid);
1144
+ child = child.nextSibling;
1998
1145
  }
1999
- if (n.internalSubset) {
2000
- buf.push(" [", n.internalSubset, "]");
2001
- }
2002
- buf.push(">");
2003
- return null;
2004
- case PROCESSING_INSTRUCTION_NODE:
2005
- if (requireWellFormed) {
2006
- if (n.target.indexOf(":") !== -1 || n.target.toLowerCase() === "xml") {
2007
- throw new DOMException("The ProcessingInstruction target is not well-formed", DOMExceptionName.InvalidStateError);
2008
- }
2009
- if (g.InvalidChar.test(n.data)) {
2010
- throw new DOMException("The ProcessingInstruction data contains characters outside the XML Char production", DOMExceptionName.InvalidStateError);
2011
- }
2012
- if (n.data.indexOf("?>") !== -1) {
2013
- throw new DOMException('The ProcessingInstruction data contains "?>"', DOMExceptionName.InvalidStateError);
2014
- }
1146
+ } else {
1147
+ while (child) {
1148
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1149
+ child = child.nextSibling;
2015
1150
  }
2016
- buf.push("<?", n.target, " ", n.data, "?>");
2017
- return null;
2018
- case ENTITY_REFERENCE_NODE:
2019
- buf.push("&", n.nodeName, ";");
2020
- return null;
2021
- default:
2022
- buf.push("??", n.nodeName);
2023
- return null;
1151
+ }
1152
+ buf.push("</", prefixedNodeName, ">");
1153
+ } else {
1154
+ buf.push("/>");
2024
1155
  }
2025
- },
2026
- exit: function(n, childCtx) {
2027
- if (childCtx && childCtx.tag) {
2028
- buf.push("</", childCtx.tag, ">");
1156
+ return;
1157
+ case DOCUMENT_NODE:
1158
+ case DOCUMENT_FRAGMENT_NODE:
1159
+ var child = node.firstChild;
1160
+ while (child) {
1161
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1162
+ child = child.nextSibling;
2029
1163
  }
2030
- }
2031
- });
2032
- }
2033
- function importNode(doc, node, deep) {
2034
- var destRoot;
2035
- walkDOM(node, null, {
2036
- enter: function(srcNode, destParent) {
2037
- var destNode = srcNode.cloneNode(false);
2038
- destNode.ownerDocument = doc;
2039
- destNode.parentNode = null;
2040
- if (destParent === null) {
2041
- destRoot = destNode;
1164
+ return;
1165
+ case ATTRIBUTE_NODE:
1166
+ return addSerializedAttribute(buf, node.name, node.value);
1167
+ case TEXT_NODE:
1168
+ return buf.push(node.data.replace(/[<&>]/g, _xmlEncoder));
1169
+ case CDATA_SECTION_NODE:
1170
+ return buf.push("<![CDATA[", node.data.replace(/]]>/g, "]]]]><![CDATA[>"), "]]>");
1171
+ case COMMENT_NODE:
1172
+ return buf.push("<!--", node.data, "-->");
1173
+ case DOCUMENT_TYPE_NODE:
1174
+ var pubid = node.publicId;
1175
+ var sysid = node.systemId;
1176
+ buf.push("<!DOCTYPE ", node.name);
1177
+ if (pubid) {
1178
+ buf.push(" PUBLIC ", pubid);
1179
+ if (sysid && sysid != ".") {
1180
+ buf.push(" ", sysid);
1181
+ }
1182
+ buf.push(">");
1183
+ } else if (sysid && sysid != ".") {
1184
+ buf.push(" SYSTEM ", sysid, ">");
2042
1185
  } else {
2043
- destParent.appendChild(destNode);
1186
+ var sub = node.internalSubset;
1187
+ if (sub) {
1188
+ buf.push(" [", sub, "]");
1189
+ }
1190
+ buf.push(">");
2044
1191
  }
2045
- var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
2046
- return shouldDeep ? destNode : null;
1192
+ return;
1193
+ case PROCESSING_INSTRUCTION_NODE:
1194
+ return buf.push("<?", node.target, " ", node.data, "?>");
1195
+ case ENTITY_REFERENCE_NODE:
1196
+ return buf.push("&", node.nodeName, ";");
1197
+ default:
1198
+ buf.push("??", node.nodeName);
1199
+ }
1200
+ }
1201
+ function importNode(doc, node, deep) {
1202
+ var node2;
1203
+ switch (node.nodeType) {
1204
+ case ELEMENT_NODE:
1205
+ node2 = node.cloneNode(false);
1206
+ node2.ownerDocument = doc;
1207
+ case DOCUMENT_FRAGMENT_NODE:
1208
+ break;
1209
+ case ATTRIBUTE_NODE:
1210
+ deep = true;
1211
+ break;
1212
+ }
1213
+ if (!node2) {
1214
+ node2 = node.cloneNode(false);
1215
+ }
1216
+ node2.ownerDocument = doc;
1217
+ node2.parentNode = null;
1218
+ if (deep) {
1219
+ var child = node.firstChild;
1220
+ while (child) {
1221
+ node2.appendChild(importNode(doc, child, deep));
1222
+ child = child.nextSibling;
2047
1223
  }
2048
- });
2049
- return destRoot;
1224
+ }
1225
+ return node2;
2050
1226
  }
2051
1227
  function cloneNode(doc, node, deep) {
2052
- var destRoot;
2053
- walkDOM(node, null, {
2054
- enter: function(srcNode, destParent) {
2055
- var destNode = new srcNode.constructor(PDC);
2056
- for (var n in srcNode) {
2057
- if (hasOwn(srcNode, n)) {
2058
- var v = srcNode[n];
2059
- if (typeof v != "object") {
2060
- if (v != destNode[n]) {
2061
- destNode[n] = v;
2062
- }
2063
- }
1228
+ var node2 = new node.constructor;
1229
+ for (var n in node) {
1230
+ if (Object.prototype.hasOwnProperty.call(node, n)) {
1231
+ var v = node[n];
1232
+ if (typeof v != "object") {
1233
+ if (v != node2[n]) {
1234
+ node2[n] = v;
2064
1235
  }
2065
1236
  }
2066
- if (srcNode.childNodes) {
2067
- destNode.childNodes = new NodeList;
2068
- }
2069
- destNode.ownerDocument = doc;
2070
- var shouldDeep = deep;
2071
- switch (destNode.nodeType) {
2072
- case ELEMENT_NODE:
2073
- var attrs = srcNode.attributes;
2074
- var attrs2 = destNode.attributes = new NamedNodeMap;
2075
- var len = attrs.length;
2076
- attrs2._ownerElement = destNode;
2077
- for (var i = 0;i < len; i++) {
2078
- destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
2079
- }
2080
- break;
2081
- case ATTRIBUTE_NODE:
2082
- shouldDeep = true;
2083
- }
2084
- if (destParent !== null) {
2085
- destParent.appendChild(destNode);
2086
- } else {
2087
- destRoot = destNode;
2088
- }
2089
- return shouldDeep ? destNode : null;
2090
1237
  }
2091
- });
2092
- return destRoot;
1238
+ }
1239
+ if (node.childNodes) {
1240
+ node2.childNodes = new NodeList;
1241
+ }
1242
+ node2.ownerDocument = doc;
1243
+ switch (node2.nodeType) {
1244
+ case ELEMENT_NODE:
1245
+ var attrs = node.attributes;
1246
+ var attrs2 = node2.attributes = new NamedNodeMap;
1247
+ var len = attrs.length;
1248
+ attrs2._ownerElement = node2;
1249
+ for (var i = 0;i < len; i++) {
1250
+ node2.setAttributeNode(cloneNode(doc, attrs.item(i), true));
1251
+ }
1252
+ break;
1253
+ ;
1254
+ case ATTRIBUTE_NODE:
1255
+ deep = true;
1256
+ }
1257
+ if (deep) {
1258
+ var child = node.firstChild;
1259
+ while (child) {
1260
+ node2.appendChild(cloneNode(doc, child, deep));
1261
+ child = child.nextSibling;
1262
+ }
1263
+ }
1264
+ return node2;
2093
1265
  }
2094
1266
  function __set__(object, key, value) {
2095
1267
  object[key] = value;
2096
1268
  }
2097
- function childrenRefresh(node) {
2098
- var ls = [];
2099
- var child = node.firstChild;
2100
- while (child) {
2101
- if (child.nodeType === ELEMENT_NODE) {
2102
- ls.push(child);
2103
- }
2104
- child = child.nextSibling;
2105
- }
2106
- return ls;
2107
- }
2108
1269
  try {
2109
1270
  if (Object.defineProperty) {
1271
+ let getTextContent2 = function(node) {
1272
+ switch (node.nodeType) {
1273
+ case ELEMENT_NODE:
1274
+ case DOCUMENT_FRAGMENT_NODE:
1275
+ var buf = [];
1276
+ node = node.firstChild;
1277
+ while (node) {
1278
+ if (node.nodeType !== 7 && node.nodeType !== 8) {
1279
+ buf.push(getTextContent2(node));
1280
+ }
1281
+ node = node.nextSibling;
1282
+ }
1283
+ return buf.join("");
1284
+ default:
1285
+ return node.nodeValue;
1286
+ }
1287
+ };
1288
+ getTextContent = getTextContent2;
2110
1289
  Object.defineProperty(LiveNodeList.prototype, "length", {
2111
1290
  get: function() {
2112
1291
  _updateLiveList(this);
@@ -2115,22 +1294,7 @@ var require_dom = __commonJS((exports) => {
2115
1294
  });
2116
1295
  Object.defineProperty(Node.prototype, "textContent", {
2117
1296
  get: function() {
2118
- if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
2119
- var buf = [];
2120
- walkDOM(this, null, {
2121
- enter: function(n) {
2122
- if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
2123
- return true;
2124
- }
2125
- if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
2126
- return null;
2127
- }
2128
- buf.push(n.nodeValue);
2129
- }
2130
- });
2131
- return buf.join("");
2132
- }
2133
- return this.nodeValue;
1297
+ return getTextContent2(this);
2134
1298
  },
2135
1299
  set: function(data) {
2136
1300
  switch (this.nodeType) {
@@ -2150,50 +1314,22 @@ var require_dom = __commonJS((exports) => {
2150
1314
  }
2151
1315
  }
2152
1316
  });
2153
- Object.defineProperty(Element.prototype, "children", {
2154
- get: function() {
2155
- return new LiveNodeList(this, childrenRefresh);
2156
- }
2157
- });
2158
- Object.defineProperty(Document.prototype, "children", {
2159
- get: function() {
2160
- return new LiveNodeList(this, childrenRefresh);
2161
- }
2162
- });
2163
- Object.defineProperty(DocumentFragment.prototype, "children", {
2164
- get: function() {
2165
- return new LiveNodeList(this, childrenRefresh);
2166
- }
2167
- });
2168
1317
  __set__ = function(object, key, value) {
2169
1318
  object["$$" + key] = value;
2170
1319
  };
2171
1320
  }
2172
1321
  } catch (e) {}
2173
- exports._updateLiveList = _updateLiveList;
2174
- exports.Attr = Attr;
2175
- exports.CDATASection = CDATASection;
2176
- exports.CharacterData = CharacterData;
2177
- exports.Comment = Comment;
2178
- exports.Document = Document;
2179
- exports.DocumentFragment = DocumentFragment;
1322
+ var getTextContent;
2180
1323
  exports.DocumentType = DocumentType;
1324
+ exports.DOMException = DOMException;
2181
1325
  exports.DOMImplementation = DOMImplementation;
2182
1326
  exports.Element = Element;
2183
- exports.Entity = Entity;
2184
- exports.EntityReference = EntityReference;
2185
- exports.LiveNodeList = LiveNodeList;
2186
- exports.NamedNodeMap = NamedNodeMap;
2187
1327
  exports.Node = Node;
2188
1328
  exports.NodeList = NodeList;
2189
- exports.Notation = Notation;
2190
- exports.Text = Text;
2191
- exports.ProcessingInstruction = ProcessingInstruction;
2192
- exports.walkDOM = walkDOM;
2193
1329
  exports.XMLSerializer = XMLSerializer;
2194
1330
  });
2195
1331
 
2196
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/entities.js
1332
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/entities.js
2197
1333
  var require_entities = __commonJS((exports) => {
2198
1334
  var freeze = require_conventions().freeze;
2199
1335
  exports.XML_ENTITIES = freeze({
@@ -4334,18 +3470,12 @@ var require_entities = __commonJS((exports) => {
4334
3470
  exports.entityMap = exports.HTML_ENTITIES;
4335
3471
  });
4336
3472
 
4337
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/sax.js
3473
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/sax.js
4338
3474
  var require_sax = __commonJS((exports) => {
4339
- var conventions = require_conventions();
4340
- var g = require_grammar();
4341
- var errors = require_errors();
4342
- var isHTMLEscapableRawTextElement = conventions.isHTMLEscapableRawTextElement;
4343
- var isHTMLMimeType = conventions.isHTMLMimeType;
4344
- var isHTMLRawTextElement = conventions.isHTMLRawTextElement;
4345
- var hasOwn = conventions.hasOwn;
4346
- var NAMESPACE = conventions.NAMESPACE;
4347
- var ParseError = errors.ParseError;
4348
- var DOMException = errors.DOMException;
3475
+ var NAMESPACE = require_conventions().NAMESPACE;
3476
+ var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
3477
+ var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
3478
+ var tagNamePattern = new RegExp("^" + nameStartChar.source + nameChar.source + "*(?::" + nameStartChar.source + nameChar.source + "*)?$");
4349
3479
  var S_TAG = 0;
4350
3480
  var S_ATTR = 1;
4351
3481
  var S_ATTR_SPACE = 2;
@@ -4354,22 +3484,25 @@ var require_sax = __commonJS((exports) => {
4354
3484
  var S_ATTR_END = 5;
4355
3485
  var S_TAG_SPACE = 6;
4356
3486
  var S_TAG_CLOSE = 7;
3487
+ function ParseError(message, locator) {
3488
+ this.message = message;
3489
+ this.locator = locator;
3490
+ if (Error.captureStackTrace)
3491
+ Error.captureStackTrace(this, ParseError);
3492
+ }
3493
+ ParseError.prototype = new Error;
3494
+ ParseError.prototype.name = ParseError.name;
4357
3495
  function XMLReader() {}
4358
3496
  XMLReader.prototype = {
4359
3497
  parse: function(source, defaultNSMap, entityMap) {
4360
3498
  var domBuilder = this.domBuilder;
4361
3499
  domBuilder.startDocument();
4362
- _copy(defaultNSMap, defaultNSMap = Object.create(null));
3500
+ _copy(defaultNSMap, defaultNSMap = {});
4363
3501
  parse(source, defaultNSMap, entityMap, domBuilder, this.errorHandler);
4364
3502
  domBuilder.endDocument();
4365
3503
  }
4366
3504
  };
4367
- var ENTITY_REG = /&#?\w+;?/g;
4368
3505
  function parse(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
4369
- var isHTML = isHTMLMimeType(domBuilder.mimeType);
4370
- if (source.indexOf(g.UNICODE_REPLACEMENT_CHARACTER) >= 0) {
4371
- errorHandler.warning("Unicode replacement character detected, source encoding issues?");
4372
- }
4373
3506
  function fixedFromCharCode(code) {
4374
3507
  if (code > 65535) {
4375
3508
  code -= 65536;
@@ -4380,21 +3513,11 @@ var require_sax = __commonJS((exports) => {
4380
3513
  }
4381
3514
  }
4382
3515
  function entityReplacer(a2) {
4383
- var complete = a2[a2.length - 1] === ";" ? a2 : a2 + ";";
4384
- if (!isHTML && complete !== a2) {
4385
- errorHandler.error("EntityRef: expecting ;");
4386
- return a2;
4387
- }
4388
- var match = g.Reference.exec(complete);
4389
- if (!match || match[0].length !== complete.length) {
4390
- errorHandler.error("entity not matching Reference production: " + a2);
4391
- return a2;
4392
- }
4393
- var k = complete.slice(1, -1);
4394
- if (hasOwn(entityMap, k)) {
3516
+ var k = a2.slice(1, -1);
3517
+ if (Object.hasOwnProperty.call(entityMap, k)) {
4395
3518
  return entityMap[k];
4396
3519
  } else if (k.charAt(0) === "#") {
4397
- return fixedFromCharCode(parseInt(k.substring(1).replace("x", "0x")));
3520
+ return fixedFromCharCode(parseInt(k.substr(1).replace("x", "0x")));
4398
3521
  } else {
4399
3522
  errorHandler.error("entity not found:" + a2);
4400
3523
  return a2;
@@ -4402,106 +3525,94 @@ var require_sax = __commonJS((exports) => {
4402
3525
  }
4403
3526
  function appendText(end2) {
4404
3527
  if (end2 > start) {
4405
- var xt = source.substring(start, end2).replace(ENTITY_REG, entityReplacer);
3528
+ var xt = source.substring(start, end2).replace(/&#?\w+;/g, entityReplacer);
4406
3529
  locator && position(start);
4407
3530
  domBuilder.characters(xt, 0, end2 - start);
4408
3531
  start = end2;
4409
3532
  }
4410
3533
  }
4411
- var lineStart = 0;
4412
- var lineEnd = 0;
4413
- var linePattern = /\r\n?|\n|$/g;
4414
- var locator = domBuilder.locator;
4415
3534
  function position(p, m) {
4416
3535
  while (p >= lineEnd && (m = linePattern.exec(source))) {
4417
- lineStart = lineEnd;
4418
- lineEnd = m.index + m[0].length;
3536
+ lineStart = m.index;
3537
+ lineEnd = lineStart + m[0].length;
4419
3538
  locator.lineNumber++;
4420
3539
  }
4421
3540
  locator.columnNumber = p - lineStart + 1;
4422
3541
  }
3542
+ var lineStart = 0;
3543
+ var lineEnd = 0;
3544
+ var linePattern = /.*(?:\r\n?|\n)|.*$/g;
3545
+ var locator = domBuilder.locator;
4423
3546
  var parseStack = [{ currentNSMap: defaultNSMapCopy }];
4424
- var unclosedTags = [];
3547
+ var closeMap = {};
4425
3548
  var start = 0;
4426
3549
  while (true) {
4427
3550
  try {
4428
3551
  var tagStart = source.indexOf("<", start);
4429
3552
  if (tagStart < 0) {
4430
- if (!isHTML && unclosedTags.length > 0) {
4431
- return errorHandler.fatalError("unclosed xml tag(s): " + unclosedTags.join(", "));
4432
- }
4433
- if (!source.substring(start).match(/^\s*$/)) {
3553
+ if (!source.substr(start).match(/^\s*$/)) {
4434
3554
  var doc = domBuilder.doc;
4435
- var text = doc.createTextNode(source.substring(start));
4436
- if (doc.documentElement) {
4437
- return errorHandler.error("Extra content at the end of the document");
4438
- }
3555
+ var text = doc.createTextNode(source.substr(start));
4439
3556
  doc.appendChild(text);
4440
3557
  domBuilder.currentElement = text;
4441
3558
  }
4442
3559
  return;
4443
3560
  }
4444
3561
  if (tagStart > start) {
4445
- var fromSource = source.substring(start, tagStart);
4446
- if (!isHTML && unclosedTags.length === 0) {
4447
- fromSource = fromSource.replace(new RegExp(g.S_OPT.source, "g"), "");
4448
- fromSource && errorHandler.error("Unexpected content outside root element: '" + fromSource + "'");
4449
- }
4450
3562
  appendText(tagStart);
4451
3563
  }
4452
3564
  switch (source.charAt(tagStart + 1)) {
4453
3565
  case "/":
4454
- var end = source.indexOf(">", tagStart + 2);
4455
- var tagNameRaw = source.substring(tagStart + 2, end > 0 ? end : undefined);
4456
- if (!tagNameRaw) {
4457
- return errorHandler.fatalError("end tag name missing");
4458
- }
4459
- var tagNameMatch = end > 0 && g.reg("^", g.QName_group, g.S_OPT, "$").exec(tagNameRaw);
4460
- if (!tagNameMatch) {
4461
- return errorHandler.fatalError('end tag name contains invalid characters: "' + tagNameRaw + '"');
4462
- }
4463
- if (!domBuilder.currentElement && !domBuilder.doc.documentElement) {
4464
- return;
4465
- }
4466
- var currentTagName = unclosedTags[unclosedTags.length - 1] || domBuilder.currentElement.tagName || domBuilder.doc.documentElement.tagName || "";
4467
- if (currentTagName !== tagNameMatch[1]) {
4468
- var tagNameLower = tagNameMatch[1].toLowerCase();
4469
- if (!isHTML || currentTagName.toLowerCase() !== tagNameLower) {
4470
- return errorHandler.fatalError('Opening and ending tag mismatch: "' + currentTagName + '" != "' + tagNameRaw + '"');
4471
- }
4472
- }
3566
+ var end = source.indexOf(">", tagStart + 3);
3567
+ var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, "");
4473
3568
  var config = parseStack.pop();
4474
- unclosedTags.pop();
3569
+ if (end < 0) {
3570
+ tagName = source.substring(tagStart + 2).replace(/[\s<].*/, "");
3571
+ errorHandler.error("end tag name: " + tagName + " is not complete:" + config.tagName);
3572
+ end = tagStart + 1 + tagName.length;
3573
+ } else if (tagName.match(/\s</)) {
3574
+ tagName = tagName.replace(/[\s<].*/, "");
3575
+ errorHandler.error("end tag name: " + tagName + " maybe not complete");
3576
+ end = tagStart + 1 + tagName.length;
3577
+ }
4475
3578
  var localNSMap = config.localNSMap;
4476
- domBuilder.endElement(config.uri, config.localName, currentTagName);
4477
- if (localNSMap) {
4478
- for (var prefix in localNSMap) {
4479
- if (hasOwn(localNSMap, prefix)) {
4480
- domBuilder.endPrefixMapping(prefix);
3579
+ var endMatch = config.tagName == tagName;
3580
+ var endIgnoreCaseMach = endMatch || config.tagName && config.tagName.toLowerCase() == tagName.toLowerCase();
3581
+ if (endIgnoreCaseMach) {
3582
+ domBuilder.endElement(config.uri, config.localName, tagName);
3583
+ if (localNSMap) {
3584
+ for (var prefix in localNSMap) {
3585
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
3586
+ domBuilder.endPrefixMapping(prefix);
3587
+ }
4481
3588
  }
4482
3589
  }
3590
+ if (!endMatch) {
3591
+ errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config.tagName);
3592
+ }
3593
+ } else {
3594
+ parseStack.push(config);
4483
3595
  }
4484
3596
  end++;
4485
3597
  break;
4486
3598
  case "?":
4487
3599
  locator && position(tagStart);
4488
- end = parseProcessingInstruction(source, tagStart, domBuilder, errorHandler);
3600
+ end = parseInstruction(source, tagStart, domBuilder);
4489
3601
  break;
4490
3602
  case "!":
4491
3603
  locator && position(tagStart);
4492
- end = parseDoctypeCommentOrCData(source, tagStart, domBuilder, errorHandler, isHTML);
3604
+ end = parseDCC(source, tagStart, domBuilder, errorHandler);
4493
3605
  break;
4494
3606
  default:
4495
3607
  locator && position(tagStart);
4496
3608
  var el = new ElementAttributes;
4497
3609
  var currentNSMap = parseStack[parseStack.length - 1].currentNSMap;
4498
- var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler, isHTML);
3610
+ var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler);
4499
3611
  var len = el.length;
4500
- if (!el.closed) {
4501
- if (isHTML && conventions.isHTMLVoidElement(el.tagName)) {
4502
- el.closed = true;
4503
- } else {
4504
- unclosedTags.push(el.tagName);
3612
+ if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) {
3613
+ el.closed = true;
3614
+ if (!entityMap.nbsp) {
3615
+ errorHandler.warning("unclosed xml attribute");
4505
3616
  }
4506
3617
  }
4507
3618
  if (locator && len) {
@@ -4521,7 +3632,7 @@ var require_sax = __commonJS((exports) => {
4521
3632
  parseStack.push(el);
4522
3633
  }
4523
3634
  }
4524
- if (isHTML && !el.closed) {
3635
+ if (NAMESPACE.isHTML(el.uri) && !el.closed) {
4525
3636
  end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder);
4526
3637
  } else {
4527
3638
  end++;
@@ -4530,8 +3641,6 @@ var require_sax = __commonJS((exports) => {
4530
3641
  } catch (e) {
4531
3642
  if (e instanceof ParseError) {
4532
3643
  throw e;
4533
- } else if (e instanceof DOMException) {
4534
- throw new ParseError(e.name + ": " + e.message, domBuilder.locator, e);
4535
3644
  }
4536
3645
  errorHandler.error("element parse error: " + e);
4537
3646
  end = -1;
@@ -4548,15 +3657,12 @@ var require_sax = __commonJS((exports) => {
4548
3657
  t.columnNumber = f.columnNumber;
4549
3658
  return t;
4550
3659
  }
4551
- function parseElementStartPart(source, start, el, currentNSMap, entityReplacer, errorHandler, isHTML) {
3660
+ function parseElementStartPart(source, start, el, currentNSMap, entityReplacer, errorHandler) {
4552
3661
  function addAttribute(qname, value2, startIndex) {
4553
- if (hasOwn(el.attributeNames, qname)) {
4554
- return errorHandler.fatalError("Attribute " + qname + " redefined");
4555
- }
4556
- if (!isHTML && value2.indexOf("<") >= 0) {
4557
- return errorHandler.fatalError("Unescaped '<' not allowed in attributes values");
3662
+ if (el.attributeNames.hasOwnProperty(qname)) {
3663
+ errorHandler.fatalError("Attribute " + qname + " redefined");
4558
3664
  }
4559
- el.addValue(qname, value2.replace(/[\t\n\r]/g, " ").replace(ENTITY_REG, entityReplacer), startIndex);
3665
+ el.addValue(qname, value2.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, entityReplacer), startIndex);
4560
3666
  }
4561
3667
  var attrName;
4562
3668
  var value;
@@ -4649,16 +3755,14 @@ var require_sax = __commonJS((exports) => {
4649
3755
  errorHandler.warning('attribute "' + value + '" missed quot(")!');
4650
3756
  addAttribute(attrName, value, start);
4651
3757
  } else {
4652
- if (!isHTML) {
3758
+ if (!NAMESPACE.isHTML(currentNSMap[""]) || !value.match(/^(?:disabled|checked|selected)$/i)) {
4653
3759
  errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!');
4654
3760
  }
4655
3761
  addAttribute(value, value, start);
4656
3762
  }
4657
3763
  break;
4658
3764
  case S_EQ:
4659
- if (!isHTML) {
4660
- return errorHandler.fatalError(`AttValue: ' or " expected`);
4661
- }
3765
+ throw new Error("attribute value missed!!");
4662
3766
  }
4663
3767
  return p;
4664
3768
  case "\x80":
@@ -4685,7 +3789,8 @@ var require_sax = __commonJS((exports) => {
4685
3789
  } else {
4686
3790
  switch (s) {
4687
3791
  case S_ATTR_SPACE:
4688
- if (!isHTML) {
3792
+ var tagName = el.tagName;
3793
+ if (!NAMESPACE.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
4689
3794
  errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!');
4690
3795
  }
4691
3796
  addAttribute(attrName, attrName, start);
@@ -4731,8 +3836,8 @@ var require_sax = __commonJS((exports) => {
4731
3836
  a.localName = localName;
4732
3837
  if (nsPrefix !== false) {
4733
3838
  if (localNSMap == null) {
4734
- localNSMap = Object.create(null);
4735
- _copy(currentNSMap, currentNSMap = Object.create(null));
3839
+ localNSMap = {};
3840
+ _copy(currentNSMap, currentNSMap = {});
4736
3841
  }
4737
3842
  currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
4738
3843
  a.uri = NAMESPACE.XMLNS;
@@ -4742,12 +3847,13 @@ var require_sax = __commonJS((exports) => {
4742
3847
  var i = el.length;
4743
3848
  while (i--) {
4744
3849
  a = el[i];
4745
- if (a.prefix) {
4746
- if (a.prefix === "xml") {
3850
+ var prefix = a.prefix;
3851
+ if (prefix) {
3852
+ if (prefix === "xml") {
4747
3853
  a.uri = NAMESPACE.XML;
4748
3854
  }
4749
- if (a.prefix !== "xmlns") {
4750
- a.uri = currentNSMap[a.prefix];
3855
+ if (prefix !== "xmlns") {
3856
+ a.uri = currentNSMap[prefix || ""];
4751
3857
  }
4752
3858
  }
4753
3859
  }
@@ -4765,7 +3871,7 @@ var require_sax = __commonJS((exports) => {
4765
3871
  domBuilder.endElement(ns, localName, tagName);
4766
3872
  if (localNSMap) {
4767
3873
  for (prefix in localNSMap) {
4768
- if (hasOwn(localNSMap, prefix)) {
3874
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
4769
3875
  domBuilder.endPrefixMapping(prefix);
4770
3876
  }
4771
3877
  }
@@ -4777,257 +3883,111 @@ var require_sax = __commonJS((exports) => {
4777
3883
  }
4778
3884
  }
4779
3885
  function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) {
4780
- var isEscapableRaw = isHTMLEscapableRawTextElement(tagName);
4781
- if (isEscapableRaw || isHTMLRawTextElement(tagName)) {
3886
+ if (/^(?:script|textarea)$/i.test(tagName)) {
4782
3887
  var elEndStart = source.indexOf("</" + tagName + ">", elStartEnd);
4783
3888
  var text = source.substring(elStartEnd + 1, elEndStart);
4784
- if (isEscapableRaw) {
4785
- text = text.replace(ENTITY_REG, entityReplacer);
3889
+ if (/[&<]/.test(text)) {
3890
+ if (/^script$/i.test(tagName)) {
3891
+ domBuilder.characters(text, 0, text.length);
3892
+ return elEndStart;
3893
+ }
3894
+ text = text.replace(/&#?\w+;/g, entityReplacer);
3895
+ domBuilder.characters(text, 0, text.length);
3896
+ return elEndStart;
4786
3897
  }
4787
- domBuilder.characters(text, 0, text.length);
4788
- return elEndStart;
4789
3898
  }
4790
3899
  return elStartEnd + 1;
4791
3900
  }
3901
+ function fixSelfClosed(source, elStartEnd, tagName, closeMap) {
3902
+ var pos = closeMap[tagName];
3903
+ if (pos == null) {
3904
+ pos = source.lastIndexOf("</" + tagName + ">");
3905
+ if (pos < elStartEnd) {
3906
+ pos = source.lastIndexOf("</" + tagName);
3907
+ }
3908
+ closeMap[tagName] = pos;
3909
+ }
3910
+ return pos < elStartEnd;
3911
+ }
4792
3912
  function _copy(source, target) {
4793
3913
  for (var n in source) {
4794
- if (hasOwn(source, n)) {
3914
+ if (Object.prototype.hasOwnProperty.call(source, n)) {
4795
3915
  target[n] = source[n];
4796
3916
  }
4797
3917
  }
4798
3918
  }
4799
- function parseUtils(source, start) {
4800
- var index = start;
4801
- function char(n) {
4802
- n = n || 0;
4803
- return source.charAt(index + n);
4804
- }
4805
- function skip(n) {
4806
- n = n || 1;
4807
- index += n;
4808
- }
4809
- function skipBlanks() {
4810
- var blanks = 0;
4811
- while (index < source.length) {
4812
- var c = char();
4813
- if (c !== " " && c !== `
4814
- ` && c !== "\t" && c !== "\r") {
4815
- return blanks;
4816
- }
4817
- blanks++;
4818
- skip();
4819
- }
4820
- return -1;
4821
- }
4822
- function substringFromIndex() {
4823
- return source.substring(index);
4824
- }
4825
- function substringStartsWith(text) {
4826
- return source.substring(index, index + text.length) === text;
4827
- }
4828
- function substringStartsWithCaseInsensitive(text) {
4829
- return source.substring(index, index + text.length).toUpperCase() === text.toUpperCase();
4830
- }
4831
- function getMatch(args) {
4832
- var expr = g.reg("^", args);
4833
- var match = expr.exec(substringFromIndex());
4834
- if (match) {
4835
- skip(match[0].length);
4836
- return match[0];
4837
- }
4838
- return null;
4839
- }
4840
- return {
4841
- char,
4842
- getIndex: function() {
4843
- return index;
4844
- },
4845
- getMatch,
4846
- getSource: function() {
4847
- return source;
4848
- },
4849
- skip,
4850
- skipBlanks,
4851
- substringFromIndex,
4852
- substringStartsWith,
4853
- substringStartsWithCaseInsensitive
4854
- };
4855
- }
4856
- function parseDoctypeInternalSubset(p, errorHandler) {
4857
- function parsePI(p2, errorHandler2) {
4858
- var match = g.PI.exec(p2.substringFromIndex());
4859
- if (!match) {
4860
- return errorHandler2.fatalError("processing instruction is not well-formed at position " + p2.getIndex());
4861
- }
4862
- if (match[1].toLowerCase() === "xml") {
4863
- return errorHandler2.fatalError("xml declaration is only allowed at the start of the document, but found at position " + p2.getIndex());
4864
- }
4865
- p2.skip(match[0].length);
4866
- return match[0];
4867
- }
4868
- var source = p.getSource();
4869
- if (p.char() === "[") {
4870
- p.skip(1);
4871
- var intSubsetStart = p.getIndex();
4872
- while (p.getIndex() < source.length) {
4873
- p.skipBlanks();
4874
- if (p.char() === "]") {
4875
- var internalSubset = source.substring(intSubsetStart, p.getIndex());
4876
- p.skip(1);
4877
- return internalSubset;
4878
- }
4879
- var current = null;
4880
- if (p.char() === "<" && p.char(1) === "!") {
4881
- switch (p.char(2)) {
4882
- case "E":
4883
- if (p.char(3) === "L") {
4884
- current = p.getMatch(g.elementdecl);
4885
- } else if (p.char(3) === "N") {
4886
- current = p.getMatch(g.EntityDecl);
4887
- }
4888
- break;
4889
- case "A":
4890
- current = p.getMatch(g.AttlistDecl);
4891
- break;
4892
- case "N":
4893
- current = p.getMatch(g.NotationDecl);
4894
- break;
4895
- case "-":
4896
- current = p.getMatch(g.Comment);
4897
- break;
4898
- }
4899
- } else if (p.char() === "<" && p.char(1) === "?") {
4900
- current = parsePI(p, errorHandler);
4901
- } else if (p.char() === "%") {
4902
- current = p.getMatch(g.PEReference);
4903
- } else {
4904
- return errorHandler.fatalError("Error detected in Markup declaration");
4905
- }
4906
- if (!current) {
4907
- return errorHandler.fatalError("Error in internal subset at position " + p.getIndex());
4908
- }
4909
- }
4910
- return errorHandler.fatalError("doctype internal subset is not well-formed, missing ]");
4911
- }
4912
- }
4913
- function parseDoctypeCommentOrCData(source, start, domBuilder, errorHandler, isHTML) {
4914
- var p = parseUtils(source, start);
4915
- switch (isHTML ? p.char(2).toUpperCase() : p.char(2)) {
3919
+ function parseDCC(source, start, domBuilder, errorHandler) {
3920
+ var next = source.charAt(start + 2);
3921
+ switch (next) {
4916
3922
  case "-":
4917
- var comment = p.getMatch(g.Comment);
4918
- if (comment) {
4919
- domBuilder.comment(comment, g.COMMENT_START.length, comment.length - g.COMMENT_START.length - g.COMMENT_END.length);
4920
- return p.getIndex();
3923
+ if (source.charAt(start + 3) === "-") {
3924
+ var end = source.indexOf("-->", start + 4);
3925
+ if (end > start) {
3926
+ domBuilder.comment(source, start + 4, end - start - 4);
3927
+ return end + 3;
3928
+ } else {
3929
+ errorHandler.error("Unclosed comment");
3930
+ return -1;
3931
+ }
4921
3932
  } else {
4922
- return errorHandler.fatalError("comment is not well-formed at position " + p.getIndex());
3933
+ return -1;
4923
3934
  }
4924
- case "[":
4925
- var cdata = p.getMatch(g.CDSect);
4926
- if (cdata) {
4927
- if (!isHTML && !domBuilder.currentElement) {
4928
- return errorHandler.fatalError("CDATA outside of element");
4929
- }
3935
+ default:
3936
+ if (source.substr(start + 3, 6) == "CDATA[") {
3937
+ var end = source.indexOf("]]>", start + 9);
4930
3938
  domBuilder.startCDATA();
4931
- domBuilder.characters(cdata, g.CDATA_START.length, cdata.length - g.CDATA_START.length - g.CDATA_END.length);
3939
+ domBuilder.characters(source, start + 9, end - start - 9);
4932
3940
  domBuilder.endCDATA();
4933
- return p.getIndex();
4934
- } else {
4935
- return errorHandler.fatalError("Invalid CDATA starting at position " + start);
4936
- }
4937
- case "D": {
4938
- if (domBuilder.doc && domBuilder.doc.documentElement) {
4939
- return errorHandler.fatalError("Doctype not allowed inside or after documentElement at position " + p.getIndex());
4940
- }
4941
- if (isHTML ? !p.substringStartsWithCaseInsensitive(g.DOCTYPE_DECL_START) : !p.substringStartsWith(g.DOCTYPE_DECL_START)) {
4942
- return errorHandler.fatalError("Expected " + g.DOCTYPE_DECL_START + " at position " + p.getIndex());
4943
- }
4944
- p.skip(g.DOCTYPE_DECL_START.length);
4945
- if (p.skipBlanks() < 1) {
4946
- return errorHandler.fatalError("Expected whitespace after " + g.DOCTYPE_DECL_START + " at position " + p.getIndex());
4947
- }
4948
- var doctype = {
4949
- name: undefined,
4950
- publicId: undefined,
4951
- systemId: undefined,
4952
- internalSubset: undefined
4953
- };
4954
- doctype.name = p.getMatch(g.Name);
4955
- if (!doctype.name)
4956
- return errorHandler.fatalError("doctype name missing or contains unexpected characters at position " + p.getIndex());
4957
- if (isHTML && doctype.name.toLowerCase() !== "html") {
4958
- errorHandler.warning("Unexpected DOCTYPE in HTML document at position " + p.getIndex());
4959
- }
4960
- p.skipBlanks();
4961
- if (p.substringStartsWith(g.PUBLIC) || p.substringStartsWith(g.SYSTEM)) {
4962
- var match = g.ExternalID_match.exec(p.substringFromIndex());
4963
- if (!match) {
4964
- return errorHandler.fatalError("doctype external id is not well-formed at position " + p.getIndex());
4965
- }
4966
- if (match.groups.SystemLiteralOnly !== undefined) {
4967
- doctype.systemId = match.groups.SystemLiteralOnly;
4968
- } else {
4969
- doctype.systemId = match.groups.SystemLiteral;
4970
- doctype.publicId = match.groups.PubidLiteral;
4971
- }
4972
- p.skip(match[0].length);
4973
- } else if (isHTML && p.substringStartsWithCaseInsensitive(g.SYSTEM)) {
4974
- p.skip(g.SYSTEM.length);
4975
- if (p.skipBlanks() < 1) {
4976
- return errorHandler.fatalError("Expected whitespace after " + g.SYSTEM + " at position " + p.getIndex());
4977
- }
4978
- doctype.systemId = p.getMatch(g.ABOUT_LEGACY_COMPAT_SystemLiteral);
4979
- if (!doctype.systemId) {
4980
- return errorHandler.fatalError("Expected " + g.ABOUT_LEGACY_COMPAT + " in single or double quotes after " + g.SYSTEM + " at position " + p.getIndex());
3941
+ return end + 3;
3942
+ }
3943
+ var matchs = split(source, start);
3944
+ var len = matchs.length;
3945
+ if (len > 1 && /!doctype/i.test(matchs[0][0])) {
3946
+ var name = matchs[1][0];
3947
+ var pubid = false;
3948
+ var sysid = false;
3949
+ if (len > 3) {
3950
+ if (/^public$/i.test(matchs[2][0])) {
3951
+ pubid = matchs[3][0];
3952
+ sysid = len > 4 && matchs[4][0];
3953
+ } else if (/^system$/i.test(matchs[2][0])) {
3954
+ sysid = matchs[3][0];
3955
+ }
4981
3956
  }
3957
+ var lastMatch = matchs[len - 1];
3958
+ domBuilder.startDTD(name, pubid, sysid);
3959
+ domBuilder.endDTD();
3960
+ return lastMatch.index + lastMatch[0].length;
4982
3961
  }
4983
- if (isHTML && doctype.systemId && !g.ABOUT_LEGACY_COMPAT_SystemLiteral.test(doctype.systemId)) {
4984
- errorHandler.warning("Unexpected doctype.systemId in HTML document at position " + p.getIndex());
4985
- }
4986
- if (!isHTML) {
4987
- p.skipBlanks();
4988
- doctype.internalSubset = parseDoctypeInternalSubset(p, errorHandler);
4989
- }
4990
- p.skipBlanks();
4991
- if (p.char() !== ">") {
4992
- return errorHandler.fatalError("doctype not terminated with > at position " + p.getIndex());
4993
- }
4994
- p.skip(1);
4995
- domBuilder.startDTD(doctype.name, doctype.publicId, doctype.systemId, doctype.internalSubset);
4996
- domBuilder.endDTD();
4997
- return p.getIndex();
4998
- }
4999
- default:
5000
- return errorHandler.fatalError('Not well-formed XML starting with "<!" at position ' + start);
5001
3962
  }
3963
+ return -1;
5002
3964
  }
5003
- function parseProcessingInstruction(source, start, domBuilder, errorHandler) {
5004
- var match = source.substring(start).match(g.PI);
5005
- if (!match) {
5006
- return errorHandler.fatalError("Invalid processing instruction starting at position " + start);
5007
- }
5008
- if (match[1].toLowerCase() === "xml") {
5009
- if (start > 0) {
5010
- return errorHandler.fatalError("processing instruction at position " + start + " is an xml declaration which is only at the start of the document");
5011
- }
5012
- if (!g.XMLDecl.test(source.substring(start))) {
5013
- return errorHandler.fatalError("xml declaration is not well-formed");
3965
+ function parseInstruction(source, start, domBuilder) {
3966
+ var end = source.indexOf("?>", start);
3967
+ if (end) {
3968
+ var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
3969
+ if (match) {
3970
+ var len = match[0].length;
3971
+ domBuilder.processingInstruction(match[1], match[2]);
3972
+ return end + 2;
3973
+ } else {
3974
+ return -1;
5014
3975
  }
5015
3976
  }
5016
- domBuilder.processingInstruction(match[1], match[2]);
5017
- return start + match[0].length;
3977
+ return -1;
5018
3978
  }
5019
3979
  function ElementAttributes() {
5020
- this.attributeNames = Object.create(null);
3980
+ this.attributeNames = {};
5021
3981
  }
5022
3982
  ElementAttributes.prototype = {
5023
3983
  setTagName: function(tagName) {
5024
- if (!g.QName_exact.test(tagName)) {
3984
+ if (!tagNamePattern.test(tagName)) {
5025
3985
  throw new Error("invalid tagName:" + tagName);
5026
3986
  }
5027
3987
  this.tagName = tagName;
5028
3988
  },
5029
3989
  addValue: function(qName, value, offset) {
5030
- if (!g.QName_exact.test(qName)) {
3990
+ if (!tagNamePattern.test(qName)) {
5031
3991
  throw new Error("invalid attribute:" + qName);
5032
3992
  }
5033
3993
  this.attributeNames[qName] = this.length;
@@ -5050,94 +4010,94 @@ var require_sax = __commonJS((exports) => {
5050
4010
  return this[i].value;
5051
4011
  }
5052
4012
  };
4013
+ function split(source, start) {
4014
+ var match;
4015
+ var buf = [];
4016
+ var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
4017
+ reg.lastIndex = start;
4018
+ reg.exec(source);
4019
+ while (match = reg.exec(source)) {
4020
+ buf.push(match);
4021
+ if (match[1])
4022
+ return buf;
4023
+ }
4024
+ }
5053
4025
  exports.XMLReader = XMLReader;
5054
- exports.parseUtils = parseUtils;
5055
- exports.parseDoctypeCommentOrCData = parseDoctypeCommentOrCData;
4026
+ exports.ParseError = ParseError;
5056
4027
  });
5057
4028
 
5058
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/dom-parser.js
4029
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/dom-parser.js
5059
4030
  var require_dom_parser = __commonJS((exports) => {
5060
4031
  var conventions = require_conventions();
5061
4032
  var dom = require_dom();
5062
- var errors = require_errors();
5063
4033
  var entities = require_entities();
5064
4034
  var sax = require_sax();
5065
4035
  var DOMImplementation = dom.DOMImplementation;
5066
- var hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;
5067
- var isHTMLMimeType = conventions.isHTMLMimeType;
5068
- var isValidMimeType = conventions.isValidMimeType;
5069
- var MIME_TYPE = conventions.MIME_TYPE;
5070
4036
  var NAMESPACE = conventions.NAMESPACE;
5071
- var ParseError = errors.ParseError;
4037
+ var ParseError = sax.ParseError;
5072
4038
  var XMLReader = sax.XMLReader;
5073
4039
  function normalizeLineEndings(input) {
5074
4040
  return input.replace(/\r[\n\u0085]/g, `
5075
- `).replace(/[\r\u0085\u2028\u2029]/g, `
4041
+ `).replace(/[\r\u0085\u2028]/g, `
5076
4042
  `);
5077
4043
  }
5078
4044
  function DOMParser(options) {
5079
- options = options || {};
5080
- if (options.locator === undefined) {
5081
- options.locator = true;
5082
- }
5083
- this.assign = options.assign || conventions.assign;
5084
- this.domHandler = options.domHandler || DOMHandler;
5085
- this.onError = options.onError || options.errorHandler;
5086
- if (options.errorHandler && typeof options.errorHandler !== "function") {
5087
- throw new TypeError("errorHandler object is no longer supported, switch to onError!");
5088
- } else if (options.errorHandler) {
5089
- options.errorHandler("warning", "The `errorHandler` option has been deprecated, use `onError` instead!", this);
5090
- }
5091
- this.normalizeLineEndings = options.normalizeLineEndings || normalizeLineEndings;
5092
- this.locator = !!options.locator;
5093
- this.xmlns = this.assign(Object.create(null), options.xmlns);
4045
+ this.options = options || { locator: {} };
5094
4046
  }
5095
4047
  DOMParser.prototype.parseFromString = function(source, mimeType) {
5096
- if (!isValidMimeType(mimeType)) {
5097
- throw new TypeError('DOMParser.parseFromString: the provided mimeType "' + mimeType + '" is not valid.');
5098
- }
5099
- var defaultNSMap = this.assign(Object.create(null), this.xmlns);
5100
- var entityMap = entities.XML_ENTITIES;
5101
- var defaultNamespace = defaultNSMap[""] || null;
5102
- if (hasDefaultHTMLNamespace(mimeType)) {
5103
- entityMap = entities.HTML_ENTITIES;
5104
- defaultNamespace = NAMESPACE.HTML;
5105
- } else if (mimeType === MIME_TYPE.XML_SVG_IMAGE) {
5106
- defaultNamespace = NAMESPACE.SVG;
5107
- }
5108
- defaultNSMap[""] = defaultNamespace;
5109
- defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
5110
- var domBuilder = new this.domHandler({
5111
- mimeType,
5112
- defaultNamespace,
5113
- onError: this.onError
5114
- });
5115
- var locator = this.locator ? {} : undefined;
5116
- if (this.locator) {
4048
+ var options = this.options;
4049
+ var sax2 = new XMLReader;
4050
+ var domBuilder = options.domBuilder || new DOMHandler;
4051
+ var errorHandler = options.errorHandler;
4052
+ var locator = options.locator;
4053
+ var defaultNSMap = options.xmlns || {};
4054
+ var isHTML = /\/x?html?$/.test(mimeType);
4055
+ var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
4056
+ if (locator) {
5117
4057
  domBuilder.setDocumentLocator(locator);
5118
4058
  }
5119
- var sax2 = new XMLReader;
5120
- sax2.errorHandler = domBuilder;
5121
- sax2.domBuilder = domBuilder;
5122
- var isXml = !conventions.isHTMLMimeType(mimeType);
5123
- if (isXml && typeof source !== "string") {
5124
- sax2.errorHandler.fatalError("source is not a string");
4059
+ sax2.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator);
4060
+ sax2.domBuilder = options.domBuilder || domBuilder;
4061
+ if (isHTML) {
4062
+ defaultNSMap[""] = NAMESPACE.HTML;
5125
4063
  }
5126
- sax2.parse(this.normalizeLineEndings(String(source)), defaultNSMap, entityMap);
5127
- if (!domBuilder.doc.documentElement) {
5128
- sax2.errorHandler.fatalError("missing root element");
4064
+ defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
4065
+ var normalize = options.normalizeLineEndings || normalizeLineEndings;
4066
+ if (source && typeof source === "string") {
4067
+ sax2.parse(normalize(source), defaultNSMap, entityMap);
4068
+ } else {
4069
+ sax2.errorHandler.error("invalid doc source");
5129
4070
  }
5130
4071
  return domBuilder.doc;
5131
4072
  };
5132
- function DOMHandler(options) {
5133
- var opt = options || {};
5134
- this.mimeType = opt.mimeType || MIME_TYPE.XML_APPLICATION;
5135
- this.defaultNamespace = opt.defaultNamespace || null;
4073
+ function buildErrorHandler(errorImpl, domBuilder, locator) {
4074
+ if (!errorImpl) {
4075
+ if (domBuilder instanceof DOMHandler) {
4076
+ return domBuilder;
4077
+ }
4078
+ errorImpl = domBuilder;
4079
+ }
4080
+ var errorHandler = {};
4081
+ var isCallback = errorImpl instanceof Function;
4082
+ locator = locator || {};
4083
+ function build(key) {
4084
+ var fn = errorImpl[key];
4085
+ if (!fn && isCallback) {
4086
+ fn = errorImpl.length == 2 ? function(msg) {
4087
+ errorImpl(key, msg);
4088
+ } : errorImpl;
4089
+ }
4090
+ errorHandler[key] = fn && function(msg) {
4091
+ fn("[xmldom " + key + "]\t" + msg + _locator(locator));
4092
+ } || function() {};
4093
+ }
4094
+ build("warning");
4095
+ build("error");
4096
+ build("fatalError");
4097
+ return errorHandler;
4098
+ }
4099
+ function DOMHandler() {
5136
4100
  this.cdata = false;
5137
- this.currentElement = undefined;
5138
- this.doc = undefined;
5139
- this.locator = undefined;
5140
- this.onError = opt.onError;
5141
4101
  }
5142
4102
  function position(locator, node) {
5143
4103
  node.lineNumber = locator.lineNumber;
@@ -5145,8 +4105,10 @@ var require_dom_parser = __commonJS((exports) => {
5145
4105
  }
5146
4106
  DOMHandler.prototype = {
5147
4107
  startDocument: function() {
5148
- var impl = new DOMImplementation;
5149
- this.doc = isHTMLMimeType(this.mimeType) ? impl.createHTMLDocument(false) : impl.createDocument(this.defaultNamespace, "");
4108
+ this.doc = new DOMImplementation().createDocument(null, null, null);
4109
+ if (this.locator) {
4110
+ this.doc.documentURI = this.locator.systemId;
4111
+ }
5150
4112
  },
5151
4113
  startElement: function(namespaceURI, localName, qName, attrs) {
5152
4114
  var doc = this.doc;
@@ -5166,7 +4128,9 @@ var require_dom_parser = __commonJS((exports) => {
5166
4128
  }
5167
4129
  },
5168
4130
  endElement: function(namespaceURI, localName, qName) {
5169
- this.currentElement = this.currentElement.parentNode;
4131
+ var current = this.currentElement;
4132
+ var tagName = current.tagName;
4133
+ this.currentElement = current.parentNode;
5170
4134
  },
5171
4135
  startPrefixMapping: function(prefix, uri) {},
5172
4136
  endPrefixMapping: function(prefix) {},
@@ -5197,10 +4161,9 @@ var require_dom_parser = __commonJS((exports) => {
5197
4161
  this.doc.normalize();
5198
4162
  },
5199
4163
  setDocumentLocator: function(locator) {
5200
- if (locator) {
4164
+ if (this.locator = locator) {
5201
4165
  locator.lineNumber = 0;
5202
4166
  }
5203
- this.locator = locator;
5204
4167
  },
5205
4168
  comment: function(chars, start, length) {
5206
4169
  chars = _toString.apply(this, arguments);
@@ -5214,41 +4177,29 @@ var require_dom_parser = __commonJS((exports) => {
5214
4177
  endCDATA: function() {
5215
4178
  this.cdata = false;
5216
4179
  },
5217
- startDTD: function(name, publicId, systemId, internalSubset) {
4180
+ startDTD: function(name, publicId, systemId) {
5218
4181
  var impl = this.doc.implementation;
5219
4182
  if (impl && impl.createDocumentType) {
5220
- var dt = impl.createDocumentType(name, publicId, systemId, internalSubset);
4183
+ var dt = impl.createDocumentType(name, publicId, systemId);
5221
4184
  this.locator && position(this.locator, dt);
5222
4185
  appendElement(this, dt);
5223
4186
  this.doc.doctype = dt;
5224
4187
  }
5225
4188
  },
5226
- reportError: function(level, message) {
5227
- if (typeof this.onError === "function") {
5228
- try {
5229
- this.onError(level, message, this);
5230
- } catch (e) {
5231
- throw new ParseError("Reporting " + level + ' "' + message + '" caused ' + e, this.locator);
5232
- }
5233
- } else {
5234
- console.error("[xmldom " + level + "]\t" + message, _locator(this.locator));
5235
- }
5236
- },
5237
- warning: function(message) {
5238
- this.reportError("warning", message);
4189
+ warning: function(error) {
4190
+ console.warn("[xmldom warning]\t" + error, _locator(this.locator));
5239
4191
  },
5240
- error: function(message) {
5241
- this.reportError("error", message);
4192
+ error: function(error) {
4193
+ console.error("[xmldom error]\t" + error, _locator(this.locator));
5242
4194
  },
5243
- fatalError: function(message) {
5244
- this.reportError("fatalError", message);
5245
- throw new ParseError(message, this.locator);
4195
+ fatalError: function(error) {
4196
+ throw new ParseError(error, this.locator);
5246
4197
  }
5247
4198
  };
5248
4199
  function _locator(l) {
5249
4200
  if (l) {
5250
4201
  return `
5251
- @#[line:` + l.lineNumber + ",col:" + l.columnNumber + "]";
4202
+ @` + (l.systemId || "") + "#[line:" + l.lineNumber + ",col:" + l.columnNumber + "]";
5252
4203
  }
5253
4204
  }
5254
4205
  function _toString(chars, start, length) {
@@ -5266,69 +4217,27 @@ var require_dom_parser = __commonJS((exports) => {
5266
4217
  return null;
5267
4218
  };
5268
4219
  });
5269
- function appendElement(handler, node) {
5270
- if (!handler.currentElement) {
5271
- handler.doc.appendChild(node);
4220
+ function appendElement(hander, node) {
4221
+ if (!hander.currentElement) {
4222
+ hander.doc.appendChild(node);
5272
4223
  } else {
5273
- handler.currentElement.appendChild(node);
4224
+ hander.currentElement.appendChild(node);
5274
4225
  }
5275
4226
  }
5276
- function onErrorStopParsing(level) {
5277
- if (level === "error")
5278
- throw "onErrorStopParsing";
5279
- }
5280
- function onWarningStopParsing() {
5281
- throw "onWarningStopParsing";
5282
- }
5283
4227
  exports.__DOMHandler = DOMHandler;
5284
- exports.DOMParser = DOMParser;
5285
4228
  exports.normalizeLineEndings = normalizeLineEndings;
5286
- exports.onErrorStopParsing = onErrorStopParsing;
5287
- exports.onWarningStopParsing = onWarningStopParsing;
4229
+ exports.DOMParser = DOMParser;
5288
4230
  });
5289
4231
 
5290
- // node_modules/.bun/@xmldom+xmldom@0.9.10/node_modules/@xmldom/xmldom/lib/index.js
4232
+ // node_modules/.bun/@xmldom+xmldom@0.8.12/node_modules/@xmldom/xmldom/lib/index.js
5291
4233
  var require_lib = __commonJS((exports) => {
5292
- var conventions = require_conventions();
5293
- exports.assign = conventions.assign;
5294
- exports.hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;
5295
- exports.isHTMLMimeType = conventions.isHTMLMimeType;
5296
- exports.isValidMimeType = conventions.isValidMimeType;
5297
- exports.MIME_TYPE = conventions.MIME_TYPE;
5298
- exports.NAMESPACE = conventions.NAMESPACE;
5299
- var errors = require_errors();
5300
- exports.DOMException = errors.DOMException;
5301
- exports.DOMExceptionName = errors.DOMExceptionName;
5302
- exports.ExceptionCode = errors.ExceptionCode;
5303
- exports.ParseError = errors.ParseError;
5304
4234
  var dom = require_dom();
5305
- exports.Attr = dom.Attr;
5306
- exports.CDATASection = dom.CDATASection;
5307
- exports.CharacterData = dom.CharacterData;
5308
- exports.Comment = dom.Comment;
5309
- exports.Document = dom.Document;
5310
- exports.DocumentFragment = dom.DocumentFragment;
5311
- exports.DocumentType = dom.DocumentType;
5312
4235
  exports.DOMImplementation = dom.DOMImplementation;
5313
- exports.Element = dom.Element;
5314
- exports.Entity = dom.Entity;
5315
- exports.EntityReference = dom.EntityReference;
5316
- exports.LiveNodeList = dom.LiveNodeList;
5317
- exports.NamedNodeMap = dom.NamedNodeMap;
5318
- exports.Node = dom.Node;
5319
- exports.NodeList = dom.NodeList;
5320
- exports.Notation = dom.Notation;
5321
- exports.ProcessingInstruction = dom.ProcessingInstruction;
5322
- exports.Text = dom.Text;
5323
4236
  exports.XMLSerializer = dom.XMLSerializer;
5324
- var domParser = require_dom_parser();
5325
- exports.DOMParser = domParser.DOMParser;
5326
- exports.normalizeLineEndings = domParser.normalizeLineEndings;
5327
- exports.onErrorStopParsing = domParser.onErrorStopParsing;
5328
- exports.onWarningStopParsing = domParser.onWarningStopParsing;
4237
+ exports.DOMParser = require_dom_parser().DOMParser;
5329
4238
  });
5330
4239
 
5331
- // node_modules/.bun/plist@3.1.1/node_modules/plist/lib/parse.js
4240
+ // node_modules/.bun/plist@3.1.0/node_modules/plist/lib/parse.js
5332
4241
  var require_parse = __commonJS((exports) => {
5333
4242
  var { DOMParser } = require_lib();
5334
4243
  exports.parse = parse;
@@ -5351,7 +4260,7 @@ var require_parse = __commonJS((exports) => {
5351
4260
  }
5352
4261
  }
5353
4262
  function parse(xml) {
5354
- var doc = new DOMParser().parseFromString(xml, "text/xml");
4263
+ var doc = new DOMParser().parseFromString(xml);
5355
4264
  invariant(doc.documentElement.nodeName === "plist", "malformed document. First element should be <plist>");
5356
4265
  var plist = parsePlistXML(doc.documentElement);
5357
4266
  if (plist.length == 1)
@@ -9159,7 +8068,7 @@ var require_lib2 = __commonJS((exports, module) => {
9159
8068
  }).call(exports);
9160
8069
  });
9161
8070
 
9162
- // node_modules/.bun/plist@3.1.1/node_modules/plist/lib/build.js
8071
+ // node_modules/.bun/plist@3.1.0/node_modules/plist/lib/build.js
9163
8072
  var require_build = __commonJS((exports) => {
9164
8073
  var base64 = require_base64_js();
9165
8074
  var xmlbuilder = require_lib2();
@@ -9235,7 +8144,7 @@ var require_build = __commonJS((exports) => {
9235
8144
  }
9236
8145
  });
9237
8146
 
9238
- // node_modules/.bun/plist@3.1.1/node_modules/plist/index.js
8147
+ // node_modules/.bun/plist@3.1.0/node_modules/plist/index.js
9239
8148
  var require_plist = __commonJS((exports) => {
9240
8149
  var parserFunctions = require_parse();
9241
8150
  Object.keys(parserFunctions).forEach(function(k) {