file-viewer3 1.0.8 → 1.0.26

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 (370) hide show
  1. package/LICENSE +160 -0
  2. package/README.en.md +390 -0
  3. package/README.md +306 -89
  4. package/dist/components/3MFLoader.js +527 -0
  5. package/dist/components/AMFLoader.js +188 -0
  6. package/dist/components/ArchiveViewer.js +526 -0
  7. package/dist/components/AudioViewer.js +66 -0
  8. package/dist/components/CadViewer.js +9040 -0
  9. package/dist/components/CodeViewer.js +151 -0
  10. package/dist/components/ColladaLoader.js +2282 -0
  11. package/dist/components/DrawingViewer.js +295 -0
  12. package/dist/components/EdaViewer.js +630 -0
  13. package/dist/components/EmailViewer.js +276 -0
  14. package/dist/components/EpubViewer.js +172 -0
  15. package/dist/components/FBXLoader.js +1574 -0
  16. package/dist/components/GLTFLoader.js +1383 -0
  17. package/dist/components/ImageViewer.js +1516 -1895
  18. package/dist/components/KMZLoader.js +45 -0
  19. package/dist/components/MarkdownViewer.js +1456 -1557
  20. package/dist/components/ModelViewer.js +797 -0
  21. package/dist/components/OBJLoader.js +287 -0
  22. package/dist/components/OfdViewer.js +133 -0
  23. package/dist/components/PCDLoader.js +141 -0
  24. package/dist/components/PLYLoader.js +305 -0
  25. package/dist/components/PdfView.js +27662 -21655
  26. package/dist/components/PptxRender.js +11170 -21118
  27. package/dist/components/STLLoader.js +83 -0
  28. package/dist/components/TDSLoader.js +228 -0
  29. package/dist/components/TypstViewer.js +1697 -0
  30. package/dist/components/USDLoader.js +2526 -0
  31. package/dist/components/UmdViewer.js +1873 -0
  32. package/dist/components/VRMLLoader.js +6422 -0
  33. package/dist/components/VTKLoader.js +337 -0
  34. package/dist/components/XYZLoader.js +30 -0
  35. package/dist/components/XlsxTable.js +7871 -69873
  36. package/dist/components/__vite-browser-external.js +7 -0
  37. package/dist/components/_plugin-vue_export-helper.js +8 -0
  38. package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
  39. package/dist/components/arc.js +79 -0
  40. package/dist/components/architecture-7EHR7CIX.js +3 -0
  41. package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
  42. package/dist/components/archive.js +24 -0
  43. package/dist/components/asyncToGenerator.js +29 -0
  44. package/dist/components/audio.js +19 -0
  45. package/dist/components/az-AZ-76LH7QW2.js +523 -0
  46. package/dist/components/bash.js +169 -0
  47. package/dist/components/bg-BG-XCXSNQG7.js +523 -0
  48. package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
  49. package/dist/components/bn-BD-2XOGV67Q.js +523 -0
  50. package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
  51. package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
  52. package/dist/components/cad.js +23 -0
  53. package/dist/components/cfb.js +1174 -0
  54. package/dist/components/channel.js +5 -0
  55. package/dist/components/chunk-2J33WTMH.js +26 -0
  56. package/dist/components/chunk-3OPIFGDE.js +4167 -0
  57. package/dist/components/chunk-4BX2VUAB.js +19 -0
  58. package/dist/components/chunk-55IACEB6.js +9 -0
  59. package/dist/components/chunk-5ZQYHXKU.js +669 -0
  60. package/dist/components/chunk-6U3AYISY.js +624 -0
  61. package/dist/components/chunk-727SXJPM.js +3356 -0
  62. package/dist/components/chunk-AGHRB4JF.js +324 -0
  63. package/dist/components/chunk-AQP2D5EJ.js +2055 -0
  64. package/dist/components/chunk-BSJP7CBP.js +83 -0
  65. package/dist/components/chunk-CSCIHK7Q.js +3500 -0
  66. package/dist/components/chunk-EIO257PC.js +1836 -0
  67. package/dist/components/chunk-FMBD7UC4.js +5 -0
  68. package/dist/components/chunk-K2UTITRG.js +17627 -0
  69. package/dist/components/chunk-KSCS5N6A.js +572 -0
  70. package/dist/components/chunk-L5ZTLDWV.js +40 -0
  71. package/dist/components/chunk-LZXEDZCA.js +60 -0
  72. package/dist/components/chunk-ND2GUHAM.js +61 -0
  73. package/dist/components/chunk-NNHCCRGN.js +20425 -0
  74. package/dist/components/chunk-NZK2D7GU.js +68 -0
  75. package/dist/components/chunk-O5CBEL6O.js +1894 -0
  76. package/dist/components/chunk-QZHKN3VN.js +12 -0
  77. package/dist/components/chunk-SRAX5OIU.js +22 -0
  78. package/dist/components/chunk-WU5MYG2G.js +14 -0
  79. package/dist/components/chunk-XPW4576I.js +1146 -0
  80. package/dist/components/chunk-Z3N5DIM6.js +59 -0
  81. package/dist/components/chunk-ZUYEQ4TG.js +22 -0
  82. package/dist/components/chunk.js +23 -0
  83. package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
  84. package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
  85. package/dist/components/compiler.js +2 -0
  86. package/dist/components/core.js +845 -0
  87. package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
  88. package/dist/components/cpp.js +225 -0
  89. package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
  90. package/dist/components/csharp.js +260 -0
  91. package/dist/components/css.js +140 -0
  92. package/dist/components/cytoscape.esm.js +18114 -0
  93. package/dist/components/da-DK-5WZEPLOC.js +523 -0
  94. package/dist/components/dagre-BM42HDAG.js +325 -0
  95. package/dist/components/dagre.js +1936 -0
  96. package/dist/components/de-DE-XR44H4JA.js +523 -0
  97. package/dist/components/defaultLocale.js +201 -0
  98. package/dist/components/defineProperty.js +50 -0
  99. package/dist/components/diagram-2AECGRRQ.js +229 -0
  100. package/dist/components/diagram-5GNKFQAL.js +108 -0
  101. package/dist/components/diagram-KO2AKTUF.js +443 -0
  102. package/dist/components/diagram-LMA3HP47.js +139 -0
  103. package/dist/components/diagram-OG6HWLK6.js +541 -0
  104. package/dist/components/diff.js +39 -0
  105. package/dist/components/directory-open-01563666.js +26 -0
  106. package/dist/components/directory-open-4ed118d0.js +83 -0
  107. package/dist/components/dist.js +50 -0
  108. package/dist/components/dist2.js +3291 -0
  109. package/dist/components/dist3.js +1593 -0
  110. package/dist/components/documentSearch.js +378 -0
  111. package/dist/components/docx-preview.js +3113 -0
  112. package/dist/components/drawing.js +19 -0
  113. package/dist/components/ebook.js +16 -0
  114. package/dist/components/eda.js +20 -0
  115. package/dist/components/el-GR-BZB4AONW.js +523 -0
  116. package/dist/components/email.js +21 -0
  117. package/dist/components/en-B4ZKOASM.js +3 -0
  118. package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
  119. package/dist/components/es-ES-U4NZUMDT.js +523 -0
  120. package/dist/components/eu-ES-A7QVB2H4.js +523 -0
  121. package/dist/components/eventmodeling-FCH6USID.js +3 -0
  122. package/dist/components/fa-IR-HGAKTJCU.js +523 -0
  123. package/dist/components/fflate.module.js +323 -0
  124. package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
  125. package/dist/components/file-open-002ab408.js +38 -0
  126. package/dist/components/file-open-7c801643.js +24 -0
  127. package/dist/components/file-save-3189631c.js +40 -0
  128. package/dist/components/file-save-745eba88.js +36 -0
  129. package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
  130. package/dist/components/fr-FR-RHASNOE6.js +523 -0
  131. package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
  132. package/dist/components/gitGraph-WXDBUCRP.js +3 -0
  133. package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
  134. package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
  135. package/dist/components/global-compiler.js +23 -0
  136. package/dist/components/global-renderer.js +23 -0
  137. package/dist/components/go.js +140 -0
  138. package/dist/components/graphlib.js +1267 -0
  139. package/dist/components/he-IL-6SHJWFNN.js +523 -0
  140. package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
  141. package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
  142. package/dist/components/id-ID-SAP4L64H.js +523 -0
  143. package/dist/components/image-GAAHSSAO.js +3 -0
  144. package/dist/components/image-blob-reduce.esm.js +1429 -0
  145. package/dist/components/image.js +17 -0
  146. package/dist/components/info-J43DQDTF.js +3 -0
  147. package/dist/components/infoDiagram-5YYISTIA.js +26 -0
  148. package/dist/components/ini.js +88 -0
  149. package/dist/components/init.js +15 -0
  150. package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
  151. package/dist/components/it-IT-JPQ66NNP.js +523 -0
  152. package/dist/components/ja-JP-DBVTYXUO.js +523 -0
  153. package/dist/components/java.js +169 -0
  154. package/dist/components/javascript.js +436 -0
  155. package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
  156. package/dist/components/json.js +36 -0
  157. package/dist/components/jszip.min.js +3033 -0
  158. package/dist/components/kaa-6HZHGXH3.js +523 -0
  159. package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
  160. package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
  161. package/dist/components/katex.js +21979 -0
  162. package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
  163. package/dist/components/km-KH-HSX4SM5Z.js +523 -0
  164. package/dist/components/ko-KR-MTYHY66A.js +523 -0
  165. package/dist/components/ku-TR-6OUDTVRD.js +523 -0
  166. package/dist/components/lib.js +4877 -0
  167. package/dist/components/libarchive.js +360 -0
  168. package/dist/components/linear.js +289 -0
  169. package/dist/components/lt-LT-XHIRWOB4.js +523 -0
  170. package/dist/components/lv-LV-5QDEKY6T.js +523 -0
  171. package/dist/components/markdown.js +181 -0
  172. package/dist/components/md.js +17 -0
  173. package/dist/components/mermaid-parser.core.js +328 -0
  174. package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
  175. package/dist/components/model.js +21 -0
  176. package/dist/components/mp4.js +12 -0
  177. package/dist/components/mr-IN-CRQNXWMA.js +523 -0
  178. package/dist/components/my-MM-5M5IBNSE.js +523 -0
  179. package/dist/components/nb-NO-T6EIAALU.js +523 -0
  180. package/dist/components/nestedRender.js +158 -0
  181. package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
  182. package/dist/components/nn-NO-6E72VCQL.js +523 -0
  183. package/dist/components/objectSpread2.js +29 -0
  184. package/dist/components/objectWithoutProperties.js +28 -0
  185. package/dist/components/oc-FR-POXYY2M6.js +523 -0
  186. package/dist/components/ofd.js +5261 -0
  187. package/dist/components/ofd2.js +16 -0
  188. package/dist/components/ordinal.js +65 -0
  189. package/dist/components/pa-IN-N4M65BXN.js +523 -0
  190. package/dist/components/packet-YPE3B663.js +3 -0
  191. package/dist/components/pdf.js +24 -0
  192. package/dist/components/percentages-BXMCSKIN.js +3 -0
  193. package/dist/components/php.js +294 -0
  194. package/dist/components/pica.js +1009 -0
  195. package/dist/components/pie-LRSECV5Y.js +3 -0
  196. package/dist/components/pie.js +47 -0
  197. package/dist/components/pieDiagram-4H26LBE5.js +130 -0
  198. package/dist/components/pl-PL-T2D74RX3.js +523 -0
  199. package/dist/components/postal-mime.js +3146 -0
  200. package/dist/components/pptx.js +15 -0
  201. package/dist/components/printLayout.js +42 -0
  202. package/dist/components/prod.js +21770 -0
  203. package/dist/components/pt-BR-5N22H2LF.js +523 -0
  204. package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
  205. package/dist/components/python.js +238 -0
  206. package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
  207. package/dist/components/radar-GUYGQ44K.js +3 -0
  208. package/dist/components/renderer.js +2 -0
  209. package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
  210. package/dist/components/ro-RO-JPDTUUEW.js +523 -0
  211. package/dist/components/rough.esm.js +1355 -0
  212. package/dist/components/roundRect.js +90 -0
  213. package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
  214. package/dist/components/rust.js +169 -0
  215. package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
  216. package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
  217. package/dist/components/shared.js +175 -0
  218. package/dist/components/shared2.js +4 -0
  219. package/dist/components/si-LK-N5RQ5JYF.js +523 -0
  220. package/dist/components/sk-SK-C5VTKIMK.js +523 -0
  221. package/dist/components/sl-SI-NN7IZMDC.js +523 -0
  222. package/dist/components/sourceLoading.js +134 -0
  223. package/dist/components/sql.js +118 -0
  224. package/dist/components/src.js +2664 -0
  225. package/dist/components/src2.js +10722 -0
  226. package/dist/components/stateDiagram-AJRCARHV.js +217 -0
  227. package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
  228. package/dist/components/subset-shared.chunk.js +3 -0
  229. package/dist/components/subset-worker.chunk.js +21 -0
  230. package/dist/components/sv-SE-XGPEYMSR.js +523 -0
  231. package/dist/components/ta-IN-2NMHFXQM.js +523 -0
  232. package/dist/components/text.js +20 -0
  233. package/dist/components/th-TH-HPSO5L25.js +523 -0
  234. package/dist/components/three.module.js +13134 -0
  235. package/dist/components/time.js +910 -0
  236. package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
  237. package/dist/components/tr-TR-DEFEU3FU.js +523 -0
  238. package/dist/components/treeView-BLDUP644.js +3 -0
  239. package/dist/components/treemap-LRROVOQU.js +3 -0
  240. package/dist/components/typescript.js +521 -0
  241. package/dist/components/typst.js +25 -0
  242. package/dist/components/uk-UA-QMV73CPH.js +523 -0
  243. package/dist/components/umd.js +16 -0
  244. package/dist/components/use.js +422 -0
  245. package/dist/components/util.js +49 -0
  246. package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
  247. package/dist/components/vi-VN-M7AON7JQ.js +523 -0
  248. package/dist/components/viewerZoom.js +92 -0
  249. package/dist/components/wardley-L42UT6IY.js +3 -0
  250. package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
  251. package/dist/components/wasm-pack-shim.js +1711 -0
  252. package/dist/components/wasm-pack-shim2.js +934 -0
  253. package/dist/components/wasm.js +97 -0
  254. package/dist/components/word.js +3055 -0
  255. package/dist/components/worker-ref.js +15 -20
  256. package/dist/components/xlsx.js +21 -0
  257. package/dist/components/xml.js +166 -0
  258. package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
  259. package/dist/components/yaml.js +144 -0
  260. package/dist/components/zh-CN-LNUGB5OW.js +523 -0
  261. package/dist/components/zh-HK-E62DVLB3.js +523 -0
  262. package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
  263. package/dist/file-viewer3.css +2 -0
  264. package/dist/index.mjs +3292 -5
  265. package/dist/src/App.vue.d.ts +3 -0
  266. package/dist/src/compare/CompareApp.vue.d.ts +3 -0
  267. package/dist/src/compare/main.d.ts +0 -0
  268. package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
  269. package/dist/src/components/HelloWorld.vue.d.ts +3 -0
  270. package/dist/src/components/utils.d.ts +4 -0
  271. package/dist/src/main.d.ts +0 -0
  272. package/dist/src/package/common/printCapability.d.ts +27 -0
  273. package/dist/src/package/common/printLayout.d.ts +16 -0
  274. package/dist/src/package/common/sourceLoading.d.ts +10 -0
  275. package/dist/src/package/common/type.d.ts +522 -8
  276. package/dist/src/package/common/worker-ref.d.ts +1 -1
  277. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
  278. package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
  279. package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
  280. package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
  281. package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
  282. package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
  283. package/dist/src/package/components/FileViewer/index.d.ts +1 -1
  284. package/dist/src/package/components/FileViewer/util.d.ts +2 -1
  285. package/dist/src/package/index.d.ts +14 -4
  286. package/dist/src/package/use/documentLocation.d.ts +15 -0
  287. package/dist/src/package/use/documentSearch.d.ts +234 -0
  288. package/dist/src/package/use/index.d.ts +4 -0
  289. package/dist/src/package/use/loading.d.ts +33 -0
  290. package/dist/src/package/use/viewerZoom.d.ts +42 -0
  291. package/dist/src/package/use/worker.d.ts +2 -2
  292. package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
  293. package/dist/src/package/vendors/archive/cache.d.ts +10 -0
  294. package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
  295. package/dist/src/package/vendors/archive/index.d.ts +3 -0
  296. package/dist/src/package/vendors/archive/shared.d.ts +24 -0
  297. package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
  298. package/dist/src/package/vendors/audio/index.d.ts +7 -0
  299. package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
  300. package/dist/src/package/vendors/cad/index.d.ts +8 -0
  301. package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
  302. package/dist/src/package/vendors/drawing/index.d.ts +7 -0
  303. package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
  304. package/dist/src/package/vendors/ebook/index.d.ts +7 -0
  305. package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
  306. package/dist/src/package/vendors/eda/index.d.ts +2 -0
  307. package/dist/src/package/vendors/eda/parser.d.ts +77 -0
  308. package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
  309. package/dist/src/package/vendors/email/index.d.ts +2 -0
  310. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
  311. package/dist/src/package/vendors/image/index.d.ts +1 -1
  312. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
  313. package/dist/src/package/vendors/md/index.d.ts +1 -1
  314. package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
  315. package/dist/src/package/vendors/model/index.d.ts +3 -0
  316. package/dist/src/package/vendors/model/shared.d.ts +1 -0
  317. package/dist/src/package/vendors/nestedRender.d.ts +10 -0
  318. package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
  319. package/dist/src/package/vendors/ofd/index.d.ts +7 -0
  320. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
  321. package/dist/src/package/vendors/pdf/index.d.ts +2 -1
  322. package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
  323. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
  324. package/dist/src/package/vendors/pptx/index.d.ts +1 -1
  325. package/dist/src/package/vendors/renders.d.ts +1 -1
  326. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
  327. package/dist/src/package/vendors/text/index.d.ts +6 -2
  328. package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
  329. package/dist/src/package/vendors/typst/index.d.ts +8 -0
  330. package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +6 -0
  331. package/dist/src/package/vendors/umd/index.d.ts +7 -0
  332. package/dist/src/package/vendors/umd/parser.d.ts +30 -0
  333. package/dist/src/package/vendors/word/doc.d.ts +5 -0
  334. package/dist/src/package/vendors/word/docx.d.ts +5 -0
  335. package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
  336. package/dist/src/package/vendors/word/index.d.ts +3 -0
  337. package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
  338. package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
  339. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
  340. package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
  341. package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
  342. package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
  343. package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
  344. package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
  345. package/dist/style.css +1 -57
  346. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  347. package/dist/wasm/cad/dwg-worker.js +24 -0
  348. package/dist/wasm/cad/libredwg-web.js +15 -0
  349. package/dist/wasm/cad/libredwg-web.wasm +0 -0
  350. package/package.json +118 -42
  351. package/.vscode/extensions.json +0 -3
  352. package/dist/components/_commonjs-dynamic-modules.js +0 -6
  353. package/dist/components/_commonjsHelpers.js +0 -36
  354. package/dist/components/docx-preview.min.js +0 -5287
  355. package/dist/components/index.js +0 -1717
  356. package/dist/favicon.ico +0 -0
  357. package/dist/index.umd.js +0 -436
  358. package/dist/src/package/vendors/docx/index.d.ts +0 -4
  359. package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
  360. package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
  361. package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
  362. package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
  363. package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
  364. package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
  365. package/dist/worker/pdf.worker.js +0 -66
  366. package/dist/worker/pptx.worker.js +0 -21
  367. package/dist/worker/sheet.worker.js +0 -38
  368. package/dist/worker/xlsx.worker.js +0 -65
  369. /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
  370. /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
