@flyfish-group/file-viewer-web 1.0.18 → 1.0.19

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 (204) hide show
  1. package/README.md +1 -1
  2. package/package.json +8 -8
  3. package/viewer/assets/{ArchiveViewer-DeFWfTW_.js → ArchiveViewer-CcaAEWxO.js} +1 -1
  4. package/viewer/assets/{AudioViewer-BBVD-7P-.js → AudioViewer-BjF25YAm.js} +1 -1
  5. package/viewer/assets/{CadViewer-mM01AiWy.js → CadViewer-C0QgqOUx.js} +1 -1
  6. package/viewer/assets/{CodeViewer-DcFT3req.js → CodeViewer-Ch9na7WK.js} +2 -2
  7. package/viewer/assets/{DrawingViewer-DIjvrRR2.js → DrawingViewer-BG-a6aRI.js} +2 -2
  8. package/viewer/assets/{EdaViewer-DWthh0WF.js → EdaViewer-CPQ0OplH.js} +3 -3
  9. package/viewer/assets/{EmailViewer-iqjN64Me.js → EmailViewer-BVedx1xl.js} +3 -3
  10. package/viewer/assets/{EpubViewer-pC5NrqBu.js → EpubViewer-CHbzxH40.js} +2 -2
  11. package/viewer/assets/{ImageViewer-BUytZu1F.js → ImageViewer-BhiqDvTd.js} +1 -1
  12. package/viewer/assets/{MarkdownViewer-l1wz3oUK.js → MarkdownViewer-BjNTASd0.js} +1 -1
  13. package/viewer/assets/{ModelViewer-gyf8Hi5j.js → ModelViewer-vJ20JzA9.js} +1 -1
  14. package/viewer/assets/{OfdViewer-3wsUQ38k.js → OfdViewer-NQPw-Mah.js} +2 -2
  15. package/viewer/assets/{PdfView-B8y7Os-X.js → PdfView-BArHGbuC.js} +19 -19
  16. package/viewer/assets/{PdfView-B99pn89Z.css → PdfView-CDkaqnJh.css} +1 -1
  17. package/viewer/assets/{PptxRender-BR1ZW74h.js → PptxRender-CIEoUuJx.js} +1 -1
  18. package/viewer/assets/{UmdViewer-BNuSd0WH.js → UmdViewer-Bl9DwUir.js} +1 -1
  19. package/viewer/assets/{XlsxTable-CU3ydvnt.js → XlsxTable-vFfPghWj.js} +1 -1
  20. package/viewer/assets/{ar-SA-G6X2FPQ2-B6oBbvlI.js → ar-SA-G6X2FPQ2-Dk8lrbtV.js} +1 -1
  21. package/viewer/assets/architecture-7EHR7CIX-DuuZoBFI.js +1 -0
  22. package/viewer/assets/{architectureDiagram-3BPJPVTR-BD4H8oVI.js → architectureDiagram-3BPJPVTR-CUiv7vBt.js} +1 -1
  23. package/viewer/assets/{archive-CzCpbSK5.js → archive-CIcfmjdA.js} +2 -2
  24. package/viewer/assets/{audio-cfabrZiv.js → audio-BVz7r-vA.js} +2 -2
  25. package/viewer/assets/{az-AZ-76LH7QW2-CYcSQbg9.js → az-AZ-76LH7QW2-CwsjUnyx.js} +1 -1
  26. package/viewer/assets/{bg-BG-XCXSNQG7-CbZ-snrf.js → bg-BG-XCXSNQG7-D8cD2Wnb.js} +1 -1
  27. package/viewer/assets/{blockDiagram-GPEHLZMM-Y2qruzJE.js → blockDiagram-GPEHLZMM-jPcghXAd.js} +1 -1
  28. package/viewer/assets/{bn-BD-2XOGV67Q-Ro0x_pkQ.js → bn-BD-2XOGV67Q-BTIzZo-P.js} +1 -1
  29. package/viewer/assets/{c4Diagram-AAUBKEIU-D-I0IKpO.js → c4Diagram-AAUBKEIU-CLxdQz33.js} +1 -1
  30. package/viewer/assets/{ca-ES-6MX7JW3Y-Bp6XCn1B.js → ca-ES-6MX7JW3Y-DN6VCZj-.js} +1 -1
  31. package/viewer/assets/{cad-BGk4L2Kn.js → cad-Bp11_qg7.js} +2 -2
  32. package/viewer/assets/{cfb-Bk1eyFhq.js → cfb-CBlZ-Tu_.js} +1 -1
  33. package/viewer/assets/channel-BEgY7lnG.js +1 -0
  34. package/viewer/assets/{chunk-2J33WTMH-CfkDbugm.js → chunk-2J33WTMH-DySKz026.js} +1 -1
  35. package/viewer/assets/{chunk-3OPIFGDE-xQ-o_ptW.js → chunk-3OPIFGDE-_GjvnJ3T.js} +1 -1
  36. package/viewer/assets/{chunk-4BX2VUAB-BMZUR-Jo.js → chunk-4BX2VUAB-DXd3aEQr.js} +1 -1
  37. package/viewer/assets/{chunk-55IACEB6-D8a3IMy6.js → chunk-55IACEB6-DUBLXdKL.js} +1 -1
  38. package/viewer/assets/{chunk-5ZQYHXKU-F_LW5WrB.js → chunk-5ZQYHXKU-BRF7hE13.js} +1 -1
  39. package/viewer/assets/{chunk-727SXJPM-huSY_KmI.js → chunk-727SXJPM-Cix1-bNS.js} +1 -1
  40. package/viewer/assets/{chunk-AGHRB4JF-F9LVzm3r.js → chunk-AGHRB4JF-DOd8ZVka.js} +1 -1
  41. package/viewer/assets/{chunk-AQP2D5EJ-Dd_7dcK8.js → chunk-AQP2D5EJ-ByeTmPD8.js} +1 -1
  42. package/viewer/assets/{chunk-BSJP7CBP-CvjLlpUH.js → chunk-BSJP7CBP-DPTup-7J.js} +1 -1
  43. package/viewer/assets/{chunk-CSCIHK7Q-A-2nhWjK.js → chunk-CSCIHK7Q-CaK7NLDn.js} +1 -1
  44. package/viewer/assets/{chunk-EIO257PC-CYMxMNmN.js → chunk-EIO257PC-BTeCKQKr.js} +1 -1
  45. package/viewer/assets/{chunk-FMBD7UC4-DaBk5rK4.js → chunk-FMBD7UC4-BOqvoY4U.js} +1 -1
  46. package/viewer/assets/{chunk-K2UTITRG-urGpnNWe.js → chunk-K2UTITRG-ChrjtByO.js} +4 -4
  47. package/viewer/assets/{chunk-KSCS5N6A-De_oHAar.js → chunk-KSCS5N6A-DJ5nNoVF.js} +1 -1
  48. package/viewer/assets/{chunk-L5ZTLDWV-COKyELc4.js → chunk-L5ZTLDWV-Cd0mA4d7.js} +1 -1
  49. package/viewer/assets/{chunk-LZXEDZCA-D6WzRNJE.js → chunk-LZXEDZCA-CsydnLnr.js} +2 -2
  50. package/viewer/assets/{chunk-ND2GUHAM-Dc9qe0xJ.js → chunk-ND2GUHAM-BeSPY4Yj.js} +1 -1
  51. package/viewer/assets/{chunk-NZK2D7GU-BOo9ULiP.js → chunk-NZK2D7GU-D-37z8Pl.js} +1 -1
  52. package/viewer/assets/{chunk-O5CBEL6O-BCzdu7rq.js → chunk-O5CBEL6O-CdSRkJ7Y.js} +1 -1
  53. package/viewer/assets/chunk-QZHKN3VN-B7qto_fo.js +1 -0
  54. package/viewer/assets/{chunk-SRAX5OIU-K8i7EmlY.js → chunk-SRAX5OIU-DTPuYDPS.js} +1 -1
  55. package/viewer/assets/{chunk-WU5MYG2G-BfgNiitD.js → chunk-WU5MYG2G-BT9QGgBg.js} +1 -1
  56. package/viewer/assets/{chunk-XPW4576I-DadHv4_7.js → chunk-XPW4576I-CmkE4v20.js} +1 -1
  57. package/viewer/assets/classDiagram-4FO5ZUOK-BsYZOWlA.js +1 -0
  58. package/viewer/assets/classDiagram-v2-Q7XG4LA2-D8H8TEqe.js +1 -0
  59. package/viewer/assets/{core-Dyi4ryhA.js → core-DjVECA_w.js} +1 -1
  60. package/viewer/assets/{cose-bilkent-S5V4N54A-BEm2b7U9.js → cose-bilkent-S5V4N54A-BhrcOJUn.js} +1 -1
  61. package/viewer/assets/{cs-CZ-2BRQDIVT-BgnnwL0r.js → cs-CZ-2BRQDIVT-B1W9dn8v.js} +1 -1
  62. package/viewer/assets/{da-DK-5WZEPLOC-CHiO7oP1.js → da-DK-5WZEPLOC-TySh-MvB.js} +1 -1
  63. package/viewer/assets/{dagre-BM42HDAG-D01M2GA0.js → dagre-BM42HDAG-CjBTMuh6.js} +1 -1
  64. package/viewer/assets/{de-DE-XR44H4JA-BuZn1sOl.js → de-DE-XR44H4JA-DNe7czwY.js} +1 -1
  65. package/viewer/assets/{diagram-2AECGRRQ-CmDzUVRw.js → diagram-2AECGRRQ-DmTRvL7i.js} +1 -1
  66. package/viewer/assets/{diagram-5GNKFQAL-uMduBkTk.js → diagram-5GNKFQAL-CXNgVJV4.js} +1 -1
  67. package/viewer/assets/{diagram-KO2AKTUF-D0XLp2yG.js → diagram-KO2AKTUF-DFzniapf.js} +1 -1
  68. package/viewer/assets/{diagram-LMA3HP47-BdoCcvCV.js → diagram-LMA3HP47-CCZQcG0T.js} +1 -1
  69. package/viewer/assets/{diagram-OG6HWLK6-CFReHHta.js → diagram-OG6HWLK6-CSPhlVR3.js} +1 -1
  70. package/viewer/assets/{dist-R7ApiLA3.js → dist-Bs30FHMp.js} +1 -1
  71. package/viewer/assets/{dist-CgrD-eQF.js → dist-DmVKTZVH.js} +4 -4
  72. package/viewer/assets/{docx-preview-DRN_ZCQ9.js → docx-preview-DUt9cw6d.js} +1 -1
  73. package/viewer/assets/{drawing-yWOpHRzj.js → drawing-adB9hOzE.js} +2 -2
  74. package/viewer/assets/{ebook-Ss-M09sQ.js → ebook-4d5cskIQ.js} +2 -2
  75. package/viewer/assets/{eda-B4PcFX1J.js → eda-D-cY1IPP.js} +2 -2
  76. package/viewer/assets/{el-GR-BZB4AONW-BLococa1.js → el-GR-BZB4AONW-iz07YMT3.js} +1 -1
  77. package/viewer/assets/email-BtlW1Mff.js +2 -0
  78. package/viewer/assets/{en-B4ZKOASM-DyWH5NoX.js → en-B4ZKOASM-g9Xo_oqu.js} +1 -1
  79. package/viewer/assets/{erDiagram-TEJ5UH35-DitK_UAI.js → erDiagram-TEJ5UH35-BCEiJAYO.js} +1 -1
  80. package/viewer/assets/{es-ES-U4NZUMDT-BLUIuEYZ.js → es-ES-U4NZUMDT-CxLMMu7P.js} +1 -1
  81. package/viewer/assets/{eu-ES-A7QVB2H4-DMKFMOK4.js → eu-ES-A7QVB2H4-BD4OhaBy.js} +1 -1
  82. package/viewer/assets/eventmodeling-FCH6USID-BtuOgoLy.js +1 -0
  83. package/viewer/assets/{fa-IR-HGAKTJCU-C20TkYVf.js → fa-IR-HGAKTJCU-DZTpPZj7.js} +1 -1
  84. package/viewer/assets/{fi-FI-Z5N7JZ37-BvfIShH7.js → fi-FI-Z5N7JZ37-ns5ukavM.js} +1 -1
  85. package/viewer/assets/{flowDiagram-I6XJVG4X-Vfi2093e.js → flowDiagram-I6XJVG4X-DRoiC2ap.js} +1 -1
  86. package/viewer/assets/{fr-FR-RHASNOE6-ChKszyTS.js → fr-FR-RHASNOE6-DukYzLkS.js} +1 -1
  87. package/viewer/assets/{ganttDiagram-6RSMTGT7-DlmBLuk_.js → ganttDiagram-6RSMTGT7-D-cpqJ1c.js} +1 -1
  88. package/viewer/assets/gitGraph-WXDBUCRP-2o_b6R_7.js +1 -0
  89. package/viewer/assets/{gitGraphDiagram-PVQCEYII-BMU-I7Ra.js → gitGraphDiagram-PVQCEYII-DtAUzVmv.js} +1 -1
  90. package/viewer/assets/{gl-ES-HMX3MZ6V-C3FQSKZV.js → gl-ES-HMX3MZ6V-Cjk7SCTx.js} +1 -1
  91. package/viewer/assets/{he-IL-6SHJWFNN-iexMFoYd.js → he-IL-6SHJWFNN-CPFW3xAY.js} +1 -1
  92. package/viewer/assets/{hi-IN-IWLTKZ5I-DaGsHkO-.js → hi-IN-IWLTKZ5I-DisVfnaM.js} +1 -1
  93. package/viewer/assets/{hu-HU-A5ZG7DT2-BgtnzLnP.js → hu-HU-A5ZG7DT2-BfFVgJtk.js} +1 -1
  94. package/viewer/assets/{id-ID-SAP4L64H-DRxG1cnt.js → id-ID-SAP4L64H-BcRF-r9G.js} +1 -1
  95. package/viewer/assets/{image-D4B40RTC.js → image-D6N1bDFE.js} +2 -2
  96. package/viewer/assets/image-GAAHSSAO-CMi25gOf.js +1 -0
  97. package/viewer/assets/{index-BlC70W4a.css → index-B_rKNGx-.css} +1 -1
  98. package/viewer/assets/index-DP0aBxNP.js +299 -0
  99. package/viewer/assets/info-J43DQDTF-DYwZejl8.js +1 -0
  100. package/viewer/assets/{infoDiagram-5YYISTIA-BS7xZH0y.js → infoDiagram-5YYISTIA-0U1kwPhy.js} +1 -1
  101. package/viewer/assets/{ishikawaDiagram-YF4QCWOH-CG0FdU2n.js → ishikawaDiagram-YF4QCWOH-DD7UBwKB.js} +1 -1
  102. package/viewer/assets/{it-IT-JPQ66NNP-DjW-x45O.js → it-IT-JPQ66NNP-DF9-U5KK.js} +1 -1
  103. package/viewer/assets/{ja-JP-DBVTYXUO-D_q0Ea8G.js → ja-JP-DBVTYXUO-D0oP-cZ2.js} +1 -1
  104. package/viewer/assets/{journeyDiagram-JHISSGLW-D2ZJYv8-.js → journeyDiagram-JHISSGLW-F0aNIP-8.js} +1 -1
  105. package/viewer/assets/{jszip.min-DntPNpWy.js → jszip.min-DHUfArgC.js} +1 -1
  106. package/viewer/assets/{kaa-6HZHGXH3-CBN0wCD8.js → kaa-6HZHGXH3-VvXC4vMQ.js} +1 -1
  107. package/viewer/assets/{kab-KAB-ZGHBKWFO-beSKboSk.js → kab-KAB-ZGHBKWFO-DRCkdS3f.js} +1 -1
  108. package/viewer/assets/{kanban-definition-UN3LZRKU-C5xc60SV.js → kanban-definition-UN3LZRKU-DBEnmJSa.js} +1 -1
  109. package/viewer/assets/{kk-KZ-P5N5QNE5-BpEPaThu.js → kk-KZ-P5N5QNE5-DZ5GveXb.js} +1 -1
  110. package/viewer/assets/{km-KH-HSX4SM5Z-Bi0ut1Fk.js → km-KH-HSX4SM5Z-D7pETFw0.js} +1 -1
  111. package/viewer/assets/{ko-KR-MTYHY66A-DlH9rPGn.js → ko-KR-MTYHY66A-HSLEHqQR.js} +1 -1
  112. package/viewer/assets/{ku-TR-6OUDTVRD-DoLZ1Fvc.js → ku-TR-6OUDTVRD-BlwpBrtP.js} +1 -1
  113. package/viewer/assets/{lib-DDnnYT8O.js → lib-MyZCR7RP.js} +1 -1
  114. package/viewer/assets/{lt-LT-XHIRWOB4-ClrqcGIg.js → lt-LT-XHIRWOB4-Dhu43bCC.js} +1 -1
  115. package/viewer/assets/{lv-LV-5QDEKY6T-vw2aNS5w.js → lv-LV-5QDEKY6T-DzCqbO2y.js} +1 -1
  116. package/viewer/assets/{md-B77uP53i.js → md-CJ8I-UoT.js} +2 -2
  117. package/viewer/assets/{mermaid-parser.core-BYdKYW2k.js → mermaid-parser.core-C6XeWUpp.js} +2 -2
  118. package/viewer/assets/{mindmap-definition-RKZ34NQL-BksJv6tT.js → mindmap-definition-RKZ34NQL-DZabRNmz.js} +1 -1
  119. package/viewer/assets/{model-DrXcf770.js → model-dLh7hsTV.js} +2 -2
  120. package/viewer/assets/{mr-IN-CRQNXWMA-CNMC7bsZ.js → mr-IN-CRQNXWMA-JRrDEdHH.js} +1 -1
  121. package/viewer/assets/{my-MM-5M5IBNSE-BViXdec0.js → my-MM-5M5IBNSE-DgtXAn-m.js} +1 -1
  122. package/viewer/assets/{nb-NO-T6EIAALU-DEhUH4PO.js → nb-NO-T6EIAALU-DIogHd49.js} +1 -1
  123. package/viewer/assets/nestedRender-BfyUMgZx.js +3 -0
  124. package/viewer/assets/{nl-NL-IS3SIHDZ-DBAsKVbN.js → nl-NL-IS3SIHDZ-Dj3eBF-z.js} +1 -1
  125. package/viewer/assets/{nn-NO-6E72VCQL-CGKA-1JK.js → nn-NO-6E72VCQL-Cn6gfO2d.js} +1 -1
  126. package/viewer/assets/{oc-FR-POXYY2M6-hH6eLSCW.js → oc-FR-POXYY2M6-DbuLv90f.js} +1 -1
  127. package/viewer/assets/{ofd-DHwwXPSE.js → ofd-CCbysLg2.js} +1 -1
  128. package/viewer/assets/{ofd-BQVjUrFV.js → ofd-P60wwkCc.js} +2 -2
  129. package/viewer/assets/{pa-IN-N4M65BXN-5d4Ya3e3.js → pa-IN-N4M65BXN-B9Jfucii.js} +1 -1
  130. package/viewer/assets/packet-YPE3B663-Bcn5b98B.js +1 -0
  131. package/viewer/assets/pdf-D1LQO7uf.js +2 -0
  132. package/viewer/assets/percentages-BXMCSKIN-BVl7pumT.js +1 -0
  133. package/viewer/assets/{pica-rbbuKui1.js → pica-CXjnXwN8.js} +1 -1
  134. package/viewer/assets/pie-LRSECV5Y-v7uF-sA7.js +1 -0
  135. package/viewer/assets/{pieDiagram-4H26LBE5-G1vZDfKB.js → pieDiagram-4H26LBE5-hBGmntmk.js} +1 -1
  136. package/viewer/assets/{pl-PL-T2D74RX3-T3SI0nIi.js → pl-PL-T2D74RX3-CZA6kVxr.js} +1 -1
  137. package/viewer/assets/{pptx-BskXGqNz.js → pptx-98BF9vSb.js} +2 -2
  138. package/viewer/assets/printLayout-CMOwK714.js +24 -0
  139. package/viewer/assets/{prod-DESMpz9t.js → prod-DGEzi_sx.js} +6 -6
  140. package/viewer/assets/{pt-BR-5N22H2LF-C20ieoLf.js → pt-BR-5N22H2LF-CJBEgmdW.js} +1 -1
  141. package/viewer/assets/{pt-PT-UZXXM6DQ-DtA7Bj0i.js → pt-PT-UZXXM6DQ-YcL-83Sy.js} +1 -1
  142. package/viewer/assets/{quadrantDiagram-W4KKPZXB-nyTvH-BV.js → quadrantDiagram-W4KKPZXB-5sC-S6oT.js} +1 -1
  143. package/viewer/assets/radar-GUYGQ44K-BCS4X1aw.js +1 -0
  144. package/viewer/assets/{requirementDiagram-4Y6WPE33-Dtf8vRf5.js → requirementDiagram-4Y6WPE33-DkUHwjui.js} +1 -1
  145. package/viewer/assets/{ro-RO-JPDTUUEW-CWnogfnS.js → ro-RO-JPDTUUEW-DjtOcA5F.js} +1 -1
  146. package/viewer/assets/{rough.esm-BofuiFfN.js → rough.esm-CA6TiziR.js} +1 -1
  147. package/viewer/assets/{ru-RU-B4JR7IUQ-CjLE3RBq.js → ru-RU-B4JR7IUQ-CivC8w7d.js} +1 -1
  148. package/viewer/assets/{sankeyDiagram-5OEKKPKP-8CJ-9tUT.js → sankeyDiagram-5OEKKPKP-DHnEZduX.js} +1 -1
  149. package/viewer/assets/{sequenceDiagram-3UESZ5HK-CRMi6NFH.js → sequenceDiagram-3UESZ5HK-liCjEWzN.js} +1 -1
  150. package/viewer/assets/{si-LK-N5RQ5JYF-CboJGIYM.js → si-LK-N5RQ5JYF-DcC_iAkX.js} +1 -1
  151. package/viewer/assets/{sk-SK-C5VTKIMK-DumZAtOC.js → sk-SK-C5VTKIMK-B5j33LSm.js} +1 -1
  152. package/viewer/assets/{sl-SI-NN7IZMDC-eYkGnnKH.js → sl-SI-NN7IZMDC-Bvp7QhC6.js} +1 -1
  153. package/viewer/assets/{src-DDZoLlpv.js → src-C-6PUQ-1.js} +1 -1
  154. package/viewer/assets/{stateDiagram-AJRCARHV-DUSngIAy.js → stateDiagram-AJRCARHV-BT0rGRCf.js} +1 -1
  155. package/viewer/assets/stateDiagram-v2-BHNVJYJU-9scd674J.js +1 -0
  156. package/viewer/assets/subset-shared.chunk-BWLKXcn8.js +1 -0
  157. package/viewer/assets/{subset-worker.chunk-DJBcTl37.js → subset-worker.chunk-DJcS8Bpg.js} +1 -1
  158. package/viewer/assets/{sv-SE-XGPEYMSR-j0sfHjXY.js → sv-SE-XGPEYMSR-DFEd48lm.js} +1 -1
  159. package/viewer/assets/{ta-IN-2NMHFXQM-Dknrdq3F.js → ta-IN-2NMHFXQM-CHNfCwC-.js} +1 -1
  160. package/viewer/assets/{text-CUcHOXaK.js → text-CocRMFVl.js} +2 -2
  161. package/viewer/assets/{th-TH-HPSO5L25-Cx-iZVn7.js → th-TH-HPSO5L25-4cc3XUNg.js} +1 -1
  162. package/viewer/assets/{timeline-definition-PNZ67QCA-Cg6Cw2Fs.js → timeline-definition-PNZ67QCA-mCfjuMwo.js} +1 -1
  163. package/viewer/assets/{tr-TR-DEFEU3FU-Cw0eo1M7.js → tr-TR-DEFEU3FU-BN6Up0rv.js} +1 -1
  164. package/viewer/assets/treeView-BLDUP644-krRIGIJs.js +1 -0
  165. package/viewer/assets/treemap-LRROVOQU-BuCUkeJd.js +1 -0
  166. package/viewer/assets/{uk-UA-QMV73CPH-B4wtNH6O.js → uk-UA-QMV73CPH-DzjnXfb4.js} +1 -1
  167. package/viewer/assets/{umd-CQV_lJ42.js → umd-CVCUOmhK.js} +2 -2
  168. package/viewer/assets/{vennDiagram-CIIHVFJN-D7xtY8ic.js → vennDiagram-CIIHVFJN-CxlImpyM.js} +1 -1
  169. package/viewer/assets/{vi-VN-M7AON7JQ-h63_dU2m.js → vi-VN-M7AON7JQ-DSWHNiUw.js} +1 -1
  170. package/viewer/assets/wardley-L42UT6IY-CAK0a62K.js +1 -0
  171. package/viewer/assets/{wardleyDiagram-YWT4CUSO-D1ndROpq.js → wardleyDiagram-YWT4CUSO-Bc_vp_2j.js} +1 -1
  172. package/viewer/assets/word-FdCJXkda.js +126 -0
  173. package/viewer/assets/{xlsx-BOudShG0.js → xlsx-DLSWS024.js} +2 -2
  174. package/viewer/assets/{xychartDiagram-2RQKCTM6-Bx4zyLO_.js → xychartDiagram-2RQKCTM6-cRvSMQE8.js} +1 -1
  175. package/viewer/assets/{zh-CN-LNUGB5OW-B9ViALuf.js → zh-CN-LNUGB5OW-CRscQdGo.js} +1 -1
  176. package/viewer/assets/{zh-HK-E62DVLB3-Dy5LylQh.js → zh-HK-E62DVLB3-DwtXc2ez.js} +1 -1
  177. package/viewer/assets/{zh-TW-RAJ6MFWO-CWUZUmWo.js → zh-TW-RAJ6MFWO-B7ojXG_Q.js} +1 -1
  178. package/viewer/flyfish-viewer-manifest.json +1 -1
  179. package/viewer/index.html +2 -2
  180. package/LICENSE +0 -160
  181. package/viewer/assets/architecture-7EHR7CIX-Bce1FwGM.js +0 -1
  182. package/viewer/assets/channel-DtmVCU5h.js +0 -1
  183. package/viewer/assets/chunk-QZHKN3VN-CitU30Mi.js +0 -1
  184. package/viewer/assets/classDiagram-4FO5ZUOK-B0QkR2Ju.js +0 -1
  185. package/viewer/assets/classDiagram-v2-Q7XG4LA2-CgUmmElq.js +0 -1
  186. package/viewer/assets/email-YCjgQ_R2.js +0 -2
  187. package/viewer/assets/eventmodeling-FCH6USID-BGHjjFME.js +0 -1
  188. package/viewer/assets/gitGraph-WXDBUCRP-D1x3KEcE.js +0 -1
  189. package/viewer/assets/image-GAAHSSAO-7DaRxV-K.js +0 -1
  190. package/viewer/assets/index-Bs0y_lo-.js +0 -266
  191. package/viewer/assets/info-J43DQDTF-C1Q5yQJz.js +0 -1
  192. package/viewer/assets/nestedRender-DTp9LPi4.js +0 -3
  193. package/viewer/assets/packet-YPE3B663-7rLxk7Hg.js +0 -1
  194. package/viewer/assets/pdf-3Bit_HRJ.js +0 -2
  195. package/viewer/assets/percentages-BXMCSKIN-DtCkjmf7.js +0 -1
  196. package/viewer/assets/pie-LRSECV5Y-8VCeVOhU.js +0 -1
  197. package/viewer/assets/radar-GUYGQ44K-_JOo7hPn.js +0 -1
  198. package/viewer/assets/stateDiagram-v2-BHNVJYJU-DJ6QNTZF.js +0 -1
  199. package/viewer/assets/subset-shared.chunk-BmSOVB2Z.js +0 -1
  200. package/viewer/assets/treeView-BLDUP644-BI1dXxIp.js +0 -1
  201. package/viewer/assets/treemap-LRROVOQU-Bj6bnQOs.js +0 -1
  202. package/viewer/assets/wardley-L42UT6IY-C5wh5xNa.js +0 -1
  203. package/viewer/assets/word-xLKbViol.js +0 -126
  204. /package/viewer/assets/{worker-ref-i3-CbMKs.js → worker-ref-BqLasdQ2.js} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lib-DDnnYT8O.js","./index-Bs0y_lo-.js","./index-BlC70W4a.css"])))=>i.map(i=>d[i]);
