@flyfish-group/file-viewer-web 1.0.23 → 1.0.24

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 (200) hide show
  1. package/README.md +50 -0
  2. package/package.json +1 -1
  3. package/viewer/assets/{ArchiveViewer-CZ4MDsrb.js → ArchiveViewer-DVFt9C9C.js} +1 -1
  4. package/viewer/assets/{AudioViewer-DjyDsudI.js → AudioViewer-BulivPxn.js} +1 -1
  5. package/viewer/assets/{CadViewer-BInkfPwZ.css → CadViewer-D8GvQQr1.css} +1 -1
  6. package/viewer/assets/{CadViewer-BdTvIAMP.js → CadViewer-_KighJFR.js} +16 -16
  7. package/viewer/assets/{CodeViewer-57pZ6W1s.js → CodeViewer-BhkUWNKW.js} +2 -2
  8. package/viewer/assets/{DrawingViewer-NO4nzeA1.js → DrawingViewer-DV-fZze_.js} +2 -2
  9. package/viewer/assets/{EdaViewer-B296bd4C.js → EdaViewer-7B-4NYgk.js} +3 -3
  10. package/viewer/assets/{EmailViewer-CPSeSuYo.js → EmailViewer-DzWhwNVa.js} +3 -3
  11. package/viewer/assets/{EpubViewer-BCSRMeWe.js → EpubViewer-BEFiCAHj.js} +2 -2
  12. package/viewer/assets/{ImageViewer-DnZM9hve.js → ImageViewer-Dw0Q_L3O.js} +1 -1
  13. package/viewer/assets/{MarkdownViewer-CmNTA_kD.js → MarkdownViewer-CIQTBKMU.js} +1 -1
  14. package/viewer/assets/{ModelViewer-D9x3ivqk.js → ModelViewer-CuBVhnGa.js} +1 -1
  15. package/viewer/assets/{OfdViewer-IhXBAdUl.js → OfdViewer-DrhUZ8K7.js} +2 -2
  16. package/viewer/assets/{PdfView-E1iujAnQ.js → PdfView-DQJTSDKM.js} +1 -1
  17. package/viewer/assets/{PptxRender-Dad6hvcj.js → PptxRender-gJDg276O.js} +1 -1
  18. package/viewer/assets/{TypstViewer-gzZvcE-4.js → TypstViewer-Dm2KyEFW.js} +1 -1
  19. package/viewer/assets/{UmdViewer-YzLD0vlj.js → UmdViewer-DaVp1kyn.js} +1 -1
  20. package/viewer/assets/{XlsxTable-CZSQVOJ0.js → XlsxTable-BwYOmyJ1.js} +1 -1
  21. package/viewer/assets/__vite-browser-external-t8MuORTf.js +1 -0
  22. package/viewer/assets/{ar-SA-G6X2FPQ2-DIej4228.js → ar-SA-G6X2FPQ2-B5sNIcs2.js} +1 -1
  23. package/viewer/assets/architecture-7EHR7CIX-Duq6XYGl.js +1 -0
  24. package/viewer/assets/{architectureDiagram-3BPJPVTR-aQ-MRDKN.js → architectureDiagram-3BPJPVTR-ewLbySqv.js} +1 -1
  25. package/viewer/assets/{archive-CRrvkqZk.js → archive-DldaL6u9.js} +2 -2
  26. package/viewer/assets/{audio-DWT9z9tK.js → audio-B3P6Xkdn.js} +2 -2
  27. package/viewer/assets/{az-AZ-76LH7QW2-CS2qXUFa.js → az-AZ-76LH7QW2-B6R6TLFe.js} +1 -1
  28. package/viewer/assets/{bg-BG-XCXSNQG7-9ujIdMwb.js → bg-BG-XCXSNQG7-B92FLJx1.js} +1 -1
  29. package/viewer/assets/{blockDiagram-GPEHLZMM-DkVCZJHC.js → blockDiagram-GPEHLZMM-R9sdF9YY.js} +1 -1
  30. package/viewer/assets/{bn-BD-2XOGV67Q-Bz4MKzNd.js → bn-BD-2XOGV67Q-DyLimFtx.js} +1 -1
  31. package/viewer/assets/{c4Diagram-AAUBKEIU-BhUtgtBE.js → c4Diagram-AAUBKEIU-D4cIyN3b.js} +1 -1
  32. package/viewer/assets/{ca-ES-6MX7JW3Y-CQ0i-M2m.js → ca-ES-6MX7JW3Y-ZQAYnW04.js} +1 -1
  33. package/viewer/assets/cad-BlvOit0r.js +2 -0
  34. package/viewer/assets/{cfb-DgjGJYYS.js → cfb-D97WBGAx.js} +1 -1
  35. package/viewer/assets/channel-C56rZQS8.js +1 -0
  36. package/viewer/assets/{chunk-2J33WTMH-CruGLWY_.js → chunk-2J33WTMH-CH4DhXJ6.js} +1 -1
  37. package/viewer/assets/{chunk-3OPIFGDE-BBTvqaNI.js → chunk-3OPIFGDE-CeQyPc2S.js} +1 -1
  38. package/viewer/assets/{chunk-4BX2VUAB-DnDF0gw2.js → chunk-4BX2VUAB-C9f3cCY_.js} +1 -1
  39. package/viewer/assets/{chunk-55IACEB6-BXXbpqd4.js → chunk-55IACEB6-BfXxlLZE.js} +1 -1
  40. package/viewer/assets/{chunk-5ZQYHXKU-D-OgLpMs.js → chunk-5ZQYHXKU-BAalwFs3.js} +1 -1
  41. package/viewer/assets/{chunk-727SXJPM-DF6e3Zgf.js → chunk-727SXJPM-BJ5pHoLj.js} +1 -1
  42. package/viewer/assets/{chunk-AGHRB4JF-Fz9kp2Fp.js → chunk-AGHRB4JF-BPQIPtb6.js} +1 -1
  43. package/viewer/assets/{chunk-AQP2D5EJ-B3sX7UtP.js → chunk-AQP2D5EJ-DmmEzEga.js} +1 -1
  44. package/viewer/assets/{chunk-BSJP7CBP-BkJdmh17.js → chunk-BSJP7CBP-sjN6Abjx.js} +1 -1
  45. package/viewer/assets/{chunk-CSCIHK7Q-VDPd5eNJ.js → chunk-CSCIHK7Q-CSgWUfWx.js} +1 -1
  46. package/viewer/assets/{chunk-EIO257PC-Dq8JiXSZ.js → chunk-EIO257PC-CNTUsg0Z.js} +1 -1
  47. package/viewer/assets/{chunk-FMBD7UC4-CKA5OKZ8.js → chunk-FMBD7UC4-CRTOw4OX.js} +1 -1
  48. package/viewer/assets/{chunk-K2UTITRG-BEkZoneJ.js → chunk-K2UTITRG--3tR5fTd.js} +4 -4
  49. package/viewer/assets/{chunk-KSCS5N6A-BuXf0YOu.js → chunk-KSCS5N6A-CbD8pl9X.js} +1 -1
  50. package/viewer/assets/{chunk-L5ZTLDWV-CzNJ_8is.js → chunk-L5ZTLDWV-ycDBW8N9.js} +1 -1
  51. package/viewer/assets/{chunk-LZXEDZCA-n9zJSIw5.js → chunk-LZXEDZCA-CF9KGL7w.js} +2 -2
  52. package/viewer/assets/{chunk-ND2GUHAM-zGgwlxna.js → chunk-ND2GUHAM-CM8l7Cas.js} +1 -1
  53. package/viewer/assets/{chunk-NZK2D7GU-Cte2JwiA.js → chunk-NZK2D7GU-DdJsXIOi.js} +1 -1
  54. package/viewer/assets/{chunk-O5CBEL6O-Bu7jDUJy.js → chunk-O5CBEL6O-Clj0ulVd.js} +1 -1
  55. package/viewer/assets/chunk-QZHKN3VN-C4akJhtC.js +1 -0
  56. package/viewer/assets/{chunk-SRAX5OIU-w1svEpmY.js → chunk-SRAX5OIU-huS9oUCj.js} +1 -1
  57. package/viewer/assets/{chunk-WU5MYG2G-h67ucwKy.js → chunk-WU5MYG2G-B_jreI7e.js} +1 -1
  58. package/viewer/assets/{chunk-XPW4576I-SsWL9gHk.js → chunk-XPW4576I-DAt-kMFp.js} +1 -1
  59. package/viewer/assets/classDiagram-4FO5ZUOK-ZY-Or3iU.js +1 -0
  60. package/viewer/assets/classDiagram-v2-Q7XG4LA2-ZY-Or3iU.js +1 -0
  61. package/viewer/assets/{compare-CYFnIciQ.js → compare-CxX7rqpx.js} +1 -1
  62. package/viewer/assets/{compiler-Doo7uL6g.js → compiler-CSKahift.js} +1 -1
  63. package/viewer/assets/{core-DHC7JJ3v.js → core-ClJ33Pz6.js} +1 -1
  64. package/viewer/assets/{cose-bilkent-S5V4N54A-BbY9gLB6.js → cose-bilkent-S5V4N54A-DgluOF8o.js} +1 -1
  65. package/viewer/assets/{cs-CZ-2BRQDIVT-CNJY03Br.js → cs-CZ-2BRQDIVT-CjVmJN9s.js} +1 -1
  66. package/viewer/assets/{da-DK-5WZEPLOC-kycNORr2.js → da-DK-5WZEPLOC-DuO_boTF.js} +1 -1
  67. package/viewer/assets/{dagre-BM42HDAG-CtFkfSMu.js → dagre-BM42HDAG-DM5mE2Zd.js} +1 -1
  68. package/viewer/assets/{de-DE-XR44H4JA-DgEFBHUE.js → de-DE-XR44H4JA-EPlX57Pp.js} +1 -1
  69. package/viewer/assets/{diagram-2AECGRRQ-OITOieDL.js → diagram-2AECGRRQ-3nu9YN-3.js} +1 -1
  70. package/viewer/assets/{diagram-5GNKFQAL-CkpmTcRT.js → diagram-5GNKFQAL-Bgu27v2R.js} +1 -1
  71. package/viewer/assets/{diagram-KO2AKTUF-Q-LQjcLw.js → diagram-KO2AKTUF-D1MNRJyI.js} +1 -1
  72. package/viewer/assets/{diagram-LMA3HP47-BlbmzDQ6.js → diagram-LMA3HP47-DCtnTV7h.js} +1 -1
  73. package/viewer/assets/{diagram-OG6HWLK6-CcX1M4RU.js → diagram-OG6HWLK6-s6SSdQMs.js} +1 -1
  74. package/viewer/assets/{dist-idVqPIzq.js → dist-CuHfIJfC.js} +1 -1
  75. package/viewer/assets/{dist-Bgk0P6Wx.js → dist-DDjNLAL2.js} +4 -4
  76. package/viewer/assets/{dist-BzZSLV34.js → dist-DXasMrKe.js} +1 -1
  77. package/viewer/assets/{docx-preview-CbKtHvXt.js → docx-preview-DvcqvOJx.js} +1 -1
  78. package/viewer/assets/{drawing-Cg8yKw0a.js → drawing-BfpKVc9g.js} +2 -2
  79. package/viewer/assets/{ebook-B0xdVki1.js → ebook-DgiEZLdI.js} +2 -2
  80. package/viewer/assets/{eda-DB_j3--n.js → eda-CLifR9E1.js} +2 -2
  81. package/viewer/assets/{el-GR-BZB4AONW-DQbI2D0z.js → el-GR-BZB4AONW-D219qMkP.js} +1 -1
  82. package/viewer/assets/email-COTzP9LC.js +2 -0
  83. package/viewer/assets/{en-B4ZKOASM-gYELMyZ6.js → en-B4ZKOASM-7Or2cbEH.js} +1 -1
  84. package/viewer/assets/{erDiagram-TEJ5UH35-DEgxv-IW.js → erDiagram-TEJ5UH35-DeDvft1t.js} +1 -1
  85. package/viewer/assets/{es-ES-U4NZUMDT-e1S39Ti1.js → es-ES-U4NZUMDT-DjqS5A0E.js} +1 -1
  86. package/viewer/assets/{eu-ES-A7QVB2H4-BFR4rl79.js → eu-ES-A7QVB2H4-DQpymFaA.js} +1 -1
  87. package/viewer/assets/eventmodeling-FCH6USID-BCi1wRM-.js +1 -0
  88. package/viewer/assets/{fa-IR-HGAKTJCU-D9rZqekR.js → fa-IR-HGAKTJCU-B41S19qI.js} +1 -1
  89. package/viewer/assets/{fi-FI-Z5N7JZ37-LaYcmFdb.js → fi-FI-Z5N7JZ37-BKcNMsLi.js} +1 -1
  90. package/viewer/assets/{flowDiagram-I6XJVG4X-nqVkey0o.js → flowDiagram-I6XJVG4X-ScaL7pBV.js} +1 -1
  91. package/viewer/assets/{fr-FR-RHASNOE6-DaN_dVyx.js → fr-FR-RHASNOE6-DgvAxhWu.js} +1 -1
  92. package/viewer/assets/{ganttDiagram-6RSMTGT7-B5XdNYHP.js → ganttDiagram-6RSMTGT7-GBpi2uOc.js} +1 -1
  93. package/viewer/assets/{gitGraph-WXDBUCRP-CcEeprvc.js → gitGraph-WXDBUCRP-B_SAjRqW.js} +1 -1
  94. package/viewer/assets/{gitGraphDiagram-PVQCEYII-DoyI3hWK.js → gitGraphDiagram-PVQCEYII-CMv-8uuw.js} +1 -1
  95. package/viewer/assets/{gl-ES-HMX3MZ6V-Dw-96yV4.js → gl-ES-HMX3MZ6V-B7hAkp9B.js} +1 -1
  96. package/viewer/assets/{he-IL-6SHJWFNN-DSze4qOo.js → he-IL-6SHJWFNN-Ds9DqAkn.js} +1 -1
  97. package/viewer/assets/{hi-IN-IWLTKZ5I-BrDOKcx0.js → hi-IN-IWLTKZ5I-DxQ8dbv4.js} +1 -1
  98. package/viewer/assets/{hu-HU-A5ZG7DT2-B5MZHRE0.js → hu-HU-A5ZG7DT2-LGuwPxm0.js} +1 -1
  99. package/viewer/assets/{id-ID-SAP4L64H-CLeuopyl.js → id-ID-SAP4L64H-BwQGGLKg.js} +1 -1
  100. package/viewer/assets/{image-0vZMjp0Z.js → image-Dh0u7Y4X.js} +2 -2
  101. package/viewer/assets/image-GAAHSSAO-Bwjd-iIt.js +1 -0
  102. package/viewer/assets/{info-J43DQDTF-ECAOGDME.js → info-J43DQDTF-E7o0QiTK.js} +1 -1
  103. package/viewer/assets/{infoDiagram-5YYISTIA-C0vYc3h2.js → infoDiagram-5YYISTIA-DAS5lDYe.js} +1 -1
  104. package/viewer/assets/{ishikawaDiagram-YF4QCWOH-CG_Ph_lH.js → ishikawaDiagram-YF4QCWOH-BmQKRt9o.js} +1 -1
  105. package/viewer/assets/{it-IT-JPQ66NNP-CU1apqHk.js → it-IT-JPQ66NNP-B8z-5nF9.js} +1 -1
  106. package/viewer/assets/{ja-JP-DBVTYXUO-B39Q-cJE.js → ja-JP-DBVTYXUO-l_v70Hxd.js} +1 -1
  107. package/viewer/assets/{journeyDiagram-JHISSGLW-Bls8b6p5.js → journeyDiagram-JHISSGLW-fYNPiKeD.js} +1 -1
  108. package/viewer/assets/{jszip.min-CoyCHGS6.js → jszip.min-DRj_sfDb.js} +1 -1
  109. package/viewer/assets/{kaa-6HZHGXH3-DNr0Hbws.js → kaa-6HZHGXH3-BLR3dPbe.js} +1 -1
  110. package/viewer/assets/{kab-KAB-ZGHBKWFO-DUqxtUd5.js → kab-KAB-ZGHBKWFO-mpC7RdPF.js} +1 -1
  111. package/viewer/assets/{kanban-definition-UN3LZRKU-D7NWNdGb.js → kanban-definition-UN3LZRKU-DoH0A4N_.js} +1 -1
  112. package/viewer/assets/{kk-KZ-P5N5QNE5-oAQRY--4.js → kk-KZ-P5N5QNE5-CUrIpqDm.js} +1 -1
  113. package/viewer/assets/{km-KH-HSX4SM5Z-aIsalLJg.js → km-KH-HSX4SM5Z-BFFisFt-.js} +1 -1
  114. package/viewer/assets/{ko-KR-MTYHY66A-Dxxq4OHv.js → ko-KR-MTYHY66A-B0ugAj2Q.js} +1 -1
  115. package/viewer/assets/{ku-TR-6OUDTVRD-cGosJj47.js → ku-TR-6OUDTVRD-wel_K1om.js} +1 -1
  116. package/viewer/assets/{lib-DVPOsS0g.js → lib-CMUL44Cx.js} +1 -1
  117. package/viewer/assets/{lt-LT-XHIRWOB4-BrbcDiBa.js → lt-LT-XHIRWOB4-B2tSNKsB.js} +1 -1
  118. package/viewer/assets/{lv-LV-5QDEKY6T-BJB3sRF-.js → lv-LV-5QDEKY6T-C1h5AGbC.js} +1 -1
  119. package/viewer/assets/{main-BmxokhSj.js → main-C4AGnt2Q.js} +1 -1
  120. package/viewer/assets/{md-GXqo3xMM.js → md-NQ108YdD.js} +2 -2
  121. package/viewer/assets/{mermaid-parser.core-919mtcVP.js → mermaid-parser.core-CYYXW64c.js} +2 -2
  122. package/viewer/assets/{mindmap-definition-RKZ34NQL-jpsqOaHj.js → mindmap-definition-RKZ34NQL-Cy7__Nsg.js} +1 -1
  123. package/viewer/assets/{model-DNiDRYMH.js → model-C_NcDjBv.js} +2 -2
  124. package/viewer/assets/{mr-IN-CRQNXWMA-DYl82JZe.js → mr-IN-CRQNXWMA-Z0HZgwHA.js} +1 -1
  125. package/viewer/assets/{my-MM-5M5IBNSE-CdnDB-54.js → my-MM-5M5IBNSE-CaUD4d0k.js} +1 -1
  126. package/viewer/assets/{nb-NO-T6EIAALU-T-ly9gG2.js → nb-NO-T6EIAALU-XJxe52fB.js} +1 -1
  127. package/viewer/assets/{nestedRender-BAYFA7cb.js → nestedRender-CmOO-RsN.js} +3 -3
  128. package/viewer/assets/{nl-NL-IS3SIHDZ-CZqPZnHj.js → nl-NL-IS3SIHDZ-D27HZd7H.js} +1 -1
  129. package/viewer/assets/{nn-NO-6E72VCQL-CvMupQbc.js → nn-NO-6E72VCQL-BLxm3A8-.js} +1 -1
  130. package/viewer/assets/{oc-FR-POXYY2M6-BRlPd_BR.js → oc-FR-POXYY2M6-LR8bPn4N.js} +1 -1
  131. package/viewer/assets/{ofd-roCNaEHA.js → ofd-B3Svbpw-.js} +1 -1
  132. package/viewer/assets/{ofd-BJzyd_Eq.js → ofd-Cg5wG4Wd.js} +2 -2
  133. package/viewer/assets/{pa-IN-N4M65BXN-BfVUAlRi.js → pa-IN-N4M65BXN-CYdFmoV0.js} +1 -1
  134. package/viewer/assets/{package-Bop5TfAT.js → package-CykH2Y1v.js} +2 -2
  135. package/viewer/assets/{packet-YPE3B663-BLIVl-jG.js → packet-YPE3B663-D_NADg35.js} +1 -1
  136. package/viewer/assets/{pdf-CDtYB0WY.js → pdf-8WqUNSMi.js} +2 -2
  137. package/viewer/assets/percentages-BXMCSKIN-Ci_Exl4Q.js +1 -0
  138. package/viewer/assets/{pica-Dfy4NaK_.js → pica-yzoh_AWA.js} +1 -1
  139. package/viewer/assets/{pie-LRSECV5Y-DcYPzp1c.js → pie-LRSECV5Y-M88xBHjg.js} +1 -1
  140. package/viewer/assets/{pieDiagram-4H26LBE5-CMzoHPw-.js → pieDiagram-4H26LBE5-COTBWyRX.js} +1 -1
  141. package/viewer/assets/{pl-PL-T2D74RX3-CXvOHlyd.js → pl-PL-T2D74RX3-Doqck8dA.js} +1 -1
  142. package/viewer/assets/{pptx-CI2NrkhY.js → pptx-eMO7Ols-.js} +2 -2
  143. package/viewer/assets/{prod-B0HxyDM0.js → prod-CN44joQ1.js} +6 -6
  144. package/viewer/assets/{pt-BR-5N22H2LF-CAHMJIN0.js → pt-BR-5N22H2LF-CsKHA8If.js} +1 -1
  145. package/viewer/assets/{pt-PT-UZXXM6DQ-9stw3O1j.js → pt-PT-UZXXM6DQ-B7JNfKKr.js} +1 -1
  146. package/viewer/assets/{quadrantDiagram-W4KKPZXB-BS8uQ6E6.js → quadrantDiagram-W4KKPZXB-C1l_QsjJ.js} +1 -1
  147. package/viewer/assets/{radar-GUYGQ44K-Bqokr2eR.js → radar-GUYGQ44K-CnJe616e.js} +1 -1
  148. package/viewer/assets/renderer-CoE6m0-R.js +1 -0
  149. package/viewer/assets/{requirementDiagram-4Y6WPE33-pyX-Egau.js → requirementDiagram-4Y6WPE33-DTRSWSlu.js} +1 -1
  150. package/viewer/assets/{ro-RO-JPDTUUEW-_Ym6U2of.js → ro-RO-JPDTUUEW-DC6XZZcW.js} +1 -1
  151. package/viewer/assets/{rough.esm-DjrMDdlL.js → rough.esm-svAaowEF.js} +1 -1
  152. package/viewer/assets/{ru-RU-B4JR7IUQ-DWUO9__j.js → ru-RU-B4JR7IUQ-CmDtpYxp.js} +1 -1
  153. package/viewer/assets/{sankeyDiagram-5OEKKPKP-BIl0S1dQ.js → sankeyDiagram-5OEKKPKP-BtefGBSW.js} +1 -1
  154. package/viewer/assets/{sequenceDiagram-3UESZ5HK-EhMFCxNn.js → sequenceDiagram-3UESZ5HK-CTe7knxV.js} +1 -1
  155. package/viewer/assets/{si-LK-N5RQ5JYF-DOuaKjIP.js → si-LK-N5RQ5JYF-B5CINft7.js} +1 -1
  156. package/viewer/assets/{sk-SK-C5VTKIMK-D04wnRn8.js → sk-SK-C5VTKIMK-Bi81XvTL.js} +1 -1
  157. package/viewer/assets/{sl-SI-NN7IZMDC-DlSoyI38.js → sl-SI-NN7IZMDC-D8ROoVv3.js} +1 -1
  158. package/viewer/assets/{src-CmLfrMFg.js → src-Dphh0QTK.js} +1 -1
  159. package/viewer/assets/{stateDiagram-AJRCARHV-CBylKBpj.js → stateDiagram-AJRCARHV-NX5oY0W5.js} +1 -1
  160. package/viewer/assets/stateDiagram-v2-BHNVJYJU-D5m-Zx8u.js +1 -0
  161. package/viewer/assets/subset-shared.chunk-6PC5HXUZ.js +1 -0
  162. package/viewer/assets/{subset-worker.chunk-CXi44O4x.js → subset-worker.chunk-BPqA_yn_.js} +1 -1
  163. package/viewer/assets/{sv-SE-XGPEYMSR-y8nUmsTq.js → sv-SE-XGPEYMSR-DLlz6Jon.js} +1 -1
  164. package/viewer/assets/{ta-IN-2NMHFXQM-BTlY1MOo.js → ta-IN-2NMHFXQM-TGPzaQJc.js} +1 -1
  165. package/viewer/assets/{text-BTWcQTKM.js → text-CqI8IQeR.js} +2 -2
  166. package/viewer/assets/{th-TH-HPSO5L25-B0-Jm0dR.js → th-TH-HPSO5L25-BReRyzwS.js} +1 -1
  167. package/viewer/assets/{timeline-definition-PNZ67QCA-BrR0Lwj6.js → timeline-definition-PNZ67QCA-CX3iZTVi.js} +1 -1
  168. package/viewer/assets/{tr-TR-DEFEU3FU-CuiTnA8n.js → tr-TR-DEFEU3FU-CEyJ4P5k.js} +1 -1
  169. package/viewer/assets/{treeView-BLDUP644-B3NDovtS.js → treeView-BLDUP644-ZFFTCRbS.js} +1 -1
  170. package/viewer/assets/{treemap-LRROVOQU-CNBN28UV.js → treemap-LRROVOQU-DZj91ZHX.js} +1 -1
  171. package/viewer/assets/{typst-BlzZcMe5.js → typst-Dm_gO0kQ.js} +2 -2
  172. package/viewer/assets/{uk-UA-QMV73CPH-za143PJQ.js → uk-UA-QMV73CPH-C-i8uzJn.js} +1 -1
  173. package/viewer/assets/{umd-CaNdxjcL.js → umd-8CYCKt7Q.js} +2 -2
  174. package/viewer/assets/{vennDiagram-CIIHVFJN-BkqtdITb.js → vennDiagram-CIIHVFJN-CeK9u7mG.js} +1 -1
  175. package/viewer/assets/{vi-VN-M7AON7JQ-BkwUlhW4.js → vi-VN-M7AON7JQ-BkrdvRL4.js} +1 -1
  176. package/viewer/assets/{wardley-L42UT6IY-B82Hng0D.js → wardley-L42UT6IY-O3XhHMtH.js} +1 -1
  177. package/viewer/assets/{wardleyDiagram-YWT4CUSO-d1SlYFch.js → wardleyDiagram-YWT4CUSO-C9JP8sFv.js} +1 -1
  178. package/viewer/assets/{word-CbznmAOT.js → word-DjZhCKgE.js} +2 -2
  179. package/viewer/assets/{xlsx-B70Tzp_0.js → xlsx-B8FHPOo9.js} +2 -2
  180. package/viewer/assets/{xychartDiagram-2RQKCTM6-AETQ-2hJ.js → xychartDiagram-2RQKCTM6-VR6KMEMT.js} +1 -1
  181. package/viewer/assets/{zh-CN-LNUGB5OW-CLMN5wFH.js → zh-CN-LNUGB5OW-Bptre2EX.js} +1 -1
  182. package/viewer/assets/{zh-HK-E62DVLB3-BQAhIarC.js → zh-HK-E62DVLB3-BlKHI9Gv.js} +1 -1
  183. package/viewer/assets/{zh-TW-RAJ6MFWO-D3o6FRFS.js → zh-TW-RAJ6MFWO-DlDxzUxo.js} +1 -1
  184. package/viewer/compare.html +2 -2
  185. package/viewer/flyfish-viewer-manifest.json +1 -1
  186. package/viewer/index.html +3 -3
  187. package/viewer/assets/__vite-browser-external-BZdVR8v7.js +0 -1
  188. package/viewer/assets/architecture-7EHR7CIX-sRujR5WN.js +0 -1
  189. package/viewer/assets/cad-B78pKw7N.js +0 -2
  190. package/viewer/assets/channel-Dz5mnghj.js +0 -1
  191. package/viewer/assets/chunk-QZHKN3VN-DmWvf513.js +0 -1
  192. package/viewer/assets/classDiagram-4FO5ZUOK-B-NZYxkE.js +0 -1
  193. package/viewer/assets/classDiagram-v2-Q7XG4LA2-B-NZYxkE.js +0 -1
  194. package/viewer/assets/email-ZYgs8alH.js +0 -2
  195. package/viewer/assets/eventmodeling-FCH6USID-BtBKHIsk.js +0 -1
  196. package/viewer/assets/image-GAAHSSAO-Di-5eHoS.js +0 -1
  197. package/viewer/assets/percentages-BXMCSKIN-C5NgCvxl.js +0 -1
  198. package/viewer/assets/renderer-BMLnfeSl.js +0 -1
  199. package/viewer/assets/stateDiagram-v2-BHNVJYJU-f7X6eKbo.js +0 -1
  200. package/viewer/assets/subset-shared.chunk-WzaeClRm.js +0 -1