@@ -1,1898 +1,1519 @@
1
- import { defineComponent as Ee, ref as Ve, watch as yt, nextTick as wt, onMounted as Fe, onUnmounted as Me, openBlock as ft, createElementBlock as St, renderSlot as Ye, computed as We, createBlock as Xe, unref as Tt, withCtx as qe, Fragment as He, renderList as Ue } from "vue";
2
- import { _ as Be } from "./index.js";
3
- /*!
4
- * Viewer.js v1.11.3
5
- * https://fengyuanchen.github.io/viewerjs
6
- *
7
- * Copyright 2015-present Chen Fengyuan
8
- * Released under the MIT license
9
- *
10
- * Date: 2023-03-05T07:01:17.741Z
11
- */
12
- function jt(e, t) {
13
- var i = Object.keys(e);
14
- if (Object.getOwnPropertySymbols) {
15
- var r = Object.getOwnPropertySymbols(e);
16
- t && (r = r.filter(function(n) {
17
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
18
- })), i.push.apply(i, r);
19
- }
20
- return i;
21
- }
22
- function Ct(e) {
23
- for (var t = 1; t < arguments.length; t++) {
24
- var i = arguments[t] != null ? arguments[t] : {};
25
- t % 2 ? jt(Object(i), !0).forEach(function(r) {
26
- Ze(e, r, i[r]);
27
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : jt(Object(i)).forEach(function(r) {
28
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(i, r));
29
- });
30
- }
31
- return e;
32
- }
33
- function Ot(e) {
34
- return Ot = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
35
- return typeof t;
36
- } : function(t) {
37
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
38
- }, Ot(e);
39
- }
40
- function Ke(e, t) {
41
- if (!(e instanceof t))
42
- throw new TypeError("Cannot call a class as a function");
43
- }
44
- function Vt(e, t) {
45
- for (var i = 0; i < t.length; i++) {
46
- var r = t[i];
47
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, _e(r.key), r);
48
- }
49
- }
50
- function Ge(e, t, i) {
51
- return t && Vt(e.prototype, t), i && Vt(e, i), Object.defineProperty(e, "prototype", {
52
- writable: !1
53
- }), e;
54
- }
55
- function Ze(e, t, i) {
56
- return t = _e(t), t in e ? Object.defineProperty(e, t, {
57
- value: i,
58
- enumerable: !0,
59
- configurable: !0,
60
- writable: !0
61
- }) : e[t] = i, e;
62
- }
63
- function Je(e, t) {
64
- if (typeof e != "object" || e === null)
65
- return e;
66
- var i = e[Symbol.toPrimitive];
67
- if (i !== void 0) {
68
- var r = i.call(e, t || "default");
69
- if (typeof r != "object")
70
- return r;
71
- throw new TypeError("@@toPrimitive must return a primitive value.");
72
- }
73
- return (t === "string" ? String : Number)(e);
74
- }
75
- function _e(e) {
76
- var t = Je(e, "string");
77
- return typeof t == "symbol" ? t : String(t);
78
- }
79
- var Ft = {
80
- /**
81
- * Enable a modal backdrop, specify `static` for a backdrop
82
- * which doesn't close the modal on click.
83
- * @type {boolean}
84
- */
85
- backdrop: !0,
86
- /**
87
- * Show the button on the top-right of the viewer.
88
- * @type {boolean}
89
- */
90
- button: !0,
91
- /**
92
- * Show the navbar.
93
- * @type {boolean | number}
94
- */
95
- navbar: !0,
96
- /**
97
- * Specify the visibility and the content of the title.
98
- * @type {boolean | number | Function | Array}
99
- */
100
- title: !0,
101
- /**
102
- * Show the toolbar.
103
- * @type {boolean | number | Object}
104
- */
105
- toolbar: !0,
106
- /**
107
- * Custom class name(s) to add to the viewer's root element.
108
- * @type {string}
109
- */
110
- className: "",
111
- /**
112
- * Define where to put the viewer in modal mode.
113
- * @type {string | Element}
114
- */
115
- container: "body",
116
- /**
117
- * Filter the images for viewing. Return true if the image is viewable.
118
- * @type {Function}
119
- */
120
- filter: null,
121
- /**
122
- * Enable to request fullscreen when play.
123
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/FullscreenOptions}
124
- * @type {boolean|FullscreenOptions}
125
- */
126
- fullscreen: !0,
127
- /**
128
- * Define the extra attributes to inherit from the original image.
129
- * @type {Array}
130
- */
131
- inheritedAttributes: ["crossOrigin", "decoding", "isMap", "loading", "referrerPolicy", "sizes", "srcset", "useMap"],
132
- /**
133
- * Define the initial coverage of the viewing image.
134
- * @type {number}
135
- */
136
- initialCoverage: 0.9,
137
- /**
138
- * Define the initial index of the image for viewing.
139
- * @type {number}
140
- */
141
- initialViewIndex: 0,
142
- /**
143
- * Enable inline mode.
144
- * @type {boolean}
145
- */
146
- inline: !1,
147
- /**
148
- * The amount of time to delay between automatically cycling an image when playing.
149
- * @type {number}
150
- */
151
- interval: 5e3,
152
- /**
153
- * Enable keyboard support.
154
- * @type {boolean}
155
- */
156
- keyboard: !0,
157
- /**
158
- * Focus the viewer when initialized.
159
- * @type {boolean}
160
- */
161
- focus: !0,
162
- /**
163
- * Indicate if show a loading spinner when load image or not.
164
- * @type {boolean}
165
- */
166
- loading: !0,
167
- /**
168
- * Indicate if enable loop viewing or not.
169
- * @type {boolean}
170
- */
171
- loop: !0,
172
- /**
173
- * Min width of the viewer in inline mode.
174
- * @type {number}
175
- */
176
- minWidth: 200,
177
- /**
178
- * Min height of the viewer in inline mode.
179
- * @type {number}
180
- */
181
- minHeight: 100,
182
- /**
183
- * Enable to move the image.
184
- * @type {boolean}
185
- */
186
- movable: !0,
187
- /**
188
- * Enable to rotate the image.
189
- * @type {boolean}
190
- */
191
- rotatable: !0,
192
- /**
193
- * Enable to scale the image.
194
- * @type {boolean}
195
- */
196
- scalable: !0,
197
- /**
198
- * Enable to zoom the image.
199
- * @type {boolean}
200
- */
201
- zoomable: !0,
202
- /**
203
- * Enable to zoom the current image by dragging on the touch screen.
204
- * @type {boolean}
205
- */
206
- zoomOnTouch: !0,
207
- /**
208
- * Enable to zoom the image by wheeling mouse.
209
- * @type {boolean}
210
- */
211
- zoomOnWheel: !0,
212
- /**
213
- * Enable to slide to the next or previous image by swiping on the touch screen.
214
- * @type {boolean}
215
- */
216
- slideOnTouch: !0,
217
- /**
218
- * Indicate if toggle the image size between its natural size
219
- * and initial size when double click on the image or not.
220
- * @type {boolean}
221
- */
222
- toggleOnDblclick: !0,
223
- /**
224
- * Show the tooltip with image ratio (percentage) when zoom in or zoom out.
225
- * @type {boolean}
226
- */
227
- tooltip: !0,
228
- /**
229
- * Enable CSS3 Transition for some special elements.
230
- * @type {boolean}
231
- */
232
- transition: !0,
233
- /**
234
- * Define the CSS `z-index` value of viewer in modal mode.
235
- * @type {number}
236
- */
237
- zIndex: 2015,
238
- /**
239
- * Define the CSS `z-index` value of viewer in inline mode.
240
- * @type {number}
241
- */
242
- zIndexInline: 0,
243
- /**
244
- * Define the ratio when zoom the image by wheeling mouse.
245
- * @type {number}
246
- */
247
- zoomRatio: 0.1,
248
- /**
249
- * Define the min ratio of the image when zoom out.
250
- * @type {number}
251
- */
252
- minZoomRatio: 0.01,
253
- /**
254
- * Define the max ratio of the image when zoom in.
255
- * @type {number}
256
- */
257
- maxZoomRatio: 100,
258
- /**
259
- * Define where to get the original image URL for viewing.
260
- * @type {string | Function}
261
- */
262
- url: "src",
263
- /**
264
- * Event shortcuts.
265
- * @type {Function}
266
- */
267
- ready: null,
268
- show: null,
269
- shown: null,
270
- hide: null,
271
- hidden: null,
272
- view: null,
273
- viewed: null,
274
- move: null,
275
- moved: null,
276
- rotate: null,
277
- rotated: null,
278
- scale: null,
279
- scaled: null,
280
- zoom: null,
281
- zoomed: null,
282
- play: null,
283
- stop: null
284
- }, Qe = '<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>', pt = typeof window < "u" && typeof window.document < "u", V = pt ? window : {}, G = pt && V.document.documentElement ? "ontouchstart" in V.document.documentElement : !1, Lt = pt ? "PointerEvent" in V : !1, v = "viewer", dt = "move", Se = "switch", it = "zoom", ot = "".concat(v, "-active"), ti = "".concat(v, "-close"), vt = "".concat(v, "-fade"), It = "".concat(v, "-fixed"), ei = "".concat(v, "-fullscreen"), Mt = "".concat(v, "-fullscreen-exit"), Y = "".concat(v, "-hide"), ii = "".concat(v, "-hide-md-down"), ri = "".concat(v, "-hide-sm-down"), ni = "".concat(v, "-hide-xs-down"), L = "".concat(v, "-in"), rt = "".concat(v, "-invisible"), Z = "".concat(v, "-loading"), ai = "".concat(v, "-move"), Yt = "".concat(v, "-open"), q = "".concat(v, "-show"), O = "".concat(v, "-transition"), J = "click", At = "dblclick", Wt = "dragstart", Xt = "focusin", qt = "keydown", $ = "load", W = "error", si = G ? "touchend touchcancel" : "mouseup", oi = G ? "touchmove" : "mousemove", li = G ? "touchstart" : "mousedown", Ht = Lt ? "pointerdown" : li, Ut = Lt ? "pointermove" : oi, Bt = Lt ? "pointerup pointercancel" : si, Kt = "resize", k = "transitionend", Gt = "wheel", Zt = "ready", Jt = "show", Qt = "shown", te = "hide", ee = "hidden", ie = "view", nt = "viewed", re = "move", ne = "moved", ae = "rotate", se = "rotated", oe = "scale", le = "scaled", ue = "zoom", he = "zoomed", ce = "play", fe = "stop", mt = "".concat(v, "Action"), $t = /\s\s*/, lt = ["zoom-in", "zoom-out", "one-to-one", "reset", "prev", "play", "next", "rotate-left", "rotate-right", "flip-horizontal", "flip-vertical"];
285
- function at(e) {
286
- return typeof e == "string";
287
- }
288
- var ui = Number.isNaN || V.isNaN;
289
- function _(e) {
290
- return typeof e == "number" && !ui(e);
291
- }
292
- function U(e) {
293
- return typeof e > "u";
294
- }
295
- function Q(e) {
296
- return Ot(e) === "object" && e !== null;
297
- }
298
- var hi = Object.prototype.hasOwnProperty;
299
- function B(e) {
300
- if (!Q(e))
301
- return !1;
302
- try {
303
- var t = e.constructor, i = t.prototype;
304
- return t && i && hi.call(i, "isPrototypeOf");
305
- } catch {
306
- return !1;
307
- }
308
- }
309
- function p(e) {
310
- return typeof e == "function";
311
- }
312
- function y(e, t) {
313
- if (e && p(t))
314
- if (Array.isArray(e) || _(e.length)) {
315
- var i = e.length, r;
316
- for (r = 0; r < i && t.call(e, e[r], r, e) !== !1; r += 1)
317
- ;
318
- } else
319
- Q(e) && Object.keys(e).forEach(function(n) {
320
- t.call(e, e[n], n, e);
321
- });
322
- return e;
323
- }
324
- var C = Object.assign || function(t) {
325
- for (var i = arguments.length, r = new Array(i > 1 ? i - 1 : 0), n = 1; n < i; n++)
326
- r[n - 1] = arguments[n];
327
- return Q(t) && r.length > 0 && r.forEach(function(a) {
328
- Q(a) && Object.keys(a).forEach(function(s) {
329
- t[s] = a[s];
330
- });
331
- }), t;
332
- }, ci = /^(?:width|height|left|top|marginLeft|marginTop)$/;
333
- function z(e, t) {
334
- var i = e.style;
335
- y(t, function(r, n) {
336
- ci.test(n) && _(r) && (r += "px"), i[n] = r;
337
- });
338
- }
339
- function fi(e) {
340
- return at(e) ? e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : e;
341
- }
342
- function H(e, t) {
343
- return !e || !t ? !1 : e.classList ? e.classList.contains(t) : e.className.indexOf(t) > -1;
344
- }
345
- function f(e, t) {
346
- if (!(!e || !t)) {
347
- if (_(e.length)) {
348
- y(e, function(r) {
349
- f(r, t);
350
- });
351
- return;
352
- }
353
- if (e.classList) {
354
- e.classList.add(t);
355
- return;
356
- }
357
- var i = e.className.trim();
358
- i ? i.indexOf(t) < 0 && (e.className = "".concat(i, " ").concat(t)) : e.className = t;
359
- }
360
- }
361
- function m(e, t) {
362
- if (!(!e || !t)) {
363
- if (_(e.length)) {
364
- y(e, function(i) {
365
- m(i, t);
366
- });
367
- return;
368
- }
369
- if (e.classList) {
370
- e.classList.remove(t);
371
- return;
372
- }
373
- e.className.indexOf(t) >= 0 && (e.className = e.className.replace(t, ""));
374
- }
375
- }
376
- function st(e, t, i) {
377
- if (t) {
378
- if (_(e.length)) {
379
- y(e, function(r) {
380
- st(r, t, i);
381
- });
382
- return;
383
- }
384
- i ? f(e, t) : m(e, t);
385
- }
386
- }
387
- var di = /([a-z\d])([A-Z])/g;
388
- function kt(e) {
389
- return e.replace(di, "$1-$2").toLowerCase();
390
- }
391
- function K(e, t) {
392
- return Q(e[t]) ? e[t] : e.dataset ? e.dataset[t] : e.getAttribute("data-".concat(kt(t)));
393
- }
394
- function xt(e, t, i) {
395
- Q(i) ? e[t] = i : e.dataset ? e.dataset[t] = i : e.setAttribute("data-".concat(kt(t)), i);
396
- }
397
- var Oe = function() {
398
- var e = !1;
399
- if (pt) {
400
- var t = !1, i = function() {
401
- }, r = Object.defineProperty({}, "once", {
402
- get: function() {
403
- return e = !0, t;
404
- },
405
- /**
406
- * This setter can fix a `TypeError` in strict mode
407
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
408
- * @param {boolean} value - The value to set
409
- */
410
- set: function(a) {
411
- t = a;
412
- }
413
- });
414
- V.addEventListener("test", i, r), V.removeEventListener("test", i, r);
415
- }
416
- return e;
1
+ import { o as e, t } from "./chunk.js";
2
+ import { n } from "./asyncToGenerator.js";
3
+ import { n as r, r as i, t as a } from "./viewerZoom.js";
4
+ import { t as o } from "./_plugin-vue_export-helper.js";
5
+ import { Fragment as s, computed as c, createElementBlock as l, createVNode as u, defineComponent as d, nextTick as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, unref as x, watch as S, withCtx as ee } from "vue";
6
+ //#endregion
7
+ //#region node_modules/.pnpm/v-viewer@3.0.23_viewerjs@1.11.7_vue@3.5.35_typescript@6.0.3_/node_modules/v-viewer/dist/index.js
8
+ var te = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
9
+ (function(n, r) {
10
+ 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());
11
+ })(e, (function() {
12
+ function e(e, t) {
13
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
14
+ }
15
+ function t(e, t) {
16
+ for (var n = 0; n < t.length; n++) {
17
+ var r = t[n];
18
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, s(r.key), r);
19
+ }
20
+ }
21
+ function n(e, n, r) {
22
+ return n && t(e.prototype, n), r && t(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
23
+ }
24
+ function r(e, t, n) {
25
+ return (t = s(t)) in e ? Object.defineProperty(e, t, {
26
+ value: n,
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0
30
+ }) : e[t] = n, e;
31
+ }
32
+ function i(e, t) {
33
+ var n = Object.keys(e);
34
+ if (Object.getOwnPropertySymbols) {
35
+ var r = Object.getOwnPropertySymbols(e);
36
+ t && (r = r.filter(function(t) {
37
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
38
+ })), n.push.apply(n, r);
39
+ }
40
+ return n;
41
+ }
42
+ function a(e) {
43
+ for (var t = 1; t < arguments.length; t++) {
44
+ var n = arguments[t] == null ? {} : arguments[t];
45
+ t % 2 ? i(Object(n), !0).forEach(function(t) {
46
+ r(e, t, n[t]);
47
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : i(Object(n)).forEach(function(t) {
48
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
49
+ });
50
+ }
51
+ return e;
52
+ }
53
+ function o(e, t) {
54
+ if (typeof e != "object" || !e) return e;
55
+ var n = e[Symbol.toPrimitive];
56
+ if (n !== void 0) {
57
+ var r = n.call(e, t || "default");
58
+ if (typeof r != "object") return r;
59
+ throw TypeError("@@toPrimitive must return a primitive value.");
60
+ }
61
+ return (t === "string" ? String : Number)(e);
62
+ }
63
+ function s(e) {
64
+ var t = o(e, "string");
65
+ return typeof t == "symbol" ? t : t + "";
66
+ }
67
+ function c(e) {
68
+ "@babel/helpers - typeof";
69
+ return c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
70
+ return typeof e;
71
+ } : function(e) {
72
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
73
+ }, c(e);
74
+ }
75
+ var l = {
76
+ backdrop: !0,
77
+ button: !0,
78
+ navbar: !0,
79
+ title: !0,
80
+ toolbar: !0,
81
+ className: "",
82
+ container: "body",
83
+ filter: null,
84
+ fullscreen: !0,
85
+ inheritedAttributes: [
86
+ "crossOrigin",
87
+ "decoding",
88
+ "isMap",
89
+ "loading",
90
+ "referrerPolicy",
91
+ "sizes",
92
+ "srcset",
93
+ "useMap"
94
+ ],
95
+ initialCoverage: .9,
96
+ initialViewIndex: 0,
97
+ inline: !1,
98
+ interval: 5e3,
99
+ keyboard: !0,
100
+ focus: !0,
101
+ loading: !0,
102
+ loop: !0,
103
+ minWidth: 200,
104
+ minHeight: 100,
105
+ movable: !0,
106
+ rotatable: !0,
107
+ scalable: !0,
108
+ zoomable: !0,
109
+ zoomOnTouch: !0,
110
+ zoomOnWheel: !0,
111
+ slideOnTouch: !0,
112
+ toggleOnDblclick: !0,
113
+ tooltip: !0,
114
+ transition: !0,
115
+ zIndex: 2015,
116
+ zIndexInline: 0,
117
+ zoomRatio: .1,
118
+ minZoomRatio: .01,
119
+ maxZoomRatio: 100,
120
+ url: "src",
121
+ ready: null,
122
+ show: null,
123
+ shown: null,
124
+ hide: null,
125
+ hidden: null,
126
+ view: null,
127
+ viewed: null,
128
+ move: null,
129
+ moved: null,
130
+ rotate: null,
131
+ rotated: null,
132
+ scale: null,
133
+ scaled: null,
134
+ zoom: null,
135
+ zoomed: null,
136
+ play: null,
137
+ stop: null
138
+ }, 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`, b = `${h}-close`, x = `${h}-fade`, S = `${h}-fixed`, ee = `${h}-fullscreen`, te = `${h}-fullscreen-exit`, C = `${h}-hide`, ne = `${h}-hide-md-down`, re = `${h}-hide-sm-down`, w = `${h}-hide-xs-down`, T = `${h}-in`, E = `${h}-invisible`, D = `${h}-loading`, O = `${h}-move`, ie = `${h}-open`, k = `${h}-show`, A = `${h}-transition`, j = "click", ae = "dblclick", oe = "dragstart", se = "focusin", ce = "keydown", M = "load", N = "error", le = p ? "touchend touchcancel" : "mouseup", ue = p ? "touchmove" : "mousemove", de = m ? "pointerdown" : p ? "touchstart" : "mousedown", fe = m ? "pointermove" : ue, pe = m ? "pointerup pointercancel" : le, me = "resize", P = "transitionend", he = "wheel", ge = "ready", _e = "show", ve = "shown", ye = "hide", be = "hidden", xe = "view", F = "viewed", Se = "move", Ce = "moved", we = "rotate", Te = "rotated", Ee = "scale", De = "scaled", Oe = "zoom", ke = "zoomed", Ae = "play", je = "stop", Me = `${h}Action`, Ne = /\s\s*/, I = [
139
+ "zoom-in",
140
+ "zoom-out",
141
+ "one-to-one",
142
+ "reset",
143
+ "prev",
144
+ "play",
145
+ "next",
146
+ "rotate-left",
147
+ "rotate-right",
148
+ "flip-horizontal",
149
+ "flip-vertical"
150
+ ];
151
+ function L(e) {
152
+ return typeof e == "string";
153
+ }
154
+ var Pe = Number.isNaN || f.isNaN;
155
+ function R(e) {
156
+ return typeof e == "number" && !Pe(e);
157
+ }
158
+ function z(e) {
159
+ return e === void 0;
160
+ }
161
+ function B(e) {
162
+ return c(e) === "object" && e !== null;
163
+ }
164
+ var Fe = Object.prototype.hasOwnProperty;
165
+ function V(e) {
166
+ if (!B(e)) return !1;
167
+ try {
168
+ var t = e.constructor, n = t.prototype;
169
+ return t && n && Fe.call(n, "isPrototypeOf");
170
+ } catch (e) {
171
+ return !1;
172
+ }
173
+ }
174
+ function H(e) {
175
+ return typeof e == "function";
176
+ }
177
+ function U(e, t) {
178
+ if (e && H(t)) if (Array.isArray(e) || R(e.length)) {
179
+ var n = e.length, r;
180
+ for (r = 0; r < n && t.call(e, e[r], r, e) !== !1; r += 1);
181
+ } else B(e) && Object.keys(e).forEach(function(n) {
182
+ t.call(e, e[n], n, e);
183
+ });
184
+ return e;
185
+ }
186
+ var W = Object.assign || function(e) {
187
+ var t = [...arguments].slice(1);
188
+ return B(e) && t.length > 0 && t.forEach(function(t) {
189
+ B(t) && Object.keys(t).forEach(function(n) {
190
+ e[n] = t[n];
191
+ });
192
+ }), e;
193
+ }, Ie = /^(?:width|height|left|top|marginLeft|marginTop)$/;
194
+ function G(e, t) {
195
+ var n = e.style;
196
+ U(t, function(e, t) {
197
+ Ie.test(t) && R(e) && (e += "px"), n[t] = e;
198
+ });
199
+ }
200
+ function Le(e) {
201
+ return L(e) ? e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : e;
202
+ }
203
+ function K(e, t) {
204
+ return !e || !t ? !1 : e.classList ? e.classList.contains(t) : e.className.indexOf(t) > -1;
205
+ }
206
+ function q(e, t) {
207
+ if (!(!e || !t)) {
208
+ if (R(e.length)) {
209
+ U(e, function(e) {
210
+ q(e, t);
211
+ });
212
+ return;
213
+ }
214
+ if (e.classList) {
215
+ e.classList.add(t);
216
+ return;
217
+ }
218
+ var n = e.className.trim();
219
+ n ? n.indexOf(t) < 0 && (e.className = `${n} ${t}`) : e.className = t;
220
+ }
221
+ }
222
+ function J(e, t) {
223
+ if (!(!e || !t)) {
224
+ if (R(e.length)) {
225
+ U(e, function(e) {
226
+ J(e, t);
227
+ });
228
+ return;
229
+ }
230
+ if (e.classList) {
231
+ e.classList.remove(t);
232
+ return;
233
+ }
234
+ e.className.indexOf(t) >= 0 && (e.className = e.className.replace(t, ""));
235
+ }
236
+ }
237
+ function Re(e, t, n) {
238
+ if (t) {
239
+ if (R(e.length)) {
240
+ U(e, function(e) {
241
+ Re(e, t, n);
242
+ });
243
+ return;
244
+ }
245
+ n ? q(e, t) : J(e, t);
246
+ }
247
+ }
248
+ var ze = /([a-z\d])([A-Z])/g;
249
+ function Be(e) {
250
+ return e.replace(ze, "$1-$2").toLowerCase();
251
+ }
252
+ function Y(e, t) {
253
+ return B(e[t]) ? e[t] : e.dataset ? e.dataset[t] : e.getAttribute(`data-${Be(t)}`);
254
+ }
255
+ function Ve(e, t, n) {
256
+ B(n) ? e[t] = n : e.dataset ? e.dataset[t] = n : e.setAttribute(`data-${Be(t)}`, n);
257
+ }
258
+ var He = function() {
259
+ var e = !1;
260
+ if (d) {
261
+ var t = !1, n = function() {}, r = Object.defineProperty({}, "once", {
262
+ get: function() {
263
+ return e = !0, t;
264
+ },
265
+ set: function(e) {
266
+ t = e;
267
+ }
268
+ });
269
+ f.addEventListener("test", n, r), f.removeEventListener("test", n, r);
270
+ }
271
+ return e;
272
+ }();
273
+ function X(e, t, n) {
274
+ var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, i = n;
275
+ t.trim().split(Ne).forEach(function(t) {
276
+ if (!He) {
277
+ var a = e.listeners;
278
+ 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);
279
+ }
280
+ e.removeEventListener(t, i, r);
281
+ });
282
+ }
283
+ function Z(e, t, n) {
284
+ var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, i = n;
285
+ t.trim().split(Ne).forEach(function(t) {
286
+ if (r.once && !He) {
287
+ var a = e.listeners, o = a === void 0 ? {} : a;
288
+ i = function() {
289
+ delete o[t][n], e.removeEventListener(t, i, r);
290
+ var a = [...arguments];
291
+ n.apply(e, a);
292
+ }, o[t] || (o[t] = {}), o[t][n] && e.removeEventListener(t, o[t][n], r), o[t][n] = i, e.listeners = o;
293
+ }
294
+ e.addEventListener(t, i, r);
295
+ });
296
+ }
297
+ function Q(e, t, n, r) {
298
+ var i;
299
+ return H(Event) && H(CustomEvent) ? i = new CustomEvent(t, a({
300
+ bubbles: !0,
301
+ cancelable: !0,
302
+ detail: n
303
+ }, r)) : (i = document.createEvent("CustomEvent"), i.initCustomEvent(t, !0, !0, n)), e.dispatchEvent(i);
304
+ }
305
+ function Ue(e) {
306
+ var t = e.getBoundingClientRect();
307
+ return {
308
+ left: t.left + (window.pageXOffset - document.documentElement.clientLeft),
309
+ top: t.top + (window.pageYOffset - document.documentElement.clientTop)
310
+ };
311
+ }
312
+ function We(e) {
313
+ var t = e.rotate, n = e.scaleX, r = e.scaleY, i = e.translateX, a = e.translateY, o = [];
314
+ R(i) && i !== 0 && o.push(`translateX(${i}px)`), R(a) && a !== 0 && o.push(`translateY(${a}px)`), R(t) && t !== 0 && o.push(`rotate(${t}deg)`), R(n) && n !== 1 && o.push(`scaleX(${n})`), R(r) && r !== 1 && o.push(`scaleY(${r})`);
315
+ var s = o.length ? o.join(" ") : "none";
316
+ return {
317
+ WebkitTransform: s,
318
+ msTransform: s,
319
+ transform: s
320
+ };
321
+ }
322
+ function Ge(e) {
323
+ return L(e) ? decodeURIComponent(e.replace(/^.*\//, "").replace(/[?&#].*$/, "")) : "";
324
+ }
325
+ var Ke = f.navigator && /Version\/\d+(\.\d+)+?\s+Safari/i.test(f.navigator.userAgent);
326
+ function qe(e, t, n) {
327
+ var r = document.createElement("img");
328
+ if (e.naturalWidth && !Ke) return n(e.naturalWidth, e.naturalHeight), r;
329
+ var i = document.body || document.documentElement;
330
+ return r.onload = function() {
331
+ n(r.width, r.height), Ke || i.removeChild(r);
332
+ }, U(t.inheritedAttributes, function(t) {
333
+ var n = e.getAttribute(t);
334
+ n !== null && r.setAttribute(t, n);
335
+ }), 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;
336
+ }
337
+ function Je(e) {
338
+ switch (e) {
339
+ case 2: return w;
340
+ case 3: return re;
341
+ case 4: return ne;
342
+ default: return "";
343
+ }
344
+ }
345
+ function Ye(e) {
346
+ var t = a({}, e), n = [];
347
+ return U(e, function(e, r) {
348
+ delete t[r], U(t, function(t) {
349
+ 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;
350
+ n.push(c);
351
+ });
352
+ }), n.sort(function(e, t) {
353
+ return Math.abs(e) < Math.abs(t);
354
+ }), n[0];
355
+ }
356
+ function Xe(e, t) {
357
+ var n = e.pageX, r = e.pageY, i = {
358
+ endX: n,
359
+ endY: r
360
+ };
361
+ return t ? i : a({
362
+ timeStamp: Date.now(),
363
+ startX: n,
364
+ startY: r
365
+ }, i);
366
+ }
367
+ function Ze(e) {
368
+ var t = 0, n = 0, r = 0;
369
+ return U(e, function(e) {
370
+ var i = e.startX, a = e.startY;
371
+ t += i, n += a, r += 1;
372
+ }), t /= r, n /= r, {
373
+ pageX: t,
374
+ pageY: n
375
+ };
376
+ }
377
+ var Qe = {
378
+ render: function() {
379
+ this.initContainer(), this.initViewer(), this.initList(), this.renderViewer();
380
+ },
381
+ initBody: function() {
382
+ var e = this.element.ownerDocument, t = e.body || e.documentElement;
383
+ this.body = t, this.scrollbarWidth = window.innerWidth - e.documentElement.clientWidth, this.initialBodyPaddingRight = t.style.paddingRight, this.initialBodyComputedPaddingRight = window.getComputedStyle(t).paddingRight;
384
+ },
385
+ initContainer: function() {
386
+ this.containerData = {
387
+ width: window.innerWidth,
388
+ height: window.innerHeight
389
+ };
390
+ },
391
+ initViewer: function() {
392
+ var e = this.options, t = this.parent, n;
393
+ e.inline && (n = {
394
+ width: Math.max(t.offsetWidth, e.minWidth),
395
+ height: Math.max(t.offsetHeight, e.minHeight)
396
+ }, this.parentData = n), (this.fulled || !n) && (n = this.containerData), this.viewerData = W({}, n);
397
+ },
398
+ renderViewer: function() {
399
+ this.options.inline && !this.fulled && G(this.viewer, this.viewerData);
400
+ },
401
+ initList: function() {
402
+ var e = this, t = this.element, n = this.options, r = this.list, i = [];
403
+ r.innerHTML = "", U(this.images, function(t, a) {
404
+ var o = t.src, s = t.alt || Ge(o), c = e.getImageURL(t);
405
+ if (o || c) {
406
+ var l = document.createElement("li"), u = document.createElement("img");
407
+ U(n.inheritedAttributes, function(e) {
408
+ var n = t.getAttribute(e);
409
+ n !== null && u.setAttribute(e, n);
410
+ }), 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);
411
+ }
412
+ }), this.items = i, U(i, function(t) {
413
+ var r = t.firstElementChild, i, a;
414
+ Ve(r, "filled", !0), n.loading && q(t, D), Z(r, M, i = function(i) {
415
+ X(r, N, a), n.loading && J(t, D), e.loadImage(i);
416
+ }, { once: !0 }), Z(r, N, a = function() {
417
+ X(r, M, i), n.loading && J(t, D);
418
+ }, { once: !0 });
419
+ }), n.transition && Z(t, F, function() {
420
+ q(r, A);
421
+ }, { once: !0 });
422
+ },
423
+ renderList: function() {
424
+ var e = this.index, t = this.items[e];
425
+ if (t) {
426
+ var n = t.nextElementSibling, r = parseInt(window.getComputedStyle(n || t).marginLeft, 10), i = t.offsetWidth, a = i + r;
427
+ G(this.list, W({ width: a * this.length - r }, We({ translateX: (this.viewerData.width - i) / 2 - a * e })));
428
+ }
429
+ },
430
+ resetList: function() {
431
+ var e = this.list;
432
+ e.innerHTML = "", J(e, A), G(e, We({ translateX: 0 }));
433
+ },
434
+ initImage: function(e) {
435
+ 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;
436
+ this.imageInitializing = { abort: function() {
437
+ l.onload = null;
438
+ } }, l = qe(r, n, function(r, i) {
439
+ var a = r / i, l = Math.max(0, Math.min(1, n.initialCoverage)), u = o, d = s;
440
+ t.imageInitializing = !1, s * a > o ? d = o / a : u = s * a, l = R(l) ? l : .9, u = Math.min(u * l, r), d = Math.min(d * l, i);
441
+ var f = (o - u) / 2, p = (s - d) / 2, m = {
442
+ left: f,
443
+ top: p,
444
+ x: f,
445
+ y: p,
446
+ width: u,
447
+ height: d,
448
+ oldRatio: 1,
449
+ ratio: u / r,
450
+ aspectRatio: a,
451
+ naturalWidth: r,
452
+ naturalHeight: i
453
+ }, h = W({}, m);
454
+ 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();
455
+ });
456
+ },
457
+ renderImage: function(e) {
458
+ var t = this, n = this.image, r = this.imageData;
459
+ if (G(n, W({
460
+ width: r.width,
461
+ height: r.height,
462
+ marginLeft: r.x,
463
+ marginTop: r.y
464
+ }, We(r))), e) if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && K(n, A)) {
465
+ var i = function() {
466
+ t.imageRendering = !1, e();
467
+ };
468
+ this.imageRendering = { abort: function() {
469
+ X(n, P, i);
470
+ } }, Z(n, P, i, { once: !0 });
471
+ } else e();
472
+ },
473
+ resetImage: function() {
474
+ var e = this.image;
475
+ e && (this.viewing && this.viewing.abort(), e.parentNode.removeChild(e), this.image = null, this.title.innerHTML = "");
476
+ }
477
+ }, $e = {
478
+ bind: function() {
479
+ var e = this.options, t = this.viewer, n = this.canvas, r = this.element.ownerDocument;
480
+ Z(t, j, this.onClick = this.click.bind(this)), Z(t, oe, this.onDragStart = this.dragstart.bind(this)), Z(n, de, this.onPointerDown = this.pointerdown.bind(this)), Z(r, fe, this.onPointerMove = this.pointermove.bind(this)), Z(r, pe, this.onPointerUp = this.pointerup.bind(this)), Z(r, ce, this.onKeyDown = this.keydown.bind(this)), Z(window, me, this.onResize = this.resize.bind(this)), e.zoomable && e.zoomOnWheel && Z(t, he, this.onWheel = this.wheel.bind(this), {
481
+ passive: !1,
482
+ capture: !0
483
+ }), e.toggleOnDblclick && Z(n, ae, this.onDblclick = this.dblclick.bind(this));
484
+ },
485
+ unbind: function() {
486
+ var e = this.options, t = this.viewer, n = this.canvas, r = this.element.ownerDocument;
487
+ X(t, j, this.onClick), X(t, oe, this.onDragStart), X(n, de, this.onPointerDown), X(r, fe, this.onPointerMove), X(r, pe, this.onPointerUp), X(r, ce, this.onKeyDown), X(window, me, this.onResize), e.zoomable && e.zoomOnWheel && X(t, he, this.onWheel, {
488
+ passive: !1,
489
+ capture: !0
490
+ }), e.toggleOnDblclick && X(n, ae, this.onDblclick);
491
+ }
492
+ }, et = {
493
+ click: function(e) {
494
+ var t = this.options, n = this.imageData, r = e.target, i = Y(r, Me);
495
+ switch (!i && r.localName === "img" && r.parentElement.localName === "li" && (r = r.parentElement, i = Y(r, Me)), p && e.isTrusted && r === this.canvas && clearTimeout(this.clickCanvasTimeout), i) {
496
+ case "mix":
497
+ this.played ? this.stop() : t.inline ? this.fulled ? this.exit() : this.full() : this.hide();
498
+ break;
499
+ case "hide":
500
+ this.pointerMoved || this.hide();
501
+ break;
502
+ case "view":
503
+ this.view(Y(r, "index"));
504
+ break;
505
+ case "zoom-in":
506
+ this.zoom(.1, !0);
507
+ break;
508
+ case "zoom-out":
509
+ this.zoom(-.1, !0);
510
+ break;
511
+ case "one-to-one":
512
+ this.toggle();
513
+ break;
514
+ case "reset":
515
+ this.reset();
516
+ break;
517
+ case "prev":
518
+ this.prev(t.loop);
519
+ break;
520
+ case "play":
521
+ this.play(t.fullscreen);
522
+ break;
523
+ case "next":
524
+ this.next(t.loop);
525
+ break;
526
+ case "rotate-left":
527
+ this.rotate(-90);
528
+ break;
529
+ case "rotate-right":
530
+ this.rotate(90);
531
+ break;
532
+ case "flip-horizontal":
533
+ this.scaleX(-n.scaleX || -1);
534
+ break;
535
+ case "flip-vertical":
536
+ this.scaleY(-n.scaleY || -1);
537
+ break;
538
+ default: this.played && this.stop();
539
+ }
540
+ },
541
+ dblclick: function(e) {
542
+ e.preventDefault(), this.viewed && e.target === this.image && (p && e.isTrusted && clearTimeout(this.doubleClickImageTimeout), this.toggle(e.isTrusted ? e : e.detail && e.detail.originalEvent));
543
+ },
544
+ load: function() {
545
+ var e = this;
546
+ this.timeout && (clearTimeout(this.timeout), this.timeout = !1);
547
+ var t = this.element, n = this.options, r = this.image, i = this.index, a = this.viewerData;
548
+ J(r, E), n.loading && J(this.canvas, D), 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() {
549
+ Re(r, O, n.movable), Re(r, A, n.transition), e.renderImage(function() {
550
+ e.viewed = !0, e.viewing = !1, H(n.viewed) && Z(t, F, n.viewed, { once: !0 }), Q(t, F, {
551
+ originalImage: e.images[i],
552
+ index: i,
553
+ image: r
554
+ }, { cancelable: !1 });
555
+ });
556
+ });
557
+ },
558
+ loadImage: function(e) {
559
+ var t = e.target, n = t.parentNode, r = n.offsetWidth || 30, i = n.offsetHeight || 50, a = !!Y(t, "filled");
560
+ qe(t, this.options, function(e, n) {
561
+ var o = e / n, s = r, c = i;
562
+ i * o > r ? a ? s = i * o : c = r / o : a ? c = r / o : s = i * o, G(t, W({
563
+ width: s,
564
+ height: c
565
+ }, We({
566
+ translateX: (r - s) / 2,
567
+ translateY: (i - c) / 2
568
+ })));
569
+ });
570
+ },
571
+ keydown: function(e) {
572
+ var t = this.options;
573
+ if (t.keyboard) {
574
+ var n = e.keyCode || e.which || e.charCode;
575
+ switch (n) {
576
+ case 13:
577
+ this.viewer.contains(e.target) && this.click(e);
578
+ break;
579
+ }
580
+ if (this.fulled) switch (n) {
581
+ case 27:
582
+ this.played ? this.stop() : t.inline ? this.fulled && this.exit() : this.hide();
583
+ break;
584
+ case 32:
585
+ this.played && this.stop();
586
+ break;
587
+ case 37:
588
+ this.played && this.playing ? this.playing.prev() : this.prev(t.loop);
589
+ break;
590
+ case 38:
591
+ e.preventDefault(), this.zoom(t.zoomRatio, !0);
592
+ break;
593
+ case 39:
594
+ this.played && this.playing ? this.playing.next() : this.next(t.loop);
595
+ break;
596
+ case 40:
597
+ e.preventDefault(), this.zoom(-t.zoomRatio, !0);
598
+ break;
599
+ case 48:
600
+ case 49:
601
+ e.ctrlKey && (e.preventDefault(), this.toggle());
602
+ break;
603
+ }
604
+ }
605
+ },
606
+ dragstart: function(e) {
607
+ e.target.localName === "img" && e.preventDefault();
608
+ },
609
+ pointerdown: function(e) {
610
+ var t = this.options, n = this.pointers, r = e.buttons, i = e.button;
611
+ if (this.pointerMoved = !1, !(!this.viewed || this.showing || this.viewing || this.hiding || (e.type === "mousedown" || e.type === "pointerdown" && e.pointerType === "mouse") && (R(r) && r !== 1 || R(i) && i !== 0 || e.ctrlKey))) {
612
+ e.preventDefault(), e.changedTouches ? U(e.changedTouches, function(e) {
613
+ n[e.identifier] = Xe(e);
614
+ }) : n[e.pointerId || 0] = Xe(e);
615
+ var a = t.movable ? g : !1;
616
+ 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) && J(this.image, A), this.action = a;
617
+ }
618
+ },
619
+ pointermove: function(e) {
620
+ var t = this.pointers, n = this.action;
621
+ !this.viewed || !n || (e.preventDefault(), e.changedTouches ? U(e.changedTouches, function(e) {
622
+ W(t[e.identifier] || {}, Xe(e, !0));
623
+ }) : W(t[e.pointerId || 0] || {}, Xe(e, !0)), this.change(e));
624
+ },
625
+ pointerup: function(e) {
626
+ var t = this, n = this.options, r = this.action, i = this.pointers, a;
627
+ e.changedTouches ? U(e.changedTouches, function(e) {
628
+ a = i[e.identifier], delete i[e.identifier];
629
+ }) : (a = i[e.pointerId || 0], delete i[e.pointerId || 0]), r && (e.preventDefault(), n.transition && (r === g || r === v) && q(this.image, A), 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() {
630
+ Q(t.image, ae, { originalEvent: e });
631
+ }, 50)) : (this.imageClicked = !0, this.doubleClickImageTimeout = setTimeout(function() {
632
+ t.imageClicked = !1;
633
+ }, 500)) : (this.imageClicked = !1, n.backdrop && n.backdrop !== "static" && e.target === this.canvas && (this.clickCanvasTimeout = setTimeout(function() {
634
+ Q(t.canvas, j, { originalEvent: e });
635
+ }, 50)))));
636
+ },
637
+ resize: function() {
638
+ var e = this;
639
+ 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() {
640
+ e.renderImage();
641
+ }), this.played)) {
642
+ if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
643
+ this.stop();
644
+ return;
645
+ }
646
+ U(this.player.getElementsByTagName("img"), function(t) {
647
+ Z(t, M, e.loadImage.bind(e), { once: !0 }), Q(t, M);
648
+ });
649
+ }
650
+ },
651
+ wheel: function(e) {
652
+ var t = this;
653
+ if (this.viewed && (e.preventDefault(), !this.wheeling)) {
654
+ this.wheeling = !0, setTimeout(function() {
655
+ t.wheeling = !1;
656
+ }, 50);
657
+ var n = Number(this.options.zoomRatio) || .1, r = 1;
658
+ 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);
659
+ }
660
+ }
661
+ }, tt = {
662
+ show: function() {
663
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.element, n = this.options;
664
+ if (n.inline || this.showing || this.isShown || this.showing) return this;
665
+ if (!this.ready) return this.build(), this.ready && this.show(e), this;
666
+ if (H(n.show) && Z(t, _e, n.show, { once: !0 }), Q(t, _e) === !1 || !this.ready) return this;
667
+ this.hiding && this.transitioning.abort(), this.showing = !0, this.open();
668
+ var r = this.viewer;
669
+ if (J(r, C), r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", this.title.id), r.setAttribute("aria-modal", !0), r.removeAttribute("aria-hidden"), n.transition && !e) {
670
+ var i = this.shown.bind(this);
671
+ this.transitioning = { abort: function() {
672
+ X(r, P, i), J(r, T);
673
+ } }, q(r, A), r.initialOffsetWidth = r.offsetWidth, Z(r, P, i, { once: !0 }), q(r, T);
674
+ } else q(r, T), this.shown();
675
+ return this;
676
+ },
677
+ hide: function() {
678
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, n = this.element, r = this.options;
679
+ if (r.inline || this.hiding || !(this.isShown || this.showing) || (H(r.hide) && Z(n, ye, r.hide, { once: !0 }), Q(n, ye) === !1)) return this;
680
+ this.showing && this.transitioning.abort(), this.hiding = !0, this.played ? this.stop() : this.viewing && this.viewing.abort();
681
+ var i = this.viewer, a = this.image, o = function() {
682
+ J(i, T), e.hidden();
683
+ };
684
+ if (r.transition && !t) {
685
+ var s = function(t) {
686
+ t && t.target === i && (X(i, P, s), e.hidden());
687
+ }, c = function() {
688
+ K(i, A) ? (Z(i, P, s), J(i, T)) : o();
689
+ };
690
+ this.transitioning = { abort: function() {
691
+ e.viewed && K(a, A) ? X(a, P, c) : K(i, A) && X(i, P, s);
692
+ } }, this.viewed && K(a, A) ? (Z(a, P, c, { once: !0 }), this.zoomTo(0, !1, null, null, !0)) : c();
693
+ } else o();
694
+ return this;
695
+ },
696
+ view: function() {
697
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.initialViewIndex;
698
+ if (t = Number(t) || 0, this.hiding || this.played || t < 0 || t >= this.length || this.viewed && t === this.index) return this;
699
+ if (!this.isShown) return this.index = t, this.show();
700
+ this.viewing && this.viewing.abort();
701
+ 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");
702
+ if (U(r.inheritedAttributes, function(e) {
703
+ var t = s.getAttribute(e);
704
+ t !== null && u.setAttribute(e, t);
705
+ }), u.src = c, u.alt = l, H(r.view) && Z(n, xe, r.view, { once: !0 }), Q(n, xe, {
706
+ originalImage: this.images[t],
707
+ index: t,
708
+ image: u
709
+ }) === !1 || !this.isShown || this.hiding || this.played) return this;
710
+ var d = this.items[this.index];
711
+ d && (J(d, y), d.removeAttribute("aria-selected")), q(o, y), o.setAttribute("aria-selected", !0), r.focus && o.focus(), this.image = u, this.viewed = !1, this.index = t, this.imageData = {}, q(u, E), r.loading && q(a, D), a.innerHTML = "", a.appendChild(u), this.renderList(), i.innerHTML = "";
712
+ var f = function() {
713
+ var t = e.imageData, n = Array.isArray(r.title) ? r.title[1] : r.title;
714
+ i.innerHTML = Le(H(n) ? n.call(e, u, t) : `${l} (${t.naturalWidth} × ${t.naturalHeight})`);
715
+ }, p, m;
716
+ return Z(n, F, f, { once: !0 }), this.viewing = { abort: function() {
717
+ X(n, F, f), u.complete ? e.imageRendering ? e.imageRendering.abort() : e.imageInitializing && e.imageInitializing.abort() : (u.src = "", X(u, M, p), e.timeout && clearTimeout(e.timeout));
718
+ } }, u.complete ? this.load() : (Z(u, M, p = function() {
719
+ X(u, N, m), e.load();
720
+ }, { once: !0 }), Z(u, N, m = function() {
721
+ X(u, M, p), e.timeout && (clearTimeout(e.timeout), e.timeout = !1), J(u, E), r.loading && J(e.canvas, D);
722
+ }, { once: !0 }), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(function() {
723
+ J(u, E), e.timeout = !1;
724
+ }, 1e3)), this;
725
+ },
726
+ prev: function() {
727
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.index - 1;
728
+ return t < 0 && (t = e ? this.length - 1 : 0), this.view(t), this;
729
+ },
730
+ next: function() {
731
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.length - 1, n = this.index + 1;
732
+ return n > t && (n = e ? 0 : t), this.view(n), this;
733
+ },
734
+ move: function(e) {
735
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = this.imageData;
736
+ return this.moveTo(z(e) ? e : n.x + Number(e), z(t) ? t : n.y + Number(t)), this;
737
+ },
738
+ moveTo: function(e) {
739
+ 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;
740
+ if (e = Number(e), n = Number(n), this.viewed && !this.played && a.movable) {
741
+ var s = o.x, c = o.y, l = !1;
742
+ if (R(e) ? l = !0 : e = s, R(n) ? l = !0 : n = c, l) {
743
+ if (H(a.move) && Z(i, Se, a.move, { once: !0 }), Q(i, Se, {
744
+ x: e,
745
+ y: n,
746
+ oldX: s,
747
+ oldY: c,
748
+ originalEvent: r
749
+ }) === !1) return this;
750
+ o.x = e, o.y = n, o.left = e, o.top = n, this.moving = !0, this.renderImage(function() {
751
+ t.moving = !1, H(a.moved) && Z(i, Ce, a.moved, { once: !0 }), Q(i, Ce, {
752
+ x: e,
753
+ y: n,
754
+ oldX: s,
755
+ oldY: c,
756
+ originalEvent: r
757
+ }, { cancelable: !1 });
758
+ });
759
+ }
760
+ }
761
+ return this;
762
+ },
763
+ rotate: function(e) {
764
+ return this.rotateTo((this.imageData.rotate || 0) + Number(e)), this;
765
+ },
766
+ rotateTo: function(e) {
767
+ var t = this, n = this.element, r = this.options, i = this.imageData;
768
+ if (e = Number(e), R(e) && this.viewed && !this.played && r.rotatable) {
769
+ var a = i.rotate;
770
+ if (H(r.rotate) && Z(n, we, r.rotate, { once: !0 }), Q(n, we, {
771
+ degree: e,
772
+ oldDegree: a
773
+ }) === !1) return this;
774
+ i.rotate = e, this.rotating = !0, this.renderImage(function() {
775
+ t.rotating = !1, H(r.rotated) && Z(n, Te, r.rotated, { once: !0 }), Q(n, Te, {
776
+ degree: e,
777
+ oldDegree: a
778
+ }, { cancelable: !1 });
779
+ });
780
+ }
781
+ return this;
782
+ },
783
+ scaleX: function(e) {
784
+ return this.scale(e, this.imageData.scaleY), this;
785
+ },
786
+ scaleY: function(e) {
787
+ return this.scale(this.imageData.scaleX, e), this;
788
+ },
789
+ scale: function(e) {
790
+ var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, r = this.element, i = this.options, a = this.imageData;
791
+ if (e = Number(e), n = Number(n), this.viewed && !this.played && i.scalable) {
792
+ var o = a.scaleX, s = a.scaleY, c = !1;
793
+ if (R(e) ? c = !0 : e = o, R(n) ? c = !0 : n = s, c) {
794
+ if (H(i.scale) && Z(r, Ee, i.scale, { once: !0 }), Q(r, Ee, {
795
+ scaleX: e,
796
+ scaleY: n,
797
+ oldScaleX: o,
798
+ oldScaleY: s
799
+ }) === !1) return this;
800
+ a.scaleX = e, a.scaleY = n, this.scaling = !0, this.renderImage(function() {
801
+ t.scaling = !1, H(i.scaled) && Z(r, De, i.scaled, { once: !0 }), Q(r, De, {
802
+ scaleX: e,
803
+ scaleY: n,
804
+ oldScaleX: o,
805
+ oldScaleY: s
806
+ }, { cancelable: !1 });
807
+ });
808
+ }
809
+ }
810
+ return this;
811
+ },
812
+ zoom: function(e) {
813
+ 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;
814
+ return e = Number(e), e = e < 0 ? 1 / (1 - e) : 1 + e, this.zoomTo(i.width * e / i.naturalWidth, t, n, r), this;
815
+ },
816
+ zoomTo: function(e) {
817
+ 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;
818
+ if (e = Math.max(0, e), R(e) && this.viewed && !this.played && (a || s.zoomable)) {
819
+ if (!a) {
820
+ var g = Math.max(.01, s.minZoomRatio), _ = Math.min(100, s.maxZoomRatio);
821
+ e = Math.min(Math.max(e, g), _);
822
+ }
823
+ if (i) switch (i.type) {
824
+ case "wheel":
825
+ s.zoomRatio >= .055 && e > .95 && e < 1.05 && (e = 1);
826
+ break;
827
+ case "pointermove":
828
+ case "touchmove":
829
+ case "mousemove":
830
+ e > .99 && e < 1.01 && (e = 1);
831
+ break;
832
+ }
833
+ var v = m * e, y = h * e, b = v - f, x = y - p, S = l.ratio;
834
+ if (H(s.zoom) && Z(o, Oe, s.zoom, { once: !0 }), Q(o, Oe, {
835
+ ratio: e,
836
+ oldRatio: S,
837
+ originalEvent: i
838
+ }) === !1) return this;
839
+ if (this.zooming = !0, i) {
840
+ var ee = Ue(this.viewer), te = c && Object.keys(c).length > 0 ? Ze(c) : {
841
+ pageX: i.pageX,
842
+ pageY: i.pageY
843
+ };
844
+ l.x -= b * ((te.pageX - ee.left - u) / f), l.y -= x * ((te.pageY - ee.top - d) / p);
845
+ } else V(r) && R(r.x) && R(r.y) ? (l.x -= b * ((r.x - u) / f), l.y -= x * ((r.y - d) / p)) : (l.x -= b / 2, l.y -= x / 2);
846
+ l.left = l.x, l.top = l.y, l.width = v, l.height = y, l.oldRatio = S, l.ratio = e, this.renderImage(function() {
847
+ t.zooming = !1, H(s.zoomed) && Z(o, ke, s.zoomed, { once: !0 }), Q(o, ke, {
848
+ ratio: e,
849
+ oldRatio: S,
850
+ originalEvent: i
851
+ }, { cancelable: !1 });
852
+ }), n && this.tooltip();
853
+ }
854
+ return this;
855
+ },
856
+ play: function() {
857
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
858
+ if (!this.isShown || this.played) return this;
859
+ var n = this.element, r = this.options;
860
+ if (H(r.play) && Z(n, Ae, r.play, { once: !0 }), Q(n, Ae) === !1) return this;
861
+ var i = this.player, a = this.loadImage.bind(this), o = [], s = 0, c = 0;
862
+ if (this.played = !0, this.onLoadWhenPlay = a, t && this.requestFullscreen(t), q(i, k), U(this.items, function(e, t) {
863
+ var n = e.querySelector("img"), l = document.createElement("img");
864
+ l.src = Y(n, "originalUrl"), l.alt = n.getAttribute("alt"), l.referrerPolicy = n.referrerPolicy, s += 1, q(l, x), Re(l, A, r.transition), K(e, y) && (q(l, T), c = t), o.push(l), Z(l, M, a, { once: !0 }), i.appendChild(l);
865
+ }), R(r.interval) && r.interval > 0) {
866
+ var l = function() {
867
+ clearTimeout(e.playing.timeout), J(o[c], T), --c, c = c >= 0 ? c : s - 1, q(o[c], T), e.playing.timeout = setTimeout(l, r.interval);
868
+ }, u = function() {
869
+ clearTimeout(e.playing.timeout), J(o[c], T), c += 1, c = c < s ? c : 0, q(o[c], T), e.playing.timeout = setTimeout(u, r.interval);
870
+ };
871
+ s > 1 && (this.playing = {
872
+ prev: l,
873
+ next: u,
874
+ timeout: setTimeout(u, r.interval)
875
+ });
876
+ }
877
+ return this;
878
+ },
879
+ stop: function() {
880
+ var e = this;
881
+ if (!this.played) return this;
882
+ var t = this.element, n = this.options;
883
+ if (H(n.stop) && Z(t, je, n.stop, { once: !0 }), Q(t, je) === !1) return this;
884
+ var r = this.player;
885
+ return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, U(r.getElementsByTagName("img"), function(t) {
886
+ X(t, M, e.onLoadWhenPlay);
887
+ }), J(r, k), r.innerHTML = "", this.exitFullscreen(), this;
888
+ },
889
+ full: function() {
890
+ var e = this, t = this.options, n = this.viewer, r = this.image, i = this.list;
891
+ return !this.isShown || this.played || this.fulled || !t.inline ? this : (this.fulled = !0, this.open(), q(this.button, te), t.transition && (J(i, A), this.viewed && J(r, A)), q(n, S), n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", this.title.id), n.setAttribute("aria-modal", !0), n.removeAttribute("style"), G(n, { zIndex: t.zIndex }), t.focus && this.enforceFocus(), this.initContainer(), this.viewerData = W({}, this.containerData), this.renderList(), this.viewed && this.initImage(function() {
892
+ e.renderImage(function() {
893
+ t.transition && setTimeout(function() {
894
+ q(r, A), q(i, A);
895
+ }, 0);
896
+ });
897
+ }), this);
898
+ },
899
+ exit: function() {
900
+ var e = this, t = this.options, n = this.viewer, r = this.image, i = this.list;
901
+ return !this.isShown || this.played || !this.fulled || !t.inline ? this : (this.fulled = !1, this.close(), J(this.button, te), t.transition && (J(i, A), this.viewed && J(r, A)), t.focus && this.clearEnforceFocus(), n.removeAttribute("role"), n.removeAttribute("aria-labelledby"), n.removeAttribute("aria-modal"), J(n, S), G(n, { zIndex: t.zIndexInline }), this.viewerData = W({}, this.parentData), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
902
+ e.renderImage(function() {
903
+ t.transition && setTimeout(function() {
904
+ q(r, A), q(i, A);
905
+ }, 0);
906
+ });
907
+ }), this);
908
+ },
909
+ tooltip: function() {
910
+ var e = this, t = this.options, n = this.tooltipBox, r = this.imageData;
911
+ 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, P), q(n, k), q(n, x), q(n, A), n.removeAttribute("aria-hidden"), n.initialOffsetWidth = n.offsetWidth, q(n, T)) : (q(n, k), n.removeAttribute("aria-hidden")), this.tooltipping = setTimeout(function() {
912
+ t.transition ? (Z(n, P, function() {
913
+ J(n, k), J(n, x), J(n, A), n.setAttribute("aria-hidden", !0), e.fading = !1;
914
+ }, { once: !0 }), J(n, T), e.fading = !0) : (J(n, k), n.setAttribute("aria-hidden", !0)), e.tooltipping = !1;
915
+ }, 1e3), this);
916
+ },
917
+ toggle: function() {
918
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
919
+ return this.imageData.ratio === 1 ? this.zoomTo(this.imageData.oldRatio, !0, null, e) : this.zoomTo(1, !0, null, e), this;
920
+ },
921
+ reset: function() {
922
+ return this.viewed && !this.played && (this.imageData = W({}, this.initialImageData), this.renderImage()), this;
923
+ },
924
+ update: function() {
925
+ var e = this, t = this.element, n = this.options, r = this.isImg;
926
+ if (r && !t.parentNode) return this.destroy();
927
+ var i = [];
928
+ if (U(r ? [t] : t.querySelectorAll("img"), function(t) {
929
+ H(n.filter) ? n.filter.call(e, t) && i.push(t) : e.getImageURL(t) && i.push(t);
930
+ }), !i.length) return this;
931
+ if (this.images = i, this.length = i.length, this.ready) {
932
+ var a = [];
933
+ if (U(this.items, function(e, t) {
934
+ var n = e.querySelector("img"), r = i[t];
935
+ r && n ? (r.src !== n.src || r.alt !== n.alt) && a.push(t) : a.push(t);
936
+ }), G(this.list, { width: "auto" }), this.initList(), this.isShown) if (this.length) {
937
+ if (this.viewed) {
938
+ var o = a.indexOf(this.index);
939
+ if (o >= 0) this.viewed = !1, this.view(Math.max(Math.min(this.index - o, this.length - 1), 0));
940
+ else {
941
+ var s = this.items[this.index];
942
+ q(s, y), s.setAttribute("aria-selected", !0);
943
+ }
944
+ }
945
+ } else this.image = null, this.viewed = !1, this.index = 0, this.imageData = {}, this.canvas.innerHTML = "", this.title.innerHTML = "";
946
+ } else this.build();
947
+ return this;
948
+ },
949
+ destroy: function() {
950
+ var e = this.element, t = this.options;
951
+ 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, j, this.onStart), e[h] = void 0, this) : this;
952
+ }
953
+ }, nt = {
954
+ getImageURL: function(e) {
955
+ var t = this.options.url;
956
+ return t = L(t) ? e.getAttribute(t) : H(t) ? t.call(this, e) : "", t;
957
+ },
958
+ enforceFocus: function() {
959
+ var e = this;
960
+ this.clearEnforceFocus(), Z(document, se, this.onFocusin = function(t) {
961
+ var n = e.viewer, r = t.target;
962
+ if (!(r === document || r === n || n.contains(r))) {
963
+ for (; r;) {
964
+ if (r.getAttribute("tabindex") !== null || r.getAttribute("aria-modal") === "true") return;
965
+ r = r.parentElement;
966
+ }
967
+ n.focus();
968
+ }
969
+ });
970
+ },
971
+ clearEnforceFocus: function() {
972
+ this.onFocusin && (X(document, se, this.onFocusin), this.onFocusin = null);
973
+ },
974
+ open: function() {
975
+ var e = this.body;
976
+ q(e, ie), this.scrollbarWidth > 0 && (e.style.paddingRight = `${this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0)}px`);
977
+ },
978
+ close: function() {
979
+ var e = this.body;
980
+ J(e, ie), this.scrollbarWidth > 0 && (e.style.paddingRight = this.initialBodyPaddingRight);
981
+ },
982
+ shown: function() {
983
+ var e = this.element, t = this.options, n = this.viewer;
984
+ this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, t.focus && (n.focus(), this.enforceFocus()), H(t.shown) && Z(e, ve, t.shown, { once: !0 }), Q(e, ve) !== !1 && this.ready && this.isShown && !this.hiding && this.view(this.index);
985
+ },
986
+ hidden: function() {
987
+ var e = this.element, t = this.options, n = this.viewer;
988
+ t.fucus && this.clearEnforceFocus(), this.close(), this.unbind(), q(n, C), 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 || (H(t.hidden) && Z(e, be, t.hidden, { once: !0 }), Q(e, be, null, { cancelable: !1 }));
989
+ },
990
+ requestFullscreen: function(e) {
991
+ var t = this.element.ownerDocument;
992
+ if (this.fulled && !(t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement)) {
993
+ var n = t.documentElement;
994
+ n.requestFullscreen ? V(e) ? n.requestFullscreen(e) : n.requestFullscreen() : n.webkitRequestFullscreen ? n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : n.mozRequestFullScreen ? n.mozRequestFullScreen() : n.msRequestFullscreen && n.msRequestFullscreen();
995
+ }
996
+ },
997
+ exitFullscreen: function() {
998
+ var e = this.element.ownerDocument;
999
+ 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());
1000
+ },
1001
+ change: function(e) {
1002
+ var t = this.options, n = this.pointers, r = n[Object.keys(n)[0]];
1003
+ if (r) {
1004
+ var i = r.endX - r.startX, a = r.endY - r.startY;
1005
+ switch (this.action) {
1006
+ case g:
1007
+ (i !== 0 || a !== 0) && (this.pointerMoved = !0, this.move(i, a, e));
1008
+ break;
1009
+ case v:
1010
+ this.zoom(Ye(n), !1, null, e);
1011
+ break;
1012
+ case _:
1013
+ this.action = "switched";
1014
+ var o = Math.abs(i);
1015
+ o > 1 && o > Math.abs(a) && (this.pointers = {}, i > 1 ? this.prev(t.loop) : i < -1 && this.next(t.loop));
1016
+ break;
1017
+ }
1018
+ U(n, function(e) {
1019
+ e.startX = e.endX, e.startY = e.endY;
1020
+ });
1021
+ }
1022
+ },
1023
+ isSwitchable: function() {
1024
+ var e = this.imageData, t = this.viewerData;
1025
+ return this.length > 1 && e.x >= 0 && e.y >= 0 && e.width <= t.width && e.height <= t.height;
1026
+ }
1027
+ }, rt = f.Viewer, it = function(e) {
1028
+ return function() {
1029
+ return e += 1, e;
1030
+ };
1031
+ }(-1), at = /*#__PURE__*/ function() {
1032
+ function t(n) {
1033
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1034
+ if (e(this, t), !n || n.nodeType !== 1) throw Error("The first argument is required and must be an element.");
1035
+ this.element = n, this.options = W({}, l, V(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();
1036
+ }
1037
+ return n(t, [{
1038
+ key: "init",
1039
+ value: function() {
1040
+ var e = this, t = this.element, n = this.options;
1041
+ if (!t[h]) {
1042
+ t[h] = this, n.focus && !n.keyboard && (n.focus = !1);
1043
+ var r = t.localName === "img", i = [];
1044
+ if (U(r ? [t] : t.querySelectorAll("img"), function(t) {
1045
+ H(n.filter) ? n.filter.call(e, t) && i.push(t) : e.getImageURL(t) && i.push(t);
1046
+ }), this.isImg = r, this.length = i.length, this.images = i, this.initBody(), z(document.createElement(h).style.transition) && (n.transition = !1), n.inline) {
1047
+ var a = 0, o = function() {
1048
+ if (a += 1, a === e.length) {
1049
+ var t;
1050
+ e.initializing = !1, e.delaying = { abort: function() {
1051
+ clearTimeout(t);
1052
+ } }, t = setTimeout(function() {
1053
+ e.delaying = !1, e.build();
1054
+ }, 0);
1055
+ }
1056
+ };
1057
+ this.initializing = { abort: function() {
1058
+ U(i, function(e) {
1059
+ e.complete || (X(e, M, o), X(e, N, o));
1060
+ });
1061
+ } }, U(i, function(e) {
1062
+ if (e.complete) o();
1063
+ else {
1064
+ var t, n;
1065
+ Z(e, M, t = function() {
1066
+ X(e, N, n), o();
1067
+ }, { once: !0 }), Z(e, N, n = function() {
1068
+ X(e, M, t), o();
1069
+ }, { once: !0 });
1070
+ }
1071
+ });
1072
+ } else Z(t, j, this.onStart = function(t) {
1073
+ var r = t.target;
1074
+ r.localName === "img" && (!H(n.filter) || n.filter.call(e, r)) && e.view(e.images.indexOf(r));
1075
+ });
1076
+ }
1077
+ }
1078
+ }, {
1079
+ key: "build",
1080
+ value: function() {
1081
+ if (!this.ready) {
1082
+ var e = this.element, t = this.options, n = e.parentNode, r = document.createElement("div");
1083
+ r.innerHTML = u;
1084
+ 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`);
1085
+ 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}`, q(a, t.title ? Je(Array.isArray(t.title) ? t.title[0] : t.title) : C), q(s, t.navbar ? Je(t.navbar) : C), Re(c, C, !t.button), t.keyboard && c.setAttribute("tabindex", 0), t.backdrop && (q(i, `${h}-backdrop`), !t.inline && t.backdrop !== "static" && Ve(l, Me, "hide")), L(t.className) && t.className && t.className.split(Ne).forEach(function(e) {
1086
+ q(i, e);
1087
+ }), t.toolbar) {
1088
+ var d = document.createElement("ul"), f = V(t.toolbar), p = I.slice(0, 3), m = I.slice(7, 9), g = I.slice(9);
1089
+ f || q(o, Je(t.toolbar)), U(f ? t.toolbar : I, function(e, n) {
1090
+ var r = f && V(e), i = f ? Be(n) : e, a = r && !z(e.show) ? e.show : e;
1091
+ if (!(!a || !t.zoomable && p.indexOf(i) !== -1 || !t.rotatable && m.indexOf(i) !== -1 || !t.scalable && g.indexOf(i) !== -1)) {
1092
+ var o = r && !z(e.size) ? e.size : e, s = r && !z(e.click) ? e.click : e, c = document.createElement("li");
1093
+ t.keyboard && c.setAttribute("tabindex", 0), c.setAttribute("role", "button"), q(c, `${h}-${i}`), H(s) || Ve(c, Me, i), R(a) && q(c, Je(a)), ["small", "large"].indexOf(o) === -1 ? i === "play" && q(c, `${h}-large`) : q(c, `${h}-${o}`), H(s) && Z(c, j, s), d.appendChild(c);
1094
+ }
1095
+ }), o.appendChild(d);
1096
+ } else q(o, C);
1097
+ if (!t.rotatable) {
1098
+ var _ = o.querySelectorAll("li[class*=\"rotate\"]");
1099
+ q(_, E), U(_, function(e) {
1100
+ o.appendChild(e);
1101
+ });
1102
+ }
1103
+ if (t.inline) q(c, ee), G(i, { zIndex: t.zIndexInline }), window.getComputedStyle(n).position === "static" && G(n, { position: "relative" }), n.insertBefore(i, e.nextSibling);
1104
+ else {
1105
+ q(c, b), q(i, S), q(i, x), q(i, C), G(i, { zIndex: t.zIndex });
1106
+ var v = t.container;
1107
+ L(v) && (v = e.ownerDocument.querySelector(v)), v || (v = this.body), v.appendChild(i);
1108
+ }
1109
+ if (t.inline && (this.render(), this.bind(), this.isShown = !0), this.ready = !0, H(t.ready) && Z(e, ge, t.ready, { once: !0 }), Q(e, ge) === !1) {
1110
+ this.ready = !1;
1111
+ return;
1112
+ }
1113
+ this.ready && t.inline && this.view(this.index);
1114
+ }
1115
+ }
1116
+ }], [{
1117
+ key: "noConflict",
1118
+ value: function() {
1119
+ return window.Viewer = rt, t;
1120
+ }
1121
+ }, {
1122
+ key: "setDefaults",
1123
+ value: function(e) {
1124
+ W(l, V(e) && e);
1125
+ }
1126
+ }]);
1127
+ }();
1128
+ return W(at.prototype, Qe, $e, et, tt, nt), at;
1129
+ }));
1130
+ })))(), 1);
1131
+ n();
1132
+ var C = typeof global == "object" && global && global.Object === Object && global, ne = typeof self == "object" && self && self.Object === Object && self, re = C || ne || Function("return this")(), w = re.Symbol, T = Object.prototype, E = T.hasOwnProperty, D = T.toString, O = w ? w.toStringTag : void 0;
1133
+ function ie(e) {
1134
+ var t = E.call(e, O), n = e[O];
1135
+ try {
1136
+ e[O] = void 0;
1137
+ var r = !0;
1138
+ } catch (e) {}
1139
+ var i = D.call(e);
1140
+ return r && (t ? e[O] = n : delete e[O]), i;
1141
+ }
1142
+ var k = Object.prototype.toString;
1143
+ function A(e) {
1144
+ return k.call(e);
1145
+ }
1146
+ var j = "[object Null]", ae = "[object Undefined]", oe = w ? w.toStringTag : void 0;
1147
+ function se(e) {
1148
+ return e == null ? e === void 0 ? ae : j : oe && oe in Object(e) ? ie(e) : A(e);
1149
+ }
1150
+ function ce(e) {
1151
+ return typeof e == "object" && !!e;
1152
+ }
1153
+ var M = Array.isArray;
1154
+ function N(e) {
1155
+ var t = typeof e;
1156
+ return e != null && (t == "object" || t == "function");
1157
+ }
1158
+ function le(e) {
1159
+ return e;
1160
+ }
1161
+ var ue = "[object AsyncFunction]", de = "[object Function]", fe = "[object GeneratorFunction]", pe = "[object Proxy]";
1162
+ function me(e) {
1163
+ if (!N(e)) return !1;
1164
+ var t = se(e);
1165
+ return t == de || t == fe || t == ue || t == pe;
1166
+ }
1167
+ var P = re["__core-js_shared__"], he = function() {
1168
+ var e = /[^.]+$/.exec(P && P.keys && P.keys.IE_PROTO || "");
1169
+ return e ? "Symbol(src)_1." + e : "";
417
1170
  }();
418
- function b(e, t, i) {
419
- var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, n = i;
420
- t.trim().split($t).forEach(function(a) {
421
- if (!Oe) {
422
- var s = e.listeners;
423
- s && s[a] && s[a][i] && (n = s[a][i], delete s[a][i], Object.keys(s[a]).length === 0 && delete s[a], Object.keys(s).length === 0 && delete e.listeners);
424
- }
425
- e.removeEventListener(a, n, r);
426
- });
427
- }
428
- function d(e, t, i) {
429
- var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, n = i;
430
- t.trim().split($t).forEach(function(a) {
431
- if (r.once && !Oe) {
432
- var s = e.listeners, l = s === void 0 ? {} : s;
433
- n = function() {
434
- delete l[a][i], e.removeEventListener(a, n, r);
435
- for (var o = arguments.length, u = new Array(o), c = 0; c < o; c++)
436
- u[c] = arguments[c];
437
- i.apply(e, u);
438
- }, l[a] || (l[a] = {}), l[a][i] && e.removeEventListener(a, l[a][i], r), l[a][i] = n, e.listeners = l;
439
- }
440
- e.addEventListener(a, n, r);
441
- });
442
- }
443
- function A(e, t, i, r) {
444
- var n;
445
- return p(Event) && p(CustomEvent) ? n = new CustomEvent(t, Ct({
446
- bubbles: !0,
447
- cancelable: !0,
448
- detail: i
449
- }, r)) : (n = document.createEvent("CustomEvent"), n.initCustomEvent(t, !0, !0, i)), e.dispatchEvent(n);
450
- }
451
- function vi(e) {
452
- var t = e.getBoundingClientRect();
453
- return {
454
- left: t.left + (window.pageXOffset - document.documentElement.clientLeft),
455
- top: t.top + (window.pageYOffset - document.documentElement.clientTop)
456
- };
457
- }
458
- function gt(e) {
459
- var t = e.rotate, i = e.scaleX, r = e.scaleY, n = e.translateX, a = e.translateY, s = [];
460
- _(n) && n !== 0 && s.push("translateX(".concat(n, "px)")), _(a) && a !== 0 && s.push("translateY(".concat(a, "px)")), _(t) && t !== 0 && s.push("rotate(".concat(t, "deg)")), _(i) && i !== 1 && s.push("scaleX(".concat(i, ")")), _(r) && r !== 1 && s.push("scaleY(".concat(r, ")"));
461
- var l = s.length ? s.join(" ") : "none";
462
- return {
463
- WebkitTransform: l,
464
- msTransform: l,
465
- transform: l
466
- };
467
- }
468
- function gi(e) {
469
- return at(e) ? decodeURIComponent(e.replace(/^.*\//, "").replace(/[?&#].*$/, "")) : "";
470
- }
471
- var Et = V.navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(V.navigator.userAgent);
472
- function Ie(e, t, i) {
473
- var r = document.createElement("img");
474
- if (e.naturalWidth && !Et)
475
- return i(e.naturalWidth, e.naturalHeight), r;
476
- var n = document.body || document.documentElement;
477
- return r.onload = function() {
478
- i(r.width, r.height), Et || n.removeChild(r);
479
- }, y(t.inheritedAttributes, function(a) {
480
- var s = e.getAttribute(a);
481
- s !== null && r.setAttribute(a, s);
482
- }), r.src = e.src, Et || (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;", n.appendChild(r)), r;
483
- }
484
- function ut(e) {
485
- switch (e) {
486
- case 2:
487
- return ni;
488
- case 3:
489
- return ri;
490
- case 4:
491
- return ii;
492
- default:
493
- return "";
494
- }
495
- }
496
- function mi(e) {
497
- var t = Ct({}, e), i = [];
498
- return y(e, function(r, n) {
499
- delete t[n], y(t, function(a) {
500
- var s = Math.abs(r.startX - a.startX), l = Math.abs(r.startY - a.startY), h = Math.abs(r.endX - a.endX), o = Math.abs(r.endY - a.endY), u = Math.sqrt(s * s + l * l), c = Math.sqrt(h * h + o * o), g = (c - u) / u;
501
- i.push(g);
502
- });
503
- }), i.sort(function(r, n) {
504
- return Math.abs(r) < Math.abs(n);
505
- }), i[0];
506
- }
507
- function ht(e, t) {
508
- var i = e.pageX, r = e.pageY, n = {
509
- endX: i,
510
- endY: r
511
- };
512
- return t ? n : Ct({
513
- timeStamp: Date.now(),
514
- startX: i,
515
- startY: r
516
- }, n);
517
- }
518
- function pi(e) {
519
- var t = 0, i = 0, r = 0;
520
- return y(e, function(n) {
521
- var a = n.startX, s = n.startY;
522
- t += a, i += s, r += 1;
523
- }), t /= r, i /= r, {
524
- pageX: t,
525
- pageY: i
526
- };
527
- }
528
- var bi = {
529
- render: function() {
530
- this.initContainer(), this.initViewer(), this.initList(), this.renderViewer();
531
- },
532
- initBody: function() {
533
- var t = this.element.ownerDocument, i = t.body || t.documentElement;
534
- this.body = i, this.scrollbarWidth = window.innerWidth - t.documentElement.clientWidth, this.initialBodyPaddingRight = i.style.paddingRight, this.initialBodyComputedPaddingRight = window.getComputedStyle(i).paddingRight;
535
- },
536
- initContainer: function() {
537
- this.containerData = {
538
- width: window.innerWidth,
539
- height: window.innerHeight
540
- };
541
- },
542
- initViewer: function() {
543
- var t = this.options, i = this.parent, r;
544
- t.inline && (r = {
545
- width: Math.max(i.offsetWidth, t.minWidth),
546
- height: Math.max(i.offsetHeight, t.minHeight)
547
- }, this.parentData = r), (this.fulled || !r) && (r = this.containerData), this.viewerData = C({}, r);
548
- },
549
- renderViewer: function() {
550
- this.options.inline && !this.fulled && z(this.viewer, this.viewerData);
551
- },
552
- initList: function() {
553
- var t = this, i = this.element, r = this.options, n = this.list, a = [];
554
- n.innerHTML = "", y(this.images, function(s, l) {
555
- var h = s.src, o = s.alt || gi(h), u = t.getImageURL(s);
556
- if (h || u) {
557
- var c = document.createElement("li"), g = document.createElement("img");
558
- y(r.inheritedAttributes, function(I) {
559
- var S = s.getAttribute(I);
560
- S !== null && g.setAttribute(I, S);
561
- }), r.navbar && (g.src = h || u), g.alt = o, g.setAttribute("data-original-url", u || h), c.setAttribute("data-index", l), c.setAttribute("data-viewer-action", "view"), c.setAttribute("role", "button"), r.keyboard && c.setAttribute("tabindex", 0), c.appendChild(g), n.appendChild(c), a.push(c);
562
- }
563
- }), this.items = a, y(a, function(s) {
564
- var l = s.firstElementChild, h, o;
565
- xt(l, "filled", !0), r.loading && f(s, Z), d(l, $, h = function(c) {
566
- b(l, W, o), r.loading && m(s, Z), t.loadImage(c);
567
- }, {
568
- once: !0
569
- }), d(l, W, o = function() {
570
- b(l, $, h), r.loading && m(s, Z);
571
- }, {
572
- once: !0
573
- });
574
- }), r.transition && d(i, nt, function() {
575
- f(n, O);
576
- }, {
577
- once: !0
578
- });
579
- },
580
- renderList: function() {
581
- var t = this.index, i = this.items[t];
582
- if (i) {
583
- var r = i.nextElementSibling, n = parseInt(window.getComputedStyle(r || i).marginLeft, 10), a = i.offsetWidth, s = a + n;
584
- z(this.list, C({
585
- width: s * this.length - n
586
- }, gt({
587
- translateX: (this.viewerData.width - a) / 2 - s * t
588
- })));
589
- }
590
- },
591
- resetList: function() {
592
- var t = this.list;
593
- t.innerHTML = "", m(t, O), z(t, gt({
594
- translateX: 0
595
- }));
596
- },
597
- initImage: function(t) {
598
- var i = this, r = this.options, n = this.image, a = this.viewerData, s = this.footer.offsetHeight, l = a.width, h = Math.max(a.height - s, s), o = this.imageData || {}, u;
599
- this.imageInitializing = {
600
- abort: function() {
601
- u.onload = null;
602
- }
603
- }, u = Ie(n, r, function(c, g) {
604
- var I = c / g, S = Math.max(0, Math.min(1, r.initialCoverage)), E = l, x = h;
605
- i.imageInitializing = !1, h * I > l ? x = l / I : E = h * I, S = _(S) ? S : 0.9, E = Math.min(E * S, c), x = Math.min(x * S, g);
606
- var D = (l - E) / 2, N = (h - x) / 2, T = {
607
- left: D,
608
- top: N,
609
- x: D,
610
- y: N,
611
- width: E,
612
- height: x,
613
- oldRatio: 1,
614
- ratio: E / c,
615
- aspectRatio: I,
616
- naturalWidth: c,
617
- naturalHeight: g
618
- }, R = C({}, T);
619
- r.rotatable && (T.rotate = o.rotate || 0, R.rotate = 0), r.scalable && (T.scaleX = o.scaleX || 1, T.scaleY = o.scaleY || 1, R.scaleX = 1, R.scaleY = 1), i.imageData = T, i.initialImageData = R, t && t();
620
- });
621
- },
622
- renderImage: function(t) {
623
- var i = this, r = this.image, n = this.imageData;
624
- if (z(r, C({
625
- width: n.width,
626
- height: n.height,
627
- // XXX: Not to use translateX/Y to avoid image shaking when zooming
628
- marginLeft: n.x,
629
- marginTop: n.y
630
- }, gt(n))), t)
631
- if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && H(r, O)) {
632
- var a = function() {
633
- i.imageRendering = !1, t();
634
- };
635
- this.imageRendering = {
636
- abort: function() {
637
- b(r, k, a);
638
- }
639
- }, d(r, k, a, {
640
- once: !0
641
- });
642
- } else
643
- t();
644
- },
645
- resetImage: function() {
646
- if (this.viewing || this.viewed) {
647
- var t = this.image;
648
- this.viewing && this.viewing.abort(), t.parentNode.removeChild(t), this.image = null;
649
- }
650
- }
651
- }, yi = {
652
- bind: function() {
653
- var t = this.options, i = this.viewer, r = this.canvas, n = this.element.ownerDocument;
654
- d(i, J, this.onClick = this.click.bind(this)), d(i, Wt, this.onDragStart = this.dragstart.bind(this)), d(r, Ht, this.onPointerDown = this.pointerdown.bind(this)), d(n, Ut, this.onPointerMove = this.pointermove.bind(this)), d(n, Bt, this.onPointerUp = this.pointerup.bind(this)), d(n, qt, this.onKeyDown = this.keydown.bind(this)), d(window, Kt, this.onResize = this.resize.bind(this)), t.zoomable && t.zoomOnWheel && d(i, Gt, this.onWheel = this.wheel.bind(this), {
655
- passive: !1,
656
- capture: !0
657
- }), t.toggleOnDblclick && d(r, At, this.onDblclick = this.dblclick.bind(this));
658
- },
659
- unbind: function() {
660
- var t = this.options, i = this.viewer, r = this.canvas, n = this.element.ownerDocument;
661
- b(i, J, this.onClick), b(i, Wt, this.onDragStart), b(r, Ht, this.onPointerDown), b(n, Ut, this.onPointerMove), b(n, Bt, this.onPointerUp), b(n, qt, this.onKeyDown), b(window, Kt, this.onResize), t.zoomable && t.zoomOnWheel && b(i, Gt, this.onWheel, {
662
- passive: !1,
663
- capture: !0
664
- }), t.toggleOnDblclick && b(r, At, this.onDblclick);
665
- }
666
- }, wi = {
667
- click: function(t) {
668
- var i = this.options, r = this.imageData, n = t.target, a = K(n, mt);
669
- switch (!a && n.localName === "img" && n.parentElement.localName === "li" && (n = n.parentElement, a = K(n, mt)), G && t.isTrusted && n === this.canvas && clearTimeout(this.clickCanvasTimeout), a) {
670
- case "mix":
671
- this.played ? this.stop() : i.inline ? this.fulled ? this.exit() : this.full() : this.hide();
672
- break;
673
- case "hide":
674
- this.pointerMoved || this.hide();
675
- break;
676
- case "view":
677
- this.view(K(n, "index"));
678
- break;
679
- case "zoom-in":
680
- this.zoom(0.1, !0);
681
- break;
682
- case "zoom-out":
683
- this.zoom(-0.1, !0);
684
- break;
685
- case "one-to-one":
686
- this.toggle();
687
- break;
688
- case "reset":
689
- this.reset();
690
- break;
691
- case "prev":
692
- this.prev(i.loop);
693
- break;
694
- case "play":
695
- this.play(i.fullscreen);
696
- break;
697
- case "next":
698
- this.next(i.loop);
699
- break;
700
- case "rotate-left":
701
- this.rotate(-90);
702
- break;
703
- case "rotate-right":
704
- this.rotate(90);
705
- break;
706
- case "flip-horizontal":
707
- this.scaleX(-r.scaleX || -1);
708
- break;
709
- case "flip-vertical":
710
- this.scaleY(-r.scaleY || -1);
711
- break;
712
- default:
713
- this.played && this.stop();
714
- }
715
- },
716
- dblclick: function(t) {
717
- t.preventDefault(), this.viewed && t.target === this.image && (G && t.isTrusted && clearTimeout(this.doubleClickImageTimeout), this.toggle(t.isTrusted ? t : t.detail && t.detail.originalEvent));
718
- },
719
- load: function() {
720
- var t = this;
721
- this.timeout && (clearTimeout(this.timeout), this.timeout = !1);
722
- var i = this.element, r = this.options, n = this.image, a = this.index, s = this.viewerData;
723
- m(n, rt), r.loading && m(this.canvas, Z), n.style.cssText = "height:0;" + "margin-left:".concat(s.width / 2, "px;") + "margin-top:".concat(s.height / 2, "px;") + "max-width:none!important;position:relative;width:0;", this.initImage(function() {
724
- st(n, ai, r.movable), st(n, O, r.transition), t.renderImage(function() {
725
- t.viewed = !0, t.viewing = !1, p(r.viewed) && d(i, nt, r.viewed, {
726
- once: !0
727
- }), A(i, nt, {
728
- originalImage: t.images[a],
729
- index: a,
730
- image: n
731
- }, {
732
- cancelable: !1
733
- });
734
- });
735
- });
736
- },
737
- loadImage: function(t) {
738
- var i = t.target, r = i.parentNode, n = r.offsetWidth || 30, a = r.offsetHeight || 50, s = !!K(i, "filled");
739
- Ie(i, this.options, function(l, h) {
740
- var o = l / h, u = n, c = a;
741
- a * o > n ? s ? u = a * o : c = n / o : s ? c = n / o : u = a * o, z(i, C({
742
- width: u,
743
- height: c
744
- }, gt({
745
- translateX: (n - u) / 2,
746
- translateY: (a - c) / 2
747
- })));
748
- });
749
- },
750
- keydown: function(t) {
751
- var i = this.options;
752
- if (i.keyboard) {
753
- var r = t.keyCode || t.which || t.charCode;
754
- switch (r) {
755
- case 13:
756
- this.viewer.contains(t.target) && this.click(t);
757
- break;
758
- }
759
- if (this.fulled)
760
- switch (r) {
761
- case 27:
762
- this.played ? this.stop() : i.inline ? this.fulled && this.exit() : this.hide();
763
- break;
764
- case 32:
765
- this.played && this.stop();
766
- break;
767
- case 37:
768
- this.played && this.playing ? this.playing.prev() : this.prev(i.loop);
769
- break;
770
- case 38:
771
- t.preventDefault(), this.zoom(i.zoomRatio, !0);
772
- break;
773
- case 39:
774
- this.played && this.playing ? this.playing.next() : this.next(i.loop);
775
- break;
776
- case 40:
777
- t.preventDefault(), this.zoom(-i.zoomRatio, !0);
778
- break;
779
- case 48:
780
- case 49:
781
- t.ctrlKey && (t.preventDefault(), this.toggle());
782
- break;
783
- }
784
- }
785
- },
786
- dragstart: function(t) {
787
- t.target.localName === "img" && t.preventDefault();
788
- },
789
- pointerdown: function(t) {
790
- var i = this.options, r = this.pointers, n = t.buttons, a = t.button;
791
- if (this.pointerMoved = !1, !(!this.viewed || this.showing || this.viewing || this.hiding || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && // No primary button (Usually the left button)
792
- (_(n) && n !== 1 || _(a) && a !== 0 || t.ctrlKey))) {
793
- t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(l) {
794
- r[l.identifier] = ht(l);
795
- }) : r[t.pointerId || 0] = ht(t);
796
- var s = i.movable ? dt : !1;
797
- i.zoomOnTouch && i.zoomable && Object.keys(r).length > 1 ? s = it : i.slideOnTouch && (t.pointerType === "touch" || t.type === "touchstart") && this.isSwitchable() && (s = Se), i.transition && (s === dt || s === it) && m(this.image, O), this.action = s;
798
- }
799
- },
800
- pointermove: function(t) {
801
- var i = this.pointers, r = this.action;
802
- !this.viewed || !r || (t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(n) {
803
- C(i[n.identifier] || {}, ht(n, !0));
804
- }) : C(i[t.pointerId || 0] || {}, ht(t, !0)), this.change(t));
805
- },
806
- pointerup: function(t) {
807
- var i = this, r = this.options, n = this.action, a = this.pointers, s;
808
- t.changedTouches ? y(t.changedTouches, function(l) {
809
- s = a[l.identifier], delete a[l.identifier];
810
- }) : (s = a[t.pointerId || 0], delete a[t.pointerId || 0]), n && (t.preventDefault(), r.transition && (n === dt || n === it) && f(this.image, O), this.action = !1, G && n !== it && s && Date.now() - s.timeStamp < 500 && (clearTimeout(this.clickCanvasTimeout), clearTimeout(this.doubleClickImageTimeout), r.toggleOnDblclick && this.viewed && t.target === this.image ? this.imageClicked ? (this.imageClicked = !1, this.doubleClickImageTimeout = setTimeout(function() {
811
- A(i.image, At, {
812
- originalEvent: t
813
- });
814
- }, 50)) : (this.imageClicked = !0, this.doubleClickImageTimeout = setTimeout(function() {
815
- i.imageClicked = !1;
816
- }, 500)) : (this.imageClicked = !1, r.backdrop && r.backdrop !== "static" && t.target === this.canvas && (this.clickCanvasTimeout = setTimeout(function() {
817
- A(i.canvas, J, {
818
- originalEvent: t
819
- });
820
- }, 50)))));
821
- },
822
- resize: function() {
823
- var t = this;
824
- 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() {
825
- t.renderImage();
826
- }), this.played)) {
827
- if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
828
- this.stop();
829
- return;
830
- }
831
- y(this.player.getElementsByTagName("img"), function(i) {
832
- d(i, $, t.loadImage.bind(t), {
833
- once: !0
834
- }), A(i, $);
835
- });
836
- }
837
- },
838
- wheel: function(t) {
839
- var i = this;
840
- if (this.viewed && (t.preventDefault(), !this.wheeling)) {
841
- this.wheeling = !0, setTimeout(function() {
842
- i.wheeling = !1;
843
- }, 50);
844
- var r = Number(this.options.zoomRatio) || 0.1, n = 1;
845
- t.deltaY ? n = t.deltaY > 0 ? 1 : -1 : t.wheelDelta ? n = -t.wheelDelta / 120 : t.detail && (n = t.detail > 0 ? 1 : -1), this.zoom(-n * r, !0, null, t);
846
- }
847
- }
848
- }, Ti = {
849
- /** Show the viewer (only available in modal mode)
850
- * @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
851
- * @returns {Viewer} this
852
- */
853
- show: function() {
854
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.element, r = this.options;
855
- if (r.inline || this.showing || this.isShown || this.showing)
856
- return this;
857
- if (!this.ready)
858
- return this.build(), this.ready && this.show(t), this;
859
- if (p(r.show) && d(i, Jt, r.show, {
860
- once: !0
861
- }), A(i, Jt) === !1 || !this.ready)
862
- return this;
863
- this.hiding && this.transitioning.abort(), this.showing = !0, this.open();
864
- var n = this.viewer;
865
- if (m(n, Y), n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", this.title.id), n.setAttribute("aria-modal", !0), n.removeAttribute("aria-hidden"), r.transition && !t) {
866
- var a = this.shown.bind(this);
867
- this.transitioning = {
868
- abort: function() {
869
- b(n, k, a), m(n, L);
870
- }
871
- }, f(n, O), n.initialOffsetWidth = n.offsetWidth, d(n, k, a, {
872
- once: !0
873
- }), f(n, L);
874
- } else
875
- f(n, L), this.shown();
876
- return this;
877
- },
878
- /**
879
- * Hide the viewer (only available in modal mode)
880
- * @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
881
- * @returns {Viewer} this
882
- */
883
- hide: function() {
884
- var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, r = this.element, n = this.options;
885
- if (n.inline || this.hiding || !(this.isShown || this.showing))
886
- return this;
887
- if (p(n.hide) && d(r, te, n.hide, {
888
- once: !0
889
- }), A(r, te) === !1)
890
- return this;
891
- this.showing && this.transitioning.abort(), this.hiding = !0, this.played ? this.stop() : this.viewing && this.viewing.abort();
892
- var a = this.viewer, s = this.image, l = function() {
893
- m(a, L), t.hidden();
894
- };
895
- if (n.transition && !i) {
896
- var h = function u(c) {
897
- c && c.target === a && (b(a, k, u), t.hidden());
898
- }, o = function() {
899
- H(a, O) ? (d(a, k, h), m(a, L)) : l();
900
- };
901
- this.transitioning = {
902
- abort: function() {
903
- t.viewed && H(s, O) ? b(s, k, o) : H(a, O) && b(a, k, h);
904
- }
905
- }, this.viewed && H(s, O) ? (d(s, k, o, {
906
- once: !0
907
- }), this.zoomTo(0, !1, null, null, !0)) : o();
908
- } else
909
- l();
910
- return this;
911
- },
912
- /**
913
- * View one of the images with image's index
914
- * @param {number} index - The index of the image to view.
915
- * @returns {Viewer} this
916
- */
917
- view: function() {
918
- var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.initialViewIndex;
919
- if (i = Number(i) || 0, this.hiding || this.played || i < 0 || i >= this.length || this.viewed && i === this.index)
920
- return this;
921
- if (!this.isShown)
922
- return this.index = i, this.show();
923
- this.viewing && this.viewing.abort();
924
- var r = this.element, n = this.options, a = this.title, s = this.canvas, l = this.items[i], h = l.querySelector("img"), o = K(h, "originalUrl"), u = h.getAttribute("alt"), c = document.createElement("img");
925
- if (y(n.inheritedAttributes, function(x) {
926
- var D = h.getAttribute(x);
927
- D !== null && c.setAttribute(x, D);
928
- }), c.src = o, c.alt = u, p(n.view) && d(r, ie, n.view, {
929
- once: !0
930
- }), A(r, ie, {
931
- originalImage: this.images[i],
932
- index: i,
933
- image: c
934
- }) === !1 || !this.isShown || this.hiding || this.played)
935
- return this;
936
- var g = this.items[this.index];
937
- g && (m(g, ot), g.removeAttribute("aria-selected")), f(l, ot), l.setAttribute("aria-selected", !0), n.focus && l.focus(), this.image = c, this.viewed = !1, this.index = i, this.imageData = {}, f(c, rt), n.loading && f(s, Z), s.innerHTML = "", s.appendChild(c), this.renderList(), a.innerHTML = "";
938
- var I = function() {
939
- var D = t.imageData, N = Array.isArray(n.title) ? n.title[1] : n.title;
940
- a.innerHTML = fi(p(N) ? N.call(t, c, D) : "".concat(u, " (").concat(D.naturalWidth, " × ").concat(D.naturalHeight, ")"));
941
- }, S, E;
942
- return d(r, nt, I, {
943
- once: !0
944
- }), this.viewing = {
945
- abort: function() {
946
- b(r, nt, I), c.complete ? t.imageRendering ? t.imageRendering.abort() : t.imageInitializing && t.imageInitializing.abort() : (c.src = "", b(c, $, S), t.timeout && clearTimeout(t.timeout));
947
- }
948
- }, c.complete ? this.load() : (d(c, $, S = function() {
949
- b(c, W, E), t.load();
950
- }, {
951
- once: !0
952
- }), d(c, W, E = function() {
953
- b(c, $, S), t.timeout && (clearTimeout(t.timeout), t.timeout = !1), m(c, rt), n.loading && m(t.canvas, Z);
954
- }, {
955
- once: !0
956
- }), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(function() {
957
- m(c, rt), t.timeout = !1;
958
- }, 1e3)), this;
959
- },
960
- /**
961
- * View the previous image
962
- * @param {boolean} [loop=false] - Indicate if view the last one
963
- * when it is the first one at present.
964
- * @returns {Viewer} this
965
- */
966
- prev: function() {
967
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.index - 1;
968
- return i < 0 && (i = t ? this.length - 1 : 0), this.view(i), this;
969
- },
970
- /**
971
- * View the next image
972
- * @param {boolean} [loop=false] - Indicate if view the first one
973
- * when it is the last one at present.
974
- * @returns {Viewer} this
975
- */
976
- next: function() {
977
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.length - 1, r = this.index + 1;
978
- return r > i && (r = t ? 0 : i), this.view(r), this;
979
- },
980
- /**
981
- * Move the image with relative offsets.
982
- * @param {number} x - The moving distance in the horizontal direction.
983
- * @param {number} [y=x] The moving distance in the vertical direction.
984
- * @returns {Viewer} this
985
- */
986
- move: function(t) {
987
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = this.imageData;
988
- return this.moveTo(U(t) ? t : r.x + Number(t), U(i) ? i : r.y + Number(i)), this;
989
- },
990
- /**
991
- * Move the image to an absolute point.
992
- * @param {number} x - The new position in the horizontal direction.
993
- * @param {number} [y=x] - The new position in the vertical direction.
994
- * @param {Event} [_originalEvent=null] - The original event if any.
995
- * @returns {Viewer} this
996
- */
997
- moveTo: function(t) {
998
- var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = this.element, s = this.options, l = this.imageData;
999
- if (t = Number(t), r = Number(r), this.viewed && !this.played && s.movable) {
1000
- var h = l.x, o = l.y, u = !1;
1001
- if (_(t) ? u = !0 : t = h, _(r) ? u = !0 : r = o, u) {
1002
- if (p(s.move) && d(a, re, s.move, {
1003
- once: !0
1004
- }), A(a, re, {
1005
- x: t,
1006
- y: r,
1007
- oldX: h,
1008
- oldY: o,
1009
- originalEvent: n
1010
- }) === !1)
1011
- return this;
1012
- l.x = t, l.y = r, l.left = t, l.top = r, this.moving = !0, this.renderImage(function() {
1013
- i.moving = !1, p(s.moved) && d(a, ne, s.moved, {
1014
- once: !0
1015
- }), A(a, ne, {
1016
- x: t,
1017
- y: r,
1018
- oldX: h,
1019
- oldY: o,
1020
- originalEvent: n
1021
- }, {
1022
- cancelable: !1
1023
- });
1024
- });
1025
- }
1026
- }
1027
- return this;
1028
- },
1029
- /**
1030
- * Rotate the image with a relative degree.
1031
- * @param {number} degree - The rotate degree.
1032
- * @returns {Viewer} this
1033
- */
1034
- rotate: function(t) {
1035
- return this.rotateTo((this.imageData.rotate || 0) + Number(t)), this;
1036
- },
1037
- /**
1038
- * Rotate the image to an absolute degree.
1039
- * @param {number} degree - The rotate degree.
1040
- * @returns {Viewer} this
1041
- */
1042
- rotateTo: function(t) {
1043
- var i = this, r = this.element, n = this.options, a = this.imageData;
1044
- if (t = Number(t), _(t) && this.viewed && !this.played && n.rotatable) {
1045
- var s = a.rotate;
1046
- if (p(n.rotate) && d(r, ae, n.rotate, {
1047
- once: !0
1048
- }), A(r, ae, {
1049
- degree: t,
1050
- oldDegree: s
1051
- }) === !1)
1052
- return this;
1053
- a.rotate = t, this.rotating = !0, this.renderImage(function() {
1054
- i.rotating = !1, p(n.rotated) && d(r, se, n.rotated, {
1055
- once: !0
1056
- }), A(r, se, {
1057
- degree: t,
1058
- oldDegree: s
1059
- }, {
1060
- cancelable: !1
1061
- });
1062
- });
1063
- }
1064
- return this;
1065
- },
1066
- /**
1067
- * Scale the image on the x-axis.
1068
- * @param {number} scaleX - The scale ratio on the x-axis.
1069
- * @returns {Viewer} this
1070
- */
1071
- scaleX: function(t) {
1072
- return this.scale(t, this.imageData.scaleY), this;
1073
- },
1074
- /**
1075
- * Scale the image on the y-axis.
1076
- * @param {number} scaleY - The scale ratio on the y-axis.
1077
- * @returns {Viewer} this
1078
- */
1079
- scaleY: function(t) {
1080
- return this.scale(this.imageData.scaleX, t), this;
1081
- },
1082
- /**
1083
- * Scale the image.
1084
- * @param {number} scaleX - The scale ratio on the x-axis.
1085
- * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
1086
- * @returns {Viewer} this
1087
- */
1088
- scale: function(t) {
1089
- var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, n = this.element, a = this.options, s = this.imageData;
1090
- if (t = Number(t), r = Number(r), this.viewed && !this.played && a.scalable) {
1091
- var l = s.scaleX, h = s.scaleY, o = !1;
1092
- if (_(t) ? o = !0 : t = l, _(r) ? o = !0 : r = h, o) {
1093
- if (p(a.scale) && d(n, oe, a.scale, {
1094
- once: !0
1095
- }), A(n, oe, {
1096
- scaleX: t,
1097
- scaleY: r,
1098
- oldScaleX: l,
1099
- oldScaleY: h
1100
- }) === !1)
1101
- return this;
1102
- s.scaleX = t, s.scaleY = r, this.scaling = !0, this.renderImage(function() {
1103
- i.scaling = !1, p(a.scaled) && d(n, le, a.scaled, {
1104
- once: !0
1105
- }), A(n, le, {
1106
- scaleX: t,
1107
- scaleY: r,
1108
- oldScaleX: l,
1109
- oldScaleY: h
1110
- }, {
1111
- cancelable: !1
1112
- });
1113
- });
1114
- }
1115
- }
1116
- return this;
1117
- },
1118
- /**
1119
- * Zoom the image with a relative ratio.
1120
- * @param {number} ratio - The target ratio.
1121
- * @param {boolean} [showTooltip=false] - Indicates whether to show the tooltip.
1122
- * @param {Object} [pivot] - The pivot point coordinate for zooming.
1123
- * @param {Event} [_originalEvent=null] - The original event if any.
1124
- * @returns {Viewer} this
1125
- */
1126
- zoom: function(t) {
1127
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, a = this.imageData;
1128
- return t = Number(t), t < 0 ? t = 1 / (1 - t) : t = 1 + t, this.zoomTo(a.width * t / a.naturalWidth, i, r, n), this;
1129
- },
1130
- /**
1131
- * Zoom the image to an absolute ratio.
1132
- * @param {number} ratio - The target ratio.
1133
- * @param {boolean} [showTooltip] - Indicates whether to show the tooltip.
1134
- * @param {Object} [pivot] - The pivot point coordinate for zooming.
1135
- * @param {Event} [_originalEvent=null] - The original event if any.
1136
- * @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
1137
- * @returns {Viewer} this
1138
- */
1139
- zoomTo: function(t) {
1140
- var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, l = this.element, h = this.options, o = this.pointers, u = this.imageData, c = u.x, g = u.y, I = u.width, S = u.height, E = u.naturalWidth, x = u.naturalHeight;
1141
- if (t = Math.max(0, t), _(t) && this.viewed && !this.played && (s || h.zoomable)) {
1142
- if (!s) {
1143
- var D = Math.max(0.01, h.minZoomRatio), N = Math.min(100, h.maxZoomRatio);
1144
- t = Math.min(Math.max(t, D), N);
1145
- }
1146
- if (a)
1147
- switch (a.type) {
1148
- case "wheel":
1149
- h.zoomRatio >= 0.055 && t > 0.95 && t < 1.05 && (t = 1);
1150
- break;
1151
- case "pointermove":
1152
- case "touchmove":
1153
- case "mousemove":
1154
- t > 0.99 && t < 1.01 && (t = 1);
1155
- break;
1156
- }
1157
- var T = E * t, R = x * t, F = T - I, P = R - S, M = u.ratio;
1158
- if (p(h.zoom) && d(l, ue, h.zoom, {
1159
- once: !0
1160
- }), A(l, ue, {
1161
- ratio: t,
1162
- oldRatio: M,
1163
- originalEvent: a
1164
- }) === !1)
1165
- return this;
1166
- if (this.zooming = !0, a) {
1167
- var tt = vi(this.viewer), X = o && Object.keys(o).length > 0 ? pi(o) : {
1168
- pageX: a.pageX,
1169
- pageY: a.pageY
1170
- };
1171
- u.x -= F * ((X.pageX - tt.left - c) / I), u.y -= P * ((X.pageY - tt.top - g) / S);
1172
- } else
1173
- B(n) && _(n.x) && _(n.y) ? (u.x -= F * ((n.x - c) / I), u.y -= P * ((n.y - g) / S)) : (u.x -= F / 2, u.y -= P / 2);
1174
- u.left = u.x, u.top = u.y, u.width = T, u.height = R, u.oldRatio = M, u.ratio = t, this.renderImage(function() {
1175
- i.zooming = !1, p(h.zoomed) && d(l, he, h.zoomed, {
1176
- once: !0
1177
- }), A(l, he, {
1178
- ratio: t,
1179
- oldRatio: M,
1180
- originalEvent: a
1181
- }, {
1182
- cancelable: !1
1183
- });
1184
- }), r && this.tooltip();
1185
- }
1186
- return this;
1187
- },
1188
- /**
1189
- * Play the images
1190
- * @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
1191
- * @returns {Viewer} this
1192
- */
1193
- play: function() {
1194
- var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1195
- if (!this.isShown || this.played)
1196
- return this;
1197
- var r = this.element, n = this.options;
1198
- if (p(n.play) && d(r, ce, n.play, {
1199
- once: !0
1200
- }), A(r, ce) === !1)
1201
- return this;
1202
- var a = this.player, s = this.loadImage.bind(this), l = [], h = 0, o = 0;
1203
- if (this.played = !0, this.onLoadWhenPlay = s, i && this.requestFullscreen(i), f(a, q), y(this.items, function(g, I) {
1204
- var S = g.querySelector("img"), E = document.createElement("img");
1205
- E.src = K(S, "originalUrl"), E.alt = S.getAttribute("alt"), E.referrerPolicy = S.referrerPolicy, h += 1, f(E, vt), st(E, O, n.transition), H(g, ot) && (f(E, L), o = I), l.push(E), d(E, $, s, {
1206
- once: !0
1207
- }), a.appendChild(E);
1208
- }), _(n.interval) && n.interval > 0) {
1209
- var u = function g() {
1210
- clearTimeout(t.playing.timeout), m(l[o], L), o -= 1, o = o >= 0 ? o : h - 1, f(l[o], L), t.playing.timeout = setTimeout(g, n.interval);
1211
- }, c = function g() {
1212
- clearTimeout(t.playing.timeout), m(l[o], L), o += 1, o = o < h ? o : 0, f(l[o], L), t.playing.timeout = setTimeout(g, n.interval);
1213
- };
1214
- h > 1 && (this.playing = {
1215
- prev: u,
1216
- next: c,
1217
- timeout: setTimeout(c, n.interval)
1218
- });
1219
- }
1220
- return this;
1221
- },
1222
- // Stop play
1223
- stop: function() {
1224
- var t = this;
1225
- if (!this.played)
1226
- return this;
1227
- var i = this.element, r = this.options;
1228
- if (p(r.stop) && d(i, fe, r.stop, {
1229
- once: !0
1230
- }), A(i, fe) === !1)
1231
- return this;
1232
- var n = this.player;
1233
- return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, y(n.getElementsByTagName("img"), function(a) {
1234
- b(a, $, t.onLoadWhenPlay);
1235
- }), m(n, q), n.innerHTML = "", this.exitFullscreen(), this;
1236
- },
1237
- // Enter modal mode (only available in inline mode)
1238
- full: function() {
1239
- var t = this, i = this.options, r = this.viewer, n = this.image, a = this.list;
1240
- return !this.isShown || this.played || this.fulled || !i.inline ? this : (this.fulled = !0, this.open(), f(this.button, Mt), i.transition && (m(a, O), this.viewed && m(n, O)), f(r, It), r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", this.title.id), r.setAttribute("aria-modal", !0), r.removeAttribute("style"), z(r, {
1241
- zIndex: i.zIndex
1242
- }), i.focus && this.enforceFocus(), this.initContainer(), this.viewerData = C({}, this.containerData), this.renderList(), this.viewed && this.initImage(function() {
1243
- t.renderImage(function() {
1244
- i.transition && setTimeout(function() {
1245
- f(n, O), f(a, O);
1246
- }, 0);
1247
- });
1248
- }), this);
1249
- },
1250
- // Exit modal mode (only available in inline mode)
1251
- exit: function() {
1252
- var t = this, i = this.options, r = this.viewer, n = this.image, a = this.list;
1253
- return !this.isShown || this.played || !this.fulled || !i.inline ? this : (this.fulled = !1, this.close(), m(this.button, Mt), i.transition && (m(a, O), this.viewed && m(n, O)), i.focus && this.clearEnforceFocus(), r.removeAttribute("role"), r.removeAttribute("aria-labelledby"), r.removeAttribute("aria-modal"), m(r, It), z(r, {
1254
- zIndex: i.zIndexInline
1255
- }), this.viewerData = C({}, this.parentData), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
1256
- t.renderImage(function() {
1257
- i.transition && setTimeout(function() {
1258
- f(n, O), f(a, O);
1259
- }, 0);
1260
- });
1261
- }), this);
1262
- },
1263
- // Show the current ratio of the image with percentage
1264
- tooltip: function() {
1265
- var t = this, i = this.options, r = this.tooltipBox, n = this.imageData;
1266
- return !this.viewed || this.played || !i.tooltip ? this : (r.textContent = "".concat(Math.round(n.ratio * 100), "%"), this.tooltipping ? clearTimeout(this.tooltipping) : i.transition ? (this.fading && A(r, k), f(r, q), f(r, vt), f(r, O), r.removeAttribute("aria-hidden"), r.initialOffsetWidth = r.offsetWidth, f(r, L)) : (f(r, q), r.removeAttribute("aria-hidden")), this.tooltipping = setTimeout(function() {
1267
- i.transition ? (d(r, k, function() {
1268
- m(r, q), m(r, vt), m(r, O), r.setAttribute("aria-hidden", !0), t.fading = !1;
1269
- }, {
1270
- once: !0
1271
- }), m(r, L), t.fading = !0) : (m(r, q), r.setAttribute("aria-hidden", !0)), t.tooltipping = !1;
1272
- }, 1e3), this);
1273
- },
1274
- /**
1275
- * Toggle the image size between its current size and natural size
1276
- * @param {Event} [_originalEvent=null] - The original event if any.
1277
- * @returns {Viewer} this
1278
- */
1279
- toggle: function() {
1280
- var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
1281
- return this.imageData.ratio === 1 ? this.zoomTo(this.imageData.oldRatio, !0, null, t) : this.zoomTo(1, !0, null, t), this;
1282
- },
1283
- // Reset the image to its initial state
1284
- reset: function() {
1285
- return this.viewed && !this.played && (this.imageData = C({}, this.initialImageData), this.renderImage()), this;
1286
- },
1287
- // Update viewer when images changed
1288
- update: function() {
1289
- var t = this, i = this.element, r = this.options, n = this.isImg;
1290
- if (n && !i.parentNode)
1291
- return this.destroy();
1292
- var a = [];
1293
- if (y(n ? [i] : i.querySelectorAll("img"), function(o) {
1294
- p(r.filter) ? r.filter.call(t, o) && a.push(o) : t.getImageURL(o) && a.push(o);
1295
- }), !a.length)
1296
- return this;
1297
- if (this.images = a, this.length = a.length, this.ready) {
1298
- var s = [];
1299
- if (y(this.items, function(o, u) {
1300
- var c = o.querySelector("img"), g = a[u];
1301
- g && c ? (g.src !== c.src || g.alt !== c.alt) && s.push(u) : s.push(u);
1302
- }), z(this.list, {
1303
- width: "auto"
1304
- }), this.initList(), this.isShown)
1305
- if (this.length) {
1306
- if (this.viewed) {
1307
- var l = s.indexOf(this.index);
1308
- if (l >= 0)
1309
- this.viewed = !1, this.view(Math.max(Math.min(this.index - l, this.length - 1), 0));
1310
- else {
1311
- var h = this.items[this.index];
1312
- f(h, ot), h.setAttribute("aria-selected", !0);
1313
- }
1314
- }
1315
- } else
1316
- this.image = null, this.viewed = !1, this.index = 0, this.imageData = {}, this.canvas.innerHTML = "", this.title.innerHTML = "";
1317
- } else
1318
- this.build();
1319
- return this;
1320
- },
1321
- // Destroy the viewer
1322
- destroy: function() {
1323
- var t = this.element, i = this.options;
1324
- return t[v] ? (this.destroyed = !0, this.ready ? (this.played && this.stop(), i.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)) : i.inline && (this.delaying ? this.delaying.abort() : this.initializing && this.initializing.abort()), i.inline || b(t, J, this.onStart), t[v] = void 0, this) : this;
1325
- }
1326
- }, Ei = {
1327
- getImageURL: function(t) {
1328
- var i = this.options.url;
1329
- return at(i) ? i = t.getAttribute(i) : p(i) ? i = i.call(this, t) : i = "", i;
1330
- },
1331
- enforceFocus: function() {
1332
- var t = this;
1333
- this.clearEnforceFocus(), d(document, Xt, this.onFocusin = function(i) {
1334
- var r = t.viewer, n = i.target;
1335
- if (!(n === document || n === r || r.contains(n))) {
1336
- for (; n; ) {
1337
- if (n.getAttribute("tabindex") !== null || n.getAttribute("aria-modal") === "true")
1338
- return;
1339
- n = n.parentElement;
1340
- }
1341
- r.focus();
1342
- }
1343
- });
1344
- },
1345
- clearEnforceFocus: function() {
1346
- this.onFocusin && (b(document, Xt, this.onFocusin), this.onFocusin = null);
1347
- },
1348
- open: function() {
1349
- var t = this.body;
1350
- f(t, Yt), this.scrollbarWidth > 0 && (t.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), "px"));
1351
- },
1352
- close: function() {
1353
- var t = this.body;
1354
- m(t, Yt), this.scrollbarWidth > 0 && (t.style.paddingRight = this.initialBodyPaddingRight);
1355
- },
1356
- shown: function() {
1357
- var t = this.element, i = this.options, r = this.viewer;
1358
- this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, i.focus && (r.focus(), this.enforceFocus()), p(i.shown) && d(t, Qt, i.shown, {
1359
- once: !0
1360
- }), A(t, Qt) !== !1 && this.ready && this.isShown && !this.hiding && this.view(this.index);
1361
- },
1362
- hidden: function() {
1363
- var t = this.element, i = this.options, r = this.viewer;
1364
- i.fucus && this.clearEnforceFocus(), this.fulled = !1, this.viewed = !1, this.isShown = !1, this.close(), this.unbind(), f(r, Y), r.removeAttribute("role"), r.removeAttribute("aria-labelledby"), r.removeAttribute("aria-modal"), r.setAttribute("aria-hidden", !0), this.resetList(), this.resetImage(), this.hiding = !1, this.destroyed || (p(i.hidden) && d(t, ee, i.hidden, {
1365
- once: !0
1366
- }), A(t, ee, null, {
1367
- cancelable: !1
1368
- }));
1369
- },
1370
- requestFullscreen: function(t) {
1371
- var i = this.element.ownerDocument;
1372
- if (this.fulled && !(i.fullscreenElement || i.webkitFullscreenElement || i.mozFullScreenElement || i.msFullscreenElement)) {
1373
- var r = i.documentElement;
1374
- r.requestFullscreen ? B(t) ? r.requestFullscreen(t) : r.requestFullscreen() : r.webkitRequestFullscreen ? r.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : r.mozRequestFullScreen ? r.mozRequestFullScreen() : r.msRequestFullscreen && r.msRequestFullscreen();
1375
- }
1376
- },
1377
- exitFullscreen: function() {
1378
- var t = this.element.ownerDocument;
1379
- this.fulled && (t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement) && (t.exitFullscreen ? t.exitFullscreen() : t.webkitExitFullscreen ? t.webkitExitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.msExitFullscreen && t.msExitFullscreen());
1380
- },
1381
- change: function(t) {
1382
- var i = this.options, r = this.pointers, n = r[Object.keys(r)[0]];
1383
- if (n) {
1384
- var a = n.endX - n.startX, s = n.endY - n.startY;
1385
- switch (this.action) {
1386
- case dt:
1387
- (a !== 0 || s !== 0) && (this.pointerMoved = !0, this.move(a, s, t));
1388
- break;
1389
- case it:
1390
- this.zoom(mi(r), !1, null, t);
1391
- break;
1392
- case Se: {
1393
- this.action = "switched";
1394
- var l = Math.abs(a);
1395
- l > 1 && l > Math.abs(s) && (this.pointers = {}, a > 1 ? this.prev(i.loop) : a < -1 && this.next(i.loop));
1396
- break;
1397
- }
1398
- }
1399
- y(r, function(h) {
1400
- h.startX = h.endX, h.startY = h.endY;
1401
- });
1402
- }
1403
- },
1404
- isSwitchable: function() {
1405
- var t = this.imageData, i = this.viewerData;
1406
- return this.length > 1 && t.x >= 0 && t.y >= 0 && t.width <= i.width && t.height <= i.height;
1407
- }
1408
- }, _i = V.Viewer, Si = function(e) {
1409
- return function() {
1410
- return e += 1, e;
1411
- };
1412
- }(-1), Ae = /* @__PURE__ */ function() {
1413
- function e(t) {
1414
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1415
- if (Ke(this, e), !t || t.nodeType !== 1)
1416
- throw new Error("The first argument is required and must be an element.");
1417
- this.element = t, this.options = C({}, Ft, B(i) && i), 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 = Si(), this.init();
1418
- }
1419
- return Ge(e, [{
1420
- key: "init",
1421
- value: function() {
1422
- var i = this, r = this.element, n = this.options;
1423
- if (!r[v]) {
1424
- r[v] = this, n.focus && !n.keyboard && (n.focus = !1);
1425
- var a = r.localName === "img", s = [];
1426
- if (y(a ? [r] : r.querySelectorAll("img"), function(o) {
1427
- p(n.filter) ? n.filter.call(i, o) && s.push(o) : i.getImageURL(o) && s.push(o);
1428
- }), this.isImg = a, this.length = s.length, this.images = s, this.initBody(), U(document.createElement(v).style.transition) && (n.transition = !1), n.inline) {
1429
- var l = 0, h = function() {
1430
- if (l += 1, l === i.length) {
1431
- var u;
1432
- i.initializing = !1, i.delaying = {
1433
- abort: function() {
1434
- clearTimeout(u);
1435
- }
1436
- }, u = setTimeout(function() {
1437
- i.delaying = !1, i.build();
1438
- }, 0);
1439
- }
1440
- };
1441
- this.initializing = {
1442
- abort: function() {
1443
- y(s, function(u) {
1444
- u.complete || (b(u, $, h), b(u, W, h));
1445
- });
1446
- }
1447
- }, y(s, function(o) {
1448
- if (o.complete)
1449
- h();
1450
- else {
1451
- var u, c;
1452
- d(o, $, u = function() {
1453
- b(o, W, c), h();
1454
- }, {
1455
- once: !0
1456
- }), d(o, W, c = function() {
1457
- b(o, $, u), h();
1458
- }, {
1459
- once: !0
1460
- });
1461
- }
1462
- });
1463
- } else
1464
- d(r, J, this.onStart = function(o) {
1465
- var u = o.target;
1466
- u.localName === "img" && (!p(n.filter) || n.filter.call(i, u)) && i.view(i.images.indexOf(u));
1467
- });
1468
- }
1469
- }
1470
- }, {
1471
- key: "build",
1472
- value: function() {
1473
- if (!this.ready) {
1474
- var i = this.element, r = this.options, n = i.parentNode, a = document.createElement("div");
1475
- a.innerHTML = Qe;
1476
- var s = a.querySelector(".".concat(v, "-container")), l = s.querySelector(".".concat(v, "-title")), h = s.querySelector(".".concat(v, "-toolbar")), o = s.querySelector(".".concat(v, "-navbar")), u = s.querySelector(".".concat(v, "-button")), c = s.querySelector(".".concat(v, "-canvas"));
1477
- if (this.parent = n, this.viewer = s, this.title = l, this.toolbar = h, this.navbar = o, this.button = u, this.canvas = c, this.footer = s.querySelector(".".concat(v, "-footer")), this.tooltipBox = s.querySelector(".".concat(v, "-tooltip")), this.player = s.querySelector(".".concat(v, "-player")), this.list = s.querySelector(".".concat(v, "-list")), s.id = "".concat(v).concat(this.id), l.id = "".concat(v, "Title").concat(this.id), f(l, r.title ? ut(Array.isArray(r.title) ? r.title[0] : r.title) : Y), f(o, r.navbar ? ut(r.navbar) : Y), st(u, Y, !r.button), r.keyboard && u.setAttribute("tabindex", 0), r.backdrop && (f(s, "".concat(v, "-backdrop")), !r.inline && r.backdrop !== "static" && xt(c, mt, "hide")), at(r.className) && r.className && r.className.split($t).forEach(function(T) {
1478
- f(s, T);
1479
- }), r.toolbar) {
1480
- var g = document.createElement("ul"), I = B(r.toolbar), S = lt.slice(0, 3), E = lt.slice(7, 9), x = lt.slice(9);
1481
- I || f(h, ut(r.toolbar)), y(I ? r.toolbar : lt, function(T, R) {
1482
- var F = I && B(T), P = I ? kt(R) : T, M = F && !U(T.show) ? T.show : T;
1483
- if (!(!M || !r.zoomable && S.indexOf(P) !== -1 || !r.rotatable && E.indexOf(P) !== -1 || !r.scalable && x.indexOf(P) !== -1)) {
1484
- var tt = F && !U(T.size) ? T.size : T, X = F && !U(T.click) ? T.click : T, j = document.createElement("li");
1485
- r.keyboard && j.setAttribute("tabindex", 0), j.setAttribute("role", "button"), f(j, "".concat(v, "-").concat(P)), p(X) || xt(j, mt, P), _(M) && f(j, ut(M)), ["small", "large"].indexOf(tt) !== -1 ? f(j, "".concat(v, "-").concat(tt)) : P === "play" && f(j, "".concat(v, "-large")), p(X) && d(j, J, X), g.appendChild(j);
1486
- }
1487
- }), h.appendChild(g);
1488
- } else
1489
- f(h, Y);
1490
- if (!r.rotatable) {
1491
- var D = h.querySelectorAll('li[class*="rotate"]');
1492
- f(D, rt), y(D, function(T) {
1493
- h.appendChild(T);
1494
- });
1495
- }
1496
- if (r.inline)
1497
- f(u, ei), z(s, {
1498
- zIndex: r.zIndexInline
1499
- }), window.getComputedStyle(n).position === "static" && z(n, {
1500
- position: "relative"
1501
- }), n.insertBefore(s, i.nextSibling);
1502
- else {
1503
- f(u, ti), f(s, It), f(s, vt), f(s, Y), z(s, {
1504
- zIndex: r.zIndex
1505
- });
1506
- var N = r.container;
1507
- at(N) && (N = i.ownerDocument.querySelector(N)), N || (N = this.body), N.appendChild(s);
1508
- }
1509
- if (r.inline && (this.render(), this.bind(), this.isShown = !0), this.ready = !0, p(r.ready) && d(i, Zt, r.ready, {
1510
- once: !0
1511
- }), A(i, Zt) === !1) {
1512
- this.ready = !1;
1513
- return;
1514
- }
1515
- this.ready && r.inline && this.view(this.index);
1516
- }
1517
- }
1518
- /**
1519
- * Get the no conflict viewer class.
1520
- * @returns {Viewer} The viewer class.
1521
- */
1522
- }], [{
1523
- key: "noConflict",
1524
- value: function() {
1525
- return window.Viewer = _i, e;
1526
- }
1527
- /**
1528
- * Change the default options.
1529
- * @param {Object} options - The new default options.
1530
- */
1531
- }, {
1532
- key: "setDefaults",
1533
- value: function(i) {
1534
- C(Ft, B(i) && i);
1535
- }
1536
- }]), e;
1537
- }();
1538
- C(Ae.prototype, bi, yi, wi, Ti, Ei);
1539
- /*!
1540
- * v-viewer v3.0.11
1541
- * https://github.com/mirari/v-viewer#readme
1542
- *
1543
- * Copyright 2022 mirari
1544
- * Released under the MIT license
1545
- *
1546
- * Date: 2022-10-25T08:49:33.301Z
1547
- */
1548
- var ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1549
- function Oi(e) {
1550
- return e;
1551
- }
1552
- var xe = Oi;
1553
- function Ii(e, t, i) {
1554
- switch (i.length) {
1555
- case 0:
1556
- return e.call(t);
1557
- case 1:
1558
- return e.call(t, i[0]);
1559
- case 2:
1560
- return e.call(t, i[0], i[1]);
1561
- case 3:
1562
- return e.call(t, i[0], i[1], i[2]);
1563
- }
1564
- return e.apply(t, i);
1565
- }
1566
- var Ai = Ii, xi = Ai, de = Math.max;
1567
- function Di(e, t, i) {
1568
- return t = de(t === void 0 ? e.length - 1 : t, 0), function() {
1569
- for (var r = arguments, n = -1, a = de(r.length - t, 0), s = Array(a); ++n < a; )
1570
- s[n] = r[t + n];
1571
- n = -1;
1572
- for (var l = Array(t + 1); ++n < t; )
1573
- l[n] = r[n];
1574
- return l[t] = i(s), xi(e, this, l);
1575
- };
1576
- }
1577
- var Ni = Di;
1578
- function Ci(e) {
1579
- return function() {
1580
- return e;
1581
- };
1582
- }
1583
- var Li = Ci, $i = typeof ct == "object" && ct && ct.Object === Object && ct, De = $i, ki = De, zi = typeof self == "object" && self && self.Object === Object && self, Pi = ki || zi || Function("return this")(), zt = Pi, Ri = zt, ji = Ri.Symbol, Ne = ji, ve = Ne, Ce = Object.prototype, Vi = Ce.hasOwnProperty, Fi = Ce.toString, et = ve ? ve.toStringTag : void 0;
1584
- function Mi(e) {
1585
- var t = Vi.call(e, et), i = e[et];
1586
- try {
1587
- e[et] = void 0;
1588
- var r = !0;
1589
- } catch {
1590
- }
1591
- var n = Fi.call(e);
1592
- return r && (t ? e[et] = i : delete e[et]), n;
1593
- }
1594
- var Yi = Mi, Wi = Object.prototype, Xi = Wi.toString;
1595
- function qi(e) {
1596
- return Xi.call(e);
1597
- }
1598
- var Hi = qi, ge = Ne, Ui = Yi, Bi = Hi, Ki = "[object Null]", Gi = "[object Undefined]", me = ge ? ge.toStringTag : void 0;
1599
- function Zi(e) {
1600
- return e == null ? e === void 0 ? Gi : Ki : me && me in Object(e) ? Ui(e) : Bi(e);
1601
- }
1602
- var Pt = Zi;
1603
- function Ji(e) {
1604
- var t = typeof e;
1605
- return e != null && (t == "object" || t == "function");
1606
- }
1607
- var bt = Ji, Qi = Pt, tr = bt, er = "[object AsyncFunction]", ir = "[object Function]", rr = "[object GeneratorFunction]", nr = "[object Proxy]";
1608
- function ar(e) {
1609
- if (!tr(e))
1610
- return !1;
1611
- var t = Qi(e);
1612
- return t == ir || t == rr || t == er || t == nr;
1613
- }
1614
- var Le = ar, sr = zt, or = sr["__core-js_shared__"], lr = or, _t = lr, pe = function() {
1615
- var e = /[^.]+$/.exec(_t && _t.keys && _t.keys.IE_PROTO || "");
1616
- return e ? "Symbol(src)_1." + e : "";
1617
- }();
1618
- function ur(e) {
1619
- return !!pe && pe in e;
1620
- }
1621
- var hr = ur, cr = Function.prototype, fr = cr.toString;
1622
- function dr(e) {
1623
- if (e != null) {
1624
- try {
1625
- return fr.call(e);
1626
- } catch {
1627
- }
1628
- try {
1629
- return e + "";
1630
- } catch {
1631
- }
1632
- }
1633
- return "";
1634
- }
1635
- var vr = dr, gr = Le, mr = hr, pr = bt, br = vr, yr = /[\\^$.*+?()[\]{}|]/g, wr = /^\[object .+?Constructor\]$/, Tr = Function.prototype, Er = Object.prototype, _r = Tr.toString, Sr = Er.hasOwnProperty, Or = RegExp("^" + _r.call(Sr).replace(yr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
1636
- function Ir(e) {
1637
- if (!pr(e) || mr(e))
1638
- return !1;
1639
- var t = gr(e) ? Or : wr;
1640
- return t.test(br(e));
1641
- }
1642
- var Ar = Ir;
1643
- function xr(e, t) {
1644
- return e == null ? void 0 : e[t];
1645
- }
1646
- var Dr = xr, Nr = Ar, Cr = Dr;
1647
- function Lr(e, t) {
1648
- var i = Cr(e, t);
1649
- return Nr(i) ? i : void 0;
1650
- }
1651
- var $r = Lr, kr = $r, zr = function() {
1652
- try {
1653
- var e = kr(Object, "defineProperty");
1654
- return e({}, "", {}), e;
1655
- } catch {
1656
- }
1657
- }(), Pr = zr, Rr = Li, be = Pr, jr = xe, Vr = be ? function(e, t) {
1658
- return be(e, "toString", {
1659
- configurable: !0,
1660
- enumerable: !1,
1661
- value: Rr(t),
1662
- writable: !0
1663
- });
1664
- } : jr, Fr = Vr, Mr = 800, Yr = 16, Wr = Date.now;
1665
- function Xr(e) {
1666
- var t = 0, i = 0;
1667
- return function() {
1668
- var r = Wr(), n = Yr - (r - i);
1669
- if (i = r, n > 0) {
1670
- if (++t >= Mr)
1671
- return arguments[0];
1672
- } else
1673
- t = 0;
1674
- return e.apply(void 0, arguments);
1675
- };
1676
- }
1677
- var qr = Xr, Hr = Fr, Ur = qr, Br = Ur(Hr), Kr = Br, Gr = xe, Zr = Ni, Jr = Kr;
1678
- function Qr(e, t) {
1679
- return Jr(Zr(e, t, Gr), e + "");
1680
- }
1681
- var tn = Qr;
1682
- function en(e, t) {
1683
- return e === t || e !== e && t !== t;
1684
- }
1685
- var $e = en, rn = 9007199254740991;
1686
- function nn(e) {
1687
- return typeof e == "number" && e > -1 && e % 1 == 0 && e <= rn;
1688
- }
1689
- var ke = nn, an = Le, sn = ke;
1690
- function on(e) {
1691
- return e != null && sn(e.length) && !an(e);
1692
- }
1693
- var ze = on, ln = 9007199254740991, un = /^(?:0|[1-9]\d*)$/;
1694
- function hn(e, t) {
1695
- var i = typeof e;
1696
- return t = t ?? ln, !!t && (i == "number" || i != "symbol" && un.test(e)) && e > -1 && e % 1 == 0 && e < t;
1697
- }
1698
- var Pe = hn, cn = $e, fn = ze, dn = Pe, vn = bt;
1699
- function gn(e, t, i) {
1700
- if (!vn(i))
1701
- return !1;
1702
- var r = typeof t;
1703
- return (r == "number" ? fn(i) && dn(t, i.length) : r == "string" && t in i) ? cn(i[t], e) : !1;
1704
- }
1705
- var mn = gn;
1706
- function pn(e, t) {
1707
- for (var i = -1, r = Array(e); ++i < e; )
1708
- r[i] = t(i);
1709
- return r;
1710
- }
1711
- var bn = pn;
1712
- function yn(e) {
1713
- return e != null && typeof e == "object";
1714
- }
1715
- var Rt = yn, wn = Pt, Tn = Rt, En = "[object Arguments]";
1716
- function _n(e) {
1717
- return Tn(e) && wn(e) == En;
1718
- }
1719
- var Sn = _n, ye = Sn, On = Rt, Re = Object.prototype, In = Re.hasOwnProperty, An = Re.propertyIsEnumerable, xn = ye(function() {
1720
- return arguments;
1721
- }()) ? ye : function(e) {
1722
- return On(e) && In.call(e, "callee") && !An.call(e, "callee");
1723
- }, Dn = xn, Nn = Array.isArray, Cn = Nn, Dt = { exports: {} };
1724
- function Ln() {
1725
- return !1;
1726
- }
1727
- var $n = Ln;
1728
- (function(e, t) {
1729
- var i = zt, r = $n, n = t && !t.nodeType && t, a = n && !0 && e && !e.nodeType && e, s = a && a.exports === n, l = s ? i.Buffer : void 0, h = l ? l.isBuffer : void 0, o = h || r;
1730
- e.exports = o;
1731
- })(Dt, Dt.exports);
1732
- var kn = Pt, zn = ke, Pn = Rt, Rn = "[object Arguments]", jn = "[object Array]", Vn = "[object Boolean]", Fn = "[object Date]", Mn = "[object Error]", Yn = "[object Function]", Wn = "[object Map]", Xn = "[object Number]", qn = "[object Object]", Hn = "[object RegExp]", Un = "[object Set]", Bn = "[object String]", Kn = "[object WeakMap]", Gn = "[object ArrayBuffer]", Zn = "[object DataView]", Jn = "[object Float32Array]", Qn = "[object Float64Array]", ta = "[object Int8Array]", ea = "[object Int16Array]", ia = "[object Int32Array]", ra = "[object Uint8Array]", na = "[object Uint8ClampedArray]", aa = "[object Uint16Array]", sa = "[object Uint32Array]", w = {};
1733
- w[Jn] = w[Qn] = w[ta] = w[ea] = w[ia] = w[ra] = w[na] = w[aa] = w[sa] = !0;
1734
- w[Rn] = w[jn] = w[Gn] = w[Vn] = w[Zn] = w[Fn] = w[Mn] = w[Yn] = w[Wn] = w[Xn] = w[qn] = w[Hn] = w[Un] = w[Bn] = w[Kn] = !1;
1735
- function oa(e) {
1736
- return Pn(e) && zn(e.length) && !!w[kn(e)];
1737
- }
1738
- var la = oa;
1739
- function ua(e) {
1740
- return function(t) {
1741
- return e(t);
1742
- };
1743
- }
1744
- var ha = ua, Nt = { exports: {} };
1745
- (function(e, t) {
1746
- var i = De, r = t && !t.nodeType && t, n = r && !0 && e && !e.nodeType && e, a = n && n.exports === r, s = a && i.process, l = function() {
1747
- try {
1748
- var h = n && n.require && n.require("util").types;
1749
- return h || s && s.binding && s.binding("util");
1750
- } catch {
1751
- }
1752
- }();
1753
- e.exports = l;
1754
- })(Nt, Nt.exports);
1755
- var ca = la, fa = ha, we = Nt.exports, Te = we && we.isTypedArray, da = Te ? fa(Te) : ca, va = da, ga = bn, ma = Dn, pa = Cn, ba = Dt.exports, ya = Pe, wa = va, Ta = Object.prototype, Ea = Ta.hasOwnProperty;
1756
- function _a(e, t) {
1757
- var i = pa(e), r = !i && ma(e), n = !i && !r && ba(e), a = !i && !r && !n && wa(e), s = i || r || n || a, l = s ? ga(e.length, String) : [], h = l.length;
1758
- for (var o in e)
1759
- (t || Ea.call(e, o)) && !(s && (o == "length" || n && (o == "offset" || o == "parent") || a && (o == "buffer" || o == "byteLength" || o == "byteOffset") || ya(o, h))) && l.push(o);
1760
- return l;
1761
- }
1762
- var Sa = _a, Oa = Object.prototype;
1763
- function Ia(e) {
1764
- var t = e && e.constructor, i = typeof t == "function" && t.prototype || Oa;
1765
- return e === i;
1766
- }
1767
- var Aa = Ia;
1768
- function xa(e) {
1769
- var t = [];
1770
- if (e != null)
1771
- for (var i in Object(e))
1772
- t.push(i);
1773
- return t;
1774
- }
1775
- var Da = xa, Na = bt, Ca = Aa, La = Da, $a = Object.prototype, ka = $a.hasOwnProperty;
1776
- function za(e) {
1777
- if (!Na(e))
1778
- return La(e);
1779
- var t = Ca(e), i = [];
1780
- for (var r in e)
1781
- r == "constructor" && (t || !ka.call(e, r)) || i.push(r);
1782
- return i;
1783
- }
1784
- var Pa = za, Ra = Sa, ja = Pa, Va = ze;
1785
- function Fa(e) {
1786
- return Va(e) ? Ra(e, !0) : ja(e);
1787
- }
1788
- var Ma = Fa, Ya = tn, Wa = $e, Xa = mn, qa = Ma, je = Object.prototype, Ha = je.hasOwnProperty;
1789
- Ya(function(e, t) {
1790
- e = Object(e);
1791
- var i = -1, r = t.length, n = r > 2 ? t[2] : void 0;
1792
- for (n && Xa(t[0], t[1], n) && (r = 1); ++i < r; )
1793
- for (var a = t[i], s = qa(a), l = -1, h = s.length; ++l < h; ) {
1794
- var o = s[l], u = e[o];
1795
- (u === void 0 || Wa(u, je[o]) && !Ha.call(e, o)) && (e[o] = a[o]);
1796
- }
1797
- return e;
1798
- });
1799
- const Ua = typeof window < "u" && window !== null;
1800
- Ba();
1801
- function Ba() {
1802
- return Ua && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype ? ("isIntersecting" in window.IntersectionObserverEntry.prototype || Object.defineProperty(window.IntersectionObserverEntry.prototype, "isIntersecting", {
1803
- get() {
1804
- return this.intersectionRatio > 0;
1805
- }
1806
- }), !0) : !1;
1807
- }
1808
- var Ka = (e, t) => {
1809
- const i = e.__vccOpts || e;
1810
- for (const [r, n] of t)
1811
- i[r] = n;
1812
- return i;
1171
+ function ge(e) {
1172
+ return !!he && he in e;
1173
+ }
1174
+ var _e = Function.prototype.toString;
1175
+ function ve(e) {
1176
+ if (e != null) {
1177
+ try {
1178
+ return _e.call(e);
1179
+ } catch (e) {}
1180
+ try {
1181
+ return e + "";
1182
+ } catch (e) {}
1183
+ }
1184
+ return "";
1185
+ }
1186
+ var ye = /[\\^$.*+?()[\]{}|]/g, be = /^\[object .+?Constructor\]$/, xe = Function.prototype, F = Object.prototype, Se = xe.toString, Ce = F.hasOwnProperty, we = RegExp("^" + Se.call(Ce).replace(ye, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
1187
+ function Te(e) {
1188
+ return !N(e) || ge(e) ? !1 : (me(e) ? we : be).test(ve(e));
1189
+ }
1190
+ function Ee(e, t) {
1191
+ return e == null ? void 0 : e[t];
1192
+ }
1193
+ function De(e, t) {
1194
+ var n = Ee(e, t);
1195
+ return Te(n) ? n : void 0;
1196
+ }
1197
+ function Oe(e, t, n) {
1198
+ switch (n.length) {
1199
+ case 0: return e.call(t);
1200
+ case 1: return e.call(t, n[0]);
1201
+ case 2: return e.call(t, n[0], n[1]);
1202
+ case 3: return e.call(t, n[0], n[1], n[2]);
1203
+ }
1204
+ return e.apply(t, n);
1205
+ }
1206
+ var ke = 800, Ae = 16, je = Date.now;
1207
+ function Me(e) {
1208
+ var t = 0, n = 0;
1209
+ return function() {
1210
+ var r = je(), i = Ae - (r - n);
1211
+ if (n = r, i > 0) {
1212
+ if (++t >= ke) return arguments[0];
1213
+ } else t = 0;
1214
+ return e.apply(void 0, arguments);
1215
+ };
1216
+ }
1217
+ function Ne(e) {
1218
+ return function() {
1219
+ return e;
1220
+ };
1221
+ }
1222
+ var I = function() {
1223
+ try {
1224
+ var e = De(Object, "defineProperty");
1225
+ return e({}, "", {}), e;
1226
+ } catch (e) {}
1227
+ }(), L = Me(I ? function(e, t) {
1228
+ return I(e, "toString", {
1229
+ configurable: !0,
1230
+ enumerable: !1,
1231
+ value: Ne(t),
1232
+ writable: !0
1233
+ });
1234
+ } : le), Pe = 9007199254740991, R = /^(?:0|[1-9]\d*)$/;
1235
+ function z(e, t) {
1236
+ var n = typeof e;
1237
+ return t = t == null ? Pe : t, !!t && (n == "number" || n != "symbol" && R.test(e)) && e > -1 && e % 1 == 0 && e < t;
1238
+ }
1239
+ function B(e, t, n) {
1240
+ t == "__proto__" && I ? I(e, t, {
1241
+ configurable: !0,
1242
+ enumerable: !0,
1243
+ value: n,
1244
+ writable: !0
1245
+ }) : e[t] = n;
1246
+ }
1247
+ function Fe(e, t) {
1248
+ return e === t || e !== e && t !== t;
1249
+ }
1250
+ var V = Object.prototype.hasOwnProperty;
1251
+ function H(e, t, n) {
1252
+ var r = e[t];
1253
+ (!(V.call(e, t) && Fe(r, n)) || n === void 0 && !(t in e)) && B(e, t, n);
1254
+ }
1255
+ function U(e, t, n, r) {
1256
+ var i = !n;
1257
+ n || (n = {});
1258
+ for (var a = -1, o = t.length; ++a < o;) {
1259
+ var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
1260
+ c === void 0 && (c = e[s]), i ? B(n, s, c) : H(n, s, c);
1261
+ }
1262
+ return n;
1263
+ }
1264
+ var W = Math.max;
1265
+ function Ie(e, t, n) {
1266
+ return t = W(t === void 0 ? e.length - 1 : t, 0), function() {
1267
+ for (var r = arguments, i = -1, a = W(r.length - t, 0), o = Array(a); ++i < a;) o[i] = r[t + i];
1268
+ i = -1;
1269
+ for (var s = Array(t + 1); ++i < t;) s[i] = r[i];
1270
+ return s[t] = n(o), Oe(e, this, s);
1271
+ };
1272
+ }
1273
+ function G(e, t) {
1274
+ return L(Ie(e, t, le), e + "");
1275
+ }
1276
+ var Le = 9007199254740991;
1277
+ function K(e) {
1278
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Le;
1279
+ }
1280
+ function q(e) {
1281
+ return e != null && K(e.length) && !me(e);
1282
+ }
1283
+ function J(e, t, n) {
1284
+ if (!N(n)) return !1;
1285
+ var r = typeof t;
1286
+ return (r == "number" ? q(n) && z(t, n.length) : r == "string" && t in n) ? Fe(n[t], e) : !1;
1287
+ }
1288
+ function Re(e) {
1289
+ return G(function(t, n) {
1290
+ var r = -1, i = n.length, a = i > 1 ? n[i - 1] : void 0, o = i > 2 ? n[2] : void 0;
1291
+ for (a = e.length > 3 && typeof a == "function" ? (i--, a) : void 0, o && J(n[0], n[1], o) && (a = i < 3 ? void 0 : a, i = 1), t = Object(t); ++r < i;) {
1292
+ var s = n[r];
1293
+ s && e(t, s, r, a);
1294
+ }
1295
+ return t;
1296
+ });
1297
+ }
1298
+ var ze = Object.prototype;
1299
+ function Be(e) {
1300
+ var t = e && e.constructor;
1301
+ return e === (typeof t == "function" && t.prototype || ze);
1302
+ }
1303
+ function Y(e, t) {
1304
+ for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
1305
+ return r;
1306
+ }
1307
+ var Ve = "[object Arguments]";
1308
+ function He(e) {
1309
+ return ce(e) && se(e) == Ve;
1310
+ }
1311
+ var X = Object.prototype, Z = X.hasOwnProperty, Q = X.propertyIsEnumerable, Ue = He(function() {
1312
+ return arguments;
1313
+ }()) ? He : function(e) {
1314
+ return ce(e) && Z.call(e, "callee") && !Q.call(e, "callee");
1813
1315
  };
1814
- const Ga = Ee({
1815
- name: "Viewer",
1816
- props: {
1817
- images: {
1818
- type: Array,
1819
- default: () => []
1820
- },
1821
- rebuild: {
1822
- type: Boolean,
1823
- default: !1
1824
- },
1825
- trigger: {
1826
- type: Object,
1827
- default: null
1828
- },
1829
- options: {
1830
- type: Object,
1831
- default: () => null
1832
- }
1833
- },
1834
- emits: ["inited"],
1835
- setup(e, { emit: t }) {
1836
- let i;
1837
- const r = Ve();
1838
- function n() {
1839
- i = new Ae(r.value, e.options), t("inited", i);
1840
- }
1841
- function a() {
1842
- i && i.destroy();
1843
- }
1844
- function s() {
1845
- a(), n();
1846
- }
1847
- function l() {
1848
- i ? (i.update(), t("inited", i)) : n();
1849
- }
1850
- function h() {
1851
- e.rebuild ? s() : l();
1852
- }
1853
- const o = { deep: !0 };
1854
- return yt(() => e.images, () => wt(() => h()), o), yt(() => e.trigger, () => wt(() => h()), o), yt(() => e.options, () => wt(() => s()), o), Fe(() => n()), Me(() => a()), {
1855
- root: r,
1856
- createViewer: n,
1857
- rebuildViewer: s,
1858
- updateViewer: l,
1859
- destroyViewer: a
1860
- };
1861
- }
1862
- }), Za = { ref: "root" };
1863
- function Ja(e, t, i, r, n, a) {
1864
- return ft(), St("div", Za, [
1865
- Ye(e.$slots, "default", {
1866
- images: e.images,
1867
- options: e.options
1868
- })
1869
- ], 512);
1870
- }
1871
- var Qa = /* @__PURE__ */ Ka(Ga, [["render", Ja]]);
1872
- const ts = ["src"], es = /* @__PURE__ */ Ee({
1873
- __name: "ImageViewer",
1874
- props: {
1875
- image: null
1876
- },
1877
- setup(e) {
1878
- const t = e, i = We(() => t.image ? [{ src: t.image, index: 0 }] : []);
1879
- return (r, n) => (ft(), Xe(Tt(Qa), {
1880
- images: Tt(i),
1881
- style: { height: "100%" }
1882
- }, {
1883
- default: qe(() => [
1884
- (ft(!0), St(He, null, Ue(Tt(i), (a) => (ft(), St("img", {
1885
- alt: "图片",
1886
- src: a.src,
1887
- key: a.index,
1888
- class: "image"
1889
- }, null, 8, ts))), 128))
1890
- ]),
1891
- _: 1
1892
- }, 8, ["images"]));
1893
- }
1316
+ function We() {
1317
+ return !1;
1318
+ }
1319
+ var Ge = typeof exports == "object" && exports && !exports.nodeType && exports, Ke = Ge && typeof module == "object" && module && !module.nodeType && module, qe = Ke && Ke.exports === Ge ? re.Buffer : void 0, Je = (qe ? qe.isBuffer : void 0) || We, Ye = "[object Arguments]", Xe = "[object Array]", Ze = "[object Boolean]", Qe = "[object Date]", $e = "[object Error]", et = "[object Function]", tt = "[object Map]", nt = "[object Number]", rt = "[object Object]", it = "[object RegExp]", at = "[object Set]", ot = "[object String]", st = "[object WeakMap]", ct = "[object ArrayBuffer]", lt = "[object DataView]", ut = "[object Float32Array]", dt = "[object Float64Array]", ft = "[object Int8Array]", pt = "[object Int16Array]", mt = "[object Int32Array]", ht = "[object Uint8Array]", gt = "[object Uint8ClampedArray]", _t = "[object Uint16Array]", vt = "[object Uint32Array]", $ = {};
1320
+ $[ut] = $[dt] = $[ft] = $[pt] = $[mt] = $[ht] = $[gt] = $[_t] = $[vt] = !0, $[Ye] = $[Xe] = $[ct] = $[Ze] = $[lt] = $[Qe] = $[$e] = $[et] = $[tt] = $[nt] = $[rt] = $[it] = $[at] = $[ot] = $[st] = !1;
1321
+ function yt(e) {
1322
+ return ce(e) && K(e.length) && !!$[se(e)];
1323
+ }
1324
+ function bt(e) {
1325
+ return function(t) {
1326
+ return e(t);
1327
+ };
1328
+ }
1329
+ var xt = typeof exports == "object" && exports && !exports.nodeType && exports, St = xt && typeof module == "object" && module && !module.nodeType && module, Ct = St && St.exports === xt && C.process, wt = function() {
1330
+ try {
1331
+ return St && St.require && St.require("util").types || Ct && Ct.binding && Ct.binding("util");
1332
+ } catch (e) {}
1333
+ }(), Tt = wt && wt.isTypedArray, Et = Tt ? bt(Tt) : yt, Dt = Object.prototype.hasOwnProperty;
1334
+ function Ot(e, t) {
1335
+ var n = M(e), r = !n && Ue(e), i = !n && !r && Je(e), a = !n && !r && !i && Et(e), o = n || r || i || a, s = o ? Y(e.length, String) : [], c = s.length;
1336
+ for (var l in e) (t || Dt.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || z(l, c))) && s.push(l);
1337
+ return s;
1338
+ }
1339
+ function kt(e, t) {
1340
+ return function(n) {
1341
+ return e(t(n));
1342
+ };
1343
+ }
1344
+ var At = kt(Object.keys, Object), jt = Object.prototype.hasOwnProperty;
1345
+ function Mt(e) {
1346
+ if (!Be(e)) return At(e);
1347
+ var t = [];
1348
+ for (var n in Object(e)) jt.call(e, n) && n != "constructor" && t.push(n);
1349
+ return t;
1350
+ }
1351
+ function Nt(e) {
1352
+ return q(e) ? Ot(e) : Mt(e);
1353
+ }
1354
+ var Pt = Object.prototype.hasOwnProperty;
1355
+ Re(function(e, t) {
1356
+ if (Be(t) || q(t)) {
1357
+ U(t, Nt(t), e);
1358
+ return;
1359
+ }
1360
+ for (var n in t) Pt.call(t, n) && H(e, n, t[n]);
1894
1361
  });
1895
- const ns = /* @__PURE__ */ Be(es, [["__scopeId", "data-v-b0f61c51"]]);
1896
- export {
1897
- ns as default
1898
- };
1362
+ function Ft(e) {
1363
+ var t = [];
1364
+ if (e != null) for (var n in Object(e)) t.push(n);
1365
+ return t;
1366
+ }
1367
+ var It = Object.prototype.hasOwnProperty;
1368
+ function Lt(e) {
1369
+ if (!N(e)) return Ft(e);
1370
+ var t = Be(e), n = [];
1371
+ for (var r in e) r == "constructor" && (t || !It.call(e, r)) || n.push(r);
1372
+ return n;
1373
+ }
1374
+ function Rt(e) {
1375
+ return q(e) ? Ot(e, !0) : Lt(e);
1376
+ }
1377
+ var zt = Object.prototype, Bt = zt.hasOwnProperty;
1378
+ G(function(e, t) {
1379
+ e = Object(e);
1380
+ var n = -1, r = t.length, i = r > 2 ? t[2] : void 0;
1381
+ for (i && J(t[0], t[1], i) && (r = 1); ++n < r;) for (var a = t[n], o = Rt(a), s = -1, c = o.length; ++s < c;) {
1382
+ var l = o[s], u = e[l];
1383
+ (u === void 0 || Fe(u, zt[l]) && !Bt.call(e, l)) && (e[l] = a[l]);
1384
+ }
1385
+ return e;
1386
+ });
1387
+ var Vt = d({
1388
+ name: "Viewer",
1389
+ props: {
1390
+ images: {
1391
+ type: Array,
1392
+ default: () => []
1393
+ },
1394
+ rebuild: {
1395
+ type: Boolean,
1396
+ default: !1
1397
+ },
1398
+ trigger: {
1399
+ type: Object,
1400
+ default: null
1401
+ },
1402
+ options: {
1403
+ type: Object,
1404
+ default: () => null
1405
+ }
1406
+ },
1407
+ emits: ["inited"],
1408
+ setup(e, { emit: t }) {
1409
+ let n, r = v();
1410
+ function i() {
1411
+ n = new te.default(r.value, e.options), t("inited", n);
1412
+ }
1413
+ function a() {
1414
+ n && n.destroy();
1415
+ }
1416
+ function o() {
1417
+ a(), i();
1418
+ }
1419
+ function s() {
1420
+ n ? (n.update(), t("inited", n)) : i();
1421
+ }
1422
+ function c() {
1423
+ e.rebuild ? o() : s();
1424
+ }
1425
+ let l = { deep: !0 };
1426
+ return S(() => e.images, () => {
1427
+ f(() => {
1428
+ c();
1429
+ });
1430
+ }, l), S(() => e.trigger, () => {
1431
+ f(() => {
1432
+ c();
1433
+ });
1434
+ }, l), S(() => e.options, () => {
1435
+ f(() => {
1436
+ o();
1437
+ });
1438
+ }, l), h(() => i()), g(() => a()), {
1439
+ root: r,
1440
+ createViewer: i,
1441
+ rebuildViewer: o,
1442
+ updateViewer: s,
1443
+ destroyViewer: a
1444
+ };
1445
+ }
1446
+ }), Ht = (e, t) => {
1447
+ let n = e.__vccOpts || e;
1448
+ for (let [e, r] of t) n[e] = r;
1449
+ return n;
1450
+ }, Ut = { ref: "root" };
1451
+ function Wt(e, t, n, r, i, a) {
1452
+ return _(), l("div", Ut, [b(e.$slots, "default", {
1453
+ images: e.images,
1454
+ options: e.options
1455
+ })], 512);
1456
+ }
1457
+ var Gt = /* @__PURE__ */ Ht(Vt, [["render", Wt]]), Kt = ["src"], qt = /*#__PURE__*/ o(/* @__PURE__ */ d({
1458
+ __name: "ImageViewer",
1459
+ props: { image: {} },
1460
+ setup(e) {
1461
+ let t = e, n = v(null), o = v(1), d = v(0), f = a(), g = null, b = c(() => t.image ? [{
1462
+ src: t.image,
1463
+ index: 0
1464
+ }] : []), te = c(() => ({ height: d.value ? `${Math.max(1, Math.round(d.value * o.value))}px` : `${o.value * 100}%` })), C = (e) => Math.min(5, Math.max(.1, Number(e.toFixed(2)))), ne = () => {
1465
+ o.value = C(o.value + .15);
1466
+ }, re = () => {
1467
+ o.value = C(o.value - .15);
1468
+ }, w = () => {
1469
+ o.value = 1;
1470
+ }, T = () => ({
1471
+ scale: o.value,
1472
+ label: `${Math.round(o.value * 100)}%`,
1473
+ canZoomIn: o.value < 5,
1474
+ canZoomOut: o.value > .1,
1475
+ canReset: o.value !== 1,
1476
+ minScale: .1,
1477
+ maxScale: 5
1478
+ }), E = () => {
1479
+ let e = n.value;
1480
+ e && r(e, {
1481
+ zoomIn: () => (ne(), T()),
1482
+ zoomOut: () => (re(), T()),
1483
+ resetZoom: () => (w(), T()),
1484
+ setZoom: (e) => (o.value = C(e), T()),
1485
+ getState: T,
1486
+ subscribe: f.subscribe
1487
+ });
1488
+ }, D = () => {
1489
+ var e;
1490
+ d.value = ((e = n.value) == null ? void 0 : e.clientHeight) || 0;
1491
+ };
1492
+ return S([o, d], () => {
1493
+ f.emit();
1494
+ }), h(() => {
1495
+ E(), D(), n.value && (g = new ResizeObserver(D), g.observe(n.value));
1496
+ }), m(() => {
1497
+ g == null || g.disconnect(), g = null, i(n.value);
1498
+ }), (e, t) => (_(), l("div", {
1499
+ ref_key: "root",
1500
+ ref: n,
1501
+ class: "image-viewer",
1502
+ "data-viewer-zoom-provider": "image"
1503
+ }, [u(x(Gt), {
1504
+ images: b.value,
1505
+ class: "image-stage"
1506
+ }, {
1507
+ default: ee(() => [(_(!0), l(s, null, y(b.value, (e) => (_(), l("img", {
1508
+ alt: "图片",
1509
+ src: e.src,
1510
+ key: e.index,
1511
+ class: "image",
1512
+ style: p(te.value)
1513
+ }, null, 12, Kt))), 128))]),
1514
+ _: 1
1515
+ }, 8, ["images"])], 512));
1516
+ }
1517
+ }), [["__scopeId", "data-v-4dc76b9d"]]);
1518
+ //#endregion
1519
+ export { qt as default };