2
- import{A as e,D as t,E as n,I as r,O as i,V as a,_ as o,b as s,g as c,h as l,j as u,l as d,q as f,t as p,w as m,x as h,y as g,z as _}from"./index-Bs0y_lo-.js";import{t as v}from"./nestedRender-DTp9LPi4.js";var y={class:`email-viewer`},b={class:`email-header`},x={key:0,class:`email-meta`},S={key:0},C={key:0,class:`email-body`},w={class:`email-sidebar`},T={class:`body-tabs`},E=[`disabled`,`onClick`],D={class:`attachment-panel`},O={class:`attachment-title`},k=[`onClick`],A={class:`message-panel`},j=[`srcdoc`],ee={key:1,class:`email-text`},M={key:2,class:`email-text`},N={key:3,class:`attachment-preview`},P={class:`attachment-preview-head`},F={key:1,class:`email-state`},I={key:2,class:`email-error`},L=d(m({__name:`EmailViewer`,props:{data:{},type:{},filename:{},options:{}},setup(d){let m=d,L=r(null),R=r(!0),z=r(`正在解析邮件...`),B=r(``),V=r(`html`),H=r(null),U=r(null),W=new Map,G=[],K,q=e=>{if(!Number.isFinite(e)||e<0)return`-`;if(e<1024)return`${e} B`;let t=e/1024/1024;return t>=1?`${t.toFixed(+(t<10))} MB`:`${(e/1024).toFixed(+(e<10*1024))} KB`},J=e=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let t=e;return t.group?J(t.group):[{name:t.name||``,address:t.address||t.email||``}]}):[],Y=e=>e.map(e=>e.name&&e.address?`${e.name} <${e.address}>`:e.address||e.name||``).filter(Boolean).join(`, `),X=c(()=>{let e=L.value?.html||``;if(!e)return``;let t=e;return W.forEach((e,n)=>{t=t.replace(RegExp(`cid:${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}`,`gi`),e)}),`<!doctype html><html><head><meta charset="utf-8"><base target="_blank"><style>body{margin:0;padding:18px;font-family:Aptos,"Segoe UI",sans-serif;line-height:1.6;color:#172033;word-break:break-word;}img{max-width:100%;height:auto;}</style></head><body>${t}</body></html>`}),Z=c(()=>[{key:`html`,label:`HTML`,disabled:!L.value?.html},{key:`text`,label:`正文`,disabled:!L.value?.text},{key:`headers`,label:`头信息`,disabled:!L.value?.headers}]),Q=async e=>{if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}return Q(new TextEncoder().encode(e))},te=async()=>{let e=await(await p(async()=>{let{default:e}=await import(`./postal-mime-_xaVOoDw.js`);return{default:e}},[],import.meta.url)).default.parse(m.data,{attachmentEncoding:`arraybuffer`,maxNestingDepth:24,maxHeadersSize:2*1024*1024}),t=e.attachments.map((e,t)=>{let n=typeof e.content==`string`?e.content.length:e.content.byteLength,r=e.filename||`attachment-${t+1}`;return{id:`${t}-${r}`,name:r,mimeType:e.mimeType,size:n,contentId:e.contentId,load:()=>Q(e.content)}});return await Promise.all(t.map(async e=>{if(!e.contentId||!e.mimeType?.startsWith(`image/`))return;let t=await e.load(),n=URL.createObjectURL(new Blob([t],{type:e.mimeType}));G.push(n),W.set(e.contentId.replace(/[<>]/g,``),n)})),{kind:`eml`,subject:e.subject||m.filename,from:J(e.from),to:J(e.to),cc:J(e.cc),date:e.date,text:e.text,html:e.html,headers:e.headerLines?.map(e=>e.line).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lib-MyZCR7RP.js","./index-DP0aBxNP.js","./index-B_rKNGx-.css"])))=>i.map(i=>d[i]);
2
+ import{A as e,D as t,E as n,I as r,O as i,V as a,_ as o,b as s,g as c,h as l,j as u,l as d,q as f,t as p,w as m,x as h,y as g,z as _}from"./index-DP0aBxNP.js";import{t as v}from"./nestedRender-BfyUMgZx.js";var y={class:`email-viewer`},b={class:`email-header`},x={key:0,class:`email-meta`},S={key:0},C={key:0,class:`email-body`},w={class:`email-sidebar`},T={class:`body-tabs`},E=[`disabled`,`onClick`],D={class:`attachment-panel`},O={class:`attachment-title`},k=[`onClick`],A={class:`message-panel`},j=[`srcdoc`],ee={key:1,class:`email-text`},M={key:2,class:`email-text`},N={key:3,class:`attachment-preview`},P={class:`attachment-preview-head`},F={key:1,class:`email-state`},I={key:2,class:`email-error`},L=d(m({__name:`EmailViewer`,props:{data:{},type:{},filename:{},options:{}},setup(d){let m=d,L=r(null),R=r(!0),z=r(`正在解析邮件...`),B=r(``),V=r(`html`),H=r(null),U=r(null),W=new Map,G=[],K,q=e=>{if(!Number.isFinite(e)||e<0)return`-`;if(e<1024)return`${e} B`;let t=e/1024/1024;return t>=1?`${t.toFixed(+(t<10))} MB`:`${(e/1024).toFixed(+(e<10*1024))} KB`},J=e=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let t=e;return t.group?J(t.group):[{name:t.name||``,address:t.address||t.email||``}]}):[],Y=e=>e.map(e=>e.name&&e.address?`${e.name} <${e.address}>`:e.address||e.name||``).filter(Boolean).join(`, `),X=c(()=>{let e=L.value?.html||``;if(!e)return``;let t=e;return W.forEach((e,n)=>{t=t.replace(RegExp(`cid:${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}`,`gi`),e)}),`<!doctype html><html><head><meta charset="utf-8"><base target="_blank"><style>body{margin:0;padding:18px;font-family:Aptos,"Segoe UI",sans-serif;line-height:1.6;color:#172033;word-break:break-word;}img{max-width:100%;height:auto;}</style></head><body>${t}</body></html>`}),Z=c(()=>[{key:`html`,label:`HTML`,disabled:!L.value?.html},{key:`text`,label:`正文`,disabled:!L.value?.text},{key:`headers`,label:`头信息`,disabled:!L.value?.headers}]),Q=async e=>{if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new Uint8Array(e.byteLength);return t.set(e),t.buffer}return Q(new TextEncoder().encode(e))},te=async()=>{let e=await(await p(async()=>{let{default:e}=await import(`./postal-mime-_xaVOoDw.js`);return{default:e}},[],import.meta.url)).default.parse(m.data,{attachmentEncoding:`arraybuffer`,maxNestingDepth:24,maxHeadersSize:2*1024*1024}),t=e.attachments.map((e,t)=>{let n=typeof e.content==`string`?e.content.length:e.content.byteLength,r=e.filename||`attachment-${t+1}`;return{id:`${t}-${r}`,name:r,mimeType:e.mimeType,size:n,contentId:e.contentId,load:()=>Q(e.content)}});return await Promise.all(t.map(async e=>{if(!e.contentId||!e.mimeType?.startsWith(`image/`))return;let t=await e.load(),n=URL.createObjectURL(new Blob([t],{type:e.mimeType}));G.push(n),W.set(e.contentId.replace(/[<>]/g,``),n)})),{kind:`eml`,subject:e.subject||m.filename,from:J(e.from),to:J(e.to),cc:J(e.cc),date:e.date,text:e.text,html:e.html,headers:e.headerLines?.map(e=>e.line).join(`
3
3
  `)||e.headers?.map(e=>`${e.originalKey}: ${e.value}`).join(`
4
- `),attachments:t}},ne=async()=>{let e=await p(()=>import(`./lib-DDnnYT8O.js`).then(e=>f(e.default,1)),__vite__mapDeps([0,1,2]),import.meta.url),t=new(e.default?.default||e.default)(m.data),n=t.getFileData(),r=(n.attachments||[]).map((e,n)=>{let r=e.fileName||e.fileNameShort||e.name||`attachment-${n+1}${e.extension||``}`;return{id:`${n}-${r}`,name:r,mimeType:`application/octet-stream`,size:e.contentLength||e.size||0,contentId:e.pidContentId,async load(){return Q(t.getAttachment(e).content)}}});return{kind:`msg`,subject:n.subject||m.filename,from:J({name:n.senderName,address:n.senderEmail}),to:J(n.recipients||[]).filter(e=>e.name||e.address),cc:[],date:n.messageDeliveryTime||n.clientSubmitTime||n.creationTime,text:n.body,html:n.html||``,headers:n.headers,attachments:r}},re=async()=>{R.value=!0,B.value=``;try{L.value=m.type===`msg`?await ne():await te(),V.value=L.value.html?`html`:L.value.text?`text`:`headers`}catch(e){console.error(e),B.value=e instanceof Error?e.message:String(e)}finally{R.value=!1}},$=()=>{K?.unmount?.(),K=void 0;let e=U.value;if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},ie=async e=>{H.value=e,R.value=!0,z.value=`正在打开附件 ${e.name}...`;try{let t=await e.load();await n(),$();let r=U.value;if(!r)return;let i=document.createElement(`div`);i.className=`email-attachment-render`,r.appendChild(i),K=await v(t,e.name.includes(`.`)?e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase():`txt`,i,{filename:e.name,options:m.options})}catch(e){console.error(e),B.value=e instanceof Error?e.message:String(e)}finally{R.value=!1,z.value=`正在解析邮件...`}},ae=async e=>{let t=await e.load(),n=URL.createObjectURL(new Blob([t],{type:e.mimeType||`application/octet-stream`}));G.push(n);let r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove()};return i(()=>{re()}),t(()=>{$(),G.forEach(e=>URL.revokeObjectURL(e))}),(t,n)=>(e(),s(`section`,y,[o(`header`,b,[o(`span`,null,a(L.value?.kind?.toUpperCase()||d.type.toUpperCase()),1),o(`h2`,null,a(L.value?.subject||d.filename),1),L.value?(e(),s(`div`,x,[o(`p`,null,[n[1]||=o(`strong`,null,`发件人`,-1),h(a(Y(L.value.from)||`-`),1)]),o(`p`,null,[n[2]||=o(`strong`,null,`收件人`,-1),h(a(Y(L.value.to)||`-`),1)]),L.value.cc.length?(e(),s(`p`,S,[n[3]||=o(`strong`,null,`抄送`,-1),h(a(Y(L.value.cc)),1)])):g(``,!0),o(`p`,null,[n[4]||=o(`strong`,null,`时间`,-1),h(a(L.value.date||`-`),1)])])):g(``,!0)]),L.value?(e(),s(`div`,C,[o(`aside`,w,[o(`div`,T,[(e(!0),s(l,null,u(Z.value,t=>(e(),s(`button`,{key:t.key,type:`button`,disabled:t.disabled,class:_({active:V.value===t.key}),onClick:e=>V.value=t.key},a(t.label),11,E))),128))]),o(`section`,D,[o(`div`,O,[n[5]||=o(`strong`,null,`附件`,-1),o(`span`,null,a(L.value.attachments.length),1)]),(e(!0),s(l,null,u(L.value.attachments,t=>(e(),s(`button`,{key:t.id,type:`button`,class:_([`attachment-item`,{active:H.value?.id===t.id}]),onClick:e=>ie(t)},[o(`span`,null,a(t.name.split(`.`).pop()?.toUpperCase()||`FILE`),1),o(`strong`,null,a(t.name),1),o(`em`,null,a(q(t.size)),1)],10,k))),128))])]),o(`main`,A,[V.value===`html`&&X.value?(e(),s(`iframe`,{key:0,class:`email-html`,sandbox:``,srcdoc:X.value},null,8,j)):V.value===`text`?(e(),s(`pre`,ee,a(L.value.text),1)):(e(),s(`pre`,M,a(L.value.headers),1)),H.value?(e(),s(`section`,N,[o(`div`,P,[o(`strong`,null,a(H.value.name),1),o(`button`,{type:`button`,onClick:n[0]||=e=>ae(H.value)},`下载附件`)]),o(`div`,{ref_key:`attachmentTarget`,ref:U,class:`attachment-target`},null,512)])):g(``,!0)])])):g(``,!0),R.value?(e(),s(`div`,F,[n[6]||=o(`span`,null,null,-1),o(`strong`,null,a(z.value),1)])):g(``,!0),B.value?(e(),s(`div`,I,[n[7]||=o(`strong`,null,`邮件预览提示`,-1),o(`p`,null,a(B.value),1)])):g(``,!0)]))}}),[[`__scopeId`,`data-v-0989d798`]]);export{L as default};
4
+ `),attachments:t}},ne=async()=>{let e=await p(()=>import(`./lib-MyZCR7RP.js`).then(e=>f(e.default,1)),__vite__mapDeps([0,1,2]),import.meta.url),t=new(e.default?.default||e.default)(m.data),n=t.getFileData(),r=(n.attachments||[]).map((e,n)=>{let r=e.fileName||e.fileNameShort||e.name||`attachment-${n+1}${e.extension||``}`;return{id:`${n}-${r}`,name:r,mimeType:`application/octet-stream`,size:e.contentLength||e.size||0,contentId:e.pidContentId,async load(){return Q(t.getAttachment(e).content)}}});return{kind:`msg`,subject:n.subject||m.filename,from:J({name:n.senderName,address:n.senderEmail}),to:J(n.recipients||[]).filter(e=>e.name||e.address),cc:[],date:n.messageDeliveryTime||n.clientSubmitTime||n.creationTime,text:n.body,html:n.html||``,headers:n.headers,attachments:r}},re=async()=>{R.value=!0,B.value=``;try{L.value=m.type===`msg`?await ne():await te(),V.value=L.value.html?`html`:L.value.text?`text`:`headers`}catch(e){console.error(e),B.value=e instanceof Error?e.message:String(e)}finally{R.value=!1}},$=()=>{K?.unmount?.(),K=void 0;let e=U.value;if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},ie=async e=>{H.value=e,R.value=!0,z.value=`正在打开附件 ${e.name}...`;try{let t=await e.load();await n(),$();let r=U.value;if(!r)return;let i=document.createElement(`div`);i.className=`email-attachment-render`,r.appendChild(i),K=await v(t,e.name.includes(`.`)?e.name.slice(e.name.lastIndexOf(`.`)+1).toLowerCase():`txt`,i,{filename:e.name,options:m.options})}catch(e){console.error(e),B.value=e instanceof Error?e.message:String(e)}finally{R.value=!1,z.value=`正在解析邮件...`}},ae=async e=>{let t=await e.load(),n=URL.createObjectURL(new Blob([t],{type:e.mimeType||`application/octet-stream`}));G.push(n);let r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove()};return i(()=>{re()}),t(()=>{$(),G.forEach(e=>URL.revokeObjectURL(e))}),(t,n)=>(e(),s(`section`,y,[o(`header`,b,[o(`span`,null,a(L.value?.kind?.toUpperCase()||d.type.toUpperCase()),1),o(`h2`,null,a(L.value?.subject||d.filename),1),L.value?(e(),s(`div`,x,[o(`p`,null,[n[1]||=o(`strong`,null,`发件人`,-1),h(a(Y(L.value.from)||`-`),1)]),o(`p`,null,[n[2]||=o(`strong`,null,`收件人`,-1),h(a(Y(L.value.to)||`-`),1)]),L.value.cc.length?(e(),s(`p`,S,[n[3]||=o(`strong`,null,`抄送`,-1),h(a(Y(L.value.cc)),1)])):g(``,!0),o(`p`,null,[n[4]||=o(`strong`,null,`时间`,-1),h(a(L.value.date||`-`),1)])])):g(``,!0)]),L.value?(e(),s(`div`,C,[o(`aside`,w,[o(`div`,T,[(e(!0),s(l,null,u(Z.value,t=>(e(),s(`button`,{key:t.key,type:`button`,disabled:t.disabled,class:_({active:V.value===t.key}),onClick:e=>V.value=t.key},a(t.label),11,E))),128))]),o(`section`,D,[o(`div`,O,[n[5]||=o(`strong`,null,`附件`,-1),o(`span`,null,a(L.value.attachments.length),1)]),(e(!0),s(l,null,u(L.value.attachments,t=>(e(),s(`button`,{key:t.id,type:`button`,class:_([`attachment-item`,{active:H.value?.id===t.id}]),onClick:e=>ie(t)},[o(`span`,null,a(t.name.split(`.`).pop()?.toUpperCase()||`FILE`),1),o(`strong`,null,a(t.name),1),o(`em`,null,a(q(t.size)),1)],10,k))),128))])]),o(`main`,A,[V.value===`html`&&X.value?(e(),s(`iframe`,{key:0,class:`email-html`,sandbox:``,srcdoc:X.value},null,8,j)):V.value===`text`?(e(),s(`pre`,ee,a(L.value.text),1)):(e(),s(`pre`,M,a(L.value.headers),1)),H.value?(e(),s(`section`,N,[o(`div`,P,[o(`strong`,null,a(H.value.name),1),o(`button`,{type:`button`,onClick:n[0]||=e=>ae(H.value)},`下载附件`)]),o(`div`,{ref_key:`attachmentTarget`,ref:U,class:`attachment-target`},null,512)])):g(``,!0)])])):g(``,!0),R.value?(e(),s(`div`,F,[n[6]||=o(`span`,null,null,-1),o(`strong`,null,a(z.value),1)])):g(``,!0),B.value?(e(),s(`div`,I,[n[7]||=o(`strong`,null,`邮件预览提示`,-1),o(`p`,null,a(B.value),1)])):g(``,!0)]))}}),[[`__scopeId`,`data-v-0989d798`]]);export{L as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./src-DDZoLlpv.js","./index-Bs0y_lo-.js","./index-BlC70W4a.css"])))=>i.map(i=>d[i]);
2
- import{A as e,B as t,D as n,E as r,I as i,O as a,V as o,_ as s,b as c,g as l,h as u,j as d,l as f,t as p,w as m,y as h,z as g}from"./index-Bs0y_lo-.js";var _={class:`epub-toolbar`},v={class:`epub-title`},y={class:`epub-actions`},b=[`disabled`],x={class:`epub-progress`},S=[`disabled`],C={class:`epub-body`},w={key:0,class:`epub-toc`},T={class:`epub-toc-head`},E={class:`epub-toc-list`},D=[`onClick`],O={class:`epub-stage-wrap`},k={key:0,class:`epub-state`},A={key:1,class:`epub-state error`},j=f(m({__name:`EpubViewer`,props:{data:{}},setup(f){let m=f,j=i(null),M=i(`loading`),N=i(``),P=i(!0),F=i(`EPUB 电子书`),I=i(``),L=i([]),R=i(``),z=i(null),B=i(!0),V=i(!1),H,U,W=!1,G,K=l(()=>{if(!R.value)return``;let e=L.value.find(e=>e.href===R.value);return e?e.label:L.value.find(e=>R.value.includes(e.href.split(`#`)[0]))?.label||``}),q=l(()=>typeof z.value==`number`?`${z.value}%`:K.value||`阅读中`),J=(e,t)=>typeof e==`string`&&e.trim()?e.trim():t,Y=(e,t=0)=>Array.isArray(e)?e.flatMap((e,n)=>{let r=e,i=typeof r.href==`string`?r.href:``,a=J(r.label||r.title,`章节 ${n+1}`),o=Y(r.subitems||r.children,t+1);return i?[{depth:t,href:i,id:`${t}-${n}-${i}`,label:a},...o]:o}):[],X=e=>{let t=e.find(e=>{let t=e.label.toLowerCase();return/(^|\s)(chapter|part|book|prologue|preface|introduction)\b/.test(t)||/第[一二三四五六七八九十百千0-9]+[章节回部卷篇]/.test(e.label)});return t?t.href:e.find(e=>{let t=`${e.label} ${e.href}`.toLowerCase();return!/(cover|titlepage|title-page|copyright|license|toc|contents|nav|table-of-contents|wrap0000)/.test(t)})?.href||e[0]?.href},Z=e=>{B.value=!!e?.atStart,V.value=!!e?.atEnd,R.value=e?.start?.href||``,typeof e?.start?.percentage==`number`&&(z.value=Math.round(e.start.percentage*100))},Q=e=>new Promise(t=>{G=window.setTimeout(t,e)}),$=()=>{let e=(j.value?.querySelector(`iframe`))?.contentDocument?.body;return e?!!(e.innerText.trim()||e.querySelector(`img, svg, canvas`)):!1},ee=async()=>{for(let e=0;e<20;e++){if(W||$())return $();await Q(100)}return $()},te=async()=>{M.value=`loading`,await r();let e=j.value;if(e)try{let{default:t}=await p(async()=>{let{default:e}=await import(`./src-DDZoLlpv.js`);return{default:e}},__vite__mapDeps([0,1,2]),import.meta.url);if(W)return;H=t(m.data.slice(0),{openAs:`binary`,replacements:`blobUrl`}),U=H.renderTo(e,{allowScriptedContent:!1,flow:`scrolled`,height:`100%`,manager:`continuous`,resizeOnOrientationChange:!0,spread:`none`,width:`100%`}),U.themes.default({body:{color:`#172033`,fontFamily:`Georgia, "Times New Roman", serif`,lineHeight:`1.72`,padding:`0 8px`},img:{maxWidth:`100%`},html:{height:`auto`,overflow:`auto`}}),U.on(`relocated`,Z),await H.ready;let n=await H.loaded.metadata.catch(()=>void 0);F.value=J(n?.title,F.value),I.value=J(n?.creator,``),L.value=Y((await H.loaded.navigation.catch(()=>void 0))?.toc);let r=X(L.value);if(await U.display(r),!await ee())throw Error(`EPUB 正文渲染未完成,请刷新后重试`);if(W)return;M.value=`ready`,H.locations.generate(1200).catch(()=>void 0)}catch(e){console.error(e),N.value=e instanceof Error?e.message:String(e),M.value=`error`}},ne=async()=>{await U?.prev()},re=async()=>{await U?.next()},ie=async e=>{await U?.display(e.href),P.value=!1};return a(te),n(()=>{W=!0,G!==void 0&&(clearTimeout(G),G=void 0),U&&=(U.off(`relocated`,Z),U.destroy(),void 0),H?.destroy(),H=void 0}),(n,r)=>(e(),c(`div`,{class:g([`epub-viewer`,{"epub-viewer--toc-hidden":!P.value}])},[s(`div`,_,[s(`button`,{type:`button`,class:g([`epub-icon-button`,{active:P.value}]),title:`目录`,onClick:r[0]||=e=>P.value=!P.value},[...r[1]||=[s(`span`,null,null,-1)]],2),s(`div`,v,[s(`strong`,null,o(F.value),1),s(`span`,null,o(I.value||q.value),1)]),s(`div`,y,[s(`button`,{type:`button`,class:`epub-button`,disabled:M.value!==`ready`||B.value,onClick:ne},` 上一页 `,8,b),s(`span`,x,o(q.value),1),s(`button`,{type:`button`,class:`epub-button`,disabled:M.value!==`ready`||V.value,onClick:re},` 下一页 `,8,S)])]),s(`div`,C,[P.value?(e(),c(`aside`,w,[s(`div`,T,[r[2]||=s(`strong`,null,`目录`,-1),s(`span`,null,o(L.value.length)+` 项`,1)]),s(`div`,E,[(e(!0),c(u,null,d(L.value,n=>(e(),c(`button`,{key:n.id,type:`button`,class:g([`epub-toc-item`,{active:n.href===R.value}]),style:t({paddingLeft:`${12+n.depth*14}px`}),onClick:e=>ie(n)},o(n.label),15,D))),128))])])):h(``,!0),s(`main`,O,[s(`div`,{ref_key:`stage`,ref:j,class:`epub-stage`},null,512),M.value===`loading`?(e(),c(`div`,k,`正在解析 EPUB...`)):M.value===`error`?(e(),c(`div`,A,o(N.value),1)):h(``,!0)])])],2))}}),[[`__scopeId`,`data-v-8f8a2b3b`]]);export{j as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./src-C-6PUQ-1.js","./index-DP0aBxNP.js","./index-B_rKNGx-.css"])))=>i.map(i=>d[i]);
2
+ import{A as e,B as t,D as n,E as r,I as i,O as a,V as o,_ as s,b as c,g as l,h as u,j as d,l as f,t as p,w as m,y as h,z as g}from"./index-DP0aBxNP.js";var _={class:`epub-toolbar`},v={class:`epub-title`},y={class:`epub-actions`},b=[`disabled`],x={class:`epub-progress`},S=[`disabled`],C={class:`epub-body`},w={key:0,class:`epub-toc`},T={class:`epub-toc-head`},E={class:`epub-toc-list`},D=[`onClick`],O={class:`epub-stage-wrap`},k={key:0,class:`epub-state`},A={key:1,class:`epub-state error`},j=f(m({__name:`EpubViewer`,props:{data:{}},setup(f){let m=f,j=i(null),M=i(`loading`),N=i(``),P=i(!0),F=i(`EPUB 电子书`),I=i(``),L=i([]),R=i(``),z=i(null),B=i(!0),V=i(!1),H,U,W=!1,G,K=l(()=>{if(!R.value)return``;let e=L.value.find(e=>e.href===R.value);return e?e.label:L.value.find(e=>R.value.includes(e.href.split(`#`)[0]))?.label||``}),q=l(()=>typeof z.value==`number`?`${z.value}%`:K.value||`阅读中`),J=(e,t)=>typeof e==`string`&&e.trim()?e.trim():t,Y=(e,t=0)=>Array.isArray(e)?e.flatMap((e,n)=>{let r=e,i=typeof r.href==`string`?r.href:``,a=J(r.label||r.title,`章节 ${n+1}`),o=Y(r.subitems||r.children,t+1);return i?[{depth:t,href:i,id:`${t}-${n}-${i}`,label:a},...o]:o}):[],X=e=>{let t=e.find(e=>{let t=e.label.toLowerCase();return/(^|\s)(chapter|part|book|prologue|preface|introduction)\b/.test(t)||/第[一二三四五六七八九十百千0-9]+[章节回部卷篇]/.test(e.label)});return t?t.href:e.find(e=>{let t=`${e.label} ${e.href}`.toLowerCase();return!/(cover|titlepage|title-page|copyright|license|toc|contents|nav|table-of-contents|wrap0000)/.test(t)})?.href||e[0]?.href},Z=e=>{B.value=!!e?.atStart,V.value=!!e?.atEnd,R.value=e?.start?.href||``,typeof e?.start?.percentage==`number`&&(z.value=Math.round(e.start.percentage*100))},Q=e=>new Promise(t=>{G=window.setTimeout(t,e)}),$=()=>{let e=(j.value?.querySelector(`iframe`))?.contentDocument?.body;return e?!!(e.innerText.trim()||e.querySelector(`img, svg, canvas`)):!1},ee=async()=>{for(let e=0;e<20;e++){if(W||$())return $();await Q(100)}return $()},te=async()=>{M.value=`loading`,await r();let e=j.value;if(e)try{let{default:t}=await p(async()=>{let{default:e}=await import(`./src-C-6PUQ-1.js`);return{default:e}},__vite__mapDeps([0,1,2]),import.meta.url);if(W)return;H=t(m.data.slice(0),{openAs:`binary`,replacements:`blobUrl`}),U=H.renderTo(e,{allowScriptedContent:!1,flow:`scrolled`,height:`100%`,manager:`continuous`,resizeOnOrientationChange:!0,spread:`none`,width:`100%`}),U.themes.default({body:{color:`#172033`,fontFamily:`Georgia, "Times New Roman", serif`,lineHeight:`1.72`,padding:`0 8px`},img:{maxWidth:`100%`},html:{height:`auto`,overflow:`auto`}}),U.on(`relocated`,Z),await H.ready;let n=await H.loaded.metadata.catch(()=>void 0);F.value=J(n?.title,F.value),I.value=J(n?.creator,``),L.value=Y((await H.loaded.navigation.catch(()=>void 0))?.toc);let r=X(L.value);if(await U.display(r),!await ee())throw Error(`EPUB 正文渲染未完成,请刷新后重试`);if(W)return;M.value=`ready`,H.locations.generate(1200).catch(()=>void 0)}catch(e){console.error(e),N.value=e instanceof Error?e.message:String(e),M.value=`error`}},ne=async()=>{await U?.prev()},re=async()=>{await U?.next()},ie=async e=>{await U?.display(e.href),P.value=!1};return a(te),n(()=>{W=!0,G!==void 0&&(clearTimeout(G),G=void 0),U&&=(U.off(`relocated`,Z),U.destroy(),void 0),H?.destroy(),H=void 0}),(n,r)=>(e(),c(`div`,{class:g([`epub-viewer`,{"epub-viewer--toc-hidden":!P.value}])},[s(`div`,_,[s(`button`,{type:`button`,class:g([`epub-icon-button`,{active:P.value}]),title:`目录`,onClick:r[0]||=e=>P.value=!P.value},[...r[1]||=[s(`span`,null,null,-1)]],2),s(`div`,v,[s(`strong`,null,o(F.value),1),s(`span`,null,o(I.value||q.value),1)]),s(`div`,y,[s(`button`,{type:`button`,class:`epub-button`,disabled:M.value!==`ready`||B.value,onClick:ne},` 上一页 `,8,b),s(`span`,x,o(q.value),1),s(`button`,{type:`button`,class:`epub-button`,disabled:M.value!==`ready`||V.value,onClick:re},` 下一页 `,8,S)])]),s(`div`,C,[P.value?(e(),c(`aside`,w,[s(`div`,T,[r[2]||=s(`strong`,null,`目录`,-1),s(`span`,null,o(L.value.length)+` 项`,1)]),s(`div`,E,[(e(!0),c(u,null,d(L.value,n=>(e(),c(`button`,{key:n.id,type:`button`,class:g([`epub-toc-item`,{active:n.href===R.value}]),style:t({paddingLeft:`${12+n.depth*14}px`}),onClick:e=>ie(n)},o(n.label),15,D))),128))])])):h(``,!0),s(`main`,O,[s(`div`,{ref_key:`stage`,ref:j,class:`epub-stage`},null,512),M.value===`loading`?(e(),c(`div`,k,`正在解析 EPUB...`)):M.value===`error`?(e(),c(`div`,A,o(N.value),1)):h(``,!0)])])],2))}}),[[`__scopeId`,`data-v-8f8a2b3b`]]);export{j as default};
@@ -1 +1 @@
1
- import{A as e,E as t,H as n,I as r,M as i,N as a,O as o,P as s,R as c,b as l,g as u,h as d,j as f,k as p,l as m,q as h,v as g,w as _}from"./index-Bs0y_lo-.js";var v=h(n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Viewer=r())})(e,(function(){function e(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function t(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,s(r.key),r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,`prototype`,{writable:!1}),e}function r(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e){var t=o(e,`string`);return typeof t==`symbol`?t:t+``}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:``,container:`body`,filter:null,fullscreen:!0,inheritedAttributes:[`crossOrigin`,`decoding`,`isMap`,`loading`,`referrerPolicy`,`sizes`,`srcset`,`useMap`],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:`src`,ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},u=`<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>`,d=typeof window<`u`&&window.document!==void 0,f=d?window:{},p=d&&f.document.documentElement?`ontouchstart`in f.document.documentElement:!1,m=d?`PointerEvent`in f:!1,h=`viewer`,g=`move`,_=`switch`,v=`zoom`,y=`${h}-active`,ee=`${h}-close`,b=`${h}-fade`,x=`${h}-fixed`,te=`${h}-fullscreen`,ne=`${h}-fullscreen-exit`,S=`${h}-hide`,C=`${h}-hide-md-down`,re=`${h}-hide-sm-down`,ie=`${h}-hide-xs-down`,w=`${h}-in`,T=`${h}-invisible`,E=`${h}-loading`,ae=`${h}-move`,oe=`${h}-open`,D=`${h}-show`,O=`${h}-transition`,k=`click`,se=`dblclick`,ce=`dragstart`,le=`focusin`,ue=`keydown`,A=`load`,j=`error`,de=p?`touchend touchcancel`:`mouseup`,fe=p?`touchmove`:`mousemove`,pe=m?`pointerdown`:p?`touchstart`:`mousedown`,me=m?`pointermove`:fe,he=m?`pointerup pointercancel`:de,ge=`resize`,M=`transitionend`,_e=`wheel`,ve=`ready`,ye=`show`,be=`shown`,xe=`hide`,Se=`hidden`,Ce=`view`,N=`viewed`,we=`move`,Te=`moved`,Ee=`rotate`,De=`rotated`,Oe=`scale`,ke=`scaled`,P=`zoom`,Ae=`zoomed`,je=`play`,Me=`stop`,F=`${h}Action`,Ne=/\s\s*/,I=[`zoom-in`,`zoom-out`,`one-to-one`,`reset`,`prev`,`play`,`next`,`rotate-left`,`rotate-right`,`flip-horizontal`,`flip-vertical`];function Pe(e){return typeof e==`string`}var Fe=Number.isNaN||f.isNaN;function L(e){return typeof e==`number`&&!Fe(e)}function R(e){return e===void 0}function z(e){return c(e)===`object`&&e!==null}var Ie=Object.prototype.hasOwnProperty;function B(e){if(!z(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&Ie.call(n,`isPrototypeOf`)}catch{return!1}}function V(e){return typeof e==`function`}function H(e,t){if(e&&V(t))if(Array.isArray(e)||L(e.length)){var n=e.length,r;for(r=0;r<n&&t.call(e,e[r],r,e)!==!1;r+=1);}else z(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)});return e}var U=Object.assign||function(e){var t=[...arguments].slice(1);return z(e)&&t.length>0&&t.forEach(function(t){z(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Le=/^(?:width|height|left|top|marginLeft|marginTop)$/;function W(e,t){var n=e.style;H(t,function(e,t){Le.test(t)&&L(e)&&(e+=`px`),n[t]=e})}function Re(e){return Pe(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`):e}function G(e,t){return!e||!t?!1:e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function K(e,t){if(!(!e||!t)){if(L(e.length)){H(e,function(e){K(e,t)});return}if(e.classList){e.classList.add(t);return}var n=e.className.trim();n?n.indexOf(t)<0&&(e.className=`${n} ${t}`):e.className=t}}function q(e,t){if(!(!e||!t)){if(L(e.length)){H(e,function(e){q(e,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,``))}}function J(e,t,n){if(t){if(L(e.length)){H(e,function(e){J(e,t,n)});return}n?K(e,t):q(e,t)}}var ze=/([a-z\d])([A-Z])/g;function Be(e){return e.replace(ze,`$1-$2`).toLowerCase()}function Y(e,t){return z(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute(`data-${Be(t)}`)}function Ve(e,t,n){z(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute(`data-${Be(t)}`,n)}var He=function(){var e=!1;if(d){var t=!1,n=function(){},r=Object.defineProperty({},`once`,{get:function(){return e=!0,t},set:function(e){t=e}});f.addEventListener(`test`,n,r),f.removeEventListener(`test`,n,r)}return e}();function X(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split(Ne).forEach(function(t){if(!He){var a=e.listeners;a&&a[t]&&a[t][n]&&(i=a[t][n],delete a[t][n],Object.keys(a[t]).length===0&&delete a[t],Object.keys(a).length===0&&delete e.listeners)}e.removeEventListener(t,i,r)})}function Z(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split(Ne).forEach(function(t){if(r.once&&!He){var a=e.listeners,o=a===void 0?{}:a;i=function(){delete o[t][n],e.removeEventListener(t,i,r);var a=[...arguments];n.apply(e,a)},o[t]||(o[t]={}),o[t][n]&&e.removeEventListener(t,o[t][n],r),o[t][n]=i,e.listeners=o}e.addEventListener(t,i,r)})}function Q(e,t,n,r){var i;return V(Event)&&V(CustomEvent)?i=new CustomEvent(t,a({bubbles:!0,cancelable:!0,detail:n},r)):(i=document.createEvent(`CustomEvent`),i.initCustomEvent(t,!0,!0,n)),e.dispatchEvent(i)}function Ue(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}function We(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,a=e.translateY,o=[];L(i)&&i!==0&&o.push(`translateX(${i}px)`),L(a)&&a!==0&&o.push(`translateY(${a}px)`),L(t)&&t!==0&&o.push(`rotate(${t}deg)`),L(n)&&n!==1&&o.push(`scaleX(${n})`),L(r)&&r!==1&&o.push(`scaleY(${r})`);var s=o.length?o.join(` `):`none`;return{WebkitTransform:s,msTransform:s,transform:s}}function Ge(e){return Pe(e)?decodeURIComponent(e.replace(/^.*\//,``).replace(/[?&#].*$/,``)):``}var Ke=f.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(f.navigator.userAgent);function qe(e,t,n){var r=document.createElement(`img`);if(e.naturalWidth&&!Ke)return n(e.naturalWidth,e.naturalHeight),r;var i=document.body||document.documentElement;return r.onload=function(){n(r.width,r.height),Ke||i.removeChild(r)},H(t.inheritedAttributes,function(t){var n=e.getAttribute(t);n!==null&&r.setAttribute(t,n)}),r.src=e.src,Ke||(r.style.cssText=`left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;`,i.appendChild(r)),r}function Je(e){switch(e){case 2:return ie;case 3:return re;case 4:return C;default:return``}}function Ye(e){var t=a({},e),n=[];return H(e,function(e,r){delete t[r],H(t,function(t){var r=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),a=Math.abs(e.endX-t.endX),o=Math.abs(e.endY-t.endY),s=Math.sqrt(r*r+i*i),c=(Math.sqrt(a*a+o*o)-s)/s;n.push(c)})}),n.sort(function(e,t){return Math.abs(e)<Math.abs(t)}),n[0]}function Xe(e,t){var n=e.pageX,r=e.pageY,i={endX:n,endY:r};return t?i:a({timeStamp:Date.now(),startX:n,startY:r},i)}function Ze(e){var t=0,n=0,r=0;return H(e,function(e){var i=e.startX,a=e.startY;t+=i,n+=a,r+=1}),t/=r,n/=r,{pageX:t,pageY:n}}var Qe={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var e=this.element.ownerDocument,t=e.body||e.documentElement;this.body=t,this.scrollbarWidth=window.innerWidth-e.documentElement.clientWidth,this.initialBodyPaddingRight=t.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(t).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var e=this.options,t=this.parent,n;e.inline&&(n={width:Math.max(t.offsetWidth,e.minWidth),height:Math.max(t.offsetHeight,e.minHeight)},this.parentData=n),(this.fulled||!n)&&(n=this.containerData),this.viewerData=U({},n)},renderViewer:function(){this.options.inline&&!this.fulled&&W(this.viewer,this.viewerData)},initList:function(){var e=this,t=this.element,n=this.options,r=this.list,i=[];r.innerHTML=``,H(this.images,function(t,a){var o=t.src,s=t.alt||Ge(o),c=e.getImageURL(t);if(o||c){var l=document.createElement(`li`),u=document.createElement(`img`);H(n.inheritedAttributes,function(e){var n=t.getAttribute(e);n!==null&&u.setAttribute(e,n)}),n.navbar&&(u.src=o||c),u.alt=s,u.setAttribute(`data-original-url`,c||o),l.setAttribute(`data-index`,a),l.setAttribute(`data-viewer-action`,`view`),l.setAttribute(`role`,`button`),n.keyboard&&l.setAttribute(`tabindex`,0),l.appendChild(u),r.appendChild(l),i.push(l)}}),this.items=i,H(i,function(t){var r=t.firstElementChild,i,a;Ve(r,`filled`,!0),n.loading&&K(t,E),Z(r,A,i=function(i){X(r,j,a),n.loading&&q(t,E),e.loadImage(i)},{once:!0}),Z(r,j,a=function(){X(r,A,i),n.loading&&q(t,E)},{once:!0})}),n.transition&&Z(t,N,function(){K(r,O)},{once:!0})},renderList:function(){var e=this.index,t=this.items[e];if(t){var n=t.nextElementSibling,r=parseInt(window.getComputedStyle(n||t).marginLeft,10),i=t.offsetWidth,a=i+r;W(this.list,U({width:a*this.length-r},We({translateX:(this.viewerData.width-i)/2-a*e})))}},resetList:function(){var e=this.list;e.innerHTML=``,q(e,O),W(e,We({translateX:0}))},initImage:function(e){var t=this,n=this.options,r=this.image,i=this.viewerData,a=this.footer.offsetHeight,o=i.width,s=Math.max(i.height-a,a),c=this.imageData||{},l;this.imageInitializing={abort:function(){l.onload=null}},l=qe(r,n,function(r,i){var a=r/i,l=Math.max(0,Math.min(1,n.initialCoverage)),u=o,d=s;t.imageInitializing=!1,s*a>o?d=o/a:u=s*a,l=L(l)?l:.9,u=Math.min(u*l,r),d=Math.min(d*l,i);var f=(o-u)/2,p=(s-d)/2,m={left:f,top:p,x:f,y:p,width:u,height:d,oldRatio:1,ratio:u/r,aspectRatio:a,naturalWidth:r,naturalHeight:i},h=U({},m);n.rotatable&&(m.rotate=c.rotate||0,h.rotate=0),n.scalable&&(m.scaleX=c.scaleX||1,m.scaleY=c.scaleY||1,h.scaleX=1,h.scaleY=1),t.imageData=m,t.initialImageData=h,e&&e()})},renderImage:function(e){var t=this,n=this.image,r=this.imageData;if(W(n,U({width:r.width,height:r.height,marginLeft:r.x,marginTop:r.y},We(r))),e)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&G(n,O)){var i=function(){t.imageRendering=!1,e()};this.imageRendering={abort:function(){X(n,M,i)}},Z(n,M,i,{once:!0})}else e()},resetImage:function(){var e=this.image;e&&(this.viewing&&this.viewing.abort(),e.parentNode.removeChild(e),this.image=null,this.title.innerHTML=``)}},$e={bind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Z(t,k,this.onClick=this.click.bind(this)),Z(t,ce,this.onDragStart=this.dragstart.bind(this)),Z(n,pe,this.onPointerDown=this.pointerdown.bind(this)),Z(r,me,this.onPointerMove=this.pointermove.bind(this)),Z(r,he,this.onPointerUp=this.pointerup.bind(this)),Z(r,ue,this.onKeyDown=this.keydown.bind(this)),Z(window,ge,this.onResize=this.resize.bind(this)),e.zoomable&&e.zoomOnWheel&&Z(t,_e,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleOnDblclick&&Z(n,se,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;X(t,k,this.onClick),X(t,ce,this.onDragStart),X(n,pe,this.onPointerDown),X(r,me,this.onPointerMove),X(r,he,this.onPointerUp),X(r,ue,this.onKeyDown),X(window,ge,this.onResize),e.zoomable&&e.zoomOnWheel&&X(t,_e,this.onWheel,{passive:!1,capture:!0}),e.toggleOnDblclick&&X(n,se,this.onDblclick)}},et={click:function(e){var t=this.options,n=this.imageData,r=e.target,i=Y(r,F);switch(!i&&r.localName===`img`&&r.parentElement.localName===`li`&&(r=r.parentElement,i=Y(r,F)),p&&e.isTrusted&&r===this.canvas&&clearTimeout(this.clickCanvasTimeout),i){case`mix`:this.played?this.stop():t.inline?this.fulled?this.exit():this.full():this.hide();break;case`hide`:this.pointerMoved||this.hide();break;case`view`:this.view(Y(r,`index`));break;case`zoom-in`:this.zoom(.1,!0);break;case`zoom-out`:this.zoom(-.1,!0);break;case`one-to-one`:this.toggle();break;case`reset`:this.reset();break;case`prev`:this.prev(t.loop);break;case`play`:this.play(t.fullscreen);break;case`next`:this.next(t.loop);break;case`rotate-left`:this.rotate(-90);break;case`rotate-right`:this.rotate(90);break;case`flip-horizontal`:this.scaleX(-n.scaleX||-1);break;case`flip-vertical`:this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(e){e.preventDefault(),this.viewed&&e.target===this.image&&(p&&e.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(e.isTrusted?e:e.detail&&e.detail.originalEvent))},load:function(){var e=this;this.timeout&&=(clearTimeout(this.timeout),!1);var t=this.element,n=this.options,r=this.image,i=this.index,a=this.viewerData;q(r,T),n.loading&&q(this.canvas,E),r.style.cssText=`height:0;margin-left:${a.width/2}px;margin-top:${a.height/2}px;max-width:none!important;position:relative;width:0;`,this.initImage(function(){J(r,ae,n.movable),J(r,O,n.transition),e.renderImage(function(){e.viewed=!0,e.viewing=!1,V(n.viewed)&&Z(t,N,n.viewed,{once:!0}),Q(t,N,{originalImage:e.images[i],index:i,image:r},{cancelable:!1})})})},loadImage:function(e){var t=e.target,n=t.parentNode,r=n.offsetWidth||30,i=n.offsetHeight||50,a=!!Y(t,`filled`);qe(t,this.options,function(e,n){var o=e/n,s=r,c=i;i*o>r?a?s=i*o:c=r/o:a?c=r/o:s=i*o,W(t,U({width:s,height:c},We({translateX:(r-s)/2,translateY:(i-c)/2})))})},keydown:function(e){var t=this.options;if(t.keyboard){var n=e.keyCode||e.which||e.charCode;switch(n){case 13:this.viewer.contains(e.target)&&this.click(e);break}if(this.fulled)switch(n){case 27:this.played?this.stop():t.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(t.loop);break;case 38:e.preventDefault(),this.zoom(t.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(t.loop);break;case 40:e.preventDefault(),this.zoom(-t.zoomRatio,!0);break;case 48:case 49:e.ctrlKey&&(e.preventDefault(),this.toggle());break}}},dragstart:function(e){e.target.localName===`img`&&e.preventDefault()},pointerdown:function(e){var t=this.options,n=this.pointers,r=e.buttons,i=e.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(e.type===`mousedown`||e.type===`pointerdown`&&e.pointerType===`mouse`)&&(L(r)&&r!==1||L(i)&&i!==0||e.ctrlKey))){e.preventDefault(),e.changedTouches?H(e.changedTouches,function(e){n[e.identifier]=Xe(e)}):n[e.pointerId||0]=Xe(e);var a=t.movable?g:!1;t.zoomOnTouch&&t.zoomable&&Object.keys(n).length>1?a=v:t.slideOnTouch&&(e.pointerType===`touch`||e.type===`touchstart`)&&this.isSwitchable()&&(a=_),t.transition&&(a===g||a===v)&&q(this.image,O),this.action=a}},pointermove:function(e){var t=this.pointers,n=this.action;!this.viewed||!n||(e.preventDefault(),e.changedTouches?H(e.changedTouches,function(e){U(t[e.identifier]||{},Xe(e,!0))}):U(t[e.pointerId||0]||{},Xe(e,!0)),this.change(e))},pointerup:function(e){var t=this,n=this.options,r=this.action,i=this.pointers,a;e.changedTouches?H(e.changedTouches,function(e){a=i[e.identifier],delete i[e.identifier]}):(a=i[e.pointerId||0],delete i[e.pointerId||0]),r&&(e.preventDefault(),n.transition&&(r===g||r===v)&&K(this.image,O),this.action=!1,p&&r!==v&&a&&Date.now()-a.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&e.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){Q(t.image,se,{originalEvent:e})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){t.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&n.backdrop!==`static`&&e.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){Q(t.canvas,k,{originalEvent:e})},50)))))},resize:function(){var e=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}H(this.player.getElementsByTagName(`img`),function(t){Z(t,A,e.loadImage.bind(e),{once:!0}),Q(t,A)})}},wheel:function(e){var t=this;if(this.viewed&&(e.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50);var n=Number(this.options.zoomRatio)||.1,r=1;e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,!0,null,e)}}},tt={show:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(e),this;if(V(n.show)&&Z(t,ye,n.show,{once:!0}),Q(t,ye)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var r=this.viewer;if(q(r,S),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-labelledby`,this.title.id),r.setAttribute(`aria-modal`,!0),r.removeAttribute(`aria-hidden`),n.transition&&!e){var i=this.shown.bind(this);this.transitioning={abort:function(){X(r,M,i),q(r,w)}},K(r,O),r.initialOffsetWidth=r.offsetWidth,Z(r,M,i,{once:!0}),K(r,w)}else K(r,w),this.shown();return this},hide:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.element,r=this.options;if(r.inline||this.hiding||!(this.isShown||this.showing)||(V(r.hide)&&Z(n,xe,r.hide,{once:!0}),Q(n,xe)===!1))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var i=this.viewer,a=this.image,o=function(){q(i,w),e.hidden()};if(r.transition&&!t){var s=function(t){t&&t.target===i&&(X(i,M,s),e.hidden())},c=function(){G(i,O)?(Z(i,M,s),q(i,w)):o()};this.transitioning={abort:function(){e.viewed&&G(a,O)?X(a,M,c):G(i,O)&&X(i,M,s)}},this.viewed&&G(a,O)?(Z(a,M,c,{once:!0}),this.zoomTo(0,!1,null,null,!0)):c()}else o();return this},view:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(t=Number(t)||0,this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var n=this.element,r=this.options,i=this.title,a=this.canvas,o=this.items[t],s=o.querySelector(`img`),c=Y(s,`originalUrl`),l=s.getAttribute(`alt`),u=document.createElement(`img`);if(H(r.inheritedAttributes,function(e){var t=s.getAttribute(e);t!==null&&u.setAttribute(e,t)}),u.src=c,u.alt=l,V(r.view)&&Z(n,Ce,r.view,{once:!0}),Q(n,Ce,{originalImage:this.images[t],index:t,image:u})===!1||!this.isShown||this.hiding||this.played)return this;var d=this.items[this.index];d&&(q(d,y),d.removeAttribute(`aria-selected`)),K(o,y),o.setAttribute(`aria-selected`,!0),r.focus&&o.focus(),this.image=u,this.viewed=!1,this.index=t,this.imageData={},K(u,T),r.loading&&K(a,E),a.innerHTML=``,a.appendChild(u),this.renderList(),i.innerHTML=``;var f=function(){var t=e.imageData,n=Array.isArray(r.title)?r.title[1]:r.title;i.innerHTML=Re(V(n)?n.call(e,u,t):`${l} (${t.naturalWidth} × ${t.naturalHeight})`)},p,m;return Z(n,N,f,{once:!0}),this.viewing={abort:function(){X(n,N,f),u.complete?e.imageRendering?e.imageRendering.abort():e.imageInitializing&&e.imageInitializing.abort():(u.src=``,X(u,A,p),e.timeout&&clearTimeout(e.timeout))}},u.complete?this.load():(Z(u,A,p=function(){X(u,j,m),e.load()},{once:!0}),Z(u,j,m=function(){X(u,A,p),e.timeout&&=(clearTimeout(e.timeout),!1),q(u,T),r.loading&&q(e.canvas,E)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){q(u,T),e.timeout=!1},1e3)),this},prev:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.index-1;return t<0&&(t=e?this.length-1:0),this.view(t),this},next:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.length-1,n=this.index+1;return n>t&&(n=e?0:t),this.view(n),this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData;return this.moveTo(R(e)?e:n.x+Number(e),R(t)?t:n.y+Number(t)),this},moveTo:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=this.element,a=this.options,o=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&a.movable){var s=o.x,c=o.y,l=!1;if(L(e)?l=!0:e=s,L(n)?l=!0:n=c,l){if(V(a.move)&&Z(i,we,a.move,{once:!0}),Q(i,we,{x:e,y:n,oldX:s,oldY:c,originalEvent:r})===!1)return this;o.x=e,o.y=n,o.left=e,o.top=n,this.moving=!0,this.renderImage(function(){t.moving=!1,V(a.moved)&&Z(i,Te,a.moved,{once:!0}),Q(i,Te,{x:e,y:n,oldX:s,oldY:c,originalEvent:r},{cancelable:!1})})}}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e)),this},rotateTo:function(e){var t=this,n=this.element,r=this.options,i=this.imageData;if(e=Number(e),L(e)&&this.viewed&&!this.played&&r.rotatable){var a=i.rotate;if(V(r.rotate)&&Z(n,Ee,r.rotate,{once:!0}),Q(n,Ee,{degree:e,oldDegree:a})===!1)return this;i.rotate=e,this.rotating=!0,this.renderImage(function(){t.rotating=!1,V(r.rotated)&&Z(n,De,r.rotated,{once:!0}),Q(n,De,{degree:e,oldDegree:a},{cancelable:!1})})}return this},scaleX:function(e){return this.scale(e,this.imageData.scaleY),this},scaleY:function(e){return this.scale(this.imageData.scaleX,e),this},scale:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.element,i=this.options,a=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&i.scalable){var o=a.scaleX,s=a.scaleY,c=!1;if(L(e)?c=!0:e=o,L(n)?c=!0:n=s,c){if(V(i.scale)&&Z(r,Oe,i.scale,{once:!0}),Q(r,Oe,{scaleX:e,scaleY:n,oldScaleX:o,oldScaleY:s})===!1)return this;a.scaleX=e,a.scaleY=n,this.scaling=!0,this.renderImage(function(){t.scaling=!1,V(i.scaled)&&Z(r,ke,i.scaled,{once:!0}),Q(r,ke,{scaleX:e,scaleY:n,oldScaleX:o,oldScaleY:s},{cancelable:!1})})}}return this},zoom:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=this.imageData;return e=Number(e),e=e<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,t,n,r),this},zoomTo:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o=this.element,s=this.options,c=this.pointers,l=this.imageData,u=l.x,d=l.y,f=l.width,p=l.height,m=l.naturalWidth,h=l.naturalHeight;if(e=Math.max(0,e),L(e)&&this.viewed&&!this.played&&(a||s.zoomable)){if(!a){var g=Math.max(.01,s.minZoomRatio),_=Math.min(100,s.maxZoomRatio);e=Math.min(Math.max(e,g),_)}if(i)switch(i.type){case`wheel`:s.zoomRatio>=.055&&e>.95&&e<1.05&&(e=1);break;case`pointermove`:case`touchmove`:case`mousemove`:e>.99&&e<1.01&&(e=1);break}var v=m*e,y=h*e,ee=v-f,b=y-p,x=l.ratio;if(V(s.zoom)&&Z(o,P,s.zoom,{once:!0}),Q(o,P,{ratio:e,oldRatio:x,originalEvent:i})===!1)return this;if(this.zooming=!0,i){var te=Ue(this.viewer),ne=c&&Object.keys(c).length>0?Ze(c):{pageX:i.pageX,pageY:i.pageY};l.x-=ee*((ne.pageX-te.left-u)/f),l.y-=b*((ne.pageY-te.top-d)/p)}else B(r)&&L(r.x)&&L(r.y)?(l.x-=ee*((r.x-u)/f),l.y-=b*((r.y-d)/p)):(l.x-=ee/2,l.y-=b/2);l.left=l.x,l.top=l.y,l.width=v,l.height=y,l.oldRatio=x,l.ratio=e,this.renderImage(function(){t.zooming=!1,V(s.zoomed)&&Z(o,Ae,s.zoomed,{once:!0}),Q(o,Ae,{ratio:e,oldRatio:x,originalEvent:i},{cancelable:!1})}),n&&this.tooltip()}return this},play:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var n=this.element,r=this.options;if(V(r.play)&&Z(n,je,r.play,{once:!0}),Q(n,je)===!1)return this;var i=this.player,a=this.loadImage.bind(this),o=[],s=0,c=0;if(this.played=!0,this.onLoadWhenPlay=a,t&&this.requestFullscreen(t),K(i,D),H(this.items,function(e,t){var n=e.querySelector(`img`),l=document.createElement(`img`);l.src=Y(n,`originalUrl`),l.alt=n.getAttribute(`alt`),l.referrerPolicy=n.referrerPolicy,s+=1,K(l,b),J(l,O,r.transition),G(e,y)&&(K(l,w),c=t),o.push(l),Z(l,A,a,{once:!0}),i.appendChild(l)}),L(r.interval)&&r.interval>0){var l=function(){clearTimeout(e.playing.timeout),q(o[c],w),--c,c=c>=0?c:s-1,K(o[c],w),e.playing.timeout=setTimeout(l,r.interval)},u=function(){clearTimeout(e.playing.timeout),q(o[c],w),c+=1,c=c<s?c:0,K(o[c],w),e.playing.timeout=setTimeout(u,r.interval)};s>1&&(this.playing={prev:l,next:u,timeout:setTimeout(u,r.interval)})}return this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,n=this.options;if(V(n.stop)&&Z(t,Me,n.stop,{once:!0}),Q(t,Me)===!1)return this;var r=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,H(r.getElementsByTagName(`img`),function(t){X(t,A,e.onLoadWhenPlay)}),q(r,D),r.innerHTML=``,this.exitFullscreen(),this},full:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||this.fulled||!t.inline?this:(this.fulled=!0,this.open(),K(this.button,ne),t.transition&&(q(i,O),this.viewed&&q(r,O)),K(n,x),n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-labelledby`,this.title.id),n.setAttribute(`aria-modal`,!0),n.removeAttribute(`style`),W(n,{zIndex:t.zIndex}),t.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=U({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){K(r,O),K(i,O)},0)})}),this)},exit:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||!this.fulled||!t.inline?this:(this.fulled=!1,this.close(),q(this.button,ne),t.transition&&(q(i,O),this.viewed&&q(r,O)),t.focus&&this.clearEnforceFocus(),n.removeAttribute(`role`),n.removeAttribute(`aria-labelledby`),n.removeAttribute(`aria-modal`),q(n,x),W(n,{zIndex:t.zIndexInline}),this.viewerData=U({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){K(r,O),K(i,O)},0)})}),this)},tooltip:function(){var e=this,t=this.options,n=this.tooltipBox,r=this.imageData;return!this.viewed||this.played||!t.tooltip?this:(n.textContent=`${Math.round(r.ratio*100)}%`,this.tooltipping?clearTimeout(this.tooltipping):t.transition?(this.fading&&Q(n,M),K(n,D),K(n,b),K(n,O),n.removeAttribute(`aria-hidden`),n.initialOffsetWidth=n.offsetWidth,K(n,w)):(K(n,D),n.removeAttribute(`aria-hidden`)),this.tooltipping=setTimeout(function(){t.transition?(Z(n,M,function(){q(n,D),q(n,b),q(n,O),n.setAttribute(`aria-hidden`,!0),e.fading=!1},{once:!0}),q(n,w),e.fading=!0):(q(n,D),n.setAttribute(`aria-hidden`,!0)),e.tooltipping=!1},1e3),this)},toggle:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,e):this.zoomTo(1,!0,null,e),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=U({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,n=this.options,r=this.isImg;if(r&&!t.parentNode)return this.destroy();var i=[];if(H(r?[t]:t.querySelectorAll(`img`),function(t){V(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),!i.length)return this;if(this.images=i,this.length=i.length,this.ready){var a=[];if(H(this.items,function(e,t){var n=e.querySelector(`img`),r=i[t];r&&n?(r.src!==n.src||r.alt!==n.alt)&&a.push(t):a.push(t)}),W(this.list,{width:`auto`}),this.initList(),this.isShown)if(this.length){if(this.viewed){var o=a.indexOf(this.index);if(o>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-o,this.length-1),0));else{var s=this.items[this.index];K(s,y),s.setAttribute(`aria-selected`,!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML=``,this.title.innerHTML=``}else this.build();return this},destroy:function(){var e=this.element,t=this.options;return e[h]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),t.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):t.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),t.inline||X(e,k,this.onStart),e[h]=void 0,this):this}},nt={getImageURL:function(e){var t=this.options.url;return t=Pe(t)?e.getAttribute(t):V(t)?t.call(this,e):``,t},enforceFocus:function(){var e=this;this.clearEnforceFocus(),Z(document,le,this.onFocusin=function(t){var n=e.viewer,r=t.target;if(!(r===document||r===n||n.contains(r))){for(;r;){if(r.getAttribute(`tabindex`)!==null||r.getAttribute(`aria-modal`)===`true`)return;r=r.parentElement}n.focus()}})},clearEnforceFocus:function(){this.onFocusin&&=(X(document,le,this.onFocusin),null)},open:function(){var e=this.body;K(e,oe),this.scrollbarWidth>0&&(e.style.paddingRight=`${this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0)}px`)},close:function(){var e=this.body;q(e,oe),this.scrollbarWidth>0&&(e.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var e=this.element,t=this.options,n=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,t.focus&&(n.focus(),this.enforceFocus()),V(t.shown)&&Z(e,be,t.shown,{once:!0}),Q(e,be)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var e=this.element,t=this.options,n=this.viewer;t.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),K(n,S),n.removeAttribute(`role`),n.removeAttribute(`aria-labelledby`),n.removeAttribute(`aria-modal`),n.setAttribute(`aria-hidden`,!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(V(t.hidden)&&Z(e,Se,t.hidden,{once:!0}),Q(e,Se,null,{cancelable:!1}))},requestFullscreen:function(e){var t=this.element.ownerDocument;if(this.fulled&&!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)){var n=t.documentElement;n.requestFullscreen?B(e)?n.requestFullscreen(e):n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen()}},exitFullscreen:function(){var e=this.element.ownerDocument;this.fulled&&(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},change:function(e){var t=this.options,n=this.pointers,r=n[Object.keys(n)[0]];if(r){var i=r.endX-r.startX,a=r.endY-r.startY;switch(this.action){case g:(i!==0||a!==0)&&(this.pointerMoved=!0,this.move(i,a,e));break;case v:this.zoom(Ye(n),!1,null,e);break;case _:this.action=`switched`;var o=Math.abs(i);o>1&&o>Math.abs(a)&&(this.pointers={},i>1?this.prev(t.loop):i<-1&&this.next(t.loop));break}H(n,function(e){e.startX=e.endX,e.startY=e.endY})}},isSwitchable:function(){var e=this.imageData,t=this.viewerData;return this.length>1&&e.x>=0&&e.y>=0&&e.width<=t.width&&e.height<=t.height}},rt=f.Viewer,it=function(e){return function(){return e+=1,e}}(-1),at=function(){function t(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,t),!n||n.nodeType!==1)throw Error(`The first argument is required and must be an element.`);this.element=n,this.options=U({},l,B(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=it(),this.init()}return n(t,[{key:`init`,value:function(){var e=this,t=this.element,n=this.options;if(!t[h]){t[h]=this,n.focus&&!n.keyboard&&(n.focus=!1);var r=t.localName===`img`,i=[];if(H(r?[t]:t.querySelectorAll(`img`),function(t){V(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),this.isImg=r,this.length=i.length,this.images=i,this.initBody(),R(document.createElement(h).style.transition)&&(n.transition=!1),n.inline){var a=0,o=function(){if(a+=1,a===e.length){var t;e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0)}};this.initializing={abort:function(){H(i,function(e){e.complete||(X(e,A,o),X(e,j,o))})}},H(i,function(e){if(e.complete)o();else{var t,n;Z(e,A,t=function(){X(e,j,n),o()},{once:!0}),Z(e,j,n=function(){X(e,A,t),o()},{once:!0})}})}else Z(t,k,this.onStart=function(t){var r=t.target;r.localName===`img`&&(!V(n.filter)||n.filter.call(e,r))&&e.view(e.images.indexOf(r))})}}},{key:`build`,value:function(){if(!this.ready){var e=this.element,t=this.options,n=e.parentNode,r=document.createElement(`div`);r.innerHTML=u;var i=r.querySelector(`.${h}-container`),a=i.querySelector(`.${h}-title`),o=i.querySelector(`.${h}-toolbar`),s=i.querySelector(`.${h}-navbar`),c=i.querySelector(`.${h}-button`),l=i.querySelector(`.${h}-canvas`);if(this.parent=n,this.viewer=i,this.title=a,this.toolbar=o,this.navbar=s,this.button=c,this.canvas=l,this.footer=i.querySelector(`.${h}-footer`),this.tooltipBox=i.querySelector(`.${h}-tooltip`),this.player=i.querySelector(`.${h}-player`),this.list=i.querySelector(`.${h}-list`),i.id=`${h}${this.id}`,a.id=`${h}Title${this.id}`,K(a,t.title?Je(Array.isArray(t.title)?t.title[0]:t.title):S),K(s,t.navbar?Je(t.navbar):S),J(c,S,!t.button),t.keyboard&&c.setAttribute(`tabindex`,0),t.backdrop&&(K(i,`${h}-backdrop`),!t.inline&&t.backdrop!==`static`&&Ve(l,F,`hide`)),Pe(t.className)&&t.className&&t.className.split(Ne).forEach(function(e){K(i,e)}),t.toolbar){var d=document.createElement(`ul`),f=B(t.toolbar),p=I.slice(0,3),m=I.slice(7,9),g=I.slice(9);f||K(o,Je(t.toolbar)),H(f?t.toolbar:I,function(e,n){var r=f&&B(e),i=f?Be(n):e,a=r&&!R(e.show)?e.show:e;if(!(!a||!t.zoomable&&p.indexOf(i)!==-1||!t.rotatable&&m.indexOf(i)!==-1||!t.scalable&&g.indexOf(i)!==-1)){var o=r&&!R(e.size)?e.size:e,s=r&&!R(e.click)?e.click:e,c=document.createElement(`li`);t.keyboard&&c.setAttribute(`tabindex`,0),c.setAttribute(`role`,`button`),K(c,`${h}-${i}`),V(s)||Ve(c,F,i),L(a)&&K(c,Je(a)),[`small`,`large`].indexOf(o)===-1?i===`play`&&K(c,`${h}-large`):K(c,`${h}-${o}`),V(s)&&Z(c,k,s),d.appendChild(c)}}),o.appendChild(d)}else K(o,S);if(!t.rotatable){var _=o.querySelectorAll(`li[class*="rotate"]`);K(_,T),H(_,function(e){o.appendChild(e)})}if(t.inline)K(c,te),W(i,{zIndex:t.zIndexInline}),window.getComputedStyle(n).position===`static`&&W(n,{position:`relative`}),n.insertBefore(i,e.nextSibling);else{K(c,ee),K(i,x),K(i,b),K(i,S),W(i,{zIndex:t.zIndex});var v=t.container;Pe(v)&&(v=e.ownerDocument.querySelector(v)),v||=this.body,v.appendChild(i)}if(t.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,V(t.ready)&&Z(e,ve,t.ready,{once:!0}),Q(e,ve)===!1){this.ready=!1;return}this.ready&&t.inline&&this.view(this.index)}}}],[{key:`noConflict`,value:function(){return window.Viewer=rt,t}},{key:`setDefaults`,value:function(e){U(l,B(e)&&e)}}])}();return U(at.prototype,Qe,$e,et,tt,nt),at}))}))(),1),y=typeof global==`object`&&global&&global.Object===Object&&global,ee=typeof self==`object`&&self&&self.Object===Object&&self,b=y||ee||Function(`return this`)(),x=b.Symbol,te=Object.prototype,ne=te.hasOwnProperty,S=te.toString,C=x?x.toStringTag:void 0;function re(e){var t=ne.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch{}var i=S.call(e);return r&&(t?e[C]=n:delete e[C]),i}var ie=Object.prototype.toString;function w(e){return ie.call(e)}var T=`[object Null]`,E=`[object Undefined]`,ae=x?x.toStringTag:void 0;function oe(e){return e==null?e===void 0?E:T:ae&&ae in Object(e)?re(e):w(e)}function D(e){return typeof e==`object`&&!!e}var O=Array.isArray;function k(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function se(e){return e}var ce=`[object AsyncFunction]`,le=`[object Function]`,ue=`[object GeneratorFunction]`,A=`[object Proxy]`;function j(e){if(!k(e))return!1;var t=oe(e);return t==le||t==ue||t==ce||t==A}var de=b[`__core-js_shared__`],fe=function(){var e=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function pe(e){return!!fe&&fe in e}var me=Function.prototype.toString;function he(e){if(e!=null){try{return me.call(e)}catch{}try{return e+``}catch{}}return``}var ge=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,_e=Function.prototype,ve=Object.prototype,ye=_e.toString,be=ve.hasOwnProperty,xe=RegExp(`^`+ye.call(be).replace(ge,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Se(e){return!k(e)||pe(e)?!1:(j(e)?xe:M).test(he(e))}function Ce(e,t){return e?.[t]}function N(e,t){var n=Ce(e,t);return Se(n)?n:void 0}function we(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Te=800,Ee=16,De=Date.now;function Oe(e){var t=0,n=0;return function(){var r=De(),i=Ee-(r-n);if(n=r,i>0){if(++t>=Te)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ke(e){return function(){return e}}var P=function(){try{var e=N(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Ae=Oe(P?function(e,t){return P(e,`toString`,{configurable:!0,enumerable:!1,value:ke(t),writable:!0})}:se),je=9007199254740991,Me=/^(?:0|[1-9]\d*)$/;function F(e,t){var n=typeof e;return t??=je,!!t&&(n==`number`||n!=`symbol`&&Me.test(e))&&e>-1&&e%1==0&&e<t}function Ne(e,t,n){t==`__proto__`&&P?P(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function I(e,t){return e===t||e!==e&&t!==t}var Pe=Object.prototype.hasOwnProperty;function Fe(e,t,n){var r=e[t];(!(Pe.call(e,t)&&I(r,n))||n===void 0&&!(t in e))&&Ne(e,t,n)}function L(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Ne(n,s,c):Fe(n,s,c)}return n}var R=Math.max;function z(e,t,n){return t=R(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=R(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),we(e,this,s)}}function Ie(e,t){return Ae(z(e,t,se),e+``)}var B=9007199254740991;function V(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=B}function H(e){return e!=null&&V(e.length)&&!j(e)}function U(e,t,n){if(!k(n))return!1;var r=typeof t;return(r==`number`?H(n)&&F(t,n.length):r==`string`&&t in n)?I(n[t],e):!1}function Le(e){return Ie(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&U(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var W=Object.prototype;function Re(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||W)}function G(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var K=`[object Arguments]`;function q(e){return D(e)&&oe(e)==K}var J=Object.prototype,ze=J.hasOwnProperty,Be=J.propertyIsEnumerable,Y=q(function(){return arguments}())?q:function(e){return D(e)&&ze.call(e,`callee`)&&!Be.call(e,`callee`)};function Ve(){return!1}var He=typeof exports==`object`&&exports&&!exports.nodeType&&exports,X=He&&typeof module==`object`&&module&&!module.nodeType&&module,Z=X&&X.exports===He?b.Buffer:void 0,Q=(Z?Z.isBuffer:void 0)||Ve,Ue=`[object Arguments]`,We=`[object Array]`,Ge=`[object Boolean]`,Ke=`[object Date]`,qe=`[object Error]`,Je=`[object Function]`,Ye=`[object Map]`,Xe=`[object Number]`,Ze=`[object Object]`,Qe=`[object RegExp]`,$e=`[object Set]`,et=`[object String]`,tt=`[object WeakMap]`,nt=`[object ArrayBuffer]`,rt=`[object DataView]`,it=`[object Float32Array]`,at=`[object Float64Array]`,ot=`[object Int8Array]`,st=`[object Int16Array]`,ct=`[object Int32Array]`,lt=`[object Uint8Array]`,ut=`[object Uint8ClampedArray]`,dt=`[object Uint16Array]`,ft=`[object Uint32Array]`,$={};$[it]=$[at]=$[ot]=$[st]=$[ct]=$[lt]=$[ut]=$[dt]=$[ft]=!0,$[Ue]=$[We]=$[nt]=$[Ge]=$[rt]=$[Ke]=$[qe]=$[Je]=$[Ye]=$[Xe]=$[Ze]=$[Qe]=$[$e]=$[et]=$[tt]=!1;function pt(e){return D(e)&&V(e.length)&&!!$[oe(e)]}function mt(e){return function(t){return e(t)}}var ht=typeof exports==`object`&&exports&&!exports.nodeType&&exports,gt=ht&&typeof module==`object`&&module&&!module.nodeType&&module,_t=gt&&gt.exports===ht&&y.process,vt=function(){try{return gt&&gt.require&&gt.require(`util`).types||_t&&_t.binding&&_t.binding(`util`)}catch{}}(),yt=vt&&vt.isTypedArray,bt=yt?mt(yt):pt,xt=Object.prototype.hasOwnProperty;function St(e,t){var n=O(e),r=!n&&Y(e),i=!n&&!r&&Q(e),a=!n&&!r&&!i&&bt(e),o=n||r||i||a,s=o?G(e.length,String):[],c=s.length;for(var l in e)(t||xt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||F(l,c)))&&s.push(l);return s}function Ct(e,t){return function(n){return e(t(n))}}var wt=Ct(Object.keys,Object),Tt=Object.prototype.hasOwnProperty;function Et(e){if(!Re(e))return wt(e);var t=[];for(var n in Object(e))Tt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){return H(e)?St(e):Et(e)}var Ot=Object.prototype.hasOwnProperty;Le(function(e,t){if(Re(t)||H(t)){L(t,Dt(t),e);return}for(var n in t)Ot.call(t,n)&&Fe(e,n,t[n])});function kt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var At=Object.prototype.hasOwnProperty;function jt(e){if(!k(e))return kt(e);var t=Re(e),n=[];for(var r in e)r==`constructor`&&(t||!At.call(e,r))||n.push(r);return n}function Mt(e){return H(e)?St(e,!0):jt(e)}var Nt=Object.prototype,Pt=Nt.hasOwnProperty;Ie(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&U(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=Mt(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||I(u,Nt[l])&&!Pt.call(e,l))&&(e[l]=a[l])}return e});var Ft=_({name:`Viewer`,props:{images:{type:Array,default:()=>[]},rebuild:{type:Boolean,default:!1},trigger:{type:Object,default:null},options:{type:Object,default:()=>null}},emits:[`inited`],setup(e,{emit:n}){let i,s=r();function c(){i=new v.default(s.value,e.options),n(`inited`,i)}function l(){i&&i.destroy()}function u(){l(),c()}function d(){i?(i.update(),n(`inited`,i)):c()}function f(){e.rebuild?u():d()}let m={deep:!0};return a(()=>e.images,()=>{t(()=>{f()})},m),a(()=>e.trigger,()=>{t(()=>{f()})},m),a(()=>e.options,()=>{t(()=>{u()})},m),o(()=>c()),p(()=>l()),{root:s,createViewer:c,rebuildViewer:u,updateViewer:d,destroyViewer:l}}}),It=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Lt={ref:`root`};function Rt(t,n,r,a,o,s){return e(),l(`div`,Lt,[i(t.$slots,`default`,{images:t.images,options:t.options})],512)}var zt=It(Ft,[[`render`,Rt]]),Bt=[`src`],Vt=m(_({__name:`ImageViewer`,props:{image:{}},setup(t){let n=t,r=u(()=>n.image?[{src:n.image,index:0}]:[]);return(t,n)=>(e(),g(c(zt),{images:r.value,style:{height:`100%`}},{default:s(()=>[(e(!0),l(d,null,f(r.value,t=>(e(),l(`img`,{alt:`图片`,src:t.src,key:t.index,class:`image`},null,8,Bt))),128))]),_:1},8,[`images`]))}}),[[`__scopeId`,`data-v-b0f61c51`]]);export{Vt as default};
1
+ import{A as e,E as t,H as n,I as r,M as i,N as a,O as o,P as s,R as c,b as l,g as u,h as d,j as f,k as p,l as m,q as h,v as g,w as _}from"./index-DP0aBxNP.js";var v=h(n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Viewer=r())})(e,(function(){function e(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function t(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,s(r.key),r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,`prototype`,{writable:!1}),e}function r(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e){var t=o(e,`string`);return typeof t==`symbol`?t:t+``}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:``,container:`body`,filter:null,fullscreen:!0,inheritedAttributes:[`crossOrigin`,`decoding`,`isMap`,`loading`,`referrerPolicy`,`sizes`,`srcset`,`useMap`],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:`src`,ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},u=`<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>`,d=typeof window<`u`&&window.document!==void 0,f=d?window:{},p=d&&f.document.documentElement?`ontouchstart`in f.document.documentElement:!1,m=d?`PointerEvent`in f:!1,h=`viewer`,g=`move`,_=`switch`,v=`zoom`,y=`${h}-active`,ee=`${h}-close`,b=`${h}-fade`,x=`${h}-fixed`,te=`${h}-fullscreen`,ne=`${h}-fullscreen-exit`,S=`${h}-hide`,C=`${h}-hide-md-down`,re=`${h}-hide-sm-down`,ie=`${h}-hide-xs-down`,w=`${h}-in`,T=`${h}-invisible`,E=`${h}-loading`,ae=`${h}-move`,oe=`${h}-open`,D=`${h}-show`,O=`${h}-transition`,k=`click`,se=`dblclick`,ce=`dragstart`,le=`focusin`,ue=`keydown`,A=`load`,j=`error`,de=p?`touchend touchcancel`:`mouseup`,fe=p?`touchmove`:`mousemove`,pe=m?`pointerdown`:p?`touchstart`:`mousedown`,me=m?`pointermove`:fe,he=m?`pointerup pointercancel`:de,ge=`resize`,M=`transitionend`,_e=`wheel`,ve=`ready`,ye=`show`,be=`shown`,xe=`hide`,Se=`hidden`,Ce=`view`,N=`viewed`,we=`move`,Te=`moved`,Ee=`rotate`,De=`rotated`,Oe=`scale`,ke=`scaled`,P=`zoom`,Ae=`zoomed`,je=`play`,Me=`stop`,F=`${h}Action`,Ne=/\s\s*/,I=[`zoom-in`,`zoom-out`,`one-to-one`,`reset`,`prev`,`play`,`next`,`rotate-left`,`rotate-right`,`flip-horizontal`,`flip-vertical`];function Pe(e){return typeof e==`string`}var Fe=Number.isNaN||f.isNaN;function L(e){return typeof e==`number`&&!Fe(e)}function R(e){return e===void 0}function z(e){return c(e)===`object`&&e!==null}var Ie=Object.prototype.hasOwnProperty;function B(e){if(!z(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&Ie.call(n,`isPrototypeOf`)}catch{return!1}}function V(e){return typeof e==`function`}function H(e,t){if(e&&V(t))if(Array.isArray(e)||L(e.length)){var n=e.length,r;for(r=0;r<n&&t.call(e,e[r],r,e)!==!1;r+=1);}else z(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)});return e}var U=Object.assign||function(e){var t=[...arguments].slice(1);return z(e)&&t.length>0&&t.forEach(function(t){z(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Le=/^(?:width|height|left|top|marginLeft|marginTop)$/;function W(e,t){var n=e.style;H(t,function(e,t){Le.test(t)&&L(e)&&(e+=`px`),n[t]=e})}function Re(e){return Pe(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`):e}function G(e,t){return!e||!t?!1:e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function K(e,t){if(!(!e||!t)){if(L(e.length)){H(e,function(e){K(e,t)});return}if(e.classList){e.classList.add(t);return}var n=e.className.trim();n?n.indexOf(t)<0&&(e.className=`${n} ${t}`):e.className=t}}function q(e,t){if(!(!e||!t)){if(L(e.length)){H(e,function(e){q(e,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,``))}}function J(e,t,n){if(t){if(L(e.length)){H(e,function(e){J(e,t,n)});return}n?K(e,t):q(e,t)}}var ze=/([a-z\d])([A-Z])/g;function Be(e){return e.replace(ze,`$1-$2`).toLowerCase()}function Y(e,t){return z(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute(`data-${Be(t)}`)}function Ve(e,t,n){z(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute(`data-${Be(t)}`,n)}var He=function(){var e=!1;if(d){var t=!1,n=function(){},r=Object.defineProperty({},`once`,{get:function(){return e=!0,t},set:function(e){t=e}});f.addEventListener(`test`,n,r),f.removeEventListener(`test`,n,r)}return e}();function X(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split(Ne).forEach(function(t){if(!He){var a=e.listeners;a&&a[t]&&a[t][n]&&(i=a[t][n],delete a[t][n],Object.keys(a[t]).length===0&&delete a[t],Object.keys(a).length===0&&delete e.listeners)}e.removeEventListener(t,i,r)})}function Z(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split(Ne).forEach(function(t){if(r.once&&!He){var a=e.listeners,o=a===void 0?{}:a;i=function(){delete o[t][n],e.removeEventListener(t,i,r);var a=[...arguments];n.apply(e,a)},o[t]||(o[t]={}),o[t][n]&&e.removeEventListener(t,o[t][n],r),o[t][n]=i,e.listeners=o}e.addEventListener(t,i,r)})}function Q(e,t,n,r){var i;return V(Event)&&V(CustomEvent)?i=new CustomEvent(t,a({bubbles:!0,cancelable:!0,detail:n},r)):(i=document.createEvent(`CustomEvent`),i.initCustomEvent(t,!0,!0,n)),e.dispatchEvent(i)}function Ue(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}function We(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,a=e.translateY,o=[];L(i)&&i!==0&&o.push(`translateX(${i}px)`),L(a)&&a!==0&&o.push(`translateY(${a}px)`),L(t)&&t!==0&&o.push(`rotate(${t}deg)`),L(n)&&n!==1&&o.push(`scaleX(${n})`),L(r)&&r!==1&&o.push(`scaleY(${r})`);var s=o.length?o.join(` `):`none`;return{WebkitTransform:s,msTransform:s,transform:s}}function Ge(e){return Pe(e)?decodeURIComponent(e.replace(/^.*\//,``).replace(/[?&#].*$/,``)):``}var Ke=f.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(f.navigator.userAgent);function qe(e,t,n){var r=document.createElement(`img`);if(e.naturalWidth&&!Ke)return n(e.naturalWidth,e.naturalHeight),r;var i=document.body||document.documentElement;return r.onload=function(){n(r.width,r.height),Ke||i.removeChild(r)},H(t.inheritedAttributes,function(t){var n=e.getAttribute(t);n!==null&&r.setAttribute(t,n)}),r.src=e.src,Ke||(r.style.cssText=`left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;`,i.appendChild(r)),r}function Je(e){switch(e){case 2:return ie;case 3:return re;case 4:return C;default:return``}}function Ye(e){var t=a({},e),n=[];return H(e,function(e,r){delete t[r],H(t,function(t){var r=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),a=Math.abs(e.endX-t.endX),o=Math.abs(e.endY-t.endY),s=Math.sqrt(r*r+i*i),c=(Math.sqrt(a*a+o*o)-s)/s;n.push(c)})}),n.sort(function(e,t){return Math.abs(e)<Math.abs(t)}),n[0]}function Xe(e,t){var n=e.pageX,r=e.pageY,i={endX:n,endY:r};return t?i:a({timeStamp:Date.now(),startX:n,startY:r},i)}function Ze(e){var t=0,n=0,r=0;return H(e,function(e){var i=e.startX,a=e.startY;t+=i,n+=a,r+=1}),t/=r,n/=r,{pageX:t,pageY:n}}var Qe={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var e=this.element.ownerDocument,t=e.body||e.documentElement;this.body=t,this.scrollbarWidth=window.innerWidth-e.documentElement.clientWidth,this.initialBodyPaddingRight=t.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(t).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var e=this.options,t=this.parent,n;e.inline&&(n={width:Math.max(t.offsetWidth,e.minWidth),height:Math.max(t.offsetHeight,e.minHeight)},this.parentData=n),(this.fulled||!n)&&(n=this.containerData),this.viewerData=U({},n)},renderViewer:function(){this.options.inline&&!this.fulled&&W(this.viewer,this.viewerData)},initList:function(){var e=this,t=this.element,n=this.options,r=this.list,i=[];r.innerHTML=``,H(this.images,function(t,a){var o=t.src,s=t.alt||Ge(o),c=e.getImageURL(t);if(o||c){var l=document.createElement(`li`),u=document.createElement(`img`);H(n.inheritedAttributes,function(e){var n=t.getAttribute(e);n!==null&&u.setAttribute(e,n)}),n.navbar&&(u.src=o||c),u.alt=s,u.setAttribute(`data-original-url`,c||o),l.setAttribute(`data-index`,a),l.setAttribute(`data-viewer-action`,`view`),l.setAttribute(`role`,`button`),n.keyboard&&l.setAttribute(`tabindex`,0),l.appendChild(u),r.appendChild(l),i.push(l)}}),this.items=i,H(i,function(t){var r=t.firstElementChild,i,a;Ve(r,`filled`,!0),n.loading&&K(t,E),Z(r,A,i=function(i){X(r,j,a),n.loading&&q(t,E),e.loadImage(i)},{once:!0}),Z(r,j,a=function(){X(r,A,i),n.loading&&q(t,E)},{once:!0})}),n.transition&&Z(t,N,function(){K(r,O)},{once:!0})},renderList:function(){var e=this.index,t=this.items[e];if(t){var n=t.nextElementSibling,r=parseInt(window.getComputedStyle(n||t).marginLeft,10),i=t.offsetWidth,a=i+r;W(this.list,U({width:a*this.length-r},We({translateX:(this.viewerData.width-i)/2-a*e})))}},resetList:function(){var e=this.list;e.innerHTML=``,q(e,O),W(e,We({translateX:0}))},initImage:function(e){var t=this,n=this.options,r=this.image,i=this.viewerData,a=this.footer.offsetHeight,o=i.width,s=Math.max(i.height-a,a),c=this.imageData||{},l;this.imageInitializing={abort:function(){l.onload=null}},l=qe(r,n,function(r,i){var a=r/i,l=Math.max(0,Math.min(1,n.initialCoverage)),u=o,d=s;t.imageInitializing=!1,s*a>o?d=o/a:u=s*a,l=L(l)?l:.9,u=Math.min(u*l,r),d=Math.min(d*l,i);var f=(o-u)/2,p=(s-d)/2,m={left:f,top:p,x:f,y:p,width:u,height:d,oldRatio:1,ratio:u/r,aspectRatio:a,naturalWidth:r,naturalHeight:i},h=U({},m);n.rotatable&&(m.rotate=c.rotate||0,h.rotate=0),n.scalable&&(m.scaleX=c.scaleX||1,m.scaleY=c.scaleY||1,h.scaleX=1,h.scaleY=1),t.imageData=m,t.initialImageData=h,e&&e()})},renderImage:function(e){var t=this,n=this.image,r=this.imageData;if(W(n,U({width:r.width,height:r.height,marginLeft:r.x,marginTop:r.y},We(r))),e)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&G(n,O)){var i=function(){t.imageRendering=!1,e()};this.imageRendering={abort:function(){X(n,M,i)}},Z(n,M,i,{once:!0})}else e()},resetImage:function(){var e=this.image;e&&(this.viewing&&this.viewing.abort(),e.parentNode.removeChild(e),this.image=null,this.title.innerHTML=``)}},$e={bind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;Z(t,k,this.onClick=this.click.bind(this)),Z(t,ce,this.onDragStart=this.dragstart.bind(this)),Z(n,pe,this.onPointerDown=this.pointerdown.bind(this)),Z(r,me,this.onPointerMove=this.pointermove.bind(this)),Z(r,he,this.onPointerUp=this.pointerup.bind(this)),Z(r,ue,this.onKeyDown=this.keydown.bind(this)),Z(window,ge,this.onResize=this.resize.bind(this)),e.zoomable&&e.zoomOnWheel&&Z(t,_e,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleOnDblclick&&Z(n,se,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var e=this.options,t=this.viewer,n=this.canvas,r=this.element.ownerDocument;X(t,k,this.onClick),X(t,ce,this.onDragStart),X(n,pe,this.onPointerDown),X(r,me,this.onPointerMove),X(r,he,this.onPointerUp),X(r,ue,this.onKeyDown),X(window,ge,this.onResize),e.zoomable&&e.zoomOnWheel&&X(t,_e,this.onWheel,{passive:!1,capture:!0}),e.toggleOnDblclick&&X(n,se,this.onDblclick)}},et={click:function(e){var t=this.options,n=this.imageData,r=e.target,i=Y(r,F);switch(!i&&r.localName===`img`&&r.parentElement.localName===`li`&&(r=r.parentElement,i=Y(r,F)),p&&e.isTrusted&&r===this.canvas&&clearTimeout(this.clickCanvasTimeout),i){case`mix`:this.played?this.stop():t.inline?this.fulled?this.exit():this.full():this.hide();break;case`hide`:this.pointerMoved||this.hide();break;case`view`:this.view(Y(r,`index`));break;case`zoom-in`:this.zoom(.1,!0);break;case`zoom-out`:this.zoom(-.1,!0);break;case`one-to-one`:this.toggle();break;case`reset`:this.reset();break;case`prev`:this.prev(t.loop);break;case`play`:this.play(t.fullscreen);break;case`next`:this.next(t.loop);break;case`rotate-left`:this.rotate(-90);break;case`rotate-right`:this.rotate(90);break;case`flip-horizontal`:this.scaleX(-n.scaleX||-1);break;case`flip-vertical`:this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(e){e.preventDefault(),this.viewed&&e.target===this.image&&(p&&e.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(e.isTrusted?e:e.detail&&e.detail.originalEvent))},load:function(){var e=this;this.timeout&&=(clearTimeout(this.timeout),!1);var t=this.element,n=this.options,r=this.image,i=this.index,a=this.viewerData;q(r,T),n.loading&&q(this.canvas,E),r.style.cssText=`height:0;margin-left:${a.width/2}px;margin-top:${a.height/2}px;max-width:none!important;position:relative;width:0;`,this.initImage(function(){J(r,ae,n.movable),J(r,O,n.transition),e.renderImage(function(){e.viewed=!0,e.viewing=!1,V(n.viewed)&&Z(t,N,n.viewed,{once:!0}),Q(t,N,{originalImage:e.images[i],index:i,image:r},{cancelable:!1})})})},loadImage:function(e){var t=e.target,n=t.parentNode,r=n.offsetWidth||30,i=n.offsetHeight||50,a=!!Y(t,`filled`);qe(t,this.options,function(e,n){var o=e/n,s=r,c=i;i*o>r?a?s=i*o:c=r/o:a?c=r/o:s=i*o,W(t,U({width:s,height:c},We({translateX:(r-s)/2,translateY:(i-c)/2})))})},keydown:function(e){var t=this.options;if(t.keyboard){var n=e.keyCode||e.which||e.charCode;switch(n){case 13:this.viewer.contains(e.target)&&this.click(e);break}if(this.fulled)switch(n){case 27:this.played?this.stop():t.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(t.loop);break;case 38:e.preventDefault(),this.zoom(t.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(t.loop);break;case 40:e.preventDefault(),this.zoom(-t.zoomRatio,!0);break;case 48:case 49:e.ctrlKey&&(e.preventDefault(),this.toggle());break}}},dragstart:function(e){e.target.localName===`img`&&e.preventDefault()},pointerdown:function(e){var t=this.options,n=this.pointers,r=e.buttons,i=e.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(e.type===`mousedown`||e.type===`pointerdown`&&e.pointerType===`mouse`)&&(L(r)&&r!==1||L(i)&&i!==0||e.ctrlKey))){e.preventDefault(),e.changedTouches?H(e.changedTouches,function(e){n[e.identifier]=Xe(e)}):n[e.pointerId||0]=Xe(e);var a=t.movable?g:!1;t.zoomOnTouch&&t.zoomable&&Object.keys(n).length>1?a=v:t.slideOnTouch&&(e.pointerType===`touch`||e.type===`touchstart`)&&this.isSwitchable()&&(a=_),t.transition&&(a===g||a===v)&&q(this.image,O),this.action=a}},pointermove:function(e){var t=this.pointers,n=this.action;!this.viewed||!n||(e.preventDefault(),e.changedTouches?H(e.changedTouches,function(e){U(t[e.identifier]||{},Xe(e,!0))}):U(t[e.pointerId||0]||{},Xe(e,!0)),this.change(e))},pointerup:function(e){var t=this,n=this.options,r=this.action,i=this.pointers,a;e.changedTouches?H(e.changedTouches,function(e){a=i[e.identifier],delete i[e.identifier]}):(a=i[e.pointerId||0],delete i[e.pointerId||0]),r&&(e.preventDefault(),n.transition&&(r===g||r===v)&&K(this.image,O),this.action=!1,p&&r!==v&&a&&Date.now()-a.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&e.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){Q(t.image,se,{originalEvent:e})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){t.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&n.backdrop!==`static`&&e.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){Q(t.canvas,k,{originalEvent:e})},50)))))},resize:function(){var e=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}H(this.player.getElementsByTagName(`img`),function(t){Z(t,A,e.loadImage.bind(e),{once:!0}),Q(t,A)})}},wheel:function(e){var t=this;if(this.viewed&&(e.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50);var n=Number(this.options.zoomRatio)||.1,r=1;e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,!0,null,e)}}},tt={show:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(e),this;if(V(n.show)&&Z(t,ye,n.show,{once:!0}),Q(t,ye)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var r=this.viewer;if(q(r,S),r.setAttribute(`role`,`dialog`),r.setAttribute(`aria-labelledby`,this.title.id),r.setAttribute(`aria-modal`,!0),r.removeAttribute(`aria-hidden`),n.transition&&!e){var i=this.shown.bind(this);this.transitioning={abort:function(){X(r,M,i),q(r,w)}},K(r,O),r.initialOffsetWidth=r.offsetWidth,Z(r,M,i,{once:!0}),K(r,w)}else K(r,w),this.shown();return this},hide:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.element,r=this.options;if(r.inline||this.hiding||!(this.isShown||this.showing)||(V(r.hide)&&Z(n,xe,r.hide,{once:!0}),Q(n,xe)===!1))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var i=this.viewer,a=this.image,o=function(){q(i,w),e.hidden()};if(r.transition&&!t){var s=function(t){t&&t.target===i&&(X(i,M,s),e.hidden())},c=function(){G(i,O)?(Z(i,M,s),q(i,w)):o()};this.transitioning={abort:function(){e.viewed&&G(a,O)?X(a,M,c):G(i,O)&&X(i,M,s)}},this.viewed&&G(a,O)?(Z(a,M,c,{once:!0}),this.zoomTo(0,!1,null,null,!0)):c()}else o();return this},view:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(t=Number(t)||0,this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var n=this.element,r=this.options,i=this.title,a=this.canvas,o=this.items[t],s=o.querySelector(`img`),c=Y(s,`originalUrl`),l=s.getAttribute(`alt`),u=document.createElement(`img`);if(H(r.inheritedAttributes,function(e){var t=s.getAttribute(e);t!==null&&u.setAttribute(e,t)}),u.src=c,u.alt=l,V(r.view)&&Z(n,Ce,r.view,{once:!0}),Q(n,Ce,{originalImage:this.images[t],index:t,image:u})===!1||!this.isShown||this.hiding||this.played)return this;var d=this.items[this.index];d&&(q(d,y),d.removeAttribute(`aria-selected`)),K(o,y),o.setAttribute(`aria-selected`,!0),r.focus&&o.focus(),this.image=u,this.viewed=!1,this.index=t,this.imageData={},K(u,T),r.loading&&K(a,E),a.innerHTML=``,a.appendChild(u),this.renderList(),i.innerHTML=``;var f=function(){var t=e.imageData,n=Array.isArray(r.title)?r.title[1]:r.title;i.innerHTML=Re(V(n)?n.call(e,u,t):`${l} (${t.naturalWidth} × ${t.naturalHeight})`)},p,m;return Z(n,N,f,{once:!0}),this.viewing={abort:function(){X(n,N,f),u.complete?e.imageRendering?e.imageRendering.abort():e.imageInitializing&&e.imageInitializing.abort():(u.src=``,X(u,A,p),e.timeout&&clearTimeout(e.timeout))}},u.complete?this.load():(Z(u,A,p=function(){X(u,j,m),e.load()},{once:!0}),Z(u,j,m=function(){X(u,A,p),e.timeout&&=(clearTimeout(e.timeout),!1),q(u,T),r.loading&&q(e.canvas,E)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){q(u,T),e.timeout=!1},1e3)),this},prev:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.index-1;return t<0&&(t=e?this.length-1:0),this.view(t),this},next:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.length-1,n=this.index+1;return n>t&&(n=e?0:t),this.view(n),this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData;return this.moveTo(R(e)?e:n.x+Number(e),R(t)?t:n.y+Number(t)),this},moveTo:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=this.element,a=this.options,o=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&a.movable){var s=o.x,c=o.y,l=!1;if(L(e)?l=!0:e=s,L(n)?l=!0:n=c,l){if(V(a.move)&&Z(i,we,a.move,{once:!0}),Q(i,we,{x:e,y:n,oldX:s,oldY:c,originalEvent:r})===!1)return this;o.x=e,o.y=n,o.left=e,o.top=n,this.moving=!0,this.renderImage(function(){t.moving=!1,V(a.moved)&&Z(i,Te,a.moved,{once:!0}),Q(i,Te,{x:e,y:n,oldX:s,oldY:c,originalEvent:r},{cancelable:!1})})}}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e)),this},rotateTo:function(e){var t=this,n=this.element,r=this.options,i=this.imageData;if(e=Number(e),L(e)&&this.viewed&&!this.played&&r.rotatable){var a=i.rotate;if(V(r.rotate)&&Z(n,Ee,r.rotate,{once:!0}),Q(n,Ee,{degree:e,oldDegree:a})===!1)return this;i.rotate=e,this.rotating=!0,this.renderImage(function(){t.rotating=!1,V(r.rotated)&&Z(n,De,r.rotated,{once:!0}),Q(n,De,{degree:e,oldDegree:a},{cancelable:!1})})}return this},scaleX:function(e){return this.scale(e,this.imageData.scaleY),this},scaleY:function(e){return this.scale(this.imageData.scaleX,e),this},scale:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.element,i=this.options,a=this.imageData;if(e=Number(e),n=Number(n),this.viewed&&!this.played&&i.scalable){var o=a.scaleX,s=a.scaleY,c=!1;if(L(e)?c=!0:e=o,L(n)?c=!0:n=s,c){if(V(i.scale)&&Z(r,Oe,i.scale,{once:!0}),Q(r,Oe,{scaleX:e,scaleY:n,oldScaleX:o,oldScaleY:s})===!1)return this;a.scaleX=e,a.scaleY=n,this.scaling=!0,this.renderImage(function(){t.scaling=!1,V(i.scaled)&&Z(r,ke,i.scaled,{once:!0}),Q(r,ke,{scaleX:e,scaleY:n,oldScaleX:o,oldScaleY:s},{cancelable:!1})})}}return this},zoom:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=this.imageData;return e=Number(e),e=e<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,t,n,r),this},zoomTo:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o=this.element,s=this.options,c=this.pointers,l=this.imageData,u=l.x,d=l.y,f=l.width,p=l.height,m=l.naturalWidth,h=l.naturalHeight;if(e=Math.max(0,e),L(e)&&this.viewed&&!this.played&&(a||s.zoomable)){if(!a){var g=Math.max(.01,s.minZoomRatio),_=Math.min(100,s.maxZoomRatio);e=Math.min(Math.max(e,g),_)}if(i)switch(i.type){case`wheel`:s.zoomRatio>=.055&&e>.95&&e<1.05&&(e=1);break;case`pointermove`:case`touchmove`:case`mousemove`:e>.99&&e<1.01&&(e=1);break}var v=m*e,y=h*e,ee=v-f,b=y-p,x=l.ratio;if(V(s.zoom)&&Z(o,P,s.zoom,{once:!0}),Q(o,P,{ratio:e,oldRatio:x,originalEvent:i})===!1)return this;if(this.zooming=!0,i){var te=Ue(this.viewer),ne=c&&Object.keys(c).length>0?Ze(c):{pageX:i.pageX,pageY:i.pageY};l.x-=ee*((ne.pageX-te.left-u)/f),l.y-=b*((ne.pageY-te.top-d)/p)}else B(r)&&L(r.x)&&L(r.y)?(l.x-=ee*((r.x-u)/f),l.y-=b*((r.y-d)/p)):(l.x-=ee/2,l.y-=b/2);l.left=l.x,l.top=l.y,l.width=v,l.height=y,l.oldRatio=x,l.ratio=e,this.renderImage(function(){t.zooming=!1,V(s.zoomed)&&Z(o,Ae,s.zoomed,{once:!0}),Q(o,Ae,{ratio:e,oldRatio:x,originalEvent:i},{cancelable:!1})}),n&&this.tooltip()}return this},play:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var n=this.element,r=this.options;if(V(r.play)&&Z(n,je,r.play,{once:!0}),Q(n,je)===!1)return this;var i=this.player,a=this.loadImage.bind(this),o=[],s=0,c=0;if(this.played=!0,this.onLoadWhenPlay=a,t&&this.requestFullscreen(t),K(i,D),H(this.items,function(e,t){var n=e.querySelector(`img`),l=document.createElement(`img`);l.src=Y(n,`originalUrl`),l.alt=n.getAttribute(`alt`),l.referrerPolicy=n.referrerPolicy,s+=1,K(l,b),J(l,O,r.transition),G(e,y)&&(K(l,w),c=t),o.push(l),Z(l,A,a,{once:!0}),i.appendChild(l)}),L(r.interval)&&r.interval>0){var l=function(){clearTimeout(e.playing.timeout),q(o[c],w),--c,c=c>=0?c:s-1,K(o[c],w),e.playing.timeout=setTimeout(l,r.interval)},u=function(){clearTimeout(e.playing.timeout),q(o[c],w),c+=1,c=c<s?c:0,K(o[c],w),e.playing.timeout=setTimeout(u,r.interval)};s>1&&(this.playing={prev:l,next:u,timeout:setTimeout(u,r.interval)})}return this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,n=this.options;if(V(n.stop)&&Z(t,Me,n.stop,{once:!0}),Q(t,Me)===!1)return this;var r=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,H(r.getElementsByTagName(`img`),function(t){X(t,A,e.onLoadWhenPlay)}),q(r,D),r.innerHTML=``,this.exitFullscreen(),this},full:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||this.fulled||!t.inline?this:(this.fulled=!0,this.open(),K(this.button,ne),t.transition&&(q(i,O),this.viewed&&q(r,O)),K(n,x),n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-labelledby`,this.title.id),n.setAttribute(`aria-modal`,!0),n.removeAttribute(`style`),W(n,{zIndex:t.zIndex}),t.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=U({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){K(r,O),K(i,O)},0)})}),this)},exit:function(){var e=this,t=this.options,n=this.viewer,r=this.image,i=this.list;return!this.isShown||this.played||!this.fulled||!t.inline?this:(this.fulled=!1,this.close(),q(this.button,ne),t.transition&&(q(i,O),this.viewed&&q(r,O)),t.focus&&this.clearEnforceFocus(),n.removeAttribute(`role`),n.removeAttribute(`aria-labelledby`),n.removeAttribute(`aria-modal`),q(n,x),W(n,{zIndex:t.zIndexInline}),this.viewerData=U({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage(function(){t.transition&&setTimeout(function(){K(r,O),K(i,O)},0)})}),this)},tooltip:function(){var e=this,t=this.options,n=this.tooltipBox,r=this.imageData;return!this.viewed||this.played||!t.tooltip?this:(n.textContent=`${Math.round(r.ratio*100)}%`,this.tooltipping?clearTimeout(this.tooltipping):t.transition?(this.fading&&Q(n,M),K(n,D),K(n,b),K(n,O),n.removeAttribute(`aria-hidden`),n.initialOffsetWidth=n.offsetWidth,K(n,w)):(K(n,D),n.removeAttribute(`aria-hidden`)),this.tooltipping=setTimeout(function(){t.transition?(Z(n,M,function(){q(n,D),q(n,b),q(n,O),n.setAttribute(`aria-hidden`,!0),e.fading=!1},{once:!0}),q(n,w),e.fading=!0):(q(n,D),n.setAttribute(`aria-hidden`,!0)),e.tooltipping=!1},1e3),this)},toggle:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,e):this.zoomTo(1,!0,null,e),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=U({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,n=this.options,r=this.isImg;if(r&&!t.parentNode)return this.destroy();var i=[];if(H(r?[t]:t.querySelectorAll(`img`),function(t){V(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),!i.length)return this;if(this.images=i,this.length=i.length,this.ready){var a=[];if(H(this.items,function(e,t){var n=e.querySelector(`img`),r=i[t];r&&n?(r.src!==n.src||r.alt!==n.alt)&&a.push(t):a.push(t)}),W(this.list,{width:`auto`}),this.initList(),this.isShown)if(this.length){if(this.viewed){var o=a.indexOf(this.index);if(o>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-o,this.length-1),0));else{var s=this.items[this.index];K(s,y),s.setAttribute(`aria-selected`,!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML=``,this.title.innerHTML=``}else this.build();return this},destroy:function(){var e=this.element,t=this.options;return e[h]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),t.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):t.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),t.inline||X(e,k,this.onStart),e[h]=void 0,this):this}},nt={getImageURL:function(e){var t=this.options.url;return t=Pe(t)?e.getAttribute(t):V(t)?t.call(this,e):``,t},enforceFocus:function(){var e=this;this.clearEnforceFocus(),Z(document,le,this.onFocusin=function(t){var n=e.viewer,r=t.target;if(!(r===document||r===n||n.contains(r))){for(;r;){if(r.getAttribute(`tabindex`)!==null||r.getAttribute(`aria-modal`)===`true`)return;r=r.parentElement}n.focus()}})},clearEnforceFocus:function(){this.onFocusin&&=(X(document,le,this.onFocusin),null)},open:function(){var e=this.body;K(e,oe),this.scrollbarWidth>0&&(e.style.paddingRight=`${this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0)}px`)},close:function(){var e=this.body;q(e,oe),this.scrollbarWidth>0&&(e.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var e=this.element,t=this.options,n=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,t.focus&&(n.focus(),this.enforceFocus()),V(t.shown)&&Z(e,be,t.shown,{once:!0}),Q(e,be)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var e=this.element,t=this.options,n=this.viewer;t.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),K(n,S),n.removeAttribute(`role`),n.removeAttribute(`aria-labelledby`),n.removeAttribute(`aria-modal`),n.setAttribute(`aria-hidden`,!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(V(t.hidden)&&Z(e,Se,t.hidden,{once:!0}),Q(e,Se,null,{cancelable:!1}))},requestFullscreen:function(e){var t=this.element.ownerDocument;if(this.fulled&&!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)){var n=t.documentElement;n.requestFullscreen?B(e)?n.requestFullscreen(e):n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen&&n.msRequestFullscreen()}},exitFullscreen:function(){var e=this.element.ownerDocument;this.fulled&&(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},change:function(e){var t=this.options,n=this.pointers,r=n[Object.keys(n)[0]];if(r){var i=r.endX-r.startX,a=r.endY-r.startY;switch(this.action){case g:(i!==0||a!==0)&&(this.pointerMoved=!0,this.move(i,a,e));break;case v:this.zoom(Ye(n),!1,null,e);break;case _:this.action=`switched`;var o=Math.abs(i);o>1&&o>Math.abs(a)&&(this.pointers={},i>1?this.prev(t.loop):i<-1&&this.next(t.loop));break}H(n,function(e){e.startX=e.endX,e.startY=e.endY})}},isSwitchable:function(){var e=this.imageData,t=this.viewerData;return this.length>1&&e.x>=0&&e.y>=0&&e.width<=t.width&&e.height<=t.height}},rt=f.Viewer,it=function(e){return function(){return e+=1,e}}(-1),at=function(){function t(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,t),!n||n.nodeType!==1)throw Error(`The first argument is required and must be an element.`);this.element=n,this.options=U({},l,B(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=it(),this.init()}return n(t,[{key:`init`,value:function(){var e=this,t=this.element,n=this.options;if(!t[h]){t[h]=this,n.focus&&!n.keyboard&&(n.focus=!1);var r=t.localName===`img`,i=[];if(H(r?[t]:t.querySelectorAll(`img`),function(t){V(n.filter)?n.filter.call(e,t)&&i.push(t):e.getImageURL(t)&&i.push(t)}),this.isImg=r,this.length=i.length,this.images=i,this.initBody(),R(document.createElement(h).style.transition)&&(n.transition=!1),n.inline){var a=0,o=function(){if(a+=1,a===e.length){var t;e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0)}};this.initializing={abort:function(){H(i,function(e){e.complete||(X(e,A,o),X(e,j,o))})}},H(i,function(e){if(e.complete)o();else{var t,n;Z(e,A,t=function(){X(e,j,n),o()},{once:!0}),Z(e,j,n=function(){X(e,A,t),o()},{once:!0})}})}else Z(t,k,this.onStart=function(t){var r=t.target;r.localName===`img`&&(!V(n.filter)||n.filter.call(e,r))&&e.view(e.images.indexOf(r))})}}},{key:`build`,value:function(){if(!this.ready){var e=this.element,t=this.options,n=e.parentNode,r=document.createElement(`div`);r.innerHTML=u;var i=r.querySelector(`.${h}-container`),a=i.querySelector(`.${h}-title`),o=i.querySelector(`.${h}-toolbar`),s=i.querySelector(`.${h}-navbar`),c=i.querySelector(`.${h}-button`),l=i.querySelector(`.${h}-canvas`);if(this.parent=n,this.viewer=i,this.title=a,this.toolbar=o,this.navbar=s,this.button=c,this.canvas=l,this.footer=i.querySelector(`.${h}-footer`),this.tooltipBox=i.querySelector(`.${h}-tooltip`),this.player=i.querySelector(`.${h}-player`),this.list=i.querySelector(`.${h}-list`),i.id=`${h}${this.id}`,a.id=`${h}Title${this.id}`,K(a,t.title?Je(Array.isArray(t.title)?t.title[0]:t.title):S),K(s,t.navbar?Je(t.navbar):S),J(c,S,!t.button),t.keyboard&&c.setAttribute(`tabindex`,0),t.backdrop&&(K(i,`${h}-backdrop`),!t.inline&&t.backdrop!==`static`&&Ve(l,F,`hide`)),Pe(t.className)&&t.className&&t.className.split(Ne).forEach(function(e){K(i,e)}),t.toolbar){var d=document.createElement(`ul`),f=B(t.toolbar),p=I.slice(0,3),m=I.slice(7,9),g=I.slice(9);f||K(o,Je(t.toolbar)),H(f?t.toolbar:I,function(e,n){var r=f&&B(e),i=f?Be(n):e,a=r&&!R(e.show)?e.show:e;if(!(!a||!t.zoomable&&p.indexOf(i)!==-1||!t.rotatable&&m.indexOf(i)!==-1||!t.scalable&&g.indexOf(i)!==-1)){var o=r&&!R(e.size)?e.size:e,s=r&&!R(e.click)?e.click:e,c=document.createElement(`li`);t.keyboard&&c.setAttribute(`tabindex`,0),c.setAttribute(`role`,`button`),K(c,`${h}-${i}`),V(s)||Ve(c,F,i),L(a)&&K(c,Je(a)),[`small`,`large`].indexOf(o)===-1?i===`play`&&K(c,`${h}-large`):K(c,`${h}-${o}`),V(s)&&Z(c,k,s),d.appendChild(c)}}),o.appendChild(d)}else K(o,S);if(!t.rotatable){var _=o.querySelectorAll(`li[class*="rotate"]`);K(_,T),H(_,function(e){o.appendChild(e)})}if(t.inline)K(c,te),W(i,{zIndex:t.zIndexInline}),window.getComputedStyle(n).position===`static`&&W(n,{position:`relative`}),n.insertBefore(i,e.nextSibling);else{K(c,ee),K(i,x),K(i,b),K(i,S),W(i,{zIndex:t.zIndex});var v=t.container;Pe(v)&&(v=e.ownerDocument.querySelector(v)),v||=this.body,v.appendChild(i)}if(t.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,V(t.ready)&&Z(e,ve,t.ready,{once:!0}),Q(e,ve)===!1){this.ready=!1;return}this.ready&&t.inline&&this.view(this.index)}}}],[{key:`noConflict`,value:function(){return window.Viewer=rt,t}},{key:`setDefaults`,value:function(e){U(l,B(e)&&e)}}])}();return U(at.prototype,Qe,$e,et,tt,nt),at}))}))(),1),y=typeof global==`object`&&global&&global.Object===Object&&global,ee=typeof self==`object`&&self&&self.Object===Object&&self,b=y||ee||Function(`return this`)(),x=b.Symbol,te=Object.prototype,ne=te.hasOwnProperty,S=te.toString,C=x?x.toStringTag:void 0;function re(e){var t=ne.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch{}var i=S.call(e);return r&&(t?e[C]=n:delete e[C]),i}var ie=Object.prototype.toString;function w(e){return ie.call(e)}var T=`[object Null]`,E=`[object Undefined]`,ae=x?x.toStringTag:void 0;function oe(e){return e==null?e===void 0?E:T:ae&&ae in Object(e)?re(e):w(e)}function D(e){return typeof e==`object`&&!!e}var O=Array.isArray;function k(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function se(e){return e}var ce=`[object AsyncFunction]`,le=`[object Function]`,ue=`[object GeneratorFunction]`,A=`[object Proxy]`;function j(e){if(!k(e))return!1;var t=oe(e);return t==le||t==ue||t==ce||t==A}var de=b[`__core-js_shared__`],fe=function(){var e=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function pe(e){return!!fe&&fe in e}var me=Function.prototype.toString;function he(e){if(e!=null){try{return me.call(e)}catch{}try{return e+``}catch{}}return``}var ge=/[\\^$.*+?()[\]{}|]/g,M=/^\[object .+?Constructor\]$/,_e=Function.prototype,ve=Object.prototype,ye=_e.toString,be=ve.hasOwnProperty,xe=RegExp(`^`+ye.call(be).replace(ge,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Se(e){return!k(e)||pe(e)?!1:(j(e)?xe:M).test(he(e))}function Ce(e,t){return e?.[t]}function N(e,t){var n=Ce(e,t);return Se(n)?n:void 0}function we(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Te=800,Ee=16,De=Date.now;function Oe(e){var t=0,n=0;return function(){var r=De(),i=Ee-(r-n);if(n=r,i>0){if(++t>=Te)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ke(e){return function(){return e}}var P=function(){try{var e=N(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Ae=Oe(P?function(e,t){return P(e,`toString`,{configurable:!0,enumerable:!1,value:ke(t),writable:!0})}:se),je=9007199254740991,Me=/^(?:0|[1-9]\d*)$/;function F(e,t){var n=typeof e;return t??=je,!!t&&(n==`number`||n!=`symbol`&&Me.test(e))&&e>-1&&e%1==0&&e<t}function Ne(e,t,n){t==`__proto__`&&P?P(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function I(e,t){return e===t||e!==e&&t!==t}var Pe=Object.prototype.hasOwnProperty;function Fe(e,t,n){var r=e[t];(!(Pe.call(e,t)&&I(r,n))||n===void 0&&!(t in e))&&Ne(e,t,n)}function L(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Ne(n,s,c):Fe(n,s,c)}return n}var R=Math.max;function z(e,t,n){return t=R(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=R(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),we(e,this,s)}}function Ie(e,t){return Ae(z(e,t,se),e+``)}var B=9007199254740991;function V(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=B}function H(e){return e!=null&&V(e.length)&&!j(e)}function U(e,t,n){if(!k(n))return!1;var r=typeof t;return(r==`number`?H(n)&&F(t,n.length):r==`string`&&t in n)?I(n[t],e):!1}function Le(e){return Ie(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&U(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var W=Object.prototype;function Re(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||W)}function G(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var K=`[object Arguments]`;function q(e){return D(e)&&oe(e)==K}var J=Object.prototype,ze=J.hasOwnProperty,Be=J.propertyIsEnumerable,Y=q(function(){return arguments}())?q:function(e){return D(e)&&ze.call(e,`callee`)&&!Be.call(e,`callee`)};function Ve(){return!1}var He=typeof exports==`object`&&exports&&!exports.nodeType&&exports,X=He&&typeof module==`object`&&module&&!module.nodeType&&module,Z=X&&X.exports===He?b.Buffer:void 0,Q=(Z?Z.isBuffer:void 0)||Ve,Ue=`[object Arguments]`,We=`[object Array]`,Ge=`[object Boolean]`,Ke=`[object Date]`,qe=`[object Error]`,Je=`[object Function]`,Ye=`[object Map]`,Xe=`[object Number]`,Ze=`[object Object]`,Qe=`[object RegExp]`,$e=`[object Set]`,et=`[object String]`,tt=`[object WeakMap]`,nt=`[object ArrayBuffer]`,rt=`[object DataView]`,it=`[object Float32Array]`,at=`[object Float64Array]`,ot=`[object Int8Array]`,st=`[object Int16Array]`,ct=`[object Int32Array]`,lt=`[object Uint8Array]`,ut=`[object Uint8ClampedArray]`,dt=`[object Uint16Array]`,ft=`[object Uint32Array]`,$={};$[it]=$[at]=$[ot]=$[st]=$[ct]=$[lt]=$[ut]=$[dt]=$[ft]=!0,$[Ue]=$[We]=$[nt]=$[Ge]=$[rt]=$[Ke]=$[qe]=$[Je]=$[Ye]=$[Xe]=$[Ze]=$[Qe]=$[$e]=$[et]=$[tt]=!1;function pt(e){return D(e)&&V(e.length)&&!!$[oe(e)]}function mt(e){return function(t){return e(t)}}var ht=typeof exports==`object`&&exports&&!exports.nodeType&&exports,gt=ht&&typeof module==`object`&&module&&!module.nodeType&&module,_t=gt&&gt.exports===ht&&y.process,vt=function(){try{return gt&&gt.require&&gt.require(`util`).types||_t&&_t.binding&&_t.binding(`util`)}catch{}}(),yt=vt&&vt.isTypedArray,bt=yt?mt(yt):pt,xt=Object.prototype.hasOwnProperty;function St(e,t){var n=O(e),r=!n&&Y(e),i=!n&&!r&&Q(e),a=!n&&!r&&!i&&bt(e),o=n||r||i||a,s=o?G(e.length,String):[],c=s.length;for(var l in e)(t||xt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||F(l,c)))&&s.push(l);return s}function Ct(e,t){return function(n){return e(t(n))}}var wt=Ct(Object.keys,Object),Tt=Object.prototype.hasOwnProperty;function Et(e){if(!Re(e))return wt(e);var t=[];for(var n in Object(e))Tt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){return H(e)?St(e):Et(e)}var Ot=Object.prototype.hasOwnProperty;Le(function(e,t){if(Re(t)||H(t)){L(t,Dt(t),e);return}for(var n in t)Ot.call(t,n)&&Fe(e,n,t[n])});function kt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var At=Object.prototype.hasOwnProperty;function jt(e){if(!k(e))return kt(e);var t=Re(e),n=[];for(var r in e)r==`constructor`&&(t||!At.call(e,r))||n.push(r);return n}function Mt(e){return H(e)?St(e,!0):jt(e)}var Nt=Object.prototype,Pt=Nt.hasOwnProperty;Ie(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&U(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=Mt(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||I(u,Nt[l])&&!Pt.call(e,l))&&(e[l]=a[l])}return e});var Ft=_({name:`Viewer`,props:{images:{type:Array,default:()=>[]},rebuild:{type:Boolean,default:!1},trigger:{type:Object,default:null},options:{type:Object,default:()=>null}},emits:[`inited`],setup(e,{emit:n}){let i,s=r();function c(){i=new v.default(s.value,e.options),n(`inited`,i)}function l(){i&&i.destroy()}function u(){l(),c()}function d(){i?(i.update(),n(`inited`,i)):c()}function f(){e.rebuild?u():d()}let m={deep:!0};return a(()=>e.images,()=>{t(()=>{f()})},m),a(()=>e.trigger,()=>{t(()=>{f()})},m),a(()=>e.options,()=>{t(()=>{u()})},m),o(()=>c()),p(()=>l()),{root:s,createViewer:c,rebuildViewer:u,updateViewer:d,destroyViewer:l}}}),It=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Lt={ref:`root`};function Rt(t,n,r,a,o,s){return e(),l(`div`,Lt,[i(t.$slots,`default`,{images:t.images,options:t.options})],512)}var zt=It(Ft,[[`render`,Rt]]),Bt=[`src`],Vt=m(_({__name:`ImageViewer`,props:{image:{}},setup(t){let n=t,r=u(()=>n.image?[{src:n.image,index:0}]:[]);return(t,n)=>(e(),g(c(zt),{images:r.value,style:{height:`100%`}},{default:s(()=>[(e(!0),l(d,null,f(r.value,t=>(e(),l(`img`,{alt:`图片`,src:t.src,key:t.index,class:`image`},null,8,Bt))),128))]),_:1},8,[`images`]))}}),[[`__scopeId`,`data-v-b0f61c51`]]);export{Vt as default};
@@ -1,4 +1,4 @@
1
- import{A as e,_ as t,b as n,g as r,l as i,w as a}from"./index-Bs0y_lo-.js";function o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var s=o();function c(e){s=e}var l={exec:()=>null};function u(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(f.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var d=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),f={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},p=/^(?:[ \t]*(?:\n|$))+/,m=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,h=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,g=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v=u(_).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ne=u(_).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,re=/^[^\n]+/,b=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ie=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,b).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,g).getRegex(),x=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,S=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oe=u(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,S).replace(`tag`,x).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se=u(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex(),C={blockquote:u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,se).getRegex(),code:m,def:ie,fences:ee,heading:te,hr:h,html:oe,lheading:v,list:ae,newline:p,paragraph:se,table:l,text:re},w=u(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex(),ce={...C,lheading:ne,table:w,paragraph:u(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,w).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex()},le={...C,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,S).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(y).replace(`hr`,h).replace(`heading`,` *#{1,6} *[^
1
+ import{A as e,_ as t,b as n,g as r,l as i,w as a}from"./index-DP0aBxNP.js";function o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var s=o();function c(e){s=e}var l={exec:()=>null};function u(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(f.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var d=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),f={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},p=/^(?:[ \t]*(?:\n|$))+/,m=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,h=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,g=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v=u(_).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ne=u(_).replace(/bull/g,g).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,re=/^[^\n]+/,b=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ie=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,b).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ae=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,g).getRegex(),x=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,S=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oe=u(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,S).replace(`tag`,x).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se=u(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex(),C={blockquote:u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,se).getRegex(),code:m,def:ie,fences:ee,heading:te,hr:h,html:oe,lheading:v,list:ae,newline:p,paragraph:se,table:l,text:re},w=u(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex(),ce={...C,lheading:ne,table:w,paragraph:u(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,w).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,x).getRegex()},le={...C,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,S).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(y).replace(`hr`,h).replace(`heading`,` *#{1,6} *[^
2
2
  ]`).replace(`lheading`,v).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ue=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,de=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,T=/^( {2,}|\\)\n(?!\s*$)/,fe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,E=/[\p{P}\p{S}]/u,D=/[\s\p{P}\p{S}]/u,O=/[^\s\p{P}\p{S}]/u,pe=u(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,D).getRegex(),k=/(?!~)[\p{P}\p{S}]/u,me=/(?!~)[\s\p{P}\p{S}]/u,he=/(?:[^\s\p{P}\p{S}]|~)/u,ge=u(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,d?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),A=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_e=u(A,`u`).replace(/punct/g,E).getRegex(),ve=u(A,`u`).replace(/punct/g,k).getRegex(),j=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ye=u(j,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),be=u(j,`gu`).replace(/notPunctSpace/g,he).replace(/punctSpace/g,me).replace(/punct/g,k).getRegex(),xe=u(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),Se=u(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,E).getRegex(),Ce=u(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),we=u(/\\(punct)/,`gu`).replace(/punct/g,E).getRegex(),Te=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ee=u(S).replace(`(?:-->|$)`,`-->`).getRegex(),De=u(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ee).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Oe=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,M).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N=u(/^!?\[(label)\]\[(ref)\]/).replace(`label`,M).replace(`ref`,b).getRegex(),P=u(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,b).getRegex(),ke=u(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,N).replace(`nolink`,P).getRegex(),F=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,I={_backpedal:l,anyPunctuation:we,autolink:Te,blockSkip:ge,br:T,code:de,del:l,delLDelim:l,delRDelim:l,emStrongLDelim:_e,emStrongRDelimAst:ye,emStrongRDelimUnd:xe,escape:ue,link:Oe,nolink:P,punctuation:pe,reflink:N,reflinkSearch:ke,tag:De,text:fe,url:l},Ae={...I,link:u(/^!?\[(label)\]\((.*?)\)/).replace(`label`,M).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,M).getRegex()},L={...I,emStrongRDelimAst:be,emStrongLDelim:ve,delLDelim:Se,delRDelim:Ce,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,F).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,F).getRegex()},je={...L,br:u(T).replace(`{2,}`,`*`).getRegex(),text:u(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:C,gfm:ce,pedantic:le},z={normal:I,gfm:L,breaks:je,pedantic:Ae},Me={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},B=e=>Me[e];function V(e,t){if(t){if(f.escapeTest.test(e))return e.replace(f.escapeReplace,B)}else if(f.escapeTestNoEncode.test(e))return e.replace(f.escapeReplaceNoEncode,B);return e}function H(e){try{e=encodeURI(e).replace(f.percentDecode,`%`)}catch{return null}return e}function U(e,t){let n=e.replace(f.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(f.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(f.slashPipe,`|`);return n}function W(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function G(e){let t=e.split(`
3
3
  `),n=t.length-1;for(;n>=0&&f.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
4
4
  `)}function Ne(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pe(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Fe(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Ie(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GLTFLoader-hUKNI0Am.js","./three.module-CZIqdNh9.js","./OBJLoader-C1dmYv7h.js","./STLLoader-CzbmjAk6.js","./PLYLoader-Dq4pQnK6.js","./FBXLoader-DlzmRpnh.js","./fflate.module-BCuI6M8v.js","./ColladaLoader-Dz956C1E.js","./TDSLoader-nrxosCSD.js","./3MFLoader-B_6HM3dj.js","./AMFLoader-BxP14esn.js","./USDLoader-BsPrvVXf.js","./KMZLoader-D8eC-S0G.js","./PCDLoader-CgQJdB5e.js","./VRMLLoader-B9TF3kFK.js","./XYZLoader-ENA3V0e-.js","./VTKLoader-C2k-pFrD.js"])))=>i.map(i=>d[i]);
2
- import{A as e,D as t,E as n,I as r,N as i,O as a,V as o,_ as s,b as c,l,t as u,w as d,y as ee,z as f}from"./index-Bs0y_lo-.js";import{Bt as p,D as te,It as m,Nt as h,T as ne,Tt as re,Y as g,Z as _,_t as ie,a as ae,at as oe,et as v,g as y,gt as se,i as ce,jt as b,mt as x,p as le,pt as ue,s as S,t as de,wt as fe,x as C,xt as w,yt as T,zt as E}from"./three.module-CZIqdNh9.js";var D={type:`change`},O={type:`start`},k={type:`end`},A=new w,j=new x,M=Math.cos(70*_.DEG2RAD),N=new p,P=2*Math.PI,F={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},I=1e-6,pe=class extends y{constructor(e,t=null){super(e,t),this.state=F.NONE,this.target=new p,this.cursor=new p,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:g.ROTATE,MIDDLE:g.DOLLY,RIGHT:g.PAN},this.touches={ONE:h.ROTATE,TWO:h.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new p,this._lastQuaternion=new T,this._lastTargetPosition=new p,this._quat=new T().setFromUnitVectors(e.up,new p(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new b,this._sphericalDelta=new b,this._scale=1,this._panOffset=new p,this._rotateStart=new E,this._rotateEnd=new E,this._rotateDelta=new E,this._panStart=new E,this._panEnd=new E,this._panDelta=new E,this._dollyStart=new E,this._dollyEnd=new E,this._dollyDelta=new E,this._dollyDirection=new p,this._mouse=new E,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=R.bind(this),this._onPointerDown=L.bind(this),this._onPointerUp=z.bind(this),this._onContextMenu=K.bind(this),this._onMouseWheel=H.bind(this),this._onKeyDown=U.bind(this),this._onTouchStart=W.bind(this),this._onTouchMove=G.bind(this),this._onMouseDown=B.bind(this),this._onMouseMove=V.bind(this),this._interceptControlDown=q.bind(this),this._interceptControlUp=J.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=``}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(D),this.update(),this.state=F.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;N.copy(t).sub(this.target),N.applyQuaternion(this._quat),this._spherical.setFromVector3(N),this.autoRotate&&this.state===F.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=P:n>Math.PI&&(n-=P),r<-Math.PI?r+=P:r>Math.PI&&(r-=P),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(N.setFromSpherical(this._spherical),N.applyQuaternion(this._quatInverse),t.copy(this.target).add(N),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=N.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new p(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new p(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=N.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(A.origin.copy(this.object.position),A.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(A.direction))<M?this.object.lookAt(this.target):(j.setFromNormalAndCoplanarPoint(this.object.up,this.target),A.intersectPlane(j,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>I||8*(1-this._lastQuaternion.dot(this.object.quaternion))>I||this._lastTargetPosition.distanceToSquared(this.target)>I?(this.dispatchEvent(D),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?P/60/60*this.autoRotateSpeed:P/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){N.setFromMatrixColumn(t,0),N.multiplyScalar(-e),this._panOffset.add(N)}_panUp(e,t){this.screenSpacePanning===!0?N.setFromMatrixColumn(t,1):(N.setFromMatrixColumn(t,0),N.crossVectors(this.object.up,N)),N.multiplyScalar(e),this._panOffset.add(N)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;N.copy(r).sub(this.target);let i=N.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(P*this._rotateDelta.x/t.clientHeight),this._rotateUp(P*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(P*this._rotateDelta.x/t.clientHeight),this._rotateUp(P*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new E,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function L(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function R(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function z(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(k),this.state=F.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function B(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case g.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=F.DOLLY;break;case g.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=F.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=F.ROTATE}break;case g.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=F.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=F.PAN}break;default:this.state=F.NONE}this.state!==F.NONE&&this.dispatchEvent(O)}function V(e){switch(this.state){case F.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case F.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case F.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e);break}}function H(e){this.enabled===!1||this.enableZoom===!1||this.state!==F.NONE||(e.preventDefault(),this.dispatchEvent(O),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(k))}function U(e){this.enabled!==!1&&this._handleKeyDown(e)}function W(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case h.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=F.TOUCH_ROTATE;break;case h.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=F.TOUCH_PAN;break;default:this.state=F.NONE}break;case 2:switch(this.touches.TWO){case h.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=F.TOUCH_DOLLY_PAN;break;case h.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=F.TOUCH_DOLLY_ROTATE;break;default:this.state=F.NONE}break;default:this.state=F.NONE}this.state!==F.NONE&&this.dispatchEvent(O)}function G(e){switch(this._trackPointer(e),this.state){case F.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case F.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case F.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case F.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=F.NONE}}function K(e){this.enabled!==!1&&e.preventDefault()}function q(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function J(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var me={class:`model-viewer`},he={class:`model-toolbar`},ge={class:`model-actions`},_e={class:`model-meta`},ve={class:`model-stage`},ye={key:0,class:`model-state`},be={key:1,class:`model-state error`},Y=l(d({__name:`ModelViewer`,props:{data:{},type:{},sourceUrl:{}},setup(l){let d=l,h=r(null),g=r(`loading`),y=r(``),b=r(`正在加载模型`),x=r(!1),w=r(!1),T=r(!0),E=r(!0),D=null,O=null,k=null,A=null,j=null,M=null,N=null,P=null,F=0,I=0,L=null,R=new m,z=new TextDecoder(`utf-8`);class B extends Error{}let V=()=>d.type.toLowerCase(),H=()=>{if(!d.sourceUrl)return``;try{return new URL(`.`,d.sourceUrl).href}catch{let e=d.sourceUrl.split(/[?#]/)[0]||d.sourceUrl,t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t+1):``}},U=e=>e instanceof Error?e.message:typeof e==`string`?e:JSON.stringify(e),W=()=>{let e=h.value;if(!e)return!1;if(D||(D=new de({antialias:!0,alpha:!1,canvas:e,powerPreference:`high-performance`}),D.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),D.outputColorSpace=fe,D.setClearColor(16317180,1)),!O){O=new re,O.background=new le(16317180);let e=new te(16777215,14147304,2.4);O.add(e);let t=new C(16777215,2.2);t.position.set(8,10,8),O.add(t);let n=new C(16777215,.9);n.position.set(-7,5,-4),O.add(n),M=new ne(10,10,13358561,14870768),O.add(M),N=new ae(3),O.add(N)}return k||(k=new ue(45,1,.01,1e5),k.position.set(5,4,6)),!A&&k&&D&&(A=new pe(k,D.domElement),A.enableDamping=!0,A.dampingFactor=.08,A.screenSpacePanning=!0,A.autoRotateSpeed=1.2),$(),Ue(),!0},G=e=>{(Array.isArray(e)?e:[e]).forEach(e=>e.dispose())},K=e=>{e.traverse(e=>{let t=e,n=e;t.geometry&&t.geometry.dispose(),t.material&&G(t.material),n.material&&G(n.material)})},q=()=>{j&&O&&(O.remove(j),K(j)),j=null,L=null},J=()=>z.decode(d.data),Y=async()=>{let{GLTFLoader:e}=await u(async()=>{let{GLTFLoader:e}=await import(`./GLTFLoader-hUKNI0Am.js`);return{GLTFLoader:e}},__vite__mapDeps([0,1]),import.meta.url),t=new e,n=H(),r=V()===`gltf`?J():d.data;return new Promise((e,i)=>{t.parse(r,n,t=>{t.animations?.length&&(L=new ce(t.scene),t.animations.forEach(e=>L?.clipAction(e).play())),e(t.scene)},i)})},xe=async()=>{let{OBJLoader:e}=await u(async()=>{let{OBJLoader:e}=await import(`./OBJLoader-C1dmYv7h.js`);return{OBJLoader:e}},__vite__mapDeps([2,1]),import.meta.url);return new e().parse(J())},Se=async()=>{let{STLLoader:e}=await u(async()=>{let{STLLoader:e}=await import(`./STLLoader-CzbmjAk6.js`);return{STLLoader:e}},__vite__mapDeps([3,1]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},Ce=async()=>{let{PLYLoader:e}=await u(async()=>{let{PLYLoader:e}=await import(`./PLYLoader-Dq4pQnK6.js`);return{PLYLoader:e}},__vite__mapDeps([4,1]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},we=async()=>{let{FBXLoader:e}=await u(async()=>{let{FBXLoader:e}=await import(`./FBXLoader-DlzmRpnh.js`);return{FBXLoader:e}},__vite__mapDeps([5,1,6]),import.meta.url),t=new e().parse(d.data,H());return t.animations?.length&&(L=new ce(t),t.animations.forEach(e=>L?.clipAction(e).play())),t},Te=async()=>{let{ColladaLoader:e}=await u(async()=>{let{ColladaLoader:e}=await import(`./ColladaLoader-Dz956C1E.js`);return{ColladaLoader:e}},__vite__mapDeps([7,1]),import.meta.url);return new e().parse(J(),H()).scene},Ee=async()=>{let{TDSLoader:e}=await u(async()=>{let{TDSLoader:e}=await import(`./TDSLoader-nrxosCSD.js`);return{TDSLoader:e}},__vite__mapDeps([8,1]),import.meta.url);return new e().parse(d.data,H())},De=async()=>{let{ThreeMFLoader:e}=await u(async()=>{let{ThreeMFLoader:e}=await import(`./3MFLoader-B_6HM3dj.js`);return{ThreeMFLoader:e}},__vite__mapDeps([9,1,6]),import.meta.url);return new e().parse(d.data)},Oe=async()=>{let{AMFLoader:e}=await u(async()=>{let{AMFLoader:e}=await import(`./AMFLoader-BxP14esn.js`);return{AMFLoader:e}},__vite__mapDeps([10,1,6]),import.meta.url);return new e().parse(d.data)},ke=async()=>{let{USDLoader:e}=await u(async()=>{let{USDLoader:e}=await import(`./USDLoader-BsPrvVXf.js`);return{USDLoader:e}},__vite__mapDeps([11,1,6]),import.meta.url);return new e().parse(d.data)},Ae=async()=>{let{KMZLoader:e}=await u(async()=>{let{KMZLoader:e}=await import(`./KMZLoader-D8eC-S0G.js`);return{KMZLoader:e}},__vite__mapDeps([12,1,6,7]),import.meta.url);return new e().parse(d.data).scene},je=e=>{let t=e.toUpperCase();throw e===`ifc`?new B(`IFC 是 BIM 模型格式,浏览器端完整解析通常依赖 web-ifc 这类 WebAssembly BIM 内核。当前 Apache-2.0 前端包不默认打入这类重型运行时,建议在私有服务端转换为 GLB/GLTF 后预览。`):e===`3dm`?new B(`3DM 是 Rhino/OpenNURBS 模型格式,浏览器端解析需要 rhino3dm WebAssembly 运行时。当前前端包未内置该运行时,建议在私有转换链路输出 GLB/GLTF 后预览。`):new B(`${t} 属于 CAD B-Rep / 工程交换格式,浏览器端完整解析通常需要 OpenCascade 等 WebAssembly 几何内核。当前前端包不默认打入这类重型运行时,建议在私有服务端转换为 GLB/GLTF 或轻量网格格式后预览。`)},Me=async()=>{let{PCDLoader:e}=await u(async()=>{let{PCDLoader:e}=await import(`./PCDLoader-CgQJdB5e.js`);return{PCDLoader:e}},__vite__mapDeps([13,1]),import.meta.url);return new e().parse(d.data,d.sourceUrl||`model.pcd`)},Ne=async()=>{let{VRMLLoader:e}=await u(async()=>{let{VRMLLoader:e}=await import(`./VRMLLoader-B9TF3kFK.js`);return{VRMLLoader:e}},__vite__mapDeps([14,1]),import.meta.url);return new e().parse(J(),H())},Pe=async()=>{let{XYZLoader:e}=await u(async()=>{let{XYZLoader:e}=await import(`./XYZLoader-ENA3V0e-.js`);return{XYZLoader:e}},__vite__mapDeps([15,1]),import.meta.url),t=new e().parse(J());return t.computeBoundingSphere(),new se(t,Ie())},Fe=async()=>{let{VTKLoader:e}=await u(async()=>{let{VTKLoader:e}=await import(`./VTKLoader-C2k-pFrD.js`);return{VTKLoader:e}},__vite__mapDeps([16,1,6]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},X=()=>new oe({color:5214138,metalness:.08,roughness:.78,side:2,wireframe:w.value}),Ie=()=>new ie({color:2062988,size:.035,sizeAttenuation:!0}),Z=e=>{e.traverse(e=>{let t=e;t.isMesh&&!t.material&&(t.material=X()),t.isMesh&&t.material&&(Array.isArray(t.material)?t.material:[t.material]).forEach(e=>{`wireframe`in e&&(e.wireframe=w.value),e.needsUpdate=!0})})},Le=e=>{let t=0,n=0;return e.traverse(e=>{e.isMesh&&(t+=1),e.isPoints&&(n+=1)}),{meshes:t,points:n}},Re=e=>{let{meshes:t,points:n}=Le(e),r=[];t&&r.push(`${t} 个网格`),n&&r.push(`${n} 个点云`),b.value=r.length?r.join(`,`):`模型已加载`},ze=e=>{let t=new S().setFromObject(e);if(t.isEmpty())return{center:new p,size:new p(4,4,4)};let n=t.getCenter(new p),r=t.getSize(new p);return e.position.sub(n),{center:new p,size:r}},Q=()=>{if(!j||!k||!A)return;let e=new S().setFromObject(j),t=e.getSize(new p),n=e.getCenter(new p),r=Math.max(t.x,t.y,t.z,1)/(2*Math.tan(_.degToRad(k.fov/2)))*1.65;k.near=Math.max(r/1e3,.01),k.far=Math.max(r*1e3,1e3),k.position.copy(n).add(new p(r,r*.62,r)),k.updateProjectionMatrix(),A.target.copy(n),A.update()},Be=async e=>{if(!O)return;q(),Z(e);let{size:t}=ze(e);j=e,O.add(e),Q(),Re(e);let n=Math.max(t.x,t.y,t.z,1);M&&M.scale.setScalar(Math.max(n/10,1))},Ve=async()=>{let e=++I;if(g.value=`loading`,y.value=``,b.value=`正在加载模型`,W())try{let t=await He(V());if(e!==I){K(t);return}await n(),await Be(t),g.value=`ready`}catch(t){if(e!==I)return;t instanceof B||console.error(t),g.value=`error`,y.value=U(t)||`${d.type.toUpperCase()} 模型解析失败`}},He=e=>{switch(e){case`glb`:case`gltf`:return Y();case`obj`:return xe();case`stl`:return Se();case`ply`:return Ce();case`fbx`:return we();case`dae`:return Te();case`3ds`:return Ee();case`3mf`:return De();case`amf`:return Oe();case`usd`:case`usda`:case`usdc`:case`usdz`:return ke();case`kmz`:return Ae();case`step`:case`stp`:case`iges`:case`igs`:case`ifc`:case`3dm`:return je(e);case`pcd`:return Me();case`wrl`:case`vrml`:return Ne();case`xyz`:return Pe();case`vtk`:case`vtp`:return Fe();default:throw Error(`暂不支持 .${e} 模型格式`)}},Ue=()=>{let e=h.value;if(!e||!D||!k)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.floor(t.width)),r=Math.max(1,Math.floor(t.height));D.setSize(n,r,!1),k.aspect=n/r,k.updateProjectionMatrix()},We=e=>{if(!D||!O||!k||!A)return;A.autoRotate=x.value,A.update(),R.update(e);let t=R.getDelta();L?.update(t),D.render(O,k),F=requestAnimationFrame(We)},Ge=()=>{j&&Z(j)},$=()=>{M&&(M.visible=T.value),N&&(N.visible=E.value)},Ke=()=>{w.value=!w.value,Ge()},qe=()=>{T.value=!T.value,$()},Je=()=>{E.value=!E.value,$()};return a(()=>{W()&&(R.connect(document),P=new ResizeObserver(Ue),h.value&&P.observe(h.value),We(),Ve())}),t(()=>{I+=1,cancelAnimationFrame(F),P?.disconnect(),P=null,q(),A?.dispose(),A=null,D?.dispose(),D=null,R.dispose(),R=new m,O=null,k=null,M=null,N=null}),i(()=>[d.data,d.type,d.sourceUrl],()=>{Ve()}),(t,n)=>(e(),c(`div`,me,[s(`div`,he,[s(`div`,ge,[s(`button`,{type:`button`,onClick:Q},`适配`),s(`button`,{type:`button`,class:f({active:x.value}),onClick:n[0]||=e=>x.value=!x.value},`旋转`,2),s(`button`,{type:`button`,class:f({active:w.value}),onClick:Ke},`线框`,2),s(`button`,{type:`button`,class:f({active:T.value}),onClick:qe},`网格`,2),s(`button`,{type:`button`,class:f({active:E.value}),onClick:Je},`坐标`,2)]),s(`div`,_e,[s(`strong`,null,o(l.type.toUpperCase()),1),s(`span`,null,o(b.value),1)])]),s(`div`,ve,[s(`canvas`,{ref_key:`canvas`,ref:h},null,512),g.value===`loading`?(e(),c(`div`,ye,`正在解析 3D 模型...`)):g.value===`error`?(e(),c(`div`,be,[n[1]||=s(`strong`,null,`模型解析失败`,-1),s(`span`,null,o(y.value),1)])):ee(``,!0)])]))}}),[[`__scopeId`,`data-v-9d2e23df`]]);export{Y as default};
2
+ import{A as e,D as t,E as n,I as r,N as i,O as a,V as o,_ as s,b as c,l,t as u,w as d,y as ee,z as f}from"./index-DP0aBxNP.js";import{Bt as p,D as te,It as m,Nt as h,T as ne,Tt as re,Y as g,Z as _,_t as ie,a as ae,at as oe,et as v,g as y,gt as se,i as ce,jt as b,mt as x,p as le,pt as ue,s as S,t as de,wt as fe,x as C,xt as w,yt as T,zt as E}from"./three.module-CZIqdNh9.js";var D={type:`change`},O={type:`start`},k={type:`end`},A=new w,j=new x,M=Math.cos(70*_.DEG2RAD),N=new p,P=2*Math.PI,F={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},I=1e-6,pe=class extends y{constructor(e,t=null){super(e,t),this.state=F.NONE,this.target=new p,this.cursor=new p,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:g.ROTATE,MIDDLE:g.DOLLY,RIGHT:g.PAN},this.touches={ONE:h.ROTATE,TWO:h.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new p,this._lastQuaternion=new T,this._lastTargetPosition=new p,this._quat=new T().setFromUnitVectors(e.up,new p(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new b,this._sphericalDelta=new b,this._scale=1,this._panOffset=new p,this._rotateStart=new E,this._rotateEnd=new E,this._rotateDelta=new E,this._panStart=new E,this._panEnd=new E,this._panDelta=new E,this._dollyStart=new E,this._dollyEnd=new E,this._dollyDelta=new E,this._dollyDirection=new p,this._mouse=new E,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=R.bind(this),this._onPointerDown=L.bind(this),this._onPointerUp=z.bind(this),this._onContextMenu=K.bind(this),this._onMouseWheel=H.bind(this),this._onKeyDown=U.bind(this),this._onTouchStart=W.bind(this),this._onTouchMove=G.bind(this),this._onMouseDown=B.bind(this),this._onMouseMove=V.bind(this),this._interceptControlDown=q.bind(this),this._interceptControlUp=J.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=``}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(D),this.update(),this.state=F.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;N.copy(t).sub(this.target),N.applyQuaternion(this._quat),this._spherical.setFromVector3(N),this.autoRotate&&this.state===F.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=P:n>Math.PI&&(n-=P),r<-Math.PI?r+=P:r>Math.PI&&(r-=P),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(N.setFromSpherical(this._spherical),N.applyQuaternion(this._quatInverse),t.copy(this.target).add(N),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=N.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new p(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new p(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=N.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(A.origin.copy(this.object.position),A.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(A.direction))<M?this.object.lookAt(this.target):(j.setFromNormalAndCoplanarPoint(this.object.up,this.target),A.intersectPlane(j,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>I||8*(1-this._lastQuaternion.dot(this.object.quaternion))>I||this._lastTargetPosition.distanceToSquared(this.target)>I?(this.dispatchEvent(D),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?P/60/60*this.autoRotateSpeed:P/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){N.setFromMatrixColumn(t,0),N.multiplyScalar(-e),this._panOffset.add(N)}_panUp(e,t){this.screenSpacePanning===!0?N.setFromMatrixColumn(t,1):(N.setFromMatrixColumn(t,0),N.crossVectors(this.object.up,N)),N.multiplyScalar(e),this._panOffset.add(N)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;N.copy(r).sub(this.target);let i=N.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(P*this._rotateDelta.x/t.clientHeight),this._rotateUp(P*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-P*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(P*this._rotateDelta.x/t.clientHeight),this._rotateUp(P*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new E,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function L(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function R(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function z(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(k),this.state=F.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function B(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case g.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=F.DOLLY;break;case g.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=F.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=F.ROTATE}break;case g.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=F.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=F.PAN}break;default:this.state=F.NONE}this.state!==F.NONE&&this.dispatchEvent(O)}function V(e){switch(this.state){case F.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case F.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case F.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e);break}}function H(e){this.enabled===!1||this.enableZoom===!1||this.state!==F.NONE||(e.preventDefault(),this.dispatchEvent(O),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(k))}function U(e){this.enabled!==!1&&this._handleKeyDown(e)}function W(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case h.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=F.TOUCH_ROTATE;break;case h.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=F.TOUCH_PAN;break;default:this.state=F.NONE}break;case 2:switch(this.touches.TWO){case h.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=F.TOUCH_DOLLY_PAN;break;case h.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=F.TOUCH_DOLLY_ROTATE;break;default:this.state=F.NONE}break;default:this.state=F.NONE}this.state!==F.NONE&&this.dispatchEvent(O)}function G(e){switch(this._trackPointer(e),this.state){case F.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case F.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case F.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case F.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=F.NONE}}function K(e){this.enabled!==!1&&e.preventDefault()}function q(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function J(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var me={class:`model-viewer`},he={class:`model-toolbar`},ge={class:`model-actions`},_e={class:`model-meta`},ve={class:`model-stage`},ye={key:0,class:`model-state`},be={key:1,class:`model-state error`},Y=l(d({__name:`ModelViewer`,props:{data:{},type:{},sourceUrl:{}},setup(l){let d=l,h=r(null),g=r(`loading`),y=r(``),b=r(`正在加载模型`),x=r(!1),w=r(!1),T=r(!0),E=r(!0),D=null,O=null,k=null,A=null,j=null,M=null,N=null,P=null,F=0,I=0,L=null,R=new m,z=new TextDecoder(`utf-8`);class B extends Error{}let V=()=>d.type.toLowerCase(),H=()=>{if(!d.sourceUrl)return``;try{return new URL(`.`,d.sourceUrl).href}catch{let e=d.sourceUrl.split(/[?#]/)[0]||d.sourceUrl,t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t+1):``}},U=e=>e instanceof Error?e.message:typeof e==`string`?e:JSON.stringify(e),W=()=>{let e=h.value;if(!e)return!1;if(D||(D=new de({antialias:!0,alpha:!1,canvas:e,powerPreference:`high-performance`}),D.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),D.outputColorSpace=fe,D.setClearColor(16317180,1)),!O){O=new re,O.background=new le(16317180);let e=new te(16777215,14147304,2.4);O.add(e);let t=new C(16777215,2.2);t.position.set(8,10,8),O.add(t);let n=new C(16777215,.9);n.position.set(-7,5,-4),O.add(n),M=new ne(10,10,13358561,14870768),O.add(M),N=new ae(3),O.add(N)}return k||(k=new ue(45,1,.01,1e5),k.position.set(5,4,6)),!A&&k&&D&&(A=new pe(k,D.domElement),A.enableDamping=!0,A.dampingFactor=.08,A.screenSpacePanning=!0,A.autoRotateSpeed=1.2),$(),Ue(),!0},G=e=>{(Array.isArray(e)?e:[e]).forEach(e=>e.dispose())},K=e=>{e.traverse(e=>{let t=e,n=e;t.geometry&&t.geometry.dispose(),t.material&&G(t.material),n.material&&G(n.material)})},q=()=>{j&&O&&(O.remove(j),K(j)),j=null,L=null},J=()=>z.decode(d.data),Y=async()=>{let{GLTFLoader:e}=await u(async()=>{let{GLTFLoader:e}=await import(`./GLTFLoader-hUKNI0Am.js`);return{GLTFLoader:e}},__vite__mapDeps([0,1]),import.meta.url),t=new e,n=H(),r=V()===`gltf`?J():d.data;return new Promise((e,i)=>{t.parse(r,n,t=>{t.animations?.length&&(L=new ce(t.scene),t.animations.forEach(e=>L?.clipAction(e).play())),e(t.scene)},i)})},xe=async()=>{let{OBJLoader:e}=await u(async()=>{let{OBJLoader:e}=await import(`./OBJLoader-C1dmYv7h.js`);return{OBJLoader:e}},__vite__mapDeps([2,1]),import.meta.url);return new e().parse(J())},Se=async()=>{let{STLLoader:e}=await u(async()=>{let{STLLoader:e}=await import(`./STLLoader-CzbmjAk6.js`);return{STLLoader:e}},__vite__mapDeps([3,1]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},Ce=async()=>{let{PLYLoader:e}=await u(async()=>{let{PLYLoader:e}=await import(`./PLYLoader-Dq4pQnK6.js`);return{PLYLoader:e}},__vite__mapDeps([4,1]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},we=async()=>{let{FBXLoader:e}=await u(async()=>{let{FBXLoader:e}=await import(`./FBXLoader-DlzmRpnh.js`);return{FBXLoader:e}},__vite__mapDeps([5,1,6]),import.meta.url),t=new e().parse(d.data,H());return t.animations?.length&&(L=new ce(t),t.animations.forEach(e=>L?.clipAction(e).play())),t},Te=async()=>{let{ColladaLoader:e}=await u(async()=>{let{ColladaLoader:e}=await import(`./ColladaLoader-Dz956C1E.js`);return{ColladaLoader:e}},__vite__mapDeps([7,1]),import.meta.url);return new e().parse(J(),H()).scene},Ee=async()=>{let{TDSLoader:e}=await u(async()=>{let{TDSLoader:e}=await import(`./TDSLoader-nrxosCSD.js`);return{TDSLoader:e}},__vite__mapDeps([8,1]),import.meta.url);return new e().parse(d.data,H())},De=async()=>{let{ThreeMFLoader:e}=await u(async()=>{let{ThreeMFLoader:e}=await import(`./3MFLoader-B_6HM3dj.js`);return{ThreeMFLoader:e}},__vite__mapDeps([9,1,6]),import.meta.url);return new e().parse(d.data)},Oe=async()=>{let{AMFLoader:e}=await u(async()=>{let{AMFLoader:e}=await import(`./AMFLoader-BxP14esn.js`);return{AMFLoader:e}},__vite__mapDeps([10,1,6]),import.meta.url);return new e().parse(d.data)},ke=async()=>{let{USDLoader:e}=await u(async()=>{let{USDLoader:e}=await import(`./USDLoader-BsPrvVXf.js`);return{USDLoader:e}},__vite__mapDeps([11,1,6]),import.meta.url);return new e().parse(d.data)},Ae=async()=>{let{KMZLoader:e}=await u(async()=>{let{KMZLoader:e}=await import(`./KMZLoader-D8eC-S0G.js`);return{KMZLoader:e}},__vite__mapDeps([12,1,6,7]),import.meta.url);return new e().parse(d.data).scene},je=e=>{let t=e.toUpperCase();throw e===`ifc`?new B(`IFC 是 BIM 模型格式,浏览器端完整解析通常依赖 web-ifc 这类 WebAssembly BIM 内核。当前 Apache-2.0 前端包不默认打入这类重型运行时,建议在私有服务端转换为 GLB/GLTF 后预览。`):e===`3dm`?new B(`3DM 是 Rhino/OpenNURBS 模型格式,浏览器端解析需要 rhino3dm WebAssembly 运行时。当前前端包未内置该运行时,建议在私有转换链路输出 GLB/GLTF 后预览。`):new B(`${t} 属于 CAD B-Rep / 工程交换格式,浏览器端完整解析通常需要 OpenCascade 等 WebAssembly 几何内核。当前前端包不默认打入这类重型运行时,建议在私有服务端转换为 GLB/GLTF 或轻量网格格式后预览。`)},Me=async()=>{let{PCDLoader:e}=await u(async()=>{let{PCDLoader:e}=await import(`./PCDLoader-CgQJdB5e.js`);return{PCDLoader:e}},__vite__mapDeps([13,1]),import.meta.url);return new e().parse(d.data,d.sourceUrl||`model.pcd`)},Ne=async()=>{let{VRMLLoader:e}=await u(async()=>{let{VRMLLoader:e}=await import(`./VRMLLoader-B9TF3kFK.js`);return{VRMLLoader:e}},__vite__mapDeps([14,1]),import.meta.url);return new e().parse(J(),H())},Pe=async()=>{let{XYZLoader:e}=await u(async()=>{let{XYZLoader:e}=await import(`./XYZLoader-ENA3V0e-.js`);return{XYZLoader:e}},__vite__mapDeps([15,1]),import.meta.url),t=new e().parse(J());return t.computeBoundingSphere(),new se(t,Ie())},Fe=async()=>{let{VTKLoader:e}=await u(async()=>{let{VTKLoader:e}=await import(`./VTKLoader-C2k-pFrD.js`);return{VTKLoader:e}},__vite__mapDeps([16,1,6]),import.meta.url),t=new e().parse(d.data);return t.computeVertexNormals(),new v(t,X())},X=()=>new oe({color:5214138,metalness:.08,roughness:.78,side:2,wireframe:w.value}),Ie=()=>new ie({color:2062988,size:.035,sizeAttenuation:!0}),Z=e=>{e.traverse(e=>{let t=e;t.isMesh&&!t.material&&(t.material=X()),t.isMesh&&t.material&&(Array.isArray(t.material)?t.material:[t.material]).forEach(e=>{`wireframe`in e&&(e.wireframe=w.value),e.needsUpdate=!0})})},Le=e=>{let t=0,n=0;return e.traverse(e=>{e.isMesh&&(t+=1),e.isPoints&&(n+=1)}),{meshes:t,points:n}},Re=e=>{let{meshes:t,points:n}=Le(e),r=[];t&&r.push(`${t} 个网格`),n&&r.push(`${n} 个点云`),b.value=r.length?r.join(`,`):`模型已加载`},ze=e=>{let t=new S().setFromObject(e);if(t.isEmpty())return{center:new p,size:new p(4,4,4)};let n=t.getCenter(new p),r=t.getSize(new p);return e.position.sub(n),{center:new p,size:r}},Q=()=>{if(!j||!k||!A)return;let e=new S().setFromObject(j),t=e.getSize(new p),n=e.getCenter(new p),r=Math.max(t.x,t.y,t.z,1)/(2*Math.tan(_.degToRad(k.fov/2)))*1.65;k.near=Math.max(r/1e3,.01),k.far=Math.max(r*1e3,1e3),k.position.copy(n).add(new p(r,r*.62,r)),k.updateProjectionMatrix(),A.target.copy(n),A.update()},Be=async e=>{if(!O)return;q(),Z(e);let{size:t}=ze(e);j=e,O.add(e),Q(),Re(e);let n=Math.max(t.x,t.y,t.z,1);M&&M.scale.setScalar(Math.max(n/10,1))},Ve=async()=>{let e=++I;if(g.value=`loading`,y.value=``,b.value=`正在加载模型`,W())try{let t=await He(V());if(e!==I){K(t);return}await n(),await Be(t),g.value=`ready`}catch(t){if(e!==I)return;t instanceof B||console.error(t),g.value=`error`,y.value=U(t)||`${d.type.toUpperCase()} 模型解析失败`}},He=e=>{switch(e){case`glb`:case`gltf`:return Y();case`obj`:return xe();case`stl`:return Se();case`ply`:return Ce();case`fbx`:return we();case`dae`:return Te();case`3ds`:return Ee();case`3mf`:return De();case`amf`:return Oe();case`usd`:case`usda`:case`usdc`:case`usdz`:return ke();case`kmz`:return Ae();case`step`:case`stp`:case`iges`:case`igs`:case`ifc`:case`3dm`:return je(e);case`pcd`:return Me();case`wrl`:case`vrml`:return Ne();case`xyz`:return Pe();case`vtk`:case`vtp`:return Fe();default:throw Error(`暂不支持 .${e} 模型格式`)}},Ue=()=>{let e=h.value;if(!e||!D||!k)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.floor(t.width)),r=Math.max(1,Math.floor(t.height));D.setSize(n,r,!1),k.aspect=n/r,k.updateProjectionMatrix()},We=e=>{if(!D||!O||!k||!A)return;A.autoRotate=x.value,A.update(),R.update(e);let t=R.getDelta();L?.update(t),D.render(O,k),F=requestAnimationFrame(We)},Ge=()=>{j&&Z(j)},$=()=>{M&&(M.visible=T.value),N&&(N.visible=E.value)},Ke=()=>{w.value=!w.value,Ge()},qe=()=>{T.value=!T.value,$()},Je=()=>{E.value=!E.value,$()};return a(()=>{W()&&(R.connect(document),P=new ResizeObserver(Ue),h.value&&P.observe(h.value),We(),Ve())}),t(()=>{I+=1,cancelAnimationFrame(F),P?.disconnect(),P=null,q(),A?.dispose(),A=null,D?.dispose(),D=null,R.dispose(),R=new m,O=null,k=null,M=null,N=null}),i(()=>[d.data,d.type,d.sourceUrl],()=>{Ve()}),(t,n)=>(e(),c(`div`,me,[s(`div`,he,[s(`div`,ge,[s(`button`,{type:`button`,onClick:Q},`适配`),s(`button`,{type:`button`,class:f({active:x.value}),onClick:n[0]||=e=>x.value=!x.value},`旋转`,2),s(`button`,{type:`button`,class:f({active:w.value}),onClick:Ke},`线框`,2),s(`button`,{type:`button`,class:f({active:T.value}),onClick:qe},`网格`,2),s(`button`,{type:`button`,class:f({active:E.value}),onClick:Je},`坐标`,2)]),s(`div`,_e,[s(`strong`,null,o(l.type.toUpperCase()),1),s(`span`,null,o(b.value),1)])]),s(`div`,ve,[s(`canvas`,{ref_key:`canvas`,ref:h},null,512),g.value===`loading`?(e(),c(`div`,ye,`正在解析 3D 模型...`)):g.value===`error`?(e(),c(`div`,be,[n[1]||=s(`strong`,null,`模型解析失败`,-1),s(`span`,null,o(y.value),1)])):ee(``,!0)])]))}}),[[`__scopeId`,`data-v-9d2e23df`]]);export{Y as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ofd-DHwwXPSE.js","./index-Bs0y_lo-.js","./index-BlC70W4a.css","./jszip.min-DntPNpWy.js"])))=>i.map(i=>d[i]);
2
- import{A as e,D as t,E as n,I as r,O as i,V as a,_ as o,b as s,l as c,t as l,w as u,y as d}from"./index-Bs0y_lo-.js";var f={key:0,class:`ofd-state`},p={key:1,class:`ofd-state error`},m=c(u({__name:`OfdViewer`,props:{data:{}},setup(c){let u=c,m=r(null),h=r(null),g=r(`loading`),_=r(``),v=!1,y=0,b=null,x=0,S=0,C=null,w=()=>{let e=m.value;if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},T=e=>new Promise((t,n)=>{e.parseOfdDocument({ofd:u.data,success:e=>t(e),fail:e=>n(e)})}),E=async e=>(C||=T(e).then(e=>{let t=e[0];if(!t)throw Error(`OFD 文件中没有可渲染的文档`);return t}),C),D=e=>e instanceof Error?e.message:typeof e==`string`?e:JSON.stringify(e),O=(e,t)=>{let n=document.createDocumentFragment();t.forEach(e=>{e.classList.add(`ofd-page`),n.appendChild(e)}),e.appendChild(n)},k=()=>{let e=h.value?.getBoundingClientRect().width||m.value?.getBoundingClientRect().width||0;return Math.max(Math.floor(e-48),240)},A=async e=>{let t=await l(()=>import(`./ofd-DHwwXPSE.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),n=await E(t);return v?[]:Promise.resolve(t.renderOfd(e,n))},j=async(e={})=>{let t=m.value;if(!t)return;let r=e.force??!1,i=e.showLoading??!1,a=k();if(!r&&g.value===`ready`&&Math.abs(a-S)<8)return;let o=++y;(i||g.value!==`ready`)&&(g.value=`loading`,w()),_.value=``;try{await n();let e=await A(a);if(v||o!==y)return;w(),O(t,e),S=a,g.value=`ready`}catch(e){if(v||o!==y)return;console.error(e),g.value=`error`,_.value=D(e)||`OFD 文件解析失败`}},M=()=>{!h.value||b||(b=new ResizeObserver(()=>{window.clearTimeout(x),x=window.setTimeout(()=>{v||j({showLoading:!1})},180)}),b.observe(h.value))};return i(()=>{j({force:!0,showLoading:!0}).finally(()=>{M()})}),t(()=>{v=!0,y+=1,window.clearTimeout(x),b?.disconnect(),b=null,w()}),(t,n)=>(e(),s(`div`,{ref_key:`viewer`,ref:h,class:`ofd-viewer`},[g.value===`loading`?(e(),s(`div`,f,`正在解析 OFD...`)):g.value===`error`?(e(),s(`div`,p,a(_.value),1)):d(``,!0),o(`div`,{ref_key:`stage`,ref:m,class:`ofd-stage`},null,512)],512))}}),[[`__scopeId`,`data-v-48238ef6`]]);export{m as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ofd-CCbysLg2.js","./index-DP0aBxNP.js","./index-B_rKNGx-.css","./jszip.min-DHUfArgC.js"])))=>i.map(i=>d[i]);
2
+ import{A as e,D as t,E as n,I as r,O as i,V as a,_ as o,b as s,l as c,t as l,w as u,y as d}from"./index-DP0aBxNP.js";var f={key:0,class:`ofd-state`},p={key:1,class:`ofd-state error`},m=c(u({__name:`OfdViewer`,props:{data:{}},setup(c){let u=c,m=r(null),h=r(null),g=r(`loading`),_=r(``),v=!1,y=0,b=null,x=0,S=0,C=null,w=()=>{let e=m.value;if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},T=e=>new Promise((t,n)=>{e.parseOfdDocument({ofd:u.data,success:e=>t(e),fail:e=>n(e)})}),E=async e=>(C||=T(e).then(e=>{let t=e[0];if(!t)throw Error(`OFD 文件中没有可渲染的文档`);return t}),C),D=e=>e instanceof Error?e.message:typeof e==`string`?e:JSON.stringify(e),O=(e,t)=>{let n=document.createDocumentFragment();t.forEach(e=>{e.classList.add(`ofd-page`),n.appendChild(e)}),e.appendChild(n)},k=()=>{let e=h.value?.getBoundingClientRect().width||m.value?.getBoundingClientRect().width||0;return Math.max(Math.floor(e-48),240)},A=async e=>{let t=await l(()=>import(`./ofd-CCbysLg2.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),n=await E(t);return v?[]:Promise.resolve(t.renderOfd(e,n))},j=async(e={})=>{let t=m.value;if(!t)return;let r=e.force??!1,i=e.showLoading??!1,a=k();if(!r&&g.value===`ready`&&Math.abs(a-S)<8)return;let o=++y;(i||g.value!==`ready`)&&(g.value=`loading`,w()),_.value=``;try{await n();let e=await A(a);if(v||o!==y)return;w(),O(t,e),S=a,g.value=`ready`}catch(e){if(v||o!==y)return;console.error(e),g.value=`error`,_.value=D(e)||`OFD 文件解析失败`}},M=()=>{!h.value||b||(b=new ResizeObserver(()=>{window.clearTimeout(x),x=window.setTimeout(()=>{v||j({showLoading:!1})},180)}),b.observe(h.value))};return i(()=>{j({force:!0,showLoading:!0}).finally(()=>{M()})}),t(()=>{v=!0,y+=1,window.clearTimeout(x),b?.disconnect(),b=null,w()}),(t,n)=>(e(),s(`div`,{ref_key:`viewer`,ref:h,class:`ofd-viewer`},[g.value===`loading`?(e(),s(`div`,f,`正在解析 OFD...`)):g.value===`error`?(e(),s(`div`,p,a(_.value),1)):d(``,!0),o(`div`,{ref_key:`stage`,ref:m,class:`ofd-stage`},null,512)],512))}}),[[`__scopeId`,`data-v-48238ef6`]]);export{m as default};