@@ -1,4 +1,4 @@
1
- import{A as e,D as t,M as n,k as r}from"./package-Bop5TfAT.js";var i=t(((e,t)=>{var n=void 0;t.exports=function(e){return e!==n&&e!==null}})),a=t(((e,t)=>{var n=i(),r={object:!0,function:!0,undefined:!0};t.exports=function(e){return n(e)?hasOwnProperty.call(r,typeof e):!1}})),o=t(((e,t)=>{var n=a();t.exports=function(e){if(!n(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch{return!1}}})),s=t(((e,t)=>{var n=o();t.exports=function(e){if(typeof e!=`function`||!hasOwnProperty.call(e,`length`))return!1;try{if(typeof e.length!=`number`||typeof e.call!=`function`||typeof e.apply!=`function`)return!1}catch{return!1}return!n(e)}})),c=t(((e,t)=>{var n=s(),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!n(e)||r.test(i.call(e)))}})),l=t(((e,t)=>{t.exports=function(){var e=Object.assign,t;return typeof e==`function`?(t={foo:`raz`},e(t,{bar:`dwa`},{trzy:`trzy`}),t.foo+t.bar+t.trzy===`razdwatrzy`):!1}})),u=t(((e,t)=>{t.exports=function(){try{return!0}catch{return!1}}})),d=t(((e,t)=>{t.exports=function(){}})),f=t(((e,t)=>{var n=d()();t.exports=function(e){return e!==n&&e!==null}})),p=t(((e,t)=>{var n=f(),r=Object.keys;t.exports=function(e){return r(n(e)?Object(e):e)}})),m=t(((e,t)=>{t.exports=u()()?Object.keys:p()})),h=t(((e,t)=>{var n=f();t.exports=function(e){if(!n(e))throw TypeError(`Cannot use null or undefined`);return e}})),g=t(((e,t)=>{var n=m(),r=h(),i=Math.max;t.exports=function(e,t){var a,o,s=i(arguments.length,2),c;for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(e){a||=e}},o=1;o<s;++o)t=arguments[o],n(t).forEach(c);if(a!==void 0)throw a;return e}})),_=t(((e,t)=>{t.exports=l()()?Object.assign:g()})),v=t(((e,t)=>{var n=f(),r=Array.prototype.forEach,i=Object.create,a=function(e,t){for(var n in e)t[n]=e[n]};t.exports=function(e){var t=i(null);return r.call(arguments,function(e){n(e)&&a(Object(e),t)}),t}})),y=t(((e,t)=>{var n=`razdwatrzy`;t.exports=function(){return typeof n.contains==`function`?n.contains(`dwa`)===!0&&n.contains(`foo`)===!1:!1}})),b=t(((e,t)=>{var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}})),x=t(((e,t)=>{t.exports=y()()?String.prototype.contains:b()})),S=t(((e,t)=>{var n=i(),r=c(),a=_(),o=v(),s=x(),l=t.exports=function(e,t){var r,i,c,l,u;return arguments.length<2||typeof e!=`string`?(l=t,t=e,e=null):l=arguments[2],n(e)?(r=s.call(e,`c`),i=s.call(e,`e`),c=s.call(e,`w`)):(r=c=!0,i=!1),u={value:t,configurable:r,enumerable:i,writable:c},l?a(o(l),u):u};l.gs=function(e,t,i){var c,l,u,d;return typeof e==`string`?u=arguments[3]:(u=i,i=t,t=e,e=null),n(t)?r(t)?n(i)?r(i)||(u=i,i=void 0):i=void 0:(u=t,t=i=void 0):t=void 0,n(e)?(c=s.call(e,`c`),l=s.call(e,`e`)):(c=!0,l=!1),d={get:t,set:i,configurable:c,enumerable:l},u?a(o(u),d):d}})),C=t(((e,t)=>{t.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function`);return e}})),w=t(((e,t)=>{var n=S(),r=C(),i=Function.prototype.apply,a=Function.prototype.call,o=Object.create,s=Object.defineProperty,c=Object.defineProperties,l=Object.prototype.hasOwnProperty,u={configurable:!0,enumerable:!1,writable:!0},d=function(e,t){var n;return r(t),l.call(this,`__ee__`)?n=this.__ee__:(n=u.value=o(null),s(this,`__ee__`,u),u.value=null),n[e]?typeof n[e]==`object`?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},f=function(e,t){var n,a;return r(t),a=this,d.call(this,e,n=function(){p.call(a,e,n),i.call(t,this,arguments)}),n.__eeOnceListener__=t,this},p=function(e,t){var n,i,a,o;if(r(t),!l.call(this,`__ee__`)||(n=this.__ee__,!n[e]))return this;if(i=n[e],typeof i==`object`)for(o=0;a=i[o];++o)(a===t||a.__eeOnceListener__===t)&&(i.length===2?n[e]=i[+!o]:i.splice(o,1));else (i===t||i.__eeOnceListener__===t)&&delete n[e];return this},m=function(e){var t,n,r,o,s;if(l.call(this,`__ee__`)&&(o=this.__ee__[e],o))if(typeof o==`object`){for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)i.call(r,this,s)}else switch(arguments.length){case 1:a.call(o,this);break;case 2:a.call(o,this,arguments[1]);break;case 3:a.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];i.call(o,this,s)}},h={on:d,once:f,off:p,emit:m},g={on:n(d),once:n(f),off:n(p),emit:n(m)},_=c({},g);t.exports=e=function(e){return e==null?o(_):c(Object(e),g)},e.methods=h})),T=t((e=>{function t(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}var n=t({HTML:`text/html`,isHTML:function(e){return e===n.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),r=t({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===r.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.freeze=t,e.MIME_TYPE=n,e.NAMESPACE=r})),E=t((e=>{var t=T().NAMESPACE;function n(e){return e!==``}function r(e){return e?e.split(/[\t\n\f\r ]+/).filter(n):[]}function i(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function a(e){if(!e)return[];var t=r(e);return Object.keys(t.reduce(i,{}))}function o(e){return function(t){return e&&e.indexOf(t)!==-1}}function s(e,t){for(var n in e)t[n]=e[n]}function c(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,s(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var l={},u=l.ELEMENT_NODE=1,d=l.ATTRIBUTE_NODE=2,f=l.TEXT_NODE=3,p=l.CDATA_SECTION_NODE=4,m=l.ENTITY_REFERENCE_NODE=5,h=l.ENTITY_NODE=6,g=l.PROCESSING_INSTRUCTION_NODE=7,_=l.COMMENT_NODE=8,v=l.DOCUMENT_NODE=9,y=l.DOCUMENT_TYPE_NODE=10,b=l.DOCUMENT_FRAGMENT_NODE=11,x=l.NOTATION_NODE=12,S={},C={};S.INDEX_SIZE_ERR=(C[1]=`Index size error`,1),S.DOMSTRING_SIZE_ERR=(C[2]=`DOMString size error`,2);var w=S.HIERARCHY_REQUEST_ERR=(C[3]=`Hierarchy request error`,3);S.WRONG_DOCUMENT_ERR=(C[4]=`Wrong document`,4),S.INVALID_CHARACTER_ERR=(C[5]=`Invalid character`,5),S.NO_DATA_ALLOWED_ERR=(C[6]=`No data allowed`,6),S.NO_MODIFICATION_ALLOWED_ERR=(C[7]=`No modification allowed`,7);var E=S.NOT_FOUND_ERR=(C[8]=`Not found`,8);S.NOT_SUPPORTED_ERR=(C[9]=`Not supported`,9);var D=S.INUSE_ATTRIBUTE_ERR=(C[10]=`Attribute in use`,10);S.INVALID_STATE_ERR=(C[11]=`Invalid state`,11),S.SYNTAX_ERR=(C[12]=`Syntax error`,12),S.INVALID_MODIFICATION_ERR=(C[13]=`Invalid modification`,13),S.NAMESPACE_ERR=(C[14]=`Invalid namespace`,14),S.INVALID_ACCESS_ERR=(C[15]=`Invalid access`,15);function O(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=e,t&&(this.message=this.message+`: `+t),n}O.prototype=Error.prototype,s(S,O);function k(){}k.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)K(this[r],n,e,t);return n.join(``)}};function A(e,t){this._node=e,this._refresh=t,j(this)}function j(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);_e(e,`length`,n.length),s(n,e),e._inc=t}}A.prototype.item=function(e){return j(this),this[e]},c(A,k);function M(){}function ee(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function N(e,t,n,r){if(r?t[ee(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&ae(i,e,r),I(i,e,n))}}function P(e,t,n){var r=ee(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(ae(a,e,n),n.ownerElement=null)}}else throw O(E,Error(e.tagName+`@`+n))}M.prototype={length:0,item:k.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new O(D);var n=this.getNamedItem(e.nodeName);return N(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new O(D);return n=this.getNamedItemNS(e.namespaceURI,e.localName),N(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return P(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return P(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function te(){}te.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new ie;if(r.implementation=this,r.childNodes=new k,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new me;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function F(){}F.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return L(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return se(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return J(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==f&&e.nodeType==f?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(n[r]==e)return r}t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function ne(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}s(l,F),s(l,F.prototype);function re(e,t){if(t(e))return!0;if(e=e.firstChild)do if(re(e,t))return!0;while(e=e.nextSibling)}function ie(){}function I(e,n,r){e&&e._inc++,r.namespaceURI===t.XMLNS&&(n._nsMap[r.prefix?r.localName:``]=r.value)}function ae(e,n,r,i){e&&e._inc++,r.namespaceURI===t.XMLNS&&delete n._nsMap[r.prefix?r.localName:``]}function oe(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a}}}function se(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,oe(e.ownerDocument,e),t}function L(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===b){var i=t.firstChild;if(i==null)return t;var a=t.lastChild}else i=a=t;var o=n?n.previousSibling:e.lastChild;i.previousSibling=o,a.nextSibling=n,o?o.nextSibling=i:e.firstChild=i,n==null?e.lastChild=a:n.previousSibling=a;do i.parentNode=e;while(i!==a&&(i=i.nextSibling));return oe(e.ownerDocument||e,e),t.nodeType==b&&(t.firstChild=t.lastChild=null),t}function ce(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,oe(e.ownerDocument,e,t),t}ie.prototype={nodeName:`#document`,nodeType:v,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==b){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return this.documentElement==null&&e.nodeType==u&&(this.documentElement=e),L(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),se(this,e)},importNode:function(e,t){return q(this,e,t)},getElementById:function(e){var t=null;return re(this.documentElement,function(n){if(n.nodeType==u&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=a(e);return new A(this,function(n){var r=[];return t.length>0&&re(n.documentElement,function(i){if(i!==n&&i.nodeType===u){var s=i.getAttribute(`class`);if(s){var c=e===s;if(!c){var l=a(s);c=t.every(o(l))}c&&r.push(i)}}}),r})},createElement:function(e){var t=new le;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new k;var n=t.attributes=new M;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new he;return e.ownerDocument=this,e.childNodes=new k,e},createTextNode:function(e){var t=new fe;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new R;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new pe;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ge;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ue;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new V;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new le,r=t.split(`:`),i=n.attributes=new M;return n.childNodes=new k,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ue,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},c(ie,F);function le(){this._nsMap={}}le.prototype={nodeType:u,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===b?this.insertBefore(e,null):ce(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new A(this,function(t){var n=[];return re(t,function(r){r!==t&&r.nodeType==u&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new A(this,function(n){var r=[];return re(n,function(i){i!==n&&i.nodeType===u&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},ie.prototype.getElementsByTagName=le.prototype.getElementsByTagName,ie.prototype.getElementsByTagNameNS=le.prototype.getElementsByTagNameNS,c(le,F);function ue(){}ue.prototype.nodeType=d,c(ue,F);function de(){}de.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(C[w])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},c(de,F);function fe(){}fe.prototype={nodeName:`#text`,nodeType:f,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},c(fe,de);function R(){}R.prototype={nodeName:`#comment`,nodeType:_},c(R,de);function pe(){}pe.prototype={nodeName:`#cdata-section`,nodeType:p},c(pe,de);function me(){}me.prototype.nodeType=y,c(me,F);function z(){}z.prototype.nodeType=x,c(z,F);function B(){}B.prototype.nodeType=h,c(B,F);function V(){}V.prototype.nodeType=m,c(V,F);function he(){}he.prototype.nodeName=`#document-fragment`,he.prototype.nodeType=b,c(he,F);function ge(){}ge.prototype.nodeType=g,c(ge,F);function H(){}H.prototype.serializeToString=function(e,t,n){return U.call(e,t,n)},F.prototype.toString=U;function U(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return K(this,n,e,t,o),n.join(``)}function W(e,n,r){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===t.XML||a===t.XMLNS)return!1;for(var o=r.length;o--;){var s=r[o];if(s.prefix===i)return s.namespace!==a}return!0}function G(e,t,n){e.push(` `,t,`="`,n.replace(/[<&"]/g,ne),`"`)}function K(e,n,r,i,a){if(a||=[],i)if(e=i(e),e){if(typeof e==`string`){n.push(e);return}}else return;switch(e.nodeType){case u:var o=e.attributes,s=o.length,c=e.firstChild,l=e.tagName;r=t.isHTML(e.namespaceURI)||r;var h=l;if(!r&&!e.prefix&&e.namespaceURI){for(var x,S=0;S<o.length;S++)if(o.item(S).name===`xmlns`){x=o.item(S).value;break}if(!x)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.prefix===``&&w.namespace===e.namespaceURI){x=w.namespace;break}}if(x!==e.namespaceURI)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.namespace===e.namespaceURI){w.prefix&&(h=w.prefix+`:`+l);break}}}n.push(`<`,h);for(var T=0;T<s;T++){var E=o.item(T);E.prefix==`xmlns`?a.push({prefix:E.localName,namespace:E.value}):E.nodeName==`xmlns`&&a.push({prefix:``,namespace:E.value})}for(var T=0;T<s;T++){var E=o.item(T);if(W(E,r,a)){var D=E.prefix||``,O=E.namespaceURI;G(n,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}K(E,n,r,i,a)}if(l===h&&W(e,r,a)){var D=e.prefix||``,O=e.namespaceURI;G(n,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}if(c||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(n.push(`>`),r&&/^script$/i.test(l))for(;c;)c.data?n.push(c.data):K(c,n,r,i,a.slice()),c=c.nextSibling;else for(;c;)K(c,n,r,i,a.slice()),c=c.nextSibling;n.push(`</`,h,`>`)}else n.push(`/>`);return;case v:case b:for(var c=e.firstChild;c;)K(c,n,r,i,a.slice()),c=c.nextSibling;return;case d:return G(n,e.name,e.value);case f:return n.push(e.data.replace(/[<&]/g,ne).replace(/]]>/g,`]]&gt;`));case p:return n.push(`<![CDATA[`,e.data,`]]>`);case _:return n.push(`<!--`,e.data,`-->`);case y:var k=e.publicId,A=e.systemId;if(n.push(`<!DOCTYPE `,e.name),k)n.push(` PUBLIC `,k),A&&A!=`.`&&n.push(` `,A),n.push(`>`);else if(A&&A!=`.`)n.push(` SYSTEM `,A,`>`);else{var j=e.internalSubset;j&&n.push(` [`,j,`]`),n.push(`>`)}return;case g:return n.push(`<?`,e.target,` `,e.data,`?>`);case m:return n.push(`&`,e.nodeName,`;`);default:n.push(`??`,e.nodeName)}}function q(e,t,n){var r;switch(t.nodeType){case u:r=t.cloneNode(!1),r.ownerDocument=e;case b:break;case d:n=!0;break}if(r||=t.cloneNode(!1),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(q(e,i,n)),i=i.nextSibling;return r}function J(e,t,n){var r=new t.constructor;for(var i in t){var a=t[i];typeof a!=`object`&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new k),r.ownerDocument=e,r.nodeType){case u:var o=t.attributes,s=r.attributes=new M,c=o.length;s._ownerElement=r;for(var l=0;l<c;l++)r.setAttributeNode(J(e,o.item(l),!0));break;case d:n=!0}if(n)for(var f=t.firstChild;f;)r.appendChild(J(e,f,n)),f=f.nextSibling;return r}function _e(e,t,n){e[t]=n}try{if(Object.defineProperty){Object.defineProperty(A.prototype,"length",{get:function(){return j(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case u:case b:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}});function e(t){switch(t.nodeType){case u:case b:var n=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&n.push(e(t)),t=t.nextSibling;return n.join(``);default:return t.nodeValue}}_e=function(e,t,n){e[`$$`+t]=n}}}catch{}e.DocumentType=me,e.DOMException=O,e.DOMImplementation=te,e.Element=le,e.Node=F,e.NodeList=k,e.XMLSerializer=H})),D=t((e=>{var t=T().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({lt:`<`,gt:`>`,amp:`&`,quot:`"`,apos:`'`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,times:`×`,divide:`÷`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,euro:`€`,trade:`™`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}),e.entityMap=e.HTML_ENTITIES})),O=t((e=>{var t=T().NAMESPACE,n=/[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]/,r=RegExp(`[\\-\\.0-9`+n.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),i=RegExp(`^`+n.source+r.source+`*(?::`+n.source+r.source+`*)?$`),a=0,o=1,s=2,c=3,l=4,u=5,d=6,f=7;function p(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=Error(),p.prototype.name=p.name;function m(){}m.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),x(t,t={}),h(e,t,n,r,this.errorHandler),r.endDocument()}};function h(e,n,r,i,a){function o(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}else return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in r?r[t]:t.charAt(0)===`#`?o(parseInt(t.substr(1).replace(`x`,`0x`))):(a.error(`entity not found:`+e),e)}function c(t){if(t>T){var n=e.substring(T,t).replace(/&#?\w+;/g,s);m&&l(T),i.characters(n,0,t-T),T=t}}function l(t,n){for(;t>=d&&(n=f.exec(e));)u=n.index,d=u+n[0].length,m.lineNumber++;m.columnNumber=t-u+1}for(var u=0,d=0,f=/.*(?:\r\n?|\n)|.*$/g,m=i.locator,h=[{currentNSMap:n}],x={},T=0;;){try{var E=e.indexOf(`<`,T);if(E<0){if(!e.substr(T).match(/^\s*$/)){var D=i.doc,O=D.createTextNode(e.substr(T));D.appendChild(O),i.currentElement=O}return}switch(E>T&&c(E),e.charAt(E+1)){case`/`:var k=e.indexOf(`>`,E+3),A=e.substring(E+2,k).replace(/[ \t\n\r]+$/g,``),j=h.pop();k<0?(A=e.substring(E+2).replace(/[\s<].*/,``),a.error(`end tag name: `+A+` is not complete:`+j.tagName),k=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,``),a.error(`end tag name: `+A+` maybe not complete`),k=E+1+A.length);var M=j.localNSMap,ee=j.tagName==A;if(ee||j.tagName&&j.tagName.toLowerCase()==A.toLowerCase()){if(i.endElement(j.uri,j.localName,A),M)for(var N in M)i.endPrefixMapping(N);ee||a.fatalError(`end tag name: `+A+` is not match the current start tagName:`+j.tagName)}else h.push(j);k++;break;case`?`:m&&l(E),k=C(e,E,i);break;case`!`:m&&l(E),k=S(e,E,i,a);break;default:m&&l(E);var P=new w,te=h[h.length-1].currentNSMap,k=_(e,E,P,te,s,a),F=P.length;if(!P.closed&&b(e,k,P.tagName,x)&&(P.closed=!0,r.nbsp||a.warning(`unclosed xml attribute`)),m&&F){for(var ne=g(m,{}),re=0;re<F;re++){var ie=P[re];l(ie.offset),ie.locator=g(m,{})}i.locator=ne,v(P,i,te)&&h.push(P),i.locator=m}else v(P,i,te)&&h.push(P);t.isHTML(P.uri)&&!P.closed?k=y(e,k,P.tagName,s,i):k++}}catch(e){if(e instanceof p)throw e;a.error(`element parse error: `+e),k=-1}k>T?T=k:c(Math.max(E,T)+1)}}function g(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,n,r,i,p,m){function h(e,t,n){r.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),r.addValue(e,t,n)}for(var g,_,v=++n,y=a;;){var b=e.charAt(v);switch(b){case`=`:if(y===o)g=e.slice(n,v),y=c;else if(y===s)y=c;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===c||y===o)if(y===o&&(m.warning(`attribute value must after "="`),g=e.slice(n,v)),n=v+1,v=e.indexOf(b,n),v>0)_=e.slice(n,v).replace(/&#?\w+;/g,p),h(g,_,n-1),y=u;else throw Error(`attribute value no end '`+b+`' match`);else if(y==l)_=e.slice(n,v).replace(/&#?\w+;/g,p),h(g,_,n),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),n=v+1,y=u;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:y=f,r.closed=!0;case l:case o:case s:break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==a&&r.setTagName(e.slice(n,v)),v;case`>`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:break;case l:case o:_=e.slice(n,v),_.slice(-1)===`/`&&(r.closed=!0,_=_.slice(0,-1));case s:y===s&&(_=g),y==l?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_.replace(/&#?\w+;/g,p),n)):((!t.isHTML(i[``])||!_.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,n));break;case c:throw Error(`attribute value missed!!`)}return v;case`€`:b=` `;default:if(b<=` `)switch(y){case a:r.setTagName(e.slice(n,v)),y=d;break;case o:g=e.slice(n,v),y=s;break;case l:var _=e.slice(n,v).replace(/&#?\w+;/g,p);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,n);case u:y=d;break}else switch(y){case s:r.tagName,(!t.isHTML(i[``])||!g.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,n),n=v,y=o;break;case u:m.warning(`attribute space is required"`+g+`"!!`);case d:y=o,n=v;break;case c:y=l,n=v;break;case f:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function v(e,n,r){for(var i=e.tagName,a=null,o=e.length;o--;){var s=e[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},x(r,r={})),r[p]=a[p]=l,s.uri=t.XMLNS,n.startPrefixMapping(p,l))}for(var o=e.length;o--;){s=e[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=t.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=e.prefix=i.slice(0,u),f=e.localName=i.slice(u+1)):(d=null,f=e.localName=i);var m=e.uri=r[d||``];if(n.startElement(m,f,i,e),e.closed){if(n.endElement(m,f,i),a)for(d in a)n.endPrefixMapping(d)}else return e.currentNSMap=r,e.localNSMap=a,!0}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function b(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function x(e,t){for(var n in e)t[n]=e[n]}function S(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}else return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=E(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function C(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(e){if(!i.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function E(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}e.XMLReader=m,e.ParseError=p})),k=t((e=>{var t=T(),n=E(),r=D(),i=O(),a=n.DOMImplementation,o=t.NAMESPACE,s=i.ParseError,c=i.XMLReader;function l(e){this.options=e||{locator:{}}}l.prototype.parseFromString=function(e,t){var n=this.options,i=new c,a=n.domBuilder||new d,s=n.errorHandler,l=n.locator,f=n.xmlns||{},p=/\/x?html?$/.test(t),m=p?r.HTML_ENTITIES:r.XML_ENTITIES;return l&&a.setDocumentLocator(l),i.errorHandler=u(s,a,l),i.domBuilder=n.domBuilder||a,p&&(f[``]=o.HTML),f.xml=f.xml||o.XML,e&&typeof e==`string`?i.parse(e,f,m):i.errorHandler.error(`invalid doc source`),a.doc};function u(e,t,n){if(!e){if(t instanceof d)return t;e=t}var r={},i=e instanceof Function;n||={};function a(t){var a=e[t];!a&&i&&(a=e.length==2?function(n){e(t,n)}:e),r[t]=a&&function(e){a(`[xmldom `+t+`] `+e+p(n))}||function(){}}return a(`warning`),a(`error`),a(`fatalError`),r}function d(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}d.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;h(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&f(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,n),h(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=m.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&f(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&f(this.locator,r),h(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&f(this.locator,i),h(this,i),this.doc.doctype=i}},warning:function(e){console.warn(`[xmldom warning] `+e,p(this.locator))},error:function(e){console.error(`[xmldom error] `+e,p(this.locator))},fatalError:function(e){throw new s(e,this.locator)}};function p(e){if(e)return`
1
+ import{A as e,D as t,M as n,k as r}from"./package-CykH2Y1v.js";var i=t(((e,t)=>{var n=void 0;t.exports=function(e){return e!==n&&e!==null}})),a=t(((e,t)=>{var n=i(),r={object:!0,function:!0,undefined:!0};t.exports=function(e){return n(e)?hasOwnProperty.call(r,typeof e):!1}})),o=t(((e,t)=>{var n=a();t.exports=function(e){if(!n(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch{return!1}}})),s=t(((e,t)=>{var n=o();t.exports=function(e){if(typeof e!=`function`||!hasOwnProperty.call(e,`length`))return!1;try{if(typeof e.length!=`number`||typeof e.call!=`function`||typeof e.apply!=`function`)return!1}catch{return!1}return!n(e)}})),c=t(((e,t)=>{var n=s(),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!n(e)||r.test(i.call(e)))}})),l=t(((e,t)=>{t.exports=function(){var e=Object.assign,t;return typeof e==`function`?(t={foo:`raz`},e(t,{bar:`dwa`},{trzy:`trzy`}),t.foo+t.bar+t.trzy===`razdwatrzy`):!1}})),u=t(((e,t)=>{t.exports=function(){try{return!0}catch{return!1}}})),d=t(((e,t)=>{t.exports=function(){}})),f=t(((e,t)=>{var n=d()();t.exports=function(e){return e!==n&&e!==null}})),p=t(((e,t)=>{var n=f(),r=Object.keys;t.exports=function(e){return r(n(e)?Object(e):e)}})),m=t(((e,t)=>{t.exports=u()()?Object.keys:p()})),h=t(((e,t)=>{var n=f();t.exports=function(e){if(!n(e))throw TypeError(`Cannot use null or undefined`);return e}})),g=t(((e,t)=>{var n=m(),r=h(),i=Math.max;t.exports=function(e,t){var a,o,s=i(arguments.length,2),c;for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(e){a||=e}},o=1;o<s;++o)t=arguments[o],n(t).forEach(c);if(a!==void 0)throw a;return e}})),_=t(((e,t)=>{t.exports=l()()?Object.assign:g()})),v=t(((e,t)=>{var n=f(),r=Array.prototype.forEach,i=Object.create,a=function(e,t){for(var n in e)t[n]=e[n]};t.exports=function(e){var t=i(null);return r.call(arguments,function(e){n(e)&&a(Object(e),t)}),t}})),y=t(((e,t)=>{var n=`razdwatrzy`;t.exports=function(){return typeof n.contains==`function`?n.contains(`dwa`)===!0&&n.contains(`foo`)===!1:!1}})),b=t(((e,t)=>{var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}})),x=t(((e,t)=>{t.exports=y()()?String.prototype.contains:b()})),S=t(((e,t)=>{var n=i(),r=c(),a=_(),o=v(),s=x(),l=t.exports=function(e,t){var r,i,c,l,u;return arguments.length<2||typeof e!=`string`?(l=t,t=e,e=null):l=arguments[2],n(e)?(r=s.call(e,`c`),i=s.call(e,`e`),c=s.call(e,`w`)):(r=c=!0,i=!1),u={value:t,configurable:r,enumerable:i,writable:c},l?a(o(l),u):u};l.gs=function(e,t,i){var c,l,u,d;return typeof e==`string`?u=arguments[3]:(u=i,i=t,t=e,e=null),n(t)?r(t)?n(i)?r(i)||(u=i,i=void 0):i=void 0:(u=t,t=i=void 0):t=void 0,n(e)?(c=s.call(e,`c`),l=s.call(e,`e`)):(c=!0,l=!1),d={get:t,set:i,configurable:c,enumerable:l},u?a(o(u),d):d}})),C=t(((e,t)=>{t.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function`);return e}})),w=t(((e,t)=>{var n=S(),r=C(),i=Function.prototype.apply,a=Function.prototype.call,o=Object.create,s=Object.defineProperty,c=Object.defineProperties,l=Object.prototype.hasOwnProperty,u={configurable:!0,enumerable:!1,writable:!0},d=function(e,t){var n;return r(t),l.call(this,`__ee__`)?n=this.__ee__:(n=u.value=o(null),s(this,`__ee__`,u),u.value=null),n[e]?typeof n[e]==`object`?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},f=function(e,t){var n,a;return r(t),a=this,d.call(this,e,n=function(){p.call(a,e,n),i.call(t,this,arguments)}),n.__eeOnceListener__=t,this},p=function(e,t){var n,i,a,o;if(r(t),!l.call(this,`__ee__`)||(n=this.__ee__,!n[e]))return this;if(i=n[e],typeof i==`object`)for(o=0;a=i[o];++o)(a===t||a.__eeOnceListener__===t)&&(i.length===2?n[e]=i[+!o]:i.splice(o,1));else (i===t||i.__eeOnceListener__===t)&&delete n[e];return this},m=function(e){var t,n,r,o,s;if(l.call(this,`__ee__`)&&(o=this.__ee__[e],o))if(typeof o==`object`){for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)i.call(r,this,s)}else switch(arguments.length){case 1:a.call(o,this);break;case 2:a.call(o,this,arguments[1]);break;case 3:a.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];i.call(o,this,s)}},h={on:d,once:f,off:p,emit:m},g={on:n(d),once:n(f),off:n(p),emit:n(m)},_=c({},g);t.exports=e=function(e){return e==null?o(_):c(Object(e),g)},e.methods=h})),T=t((e=>{function t(e,t){return t===void 0&&(t=Object),t&&typeof t.freeze==`function`?t.freeze(e):e}var n=t({HTML:`text/html`,isHTML:function(e){return e===n.HTML},XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),r=t({HTML:`http://www.w3.org/1999/xhtml`,isHTML:function(e){return e===r.HTML},SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.freeze=t,e.MIME_TYPE=n,e.NAMESPACE=r})),E=t((e=>{var t=T().NAMESPACE;function n(e){return e!==``}function r(e){return e?e.split(/[\t\n\f\r ]+/).filter(n):[]}function i(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function a(e){if(!e)return[];var t=r(e);return Object.keys(t.reduce(i,{}))}function o(e){return function(t){return e&&e.indexOf(t)!==-1}}function s(e,t){for(var n in e)t[n]=e[n]}function c(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,s(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var l={},u=l.ELEMENT_NODE=1,d=l.ATTRIBUTE_NODE=2,f=l.TEXT_NODE=3,p=l.CDATA_SECTION_NODE=4,m=l.ENTITY_REFERENCE_NODE=5,h=l.ENTITY_NODE=6,g=l.PROCESSING_INSTRUCTION_NODE=7,_=l.COMMENT_NODE=8,v=l.DOCUMENT_NODE=9,y=l.DOCUMENT_TYPE_NODE=10,b=l.DOCUMENT_FRAGMENT_NODE=11,x=l.NOTATION_NODE=12,S={},C={};S.INDEX_SIZE_ERR=(C[1]=`Index size error`,1),S.DOMSTRING_SIZE_ERR=(C[2]=`DOMString size error`,2);var w=S.HIERARCHY_REQUEST_ERR=(C[3]=`Hierarchy request error`,3);S.WRONG_DOCUMENT_ERR=(C[4]=`Wrong document`,4),S.INVALID_CHARACTER_ERR=(C[5]=`Invalid character`,5),S.NO_DATA_ALLOWED_ERR=(C[6]=`No data allowed`,6),S.NO_MODIFICATION_ALLOWED_ERR=(C[7]=`No modification allowed`,7);var E=S.NOT_FOUND_ERR=(C[8]=`Not found`,8);S.NOT_SUPPORTED_ERR=(C[9]=`Not supported`,9);var D=S.INUSE_ATTRIBUTE_ERR=(C[10]=`Attribute in use`,10);S.INVALID_STATE_ERR=(C[11]=`Invalid state`,11),S.SYNTAX_ERR=(C[12]=`Syntax error`,12),S.INVALID_MODIFICATION_ERR=(C[13]=`Invalid modification`,13),S.NAMESPACE_ERR=(C[14]=`Invalid namespace`,14),S.INVALID_ACCESS_ERR=(C[15]=`Invalid access`,15);function O(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=e,t&&(this.message=this.message+`: `+t),n}O.prototype=Error.prototype,s(S,O);function k(){}k.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)K(this[r],n,e,t);return n.join(``)}};function A(e,t){this._node=e,this._refresh=t,j(this)}function j(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);_e(e,`length`,n.length),s(n,e),e._inc=t}}A.prototype.item=function(e){return j(this),this[e]},c(A,k);function M(){}function ee(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function N(e,t,n,r){if(r?t[ee(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&ae(i,e,r),I(i,e,n))}}function P(e,t,n){var r=ee(t,n);if(r>=0){for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(ae(a,e,n),n.ownerElement=null)}}else throw O(E,Error(e.tagName+`@`+n))}M.prototype={length:0,item:k.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new O(D);var n=this.getNamedItem(e.nodeName);return N(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t=e.ownerElement,n;if(t&&t!=this._ownerElement)throw new O(D);return n=this.getNamedItemNS(e.namespaceURI,e.localName),N(this._ownerElement,this,e,n),n},removeNamedItem:function(e){var t=this.getNamedItem(e);return P(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return P(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}};function te(){}te.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new ie;if(r.implementation=this,r.childNodes=new k,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new me;return r.name=e,r.nodeName=e,r.publicId=t||``,r.systemId=n||``,r}};function F(){}F.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return L(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return se(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return J(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==f&&e.nodeType==f?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(n[r]==e)return r}t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}};function ne(e){return e==`<`&&`&lt;`||e==`>`&&`&gt;`||e==`&`&&`&amp;`||e==`"`&&`&quot;`||`&#`+e.charCodeAt()+`;`}s(l,F),s(l,F.prototype);function re(e,t){if(t(e))return!0;if(e=e.firstChild)do if(re(e,t))return!0;while(e=e.nextSibling)}function ie(){}function I(e,n,r){e&&e._inc++,r.namespaceURI===t.XMLNS&&(n._nsMap[r.prefix?r.localName:``]=r.value)}function ae(e,n,r,i){e&&e._inc++,r.namespaceURI===t.XMLNS&&delete n._nsMap[r.prefix?r.localName:``]}function oe(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a}}}function se(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,oe(e.ownerDocument,e),t}function L(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===b){var i=t.firstChild;if(i==null)return t;var a=t.lastChild}else i=a=t;var o=n?n.previousSibling:e.lastChild;i.previousSibling=o,a.nextSibling=n,o?o.nextSibling=i:e.firstChild=i,n==null?e.lastChild=a:n.previousSibling=a;do i.parentNode=e;while(i!==a&&(i=i.nextSibling));return oe(e.ownerDocument||e,e),t.nodeType==b&&(t.firstChild=t.lastChild=null),t}function ce(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,oe(e.ownerDocument,e,t),t}ie.prototype={nodeName:`#document`,nodeType:v,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==b){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return this.documentElement==null&&e.nodeType==u&&(this.documentElement=e),L(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),se(this,e)},importNode:function(e,t){return q(this,e,t)},getElementById:function(e){var t=null;return re(this.documentElement,function(n){if(n.nodeType==u&&n.getAttribute(`id`)==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=a(e);return new A(this,function(n){var r=[];return t.length>0&&re(n.documentElement,function(i){if(i!==n&&i.nodeType===u){var s=i.getAttribute(`class`);if(s){var c=e===s;if(!c){var l=a(s);c=t.every(o(l))}c&&r.push(i)}}}),r})},createElement:function(e){var t=new le;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new k;var n=t.attributes=new M;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new he;return e.ownerDocument=this,e.childNodes=new k,e},createTextNode:function(e){var t=new fe;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new R;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new pe;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ge;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ue;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new V;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new le,r=t.split(`:`),i=n.attributes=new M;return n.childNodes=new k,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ue,r=t.split(`:`);return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},c(ie,F);function le(){this._nsMap={}}le.prototype={nodeType:u,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||``},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=``+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===b?this.insertBefore(e,null):ce(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||``},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=``+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new A(this,function(t){var n=[];return re(t,function(r){r!==t&&r.nodeType==u&&(e===`*`||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new A(this,function(n){var r=[];return re(n,function(i){i!==n&&i.nodeType===u&&(e===`*`||i.namespaceURI===e)&&(t===`*`||i.localName==t)&&r.push(i)}),r})}},ie.prototype.getElementsByTagName=le.prototype.getElementsByTagName,ie.prototype.getElementsByTagNameNS=le.prototype.getElementsByTagNameNS,c(le,F);function ue(){}ue.prototype.nodeType=d,c(ue,F);function de(){}de.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(C[w])},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},c(de,F);function fe(){}fe.prototype={nodeName:`#text`,nodeType:f,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},c(fe,de);function R(){}R.prototype={nodeName:`#comment`,nodeType:_},c(R,de);function pe(){}pe.prototype={nodeName:`#cdata-section`,nodeType:p},c(pe,de);function me(){}me.prototype.nodeType=y,c(me,F);function z(){}z.prototype.nodeType=x,c(z,F);function B(){}B.prototype.nodeType=h,c(B,F);function V(){}V.prototype.nodeType=m,c(V,F);function he(){}he.prototype.nodeName=`#document-fragment`,he.prototype.nodeType=b,c(he,F);function ge(){}ge.prototype.nodeType=g,c(ge,F);function H(){}H.prototype.serializeToString=function(e,t,n){return U.call(e,t,n)},F.prototype.toString=U;function U(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return K(this,n,e,t,o),n.join(``)}function W(e,n,r){var i=e.prefix||``,a=e.namespaceURI;if(!a||i===`xml`&&a===t.XML||a===t.XMLNS)return!1;for(var o=r.length;o--;){var s=r[o];if(s.prefix===i)return s.namespace!==a}return!0}function G(e,t,n){e.push(` `,t,`="`,n.replace(/[<&"]/g,ne),`"`)}function K(e,n,r,i,a){if(a||=[],i)if(e=i(e),e){if(typeof e==`string`){n.push(e);return}}else return;switch(e.nodeType){case u:var o=e.attributes,s=o.length,c=e.firstChild,l=e.tagName;r=t.isHTML(e.namespaceURI)||r;var h=l;if(!r&&!e.prefix&&e.namespaceURI){for(var x,S=0;S<o.length;S++)if(o.item(S).name===`xmlns`){x=o.item(S).value;break}if(!x)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.prefix===``&&w.namespace===e.namespaceURI){x=w.namespace;break}}if(x!==e.namespaceURI)for(var C=a.length-1;C>=0;C--){var w=a[C];if(w.namespace===e.namespaceURI){w.prefix&&(h=w.prefix+`:`+l);break}}}n.push(`<`,h);for(var T=0;T<s;T++){var E=o.item(T);E.prefix==`xmlns`?a.push({prefix:E.localName,namespace:E.value}):E.nodeName==`xmlns`&&a.push({prefix:``,namespace:E.value})}for(var T=0;T<s;T++){var E=o.item(T);if(W(E,r,a)){var D=E.prefix||``,O=E.namespaceURI;G(n,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}K(E,n,r,i,a)}if(l===h&&W(e,r,a)){var D=e.prefix||``,O=e.namespaceURI;G(n,D?`xmlns:`+D:`xmlns`,O),a.push({prefix:D,namespace:O})}if(c||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(n.push(`>`),r&&/^script$/i.test(l))for(;c;)c.data?n.push(c.data):K(c,n,r,i,a.slice()),c=c.nextSibling;else for(;c;)K(c,n,r,i,a.slice()),c=c.nextSibling;n.push(`</`,h,`>`)}else n.push(`/>`);return;case v:case b:for(var c=e.firstChild;c;)K(c,n,r,i,a.slice()),c=c.nextSibling;return;case d:return G(n,e.name,e.value);case f:return n.push(e.data.replace(/[<&]/g,ne).replace(/]]>/g,`]]&gt;`));case p:return n.push(`<![CDATA[`,e.data,`]]>`);case _:return n.push(`<!--`,e.data,`-->`);case y:var k=e.publicId,A=e.systemId;if(n.push(`<!DOCTYPE `,e.name),k)n.push(` PUBLIC `,k),A&&A!=`.`&&n.push(` `,A),n.push(`>`);else if(A&&A!=`.`)n.push(` SYSTEM `,A,`>`);else{var j=e.internalSubset;j&&n.push(` [`,j,`]`),n.push(`>`)}return;case g:return n.push(`<?`,e.target,` `,e.data,`?>`);case m:return n.push(`&`,e.nodeName,`;`);default:n.push(`??`,e.nodeName)}}function q(e,t,n){var r;switch(t.nodeType){case u:r=t.cloneNode(!1),r.ownerDocument=e;case b:break;case d:n=!0;break}if(r||=t.cloneNode(!1),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(q(e,i,n)),i=i.nextSibling;return r}function J(e,t,n){var r=new t.constructor;for(var i in t){var a=t[i];typeof a!=`object`&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new k),r.ownerDocument=e,r.nodeType){case u:var o=t.attributes,s=r.attributes=new M,c=o.length;s._ownerElement=r;for(var l=0;l<c;l++)r.setAttributeNode(J(e,o.item(l),!0));break;case d:n=!0}if(n)for(var f=t.firstChild;f;)r.appendChild(J(e,f,n)),f=f.nextSibling;return r}function _e(e,t,n){e[t]=n}try{if(Object.defineProperty){Object.defineProperty(A.prototype,"length",{get:function(){return j(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case u:case b:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}});function e(t){switch(t.nodeType){case u:case b:var n=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&n.push(e(t)),t=t.nextSibling;return n.join(``);default:return t.nodeValue}}_e=function(e,t,n){e[`$$`+t]=n}}}catch{}e.DocumentType=me,e.DOMException=O,e.DOMImplementation=te,e.Element=le,e.Node=F,e.NodeList=k,e.XMLSerializer=H})),D=t((e=>{var t=T().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({lt:`<`,gt:`>`,amp:`&`,quot:`"`,apos:`'`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,times:`×`,divide:`÷`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,euro:`€`,trade:`™`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}),e.entityMap=e.HTML_ENTITIES})),O=t((e=>{var t=T().NAMESPACE,n=/[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]/,r=RegExp(`[\\-\\.0-9`+n.source.slice(1,-1)+`\\u00B7\\u0300-\\u036F\\u203F-\\u2040]`),i=RegExp(`^`+n.source+r.source+`*(?::`+n.source+r.source+`*)?$`),a=0,o=1,s=2,c=3,l=4,u=5,d=6,f=7;function p(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=Error(),p.prototype.name=p.name;function m(){}m.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),x(t,t={}),h(e,t,n,r,this.errorHandler),r.endDocument()}};function h(e,n,r,i,a){function o(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}else return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in r?r[t]:t.charAt(0)===`#`?o(parseInt(t.substr(1).replace(`x`,`0x`))):(a.error(`entity not found:`+e),e)}function c(t){if(t>T){var n=e.substring(T,t).replace(/&#?\w+;/g,s);m&&l(T),i.characters(n,0,t-T),T=t}}function l(t,n){for(;t>=d&&(n=f.exec(e));)u=n.index,d=u+n[0].length,m.lineNumber++;m.columnNumber=t-u+1}for(var u=0,d=0,f=/.*(?:\r\n?|\n)|.*$/g,m=i.locator,h=[{currentNSMap:n}],x={},T=0;;){try{var E=e.indexOf(`<`,T);if(E<0){if(!e.substr(T).match(/^\s*$/)){var D=i.doc,O=D.createTextNode(e.substr(T));D.appendChild(O),i.currentElement=O}return}switch(E>T&&c(E),e.charAt(E+1)){case`/`:var k=e.indexOf(`>`,E+3),A=e.substring(E+2,k).replace(/[ \t\n\r]+$/g,``),j=h.pop();k<0?(A=e.substring(E+2).replace(/[\s<].*/,``),a.error(`end tag name: `+A+` is not complete:`+j.tagName),k=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,``),a.error(`end tag name: `+A+` maybe not complete`),k=E+1+A.length);var M=j.localNSMap,ee=j.tagName==A;if(ee||j.tagName&&j.tagName.toLowerCase()==A.toLowerCase()){if(i.endElement(j.uri,j.localName,A),M)for(var N in M)i.endPrefixMapping(N);ee||a.fatalError(`end tag name: `+A+` is not match the current start tagName:`+j.tagName)}else h.push(j);k++;break;case`?`:m&&l(E),k=C(e,E,i);break;case`!`:m&&l(E),k=S(e,E,i,a);break;default:m&&l(E);var P=new w,te=h[h.length-1].currentNSMap,k=_(e,E,P,te,s,a),F=P.length;if(!P.closed&&b(e,k,P.tagName,x)&&(P.closed=!0,r.nbsp||a.warning(`unclosed xml attribute`)),m&&F){for(var ne=g(m,{}),re=0;re<F;re++){var ie=P[re];l(ie.offset),ie.locator=g(m,{})}i.locator=ne,v(P,i,te)&&h.push(P),i.locator=m}else v(P,i,te)&&h.push(P);t.isHTML(P.uri)&&!P.closed?k=y(e,k,P.tagName,s,i):k++}}catch(e){if(e instanceof p)throw e;a.error(`element parse error: `+e),k=-1}k>T?T=k:c(Math.max(E,T)+1)}}function g(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,n,r,i,p,m){function h(e,t,n){r.attributeNames.hasOwnProperty(e)&&m.fatalError(`Attribute `+e+` redefined`),r.addValue(e,t,n)}for(var g,_,v=++n,y=a;;){var b=e.charAt(v);switch(b){case`=`:if(y===o)g=e.slice(n,v),y=c;else if(y===s)y=c;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(y===c||y===o)if(y===o&&(m.warning(`attribute value must after "="`),g=e.slice(n,v)),n=v+1,v=e.indexOf(b,n),v>0)_=e.slice(n,v).replace(/&#?\w+;/g,p),h(g,_,n-1),y=u;else throw Error(`attribute value no end '`+b+`' match`);else if(y==l)_=e.slice(n,v).replace(/&#?\w+;/g,p),h(g,_,n),m.warning(`attribute "`+g+`" missed start quot(`+b+`)!!`),n=v+1,y=u;else throw Error(`attribute value must after "="`);break;case`/`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:y=f,r.closed=!0;case l:case o:case s:break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return m.error(`unexpected end of input`),y==a&&r.setTagName(e.slice(n,v)),v;case`>`:switch(y){case a:r.setTagName(e.slice(n,v));case u:case d:case f:break;case l:case o:_=e.slice(n,v),_.slice(-1)===`/`&&(r.closed=!0,_=_.slice(0,-1));case s:y===s&&(_=g),y==l?(m.warning(`attribute "`+_+`" missed quot(")!`),h(g,_.replace(/&#?\w+;/g,p),n)):((!t.isHTML(i[``])||!_.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+_+`" missed value!! "`+_+`" instead!!`),h(_,_,n));break;case c:throw Error(`attribute value missed!!`)}return v;case`€`:b=` `;default:if(b<=` `)switch(y){case a:r.setTagName(e.slice(n,v)),y=d;break;case o:g=e.slice(n,v),y=s;break;case l:var _=e.slice(n,v).replace(/&#?\w+;/g,p);m.warning(`attribute "`+_+`" missed quot(")!!`),h(g,_,n);case u:y=d;break}else switch(y){case s:r.tagName,(!t.isHTML(i[``])||!g.match(/^(?:disabled|checked|selected)$/i))&&m.warning(`attribute "`+g+`" missed value!! "`+g+`" instead2!!`),h(g,g,n),n=v,y=o;break;case u:m.warning(`attribute space is required"`+g+`"!!`);case d:y=o,n=v;break;case c:y=l,n=v;break;case f:throw Error(`elements closed character '/' and '>' must be connected to`)}}v++}}function v(e,n,r){for(var i=e.tagName,a=null,o=e.length;o--;){var s=e[o],c=s.qName,l=s.value,u=c.indexOf(`:`);if(u>0)var d=s.prefix=c.slice(0,u),f=c.slice(u+1),p=d===`xmlns`&&f;else f=c,d=null,p=c===`xmlns`&&``;s.localName=f,p!==!1&&(a??(a={},x(r,r={})),r[p]=a[p]=l,s.uri=t.XMLNS,n.startPrefixMapping(p,l))}for(var o=e.length;o--;){s=e[o];var d=s.prefix;d&&(d===`xml`&&(s.uri=t.XML),d!==`xmlns`&&(s.uri=r[d||``]))}var u=i.indexOf(`:`);u>0?(d=e.prefix=i.slice(0,u),f=e.localName=i.slice(u+1)):(d=null,f=e.localName=i);var m=e.uri=r[d||``];if(n.startElement(m,f,i,e),e.closed){if(n.endElement(m,f,i),a)for(d in a)n.endPrefixMapping(d)}else return e.currentNSMap=r,e.localNSMap=a,!0}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf(`</`+n+`>`,t),o=e.substring(t+1,a);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),a):(o=o.replace(/&#?\w+;/g,r),i.characters(o,0,o.length),a)}return t+1}function b(e,t,n,r){var i=r[n];return i??(i=e.lastIndexOf(`</`+n+`>`),i<t&&(i=e.lastIndexOf(`</`+n)),r[n]=i),i<t}function x(e,t){for(var n in e)t[n]=e[n]}function S(e,t,n,r){switch(e.charAt(t+2)){case`-`:if(e.charAt(t+3)===`-`){var i=e.indexOf(`-->`,t+4);return i>t?(n.comment(e,t+4,i-t-4),i+3):(r.error(`Unclosed comment`),-1)}else return-1;default:if(e.substr(t+3,6)==`CDATA[`){var i=e.indexOf(`]]>`,t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=E(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var s=a[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],l=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var u=a[o-1];return n.startDTD(s,c,l),n.endDTD(),u.index+u[0].length}}return-1}function C(e,t,n){var r=e.indexOf(`?>`,t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(e){if(!i.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function E(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}e.XMLReader=m,e.ParseError=p})),k=t((e=>{var t=T(),n=E(),r=D(),i=O(),a=n.DOMImplementation,o=t.NAMESPACE,s=i.ParseError,c=i.XMLReader;function l(e){this.options=e||{locator:{}}}l.prototype.parseFromString=function(e,t){var n=this.options,i=new c,a=n.domBuilder||new d,s=n.errorHandler,l=n.locator,f=n.xmlns||{},p=/\/x?html?$/.test(t),m=p?r.HTML_ENTITIES:r.XML_ENTITIES;return l&&a.setDocumentLocator(l),i.errorHandler=u(s,a,l),i.domBuilder=n.domBuilder||a,p&&(f[``]=o.HTML),f.xml=f.xml||o.XML,e&&typeof e==`string`?i.parse(e,f,m):i.errorHandler.error(`invalid doc source`),a.doc};function u(e,t,n){if(!e){if(t instanceof d)return t;e=t}var r={},i=e instanceof Function;n||={};function a(t){var a=e[t];!a&&i&&(a=e.length==2?function(n){e(t,n)}:e),r[t]=a&&function(e){a(`[xmldom `+t+`] `+e+p(n))}||function(){}}return a(`warning`),a(`error`),a(`fatalError`),r}function d(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}d.prototype={startDocument:function(){this.doc=new a().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;h(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&f(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,n),h(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=m.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&f(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&f(this.locator,r),h(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&f(this.locator,i),h(this,i),this.doc.doctype=i}},warning:function(e){console.warn(`[xmldom warning] `+e,p(this.locator))},error:function(e){console.error(`[xmldom error] `+e,p(this.locator))},fatalError:function(e){throw new s(e,this.locator)}};function p(e){if(e)return`
2
2
  @`+(e.systemId||``)+`#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function m(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){d.prototype[e]=function(){return null}});function h(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}e.__DOMHandler=d,e.DOMParser=l,e.DOMImplementation=n.DOMImplementation,e.XMLSerializer=n.XMLSerializer})),A=t((e=>{var t=E();e.DOMImplementation=t.DOMImplementation,e.XMLSerializer=t.XMLSerializer,e.DOMParser=k().DOMParser})),j=n(w()),M=r({RangeObject:()=>Te,blob2base64:()=>be,borders:()=>fe,bounds:()=>de,createBase64Url:()=>U,createBlob:()=>he,createBlobUrl:()=>ge,defaults:()=>se,defer:()=>Y,documentHeight:()=>re,extend:()=>L,filterChildren:()=>Ce,findChildren:()=>xe,getParentByTagName:()=>we,indexOfElementNode:()=>B,indexOfNode:()=>me,indexOfSorted:()=>ue,indexOfTextNode:()=>z,insert:()=>ce,isElement:()=>ie,isFloat:()=>ae,isNumber:()=>I,isXml:()=>V,locationOf:()=>le,nodeBounds:()=>R,parents:()=>Se,parse:()=>G,prefixed:()=>oe,qs:()=>K,qsa:()=>q,qsp:()=>J,querySelectorByType:()=>X,requestAnimationFrame:()=>N,revokeBlobUrl:()=>H,sprint:()=>_e,treeWalker:()=>ve,type:()=>W,uuid:()=>ne,walk:()=>ye,windowBounds:()=>pe}),ee=A(),N=typeof window<`u`?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1,P=1,te=3,F=typeof URL<`u`?URL:typeof window<`u`?window.URL||window.webkitURL||window.mozURL:void 0;function ne(){var e=new Date().getTime();return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==`x`?n:n&7|8).toString(16)})}function re(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function ie(e){return!!(e&&e.nodeType==1)}function I(e){return!isNaN(parseFloat(e))&&isFinite(e)}function ae(e){let t=parseFloat(e);return I(e)===!1?!1:typeof e==`string`&&e.indexOf(`.`)>-1?!0:Math.floor(t)!==t}function oe(e){var t=[`Webkit`,`webkit`,`Moz`,`O`,`ms`],n=[`-webkit-`,`-webkit-`,`-moz-`,`-o-`,`-ms-`],r=e.toLowerCase(),i=t.length;if(typeof document>`u`||document.body.style[r]!==void 0)return e;for(var a=0;a<i;a++)if(document.body.style[n[a]+r]!==void 0)return n[a]+r;return e}function se(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)e[i]===void 0&&(e[i]=r[i])}return e}function L(e){return[].slice.call(arguments,1).forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e}function ce(e,t,n){var r=le(e,t,n);return t.splice(r,0,e),r}function le(e,t,n,r,i){var a=r||0,o=i||t.length,s=parseInt(a+(o-a)/2),c;return n||=function(e,t){if(e>t)return 1;if(e<t)return-1;if(e==t)return 0},o-a<=0?s:(c=n(t[s],e),o-a===1?c>=0?s:s+1:c===0?s:c===-1?le(e,t,n,s,o):le(e,t,n,a,s))}function ue(e,t,n,r,i){var a=r||0,o=i||t.length,s=parseInt(a+(o-a)/2),c;return n||=function(e,t){if(e>t)return 1;if(e<t)return-1;if(e==t)return 0},o-a<=0?-1:(c=n(t[s],e),o-a===1?c===0?s:-1:c===0?s:c===-1?ue(e,t,n,s,o):ue(e,t,n,a,s))}function de(e){var t=window.getComputedStyle(e),n=[`width`,`paddingRight`,`paddingLeft`,`marginRight`,`marginLeft`,`borderRightWidth`,`borderLeftWidth`],r=[`height`,`paddingTop`,`paddingBottom`,`marginTop`,`marginBottom`,`borderTopWidth`,`borderBottomWidth`],i=0,a=0;return n.forEach(function(e){i+=parseFloat(t[e])||0}),r.forEach(function(e){a+=parseFloat(t[e])||0}),{height:a,width:i}}function fe(e){var t=window.getComputedStyle(e),n=[`paddingRight`,`paddingLeft`,`marginRight`,`marginLeft`,`borderRightWidth`,`borderLeftWidth`],r=[`paddingTop`,`paddingBottom`,`marginTop`,`marginBottom`,`borderTopWidth`,`borderBottomWidth`],i=0,a=0;return n.forEach(function(e){i+=parseFloat(t[e])||0}),r.forEach(function(e){a+=parseFloat(t[e])||0}),{height:a,width:i}}function R(e){let t,n=e.ownerDocument;if(e.nodeType==Node.TEXT_NODE){let r=n.createRange();r.selectNodeContents(e),t=r.getBoundingClientRect()}else t=e.getBoundingClientRect();return t}function pe(){var e=window.innerWidth,t=window.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function me(e,t){for(var n=e.parentNode.childNodes,r,i=-1,a=0;a<n.length&&(r=n[a],r.nodeType===t&&i++,r!=e);a++);return i}function z(e){return me(e,te)}function B(e){return me(e,P)}function V(e){return[`xml`,`opf`,`ncx`].indexOf(e)>-1}function he(e,t){return new Blob([e],{type:t})}function ge(e,t){var n,r=he(e,t);return n=F.createObjectURL(r),n}function H(e){return F.revokeObjectURL(e)}function U(e,t){var n,r;if(typeof e==`string`)return n=btoa(e),r=`data:`+t+`;base64,`+n,r}function W(e){return Object.prototype.toString.call(e).slice(8,-1)}function G(e,t,n){var r,i=typeof DOMParser>`u`||n?ee.DOMParser:DOMParser;return e.charCodeAt(0)===65279&&(e=e.slice(1)),r=new i().parseFromString(e,t),r}function K(e,t){var n;if(!e)throw Error(`No Element Provided`);if(e.querySelector!==void 0)return e.querySelector(t);if(n=e.getElementsByTagName(t),n.length)return n[0]}function q(e,t){return e.querySelector===void 0?e.getElementsByTagName(t):e.querySelectorAll(t)}function J(e,t,n){var r,i;if(e.querySelector!==void 0){for(var a in t+=`[`,n)t+=a+`~='`+n[a]+`'`;return t+=`]`,e.querySelector(t)}else if(r=e.getElementsByTagName(t),i=Array.prototype.slice.call(r,0).filter(function(e){for(var t in n)if(e.getAttribute(t)===n[t])return!0;return!1}),i)return i[0]}function _e(e,t){(e.ownerDocument||e).createTreeWalker===void 0?ye(e,function(e){e&&e.nodeType===3&&t(e)},!0):ve(e,t,NodeFilter.SHOW_TEXT)}function ve(e,t,n){var r=document.createTreeWalker(e,n,null,!1);let i;for(;i=r.nextNode();)t(i)}function ye(e,t){if(t(e))return!0;if(e=e.firstChild,e)do{if(ye(e,t))return!0;e=e.nextSibling}while(e)}function be(e){return new Promise(function(t,n){var r=new FileReader;r.readAsDataURL(e),r.onloadend=function(){t(r.result)}})}function Y(){this.resolve=null,this.reject=null,this.id=ne(),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),Object.freeze(this)}function X(e,t,n){var r;if(e.querySelector!==void 0&&(r=e.querySelector(`${t}[*|type="${n}"]`)),!r||r.length===0){r=q(e,t);for(var i=0;i<r.length;i++)if(r[i].getAttributeNS(`http://www.idpf.org/2007/ops`,`type`)===n||r[i].getAttribute(`epub:type`)===n)return r[i]}else return r}function xe(e){for(var t=[],n=e.childNodes,r=0;r<n.length;r++){let e=n[r];e.nodeType===1&&t.push(e)}return t}function Se(e){for(var t=[e];e;e=e.parentNode)t.unshift(e);return t}function Ce(e,t,n){for(var r=[],i=e.childNodes,a=0;a<i.length;a++){let e=i[a];if(e.nodeType===1&&e.nodeName.toLowerCase()===t){if(n)return e;r.push(e)}}if(!n)return r}function we(e,t){let n;if(!(e===null||t===``))for(n=e.parentNode;n.nodeType===1;){if(n.tagName.toLowerCase()===t)return n;n=n.parentNode}}var Te=class{constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,t){this.startContainer=e,this.startOffset=t,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,t){this.endContainer=e,this.endOffset=t,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let t=e.parentNode,n=Array.prototype.indexOf.call(t.childNodes,e);this.setStart(t,n),this.setEnd(t,n+1)}selectNodeContents(e){e.childNodes[e.childNodes-1];let t=e.nodeType===3?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,t)}_commonAncestorContainer(e,t){var n=Se(e||this.startContainer),r=Se(t||this.endContainer);if(n[0]==r[0]){for(var i=0;i<n.length;i++)if(n[i]!=r[i])return n[i-1]}}_checkCollapsed(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}toString(){}},Z=n(t(((e,t)=>{if(!n)var n={cwd:function(){return`/`}};function r(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+e)}function i(e,t){for(var n=``,r=-1,i=0,a,o=0;o<=e.length;++o){if(o<e.length)a=e.charCodeAt(o);else if(a===47)break;else a=47;if(a===47){if(!(r===o-1||i===1))if(r!==o-1&&i===2){if(n.length<2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){for(var s=n.length-1,c=s;c>=0&&n.charCodeAt(c)!==47;--c);if(c!==s){n=c===-1?``:n.slice(0,c),r=o,i=0;continue}}else if(n.length===2||n.length===1){n=``,r=o,i=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`)}else n.length>0?n+=`/`+e.slice(r+1,o):n=e.slice(r+1,o);r=o,i=0}else a===46&&i!==-1?++i:i=-1}return n}function a(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var o={resolve:function(){for(var e=``,t=!1,a,o=arguments.length-1;o>=-1&&!t;o--){var s;o>=0?s=arguments[o]:(a===void 0&&(a=n.cwd()),s=a),r(s),s.length!==0&&(e=s+`/`+e,t=s.charCodeAt(0)===47)}return e=i(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(r(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=i(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&n&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return r(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(e===void 0?e=n:e+=`/`+n)}return e===void 0?`.`:o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t||(e=o.resolve(e),t=o.resolve(t),e===t))return``;for(var n=1;n<e.length&&e.charCodeAt(n)===47;++n);for(var i=e.length,a=i-n,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=a<c?a:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else a>l&&(e.charCodeAt(n+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(n+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=n+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),n=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?n?`/`:`.`:n&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);r(e);var n=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){n=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return n===i?i=c:i===-1&&(i=e.length),e.slice(n,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){n=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(n,i)}},extname:function(e){r(e);for(var t=-1,n=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){n=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===n+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`Parameter "pathObject" must be an object, not `+typeof e);return a(`/`,e)},parse:function(e){r(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var n=e.charCodeAt(0),i=n===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(n=e.charCodeAt(u),n===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),n===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,posix:null};t.exports=o}))()),Ee=class{constructor(e){var t=e.indexOf(`://`),n;t>-1&&(e=new URL(e).pathname),n=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=n.dir+`/`,this.filename=n.base,this.extension=n.ext.slice(1)}parse(e){return Z.default.parse(e)}isAbsolute(e){return Z.default.isAbsolute(e||this.path)}isDirectory(e){return e.charAt(e.length-1)===`/`}resolve(e){return Z.default.resolve(this.directory,e)}relative(e){return e&&e.indexOf(`://`)>-1?e:Z.default.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}},De=class{constructor(e,t){var n=e.indexOf(`://`)>-1,r=e,i;if(this.Url=void 0,this.href=e,this.protocol=``,this.origin=``,this.hash=``,this.hash=``,this.search=``,this.base=t,!n&&t!==!1&&typeof t!=`string`&&window&&window.location&&(this.base=window.location.href),n||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,r=this.Url.pathname+(this.Url.search?this.Url.search:``)}catch{this.Url=void 0,this.base&&(i=new Ee(this.base),r=i.resolve(r))}this.Path=new Ee(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t=e.indexOf(`://`)>-1,n;return t?e:(n=Z.default.resolve(this.directory,e),this.origin+n)}relative(e){return Z.default.relative(e,this.directory)}toString(){return this.href}},Oe=1,ke=3,Ae=9,Q=class e{constructor(t,n,r){var i;if(this.str=``,this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof e))return new e(t,n,r);if(typeof n==`string`?this.base=this.parseComponent(n):typeof n==`object`&&n.steps&&(this.base=n),i=this.checkType(t),i===`string`)return this.str=t,L(this,this.parse(t));if(i===`range`)return L(this,this.fromRange(t,this.base,r));if(i===`node`)return L(this,this.fromNode(t,this.base,r));if(i===`EpubCFI`&&t.path)return t;if(t)throw TypeError(`not a valid argument for EpubCFI`);return this}checkType(t){return this.isCfiString(t)?`string`:t&&typeof t==`object`&&(W(t)===`Range`||t.startContainer!==void 0)?`range`:t&&typeof t==`object`&&t.nodeType!==void 0?`node`:t&&typeof t==`object`&&t instanceof e?`EpubCFI`:!1}parse(e){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},n,r,i;return typeof e!=`string`||(e.indexOf(`epubcfi(`)===0&&e[e.length-1]===`)`&&(e=e.slice(8,e.length-1)),n=this.getChapterComponent(e),!n)?{spinePos:-1}:(t.base=this.parseComponent(n),r=this.getPathComponent(e),t.path=this.parseComponent(r),i=this.getRange(e),i&&(t.range=!0,t.start=this.parseComponent(i[0]),t.end=this.parseComponent(i[1])),t.spinePos=t.base.steps[1].index,t)}parseComponent(e){var t={steps:[],terminal:{offset:null,assertion:null}},n=e.split(`:`),r=n[0].split(`/`),i;return n.length>1&&(i=n[1],t.terminal=this.parseTerminal(i)),r[0]===``&&r.shift(),t.steps=r.map(function(e){return this.parseStep(e)}.bind(this)),t}parseStep(e){var t,n,r,i=e.match(/\[(.*)\]/),a;if(i&&i[1]&&(a=i[1]),n=parseInt(e),!isNaN(n))return n%2==0?(t=`element`,r=n/2-1):(t=`text`,r=(n-1)/2),{type:t,index:r,id:a||null}}parseTerminal(e){var t,n,r=e.match(/\[(.*)\]/);return r&&r[1]?(t=parseInt(e.split(`[`)[0]),n=r[1]):t=parseInt(e),I(t)||(t=null),{offset:t,assertion:n}}getChapterComponent(e){return e.split(`!`)[0]}getPathComponent(e){var t=e.split(`!`);if(t[1])return t[1].split(`,`)[0]}getRange(e){var t=e.split(`,`);return t.length===3?[t[1],t[2]]:!1}getCharecterOffsetComponent(e){return e.split(`:`)[1]||``}joinSteps(e){return e?e.map(function(e){var t=``;return e.type===`element`&&(t+=(e.index+1)*2),e.type===`text`&&(t+=1+2*e.index),e.id&&(t+=`[`+e.id+`]`),t}).join(`/`):``}segmentString(e){var t=`/`;return t+=this.joinSteps(e.steps),e.terminal&&e.terminal.offset!=null&&(t+=`:`+e.terminal.offset),e.terminal&&e.terminal.assertion!=null&&(t+=`[`+e.terminal.assertion+`]`),t}toString(){var e=`epubcfi(`;return e+=this.segmentString(this.base),e+=`!`,e+=this.segmentString(this.path),this.range&&this.start&&(e+=`,`,e+=this.segmentString(this.start)),this.range&&this.end&&(e+=`,`,e+=this.segmentString(this.end)),e+=`)`,e}compare(t,n){var r,i,a,o;if(typeof t==`string`&&(t=new e(t)),typeof n==`string`&&(n=new e(n)),t.spinePos>n.spinePos)return 1;if(t.spinePos<n.spinePos)return-1;t.range?(r=t.path.steps.concat(t.start.steps),a=t.start.terminal):(r=t.path.steps,a=t.path.terminal),n.range?(i=n.path.steps.concat(n.start.steps),o=n.start.terminal):(i=n.path.steps,o=n.path.terminal);for(var s=0;s<r.length;s++){if(!r[s])return-1;if(!i[s]||r[s].index>i[s].index)return 1;if(r[s].index<i[s].index)return-1}return r.length<i.length?-1:a.offset>o.offset?1:a.offset<o.offset?-1:0}step(e){var t=e.nodeType===ke?`text`:`element`;return{id:e.id,tagName:e.tagName,type:t,index:this.position(e)}}filteredStep(e,t){var n=this.filter(e,t),r;if(n)return r=n.nodeType===ke?`text`:`element`,{id:n.id,tagName:n.tagName,type:r,index:this.filteredPosition(n,t)}}pathTo(e,t,n){for(var r={steps:[],terminal:{offset:null,assertion:null}},i=e,a;i&&i.parentNode&&i.parentNode.nodeType!=Ae;)a=n?this.filteredStep(i,n):this.step(i),a&&r.steps.unshift(a),i=i.parentNode;return t!=null&&t>=0&&(r.terminal.offset=t,r.steps[r.steps.length-1].type!=`text`&&r.steps.push({type:`text`,index:0})),r}equalStep(e,t){return!e||!t?!1:e.index===t.index&&e.id===t.id&&e.type===t.type}fromRange(e,t,n){var r={range:!1,base:{},path:{},start:null,end:null},i=e.startContainer,a=e.endContainer,o=e.startOffset,s=e.endOffset,c=!1;if(n&&(c=i.ownerDocument.querySelector(`.`+n)!=null),typeof t==`string`?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t==`object`&&(r.base=t),e.collapsed)c&&(o=this.patchOffset(i,o,n)),r.path=this.pathTo(i,o,n);else{r.range=!0,c&&(o=this.patchOffset(i,o,n)),r.start=this.pathTo(i,o,n),c&&(s=this.patchOffset(a,s,n)),r.end=this.pathTo(a,s,n),r.path={steps:[],terminal:null};var l=r.start.steps.length,u;for(u=0;u<l&&this.equalStep(r.start.steps[u],r.end.steps[u]);u++)u===l-1?r.start.terminal===r.end.terminal&&(r.path.steps.push(r.start.steps[u]),r.range=!1):r.path.steps.push(r.start.steps[u]);r.start.steps=r.start.steps.slice(r.path.steps.length),r.end.steps=r.end.steps.slice(r.path.steps.length)}return r}fromNode(e,t,n){var r={range:!1,base:{},path:{},start:null,end:null};return typeof t==`string`?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t==`object`&&(r.base=t),r.path=this.pathTo(e,null,n),r}filter(e,t){var n,r,i,a,o,s=!1;return e.nodeType===ke?(s=!0,i=e.parentNode,n=e.parentNode.classList.contains(t)):(s=!1,n=e.classList.contains(t)),n&&s?(a=i.previousSibling,o=i.nextSibling,a&&a.nodeType===ke?r=a:o&&o.nodeType===ke&&(r=o),r||e):n&&!s?!1:e}patchOffset(e,t,n){if(e.nodeType!=ke)throw Error(`Anchor must be a text node`);var r=e,i=t;for(e.parentNode.classList.contains(n)&&(r=e.parentNode);r.previousSibling;){if(r.previousSibling.nodeType===Oe)if(r.previousSibling.classList.contains(n))i+=r.previousSibling.textContent.length;else break;else i+=r.previousSibling.textContent.length;r=r.previousSibling}return i}normalizedMap(e,t,n){var r={},i=-1,a,o=e.length,s,c;for(a=0;a<o;a++)s=e[a].nodeType,s===Oe&&e[a].classList.contains(n)&&(s=ke),a>0&&s===ke&&c===ke?r[a]=i:t===s&&(i+=1,r[a]=i),c=s;return r}position(e){var t,n;return e.nodeType===Oe?(t=e.parentNode.children,t||=xe(e.parentNode),n=Array.prototype.indexOf.call(t,e)):(t=this.textNodes(e.parentNode),n=t.indexOf(e)),n}filteredPosition(e,t){var n,r,i;return e.nodeType===Oe?(n=e.parentNode.children,i=this.normalizedMap(n,Oe,t)):(n=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(e=e.parentNode,n=e.parentNode.childNodes),i=this.normalizedMap(n,ke,t)),r=Array.prototype.indexOf.call(n,e),i[r]}stepsToXpath(e){var t=[`.`,`*`];return e.forEach(function(e){var n=e.index+1;e.id?t.push(`*[position()=`+n+` and @id='`+e.id+`']`):e.type===`text`?t.push(`text()[`+n+`]`):t.push(`*[`+n+`]`)}),t.join(`/`)}stepsToQuerySelector(e){var t=[`html`];return e.forEach(function(e){var n=e.index+1;e.id?t.push(`#`+e.id):e.type===`text`||t.push(`*:nth-child(`+n+`)`)}),t.join(`>`)}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(e){return e.nodeType===ke?!0:!!(t&&e.classList.contains(t))})}walkToNode(e,t,n){var r=t||document,i=r.documentElement,a,o,s=e.length,c;for(c=0;c<s&&(o=e[c],o.type===`element`?o.id?i=r.getElementById(o.id):(a=i.children||xe(i),i=a[o.index]):o.type===`text`&&(i=this.textNodes(i,n)[o.index]),i);c++);return i}findNode(e,t,n){var r=t||document,i,a;return!n&&r.evaluate!==void 0?(a=this.stepsToXpath(e),i=r.evaluate(a,r,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue):i=n?this.walkToNode(e,r,n):this.walkToNode(e,r),i}fixMiss(e,t,n,r){var i=this.findNode(e.slice(0,-1),n,r),a=i.childNodes,o=this.normalizedMap(a,ke,r),s,c,l=e[e.length-1].index;for(let e in o){if(!o.hasOwnProperty(e))return;if(o[e]===l)if(s=a[e],c=s.textContent.length,t>c)t-=c;else{i=s.nodeType===Oe?s.childNodes[0]:s;break}}return{container:i,offset:t}}toRange(e,t){var n=e||document,r,i,a,o,s,c=this,l,u,d=t?n.querySelector(`.`+t)!=null:!1,f;if(r=n.createRange===void 0?new Te:n.createRange(),c.range?(i=c.start,l=c.path.steps.concat(i.steps),o=this.findNode(l,n,d?t:null),a=c.end,u=c.path.steps.concat(a.steps),s=this.findNode(u,n,d?t:null)):(i=c.path,l=c.path.steps,o=this.findNode(c.path.steps,n,d?t:null)),o)try{i.terminal.offset==null?r.setStart(o,0):r.setStart(o,i.terminal.offset)}catch{f=this.fixMiss(l,i.terminal.offset,n,d?t:null),r.setStart(f.container,f.offset)}else return console.log(`No startContainer found for`,this.toString()),null;if(s)try{a.terminal.offset==null?r.setEnd(s,0):r.setEnd(s,a.terminal.offset)}catch{f=this.fixMiss(u,c.end.terminal.offset,n,d?t:null),r.setEnd(f.container,f.offset)}return r}isCfiString(e){return typeof e==`string`&&e.indexOf(`epubcfi(`)===0&&e[e.length-1]===`)`}generateChapterComponent(e,t,n){var r=parseInt(t),i=`/`+(e+1)*2+`/`;return i+=(r+1)*2,n&&(i+=`[`+n+`]`),i}collapse(e){this.range&&(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}},je=class{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if(typeof arguments[e]==`function`)this.hooks.push(arguments[e]);else for(var t=0;t<arguments[e].length;++t)this.hooks.push(arguments[e][t])}deregister(e){let t;for(let n=0;n<this.hooks.length;n++)if(t=this.hooks[n],t===e){this.hooks.splice(n,1);break}}trigger(){var e=arguments,t=this.context,n=[];return this.hooks.forEach(function(r){try{var i=r.apply(t,e)}catch(e){console.log(e)}i&&typeof i.then==`function`&&n.push(i)}),Promise.all(n)}list(){return this.hooks}clear(){return this.hooks=[]}};function Me(e,t){var n,r,i=t.url,a=i.indexOf(`://`)>-1;e&&(r=K(e,`head`),n=K(r,`base`),n||(n=e.createElement(`base`),r.insertBefore(n,r.firstChild)),!a&&window&&window.location&&(i=window.location.origin+i),n.setAttribute(`href`,i))}function Ne(e,t){var n,r,i=t.canonical;e&&(n=K(e,`head`),r=K(n,`link[rel='canonical']`),r?r.setAttribute(`href`,i):(r=e.createElement(`link`),r.setAttribute(`rel`,`canonical`),r.setAttribute(`href`,i),n.appendChild(r)))}function Pe(e,t){var n,r,i=t.idref;e&&(n=K(e,`head`),r=K(n,`link[property='dc.identifier']`),r?r.setAttribute(`content`,i):(r=e.createElement(`meta`),r.setAttribute(`name`,`dc.identifier`),r.setAttribute(`content`,i),n.appendChild(r)))}function Fe(e,t){var n=e.querySelectorAll(`a[href]`);if(n.length)for(var r=K(e.ownerDocument,`base`),i=r?r.getAttribute(`href`):void 0,a=function(e){var n=e.getAttribute(`href`);if(n.indexOf(`mailto:`)!==0)if(n.indexOf(`://`)>-1)e.setAttribute(`target`,`_blank`);else{var r;try{r=new De(n,i)}catch{}e.onclick=function(){return r&&r.hash?t(r.Path.path+r.hash):t(r?r.Path.path:n),!1}}}.bind(this),o=0;o<n.length;o++)a(n[o])}function Ie(e,t,n){return t.forEach(function(t,r){t&&n[r]&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),e=e.replace(new RegExp(t,`g`),n[r]))}),e}function Le(e,t,n,r){var i=typeof window<`u`?window.URL:!1,a=i?`blob`:`arraybuffer`,o=new Y,s=new XMLHttpRequest,c=XMLHttpRequest.prototype,l;for(l in`overrideMimeType`in c||Object.defineProperty(c,"overrideMimeType",{value:function(){}}),n&&(s.withCredentials=!0),s.onreadystatechange=d,s.onerror=u,s.open(`GET`,e,!0),r)s.setRequestHeader(l,r[l]);t==`json`&&s.setRequestHeader(`Accept`,`application/json`),t||=new Ee(e).extension,t==`blob`&&(s.responseType=a),V(t)&&s.overrideMimeType(`text/xml`),t==`binary`&&(s.responseType=`arraybuffer`),s.send();function u(e){o.reject(e)}function d(){if(this.readyState===XMLHttpRequest.DONE){var e=!1;if((this.responseType===``||this.responseType===`document`)&&(e=this.responseXML),this.status===200||this.status===0||e){var n;if(!this.response&&!e)return o.reject({status:this.status,message:`Empty Response`,stack:Error().stack}),o.promise;if(this.status===403)return o.reject({status:this.status,response:this.response,message:`Forbidden`,stack:Error().stack}),o.promise;n=e?this.responseXML:V(t)?G(this.response,`text/xml`):t==`xhtml`?G(this.response,`application/xhtml+xml`):t==`html`||t==`htm`?G(this.response,`text/html`):t==`json`?JSON.parse(this.response):t==`blob`?i?this.response:new Blob([this.response]):this.response,o.resolve(n)}else o.reject({status:this.status,message:this.response,stack:Error().stack})}}return o.promise}var Re=class{constructor(e,t){this.idref=e.idref,this.linear=e.linear===`yes`,this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,t?this.hooks=t:(this.hooks={},this.hooks.serialize=new je(this),this.hooks.content=new je(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var t=e||this.request||Le,n=new Y,r=n.promise;return this.contents?n.resolve(this.contents):t(this.url).then(function(e){return this.document=e,this.contents=e.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){n.resolve(this.contents)}.bind(this)).catch(function(e){n.reject(e)}),r}base(){return Me(this.document,this)}render(e){var t=new Y,n=t.promise;return this.output,this.load(e).then(function(e){var t=(typeof navigator<`u`&&navigator.userAgent||``).indexOf(`Trident`)>=0,n=new(typeof XMLSerializer>`u`||t?ee.DOMParser:XMLSerializer);return this.output=n.serializeToString(e),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){t.resolve(this.output)}.bind(this)).catch(function(e){t.reject(e)}),n}find(e){var t=this,n=[],r=e.toLowerCase(),i=function(e){for(var i=e.textContent.toLowerCase(),a=t.document.createRange(),o,s,c=-1,l,u=150;s!=-1;)s=i.indexOf(r,c+1),s!=-1&&(a=t.document.createRange(),a.setStart(e,s),a.setEnd(e,s+r.length),o=t.cfiFromRange(a),e.textContent.length<u?l=e.textContent:(l=e.textContent.substring(s-u/2,s+u/2),l=`...`+l+`...`),n.push({cfi:o,excerpt:l})),c=s};return _e(t.document,function(e){i(e)}),n}search(e,t=5){if(document.createTreeWalker===void 0)return this.find(e);let n=[],r=this,i=e.toLowerCase(),a=function(e){let t=e.reduce((e,t)=>e+t.textContent,``).toLowerCase().indexOf(i);if(t!=-1){let a=t+i.length,o=0,s=0;if(t<e[0].length){let i;for(;o<e.length-1&&(s+=e[o].length,!(a<=s));)o+=1;let c=e[0],l=e[o],u=r.document.createRange();u.setStart(c,t);let d=e.slice(0,o).reduce((e,t)=>e+t.textContent.length,0);u.setEnd(l,d>a?a:a-d),i=r.cfiFromRange(u);let f=e.slice(0,o+1).reduce((e,t)=>e+t.textContent,``);f.length>150&&(f=f.substring(t-150/2,t+150/2),f=`...`+f+`...`),n.push({cfi:i,excerpt:f})}}},o=document.createTreeWalker(r.document,NodeFilter.SHOW_TEXT,null,!1),s,c=[];for(;s=o.nextNode();)c.push(s),c.length==t&&(a(c.slice(0,t)),c=c.slice(1,t));return c.length>0&&a(c),n}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(e){var n=e.replace(`rendition:`,``),r=n.indexOf(`-`),i,a;r!=-1&&(i=n.slice(0,r),a=n.slice(r+1),t[i]=a)}),t}cfiFromRange(e){return new Q(e,this.cfiBase).toString()}cfiFromElement(e){return new Q(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}},ze=class{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new je,this.hooks.content=new je,this.hooks.content.register(Me),this.hooks.content.register(Ne),this.hooks.content.register(Pe),this.epubcfi=new Q,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,n){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||``,this.length=this.items.length,this.items.forEach((e,r)=>{var i=this.manifest[e.idref],a;e.index=r,e.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,e.index,e.id),e.href&&(e.url=t(e.href,!0),e.canonical=n(e.href)),i&&(e.href=i.href,e.url=t(e.href,!0),e.canonical=n(e.href),i.properties.length&&e.properties.push.apply(e.properties,i.properties)),e.linear===`yes`?(e.prev=function(){let t=e.index;for(;t>0;){let e=this.get(t-1);if(e&&e.linear)return e;--t}}.bind(this),e.next=function(){let t=e.index;for(;t<this.spineItems.length-1;){let e=this.get(t+1);if(e&&e.linear)return e;t+=1}}.bind(this)):(e.prev=function(){},e.next=function(){}),a=new Re(e,this.hooks),this.append(a)}),this.loaded=!0}get(e){var t=0;if(e===void 0)for(;t<this.spineItems.length;){let e=this.spineItems[t];if(e&&e.linear)break;t+=1}else this.epubcfi.isCfiString(e)?t=new Q(e).spinePos:typeof e==`number`||isNaN(e)===!1?t=e:typeof e==`string`&&e.indexOf(`#`)===0?t=this.spineById[e.substring(1)]:typeof e==`string`&&(e=e.split(`#`)[0],t=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[t]||null}append(e){var t=this.spineItems.length;return e.index=t,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=t,this.spineByHref[encodeURI(e.href)]=t,this.spineByHref[e.href]=t,this.spineById[e.idref]=t,t}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(e,t){e.index=t}),0}remove(e){var t=this.spineItems.indexOf(e);if(t>-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let t=this.get(e);if(t&&t.linear)return t;--e}while(e>=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}},Be=class{constructor(e){this._q=[],this.context=e,this.tick=N,this.running=!1,this.paused=!1}enqueue(){var e,t,n,r=[].shift.call(arguments),i=arguments;if(!r)throw Error(`No Task Provided`);return typeof r==`function`?(e=new Y,t=e.promise,n={task:r,args:i,deferred:e,promise:t}):n={promise:r},this._q.push(n),this.paused==0&&!this.running&&this.run(),n.promise}dequeue(){var e,t,n;if(this._q.length&&!this.paused){if(e=this._q.shift(),t=e.task,t)return n=t.apply(this.context,e.args),n&&typeof n.then==`function`?n.then(function(){e.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){e.deferred.reject.apply(this.context,arguments)}.bind(this)):(e.deferred.resolve.apply(this.context,n),e.promise);if(e.promise)return e.promise}else return e=new Y,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new Y),this.tick.call(window,()=>{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),this.paused==1&&(this.paused=!1),this.defered.promise}flush(){if(this.running)return this.running;if(this._q.length)return this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}},Ve=[`keydown`,`keyup`,`keypressed`,`mouseup`,`mousedown`,`mousemove`,`click`,`touchend`,`touchstart`,`touchmove`],$={BOOK:{OPEN_FAILED:`openFailed`},CONTENTS:{EXPAND:`expand`,RESIZE:`resize`,SELECTED:`selected`,SELECTED_RANGE:`selectedRange`,LINK_CLICKED:`linkClicked`},LOCATIONS:{CHANGED:`changed`},MANAGERS:{RESIZE:`resize`,RESIZED:`resized`,ORIENTATION_CHANGE:`orientationchange`,ADDED:`added`,SCROLL:`scroll`,SCROLLED:`scrolled`,REMOVED:`removed`},VIEWS:{AXIS:`axis`,WRITING_MODE:`writingMode`,LOAD_ERROR:`loaderror`,RENDERED:`rendered`,RESIZED:`resized`,DISPLAYED:`displayed`,SHOWN:`shown`,HIDDEN:`hidden`,MARK_CLICKED:`markClicked`},RENDITION:{STARTED:`started`,ATTACHED:`attached`,DISPLAYED:`displayed`,DISPLAY_ERROR:`displayerror`,RENDERED:`rendered`,REMOVED:`removed`,RESIZED:`resized`,ORIENTATION_CHANGE:`orientationchange`,LOCATION_CHANGED:`locationChanged`,RELOCATED:`relocated`,MARK_CLICKED:`markClicked`,SELECTED:`selected`,LAYOUT:`layout`},LAYOUT:{UPDATED:`updated`},ANNOTATION:{ATTACH:`attach`,DETACH:`detach`}},He=class{constructor(e,t,n){this.spine=e,this.request=t,this.pause=n||100,this.q=new Be(this),this.epubcfi=new Q,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation=``,this._currentCfi=``,this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each(function(e){e.linear&&this.q.enqueue(this.process.bind(this),e)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then(function(t){var n=new Y,r=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(r),e.unload(),this.processingTimeout=setTimeout(()=>n.resolve(r),this.pause),n.promise}.bind(this))}parse(e,t,n){var r=[],i,a=e.ownerDocument,o=K(a,`body`),s=0,c,l=n||this.break;if(_e(o,function(e){var n=e.length,a,o=0;if(e.textContent.trim().length===0)return!1;for(s==0&&(i=this.createRange(),i.startContainer=e,i.startOffset=0),a=l-s,a>n&&(s+=n,o=n);o<n;)if(a=l-s,s===0&&(o+=1,i=this.createRange(),i.startContainer=e,i.startOffset=o),o+a>=n)s+=n-o,o=n;else{o+=a,i.endContainer=e,i.endOffset=o;let n=new Q(i,t).toString();r.push(n),s=0}c=e}.bind(this)),i&&i.startContainer&&c){i.endContainer=c,i.endOffset=c.length;let e=new Q(i,t).toString();r.push(e),s=0}return r}generateFromWords(e,t,n){var r=e?new Q(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(e){e.linear&&(r?e.index>=r.spinePos&&this.q.enqueue(this.processWords.bind(this),e,t,r,n):this.q.enqueue(this.processWords.bind(this),e,t,r,n))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(e,t,n,r){return r&&this._locationsWords.length>=r?Promise.resolve():e.load(this.request).then(function(i){var a=new Y,o=this.parseWords(i,e,t,n),s=r-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(o.length>=r?o.slice(0,s):o),e.unload(),this.processingTimeout=setTimeout(()=>a.resolve(o),this.pause),a.promise}.bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,``),e=e.replace(/[ ]{2,}/gi,` `),e=e.replace(/\n /,`
3
3
  `),e.split(` `).length}parseWords(e,t,n,r){var i=t.cfiBase,a=[],o=e.ownerDocument,s=K(o,`body`),c=n,l=r?r.spinePos!==t.index:!0,u;return r&&t.index===r.spinePos&&(u=r.findNode(r.range?r.path.steps.concat(r.start.steps):r.path.steps,e.ownerDocument)),_e(s,function(e){if(!l)if(e===u)l=!0;else return!1;if(e.textContent.length<10&&e.textContent.trim().length===0)return!1;var t=this.countWords(e.textContent),n,r=0;if(t===0)return!1;for(n=c-this._wordCounter,n>t&&(this._wordCounter+=t,r=t);r<t;)if(n=c-this._wordCounter,r+n>=t)this._wordCounter+=t-r,r=t;else{r+=n;let t=new Q(e,i);a.push({cfi:t.toString(),wordCount:this._wordCounter}),this._wordCounter=0}}.bind(this)),a}locationFromCfi(e){let t;return Q.prototype.isCfiString(e)&&(e=new Q(e)),this._locations.length===0?-1:(t=le(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(this._locations.length===0)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var t=-1;return typeof e!=`number`&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(e>1&&console.warn(`Normalize cfiFromPercentage value to between 0 - 1`),e>=1){let e=new Q(this._locations[this.total]);return e.collapse(),e.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return typeof e==`string`?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if(typeof e==`string`)this._currentCfi=e;else if(typeof e==`number`)this._current=e;else return;this._locations.length!==0&&(typeof e==`string`?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit($.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}};(0,j.default)(He.prototype);var Ue=class{constructor(e){this.packagePath=``,this.directory=``,this.encoding=``,e&&this.parse(e)}parse(e){var t;if(!e)throw Error(`Container File Not Found`);if(t=K(e,`rootfile`),!t)throw Error(`No RootFile Found`);this.packagePath=t.getAttribute(`full-path`),this.directory=Z.default.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}},We=class{constructor(e){this.manifest={},this.navPath=``,this.ncxPath=``,this.coverPath=``,this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,n,r;if(!e)throw Error(`Package File Not Found`);if(t=K(e,`metadata`),!t)throw Error(`No Metadata Found`);if(n=K(e,`manifest`),!n)throw Error(`No Manifest Found`);if(r=K(e,`spine`),!r)throw Error(`No Spine Found`);return this.manifest=this.parseManifest(n),this.navPath=this.findNavPath(n),this.ncxPath=this.findNcxPath(n,r),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=B(r),this.spine=this.parseSpine(r,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=r.getAttribute(`page-progression-direction`),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={};return t.title=this.getElementText(e,`title`),t.creator=this.getElementText(e,`creator`),t.description=this.getElementText(e,`description`),t.pubdate=this.getElementText(e,`date`),t.publisher=this.getElementText(e,`publisher`),t.identifier=this.getElementText(e,`identifier`),t.language=this.getElementText(e,`language`),t.rights=this.getElementText(e,`rights`),t.modified_date=this.getPropertyText(e,`dcterms:modified`),t.layout=this.getPropertyText(e,`rendition:layout`),t.orientation=this.getPropertyText(e,`rendition:orientation`),t.flow=this.getPropertyText(e,`rendition:flow`),t.viewport=this.getPropertyText(e,`rendition:viewport`),t.media_active_class=this.getPropertyText(e,`media:active-class`),t.spread=this.getPropertyText(e,`rendition:spread`),t}parseManifest(e){var t={},n=q(e,`item`);return Array.prototype.slice.call(n).forEach(function(e){var n=e.getAttribute(`id`),r=e.getAttribute(`href`)||``,i=e.getAttribute(`media-type`)||``,a=e.getAttribute(`media-overlay`)||``,o=e.getAttribute(`properties`)||``;t[n]={href:r,type:i,overlay:a,properties:o.length?o.split(` `):[]}}),t}parseSpine(e,t){var n=[],r=q(e,`itemref`);return Array.prototype.slice.call(r).forEach(function(e,t){var r=e.getAttribute(`idref`),i=e.getAttribute(`properties`)||``,a=i.length?i.split(` `):[],o={id:e.getAttribute(`id`),idref:r,linear:e.getAttribute(`linear`)||`yes`,properties:a,index:t};n.push(o)}),n}findUniqueIdentifier(e){var t=e.documentElement.getAttribute(`unique-identifier`);if(!t)return``;var n=e.getElementById(t);return n&&n.localName===`identifier`&&n.namespaceURI===`http://purl.org/dc/elements/1.1/`&&n.childNodes.length>0?n.childNodes[0].nodeValue.trim():``}findNavPath(e){var t=J(e,`item`,{properties:`nav`});return t?t.getAttribute(`href`):!1}findNcxPath(e,t){var n=J(e,`item`,{"media-type":`application/x-dtbncx+xml`}),r;return n||(r=t.getAttribute(`toc`),r&&(n=e.querySelector(`#${r}`))),n?n.getAttribute(`href`):!1}findCoverPath(e){K(e,`package`).getAttribute(`version`);var t=J(e,`item`,{properties:`cover-image`});if(t)return t.getAttribute(`href`);var n=J(e,`meta`,{name:`cover`});if(n){var r=n.getAttribute(`content`),i=e.getElementById(r);return i?i.getAttribute(`href`):``}else return!1}getElementText(e,t){var n=e.getElementsByTagNameNS(`http://purl.org/dc/elements/1.1/`,t),r;return!n||n.length===0?``:(r=n[0],r.childNodes.length?r.childNodes[0].nodeValue:``)}getPropertyText(e,t){var n=J(e,`meta`,{property:t});return n&&n.childNodes.length?n.childNodes[0].nodeValue:``}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((e,t)=>(e.index=t,e.linear=e.linear||`yes`,e)),e.resources.forEach((e,t)=>{this.manifest[t]=e,e.rel&&e.rel[0]===`cover`&&(this.coverPath=e.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((e,t)=>(e.label=e.title,e)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}},Ge=class{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t=e.nodeType,n,r;t&&(n=K(e,`html`),r=K(e,`ncx`)),t?n?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):r&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t,n=0;n<e.length;n++)t=e[n],t.href&&(this.tocByHref[t.href]=n),t.id&&(this.tocById[t.id]=n),this.length++,t.subitems.length&&this.unpack(t.subitems)}get(e){var t;return e?(e.indexOf(`#`)===0?t=this.tocById[e.substring(1)]:e in this.tocByHref&&(t=this.tocByHref[e]),this.getByIndex(e,t,this.toc)):this.toc}getByIndex(e,t,n){if(n.length===0)return;let r=n[t];if(r&&(e===r.id||e===r.href))return r;{let r;for(let i=0;i<n.length&&(r=this.getByIndex(e,t,n[i].subitems),!r);++i);return r}}landmark(e){var t;return e?(t=this.landmarksByType[e],this.landmarks[t]):this.landmarks}parseNav(e){var t=X(e,`nav`,`toc`),n=[];if(!t)return n;let r=Ce(t,`ol`,!0);return r&&(n=this.parseNavList(r)),n}parseNavList(e,t){let n=[];if(!e||!e.children)return n;for(let r=0;r<e.children.length;r++){let i=this.navItem(e.children[r],t);i&&n.push(i)}return n}navItem(e,t){let n=e.getAttribute(`id`)||void 0,r=Ce(e,`a`,!0)||Ce(e,`span`,!0);if(!r)return;let i=r.getAttribute(`href`)||``;n||=i;let a=r.textContent||``,o=[],s=Ce(e,`ol`,!0);return s&&(o=this.parseNavList(s,n)),{id:n,href:i,label:a,subitems:o,parent:t}}parseLandmarks(e){var t=X(e,`nav`,`landmarks`),n=t?q(t,`li`):[],r=n.length,i,a=[],o;if(!n||r===0)return a;for(i=0;i<r;++i)o=this.landmarkItem(n[i]),o&&(a.push(o),this.landmarksByType[o.type]=i);return a}landmarkItem(e){let t=Ce(e,`a`,!0);if(!t)return;let n=t.getAttributeNS(`http://www.idpf.org/2007/ops`,`type`)||void 0;return{href:t.getAttribute(`href`)||``,label:t.textContent||``,type:n}}parseNcx(e){var t=q(e,`navPoint`),n=t.length,r,i={},a=[],o,s;if(!t||n===0)return a;for(r=0;r<n;++r)o=this.ncxItem(t[r]),i[o.id]=o,o.parent?(s=i[o.parent],s.subitems.push(o)):a.push(o);return a}ncxItem(e){var t=e.getAttribute(`id`)||!1,n=K(e,`content`).getAttribute(`src`),r=K(e,`navLabel`),i=r.textContent?r.textContent:``,a=[],o=e.parentNode,s;return o&&(o.nodeName===`navPoint`||o.nodeName.split(`:`).slice(-1)[0]===`navPoint`)&&(s=o.getAttribute(`id`)),{id:t,href:n,label:i,subitems:a,parent:s}}load(e){return e.map(e=>(e.label=e.title,e.subitems=e.children?this.load(e.children):[],e))}forEach(e){return this.toc.forEach(e)}},Ke={application:{ecmascript:[`es`,`ecma`],javascript:`js`,ogg:`ogx`,pdf:`pdf`,postscript:[`ps`,`ai`,`eps`,`epsi`,`epsf`,`eps2`,`eps3`],"rdf+xml":`rdf`,smil:[`smi`,`smil`],"xhtml+xml":[`xhtml`,`xht`],xml:[`xml`,`xsl`,`xsd`,`opf`,`ncx`],zip:`zip`,"x-httpd-eruby":`rhtml`,"x-latex":`latex`,"x-maker":[`frm`,`maker`,`frame`,`fm`,`fb`,`book`,`fbdoc`],"x-object":`o`,"x-shockwave-flash":[`swf`,`swfl`],"x-silverlight":`scr`,"epub+zip":`epub`,"font-tdpfr":`pfr`,"inkml+xml":[`ink`,`inkml`],json:`json`,"jsonml+json":`jsonml`,"mathml+xml":`mathml`,"metalink+xml":`metalink`,mp4:`mp4s`,"omdoc+xml":`omdoc`,oxps:`oxps`,"vnd.amazon.ebook":`azw`,widget:`wgt`,"x-dtbook+xml":`dtb`,"x-dtbresource+xml":`res`,"x-font-bdf":`bdf`,"x-font-ghostscript":`gsf`,"x-font-linux-psf":`psf`,"x-font-otf":`otf`,"x-font-pcf":`pcf`,"x-font-snf":`snf`,"x-font-ttf":[`ttf`,`ttc`],"x-font-type1":[`pfa`,`pfb`,`pfm`,`afm`],"x-font-woff":`woff`,"x-mobipocket-ebook":[`prc`,`mobi`],"x-mspublisher":`pub`,"x-nzb":`nzb`,"x-tgif":`obj`,"xaml+xml":`xaml`,"xml-dtd":`dtd`,"xproc+xml":`xpl`,"xslt+xml":`xslt`,"internet-property-stream":`acx`,"x-compress":`z`,"x-compressed":`tgz`,"x-gzip":`gz`},audio:{flac:`flac`,midi:[`mid`,`midi`,`kar`,`rmi`],mpeg:[`mpga`,`mpega`,`mp2`,`mp3`,`m4a`,`mp2a`,`m2a`,`m3a`],mpegurl:`m3u`,ogg:[`oga`,`ogg`,`spx`],"x-aiff":[`aif`,`aiff`,`aifc`],"x-ms-wma":`wma`,"x-wav":`wav`,adpcm:`adp`,mp4:`mp4a`,webm:`weba`,"x-aac":`aac`,"x-caf":`caf`,"x-matroska":`mka`,"x-pn-realaudio-plugin":`rmp`,xm:`xm`,mid:[`mid`,`rmi`]},image:{gif:`gif`,ief:`ief`,jpeg:[`jpeg`,`jpg`,`jpe`],pcx:`pcx`,png:`png`,"svg+xml":[`svg`,`svgz`],tiff:[`tiff`,`tif`],"x-icon":`ico`,bmp:`bmp`,webp:`webp`,"x-pict":[`pic`,`pct`],"x-tga":`tga`,"cis-cod":`cod`},text:{"cache-manifest":[`manifest`,`appcache`],css:`css`,csv:`csv`,html:[`html`,`htm`,`shtml`,`stm`],mathml:`mml`,plain:[`txt`,`text`,`brf`,`conf`,`def`,`list`,`log`,`in`,`bas`],richtext:`rtx`,"tab-separated-values":`tsv`,"x-bibtex":`bib`},video:{mpeg:[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`,`mp2`,`mpa`,`mpv2`],mp4:[`mp4`,`mp4v`,`mpg4`],quicktime:[`qt`,`mov`],ogg:`ogv`,"vnd.mpegurl":[`mxu`,`m4u`],"x-flv":`flv`,"x-la-asf":[`lsf`,`lsx`],"x-mng":`mng`,"x-ms-asf":[`asf`,`asx`,`asr`],"x-ms-wm":`wm`,"x-ms-wmv":`wmv`,"x-ms-wmx":`wmx`,"x-ms-wvx":`wvx`,"x-msvideo":`avi`,"x-sgi-movie":`movie`,"x-matroska":[`mpv`,`mkv`,`mk3d`,`mks`],"3gpp2":`3g2`,h261:`h261`,h263:`h263`,h264:`h264`,jpeg:`jpgv`,jpm:[`jpm`,`jpgm`],mj2:[`mj2`,`mjp2`],"vnd.ms-playready.media.pyv":`pyv`,"vnd.uvvu.mp4":[`uvu`,`uvvu`],"vnd.vivo":`viv`,webm:`webm`,"x-f4v":`f4v`,"x-m4v":`m4v`,"x-ms-vob":`vob`,"x-smv":`smv`}},qe=(function(){var e,t,n,r,i={};for(e in Ke)if(Ke.hasOwnProperty(e)){for(t in Ke[e])if(Ke[e].hasOwnProperty(t))if(n=Ke[e][t],typeof n==`string`)i[n]=e+`/`+t;else for(r=0;r<n.length;r++)i[n[r]]=e+`/`+t}return i})(),Je=`text/plain`;function Ye(e){return e&&qe[e.split(`.`).pop().toLowerCase()]||Je}var Xe={lookup:Ye},Ze=class{constructor(e,t){this.settings={replacements:t&&t.replacements||`base64`,archive:t&&t.archive,resolver:t&&t.resolver,request:t&&t.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(t){return e[t]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if(e.type===`application/xhtml+xml`||e.type===`text/html`)return!0}),this.assets=this.resources.filter(function(e){if(e.type!==`application/xhtml+xml`&&e.type!==`text/html`)return!0}),this.css=this.resources.filter(function(e){if(e.type===`text/css`)return!0})}splitUrls(){this.urls=this.assets.map(function(e){return e.href}.bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var t=new De(e),n=Xe.lookup(t.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:this.settings.replacements===`base64`}):this.settings.replacements===`base64`?this.settings.request(e,`blob`).then(e=>be(e)).then(e=>U(e,n)):this.settings.request(e,`blob`).then(e=>ge(e,n))}replacements(){if(this.settings.replacements===`none`)return new Promise(function(e){e(this.urls)}.bind(this));var e=this.urls.map(e=>{var t=this.settings.resolver(e);return this.createUrl(t).catch(e=>(console.error(e),null))});return Promise.all(e).then(e=>(this.replacementUrls=e.filter(e=>typeof e==`string`),e))}replaceCss(e,t){var n=[];return e||=this.settings.archive,t||=this.settings.resolver,this.cssUrls.forEach(function(r){var i=this.createCssFile(r,e,t).then(function(e){var t=this.urls.indexOf(r);t>-1&&(this.replacementUrls[t]=e)}.bind(this));n.push(i)}.bind(this)),Promise.all(n)}createCssFile(e){var t;if(Z.default.isAbsolute(e))return new Promise(function(e){e()});var n=this.settings.resolver(e),r=this.settings.archive?this.settings.archive.getText(n):this.settings.request(n,`text`),i=this.urls.map(e=>{var t=this.settings.resolver(e);return new Ee(n).relative(t)});return r?r.then(e=>(e=Ie(e,i,this.replacementUrls),t=this.settings.replacements===`base64`?U(e,`text/css`):ge(e,`text/css`),t),e=>new Promise(function(e){e()})):new Promise(function(e){e()})}relativeTo(e,t){return t||=this.settings.resolver,this.urls.map(function(n){var r=t(n);return new Ee(e).relative(r)}.bind(this))}get(e){var t=this.urls.indexOf(e);if(t!==-1)return this.replacementUrls.length?new Promise(function(e,n){e(this.replacementUrls[t])}.bind(this)):this.createUrl(e)}substitute(e,t){return Ie(e,t?this.relativeTo(t):this.urls,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}},Qe=class{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new Q,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=K(e,`html`),n=K(e,`ncx`);if(t)return this.parseNav(e);if(n)return this.parseNcx(e)}parseNav(e){var t=X(e,`nav`,`page-list`),n=t?q(t,`li`):[],r=n.length,i,a=[],o;if(!n||r===0)return a;for(i=0;i<r;++i)o=this.item(n[i]),a.push(o);return a}parseNcx(e){var t=[],n=0,r,i,a,o=0;if(i=K(e,`pageList`),!i||(a=q(i,`pageTarget`),o=a.length,!a||a.length===0))return t;for(n=0;n<o;++n)r=this.ncxItem(a[n]),t.push(r);return t}ncxItem(e){var t=K(K(e,`navLabel`),`text`).textContent;return{href:K(e,`content`).getAttribute(`src`),page:parseInt(t,10)}}item(e){var t=K(e,`a`),n=t.getAttribute(`href`)||``,r=t.textContent||``,i=parseInt(r),a=n.indexOf(`epubcfi`),o,s,c;return a==-1?{href:n,page:i}:(o=n.split(`#`),s=o[0],c=o.length>1?o[1]:!1,{cfi:c,href:n,packageUrl:s,page:i})}process(e){e.forEach(function(e){this.pages.push(e.page),e.cfi&&this.locations.push(e.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var t=-1;if(this.locations.length===0)return-1;var n=ue(e,this.locations,this.epubcfi.compare);return n==-1?(n=le(e,this.locations,this.epubcfi.compare),t=n-1>=0?this.pages[n-1]:this.pages[0],t!==void 0||(t=-1)):t=this.pages[n],t}cfiFromPage(e){var t=-1;typeof e!=`number`&&(e=parseInt(e));var n=this.pages.indexOf(e);return n!=-1&&(t=this.locations[n]),t}pageFromPercentage(e){return Math.round(this.totalPages*e)}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(t*1e3)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e);return this.percentageFromPage(t)}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}},$e=class{constructor(e){this.settings=e,this.name=e.layout||`reflowable`,this._spread=e.spread!==`none`,this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,e.flow===`scrolled`||e.flow===`scrolled-continuous`||e.flow===`scrolled-doc`?this._flow=`scrolled`:this._flow=`paginated`,this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}flow(e){return e!==void 0&&(e===`scrolled`||e===`scrolled-continuous`||e===`scrolled-doc`?this._flow=`scrolled`:this._flow=`paginated`,this.update({flow:this._flow})),this._flow}spread(e,t){return e&&(this._spread=e!==`none`,this.update({spread:this._spread})),t>=0&&(this._minSpreadWidth=t),this._spread}calculate(e,t,n){var r=1,i=n||0,a=e,o=t,s=Math.floor(a/12),c,l,u,d;r=this._spread&&a>=this._minSpreadWidth?2:1,this.name===`reflowable`&&this._flow===`paginated`&&!(n>=0)&&(i=s%2==0?s:s-1),this.name===`pre-paginated`&&(i=0),r>1?(c=a/r-i,u=c+i):(c=a,u=a),this.name===`pre-paginated`&&r>1&&(a=c),l=c*r+i,d=a,this.width=a,this.height=o,this.spreadWidth=l,this.pageWidth=u,this.delta=d,this.columnWidth=c,this.gap=i,this.divisor=r,this.update({width:a,height:o,spreadWidth:l,pageWidth:u,delta:d,columnWidth:c,gap:i,divisor:r})}format(e,t,n){return this.name===`pre-paginated`?e.fit(this.columnWidth,this.height,t):this._flow===`paginated`?e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):n&&n===`horizontal`?e.size(null,this.height):e.size(this.width,null)}count(e,t){let n,r;return this.name===`pre-paginated`?(n=1,r=1):this._flow===`paginated`?(t||=this.delta,n=Math.ceil(e/t),r=n*this.divisor):(t||=this.height,n=Math.ceil(e/t),r=n),{spreads:n,pages:r}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),Object.keys(e).length>0){let t=L(this.props,e);this.emit($.LAYOUT.UPDATED,t,e)}}};(0,j.default)($e.prototype);var et=class{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:``,serialized:``}},this._overrides={},this._current=`default`,this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(arguments.length!==0){if(arguments.length===1&&typeof arguments[0]==`object`)return this.registerThemes(arguments[0]);if(arguments.length===1&&typeof arguments[0]==`string`)return this.default(arguments[0]);if(arguments.length===2&&typeof arguments[1]==`string`)return this.registerUrl(arguments[0],arguments[1]);if(arguments.length===2&&typeof arguments[1]==`object`)return this.registerRules(arguments[0],arguments[1])}}default(e){if(e){if(typeof e==`string`)return this.registerUrl(`default`,e);if(typeof e==`object`)return this.registerRules(`default`,e)}}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&(typeof e[t]==`string`?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||e=="default")&&this.update(e)}registerUrl(e,t){var n=new De(t);this._themes[e]={url:n.toString()},(this._injected[e]||e=="default")&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||e=="default")&&this.update(e)}select(e){var t=this._current,n;this._current=e,this.update(e),n=this.rendition.getContents(),n.forEach(n=>{n.removeClass(t),n.addClass(e)})}update(e){this.rendition.getContents().forEach(t=>{this.add(e,t)})}inject(e){var t=[],n=this._themes,r;for(var i in n)n.hasOwnProperty(i)&&(i===this._current||i==="default")&&(r=n[i],(r.rules&&Object.keys(r.rules).length>0||r.url&&t.indexOf(r.url)===-1)&&this.add(i,e),this._injected.push(i));this._current!="default"&&e.addClass(this._current)}add(e,t){var n=this._themes[e];!n||!t||(n.url?t.addStylesheet(n.url):n.serialized?(t.addStylesheetCss(n.serialized,e),n.injected=!0):n.rules&&(t.addStylesheetRules(n.rules,e),n.injected=!0))}override(e,t,n){var r=this.rendition.getContents();this._overrides[e]={value:t,priority:n===!0},r.forEach(t=>{t.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(t=>{t.css(e)})}overrides(e){var t=this._overrides;for(var n in t)t.hasOwnProperty(n)&&e.css(n,t[n].value,t[n].priority)}fontSize(e){this.override(`font-size`,e)}font(e){this.override(`font-family`,e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}},tt=class{constructor(e,t,n,r=!1){this.layout=e,this.horizontal=n===`horizontal`,this.direction=t||`ltr`,this._dev=r}section(e){var t=this.findRanges(e);return this.rangeListToCfiList(e.section.cfiBase,t)}page(e,t,n,r){var i=e&&e.document?e.document.body:!1,a;if(i){if(a=this.rangePairToCfiPair(t,{start:this.findStart(i,n,r),end:this.findEnd(i,n,r)}),this._dev===!0){let t=e.document,n=new Q(a.start).toRange(t),r=new Q(a.end).toRange(t),i=t.defaultView.getSelection(),o=t.createRange();i.removeAllRanges(),o.setStart(n.startContainer,n.startOffset),o.setEnd(r.endContainer,r.endOffset),i.addRange(o)}return a}}walk(e,t){if(!(e&&e.nodeType===Node.TEXT_NODE)){var n={acceptNode:function(e){return e.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},r=n.acceptNode;r.acceptNode=n.acceptNode;for(var i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,r,!1),a,o;(a=i.nextNode())&&(o=t(a),!o););return o}}findRanges(e){for(var t=[],n=e.contents.scrollWidth(),r=Math.ceil(n/this.layout.spreadWidth)*this.layout.divisor,i=this.layout.columnWidth,a=this.layout.gap,o,s,c=0;c<r.pages;c++)o=(i+a)*c,s=i*(c+1)+a*c,t.push({start:this.findStart(e.document.body,o,s),end:this.findEnd(e.document.body,o,s)});return t}findStart(e,t,n){for(var r=[e],i,a,o=e;r.length;)if(i=r.shift(),a=this.walk(i,e=>{var i,a,s,c,l=R(e);if(this.horizontal&&this.direction===`ltr`){if(i=this.horizontal?l.left:l.top,a=this.horizontal?l.right:l.bottom,i>=t&&i<=n||a>t)return e;o=e,r.push(e)}else if(this.horizontal&&this.direction===`rtl`){if(i=l.left,a=l.right,a<=n&&a>=t||i<n)return e;o=e,r.push(e)}else{if(s=l.top,c=l.bottom,s>=t&&s<=n||c>t)return e;o=e,r.push(e)}}),a)return this.findTextStartRange(a,t,n);return this.findTextStartRange(o,t,n)}findEnd(e,t,n){for(var r=[e],i,a=e,o;r.length;)if(i=r.shift(),o=this.walk(i,e=>{var i,o,s,c,l=R(e);if(this.horizontal&&this.direction===`ltr`){if(i=Math.round(l.left),o=Math.round(l.right),i>n&&a)return a;if(o>n)return e;a=e,r.push(e)}else if(this.horizontal&&this.direction===`rtl`){if(i=Math.round(this.horizontal?l.left:l.top),o=Math.round(this.horizontal?l.right:l.bottom),o<t&&a)return a;if(i<t)return e;a=e,r.push(e)}else{if(s=Math.round(l.top),c=Math.round(l.bottom),s>n&&a)return a;if(c>n)return e;a=e,r.push(e)}}),o)return this.findTextEndRange(o,t,n);return this.findTextEndRange(a,t,n)}findTextStartRange(e,t,n){for(var r=this.splitTextNodeIntoRanges(e),i,a,o,s,c,l=0;l<r.length;l++)if(i=r[l],a=i.getBoundingClientRect(),this.horizontal&&this.direction===`ltr`){if(o=a.left,o>=t)return i}else if(this.horizontal&&this.direction===`rtl`){if(c=a.right,c<=n)return i}else if(s=a.top,s>=t)return i;return r[0]}findTextEndRange(e,t,n){for(var r=this.splitTextNodeIntoRanges(e),i,a,o,s,c,l,u,d=0;d<r.length;d++){if(a=r[d],o=a.getBoundingClientRect(),this.horizontal&&this.direction===`ltr`){if(s=o.left,c=o.right,s>n&&i)return i;if(c>n)return a}else if(this.horizontal&&this.direction===`rtl`){if(s=o.left,c=o.right,c<t&&i)return i;if(s<t)return a}else{if(l=o.top,u=o.bottom,l>n&&i)return i;if(u>n)return a}i=a}return r[r.length-1]}splitTextNodeIntoRanges(e,t){var n=[],r=(e.textContent||``).trim(),i,a=e.ownerDocument,o=t||` `,s=r.indexOf(o);if(s===-1||e.nodeType!=Node.TEXT_NODE)return i=a.createRange(),i.selectNodeContents(e),[i];for(i=a.createRange(),i.setStart(e,0),i.setEnd(e,s),n.push(i),i=!1;s!=-1;)s=r.indexOf(o,s+1),s>0&&(i&&(i.setEnd(e,s),n.push(i)),i=a.createRange(),i.setStart(e,s+1));return i&&(i.setEnd(e,r.length),n.push(i)),n}rangePairToCfiPair(e,t){var n=t.start,r=t.end;return n.collapse(!0),r.collapse(!1),{start:new Q(n,e).toString(),end:new Q(r,e).toString()}}rangeListToCfiList(e,t){for(var n=[],r,i=0;i<t.length;i++)r=this.rangePairToCfiPair(e,t[i]),n.push(r);return n}axis(e){return e&&(this.horizontal=e===`horizontal`),this.horizontal}},nt=typeof navigator<`u`,rt=nt&&/Chrome/.test(navigator.userAgent),it=nt&&!rt&&/AppleWebKit/.test(navigator.userAgent),at=1,ot=class{constructor(e,t,n,r){this.epubcfi=new Q,this.document=e,this.documentElement=this.document.documentElement,this.content=t||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=r||0,this.cfiBase=n||``,this.epubReadingSystem(`epub.js`,`0.3`),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return Ve}width(e){var t=this.content;return e&&I(e)&&(e+=`px`),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}height(e){var t=this.content;return e&&I(e)&&(e+=`px`),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}contentWidth(e){var t=this.content||this.document.body;return e&&I(e)&&(e+=`px`),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}contentHeight(e){var t=this.content||this.document.body;return e&&I(e)&&(e+=`px`),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}textWidth(){let e,t,n=this.document.createRange(),r=this.content||this.document.body,i=fe(r);return n.selectNodeContents(r),e=n.getBoundingClientRect(),t=e.width,i&&i.width&&(t+=i.width),Math.round(t)}textHeight(){let e,t,n=this.document.createRange(),r=this.content||this.document.body;return n.selectNodeContents(r),e=n.getBoundingClientRect(),t=e.bottom,Math.round(t)}scrollWidth(){return this.documentElement.scrollWidth}scrollHeight(){return this.documentElement.scrollHeight}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,t,n){var r=this.content||this.document.body;return t?r.style.setProperty(e,t,n?`important`:``):r.style.removeProperty(e),this.window.getComputedStyle(r)[e]}viewport(e){var t=this.document.querySelector(`meta[name='viewport']`),n={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},r=[],i={};if(t&&t.hasAttribute(`content`)){let e=t.getAttribute(`content`),r=e.match(/width\s*=\s*([^,]*)/),i=e.match(/height\s*=\s*([^,]*)/),a=e.match(/initial-scale\s*=\s*([^,]*)/),o=e.match(/minimum-scale\s*=\s*([^,]*)/),s=e.match(/maximum-scale\s*=\s*([^,]*)/),c=e.match(/user-scalable\s*=\s*([^,]*)/);r&&r.length&&r[1]!==void 0&&(n.width=r[1]),i&&i.length&&i[1]!==void 0&&(n.height=i[1]),a&&a.length&&a[1]!==void 0&&(n.scale=a[1]),o&&o.length&&o[1]!==void 0&&(n.minimum=o[1]),s&&s.length&&s[1]!==void 0&&(n.maximum=s[1]),c&&c.length&&c[1]!==void 0&&(n.scalable=c[1])}return i=se(e||{},n),e&&(i.width&&r.push(`width=`+i.width),i.height&&r.push(`height=`+i.height),i.scale&&r.push(`initial-scale=`+i.scale),i.scalable===`no`?(r.push(`minimum-scale=`+i.scale),r.push(`maximum-scale=`+i.scale),r.push(`user-scalable=`+i.scalable)):(i.scalable&&r.push(`user-scalable=`+i.scalable),i.minimum&&r.push(`minimum-scale=`+i.minimum),i.maximum&&r.push(`minimum-scale=`+i.maximum)),t||(t=this.document.createElement(`meta`),t.setAttribute(`name`,`viewport`),this.document.querySelector(`head`).appendChild(t)),t.setAttribute(`content`,r.join(`, `)),this.window.scrollTo(0,0)),i}expand(){this.emit($.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),typeof ResizeObserver>`u`?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),t=this.textHeight();(e!=this._size.width||t!=this._size.height)&&(this._size={width:e,height:t},this.onResize&&this.onResize(this._size),this.emit($.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&this.active===!1?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty=`font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height`,e.style.transitionDuration=`0.001ms`,e.style.transitionTimingFunction=`linear`,e.style.transitionDelay=`0`,this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener(`transitionend`,this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=function(e){e.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),n=0;n<e.length;n+=1){var r;try{r=e[n].cssRules}catch{return}if(!r)return;for(var i=0;i<r.length;i+=1)r[i].media&&this.window.matchMedia(r[i].media.mediaText).addListener(t)}}resizeObservers(){this.observer=new ResizeObserver(e=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(e=>{this.resizeCheck()}),this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}imageLoadListeners(){for(var e=this.document.querySelectorAll(`img`),t,n=0;n<e.length;n++)t=e[n],t.naturalWidth!==void 0&&t.naturalWidth===0&&(t.onload=this.expand.bind(this))}fontLoadListeners(){!this.document||!this.document.fonts||this.document.fonts.ready.then(function(){this.resizeCheck()}.bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,t){var n,r={left:0,top:0};if(!this.document)return r;if(this.epubcfi.isCfiString(e)){let i=new Q(e).toRange(this.document,t);if(i){try{if(!i.endContainer||i.startContainer==i.endContainer&&i.startOffset==i.endOffset){let e=i.startContainer.textContent.indexOf(` `,i.startOffset);e==-1&&(e=i.startContainer.textContent.length),i.setEnd(i.startContainer,e)}}catch(e){console.error(`setting end offset to start container length failed`,e)}if(i.startContainer.nodeType===Node.ELEMENT_NODE)n=i.startContainer.getBoundingClientRect(),r.left=n.left,r.top=n.top;else if(it){let e=i.startContainer,t=new Range;try{e.nodeType===at?n=e.getBoundingClientRect():i.startOffset+2<e.length?(t.setStart(e,i.startOffset),t.setEnd(e,i.startOffset+2),n=t.getBoundingClientRect()):i.startOffset-2>0?(t.setStart(e,i.startOffset-2),t.setEnd(e,i.startOffset),n=t.getBoundingClientRect()):n=e.parentNode.getBoundingClientRect()}catch(e){console.error(e,e.stack)}}else n=i.getBoundingClientRect()}}else if(typeof e==`string`&&e.indexOf(`#`)>-1){let t=e.substring(e.indexOf(`#`)+1),r=this.document.getElementById(t);if(r)if(it){let e=new Range;e.selectNode(r),n=e.getBoundingClientRect()}else n=r.getBoundingClientRect()}return n&&(r.left=n.left,r.top=n.top),r}addStylesheet(e){return new Promise(function(t,n){var r,i=!1;if(!this.document){t(!1);return}if(r=this.document.querySelector(`link[href='`+e+`']`),r){t(!0);return}r=this.document.createElement(`link`),r.type=`text/css`,r.rel=`stylesheet`,r.href=e,r.onload=r.onreadystatechange=function(){!i&&(!this.readyState||this.readyState==`complete`)&&(i=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(r)}.bind(this))}_getStylesheetNode(e){var t;return e=`epubjs-inserted-css-`+(e||``),this.document?(t=this.document.getElementById(e),t||(t=this.document.createElement(`style`),t.id=e,this.document.head.appendChild(t)),t):!1}addStylesheetCss(e,t){if(!this.document||!e)return!1;var n=this._getStylesheetNode(t);return n.innerHTML=e,!0}addStylesheetRules(e,t){var n;if(!(!this.document||!e||e.length===0))if(n=this._getStylesheetNode(t).sheet,Object.prototype.toString.call(e)===`[object Array]`)for(var r=0,i=e.length;r<i;r++){var a=1,o=e[r],s=e[r][0],c=``;Object.prototype.toString.call(o[1][0])===`[object Array]`&&(o=o[1],a=0);for(var l=o.length;a<l;a++){var u=o[a];c+=u[0]+`:`+u[1]+(u[2]?` !important`:``)+`;
4
4
  `}n.insertRule(s+`{`+c+`}`,n.cssRules.length)}else Object.keys(e).forEach(t=>{let r=e[t];if(Array.isArray(r))r.forEach(e=>{let r=Object.keys(e).map(t=>`${t}:${e[t]}`).join(`;`);n.insertRule(`${t}{${r}}`,n.cssRules.length)});else{let e=Object.keys(r).map(e=>`${e}:${r[e]}`).join(`;`);n.insertRule(`${t}{${e}}`,n.cssRules.length)}})}addScript(e){return new Promise(function(t,n){var r,i=!1;if(!this.document){t(!1);return}r=this.document.createElement(`script`),r.type=`text/javascript`,r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){!i&&(!this.readyState||this.readyState==`complete`)&&(i=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(r)}.bind(this))}addClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),Ve.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){this.document&&(Ve.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener(`selectionchange`,this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){this.document&&(this.document.removeEventListener(`selectionchange`,this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var e=this.window.getSelection();this.triggerSelectedEvent(e)}.bind(this),250)}triggerSelectedEvent(e){var t,n;e&&e.rangeCount>0&&(t=e.getRangeAt(0),t.collapsed||(n=new Q(t,this.cfiBase).toString(),this.emit($.CONTENTS.SELECTED,n),this.emit($.CONTENTS.SELECTED_RANGE,t)))}range(e,t){return new Q(e).toRange(this.document,t)}cfiFromRange(e,t){return new Q(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new Q(e,this.cfiBase,t).toString()}map(e){return new tt(e).section()}size(e,t){var n={scale:1,scalable:`no`};this.layoutStyle(`scrolling`),e>=0&&(this.width(e),n.width=e,this.css(`padding`,`0 `+e/12+`px`)),t>=0&&(this.height(t),n.height=t),this.css(`margin`,`0`),this.css(`box-sizing`,`border-box`),this.viewport(n)}columns(e,t,n,r,i){let a=oe(`column-axis`),o=oe(`column-gap`),s=oe(`column-width`),c=oe(`column-fill`),l=this.writingMode().indexOf(`vertical`)===0?`vertical`:`horizontal`;this.layoutStyle(`paginated`),i===`rtl`&&l===`horizontal`&&this.direction(i),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:`no`}),this.css(`overflow-y`,`hidden`),this.css(`margin`,`0`,!0),l===`vertical`?(this.css(`padding-top`,r/2+`px`,!0),this.css(`padding-bottom`,r/2+`px`,!0),this.css(`padding-left`,`20px`),this.css(`padding-right`,`20px`),this.css(a,`vertical`)):(this.css(`padding-top`,`20px`),this.css(`padding-bottom`,`20px`),this.css(`padding-left`,r/2+`px`,!0),this.css(`padding-right`,r/2+`px`,!0),this.css(a,`horizontal`)),this.css(`box-sizing`,`border-box`),this.css(`max-width`,`inherit`),this.css(c,`auto`),this.css(o,r+`px`),this.css(s,n+`px`),this.css(`-webkit-line-box-contain`,`block glyphs replaced`)}scaler(e,t,n){var r=`scale(`+e+`)`,i=``;this.css(`transform-origin`,`top left`),(t>=0||n>=0)&&(i=` translate(`+(t||0)+`px, `+(n||0)+`px )`),this.css(`transform`,r+i)}fit(e,t,n){var r=this.viewport(),i=parseInt(r.width),a=parseInt(r.height),o=e/i,s=t/a,c=o<s?o:s;if(this.layoutStyle(`paginated`),this.width(i),this.height(a),this.overflow(`hidden`),this.scaler(c,0,0),this.css(`background-size`,i*c+`px `+a*c+`px`),this.css(`background-color`,`transparent`),n&&n.properties.includes(`page-spread-left`)){var l=e-i*c;this.css(`margin-left`,l+`px`)}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,t,n,r,i){return new tt(t,i).page(this,e,n,r)}linksHandler(){Fe(this.content,e=>{this.emit($.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=oe(`writing-mode`);return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||``}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||`paginated`}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(e){switch(e){case`dom-manipulation`:return!0;case`layout-changes`:return!0;case`touch-events`:return!0;case`mouse-events`:return!0;case`keyboard-events`:return!0;case`spine-scripting`:return!1;default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}};(0,j.default)(ot.prototype);var st=class{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,n,r,i,a){let o=encodeURI(t+e),s=new Q(t).spinePos,c=new ct({type:e,cfiRange:t,data:n,sectionIndex:s,cb:r,className:i,styles:a});return this._annotations[o]=c,s in this._annotationsBySectionIndex?this._annotationsBySectionIndex[s].push(o):this._annotationsBySectionIndex[s]=[o],this.rendition.views().forEach(e=>{c.sectionIndex===e.index&&c.attach(e)}),c}remove(e,t){let n=encodeURI(e+t);if(n in this._annotations){let e=this._annotations[n];if(t&&e.type!==t)return;this.rendition.views().forEach(t=>{this._removeFromAnnotationBySectionIndex(e.sectionIndex,n),e.sectionIndex===t.index&&e.detach(t)}),delete this._annotations[n]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(e=>e!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,n,r,i){return this.add(`highlight`,e,t,n,r,i)}underline(e,t,n,r,i){return this.add(`underline`,e,t,n,r,i)}mark(e,t,n){return this.add(`mark`,e,t,n)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(t=>{this._annotations[t].attach(e)})}clear(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(t=>{this._annotations[t].detach(e)})}show(){}hide(){}},ct=class{constructor({type:e,cfiRange:t,data:n,sectionIndex:r,cb:i,className:a,styles:o}){this.type=e,this.cfiRange=t,this.data=n,this.sectionIndex=r,this.mark=void 0,this.cb=i,this.className=a,this.styles=o}update(e){this.data=e}attach(e){let{cfiRange:t,data:n,type:r,mark:i,cb:a,className:o,styles:s}=this,c;return r===`highlight`?c=e.highlight(t,n,a,o,s):r===`underline`?c=e.underline(t,n,a,o,s):r===`mark`&&(c=e.mark(t,n,a)),this.mark=c,this.emit($.ANNOTATION.ATTACH,c),c}detach(e){let{cfiRange:t,type:n}=this,r;return e&&(n===`highlight`?r=e.unhighlight(t):n===`underline`?r=e.ununderline(t):n===`mark`&&(r=e.unmark(t))),this.mark=void 0,this.emit($.ANNOTATION.DETACH,r),r}text(){}};(0,j.default)(ct.prototype);var lt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createElement=t;function t(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}e.default={createElement:t}})),ut=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.proxyMouse=t,e.clone=n,e.default={proxyMouse:t};function t(e,t){function i(i){for(var a=t.length-1;a>=0;a--){var o=t[a],s=i.clientX,c=i.clientY;if(i.touches&&i.touches.length&&(s=i.touches[0].clientX,c=i.touches[0].clientY),r(o,e,s,c)){o.dispatchEvent(n(i));break}}}if(e.nodeName===`iframe`||e.nodeName===`IFRAME`)try{this.target=e.contentDocument}catch{this.target=e}else this.target=e;for(var a=[`mouseup`,`mousedown`,`click`,`touchstart`],o=0;o<a.length;o++){var s=a[o];this.target.addEventListener(s,function(e){return i(e)},!1)}}function n(e){var t=Object.assign({},e,{bubbles:!1});try{return new MouseEvent(e.type,t)}catch{var n=document.createEvent(`MouseEvents`);return n.initMouseEvent(e.type,!1,t.cancelable,t.view,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget),n}}function r(e,t,n,r){var i=t.getBoundingClientRect();function a(e,t,n){var r=e.top-i.top,a=e.left-i.left,o=r+e.height,s=a+e.width;return r<=n&&a<=t&&o>n&&s>t}if(!a(e.getBoundingClientRect(),n,r))return!1;for(var o=e.getClientRects(),s=0,c=o.length;s<c;s++)if(a(o[s],n,r))return!0;return!1}})),dt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Underline=e.Highlight=e.Mark=e.Pane=void 0;var t=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=a(lt()),i=a(ut());function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.Pane=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document.body;c(this,e),this.target=t,this.element=r.default.createElement(`svg`),this.marks=[],this.element.style.position=`absolute`,this.element.setAttribute(`pointer-events`,`none`),i.default.proxyMouse(this.target,this.marks),this.container=n,this.container.appendChild(this.element),this.render()}return n(e,[{key:`addMark`,value:function(e){var t=r.default.createElement(`g`);return this.element.appendChild(t),e.bind(t,this.container),this.marks.push(e),e.render(),e}},{key:`removeMark`,value:function(e){var t=this.marks.indexOf(e);if(t!==-1){var n=e.unbind();this.element.removeChild(n),this.marks.splice(t,1)}}},{key:`render`,value:function(){u(this.element,l(this.target,this.container));var e=!0,t=!1,n=void 0;try{for(var r=this.marks[Symbol.iterator](),i;!(e=(i=r.next()).done);e=!0)i.value.render()}catch(e){t=!0,n=e}finally{try{!e&&r.return&&r.return()}finally{if(t)throw n}}}}]),e}(),e.Underline=function(e){s(t,e);function t(e,n,r,i){return c(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,i))}return n(t,[{key:`render`,value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var e=this.element.ownerDocument.createDocumentFragment(),t=this.filteredRanges(),n=this.element.getBoundingClientRect(),i=this.container.getBoundingClientRect(),a=0,o=t.length;a<o;a++){var s=t[a],c=r.default.createElement(`rect`);c.setAttribute(`x`,s.left-n.left+i.left),c.setAttribute(`y`,s.top-n.top+i.top),c.setAttribute(`height`,s.height),c.setAttribute(`width`,s.width),c.setAttribute(`fill`,`none`);var l=r.default.createElement(`line`);l.setAttribute(`x1`,s.left-n.left+i.left),l.setAttribute(`x2`,s.left-n.left+i.left+s.width),l.setAttribute(`y1`,s.top-n.top+i.top+s.height-1),l.setAttribute(`y2`,s.top-n.top+i.top+s.height-1),l.setAttribute(`stroke-width`,1),l.setAttribute(`stroke`,`black`),l.setAttribute(`stroke-linecap`,`square`),e.appendChild(c),e.appendChild(l)}this.element.appendChild(e)}}]),t}(e.Highlight=function(e){s(i,e);function i(e,t,n,r){c(this,i);var a=o(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return a.range=e,a.className=t,a.data=n||{},a.attributes=r||{},a}return n(i,[{key:`bind`,value:function(e,n){for(var r in t(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),`bind`,this).call(this,e,n),this.data)this.data.hasOwnProperty(r)&&(this.element.dataset[r]=this.data[r]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&this.element.setAttribute(r,this.attributes[r]);this.className&&this.element.classList.add(this.className)}},{key:`render`,value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var e=this.element.ownerDocument.createDocumentFragment(),t=this.filteredRanges(),n=this.element.getBoundingClientRect(),i=this.container.getBoundingClientRect(),a=0,o=t.length;a<o;a++){var s=t[a],c=r.default.createElement(`rect`);c.setAttribute(`x`,s.left-n.left+i.left),c.setAttribute(`y`,s.top-n.top+i.top),c.setAttribute(`height`,s.height),c.setAttribute(`width`,s.width),e.appendChild(c)}this.element.appendChild(e)}}]),i}(e.Mark=function(){function e(){c(this,e),this.element=null}return n(e,[{key:`bind`,value:function(e,t){this.element=e,this.container=t}},{key:`unbind`,value:function(){var e=this.element;return this.element=null,e}},{key:`render`,value:function(){}},{key:`dispatchEvent`,value:function(e){this.element&&this.element.dispatchEvent(e)}},{key:`getBoundingClientRect`,value:function(){return this.element.getBoundingClientRect()}},{key:`getClientRects`,value:function(){for(var e=[],t=this.element.firstChild;t;)e.push(t.getBoundingClientRect()),t=t.nextSibling;return e}},{key:`filteredRanges`,value:function(){var e=Array.from(this.range.getClientRects());return e.filter(function(t){for(var n=0;n<e.length;n++){if(e[n]===t)return!0;if(d(e[n],t))return!1}return!0})}}]),e}()));function l(e,t){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{top:r.top-n.top,left:r.left-n.left,height:e.scrollHeight,width:e.scrollWidth}}function u(e,t){e.style.setProperty(`top`,t.top+`px`,`important`),e.style.setProperty(`left`,t.left+`px`,`important`),e.style.setProperty(`height`,t.height+`px`,`important`),e.style.setProperty(`width`,t.width+`px`,`important`)}function d(e,t){return t.right<=e.right&&t.left>=e.left&&t.top>=e.top&&t.bottom<=e.bottom}}))(),ft=class{constructor(e,t){this.settings=L({ignoreClass:``,axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},t||{}),this.id=`epubjs-view-`+ne(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new Q,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement(`div`);return t.classList.add(`epub-view`),t.style.height=`0px`,t.style.width=`0px`,t.style.overflow=`hidden`,t.style.position=`relative`,t.style.display=`block`,e&&e==`horizontal`?t.style.flex=`none`:t.style.flex=`initial`,t}create(){return this.iframe?this.iframe:(this.element||=this.createContainer(),this.iframe=document.createElement(`iframe`),this.iframe.id=this.id,this.iframe.scrolling=`no`,this.iframe.style.overflow=`hidden`,this.iframe.seamless=`seamless`,this.iframe.style.border=`none`,this.iframe.sandbox=`allow-same-origin`,this.settings.allowScriptedContent&&(this.iframe.sandbox+=` allow-scripts`),this.settings.allowPopups&&(this.iframe.sandbox+=` allow-popups`),this.iframe.setAttribute(`enable-annotation`,`true`),this.resizing=!0,this.element.style.visibility=`hidden`,this.iframe.style.visibility=`hidden`,this.iframe.style.width=`0`,this.iframe.style.height=`0`,this._width=0,this._height=0,this.element.setAttribute(`ref`,this.index),this.added=!0,this.elementBounds=de(this.element),`srcdoc`in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?`srcdoc`:`write`),this.iframe)}render(e,t){return this.create(),this.size(),this.sectionRender||=this.section.render(e),this.sectionRender.then(function(e){return this.load(e)}.bind(this)).then(function(){let e=this.contents.writingMode(),t;return t=this.settings.flow===`scrolled`?e.indexOf(`vertical`)===0?`horizontal`:`vertical`:e.indexOf(`vertical`)===0?`vertical`:`horizontal`,e.indexOf(`vertical`)===0&&this.settings.flow===`paginated`&&(this.layout.delta=this.layout.height),this.setAxis(t),this.emit($.VIEWS.AXIS,t),this.setWritingMode(e),this.emit($.VIEWS.WRITING_MODE,e),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((e,t)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+`px`),e()})}.bind(this),function(e){return this.emit($.VIEWS.LOAD_ERROR,e),new Promise((t,n)=>{n(e)})}.bind(this)).then(function(){this.emit($.VIEWS.RENDERED,this.section)}.bind(this))}reset(){this.iframe&&(this.iframe.style.width=`0`,this.iframe.style.height=`0`,this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var n=e||this.settings.width,r=t||this.settings.height;this.layout.name===`pre-paginated`?this.lock(`both`,n,r):this.settings.axis===`horizontal`?this.lock(`height`,n,r):this.lock(`width`,n,r),this.settings.width=n,this.settings.height=r}lock(e,t,n){var r=fe(this.element),i=this.iframe?fe(this.iframe):{width:0,height:0};e==`width`&&I(t)&&(this.lockedWidth=t-r.width-i.width),e==`height`&&I(n)&&(this.lockedHeight=n-r.height-i.height),e===`both`&&I(t)&&I(n)&&(this.lockedWidth=t-r.width-i.width,this.lockedHeight=n-r.height-i.height),this.displayed&&this.iframe&&this.expand()}expand(e){var t=this.lockedWidth,n=this.lockedHeight,r;!this.iframe||this._expanding||(this._expanding=!0,this.layout.name===`pre-paginated`?(t=this.layout.columnWidth,n=this.layout.height):this.settings.axis===`horizontal`?(t=this.contents.textWidth(),t%this.layout.pageWidth>0&&(t=Math.ceil(t/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(r=t/this.layout.pageWidth,this.layout.divisor>1&&this.layout.name===`reflowable`&&r%2>0&&(t+=this.layout.pageWidth))):this.settings.axis===`vertical`&&(n=this.contents.textHeight(),this.settings.flow===`paginated`&&n%this.layout.height>0&&(n=Math.ceil(n/this.layout.height)*this.layout.height)),(this._needsReframe||t!=this._width||n!=this._height)&&this.reframe(t,n),this._expanding=!1)}reframe(e,t){var n;I(e)&&(this.element.style.width=e+`px`,this.iframe.style.width=e+`px`,this._width=e),I(t)&&(this.element.style.height=t+`px`,this.iframe.style.height=t+`px`,this._height=t),n={width:e,height:t,widthDelta:this.prevBounds?e-this.prevBounds.width:e,heightDelta:this.prevBounds?t-this.prevBounds.height:t},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let e;for(let t in this.marks)this.marks.hasOwnProperty(t)&&(e=this.marks[t],this.placeMark(e.element,e.range))}),this.onResize(this,n),this.emit($.VIEWS.RESIZED,n),this.prevBounds=n,this.elementBounds=de(this.element)}load(e){var t=new Y,n=t.promise;if(!this.iframe)return t.reject(Error(`No Iframe Available`)),n;if(this.iframe.onload=function(e){this.onLoad(e,t)}.bind(this),this.settings.method===`blobUrl`)this.blobUrl=ge(e,`application/xhtml+xml`),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if(this.settings.method===`srcdoc`)this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(Error(`No Document Available`)),n;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var r=this;MSApp.execUnsafeLocalFunction(function(){r.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return n}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new ot(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var n=this.document.querySelector(`link[rel='canonical']`);n?n.setAttribute(`href`,this.section.canonical):(n=this.document.createElement(`link`),n.setAttribute(`rel`,`canonical`),n.setAttribute(`href`,this.section.canonical),this.document.querySelector(`head`).appendChild(n)),this.contents.on($.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on($.CONTENTS.RESIZE,e=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,e==`horizontal`?this.element.style.flex=`none`:this.element.style.flex=`initial`,this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var t=new Y;return this.displayed?t.resolve(this):this.render(e).then(function(){this.emit($.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}.bind(this),function(e){t.reject(e,this)}),t.promise}show(){this.element.style.visibility=`visible`,this.iframe&&(this.iframe.style.visibility=`visible`,this.iframe.style.transform=`translateZ(0)`,this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit($.VIEWS.SHOWN,this)}hide(){this.element.style.visibility=`hidden`,this.iframe.style.visibility=`hidden`,this.stopExpanding=!0,this.emit($.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){this.iframe.getBoundingClientRect();var t=this.contents.locationOf(e,this.settings.ignoreClass);return{left:t.left,top:t.top}}onDisplayed(e){}onResize(e,t){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=de(this.element)),this.elementBounds}highlight(e,t={},n,r=`epubjs-hl`,i={}){if(!this.contents)return;let a=Object.assign({fill:`yellow`,"fill-opacity":`0.3`,"mix-blend-mode":`multiply`},i),o=this.contents.range(e),s=()=>{this.emit($.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||=new dt.Pane(this.iframe,this.element);let c=new dt.Highlight(o,r,t,a),l=this.pane.addMark(c);return this.highlights[e]={mark:l,element:l.element,listeners:[s,n]},l.element.setAttribute(`ref`,r),l.element.addEventListener(`click`,s),l.element.addEventListener(`touchstart`,s),n&&(l.element.addEventListener(`click`,n),l.element.addEventListener(`touchstart`,n)),l}underline(e,t={},n,r=`epubjs-ul`,i={}){if(!this.contents)return;let a=Object.assign({stroke:`black`,"stroke-opacity":`0.3`,"mix-blend-mode":`multiply`},i),o=this.contents.range(e),s=()=>{this.emit($.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||=new dt.Pane(this.iframe,this.element);let c=new dt.Underline(o,r,t,a),l=this.pane.addMark(c);return this.underlines[e]={mark:l,element:l.element,listeners:[s,n]},l.element.setAttribute(`ref`,r),l.element.addEventListener(`click`,s),l.element.addEventListener(`touchstart`,s),n&&(l.element.addEventListener(`click`,n),l.element.addEventListener(`touchstart`,n)),l}mark(e,t={},n){if(!this.contents)return;if(e in this.marks)return this.marks[e];let r=this.contents.range(e);if(!r)return;let i=r.commonAncestorContainer,a=i.nodeType===1?i:i.parentNode,o=n=>{this.emit($.VIEWS.MARK_CLICKED,e,t)};r.collapsed&&i.nodeType===1?(r=new Range,r.selectNodeContents(i)):r.collapsed&&(r=new Range,r.selectNodeContents(a));let s=this.document.createElement(`a`);return s.setAttribute(`ref`,`epubjs-mk`),s.style.position=`absolute`,s.dataset.epubcfi=e,t&&Object.keys(t).forEach(e=>{s.dataset[e]=t[e]}),n&&(s.addEventListener(`click`,n),s.addEventListener(`touchstart`,n)),s.addEventListener(`click`,o),s.addEventListener(`touchstart`,o),this.placeMark(s,r),this.element.appendChild(s),this.marks[e]={element:s,range:r,listeners:[o,n]},a}placeMark(e,t){let n,r,i;if(this.layout.name===`pre-paginated`||this.settings.axis!==`horizontal`){let e=t.getBoundingClientRect();n=e.top,r=e.right}else{let e=t.getClientRects(),o;for(var a=0;a!=e.length;a++)o=e[a],(!i||o.left<i)&&(i=o.left,r=Math.ceil(i/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,n=o.top)}e.style.top=`${n}px`,e.style.left=`${r}px`}unhighlight(e){let t;e in this.highlights&&(t=this.highlights[e],this.pane.removeMark(t.mark),t.listeners.forEach(e=>{e&&(t.element.removeEventListener(`click`,e),t.element.removeEventListener(`touchstart`,e))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(e=>{e&&(t.element.removeEventListener(`click`,e),t.element.removeEventListener(`touchstart`,e))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(e=>{e&&(t.element.removeEventListener(`click`,e),t.element.removeEventListener(`touchstart`,e))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&H(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&=(this.pane.element.remove(),void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}};(0,j.default)(ft.prototype);function pt(){var e=`reverse`,t=mt();return document.body.appendChild(t),t.scrollLeft>0?e=`default`:typeof Element<`u`&&Element.prototype.scrollIntoView?(t.children[0].children[1].scrollIntoView(),t.scrollLeft<0&&(e=`negative`)):(t.scrollLeft=1,t.scrollLeft===0&&(e=`negative`)),document.body.removeChild(t),e}function mt(){var e=document.createElement(`div`);e.dir=`rtl`,e.style.position=`fixed`,e.style.width=`1px`,e.style.height=`1px`,e.style.top=`0px`,e.style.left=`0px`,e.style.overflow=`hidden`;var t=document.createElement(`div`);t.style.width=`2px`;var n=document.createElement(`span`);n.style.width=`1px`,n.style.display=`inline-block`;var r=document.createElement(`span`);return r.style.width=`1px`,r.style.display=`inline-block`,t.appendChild(n),t.appendChild(r),e.appendChild(t),e}var ht=t(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),gt=t(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),_t=t(((e,t)=>{var n=gt(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),vt=t(((e,t)=>{var n=_t();t.exports=function(){return n.Date.now()}})),yt=t(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),bt=t(((e,t)=>{var n=yt(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),xt=t(((e,t)=>{t.exports=_t().Symbol})),St=t(((e,t)=>{var n=xt(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Ct=t(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),wt=t(((e,t)=>{var n=xt(),r=St(),i=Ct(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Tt=t(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Et=t(((e,t)=>{var n=wt(),r=Tt(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Dt=t(((e,t)=>{var n=bt(),r=ht(),i=Et(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Ot=t(((e,t)=>{var n=ht(),r=vt(),i=Dt(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),kt=n(t(((e,t)=>{var n=Ot(),r=ht(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))()),At=class{constructor(e){this.settings=e||{},this.id=`epubjs-container-`+ne(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,n=e.width,r=e.overflow||!1,i=e.axis||`vertical`,a=e.direction;L(this.settings,e),e.height&&I(e.height)&&(t=e.height+`px`),e.width&&I(e.width)&&(n=e.width+`px`);let o=document.createElement(`div`);return o.id=this.id,o.classList.add(`epub-container`),o.style.wordSpacing=`0`,o.style.lineHeight=`0`,o.style.verticalAlign=`top`,o.style.position=`relative`,i===`horizontal`&&(o.style.display=`flex`,o.style.flexDirection=`row`,o.style.flexWrap=`nowrap`),n&&(o.style.width=n),t&&(o.style.height=t),r&&(r===`scroll`&&i===`vertical`?(o.style[`overflow-y`]=r,o.style[`overflow-x`]=`hidden`):r===`scroll`&&i===`horizontal`?(o.style[`overflow-y`]=`hidden`,o.style[`overflow-x`]=r):o.style.overflow=r),a&&(o.dir=a,o.style.direction=a),a&&this.settings.fullsize&&(document.body.style.direction=a),o}wrap(e){var t=document.createElement(`div`);return t.style.visibility=`hidden`,t.style.overflow=`hidden`,t.style.width=`0`,t.style.height=`0`,t.appendChild(e),t}getElement(e){var t;if(ie(e)?t=e:typeof e==`string`&&(t=document.getElementById(e)),!t)throw Error(`Not an Element`);return t}attachTo(e){var t=this.getElement(e),n;if(t)return n=this.settings.hidden?this.wrapper:this.container,t.appendChild(n),this.element=t,t}getContainer(){return this.container}onResize(e){(!I(this.settings.width)||!I(this.settings.height))&&(this.resizeFunc=(0,kt.default)(e,50),window.addEventListener(`resize`,this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener(`orientationchange`,this.orientationChangeFunc,!1)}size(e,t){var n;let r=e||this.settings.width,i=t||this.settings.height;e===null?(n=this.element.getBoundingClientRect(),n.width&&(e=Math.floor(n.width),this.container.style.width=e+`px`)):I(e)?this.container.style.width=e+`px`:this.container.style.width=e,t===null?(n||=this.element.getBoundingClientRect(),n.height&&(t=n.height,this.container.style.height=t+`px`)):I(t)?this.container.style.height=t+`px`:this.container.style.height=t,I(e)||(e=this.container.clientWidth),I(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles[`padding-left`])||0,right:parseFloat(this.containerStyles[`padding-right`])||0,top:parseFloat(this.containerStyles[`padding-top`])||0,bottom:parseFloat(this.containerStyles[`padding-bottom`])||0};let a=pe(),o=window.getComputedStyle(document.body),s={left:parseFloat(o[`padding-left`])||0,right:parseFloat(o[`padding-right`])||0,top:parseFloat(o[`padding-top`])||0,bottom:parseFloat(o[`padding-bottom`])||0};return r||(e=a.width-s.left-s.right),(this.settings.fullsize&&!i||!i)&&(t=a.height-s.top-s.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return this.container.style.overflow!==`visible`&&(e=this.container&&this.container.getBoundingClientRect()),!e||!e.width||!e.height?pe():e}getSheet(){var e=document.createElement(`style`);return e.appendChild(document.createTextNode(``)),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var n=`#`+this.id+` `,r=``;this.sheet||=this.getSheet(),t.forEach(function(e){for(var t in e)e.hasOwnProperty(t)&&(r+=t+`:`+e[t]+`;`)}),this.sheet.insertRule(n+e+` {`+r+`}`,0)}axis(e){e===`horizontal`?(this.container.style.display=`flex`,this.container.style.flexDirection=`row`,this.container.style.flexWrap=`nowrap`):this.container.style.display=`block`,this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&(e===`scroll`&&this.settings.axis===`vertical`?(this.container.style[`overflow-y`]=e,this.container.style[`overflow-x`]=`hidden`):e===`scroll`&&this.settings.axis===`horizontal`?(this.container.style[`overflow-y`]=`hidden`,this.container.style[`overflow-x`]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){this.element&&(this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener(`resize`,this.resizeFunc),window.removeEventListener(`orientationChange`,this.orientationChangeFunc))}},jt=class{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t<this.container.children.length?this.container.insertBefore(e.element,this.container.children[t]):this.container.appendChild(e.element)),this.length++,e}remove(e){var t=this._views.indexOf(e);t>-1&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,t=this.length;if(this.length){for(var n=0;n<t;n++)e=this._views[n],this.destroy(e);this._views=[],this.length=0}}find(e){for(var t,n=this.length,r=0;r<n;r++)if(t=this._views[r],t.displayed&&t.section.index==e.index)return t}displayed(){for(var e=[],t,n=this.length,r=0;r<n;r++)t=this._views[r],t.displayed&&e.push(t);return e}show(){for(var e,t=this.length,n=0;n<t;n++)e=this._views[n],e.displayed&&e.show();this.hidden=!1}hide(){for(var e,t=this.length,n=0;n<t;n++)e=this._views[n],e.displayed&&e.hide();this.hidden=!0}},Mt=class{constructor(e){this.name=`default`,this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new Be(this),this.settings=L(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:`scrolled`,ignoreClass:``,fullsize:void 0,allowScriptedContent:!1,allowPopups:!1}),L(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.rendered=!1}render(e,t){let n=e.tagName;this.settings.fullsize===void 0&&n&&(n.toLowerCase()==`body`||n.toLowerCase()==`html`)&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow=`visible`,this.overflow=this.settings.overflow),this.settings.size=t,this.settings.rtlScrollType=pt(),this.stage=new At({width:t.width,height:t.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new jt(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener(`unload`,function(e){this.destroy()}.bind(this)),e=this.settings.fullsize?window:this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener(`scroll`,this._onScroll)}removeEventListeners(){(this.settings.fullsize?window:this.container).removeEventListener(`scroll`,this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(e){let{orientation:t}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout(function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit($.MANAGERS.ORIENTATION_CHANGE,t)}.bind(this),500)}onResized(e){this.resize()}resize(e,t,n){let r=this.stage.size(e,t);if(this.winBounds=pe(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height){this._stageSize=void 0;return}this._stageSize&&this._stageSize.width===r.width&&this._stageSize.height===r.height||(this._stageSize=r,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit($.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},n))}createView(e,t){return new this.View(e,L(this.viewSettings,{forceRight:t}))}handleNextPrePaginated(e,t,n){let r;if(this.layout.name===`pre-paginated`&&this.layout.divisor>1){if(e||t.index===0)return;if(r=t.next(),r&&!r.properties.includes(`page-spread-left`))return n.call(this,r)}}display(e,t){var n=new Y,r=n.promise;(t===e.href||I(t))&&(t=void 0);var i=this.views.find(e);if(i&&e&&this.layout.name!==`pre-paginated`){let e=i.offset();if(this.settings.direction===`ltr`)this.scrollTo(e.left,e.top,!0);else{let t=i.width();this.scrollTo(e.left+t,e.top,!0)}if(t){let e=i.locationOf(t),n=i.width();this.moveTo(e,n)}return n.resolve(),r}this.clear();let a=!1;return this.layout.name===`pre-paginated`&&this.layout.divisor===2&&e.properties.includes(`page-spread-right`)&&(a=!0),this.add(e,a).then(function(e){if(t){let n=e.locationOf(t),r=e.width();this.moveTo(n,r)}}.bind(this),e=>{n.reject(e)}).then(function(){return this.handleNextPrePaginated(a,e,this.add)}.bind(this)).then(function(){this.views.show(),n.resolve()}.bind(this)),r}afterDisplayed(e){this.emit($.MANAGERS.ADDED,e)}afterResized(e){this.emit($.MANAGERS.RESIZE,e.section)}moveTo(e,t){var n=0,r=0;this.isPaginated?(n=Math.floor(e.left/this.layout.delta)*this.layout.delta,n+this.layout.delta>this.container.scrollWidth&&(n=this.container.scrollWidth-this.layout.delta),r=Math.floor(e.top/this.layout.delta)*this.layout.delta,r+this.layout.delta>this.container.scrollHeight&&(r=this.container.scrollHeight-this.layout.delta)):r=e.top,this.settings.direction===`rtl`&&(n+=this.layout.delta,n-=t),this.scrollTo(n,r,!0)}add(e,t){var n=this.createView(e,t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}append(e,t){var n=this.createView(e,t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}prepend(e,t){var n=this.createView(e,t);return n.on($.VIEWS.RESIZED,e=>{this.counter(e)}),this.views.prepend(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}counter(e){this.settings.axis===`vertical`?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,t;let n=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis===`horizontal`&&(!n||n===`ltr`)?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,t<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):this.isPaginated&&this.settings.axis===`horizontal`&&n===`rtl`?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft,t>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(t=this.container.scrollLeft+this.layout.delta*-1,t>this.container.scrollWidth*-1?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next())):this.isPaginated&&this.settings.axis===`vertical`?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()):e=this.views.last().section.next(),e)){this.clear(),this.updateLayout();let t=!1;return this.layout.name===`pre-paginated`&&this.layout.divisor===2&&e.properties.includes(`page-spread-right`)&&(t=!0),this.append(e,t).then(function(){return this.handleNextPrePaginated(t,e,this.append)}.bind(this),e=>e).then(function(){!this.isPaginated&&this.settings.axis===`horizontal`&&this.settings.direction===`rtl`&&this.settings.rtlScrollType==="default"&&this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}prev(){var e,t;let n=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis===`horizontal`&&(!n||n===`ltr`)?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft,t>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):this.isPaginated&&this.settings.axis===`horizontal`&&n===`rtl`?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft+this.container.offsetWidth,t<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(t=this.container.scrollLeft,t<0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev())):this.isPaginated&&this.settings.axis===`vertical`?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()):e=this.views.first().section.prev(),e)){this.clear(),this.updateLayout();let t=!1;return this.layout.name===`pre-paginated`&&this.layout.divisor===2&&typeof e.prev()!=`object`&&(t=!0),this.prepend(e,t).then(function(){var t;if(this.layout.name===`pre-paginated`&&this.layout.divisor>1&&(t=e.prev(),t))return this.prepend(t)}.bind(this),e=>e).then(function(){this.isPaginated&&this.settings.axis===`horizontal`&&(this.settings.direction===`rtl`?this.settings.rtlScrollType==="default"?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth*-1+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&this.settings.axis===`horizontal`?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),n=t.height<window.innerHeight?t.height:window.innerHeight,r=t.width<window.innerWidth?t.width:window.innerWidth,i=this.settings.axis===`vertical`;this.settings.direction;let a=0;return this.settings.fullsize&&(a=i?window.scrollY:window.scrollX),e.map(e=>{let{index:o,href:s}=e.section,c=e.position(),l=e.width(),u=e.height(),d,f,p,m;i?(d=a+t.top-c.top+0,f=d+n-0,m=this.layout.count(u,n).pages,p=n):(d=a+t.left-c.left+0,f=d+r-0,m=this.layout.count(l,r).pages,p=r);let h=Math.ceil(d/p),g=[],_=Math.ceil(f/p);if(this.settings.direction===`rtl`&&!i){let e=h;h=m-_,_=m-e}g=[];for(var v=h;v<=_;v++){let e=v+1;g.push(e)}let y=this.mapping.page(e.contents,e.section.cfiBase,d,f);return{index:o,href:s,pages:g,totalPages:m,mapping:y}})}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),n=0,r=0;return this.settings.fullsize&&(n=window.scrollX),e.map(e=>{let{index:i,href:a}=e.section,o,s=e.position(),c=e.width(),l,u,d;this.settings.direction===`rtl`?(o=t.right-n,d=Math.min(Math.abs(o-s.left),this.layout.width)-r,u=s.width-(s.right-o)-r,l=u-d):(o=t.left+n,d=Math.min(s.right-o,this.layout.width)-r,l=o-s.left+r,u=l+d),r+=d;let f=this.mapping.page(e.contents,e.section.cfiBase,l,u),p=this.layout.count(c).pages,m=Math.floor(l/this.layout.pageWidth),h=[],g=Math.floor(u/this.layout.pageWidth);if(m<0&&(m=0,g+=1),this.settings.direction===`rtl`){let e=m;m=p-g,g=p-e}for(var _=m+1;_<=g;_++){let e=_;h.push(e)}return{index:i,href:a,pages:h,totalPages:p,mapping:f}})}isVisible(e,t,n,r){var i=e.position(),a=r||this.bounds();return this.settings.axis===`horizontal`&&i.right>a.left-t&&i.left<a.right+n?!0:this.settings.axis===`vertical`&&i.bottom>a.top-t&&i.top<a.bottom+n}visible(){for(var e=this.bounds(),t=this.views.displayed(),n=t.length,r=[],i,a,o=0;o<n;o++)a=t[o],i=this.isVisible(a,0,0,e),i===!0&&r.push(a);return r}scrollBy(e,t,n){let r=this.settings.direction===`rtl`?-1:1;n&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*r,t*r):(e&&(this.container.scrollLeft+=e*r),t&&(this.container.scrollTop+=t)),this.scrolled=!0}scrollTo(e,t,n){n&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,t):(this.container.scrollLeft=e,this.container.scrollTop=t),this.scrolled=!0}onScroll(){let e,t;this.settings.fullsize?(e=window.scrollY,t=window.scrollX):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:(this.emit($.MANAGERS.SCROLL,{top:e,left:t}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit($.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),20))}bounds(){return this.stage.bounds()}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&this.views.length>0&&this.layout.name===`pre-paginated`&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new tt(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(t){t&&t.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){!t&&e===this.settings.axis||(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&=new tt(this.layout.props,this.settings.direction,this.settings.axis),this.layout&&(e===`vertical`?this.layout.spread(`none`):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t=`auto`){let n=e===`paginated`||e===`auto`;this.isPaginated=n,e===`scrolled-doc`||e===`scrolled-continuous`||e===`scrolled`?this.updateAxis(`vertical`):this.updateAxis(`horizontal`),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=n?`hidden`:t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views&&this.views.forEach(function(t){let n=t&&t.contents;n&&e.push(n)}),e}direction(e=`ltr`){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}};(0,j.default)(Mt.prototype);var Nt=Math.PI/2,Pt={easeOutSine:function(e){return Math.sin(e*Nt)},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInOutQuint:function(e){return(e/=.5)<1?.5*e**5:.5*((e-2)**5+2)},easeInCubic:function(e){return e**3}},Ft=class{constructor(e,t){this.settings=L({duration:80,minVelocity:.2,minDistance:10,easing:Pt.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling=`touch`),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=this.settings.duration*2,this.isVertical=this.manager.settings.axis===`vertical`,!(!this.manager.isPaginated||this.isVertical)&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!(`ontouchstart`in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow=`hidden`}enableScroll(){this.element.style.overflow=``}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener(`resize`,this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener(`scroll`,this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener(`touchstart`,this._onTouchStart,{passive:!0}),this.on(`touchstart`,this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener(`touchmove`,this._onTouchMove,{passive:!0}),this.on(`touchmove`,this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener(`touchend`,this._onTouchEnd,{passive:!0}),this.on(`touchend`,this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on($.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener(`resize`,this._onResize),this._onResize=void 0,this.scroller.removeEventListener(`scroll`,this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener(`touchstart`,this._onTouchStart,{passive:!0}),this.off(`touchstart`,this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener(`touchmove`,this._onTouchMove,{passive:!0}),this.off(`touchmove`,this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener(`touchend`,this._onTouchEnd,{passive:!0}),this.off(`touchend`,this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off($.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;[`touchstart`,`touchmove`,`touchend`].forEach(e=>{t.on(e,e=>this.triggerViewEvent(e,t))})}triggerViewEvent(e,t){this.emit(e.type,e,t)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:t,screenY:n}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=t,this.startTouchY=n,this.startTime=this.now()),this.endTouchX=t,this.endTouchY=n,this.endTime=this.now()}onTouchMove(e){let{screenX:t,screenY:n}=e.touches[0],r=Math.abs(n-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&r<10&&(this.element.scrollLeft-=t-this.endTouchX),this.endTouchX=t,this.endTouchY=n,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let t=this.wasSwiped();t===0?this.snap():this.snap(t),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,n=Math.abs(t),r=t/(this.endTime-this.startTime),i=this.settings.minVelocity;if(n<=this.settings.minDistance||n>=e)return 0;if(r>i)return-1;if(r<-i)return 1}needsSnap(){return this.scrollLeft%(this.layout.pageWidth*this.layout.divisor)!==0}snap(e=0){let t=this.scrollLeft,n=this.layout.pageWidth*this.layout.divisor,r=Math.round(t/n)*n;return e&&(r+=e*n),this.smoothScrollTo(r)}smoothScrollTo(e){let t=new Y,n=this.scrollLeft,r=this.now(),i=this.settings.duration,a=this.settings.easing;this.snapping=!0;function o(){let s=this.now(),c=Math.min(1,(s-r)/i);if(a(c),this.touchCanceler||this.resizeCanceler){this.resizeCanceler=!1,this.snapping=!1,t.resolve();return}c<1?(window.requestAnimationFrame(o.bind(this)),this.scrollTo(n+(e-n)*c,0)):(this.scrollTo(e,0),this.snapping=!1,t.resolve())}return o.call(this),t.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return`now`in window.performance?performance.now():new Date().getTime()}destroy(){this.scroller&&=(this.fullsize&&this.enableScroll(),this.removeListeners(),void 0)}};(0,j.default)(Ft.prototype);var It=n(Ot()),Lt=class extends Mt{constructor(e){super(e),this.name=`continuous`,this.settings=L(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:`scrolled`,offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10,allowScriptedContent:!1,allowPopups:!1}),L(this.settings,e.settings||{}),e.settings.gap!=`undefined`&&e.settings.gap===0&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,t){return Mt.prototype.display.call(this,e,t).then(function(){return this.fill()}.bind(this))}fill(e){var t=e||new Y;return this.q.enqueue(()=>this.check()).then(e=>{e?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,n=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,t+this.settings.offsetDelta):(n=e.top,e.top+this.settings.offsetDelta),(t>0||n>0)&&this.scrollBy(t,n,!0)}afterResized(e){this.emit($.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on($.VIEWS.RESIZED,e=>{t.expanded=!0}),t.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on($.VIEWS.RESIZED,e=>{t.expanded=!0}),t.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on($.VIEWS.RESIZED,e=>{this.counter(e),t.expanded=!0}),t.on($.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on($.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){this.settings.axis===`vertical`?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t=this.bounds(),n=this.views.all(),r=n.length,i=[],a=e===void 0?this.settings.offset||0:e,o,s,c=new Y,l=[],u=0;u<r;u++)if(s=n[u],o=this.isVisible(s,a,a,t),o===!0){if(s.displayed)s.show();else{let e=s.display(this.request).then(function(e){e.show()},e=>{s.hide()});l.push(e)}i.push(s)}else this.q.enqueue(s.destroy.bind(s)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return l.length?Promise.all(l).catch(e=>{c.reject(e)}):(c.resolve(),c.promise)}check(e,t){var n=new Y,r=[],i=this.settings.axis===`horizontal`,a=this.settings.offset||0;e&&i&&(a=e),t&&!i&&(a=t);var o=this._bounds;let s=i?this.scrollLeft:this.scrollTop,c=i?Math.floor(o.width):o.height,l=i?this.container.scrollWidth:this.container.scrollHeight,u=this.writingMode&&this.writingMode.indexOf(`vertical`)===0?`vertical`:`horizontal`,d=this.settings.rtlScrollType,f=this.settings.direction===`rtl`;this.settings.fullsize?(i&&f&&d===`negative`||!i&&f&&d==="default")&&(s*=-1):(f&&d==="default"&&u===`horizontal`&&(s=l-c-s),f&&d===`negative`&&u===`horizontal`&&(s*=-1));let p=()=>{let e=this.views.first(),t=e&&e.section.prev();t&&r.push(this.prepend(t))},m=()=>{let e=this.views.last(),t=e&&e.section.next();t&&r.push(this.append(t))},h=s+c+a,g=s-a;h>=l&&m(),g<0&&p();let _=r.map(e=>e.display(this.request));return r.length?Promise.all(_).then(()=>this.check()).then(()=>this.update(a),e=>e):(this.q.enqueue(function(){this.update()}.bind(this)),n.resolve(!1),n.promise)}trim(){for(var e=new Y,t=this.views.displayed(),n=t[0],r=t[t.length-1],i=this.views.indexOf(n),a=this.views.indexOf(r),o=this.views.slice(0,i),s=this.views.slice(a+1),c=0;c<o.length-1;c++)this.erase(o[c],o);for(var l=1;l<s.length;l++)this.erase(s[l]);return e.resolve(),e.promise}erase(e,t){var n,r;this.settings.fullsize?(n=window.scrollY,r=window.scrollX):(n=this.container.scrollTop,r=this.container.scrollLeft);var i=e.bounds();this.views.remove(e),t&&(this.settings.axis===`vertical`?this.scrollTo(0,n-i.height,!0):this.settings.direction===`rtl`?this.settings.fullsize?this.scrollTo(r+Math.floor(i.width),0,!0):this.scrollTo(r,0,!0):this.scrollTo(r-Math.floor(i.width),0,!0))}addEventListeners(e){window.addEventListener(`unload`,function(e){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new Ft(this,this.settings.snap&&typeof this.settings.snap==`object`&&this.settings.snap))}addScrollListeners(){var e;this.tick=N;let t=this.settings.direction===`rtl`&&this.settings.rtlScrollType==="default"?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*t,this.scrollLeft=window.scrollX*t):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener(`scroll`,this._onScroll),this._scrolled=(0,It.default)(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){(this.settings.fullsize?window:this.container).removeEventListener(`scroll`,this._onScroll),this._onScroll=void 0}onScroll(){let e,t,n=this.settings.direction===`rtl`&&this.settings.rtlScrollType==="default"?-1:1;this.settings.fullsize?(e=window.scrollY*n,t=window.scrollX*n):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(e-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(t-this.prevScrollLeft),this.prevScrollTop=e,this.prevScrollLeft=t,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue(function(){return this.check()}.bind(this)),this.emit($.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit($.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),this.settings.afterScrolledTimeout)}next(){let e=this.layout.props.name===`pre-paginated`&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis===`horizontal`?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}prev(){let e=this.layout.props.name===`pre-paginated`&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis===`horizontal`?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,`scroll`),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new Ft(this,this.settings.snap&&typeof this.settings.snap==`object`&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}},Rt=class{constructor(e,t){this.settings=L(this.settings||{},{width:null,height:null,ignoreClass:``,manager:`default`,view:`iframe`,flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:`ltr`,allowScriptedContent:!1,allowPopups:!1}),L(this.settings,t),typeof this.settings.manager==`object`&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new je(this),this.hooks.serialize=new je(this),this.hooks.content=new je(this),this.hooks.unloaded=new je(this),this.hooks.layout=new je(this),this.hooks.render=new je(this),this.hooks.show=new je(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new et(this),this.annotations=new st(this),this.epubcfi=new Q,this.q=new Be(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new Y,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){return typeof e==`string`&&e==="default"?Mt:typeof e==`string`&&e===`continuous`?Lt:e}requireView(e){return typeof e==`string`&&e===`iframe`?ft:e}start(){switch(!this.settings.layout&&(this.book.package.metadata.layout===`pre-paginated`||this.book.displayOptions.fixedLayout===`true`)&&(this.settings.layout=`pre-paginated`),this.book.package.metadata.spread){case`none`:this.settings.spread=`none`;break;case`both`:this.settings.spread=!0;break}this.manager||=(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on($.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on($.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on($.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on($.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on($.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit($.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue(function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit($.RENDITION.ATTACHED)}.bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){this.epubcfi.isCfiString(e);var t=new Y,n=t.promise,r;return this.displaying=t,this.book.locations.length()&&ae(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),r=this.book.spine.get(e),r?(this.manager.display(r,e).then(()=>{t.resolve(r),this.displaying=void 0,this.emit($.RENDITION.DISPLAYED,r),this.reportLocation()},e=>{this.emit($.RENDITION.DISPLAY_ERROR,e)}),n):(t.reject(Error(`No Section Found`)),n)}}afterDisplayed(e){e.on($.VIEWS.MARK_CLICKED,(t,n)=>this.triggerMarkEvent(t,n,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit($.RENDITION.RENDERED,e.section,e)}):this.emit($.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit($.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit($.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit($.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,n){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,n)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var t,n=this.settings.layout||e.layout||`reflowable`,r=this.settings.spread||e.spread||`auto`,i=this.settings.orientation||e.orientation||`auto`,a=this.settings.flow||e.flow||`auto`,o=e.viewport||``,s=this.settings.minSpreadWidth||e.minSpreadWidth||800,c=this.settings.direction||e.direction||`ltr`;return(this.settings.width===0||this.settings.width>0)&&(this.settings.height===0||this.settings.height),t={layout:n,spread:r,orientation:i,flow:a,viewport:o,minSpreadWidth:s,direction:c},t}flow(e){var t=e;(e===`scrolled`||e===`scrolled-doc`||e===`scrolled-continuous`)&&(t=`scrolled`),(e===`auto`||e===`paginated`)&&(t=`paginated`),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new $e(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on($.LAYOUT.UPDATED,(e,t)=>{this.emit($.RENDITION.LAYOUT,e,t)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||`ltr`,this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue(function(){requestAnimationFrame(function(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then==`function`)e.then(function(e){let t=this.located(e);!t||!t.start||!t.end||(this.location=t,this.emit($.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit($.RENDITION.RELOCATED,this.location))}.bind(this));else if(e){let t=this.located(e);if(!t||!t.start||!t.end)return;this.location=t,this.emit($.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit($.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then==`function`)e.then(function(e){return this.located(e)}.bind(this));else if(e)return this.located(e)}located(e){if(!e.length)return{};let t=e[0],n=e[e.length-1],r={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:n.index,href:n.href,cfi:n.mapping.end,displayed:{page:n.pages[n.pages.length-1]||1,total:n.totalPages}}},i=this.book.locations.locationFromCfi(t.mapping.start),a=this.book.locations.locationFromCfi(n.mapping.end);i!=null&&(r.start.location=i,r.start.percentage=this.book.locations.percentageFromLocation(i)),a!=null&&(r.end.location=a,r.end.percentage=this.book.locations.percentageFromLocation(a));let o=this.book.pageList.pageFromCfi(t.mapping.start),s=this.book.pageList.pageFromCfi(n.mapping.end);return o!=-1&&(r.start.page=o),s!=-1&&(r.end.page=s),n.index===this.book.spine.last().index&&r.end.displayed.page>=r.end.displayed.total&&(r.atEnd=!0),t.index===this.book.spine.first().index&&r.start.displayed.page===1&&(r.atStart=!0),r}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){Ve.forEach(t=>{e.on(t,t=>this.triggerViewEvent(t,e))}),e.on($.CONTENTS.SELECTED,t=>this.triggerSelectedEvent(t,e))}triggerViewEvent(e,t){this.emit(e.type,e,t)}triggerSelectedEvent(e,t){this.emit($.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,n){this.emit($.RENDITION.MARK_CLICKED,e,t,n)}getRange(e,t){var n=new Q(e),r=this.manager.visible().filter(function(e){if(n.spinePos===e.index)return!0});if(r.length)return r[0].contents.range(n,t)}adjustImages(e){if(this._layout.name===`pre-paginated`)return new Promise(function(e){e()});let t=e.window.getComputedStyle(e.content,null),n=(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)))*.95,r=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+`px`:`100%`)+`!important`,"max-height":n+`px!important`,"object-fit":`contain`,"page-break-inside":`avoid`,"break-inside":`avoid`,"box-sizing":`border-box`},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+`px`:`100%`)+`!important`,"max-height":n+`px!important`,"page-break-inside":`avoid`,"break-inside":`avoid`}}),new Promise(function(e,t){setTimeout(function(){e()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on($.CONTENTS.LINK_CLICKED,e=>{let t=this.book.path.relative(e);this.display(t)})}injectStylesheet(e,t){let n=e.createElement(`link`);n.setAttribute(`type`,`text/css`),n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,this.settings.stylesheet),e.getElementsByTagName(`head`)[0].appendChild(n)}injectScript(e,t){let n=e.createElement(`script`);n.setAttribute(`type`,`text/javascript`),n.setAttribute(`src`,this.settings.script),n.textContent=` `,e.getElementsByTagName(`head`)[0].appendChild(n)}injectIdentifier(e,t){let n=this.book.packaging.metadata.identifier,r=e.createElement(`meta`);r.setAttribute(`name`,`dc.relation.ispartof`),n&&r.setAttribute(`content`,n),e.getElementsByTagName(`head`)[0].appendChild(r)}};(0,j.default)(Rt.prototype);var zt=n(t(((t,n)=>{(function(e){if(typeof t==`object`&&n!==void 0)n.exports=e();else if(typeof define==`function`&&define.amd)define([],e);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.JSZip=e()}})(function(){return(function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a})({1:[function(e,t,n){var r=e("./utils"),i=e("./support"),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;n.encode=function(e){for(var t=[],n,i,o,s,c,l,u,d=0,f=e.length,p=f,m=r.getTypeOf(e)!==`string`;d<e.length;)p=f-d,m?(n=e[d++],i=d<f?e[d++]:0,o=d<f?e[d++]:0):(n=e.charCodeAt(d++),i=d<f?e.charCodeAt(d++):0,o=d<f?e.charCodeAt(d++):0),s=n>>2,c=(n&3)<<4|i>>4,l=p>1?(i&15)<<2|o>>6:64,u=p>2?o&63:64,t.push(a.charAt(s)+a.charAt(c)+a.charAt(l)+a.charAt(u));return t.join(``)},n.decode=function(e){var t,n,r,o,s,c,l,u=0,d=0,f=`data:`;if(e.substr(0,f.length)===f)throw Error(`Invalid base64 input, it looks like a data url.`);e=e.replace(/[^A-Za-z0-9+/=]/g,``);var p=e.length*3/4;if(e.charAt(e.length-1)===a.charAt(64)&&p--,e.charAt(e.length-2)===a.charAt(64)&&p--,p%1!=0)throw Error(`Invalid base64 input, bad content length.`);for(var m=i.uint8array?new Uint8Array(p|0):Array(p|0);u<e.length;)o=a.indexOf(e.charAt(u++)),s=a.indexOf(e.charAt(u++)),c=a.indexOf(e.charAt(u++)),l=a.indexOf(e.charAt(u++)),t=o<<2|s>>4,n=(s&15)<<4|c>>2,r=(c&3)<<6|l,m[d++]=t,c!==64&&(m[d++]=n),l!==64&&(m[d++]=r);return m}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e("./external"),i=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e("./stream/GenericWorker");n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e("./utils");function i(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var a=i();function o(e,t,n,r){var i=a,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^i[(e^t[s])&255];return e^-1}function s(e,t,n,r){var i=a,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^i[(e^t.charCodeAt(s))&255];return e^-1}t.exports=function(e,t){return e===void 0||!e.length?0:r.getTypeOf(e)===`string`?s(t|0,e,e.length,0):o(t|0,e,e.length,0)}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e("pako"),a=e("./utils"),o=e("./stream/GenericWorker"),s=r?`uint8array`:`array`;n.magic=`\b\0`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){var r=e("../utils"),i=e("../stream/GenericWorker"),a=e("../utf8"),o=e("../crc32"),s=e("../signature"),c=function(e,t){var n=``,r;for(r=0;r<t;r++)n+=String.fromCharCode(e&255),e>>>=8;return n},l=function(e,t){var n=e;return e||(n=t?16893:33204),(n&65535)<<16},u=function(e){return(e||0)&63},d=function(e,t,n,i,d,f){var p=e.file,m=e.compression,h=f!==a.utf8encode,g=r.transformTo(`string`,f(p.name)),_=r.transformTo(`string`,a.utf8encode(p.name)),v=p.comment,y=r.transformTo(`string`,f(v)),b=r.transformTo(`string`,a.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C,w,T=``,E=``,D=``,O=p.dir,k=p.date,A={crc32:0,compressedSize:0,uncompressedSize:0};(!t||n)&&(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var j=0;t&&(j|=8),!h&&(x||S)&&(j|=2048);var M=0,ee=0;O&&(M|=16),d===`UNIX`?(ee=798,M|=l(p.unixPermissions,O)):(ee=20,M|=u(p.dosPermissions,O)),C=k.getUTCHours(),C<<=6,C|=k.getUTCMinutes(),C<<=5,C|=k.getUTCSeconds()/2,w=k.getUTCFullYear()-1980,w<<=4,w|=k.getUTCMonth()+1,w<<=5,w|=k.getUTCDate(),x&&(E=c(1,1)+c(o(g),4)+_,T+=`up`+c(E.length,2)+E),S&&(D=c(1,1)+c(o(y),4)+b,T+=`uc`+c(D.length,2)+D);var N=``;return N+=`
@@ -1 +1 @@
1
- import{n as e,r as t}from"./chunk-AGHRB4JF-Fz9kp2Fp.js";import{O as n,c as r,s as i,x as a}from"./chunk-CSCIHK7Q-VDPd5eNJ.js";import{Q as o,_ as s,v as c}from"./src-BrOGWJpF.js";import{g as l}from"./chunk-5ZQYHXKU-D-OgLpMs.js";import"./chunk-BSJP7CBP-BkJdmh17.js";import"./chunk-L5ZTLDWV-CzNJ_8is.js";import"./chunk-NZK2D7GU-Cte2JwiA.js";import"./chunk-O5CBEL6O-Bu7jDUJy.js";import"./chunk-3OPIFGDE-BBTvqaNI.js";import"./chunk-KSCS5N6A-BuXf0YOu.js";import"./chunk-LZXEDZCA-n9zJSIw5.js";import{t as u}from"./graphlib-B8gBHxth.js";import{t as d}from"./dagre-Bx709z4p.js";import"./chunk-55IACEB6-BXXbpqd4.js";import"./chunk-2J33WTMH-CruGLWY_.js";import{i as f,n as p,t as m}from"./chunk-AQP2D5EJ-B3sX7UtP.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-a().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(i.lineBreakRegex),u=1.25*a().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=c().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=l.calcLabelPosition(o.points),c=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=c.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(c[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*c.length;if(c.length>1){let e=(c.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*c.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{n as e,r as t}from"./chunk-AGHRB4JF-BPQIPtb6.js";import{O as n,c as r,s as i,x as a}from"./chunk-CSCIHK7Q-CSgWUfWx.js";import{Q as o,_ as s,v as c}from"./src-BrOGWJpF.js";import{g as l}from"./chunk-5ZQYHXKU-BAalwFs3.js";import"./chunk-BSJP7CBP-sjN6Abjx.js";import"./chunk-L5ZTLDWV-ycDBW8N9.js";import"./chunk-NZK2D7GU-DdJsXIOi.js";import"./chunk-O5CBEL6O-Clj0ulVd.js";import"./chunk-3OPIFGDE-CeQyPc2S.js";import"./chunk-KSCS5N6A-CbD8pl9X.js";import"./chunk-LZXEDZCA-CF9KGL7w.js";import{t as u}from"./graphlib-B8gBHxth.js";import{t as d}from"./dagre-Bx709z4p.js";import"./chunk-55IACEB6-BfXxlLZE.js";import"./chunk-2J33WTMH-CH4DhXJ6.js";import{i as f,n as p,t as m}from"./chunk-AQP2D5EJ-DmmEzEga.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-a().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(i.lineBreakRegex),u=1.25*a().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=c().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=l.calcLabelPosition(o.points),c=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=c.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(c[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*c.length;if(c.length>1){let e=(c.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*c.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-AGHRB4JF-BPQIPtb6.js";import"./chunk-CSCIHK7Q-CSgWUfWx.js";import"./chunk-5ZQYHXKU-BAalwFs3.js";import"./chunk-BSJP7CBP-sjN6Abjx.js";import"./chunk-L5ZTLDWV-ycDBW8N9.js";import"./chunk-NZK2D7GU-DdJsXIOi.js";import"./chunk-O5CBEL6O-Clj0ulVd.js";import"./chunk-3OPIFGDE-CeQyPc2S.js";import"./chunk-KSCS5N6A-CbD8pl9X.js";import"./chunk-LZXEDZCA-CF9KGL7w.js";import"./chunk-55IACEB6-BfXxlLZE.js";import"./chunk-2J33WTMH-CH4DhXJ6.js";import{i as t,n,r,t as i}from"./chunk-AQP2D5EJ-DmmEzEga.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -0,0 +1 @@
1
+ import"./chunk-SRAX5OIU-huS9oUCj.js";import{i as e,n as t,r as n,t as r}from"./chunk-EIO257PC-CNTUsg0Z.js";export{t as Commands,e as subsetToBase64,n as subsetToBinary,r as toBase64};