@vkzstudio/muza-ui 1.0.47 → 1.1.0

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 (778) hide show
  1. package/README.md +173 -171
  2. package/dist/Muza_BP_logo.svg +26 -26
  3. package/dist/components/Accordion/Accordion.d.ts +112 -18
  4. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  5. package/dist/components/Accordion/Accordion.js +208 -110
  6. package/dist/components/Accordion/Accordion.stories.d.ts +3 -0
  7. package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
  8. package/dist/components/Alert/Alert.d.ts +3 -1
  9. package/dist/components/Alert/Alert.d.ts.map +1 -1
  10. package/dist/components/Alert/Alert.js +28 -24
  11. package/dist/components/Button/Button.stories.d.ts.map +1 -1
  12. package/dist/components/ButtonArrow/ButtonArrow.stories.d.ts.map +1 -1
  13. package/dist/components/Calendar/Calendar.js +10 -11
  14. package/dist/components/Card/Card.stories.d.ts.map +1 -1
  15. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts +111 -0
  16. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts.map +1 -0
  17. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.js +115 -0
  18. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts +13 -0
  19. package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts.map +1 -0
  20. package/dist/components/CardCheckboxAmount/index.d.ts +2 -0
  21. package/dist/components/CardCheckboxAmount/index.d.ts.map +1 -0
  22. package/dist/components/Carousel/Carousel.d.ts +30 -3
  23. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  24. package/dist/components/Carousel/Carousel.js +112 -92
  25. package/dist/components/Carousel/Carousel.stories.d.ts.map +1 -1
  26. package/dist/components/Chip/Chip.d.ts.map +1 -1
  27. package/dist/components/Chip/Chip.js +6 -2
  28. package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
  29. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
  30. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  31. package/dist/components/DatePicker/DatePicker.js +10 -2
  32. package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -0
  33. package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
  34. package/dist/components/DatePickerButton/DatePickerButton.d.ts +97 -0
  35. package/dist/components/DatePickerButton/DatePickerButton.d.ts.map +1 -0
  36. package/dist/components/DatePickerButton/DatePickerButton.js +329 -0
  37. package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts +15 -0
  38. package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts.map +1 -0
  39. package/dist/components/DatePickerButton/index.d.ts +2 -0
  40. package/dist/components/DatePickerButton/index.d.ts.map +1 -0
  41. package/dist/components/Dialog/Dialog.js +1 -1
  42. package/dist/components/Dialog/Dialog.stories.d.ts +1 -0
  43. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  44. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +1 -0
  45. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
  46. package/dist/components/Icons/CustomBadges.d.ts +5 -0
  47. package/dist/components/Icons/CustomBadges.d.ts.map +1 -1
  48. package/dist/components/Icons/CustomBadges.js +216 -13
  49. package/dist/components/Icons/CustomLogos.d.ts +18 -2
  50. package/dist/components/Icons/CustomLogos.d.ts.map +1 -1
  51. package/dist/components/Icons/CustomLogos.js +103 -97
  52. package/dist/components/Icons/LogosAndBadges.stories.d.ts +1 -0
  53. package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
  54. package/dist/components/Input/Input.js +22 -32
  55. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +26 -1
  56. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
  57. package/dist/components/LanguageSwitcher/LanguageSwitcher.js +86 -44
  58. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +2 -0
  59. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
  60. package/dist/components/Lightbox/Lightbox.d.ts.map +1 -1
  61. package/dist/components/Lightbox/Lightbox.js +70 -54
  62. package/dist/components/Lightbox/Lightbox.stories.d.ts +1 -0
  63. package/dist/components/Lightbox/Lightbox.stories.d.ts.map +1 -1
  64. package/dist/components/Lightbox/LightboxOverrides.css +5 -5
  65. package/dist/components/LoginScreen/LoginScreen.js +8 -8
  66. package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
  67. package/dist/components/LoginScreen/LoginScreen3D/LoginScreen3DModel.js +10 -9
  68. package/dist/components/LoginScreen/LoginScreen3D/LoginScreen3DScene.js +21 -22
  69. package/dist/components/LoginScreen/LoginScreenItem.js +1 -1
  70. package/dist/components/MultiSelect/MultiSelect.stories.d.ts +1 -0
  71. package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
  72. package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
  73. package/dist/components/Popover/Popover.d.ts +8 -1
  74. package/dist/components/Popover/Popover.d.ts.map +1 -1
  75. package/dist/components/Popover/Popover.js +7 -6
  76. package/dist/components/Popover/Popover.stories.d.ts +1 -0
  77. package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
  78. package/dist/components/Reorderable/Reorderable.js +74 -78
  79. package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
  80. package/dist/components/ReorderableTable/ReorderableTable.js +1 -1
  81. package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
  82. package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
  83. package/dist/components/Select/Select.stories.d.ts +1 -0
  84. package/dist/components/Select/Select.stories.d.ts.map +1 -1
  85. package/dist/components/Sheet/Sheet.stories.d.ts +1 -0
  86. package/dist/components/Sheet/Sheet.stories.d.ts.map +1 -1
  87. package/dist/components/SwipeButton/SwipeButton.js +37 -42
  88. package/dist/components/Tag/Tag.js +1 -1
  89. package/dist/components/TextEditor/LinkBubbleMenu.js +2 -2
  90. package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
  91. package/dist/components/TextEditor/TextEditor.js +17 -14
  92. package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
  93. package/dist/components/Toast/Toast.stories.d.ts +1 -0
  94. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  95. package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
  96. package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts.map +1 -1
  97. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
  98. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
  99. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  100. package/dist/components/Typography/Typography.d.ts +10 -1
  101. package/dist/components/Typography/Typography.d.ts.map +1 -1
  102. package/dist/components/Typography/Typography.js +82 -67
  103. package/dist/components/Typography/Typography.stories.d.ts +1 -0
  104. package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
  105. package/dist/components/TypographyLink/TypographyLink.d.ts +72 -0
  106. package/dist/components/TypographyLink/TypographyLink.d.ts.map +1 -0
  107. package/dist/components/TypographyLink/TypographyLink.js +103 -0
  108. package/dist/components/TypographyLink/TypographyLink.stories.d.ts +12 -0
  109. package/dist/components/TypographyLink/TypographyLink.stories.d.ts.map +1 -0
  110. package/dist/components/TypographyLink/index.d.ts +2 -0
  111. package/dist/components/TypographyLink/index.d.ts.map +1 -0
  112. package/dist/components/UniversalFooter/UniversalFooter.d.ts +198 -0
  113. package/dist/components/UniversalFooter/UniversalFooter.d.ts.map +1 -0
  114. package/dist/components/UniversalFooter/UniversalFooter.js +401 -0
  115. package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts +19 -0
  116. package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts.map +1 -0
  117. package/dist/components/UniversalFooter/index.d.ts +2 -0
  118. package/dist/components/UniversalFooter/index.d.ts.map +1 -0
  119. package/dist/components/index.d.ts +4 -0
  120. package/dist/components/index.d.ts.map +1 -1
  121. package/dist/fonts/Objectivity/OFL.txt +92 -92
  122. package/dist/globals.css +12 -12
  123. package/dist/index.js +354 -322
  124. package/dist/muza-ui.css +1 -1
  125. package/dist/styles/3rd-parties.css +5 -5
  126. package/dist/styles/animations.css +21 -21
  127. package/dist/styles/breakpoints.css +4 -4
  128. package/dist/styles/primitives.css +163 -161
  129. package/dist/styles/token-colors.css +1445 -1437
  130. package/dist/styles/token-sizes.css +1553 -1513
  131. package/dist/styles/typography.css +113 -113
  132. package/dist/styles/utilities.css +66 -66
  133. package/dist/styles/white-label.css +26 -26
  134. package/dist/translations/TranslationContext.js +22 -24
  135. package/dist/translations/index.d.ts +1 -1
  136. package/dist/translations/index.d.ts.map +1 -1
  137. package/dist/translations/locales/cs.d.ts.map +1 -1
  138. package/dist/translations/locales/cs.js +9 -1
  139. package/dist/translations/locales/en.d.ts.map +1 -1
  140. package/dist/translations/locales/en.js +9 -1
  141. package/dist/translations/locales/sk.d.ts.map +1 -1
  142. package/dist/translations/locales/sk.js +9 -1
  143. package/dist/translations/types.d.ts +20 -0
  144. package/dist/translations/types.d.ts.map +1 -1
  145. package/llms-full.md +584 -584
  146. package/llms.txt +37 -37
  147. package/package.json +20 -24
  148. package/dist/_virtual/_commonjsHelpers.js +0 -6
  149. package/dist/_virtual/constants.js +0 -5
  150. package/dist/_virtual/constants2.js +0 -4
  151. package/dist/_virtual/index.js +0 -7
  152. package/dist/_virtual/index2.js +0 -4
  153. package/dist/_virtual/index3.js +0 -4
  154. package/dist/_virtual/index4.js +0 -7
  155. package/dist/_virtual/index5.js +0 -5
  156. package/dist/_virtual/index6.js +0 -4
  157. package/dist/_virtual/index7.js +0 -4
  158. package/dist/_virtual/react-dom-server-legacy.browser.development.js +0 -4
  159. package/dist/_virtual/react-dom-server-legacy.browser.production.min.js +0 -4
  160. package/dist/_virtual/react-dom-server.browser.development.js +0 -4
  161. package/dist/_virtual/react-dom-server.browser.production.min.js +0 -4
  162. package/dist/_virtual/react-is.development.js +0 -4
  163. package/dist/_virtual/react-is.production.min.js +0 -4
  164. package/dist/_virtual/react-reconciler-constants.development.js +0 -4
  165. package/dist/_virtual/react-reconciler-constants.production.min.js +0 -4
  166. package/dist/_virtual/react-reconciler.development.js +0 -4
  167. package/dist/_virtual/scheduler.development.js +0 -4
  168. package/dist/_virtual/scheduler.production.min.js +0 -4
  169. package/dist/_virtual/server.browser.js +0 -5
  170. package/dist/_virtual/server.browser2.js +0 -4
  171. package/dist/node_modules/@date-fns/tz/date/index.js +0 -61
  172. package/dist/node_modules/@date-fns/tz/date/mini.js +0 -69
  173. package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -11
  174. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -22
  175. package/dist/node_modules/@popperjs/core/lib/createPopper.js +0 -122
  176. package/dist/node_modules/@popperjs/core/lib/dom-utils/contains.js +0 -18
  177. package/dist/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +0 -23
  178. package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +0 -37
  179. package/dist/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +0 -32
  180. package/dist/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +0 -7
  181. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +0 -10
  182. package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +0 -17
  183. package/dist/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +0 -9
  184. package/dist/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +0 -13
  185. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +0 -6
  186. package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +0 -10
  187. package/dist/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +0 -35
  188. package/dist/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +0 -18
  189. package/dist/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +0 -10
  190. package/dist/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +0 -21
  191. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindow.js +0 -12
  192. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +0 -11
  193. package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +0 -9
  194. package/dist/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +0 -20
  195. package/dist/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +0 -7
  196. package/dist/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +0 -8
  197. package/dist/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +0 -7
  198. package/dist/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +0 -16
  199. package/dist/node_modules/@popperjs/core/lib/enums.js +0 -31
  200. package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +0 -47
  201. package/dist/node_modules/@popperjs/core/lib/modifiers/arrow.js +0 -37
  202. package/dist/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +0 -99
  203. package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +0 -26
  204. package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js +0 -74
  205. package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js +0 -44
  206. package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js +0 -31
  207. package/dist/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +0 -19
  208. package/dist/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +0 -54
  209. package/dist/node_modules/@popperjs/core/lib/popper.js +0 -27
  210. package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +0 -27
  211. package/dist/node_modules/@popperjs/core/lib/utils/computeOffsets.js +0 -54
  212. package/dist/node_modules/@popperjs/core/lib/utils/debounce.js +0 -13
  213. package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js +0 -33
  214. package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +0 -8
  215. package/dist/node_modules/@popperjs/core/lib/utils/getAltAxis.js +0 -6
  216. package/dist/node_modules/@popperjs/core/lib/utils/getBasePlacement.js +0 -6
  217. package/dist/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +0 -11
  218. package/dist/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +0 -6
  219. package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +0 -14
  220. package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +0 -12
  221. package/dist/node_modules/@popperjs/core/lib/utils/getVariation.js +0 -6
  222. package/dist/node_modules/@popperjs/core/lib/utils/math.js +0 -6
  223. package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js +0 -15
  224. package/dist/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +0 -7
  225. package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js +0 -31
  226. package/dist/node_modules/@popperjs/core/lib/utils/rectToClientRect.js +0 -11
  227. package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js +0 -9
  228. package/dist/node_modules/@popperjs/core/lib/utils/within.js +0 -12
  229. package/dist/node_modules/@react-three/drei/core/useAnimations.js +0 -34
  230. package/dist/node_modules/@react-three/drei/core/useGLTF.js +0 -18
  231. package/dist/node_modules/@react-three/fiber/dist/events-776716bd.esm.js +0 -1311
  232. package/dist/node_modules/@react-three/fiber/dist/react-three-fiber.esm.js +0 -145
  233. package/dist/node_modules/@react-three/fiber/node_modules/suspend-react/index.js +0 -47
  234. package/dist/node_modules/@tiptap/core/dist/index.js +0 -2857
  235. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -45
  236. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -76
  237. package/dist/node_modules/@tiptap/extension-bubble-menu/dist/index.js +0 -129
  238. package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +0 -55
  239. package/dist/node_modules/@tiptap/extension-character-count/dist/index.js +0 -73
  240. package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -54
  241. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -136
  242. package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -10
  243. package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +0 -21
  244. package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +0 -25
  245. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -56
  246. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -55
  247. package/dist/node_modules/@tiptap/extension-history/dist/index.js +0 -36
  248. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -59
  249. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -75
  250. package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -272
  251. package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +0 -34
  252. package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +0 -73
  253. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -34
  254. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -53
  255. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -64
  256. package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -9
  257. package/dist/node_modules/@tiptap/react/dist/index.js +0 -709
  258. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -30
  259. package/dist/node_modules/color/index.js +0 -262
  260. package/dist/node_modules/color/node_modules/color-convert/conversions.js +0 -421
  261. package/dist/node_modules/color/node_modules/color-convert/index.js +0 -35
  262. package/dist/node_modules/color/node_modules/color-convert/route.js +0 -46
  263. package/dist/node_modules/color/node_modules/color-name/index.js +0 -153
  264. package/dist/node_modules/color-string/index.js +0 -105
  265. package/dist/node_modules/color-string/node_modules/color-name/index.js +0 -153
  266. package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
  267. package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -11
  268. package/dist/node_modules/date-fns/constants.js +0 -4
  269. package/dist/node_modules/date-fns/constructFrom.js +0 -8
  270. package/dist/node_modules/date-fns/isSameWeek.js +0 -14
  271. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
  272. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -18
  273. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -31
  274. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -15
  275. package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +0 -275
  276. package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +0 -33
  277. package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +0 -25
  278. package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +0 -167
  279. package/dist/node_modules/date-fns/locale/cs/_lib/match.js +0 -109
  280. package/dist/node_modules/date-fns/locale/cs.js +0 -21
  281. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -70
  282. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -33
  283. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -11
  284. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -155
  285. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -110
  286. package/dist/node_modules/date-fns/locale/en-US.js +0 -21
  287. package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +0 -158
  288. package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +0 -33
  289. package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +0 -60
  290. package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +0 -175
  291. package/dist/node_modules/date-fns/locale/sk/_lib/match.js +0 -111
  292. package/dist/node_modules/date-fns/locale/sk.js +0 -21
  293. package/dist/node_modules/date-fns/startOfWeek.js +0 -11
  294. package/dist/node_modules/date-fns/toDate.js +0 -8
  295. package/dist/node_modules/framer-motion/dist/es/animation/animate/index.js +0 -25
  296. package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +0 -8
  297. package/dist/node_modules/framer-motion/dist/es/animation/animate/sequence.js +0 -12
  298. package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +0 -32
  299. package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +0 -128
  300. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.js +0 -6
  301. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.js +0 -6
  302. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.js +0 -22
  303. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.js +0 -7
  304. package/dist/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.js +0 -6
  305. package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +0 -40
  306. package/dist/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.js +0 -6
  307. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
  308. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -34
  309. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -47
  310. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -17
  311. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -12
  312. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +0 -46
  313. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +0 -34
  314. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +0 -64
  315. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +0 -17
  316. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
  317. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
  318. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -9
  319. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
  320. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
  321. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -15
  322. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -5
  323. package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +0 -5
  324. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -5
  325. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
  326. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -14
  327. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -277
  328. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -22
  329. package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +0 -70
  330. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -67
  331. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -28
  332. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -21
  333. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -131
  334. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -43
  335. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -23
  336. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -27
  337. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -34
  338. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
  339. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -39
  340. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
  341. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
  342. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -60
  343. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
  344. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -14
  345. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
  346. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -21
  347. package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -63
  348. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -4
  349. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -22
  350. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -65
  351. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -52
  352. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -38
  353. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -18
  354. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -13
  355. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -7
  356. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -10
  357. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -16
  358. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -20
  359. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -24
  360. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -10
  361. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -27
  362. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -9
  363. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -30
  364. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -22
  365. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -10
  366. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
  367. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
  368. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -4
  369. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -4
  370. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
  371. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -28
  372. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -8
  373. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
  374. package/dist/node_modules/framer-motion/dist/es/utils/use-motion-value-event.js +0 -7
  375. package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +0 -15
  376. package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +0 -10
  377. package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +0 -15
  378. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +0 -31
  379. package/dist/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -34
  380. package/dist/node_modules/imask/esm/controls/html-input-mask-element.js +0 -31
  381. package/dist/node_modules/imask/esm/controls/html-mask-element.js +0 -48
  382. package/dist/node_modules/imask/esm/controls/input-history.js +0 -30
  383. package/dist/node_modules/imask/esm/controls/input.js +0 -222
  384. package/dist/node_modules/imask/esm/controls/mask-element.js +0 -43
  385. package/dist/node_modules/imask/esm/core/action-details.js +0 -51
  386. package/dist/node_modules/imask/esm/core/change-details.js +0 -36
  387. package/dist/node_modules/imask/esm/core/continuous-tail-details.js +0 -42
  388. package/dist/node_modules/imask/esm/core/holder.js +0 -6
  389. package/dist/node_modules/imask/esm/core/utils.js +0 -67
  390. package/dist/node_modules/imask/esm/index.js +0 -50
  391. package/dist/node_modules/imask/esm/masked/base.js +0 -252
  392. package/dist/node_modules/imask/esm/masked/date.js +0 -117
  393. package/dist/node_modules/imask/esm/masked/dynamic.js +0 -222
  394. package/dist/node_modules/imask/esm/masked/enum.js +0 -69
  395. package/dist/node_modules/imask/esm/masked/factory.js +0 -46
  396. package/dist/node_modules/imask/esm/masked/function.js +0 -23
  397. package/dist/node_modules/imask/esm/masked/number.js +0 -212
  398. package/dist/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -103
  399. package/dist/node_modules/imask/esm/masked/pattern/cursor.js +0 -100
  400. package/dist/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -102
  401. package/dist/node_modules/imask/esm/masked/pattern/input-definition.js +0 -133
  402. package/dist/node_modules/imask/esm/masked/pattern.js +0 -322
  403. package/dist/node_modules/imask/esm/masked/pipe.js +0 -23
  404. package/dist/node_modules/imask/esm/masked/range.js +0 -78
  405. package/dist/node_modules/imask/esm/masked/regexp.js +0 -21
  406. package/dist/node_modules/imask/esm/masked/repeat.js +0 -104
  407. package/dist/node_modules/its-fine/dist/index.js +0 -116
  408. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -707
  409. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -106
  410. package/dist/node_modules/motion-dom/dist/es/animation/GroupAnimation.js +0 -76
  411. package/dist/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.js +0 -10
  412. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -133
  413. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -108
  414. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -37
  415. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -10
  416. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -17
  417. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -37
  418. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -30
  419. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.js +0 -32
  420. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.js +0 -52
  421. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.js +0 -98
  422. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -13
  423. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -13
  424. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -6
  425. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -9
  426. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -46
  427. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -46
  428. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -30
  429. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -22
  430. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -69
  431. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -75
  432. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -8
  433. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -8
  434. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -12
  435. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -6
  436. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -7
  437. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -7
  438. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
  439. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -31
  440. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -6
  441. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
  442. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -27
  443. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -7
  444. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -23
  445. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -31
  446. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -22
  447. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.js +0 -8
  448. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
  449. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -7
  450. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -9
  451. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -6
  452. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -6
  453. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -16
  454. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -4
  455. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -12
  456. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -15
  457. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -21
  458. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -24
  459. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -8
  460. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -10
  461. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -17
  462. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -6
  463. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -27
  464. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -9
  465. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -5
  466. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -21
  467. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -41
  468. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -15
  469. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -11
  470. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -11
  471. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -24
  472. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -33
  473. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -13
  474. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -27
  475. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -4
  476. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -4
  477. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -4
  478. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -12
  479. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -27
  480. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -25
  481. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -14
  482. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -52
  483. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -36
  484. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -25
  485. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -18
  486. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -34
  487. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -16
  488. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -25
  489. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -623
  490. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -15
  491. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -60
  492. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -21
  493. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -16
  494. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -21
  495. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -13
  496. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -4
  497. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -6
  498. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -19
  499. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -20
  500. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -13
  501. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -10
  502. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -247
  503. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -28
  504. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -4
  505. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -65
  506. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -7
  507. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -6
  508. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -38
  509. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -29
  510. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -37
  511. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -12
  512. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -14
  513. package/dist/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.js +0 -37
  514. package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -4
  515. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -40
  516. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -32
  517. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -28
  518. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -4
  519. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -15
  520. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -11
  521. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
  522. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -141
  523. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -20
  524. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -6
  525. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -13
  526. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -9
  527. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -4
  528. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -6
  529. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -13
  530. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -23
  531. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -25
  532. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -15
  533. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -5
  534. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
  535. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -20
  536. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -21
  537. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -14
  538. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -13
  539. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -12
  540. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -42
  541. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -7
  542. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -7
  543. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -7
  544. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -29
  545. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -51
  546. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -6
  547. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -8
  548. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -4
  549. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -8
  550. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -15
  551. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -4
  552. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -12
  553. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -9
  554. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -5
  555. package/dist/node_modules/motion-dom/dist/es/utils/transform.js +0 -8
  556. package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -218
  557. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -7
  558. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -19
  559. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -22
  560. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -12
  561. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -15
  562. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -16
  563. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -18
  564. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
  565. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -49
  566. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -9
  567. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -8
  568. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -24
  569. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -70
  570. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -31
  571. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -17
  572. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -17
  573. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -4
  574. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -10
  575. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -4
  576. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -8
  577. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -4
  578. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -4
  579. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -6
  580. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -4
  581. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -4
  582. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -4
  583. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -7
  584. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -14
  585. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -7
  586. package/dist/node_modules/motion-utils/dist/es/array.js +0 -20
  587. package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -4
  588. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -5
  589. package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -9
  590. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -8
  591. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -18
  592. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -7
  593. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -4
  594. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -4
  595. package/dist/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.js +0 -8
  596. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -4
  597. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -4
  598. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -32
  599. package/dist/node_modules/motion-utils/dist/es/errors.js +0 -15
  600. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -6
  601. package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -4
  602. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -4
  603. package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -6
  604. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -4
  605. package/dist/node_modules/motion-utils/dist/es/memo.js +0 -8
  606. package/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
  607. package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -4
  608. package/dist/node_modules/motion-utils/dist/es/progress.js +0 -7
  609. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -29
  610. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -5
  611. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -6
  612. package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -8
  613. package/dist/node_modules/motion-utils/dist/es/wrap.js +0 -7
  614. package/dist/node_modules/object-assign/index.js +0 -54
  615. package/dist/node_modules/orderedmap/dist/index.js +0 -103
  616. package/dist/node_modules/photoswipe/dist/photoswipe.esm.js +0 -2956
  617. package/dist/node_modules/prop-types/checkPropTypes.js +0 -54
  618. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -52
  619. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -329
  620. package/dist/node_modules/prop-types/index.js +0 -17
  621. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -10
  622. package/dist/node_modules/prop-types/lib/has.js +0 -7
  623. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -95
  624. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -78
  625. package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
  626. package/dist/node_modules/prosemirror-commands/dist/index.js +0 -388
  627. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -86
  628. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -204
  629. package/dist/node_modules/prosemirror-history/dist/index.js +0 -248
  630. package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -62
  631. package/dist/node_modules/prosemirror-model/dist/index.js +0 -2733
  632. package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -88
  633. package/dist/node_modules/prosemirror-state/dist/index.js +0 -822
  634. package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1520
  635. package/dist/node_modules/prosemirror-view/dist/index.js +0 -3794
  636. package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -229
  637. package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -22
  638. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -19
  639. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -8
  640. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -8
  641. package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -222
  642. package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +0 -7
  643. package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -7
  644. package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -18
  645. package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -8
  646. package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -11
  647. package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -19
  648. package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -7
  649. package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -7
  650. package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -8
  651. package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -8
  652. package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -7
  653. package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -7
  654. package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -9
  655. package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -27
  656. package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -9
  657. package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -7
  658. package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -9
  659. package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -8
  660. package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -7
  661. package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -8
  662. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -8
  663. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -7
  664. package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -7
  665. package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -11
  666. package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -7
  667. package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -9
  668. package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -54
  669. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -9
  670. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -7
  671. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -7
  672. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -7
  673. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -6
  674. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -7
  675. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -9
  676. package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -18
  677. package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -19
  678. package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -42
  679. package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -9
  680. package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -7
  681. package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -7
  682. package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -10
  683. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -16
  684. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -21
  685. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -10
  686. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -16
  687. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -13
  688. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -15
  689. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -10
  690. package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -13
  691. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -13
  692. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -24
  693. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -13
  694. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -12
  695. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -12
  696. package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -12
  697. package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -13
  698. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -11
  699. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -7
  700. package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -16
  701. package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -7
  702. package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -8
  703. package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -26
  704. package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -10
  705. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -9
  706. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -8
  707. package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -6
  708. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -6
  709. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -6
  710. package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -6
  711. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -6
  712. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -6
  713. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -7
  714. package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -6
  715. package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -21
  716. package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -18
  717. package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -15
  718. package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -56
  719. package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -44
  720. package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -12
  721. package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -23
  722. package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -19
  723. package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -32
  724. package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -26
  725. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -15
  726. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -28
  727. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -9
  728. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -8
  729. package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -26
  730. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -3621
  731. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -1234
  732. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -3600
  733. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -1255
  734. package/dist/node_modules/react-dom/server.browser.js +0 -15
  735. package/dist/node_modules/react-imask/esm/hook.js +0 -75
  736. package/dist/node_modules/react-imask/esm/input.js +0 -23
  737. package/dist/node_modules/react-imask/esm/mixin.js +0 -131
  738. package/dist/node_modules/react-photoswipe-gallery/dist/context.js +0 -17
  739. package/dist/node_modules/react-photoswipe-gallery/dist/gallery.js +0 -216
  740. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/ensure-ref-passed.js +0 -10
  741. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/entry-item-ref-is-element.js +0 -4
  742. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-base-url.js +0 -6
  743. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-hash-value.js +0 -6
  744. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-hash-without-gid-and-pid.js +0 -9
  745. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-initial-active-slide-index.js +0 -6
  746. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-slides-and-index-from-data-source.js +0 -39
  747. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/get-slides-and-index-from-items-refs.js +0 -31
  748. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/hash-includes-navigation-query-params.js +0 -8
  749. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/hash-to-object.js +0 -9
  750. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/item-to-slide.js +0 -37
  751. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/object-to-hash.js +0 -6
  752. package/dist/node_modules/react-photoswipe-gallery/dist/helpers/sort-nodes.js +0 -6
  753. package/dist/node_modules/react-photoswipe-gallery/dist/hooks.js +0 -22
  754. package/dist/node_modules/react-photoswipe-gallery/dist/item.js +0 -54
  755. package/dist/node_modules/react-photoswipe-gallery/dist/lightbox-stub.js +0 -8
  756. package/dist/node_modules/react-photoswipe-gallery/dist/no-ref-error.js +0 -14
  757. package/dist/node_modules/react-photoswipe-gallery/dist/no-source-id-error.js +0 -18
  758. package/dist/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js +0 -32
  759. package/dist/node_modules/react-reconciler/cjs/react-reconciler-constants.production.min.js +0 -17
  760. package/dist/node_modules/react-reconciler/cjs/react-reconciler.development.js +0 -9139
  761. package/dist/node_modules/react-reconciler/cjs/react-reconciler.production.min.js +0 -3778
  762. package/dist/node_modules/react-reconciler/constants.js +0 -10
  763. package/dist/node_modules/react-reconciler/index.js +0 -10
  764. package/dist/node_modules/react-use-measure/dist/index.js +0 -60
  765. package/dist/node_modules/rope-sequence/dist/index.js +0 -100
  766. package/dist/node_modules/scheduler/cjs/scheduler.development.js +0 -277
  767. package/dist/node_modules/scheduler/cjs/scheduler.production.min.js +0 -213
  768. package/dist/node_modules/scheduler/index.js +0 -10
  769. package/dist/node_modules/three/build/three.module.js +0 -20599
  770. package/dist/node_modules/three-stdlib/_polyfill/LoaderUtils.js +0 -15
  771. package/dist/node_modules/three-stdlib/_polyfill/constants.js +0 -5
  772. package/dist/node_modules/three-stdlib/libs/MeshoptDecoder.js +0 -201
  773. package/dist/node_modules/three-stdlib/loaders/DRACOLoader.js +0 -246
  774. package/dist/node_modules/three-stdlib/loaders/GLTFLoader.js +0 -1670
  775. package/dist/node_modules/three-stdlib/utils/BufferGeometryUtils.js +0 -34
  776. package/dist/node_modules/tippy.js/dist/tippy.esm.js +0 -813
  777. package/dist/node_modules/w3c-keyname/index.js +0 -93
  778. package/dist/node_modules/zustand/esm/index.js +0 -61
@@ -1,2956 +0,0 @@
1
- /*!
2
- * PhotoSwipe 5.4.4 - https://photoswipe.com
3
- * (c) 2024 Dmytro Semenov
4
- */
5
- function f(r, t, i) {
6
- const e = document.createElement(t);
7
- return r && (e.className = r), i && i.appendChild(e), e;
8
- }
9
- function p(r, t) {
10
- return r.x = t.x, r.y = t.y, t.id !== void 0 && (r.id = t.id), r;
11
- }
12
- function M(r) {
13
- r.x = Math.round(r.x), r.y = Math.round(r.y);
14
- }
15
- function A(r, t) {
16
- const i = Math.abs(r.x - t.x), e = Math.abs(r.y - t.y);
17
- return Math.sqrt(i * i + e * e);
18
- }
19
- function x(r, t) {
20
- return r.x === t.x && r.y === t.y;
21
- }
22
- function b(r, t, i) {
23
- return Math.min(Math.max(r, t), i);
24
- }
25
- function I(r, t, i) {
26
- let e = `translate3d(${r}px,${t || 0}px,0)`;
27
- return i !== void 0 && (e += ` scale3d(${i},${i},1)`), e;
28
- }
29
- function y(r, t, i, e) {
30
- r.style.transform = I(t, i, e);
31
- }
32
- const $ = "cubic-bezier(.4,0,.22,1)";
33
- function R(r, t, i, e) {
34
- r.style.transition = t ? `${t} ${i}ms ${e || $}` : "none";
35
- }
36
- function L(r, t, i) {
37
- r.style.width = typeof t == "number" ? `${t}px` : t, r.style.height = typeof i == "number" ? `${i}px` : i;
38
- }
39
- function U(r) {
40
- R(r);
41
- }
42
- function q(r) {
43
- return "decode" in r ? r.decode().catch(() => {
44
- }) : r.complete ? Promise.resolve(r) : new Promise((t, i) => {
45
- r.onload = () => t(r), r.onerror = i;
46
- });
47
- }
48
- const _ = {
49
- IDLE: "idle",
50
- LOADING: "loading",
51
- LOADED: "loaded",
52
- ERROR: "error"
53
- };
54
- function G(r) {
55
- return "button" in r && r.button === 1 || r.ctrlKey || r.metaKey || r.altKey || r.shiftKey;
56
- }
57
- function K(r, t, i = document) {
58
- let e = [];
59
- if (r instanceof Element)
60
- e = [r];
61
- else if (r instanceof NodeList || Array.isArray(r))
62
- e = Array.from(r);
63
- else {
64
- const s = typeof r == "string" ? r : t;
65
- s && (e = Array.from(i.querySelectorAll(s)));
66
- }
67
- return e;
68
- }
69
- function C() {
70
- return !!(navigator.vendor && navigator.vendor.match(/apple/i));
71
- }
72
- let F = !1;
73
- try {
74
- window.addEventListener("test", null, Object.defineProperty({}, "passive", {
75
- get: () => {
76
- F = !0;
77
- }
78
- }));
79
- } catch {
80
- }
81
- class X {
82
- constructor() {
83
- this._pool = [];
84
- }
85
- /**
86
- * Adds event listeners
87
- *
88
- * @param {PoolItem['target']} target
89
- * @param {PoolItem['type']} type Can be multiple, separated by space.
90
- * @param {PoolItem['listener']} listener
91
- * @param {PoolItem['passive']} [passive]
92
- */
93
- add(t, i, e, s) {
94
- this._toggleListener(t, i, e, s);
95
- }
96
- /**
97
- * Removes event listeners
98
- *
99
- * @param {PoolItem['target']} target
100
- * @param {PoolItem['type']} type
101
- * @param {PoolItem['listener']} listener
102
- * @param {PoolItem['passive']} [passive]
103
- */
104
- remove(t, i, e, s) {
105
- this._toggleListener(t, i, e, s, !0);
106
- }
107
- /**
108
- * Removes all bound events
109
- */
110
- removeAll() {
111
- this._pool.forEach((t) => {
112
- this._toggleListener(t.target, t.type, t.listener, t.passive, !0, !0);
113
- }), this._pool = [];
114
- }
115
- /**
116
- * Adds or removes event
117
- *
118
- * @private
119
- * @param {PoolItem['target']} target
120
- * @param {PoolItem['type']} type
121
- * @param {PoolItem['listener']} listener
122
- * @param {PoolItem['passive']} [passive]
123
- * @param {boolean} [unbind] Whether the event should be added or removed
124
- * @param {boolean} [skipPool] Whether events pool should be skipped
125
- */
126
- _toggleListener(t, i, e, s, n, o) {
127
- if (!t)
128
- return;
129
- const a = n ? "removeEventListener" : "addEventListener";
130
- i.split(" ").forEach((l) => {
131
- if (l) {
132
- o || (n ? this._pool = this._pool.filter((d) => d.type !== l || d.listener !== e || d.target !== t) : this._pool.push({
133
- target: t,
134
- type: l,
135
- listener: e,
136
- passive: s
137
- }));
138
- const c = F ? {
139
- passive: s || !1
140
- } : !1;
141
- t[a](l, e, c);
142
- }
143
- });
144
- }
145
- }
146
- function B(r, t) {
147
- if (r.getViewportSizeFn) {
148
- const i = r.getViewportSizeFn(r, t);
149
- if (i)
150
- return i;
151
- }
152
- return {
153
- x: document.documentElement.clientWidth,
154
- // TODO: height on mobile is very incosistent due to toolbar
155
- // find a way to improve this
156
- //
157
- // document.documentElement.clientHeight - doesn't seem to work well
158
- y: window.innerHeight
159
- };
160
- }
161
- function S(r, t, i, e, s) {
162
- let n = 0;
163
- if (t.paddingFn)
164
- n = t.paddingFn(i, e, s)[r];
165
- else if (t.padding)
166
- n = t.padding[r];
167
- else {
168
- const o = "padding" + r[0].toUpperCase() + r.slice(1);
169
- t[o] && (n = t[o]);
170
- }
171
- return Number(n) || 0;
172
- }
173
- function N(r, t, i, e) {
174
- return {
175
- x: t.x - S("left", r, t, i, e) - S("right", r, t, i, e),
176
- y: t.y - S("top", r, t, i, e) - S("bottom", r, t, i, e)
177
- };
178
- }
179
- class Y {
180
- /**
181
- * @param {Slide} slide
182
- */
183
- constructor(t) {
184
- this.slide = t, this.currZoomLevel = 1, this.center = /** @type {Point} */
185
- {
186
- x: 0,
187
- y: 0
188
- }, this.max = /** @type {Point} */
189
- {
190
- x: 0,
191
- y: 0
192
- }, this.min = /** @type {Point} */
193
- {
194
- x: 0,
195
- y: 0
196
- };
197
- }
198
- /**
199
- * _getItemBounds
200
- *
201
- * @param {number} currZoomLevel
202
- */
203
- update(t) {
204
- this.currZoomLevel = t, this.slide.width ? (this._updateAxis("x"), this._updateAxis("y"), this.slide.pswp.dispatch("calcBounds", {
205
- slide: this.slide
206
- })) : this.reset();
207
- }
208
- /**
209
- * _calculateItemBoundsForAxis
210
- *
211
- * @param {Axis} axis
212
- */
213
- _updateAxis(t) {
214
- const {
215
- pswp: i
216
- } = this.slide, e = this.slide[t === "x" ? "width" : "height"] * this.currZoomLevel, n = S(t === "x" ? "left" : "top", i.options, i.viewportSize, this.slide.data, this.slide.index), o = this.slide.panAreaSize[t];
217
- this.center[t] = Math.round((o - e) / 2) + n, this.max[t] = e > o ? Math.round(o - e) + n : this.center[t], this.min[t] = e > o ? n : this.center[t];
218
- }
219
- // _getZeroBounds
220
- reset() {
221
- this.center.x = 0, this.center.y = 0, this.max.x = 0, this.max.y = 0, this.min.x = 0, this.min.y = 0;
222
- }
223
- /**
224
- * Correct pan position if it's beyond the bounds
225
- *
226
- * @param {Axis} axis x or y
227
- * @param {number} panOffset
228
- * @returns {number}
229
- */
230
- correctPan(t, i) {
231
- return b(i, this.max[t], this.min[t]);
232
- }
233
- }
234
- const T = 4e3;
235
- class k {
236
- /**
237
- * @param {PhotoSwipeOptions} options PhotoSwipe options
238
- * @param {SlideData} itemData Slide data
239
- * @param {number} index Slide index
240
- * @param {PhotoSwipe} [pswp] PhotoSwipe instance, can be undefined if not initialized yet
241
- */
242
- constructor(t, i, e, s) {
243
- this.pswp = s, this.options = t, this.itemData = i, this.index = e, this.panAreaSize = null, this.elementSize = null, this.fit = 1, this.fill = 1, this.vFill = 1, this.initial = 1, this.secondary = 1, this.max = 1, this.min = 1;
244
- }
245
- /**
246
- * Calculate initial, secondary and maximum zoom level for the specified slide.
247
- *
248
- * It should be called when either image or viewport size changes.
249
- *
250
- * @param {number} maxWidth
251
- * @param {number} maxHeight
252
- * @param {Point} panAreaSize
253
- */
254
- update(t, i, e) {
255
- const s = {
256
- x: t,
257
- y: i
258
- };
259
- this.elementSize = s, this.panAreaSize = e;
260
- const n = e.x / s.x, o = e.y / s.y;
261
- this.fit = Math.min(1, n < o ? n : o), this.fill = Math.min(1, n > o ? n : o), this.vFill = Math.min(1, o), this.initial = this._getInitial(), this.secondary = this._getSecondary(), this.max = Math.max(this.initial, this.secondary, this._getMax()), this.min = Math.min(this.fit, this.initial, this.secondary), this.pswp && this.pswp.dispatch("zoomLevelsUpdate", {
262
- zoomLevels: this,
263
- slideData: this.itemData
264
- });
265
- }
266
- /**
267
- * Parses user-defined zoom option.
268
- *
269
- * @private
270
- * @param {'initial' | 'secondary' | 'max'} optionPrefix Zoom level option prefix (initial, secondary, max)
271
- * @returns { number | undefined }
272
- */
273
- _parseZoomLevelOption(t) {
274
- const i = (
275
- /** @type {'initialZoomLevel' | 'secondaryZoomLevel' | 'maxZoomLevel'} */
276
- t + "ZoomLevel"
277
- ), e = this.options[i];
278
- if (e)
279
- return typeof e == "function" ? e(this) : e === "fill" ? this.fill : e === "fit" ? this.fit : Number(e);
280
- }
281
- /**
282
- * Get zoom level to which image will be zoomed after double-tap gesture,
283
- * or when user clicks on zoom icon,
284
- * or mouse-click on image itself.
285
- * If you return 1 image will be zoomed to its original size.
286
- *
287
- * @private
288
- * @return {number}
289
- */
290
- _getSecondary() {
291
- let t = this._parseZoomLevelOption("secondary");
292
- return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > T && (t = T / this.elementSize.x), t);
293
- }
294
- /**
295
- * Get initial image zoom level.
296
- *
297
- * @private
298
- * @return {number}
299
- */
300
- _getInitial() {
301
- return this._parseZoomLevelOption("initial") || this.fit;
302
- }
303
- /**
304
- * Maximum zoom level when user zooms
305
- * via zoom/pinch gesture,
306
- * via cmd/ctrl-wheel or via trackpad.
307
- *
308
- * @private
309
- * @return {number}
310
- */
311
- _getMax() {
312
- return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
313
- }
314
- }
315
- class j {
316
- /**
317
- * @param {SlideData} data
318
- * @param {number} index
319
- * @param {PhotoSwipe} pswp
320
- */
321
- constructor(t, i, e) {
322
- this.data = t, this.index = i, this.pswp = e, this.isActive = i === e.currIndex, this.currentResolution = 0, this.panAreaSize = {
323
- x: 0,
324
- y: 0
325
- }, this.pan = {
326
- x: 0,
327
- y: 0
328
- }, this.isFirstSlide = this.isActive && !e.opener.isOpen, this.zoomLevels = new k(e.options, t, i, e), this.pswp.dispatch("gettingData", {
329
- slide: this,
330
- data: this.data,
331
- index: i
332
- }), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = f("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new Y(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
333
- slide: this
334
- });
335
- }
336
- /**
337
- * If this slide is active/current/visible
338
- *
339
- * @param {boolean} isActive
340
- */
341
- setIsActive(t) {
342
- t && !this.isActive ? this.activate() : !t && this.isActive && this.deactivate();
343
- }
344
- /**
345
- * Appends slide content to DOM
346
- *
347
- * @param {HTMLElement} holderElement
348
- */
349
- append(t) {
350
- this.holderElement = t, this.container.style.transformOrigin = "0 0", this.data && (this.calculateSize(), this.load(), this.updateContentSize(), this.appendHeavy(), this.holderElement.appendChild(this.container), this.zoomAndPanToInitial(), this.pswp.dispatch("firstZoomPan", {
351
- slide: this
352
- }), this.applyCurrentZoomPan(), this.pswp.dispatch("afterSetContent", {
353
- slide: this
354
- }), this.isActive && this.activate());
355
- }
356
- load() {
357
- this.content.load(!1), this.pswp.dispatch("slideLoad", {
358
- slide: this
359
- });
360
- }
361
- /**
362
- * Append "heavy" DOM elements
363
- *
364
- * This may depend on a type of slide,
365
- * but generally these are large images.
366
- */
367
- appendHeavy() {
368
- const {
369
- pswp: t
370
- } = this;
371
- this.heavyAppended || !t.opener.isOpen || t.mainScroll.isShifted() || !this.isActive && !1 || this.pswp.dispatch("appendHeavy", {
372
- slide: this
373
- }).defaultPrevented || (this.heavyAppended = !0, this.content.append(), this.pswp.dispatch("appendHeavyContent", {
374
- slide: this
375
- }));
376
- }
377
- /**
378
- * Triggered when this slide is active (selected).
379
- *
380
- * If it's part of opening/closing transition -
381
- * activate() will trigger after the transition is ended.
382
- */
383
- activate() {
384
- this.isActive = !0, this.appendHeavy(), this.content.activate(), this.pswp.dispatch("slideActivate", {
385
- slide: this
386
- });
387
- }
388
- /**
389
- * Triggered when this slide becomes inactive.
390
- *
391
- * Slide can become inactive only after it was active.
392
- */
393
- deactivate() {
394
- this.isActive = !1, this.content.deactivate(), this.currZoomLevel !== this.zoomLevels.initial && this.calculateSize(), this.currentResolution = 0, this.zoomAndPanToInitial(), this.applyCurrentZoomPan(), this.updateContentSize(), this.pswp.dispatch("slideDeactivate", {
395
- slide: this
396
- });
397
- }
398
- /**
399
- * The slide should destroy itself, it will never be used again.
400
- * (unbind all events and destroy internal components)
401
- */
402
- destroy() {
403
- this.content.hasSlide = !1, this.content.remove(), this.container.remove(), this.pswp.dispatch("slideDestroy", {
404
- slide: this
405
- });
406
- }
407
- resize() {
408
- this.currZoomLevel === this.zoomLevels.initial || !this.isActive ? (this.calculateSize(), this.currentResolution = 0, this.zoomAndPanToInitial(), this.applyCurrentZoomPan(), this.updateContentSize()) : (this.calculateSize(), this.bounds.update(this.currZoomLevel), this.panTo(this.pan.x, this.pan.y));
409
- }
410
- /**
411
- * Apply size to current slide content,
412
- * based on the current resolution and scale.
413
- *
414
- * @param {boolean} [force] if size should be updated even if dimensions weren't changed
415
- */
416
- updateContentSize(t) {
417
- const i = this.currentResolution || this.zoomLevels.initial;
418
- if (!i)
419
- return;
420
- const e = Math.round(this.width * i) || this.pswp.viewportSize.x, s = Math.round(this.height * i) || this.pswp.viewportSize.y;
421
- !this.sizeChanged(e, s) && !t || this.content.setDisplayedSize(e, s);
422
- }
423
- /**
424
- * @param {number} width
425
- * @param {number} height
426
- */
427
- sizeChanged(t, i) {
428
- return t !== this.prevDisplayedWidth || i !== this.prevDisplayedHeight ? (this.prevDisplayedWidth = t, this.prevDisplayedHeight = i, !0) : !1;
429
- }
430
- /** @returns {HTMLImageElement | HTMLDivElement | null | undefined} */
431
- getPlaceholderElement() {
432
- var t;
433
- return (t = this.content.placeholder) === null || t === void 0 ? void 0 : t.element;
434
- }
435
- /**
436
- * Zoom current slide image to...
437
- *
438
- * @param {number} destZoomLevel Destination zoom level.
439
- * @param {Point} [centerPoint]
440
- * Transform origin center point, or false if viewport center should be used.
441
- * @param {number | false} [transitionDuration] Transition duration, may be set to 0.
442
- * @param {boolean} [ignoreBounds] Minimum and maximum zoom levels will be ignored.
443
- */
444
- zoomTo(t, i, e, s) {
445
- const {
446
- pswp: n
447
- } = this;
448
- if (!this.isZoomable() || n.mainScroll.isShifted())
449
- return;
450
- n.dispatch("beforeZoomTo", {
451
- destZoomLevel: t,
452
- centerPoint: i,
453
- transitionDuration: e
454
- }), n.animations.stopAllPan();
455
- const o = this.currZoomLevel;
456
- s || (t = b(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", i, o), this.pan.y = this.calculateZoomToPanOffset("y", i, o), M(this.pan);
457
- const a = () => {
458
- this._setResolution(t), this.applyCurrentZoomPan();
459
- };
460
- e ? n.animations.startTransition({
461
- isPan: !0,
462
- name: "zoomTo",
463
- target: this.container,
464
- transform: this.getCurrentTransform(),
465
- onComplete: a,
466
- duration: e,
467
- easing: n.options.easing
468
- }) : a();
469
- }
470
- /**
471
- * @param {Point} [centerPoint]
472
- */
473
- toggleZoom(t) {
474
- this.zoomTo(this.currZoomLevel === this.zoomLevels.initial ? this.zoomLevels.secondary : this.zoomLevels.initial, t, this.pswp.options.zoomAnimationDuration);
475
- }
476
- /**
477
- * Updates zoom level property and recalculates new pan bounds,
478
- * unlike zoomTo it does not apply transform (use applyCurrentZoomPan)
479
- *
480
- * @param {number} currZoomLevel
481
- */
482
- setZoomLevel(t) {
483
- this.currZoomLevel = t, this.bounds.update(this.currZoomLevel);
484
- }
485
- /**
486
- * Get pan position after zoom at a given `point`.
487
- *
488
- * Always call setZoomLevel(newZoomLevel) beforehand to recalculate
489
- * pan bounds according to the new zoom level.
490
- *
491
- * @param {'x' | 'y'} axis
492
- * @param {Point} [point]
493
- * point based on which zoom is performed, usually refers to the current mouse position,
494
- * if false - viewport center will be used.
495
- * @param {number} [prevZoomLevel] Zoom level before new zoom was applied.
496
- * @returns {number}
497
- */
498
- calculateZoomToPanOffset(t, i, e) {
499
- if (this.bounds.max[t] - this.bounds.min[t] === 0)
500
- return this.bounds.center[t];
501
- i || (i = this.pswp.getViewportCenterPoint()), e || (e = this.zoomLevels.initial);
502
- const n = this.currZoomLevel / e;
503
- return this.bounds.correctPan(t, (this.pan[t] - i[t]) * n + i[t]);
504
- }
505
- /**
506
- * Apply pan and keep it within bounds.
507
- *
508
- * @param {number} panX
509
- * @param {number} panY
510
- */
511
- panTo(t, i) {
512
- this.pan.x = this.bounds.correctPan("x", t), this.pan.y = this.bounds.correctPan("y", i), this.applyCurrentZoomPan();
513
- }
514
- /**
515
- * If the slide in the current state can be panned by the user
516
- * @returns {boolean}
517
- */
518
- isPannable() {
519
- return !!this.width && this.currZoomLevel > this.zoomLevels.fit;
520
- }
521
- /**
522
- * If the slide can be zoomed
523
- * @returns {boolean}
524
- */
525
- isZoomable() {
526
- return !!this.width && this.content.isZoomable();
527
- }
528
- /**
529
- * Apply transform and scale based on
530
- * the current pan position (this.pan) and zoom level (this.currZoomLevel)
531
- */
532
- applyCurrentZoomPan() {
533
- this._applyZoomTransform(this.pan.x, this.pan.y, this.currZoomLevel), this === this.pswp.currSlide && this.pswp.dispatch("zoomPanUpdate", {
534
- slide: this
535
- });
536
- }
537
- zoomAndPanToInitial() {
538
- this.currZoomLevel = this.zoomLevels.initial, this.bounds.update(this.currZoomLevel), p(this.pan, this.bounds.center), this.pswp.dispatch("initialZoomPan", {
539
- slide: this
540
- });
541
- }
542
- /**
543
- * Set translate and scale based on current resolution
544
- *
545
- * @param {number} x
546
- * @param {number} y
547
- * @param {number} zoom
548
- * @private
549
- */
550
- _applyZoomTransform(t, i, e) {
551
- e /= this.currentResolution || this.zoomLevels.initial, y(this.container, t, i, e);
552
- }
553
- calculateSize() {
554
- const {
555
- pswp: t
556
- } = this;
557
- p(this.panAreaSize, N(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
558
- slide: this
559
- });
560
- }
561
- /** @returns {string} */
562
- getCurrentTransform() {
563
- const t = this.currZoomLevel / (this.currentResolution || this.zoomLevels.initial);
564
- return I(this.pan.x, this.pan.y, t);
565
- }
566
- /**
567
- * Set resolution and re-render the image.
568
- *
569
- * For example, if the real image size is 2000x1500,
570
- * and resolution is 0.5 - it will be rendered as 1000x750.
571
- *
572
- * Image with zoom level 2 and resolution 0.5 is
573
- * the same as image with zoom level 1 and resolution 1.
574
- *
575
- * Used to optimize animations and make
576
- * sure that browser renders image in the highest quality.
577
- * Also used by responsive images to load the correct one.
578
- *
579
- * @param {number} newResolution
580
- */
581
- _setResolution(t) {
582
- t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
583
- }
584
- }
585
- const Q = 0.35, J = 0.6, z = 0.4, E = 0.5;
586
- function tt(r, t) {
587
- return r * t / (1 - t);
588
- }
589
- class it {
590
- /**
591
- * @param {Gestures} gestures
592
- */
593
- constructor(t) {
594
- this.gestures = t, this.pswp = t.pswp, this.startPan = {
595
- x: 0,
596
- y: 0
597
- };
598
- }
599
- start() {
600
- this.pswp.currSlide && p(this.startPan, this.pswp.currSlide.pan), this.pswp.animations.stopAll();
601
- }
602
- change() {
603
- const {
604
- p1: t,
605
- prevP1: i,
606
- dragAxis: e
607
- } = this.gestures, {
608
- currSlide: s
609
- } = this.pswp;
610
- if (e === "y" && this.pswp.options.closeOnVerticalDrag && s && s.currZoomLevel <= s.zoomLevels.fit && !this.gestures.isMultitouch) {
611
- const n = s.pan.y + (t.y - i.y);
612
- if (!this.pswp.dispatch("verticalDrag", {
613
- panY: n
614
- }).defaultPrevented) {
615
- this._setPanWithFriction("y", n, J);
616
- const o = 1 - Math.abs(this._getVerticalDragRatio(s.pan.y));
617
- this.pswp.applyBgOpacity(o), s.applyCurrentZoomPan();
618
- }
619
- } else
620
- this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), s && (M(s.pan), s.applyCurrentZoomPan()));
621
- }
622
- end() {
623
- const {
624
- velocity: t
625
- } = this.gestures, {
626
- mainScroll: i,
627
- currSlide: e
628
- } = this.pswp;
629
- let s = 0;
630
- if (this.pswp.animations.stopAll(), i.isShifted()) {
631
- const o = (i.x - i.getCurrSlideX()) / this.pswp.viewportSize.x;
632
- t.x < -E && o < 0 || t.x < 0.1 && o < -0.5 ? (s = 1, t.x = Math.min(t.x, 0)) : (t.x > E && o > 0 || t.x > -0.1 && o > 0.5) && (s = -1, t.x = Math.max(t.x, 0)), i.moveIndexBy(s, !0, t.x);
633
- }
634
- e && e.currZoomLevel > e.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
635
- }
636
- /**
637
- * @private
638
- * @param {'x' | 'y'} axis
639
- */
640
- _finishPanGestureForAxis(t) {
641
- const {
642
- velocity: i
643
- } = this.gestures, {
644
- currSlide: e
645
- } = this.pswp;
646
- if (!e)
647
- return;
648
- const {
649
- pan: s,
650
- bounds: n
651
- } = e, o = s[t], a = this.pswp.bgOpacity < 1 && t === "y", l = o + tt(i[t], 0.995);
652
- if (a) {
653
- const v = this._getVerticalDragRatio(o), w = this._getVerticalDragRatio(l);
654
- if (v < 0 && w < -z || v > 0 && w > z) {
655
- this.pswp.close();
656
- return;
657
- }
658
- }
659
- const c = n.correctPan(t, l);
660
- if (o === c)
661
- return;
662
- const d = c === l ? 1 : 0.82, u = this.pswp.bgOpacity, m = c - o;
663
- this.pswp.animations.startSpring({
664
- name: "panGesture" + t,
665
- isPan: !0,
666
- start: o,
667
- end: c,
668
- velocity: i[t],
669
- dampingRatio: d,
670
- onUpdate: (v) => {
671
- if (a && this.pswp.bgOpacity < 1) {
672
- const w = 1 - (c - v) / m;
673
- this.pswp.applyBgOpacity(b(u + (1 - u) * w, 0, 1));
674
- }
675
- s[t] = Math.floor(v), e.applyCurrentZoomPan();
676
- }
677
- });
678
- }
679
- /**
680
- * Update position of the main scroll,
681
- * or/and update pan position of the current slide.
682
- *
683
- * Should return true if it changes (or can change) main scroll.
684
- *
685
- * @private
686
- * @param {'x' | 'y'} axis
687
- * @returns {boolean}
688
- */
689
- _panOrMoveMainScroll(t) {
690
- const {
691
- p1: i,
692
- dragAxis: e,
693
- prevP1: s,
694
- isMultitouch: n
695
- } = this.gestures, {
696
- currSlide: o,
697
- mainScroll: a
698
- } = this.pswp, h = i[t] - s[t], l = a.x + h;
699
- if (!h || !o)
700
- return !1;
701
- if (t === "x" && !o.isPannable() && !n)
702
- return a.moveTo(l, !0), !0;
703
- const {
704
- bounds: c
705
- } = o, d = o.pan[t] + h;
706
- if (this.pswp.options.allowPanToNext && e === "x" && t === "x" && !n) {
707
- const u = a.getCurrSlideX(), m = a.x - u, v = h > 0, w = !v;
708
- if (d > c.min[t] && v) {
709
- if (c.min[t] <= this.startPan[t])
710
- return a.moveTo(l, !0), !0;
711
- this._setPanWithFriction(t, d);
712
- } else if (d < c.max[t] && w) {
713
- if (this.startPan[t] <= c.max[t])
714
- return a.moveTo(l, !0), !0;
715
- this._setPanWithFriction(t, d);
716
- } else if (m !== 0) {
717
- if (m > 0)
718
- return a.moveTo(Math.max(l, u), !0), !0;
719
- if (m < 0)
720
- return a.moveTo(Math.min(l, u), !0), !0;
721
- } else
722
- this._setPanWithFriction(t, d);
723
- } else
724
- t === "y" ? !a.isShifted() && c.min.y !== c.max.y && this._setPanWithFriction(t, d) : this._setPanWithFriction(t, d);
725
- return !1;
726
- }
727
- // If we move above - the ratio is negative
728
- // If we move below the ratio is positive
729
- /**
730
- * Relation between pan Y position and third of viewport height.
731
- *
732
- * When we are at initial position (center bounds) - the ratio is 0,
733
- * if position is shifted upwards - the ratio is negative,
734
- * if position is shifted downwards - the ratio is positive.
735
- *
736
- * @private
737
- * @param {number} panY The current pan Y position.
738
- * @returns {number}
739
- */
740
- _getVerticalDragRatio(t) {
741
- var i, e;
742
- return (t - ((i = (e = this.pswp.currSlide) === null || e === void 0 ? void 0 : e.bounds.center.y) !== null && i !== void 0 ? i : 0)) / (this.pswp.viewportSize.y / 3);
743
- }
744
- /**
745
- * Set pan position of the current slide.
746
- * Apply friction if the position is beyond the pan bounds,
747
- * or if custom friction is defined.
748
- *
749
- * @private
750
- * @param {'x' | 'y'} axis
751
- * @param {number} potentialPan
752
- * @param {number} [customFriction] (0.1 - 1)
753
- */
754
- _setPanWithFriction(t, i, e) {
755
- const {
756
- currSlide: s
757
- } = this.pswp;
758
- if (!s)
759
- return;
760
- const {
761
- pan: n,
762
- bounds: o
763
- } = s;
764
- if (o.correctPan(t, i) !== i || e) {
765
- const h = Math.round(i - n[t]);
766
- n[t] += h * (e || Q);
767
- } else
768
- n[t] = i;
769
- }
770
- }
771
- const et = 0.05, st = 0.15;
772
- function O(r, t, i) {
773
- return r.x = (t.x + i.x) / 2, r.y = (t.y + i.y) / 2, r;
774
- }
775
- class nt {
776
- /**
777
- * @param {Gestures} gestures
778
- */
779
- constructor(t) {
780
- this.gestures = t, this._startPan = {
781
- x: 0,
782
- y: 0
783
- }, this._startZoomPoint = {
784
- x: 0,
785
- y: 0
786
- }, this._zoomPoint = {
787
- x: 0,
788
- y: 0
789
- }, this._wasOverFitZoomLevel = !1, this._startZoomLevel = 1;
790
- }
791
- start() {
792
- const {
793
- currSlide: t
794
- } = this.gestures.pswp;
795
- t && (this._startZoomLevel = t.currZoomLevel, p(this._startPan, t.pan)), this.gestures.pswp.animations.stopAllPan(), this._wasOverFitZoomLevel = !1;
796
- }
797
- change() {
798
- const {
799
- p1: t,
800
- startP1: i,
801
- p2: e,
802
- startP2: s,
803
- pswp: n
804
- } = this.gestures, {
805
- currSlide: o
806
- } = n;
807
- if (!o)
808
- return;
809
- const a = o.zoomLevels.min, h = o.zoomLevels.max;
810
- if (!o.isZoomable() || n.mainScroll.isShifted())
811
- return;
812
- O(this._startZoomPoint, i, s), O(this._zoomPoint, t, e);
813
- let l = 1 / A(i, s) * A(t, e) * this._startZoomLevel;
814
- if (l > o.zoomLevels.initial + o.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), l < a)
815
- if (n.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= o.zoomLevels.initial) {
816
- const c = 1 - (a - l) / (a / 1.2);
817
- n.dispatch("pinchClose", {
818
- bgOpacity: c
819
- }).defaultPrevented || n.applyBgOpacity(c);
820
- } else
821
- l = a - (a - l) * st;
822
- else l > h && (l = h + (l - h) * et);
823
- o.pan.x = this._calculatePanForZoomLevel("x", l), o.pan.y = this._calculatePanForZoomLevel("y", l), o.setZoomLevel(l), o.applyCurrentZoomPan();
824
- }
825
- end() {
826
- const {
827
- pswp: t
828
- } = this.gestures, {
829
- currSlide: i
830
- } = t;
831
- (!i || i.currZoomLevel < i.zoomLevels.initial) && !this._wasOverFitZoomLevel && t.options.pinchToClose ? t.close() : this.correctZoomPan();
832
- }
833
- /**
834
- * @private
835
- * @param {'x' | 'y'} axis
836
- * @param {number} currZoomLevel
837
- * @returns {number}
838
- */
839
- _calculatePanForZoomLevel(t, i) {
840
- const e = i / this._startZoomLevel;
841
- return this._zoomPoint[t] - (this._startZoomPoint[t] - this._startPan[t]) * e;
842
- }
843
- /**
844
- * Correct currZoomLevel and pan if they are
845
- * beyond minimum or maximum values.
846
- * With animation.
847
- *
848
- * @param {boolean} [ignoreGesture]
849
- * Wether gesture coordinates should be ignored when calculating destination pan position.
850
- */
851
- correctZoomPan(t) {
852
- const {
853
- pswp: i
854
- } = this.gestures, {
855
- currSlide: e
856
- } = i;
857
- if (!(e != null && e.isZoomable()))
858
- return;
859
- this._zoomPoint.x === 0 && (t = !0);
860
- const s = e.currZoomLevel;
861
- let n, o = !0;
862
- s < e.zoomLevels.initial ? n = e.zoomLevels.initial : s > e.zoomLevels.max ? n = e.zoomLevels.max : (o = !1, n = s);
863
- const a = i.bgOpacity, h = i.bgOpacity < 1, l = p({
864
- x: 0,
865
- y: 0
866
- }, e.pan);
867
- let c = p({
868
- x: 0,
869
- y: 0
870
- }, l);
871
- t && (this._zoomPoint.x = 0, this._zoomPoint.y = 0, this._startZoomPoint.x = 0, this._startZoomPoint.y = 0, this._startZoomLevel = s, p(this._startPan, l)), o && (c = {
872
- x: this._calculatePanForZoomLevel("x", n),
873
- y: this._calculatePanForZoomLevel("y", n)
874
- }), e.setZoomLevel(n), c = {
875
- x: e.bounds.correctPan("x", c.x),
876
- y: e.bounds.correctPan("y", c.y)
877
- }, e.setZoomLevel(s);
878
- const d = !x(c, l);
879
- if (!d && !o && !h) {
880
- e._setResolution(n), e.applyCurrentZoomPan();
881
- return;
882
- }
883
- i.animations.stopAllPan(), i.animations.startSpring({
884
- isPan: !0,
885
- start: 0,
886
- end: 1e3,
887
- velocity: 0,
888
- dampingRatio: 1,
889
- naturalFrequency: 40,
890
- onUpdate: (u) => {
891
- if (u /= 1e3, d || o) {
892
- if (d && (e.pan.x = l.x + (c.x - l.x) * u, e.pan.y = l.y + (c.y - l.y) * u), o) {
893
- const m = s + (n - s) * u;
894
- e.setZoomLevel(m);
895
- }
896
- e.applyCurrentZoomPan();
897
- }
898
- h && i.bgOpacity < 1 && i.applyBgOpacity(b(a + (1 - a) * u, 0, 1));
899
- },
900
- onComplete: () => {
901
- e._setResolution(n), e.applyCurrentZoomPan();
902
- }
903
- });
904
- }
905
- }
906
- function Z(r) {
907
- return !!/** @type {HTMLElement} */
908
- r.target.closest(".pswp__container");
909
- }
910
- class ot {
911
- /**
912
- * @param {Gestures} gestures
913
- */
914
- constructor(t) {
915
- this.gestures = t;
916
- }
917
- /**
918
- * @param {Point} point
919
- * @param {PointerEvent} originalEvent
920
- */
921
- click(t, i) {
922
- const e = (
923
- /** @type {HTMLElement} */
924
- i.target.classList
925
- ), s = e.contains("pswp__img"), n = e.contains("pswp__item") || e.contains("pswp__zoom-wrap");
926
- s ? this._doClickOrTapAction("imageClick", t, i) : n && this._doClickOrTapAction("bgClick", t, i);
927
- }
928
- /**
929
- * @param {Point} point
930
- * @param {PointerEvent} originalEvent
931
- */
932
- tap(t, i) {
933
- Z(i) && this._doClickOrTapAction("tap", t, i);
934
- }
935
- /**
936
- * @param {Point} point
937
- * @param {PointerEvent} originalEvent
938
- */
939
- doubleTap(t, i) {
940
- Z(i) && this._doClickOrTapAction("doubleTap", t, i);
941
- }
942
- /**
943
- * @private
944
- * @param {Actions} actionName
945
- * @param {Point} point
946
- * @param {PointerEvent} originalEvent
947
- */
948
- _doClickOrTapAction(t, i, e) {
949
- var s;
950
- const {
951
- pswp: n
952
- } = this.gestures, {
953
- currSlide: o
954
- } = n, a = (
955
- /** @type {AddPostfix<Actions, 'Action'>} */
956
- t + "Action"
957
- ), h = n.options[a];
958
- if (!n.dispatch(a, {
959
- point: i,
960
- originalEvent: e
961
- }).defaultPrevented) {
962
- if (typeof h == "function") {
963
- h.call(n, i, e);
964
- return;
965
- }
966
- switch (h) {
967
- case "close":
968
- case "next":
969
- n[h]();
970
- break;
971
- case "zoom":
972
- o == null || o.toggleZoom(i);
973
- break;
974
- case "zoom-or-close":
975
- o != null && o.isZoomable() && o.zoomLevels.secondary !== o.zoomLevels.initial ? o.toggleZoom(i) : n.options.clickToCloseNonZoomable && n.close();
976
- break;
977
- case "toggle-controls":
978
- (s = this.gestures.pswp.element) === null || s === void 0 || s.classList.toggle("pswp--ui-visible");
979
- break;
980
- }
981
- }
982
- }
983
- }
984
- const rt = 10, at = 300, ht = 25;
985
- class lt {
986
- /**
987
- * @param {PhotoSwipe} pswp
988
- */
989
- constructor(t) {
990
- this.pswp = t, this.dragAxis = null, this.p1 = {
991
- x: 0,
992
- y: 0
993
- }, this.p2 = {
994
- x: 0,
995
- y: 0
996
- }, this.prevP1 = {
997
- x: 0,
998
- y: 0
999
- }, this.prevP2 = {
1000
- x: 0,
1001
- y: 0
1002
- }, this.startP1 = {
1003
- x: 0,
1004
- y: 0
1005
- }, this.startP2 = {
1006
- x: 0,
1007
- y: 0
1008
- }, this.velocity = {
1009
- x: 0,
1010
- y: 0
1011
- }, this._lastStartP1 = {
1012
- x: 0,
1013
- y: 0
1014
- }, this._intervalP1 = {
1015
- x: 0,
1016
- y: 0
1017
- }, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new it(this), this.zoomLevels = new nt(this), this.tapHandler = new ot(this), t.on("bindEvents", () => {
1018
- t.events.add(
1019
- t.scrollWrap,
1020
- "click",
1021
- /** @type EventListener */
1022
- this._onClick.bind(this)
1023
- ), this._pointerEventEnabled ? this._bindEvents("pointer", "down", "up", "cancel") : this._touchEventEnabled ? (this._bindEvents("touch", "start", "end", "cancel"), t.scrollWrap && (t.scrollWrap.ontouchmove = () => {
1024
- }, t.scrollWrap.ontouchend = () => {
1025
- })) : this._bindEvents("mouse", "down", "up");
1026
- });
1027
- }
1028
- /**
1029
- * @private
1030
- * @param {'mouse' | 'touch' | 'pointer'} pref
1031
- * @param {'down' | 'start'} down
1032
- * @param {'up' | 'end'} up
1033
- * @param {'cancel'} [cancel]
1034
- */
1035
- _bindEvents(t, i, e, s) {
1036
- const {
1037
- pswp: n
1038
- } = this, {
1039
- events: o
1040
- } = n, a = s ? t + s : "";
1041
- o.add(
1042
- n.scrollWrap,
1043
- t + i,
1044
- /** @type EventListener */
1045
- this.onPointerDown.bind(this)
1046
- ), o.add(
1047
- window,
1048
- t + "move",
1049
- /** @type EventListener */
1050
- this.onPointerMove.bind(this)
1051
- ), o.add(
1052
- window,
1053
- t + e,
1054
- /** @type EventListener */
1055
- this.onPointerUp.bind(this)
1056
- ), a && o.add(
1057
- n.scrollWrap,
1058
- a,
1059
- /** @type EventListener */
1060
- this.onPointerUp.bind(this)
1061
- );
1062
- }
1063
- /**
1064
- * @param {PointerEvent} e
1065
- */
1066
- onPointerDown(t) {
1067
- const i = t.type === "mousedown" || t.pointerType === "mouse";
1068
- if (i && t.button > 0)
1069
- return;
1070
- const {
1071
- pswp: e
1072
- } = this;
1073
- if (!e.opener.isOpen) {
1074
- t.preventDefault();
1075
- return;
1076
- }
1077
- e.dispatch("pointerDown", {
1078
- originalEvent: t
1079
- }).defaultPrevented || (i && (e.mouseDetected(), this._preventPointerEventBehaviour(t, "down")), e.animations.stopAll(), this._updatePoints(t, "down"), this._numActivePoints === 1 && (this.dragAxis = null, p(this.startP1, this.p1)), this._numActivePoints > 1 ? (this._clearTapTimer(), this.isMultitouch = !0) : this.isMultitouch = !1);
1080
- }
1081
- /**
1082
- * @param {PointerEvent} e
1083
- */
1084
- onPointerMove(t) {
1085
- this._preventPointerEventBehaviour(t, "move"), this._numActivePoints && (this._updatePoints(t, "move"), !this.pswp.dispatch("pointerMove", {
1086
- originalEvent: t
1087
- }).defaultPrevented && (this._numActivePoints === 1 && !this.isDragging ? (this.dragAxis || this._calculateDragDirection(), this.dragAxis && !this.isDragging && (this.isZooming && (this.isZooming = !1, this.zoomLevels.end()), this.isDragging = !0, this._clearTapTimer(), this._updateStartPoints(), this._intervalTime = Date.now(), this._velocityCalculated = !1, p(this._intervalP1, this.p1), this.velocity.x = 0, this.velocity.y = 0, this.drag.start(), this._rafStopLoop(), this._rafRenderLoop())) : this._numActivePoints > 1 && !this.isZooming && (this._finishDrag(), this.isZooming = !0, this._updateStartPoints(), this.zoomLevels.start(), this._rafStopLoop(), this._rafRenderLoop())));
1088
- }
1089
- /**
1090
- * @private
1091
- */
1092
- _finishDrag() {
1093
- this.isDragging && (this.isDragging = !1, this._velocityCalculated || this._updateVelocity(!0), this.drag.end(), this.dragAxis = null);
1094
- }
1095
- /**
1096
- * @param {PointerEvent} e
1097
- */
1098
- onPointerUp(t) {
1099
- this._numActivePoints && (this._updatePoints(t, "up"), !this.pswp.dispatch("pointerUp", {
1100
- originalEvent: t
1101
- }).defaultPrevented && (this._numActivePoints === 0 && (this._rafStopLoop(), this.isDragging ? this._finishDrag() : !this.isZooming && !this.isMultitouch && this._finishTap(t)), this._numActivePoints < 2 && this.isZooming && (this.isZooming = !1, this.zoomLevels.end(), this._numActivePoints === 1 && (this.dragAxis = null, this._updateStartPoints()))));
1102
- }
1103
- /**
1104
- * @private
1105
- */
1106
- _rafRenderLoop() {
1107
- (this.isDragging || this.isZooming) && (this._updateVelocity(), this.isDragging ? x(this.p1, this.prevP1) || this.drag.change() : (!x(this.p1, this.prevP1) || !x(this.p2, this.prevP2)) && this.zoomLevels.change(), this._updatePrevPoints(), this.raf = requestAnimationFrame(this._rafRenderLoop.bind(this)));
1108
- }
1109
- /**
1110
- * Update velocity at 50ms interval
1111
- *
1112
- * @private
1113
- * @param {boolean} [force]
1114
- */
1115
- _updateVelocity(t) {
1116
- const i = Date.now(), e = i - this._intervalTime;
1117
- e < 50 && !t || (this.velocity.x = this._getVelocity("x", e), this.velocity.y = this._getVelocity("y", e), this._intervalTime = i, p(this._intervalP1, this.p1), this._velocityCalculated = !0);
1118
- }
1119
- /**
1120
- * @private
1121
- * @param {PointerEvent} e
1122
- */
1123
- _finishTap(t) {
1124
- const {
1125
- mainScroll: i
1126
- } = this.pswp;
1127
- if (i.isShifted()) {
1128
- i.moveIndexBy(0, !0);
1129
- return;
1130
- }
1131
- if (t.type.indexOf("cancel") > 0)
1132
- return;
1133
- if (t.type === "mouseup" || t.pointerType === "mouse") {
1134
- this.tapHandler.click(this.startP1, t);
1135
- return;
1136
- }
1137
- const e = this.pswp.options.doubleTapAction ? at : 0;
1138
- this._tapTimer ? (this._clearTapTimer(), A(this._lastStartP1, this.startP1) < ht && this.tapHandler.doubleTap(this.startP1, t)) : (p(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
1139
- this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
1140
- }, e));
1141
- }
1142
- /**
1143
- * @private
1144
- */
1145
- _clearTapTimer() {
1146
- this._tapTimer && (clearTimeout(this._tapTimer), this._tapTimer = null);
1147
- }
1148
- /**
1149
- * Get velocity for axis
1150
- *
1151
- * @private
1152
- * @param {'x' | 'y'} axis
1153
- * @param {number} duration
1154
- * @returns {number}
1155
- */
1156
- _getVelocity(t, i) {
1157
- const e = this.p1[t] - this._intervalP1[t];
1158
- return Math.abs(e) > 1 && i > 5 ? e / i : 0;
1159
- }
1160
- /**
1161
- * @private
1162
- */
1163
- _rafStopLoop() {
1164
- this.raf && (cancelAnimationFrame(this.raf), this.raf = null);
1165
- }
1166
- /**
1167
- * @private
1168
- * @param {PointerEvent} e
1169
- * @param {'up' | 'down' | 'move'} pointerType Normalized pointer type
1170
- */
1171
- _preventPointerEventBehaviour(t, i) {
1172
- this.pswp.applyFilters("preventPointerEvent", !0, t, i) && t.preventDefault();
1173
- }
1174
- /**
1175
- * Parses and normalizes points from the touch, mouse or pointer event.
1176
- * Updates p1 and p2.
1177
- *
1178
- * @private
1179
- * @param {PointerEvent | TouchEvent} e
1180
- * @param {'up' | 'down' | 'move'} pointerType Normalized pointer type
1181
- */
1182
- _updatePoints(t, i) {
1183
- if (this._pointerEventEnabled) {
1184
- const e = (
1185
- /** @type {PointerEvent} */
1186
- t
1187
- ), s = this._ongoingPointers.findIndex((n) => n.id === e.pointerId);
1188
- i === "up" && s > -1 ? this._ongoingPointers.splice(s, 1) : i === "down" && s === -1 ? this._ongoingPointers.push(this._convertEventPosToPoint(e, {
1189
- x: 0,
1190
- y: 0
1191
- })) : s > -1 && this._convertEventPosToPoint(e, this._ongoingPointers[s]), this._numActivePoints = this._ongoingPointers.length, this._numActivePoints > 0 && p(this.p1, this._ongoingPointers[0]), this._numActivePoints > 1 && p(this.p2, this._ongoingPointers[1]);
1192
- } else {
1193
- const e = (
1194
- /** @type {TouchEvent} */
1195
- t
1196
- );
1197
- this._numActivePoints = 0, e.type.indexOf("touch") > -1 ? e.touches && e.touches.length > 0 && (this._convertEventPosToPoint(e.touches[0], this.p1), this._numActivePoints++, e.touches.length > 1 && (this._convertEventPosToPoint(e.touches[1], this.p2), this._numActivePoints++)) : (this._convertEventPosToPoint(
1198
- /** @type {PointerEvent} */
1199
- t,
1200
- this.p1
1201
- ), i === "up" ? this._numActivePoints = 0 : this._numActivePoints++);
1202
- }
1203
- }
1204
- /** update points that were used during previous rAF tick
1205
- * @private
1206
- */
1207
- _updatePrevPoints() {
1208
- p(this.prevP1, this.p1), p(this.prevP2, this.p2);
1209
- }
1210
- /** update points at the start of gesture
1211
- * @private
1212
- */
1213
- _updateStartPoints() {
1214
- p(this.startP1, this.p1), p(this.startP2, this.p2), this._updatePrevPoints();
1215
- }
1216
- /** @private */
1217
- _calculateDragDirection() {
1218
- if (this.pswp.mainScroll.isShifted())
1219
- this.dragAxis = "x";
1220
- else {
1221
- const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
1222
- if (t !== 0) {
1223
- const i = t > 0 ? "x" : "y";
1224
- Math.abs(this.p1[i] - this.startP1[i]) >= rt && (this.dragAxis = i);
1225
- }
1226
- }
1227
- }
1228
- /**
1229
- * Converts touch, pointer or mouse event
1230
- * to PhotoSwipe point.
1231
- *
1232
- * @private
1233
- * @param {Touch | PointerEvent} e
1234
- * @param {Point} p
1235
- * @returns {Point}
1236
- */
1237
- _convertEventPosToPoint(t, i) {
1238
- return i.x = t.pageX - this.pswp.offset.x, i.y = t.pageY - this.pswp.offset.y, "pointerId" in t ? i.id = t.pointerId : t.identifier !== void 0 && (i.id = t.identifier), i;
1239
- }
1240
- /**
1241
- * @private
1242
- * @param {PointerEvent} e
1243
- */
1244
- _onClick(t) {
1245
- this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
1246
- }
1247
- }
1248
- const ct = 0.35;
1249
- class dt {
1250
- /**
1251
- * @param {PhotoSwipe} pswp
1252
- */
1253
- constructor(t) {
1254
- this.pswp = t, this.x = 0, this.slideWidth = 0, this._currPositionIndex = 0, this._prevPositionIndex = 0, this._containerShiftIndex = -1, this.itemHolders = [];
1255
- }
1256
- /**
1257
- * Position the scroller and slide containers
1258
- * according to viewport size.
1259
- *
1260
- * @param {boolean} [resizeSlides] Whether slides content should resized
1261
- */
1262
- resize(t) {
1263
- const {
1264
- pswp: i
1265
- } = this, e = Math.round(i.viewportSize.x + i.viewportSize.x * i.options.spacing), s = e !== this.slideWidth;
1266
- s && (this.slideWidth = e, this.moveTo(this.getCurrSlideX())), this.itemHolders.forEach((n, o) => {
1267
- s && y(n.el, (o + this._containerShiftIndex) * this.slideWidth), t && n.slide && n.slide.resize();
1268
- });
1269
- }
1270
- /**
1271
- * Reset X position of the main scroller to zero
1272
- */
1273
- resetPosition() {
1274
- this._currPositionIndex = 0, this._prevPositionIndex = 0, this.slideWidth = 0, this._containerShiftIndex = -1;
1275
- }
1276
- /**
1277
- * Create and append array of three items
1278
- * that hold data about slides in DOM
1279
- */
1280
- appendHolders() {
1281
- this.itemHolders = [];
1282
- for (let t = 0; t < 3; t++) {
1283
- const i = f("pswp__item", "div", this.pswp.container);
1284
- i.setAttribute("role", "group"), i.setAttribute("aria-roledescription", "slide"), i.setAttribute("aria-hidden", "true"), i.style.display = t === 1 ? "block" : "none", this.itemHolders.push({
1285
- el: i
1286
- //index: -1
1287
- });
1288
- }
1289
- }
1290
- /**
1291
- * Whether the main scroll can be horizontally swiped to the next or previous slide.
1292
- * @returns {boolean}
1293
- */
1294
- canBeSwiped() {
1295
- return this.pswp.getNumItems() > 1;
1296
- }
1297
- /**
1298
- * Move main scroll by X amount of slides.
1299
- * For example:
1300
- * `-1` will move to the previous slide,
1301
- * `0` will reset the scroll position of the current slide,
1302
- * `3` will move three slides forward
1303
- *
1304
- * If loop option is enabled - index will be automatically looped too,
1305
- * (for example `-1` will move to the last slide of the gallery).
1306
- *
1307
- * @param {number} diff
1308
- * @param {boolean} [animate]
1309
- * @param {number} [velocityX]
1310
- * @returns {boolean} whether index was changed or not
1311
- */
1312
- moveIndexBy(t, i, e) {
1313
- const {
1314
- pswp: s
1315
- } = this;
1316
- let n = s.potentialIndex + t;
1317
- const o = s.getNumItems();
1318
- if (s.canLoop()) {
1319
- n = s.getLoopedIndex(n);
1320
- const h = (t + o) % o;
1321
- h <= o / 2 ? t = h : t = h - o;
1322
- } else
1323
- n < 0 ? n = 0 : n >= o && (n = o - 1), t = n - s.potentialIndex;
1324
- s.potentialIndex = n, this._currPositionIndex -= t, s.animations.stopMainScroll();
1325
- const a = this.getCurrSlideX();
1326
- if (!i)
1327
- this.moveTo(a), this.updateCurrItem();
1328
- else {
1329
- s.animations.startSpring({
1330
- isMainScroll: !0,
1331
- start: this.x,
1332
- end: a,
1333
- velocity: e || 0,
1334
- naturalFrequency: 30,
1335
- dampingRatio: 1,
1336
- //0.7,
1337
- onUpdate: (l) => {
1338
- this.moveTo(l);
1339
- },
1340
- onComplete: () => {
1341
- this.updateCurrItem(), s.appendHeavy();
1342
- }
1343
- });
1344
- let h = s.potentialIndex - s.currIndex;
1345
- if (s.canLoop()) {
1346
- const l = (h + o) % o;
1347
- l <= o / 2 ? h = l : h = l - o;
1348
- }
1349
- Math.abs(h) > 1 && this.updateCurrItem();
1350
- }
1351
- return !!t;
1352
- }
1353
- /**
1354
- * X position of the main scroll for the current slide
1355
- * (ignores position during dragging)
1356
- * @returns {number}
1357
- */
1358
- getCurrSlideX() {
1359
- return this.slideWidth * this._currPositionIndex;
1360
- }
1361
- /**
1362
- * Whether scroll position is shifted.
1363
- * For example, it will return true if the scroll is being dragged or animated.
1364
- * @returns {boolean}
1365
- */
1366
- isShifted() {
1367
- return this.x !== this.getCurrSlideX();
1368
- }
1369
- /**
1370
- * Update slides X positions and set their content
1371
- */
1372
- updateCurrItem() {
1373
- var t;
1374
- const {
1375
- pswp: i
1376
- } = this, e = this._prevPositionIndex - this._currPositionIndex;
1377
- if (!e)
1378
- return;
1379
- this._prevPositionIndex = this._currPositionIndex, i.currIndex = i.potentialIndex;
1380
- let s = Math.abs(e), n;
1381
- s >= 3 && (this._containerShiftIndex += e + (e > 0 ? -3 : 3), s = 3, this.itemHolders.forEach((o) => {
1382
- var a;
1383
- (a = o.slide) === null || a === void 0 || a.destroy(), o.slide = void 0;
1384
- }));
1385
- for (let o = 0; o < s; o++)
1386
- e > 0 ? (n = this.itemHolders.shift(), n && (this.itemHolders[2] = n, this._containerShiftIndex++, y(n.el, (this._containerShiftIndex + 2) * this.slideWidth), i.setContent(n, i.currIndex - s + o + 2))) : (n = this.itemHolders.pop(), n && (this.itemHolders.unshift(n), this._containerShiftIndex--, y(n.el, this._containerShiftIndex * this.slideWidth), i.setContent(n, i.currIndex + s - o - 2)));
1387
- Math.abs(this._containerShiftIndex) > 50 && !this.isShifted() && (this.resetPosition(), this.resize()), i.animations.stopAllPan(), this.itemHolders.forEach((o, a) => {
1388
- o.slide && o.slide.setIsActive(a === 1);
1389
- }), i.currSlide = (t = this.itemHolders[1]) === null || t === void 0 ? void 0 : t.slide, i.contentLoader.updateLazy(e), i.currSlide && i.currSlide.applyCurrentZoomPan(), i.dispatch("change");
1390
- }
1391
- /**
1392
- * Move the X position of the main scroll container
1393
- *
1394
- * @param {number} x
1395
- * @param {boolean} [dragging]
1396
- */
1397
- moveTo(t, i) {
1398
- if (!this.pswp.canLoop() && i) {
1399
- let e = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
1400
- e += this.pswp.currIndex;
1401
- const s = Math.round(t - this.x);
1402
- (e < 0 && s > 0 || e >= this.pswp.getNumItems() - 1 && s < 0) && (t = this.x + s * ct);
1403
- }
1404
- this.x = t, this.pswp.container && y(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
1405
- x: t,
1406
- dragging: i ?? !1
1407
- });
1408
- }
1409
- }
1410
- const pt = {
1411
- Escape: 27,
1412
- z: 90,
1413
- ArrowLeft: 37,
1414
- ArrowUp: 38,
1415
- ArrowRight: 39,
1416
- ArrowDown: 40,
1417
- Tab: 9
1418
- }, g = (r, t) => t ? r : pt[r];
1419
- class ut {
1420
- /**
1421
- * @param {PhotoSwipe} pswp
1422
- */
1423
- constructor(t) {
1424
- this.pswp = t, this._wasFocused = !1, t.on("bindEvents", () => {
1425
- t.options.trapFocus && (t.options.initialPointerPos || this._focusRoot(), t.events.add(
1426
- document,
1427
- "focusin",
1428
- /** @type EventListener */
1429
- this._onFocusIn.bind(this)
1430
- )), t.events.add(
1431
- document,
1432
- "keydown",
1433
- /** @type EventListener */
1434
- this._onKeyDown.bind(this)
1435
- );
1436
- });
1437
- const i = (
1438
- /** @type {HTMLElement} */
1439
- document.activeElement
1440
- );
1441
- t.on("destroy", () => {
1442
- t.options.returnFocus && i && this._wasFocused && i.focus();
1443
- });
1444
- }
1445
- /** @private */
1446
- _focusRoot() {
1447
- !this._wasFocused && this.pswp.element && (this.pswp.element.focus(), this._wasFocused = !0);
1448
- }
1449
- /**
1450
- * @private
1451
- * @param {KeyboardEvent} e
1452
- */
1453
- _onKeyDown(t) {
1454
- const {
1455
- pswp: i
1456
- } = this;
1457
- if (i.dispatch("keydown", {
1458
- originalEvent: t
1459
- }).defaultPrevented || G(t))
1460
- return;
1461
- let e, s, n = !1;
1462
- const o = "key" in t;
1463
- switch (o ? t.key : t.keyCode) {
1464
- case g("Escape", o):
1465
- i.options.escKey && (e = "close");
1466
- break;
1467
- case g("z", o):
1468
- e = "toggleZoom";
1469
- break;
1470
- case g("ArrowLeft", o):
1471
- s = "x";
1472
- break;
1473
- case g("ArrowUp", o):
1474
- s = "y";
1475
- break;
1476
- case g("ArrowRight", o):
1477
- s = "x", n = !0;
1478
- break;
1479
- case g("ArrowDown", o):
1480
- n = !0, s = "y";
1481
- break;
1482
- case g("Tab", o):
1483
- this._focusRoot();
1484
- break;
1485
- }
1486
- if (s) {
1487
- t.preventDefault();
1488
- const {
1489
- currSlide: a
1490
- } = i;
1491
- i.options.arrowKeys && s === "x" && i.getNumItems() > 1 ? e = n ? "next" : "prev" : a && a.currZoomLevel > a.zoomLevels.fit && (a.pan[s] += n ? -80 : 80, a.panTo(a.pan.x, a.pan.y));
1492
- }
1493
- e && (t.preventDefault(), i[e]());
1494
- }
1495
- /**
1496
- * Trap focus inside photoswipe
1497
- *
1498
- * @private
1499
- * @param {FocusEvent} e
1500
- */
1501
- _onFocusIn(t) {
1502
- const {
1503
- template: i
1504
- } = this.pswp;
1505
- i && document !== t.target && i !== t.target && !i.contains(
1506
- /** @type {Node} */
1507
- t.target
1508
- ) && i.focus();
1509
- }
1510
- }
1511
- const mt = "cubic-bezier(.4,0,.22,1)";
1512
- class ft {
1513
- /**
1514
- * onComplete can be unpredictable, be careful about current state
1515
- *
1516
- * @param {CssAnimationProps} props
1517
- */
1518
- constructor(t) {
1519
- var i;
1520
- this.props = t;
1521
- const {
1522
- target: e,
1523
- onComplete: s,
1524
- transform: n,
1525
- onFinish: o = () => {
1526
- },
1527
- duration: a = 333,
1528
- easing: h = mt
1529
- } = t;
1530
- this.onFinish = o;
1531
- const l = n ? "transform" : "opacity", c = (i = t[l]) !== null && i !== void 0 ? i : "";
1532
- this._target = e, this._onComplete = s, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
1533
- R(e, l, a, h), this._helperTimeout = setTimeout(() => {
1534
- e.addEventListener("transitionend", this._onTransitionEnd, !1), e.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
1535
- this._finalizeAnimation();
1536
- }, a + 500), e.style[l] = c;
1537
- }, 30);
1538
- }, 0);
1539
- }
1540
- /**
1541
- * @private
1542
- * @param {TransitionEvent} e
1543
- */
1544
- _onTransitionEnd(t) {
1545
- t.target === this._target && this._finalizeAnimation();
1546
- }
1547
- /**
1548
- * @private
1549
- */
1550
- _finalizeAnimation() {
1551
- this._finished || (this._finished = !0, this.onFinish(), this._onComplete && this._onComplete());
1552
- }
1553
- // Destroy is called automatically onFinish
1554
- destroy() {
1555
- this._helperTimeout && clearTimeout(this._helperTimeout), U(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
1556
- }
1557
- }
1558
- const _t = 12, vt = 0.75;
1559
- class gt {
1560
- /**
1561
- * @param {number} initialVelocity Initial velocity, px per ms.
1562
- *
1563
- * @param {number} [dampingRatio]
1564
- * Determines how bouncy animation will be.
1565
- * From 0 to 1, 0 - always overshoot, 1 - do not overshoot.
1566
- * "overshoot" refers to part of animation that
1567
- * goes beyond the final value.
1568
- *
1569
- * @param {number} [naturalFrequency]
1570
- * Determines how fast animation will slow down.
1571
- * The higher value - the stiffer the transition will be,
1572
- * and the faster it will slow down.
1573
- * Recommended value from 10 to 50
1574
- */
1575
- constructor(t, i, e) {
1576
- this.velocity = t * 1e3, this._dampingRatio = i || vt, this._naturalFrequency = e || _t, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
1577
- }
1578
- /**
1579
- * @param {number} deltaPosition Difference between current and end position of the animation
1580
- * @param {number} deltaTime Frame duration in milliseconds
1581
- *
1582
- * @returns {number} Displacement, relative to the end position.
1583
- */
1584
- easeFrame(t, i) {
1585
- let e = 0, s;
1586
- i /= 1e3;
1587
- const n = Math.E ** (-this._dampingRatio * this._naturalFrequency * i);
1588
- if (this._dampingRatio === 1)
1589
- s = this.velocity + this._naturalFrequency * t, e = (t + s * i) * n, this.velocity = e * -this._naturalFrequency + s * n;
1590
- else if (this._dampingRatio < 1) {
1591
- s = 1 / this._dampedFrequency * (this._dampingRatio * this._naturalFrequency * t + this.velocity);
1592
- const o = Math.cos(this._dampedFrequency * i), a = Math.sin(this._dampedFrequency * i);
1593
- e = n * (t * o + s * a), this.velocity = e * -this._naturalFrequency * this._dampingRatio + n * (-this._dampedFrequency * t * a + this._dampedFrequency * s * o);
1594
- }
1595
- return e;
1596
- }
1597
- }
1598
- class yt {
1599
- /**
1600
- * @param {SpringAnimationProps} props
1601
- */
1602
- constructor(t) {
1603
- this.props = t, this._raf = 0;
1604
- const {
1605
- start: i,
1606
- end: e,
1607
- velocity: s,
1608
- onUpdate: n,
1609
- onComplete: o,
1610
- onFinish: a = () => {
1611
- },
1612
- dampingRatio: h,
1613
- naturalFrequency: l
1614
- } = t;
1615
- this.onFinish = a;
1616
- const c = new gt(s, h, l);
1617
- let d = Date.now(), u = i - e;
1618
- const m = () => {
1619
- this._raf && (u = c.easeFrame(u, Date.now() - d), Math.abs(u) < 1 && Math.abs(c.velocity) < 50 ? (n(e), o && o(), this.onFinish()) : (d = Date.now(), n(u + e), this._raf = requestAnimationFrame(m)));
1620
- };
1621
- this._raf = requestAnimationFrame(m);
1622
- }
1623
- // Destroy is called automatically onFinish
1624
- destroy() {
1625
- this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
1626
- }
1627
- }
1628
- class wt {
1629
- constructor() {
1630
- this.activeAnimations = [];
1631
- }
1632
- /**
1633
- * @param {SpringAnimationProps} props
1634
- */
1635
- startSpring(t) {
1636
- this._start(t, !0);
1637
- }
1638
- /**
1639
- * @param {CssAnimationProps} props
1640
- */
1641
- startTransition(t) {
1642
- this._start(t);
1643
- }
1644
- /**
1645
- * @private
1646
- * @param {AnimationProps} props
1647
- * @param {boolean} [isSpring]
1648
- * @returns {Animation}
1649
- */
1650
- _start(t, i) {
1651
- const e = i ? new yt(
1652
- /** @type SpringAnimationProps */
1653
- t
1654
- ) : new ft(
1655
- /** @type CssAnimationProps */
1656
- t
1657
- );
1658
- return this.activeAnimations.push(e), e.onFinish = () => this.stop(e), e;
1659
- }
1660
- /**
1661
- * @param {Animation} animation
1662
- */
1663
- stop(t) {
1664
- t.destroy();
1665
- const i = this.activeAnimations.indexOf(t);
1666
- i > -1 && this.activeAnimations.splice(i, 1);
1667
- }
1668
- stopAll() {
1669
- this.activeAnimations.forEach((t) => {
1670
- t.destroy();
1671
- }), this.activeAnimations = [];
1672
- }
1673
- /**
1674
- * Stop all pan or zoom transitions
1675
- */
1676
- stopAllPan() {
1677
- this.activeAnimations = this.activeAnimations.filter((t) => t.props.isPan ? (t.destroy(), !1) : !0);
1678
- }
1679
- stopMainScroll() {
1680
- this.activeAnimations = this.activeAnimations.filter((t) => t.props.isMainScroll ? (t.destroy(), !1) : !0);
1681
- }
1682
- /**
1683
- * Returns true if main scroll transition is running
1684
- */
1685
- // isMainScrollRunning() {
1686
- // return this.activeAnimations.some((animation) => {
1687
- // return animation.props.isMainScroll;
1688
- // });
1689
- // }
1690
- /**
1691
- * Returns true if any pan or zoom transition is running
1692
- */
1693
- isPanRunning() {
1694
- return this.activeAnimations.some((t) => t.props.isPan);
1695
- }
1696
- }
1697
- class Pt {
1698
- /**
1699
- * @param {PhotoSwipe} pswp
1700
- */
1701
- constructor(t) {
1702
- this.pswp = t, t.events.add(
1703
- t.element,
1704
- "wheel",
1705
- /** @type EventListener */
1706
- this._onWheel.bind(this)
1707
- );
1708
- }
1709
- /**
1710
- * @private
1711
- * @param {WheelEvent} e
1712
- */
1713
- _onWheel(t) {
1714
- t.preventDefault();
1715
- const {
1716
- currSlide: i
1717
- } = this.pswp;
1718
- let {
1719
- deltaX: e,
1720
- deltaY: s
1721
- } = t;
1722
- if (i && !this.pswp.dispatch("wheel", {
1723
- originalEvent: t
1724
- }).defaultPrevented)
1725
- if (t.ctrlKey || this.pswp.options.wheelToZoom) {
1726
- if (i.isZoomable()) {
1727
- let n = -s;
1728
- t.deltaMode === 1 ? n *= 0.05 : n *= t.deltaMode ? 1 : 2e-3, n = 2 ** n;
1729
- const o = i.currZoomLevel * n;
1730
- i.zoomTo(o, {
1731
- x: t.clientX,
1732
- y: t.clientY
1733
- });
1734
- }
1735
- } else
1736
- i.isPannable() && (t.deltaMode === 1 && (e *= 18, s *= 18), i.panTo(i.pan.x - e, i.pan.y - s));
1737
- }
1738
- }
1739
- function St(r) {
1740
- if (typeof r == "string")
1741
- return r;
1742
- if (!r || !r.isCustomSVG)
1743
- return "";
1744
- const t = r;
1745
- let i = '<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';
1746
- return i = i.split("%d").join(
1747
- /** @type {string} */
1748
- t.size || 32
1749
- ), t.outlineID && (i += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), i += t.inner, i += "</svg>", i;
1750
- }
1751
- class xt {
1752
- /**
1753
- * @param {PhotoSwipe} pswp
1754
- * @param {UIElementData} data
1755
- */
1756
- constructor(t, i) {
1757
- var e;
1758
- const s = i.name || i.className;
1759
- let n = i.html;
1760
- if (t.options[s] === !1)
1761
- return;
1762
- typeof t.options[s + "SVG"] == "string" && (n = t.options[s + "SVG"]), t.dispatch("uiElementCreate", {
1763
- data: i
1764
- });
1765
- let o = "";
1766
- i.isButton ? (o += "pswp__button ", o += i.className || `pswp__button--${i.name}`) : o += i.className || `pswp__${i.name}`;
1767
- let a = i.isButton ? i.tagName || "button" : i.tagName || "div";
1768
- a = /** @type {keyof HTMLElementTagNameMap} */
1769
- a.toLowerCase();
1770
- const h = f(o, a);
1771
- if (i.isButton) {
1772
- a === "button" && (h.type = "button");
1773
- let {
1774
- title: d
1775
- } = i;
1776
- const {
1777
- ariaLabel: u
1778
- } = i;
1779
- typeof t.options[s + "Title"] == "string" && (d = t.options[s + "Title"]), d && (h.title = d);
1780
- const m = u || d;
1781
- m && h.setAttribute("aria-label", m);
1782
- }
1783
- h.innerHTML = St(n), i.onInit && i.onInit(h, t), i.onClick && (h.onclick = (d) => {
1784
- typeof i.onClick == "string" ? t[i.onClick]() : typeof i.onClick == "function" && i.onClick(d, h, t);
1785
- });
1786
- const l = i.appendTo || "bar";
1787
- let c = t.element;
1788
- l === "bar" ? (t.topBar || (t.topBar = f("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), c = t.topBar) : (h.classList.add("pswp__hide-on-close"), l === "wrapper" && (c = t.scrollWrap)), (e = c) === null || e === void 0 || e.appendChild(t.applyFilters("uiElement", h, i));
1789
- }
1790
- }
1791
- function H(r, t, i) {
1792
- r.classList.add("pswp__button--arrow"), r.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
1793
- t.options.loop || (i ? r.disabled = !(t.currIndex < t.getNumItems() - 1) : r.disabled = !(t.currIndex > 0));
1794
- });
1795
- }
1796
- const It = {
1797
- name: "arrowPrev",
1798
- className: "pswp__button--arrow--prev",
1799
- title: "Previous",
1800
- order: 10,
1801
- isButton: !0,
1802
- appendTo: "wrapper",
1803
- html: {
1804
- isCustomSVG: !0,
1805
- size: 60,
1806
- inner: '<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',
1807
- outlineID: "pswp__icn-arrow"
1808
- },
1809
- onClick: "prev",
1810
- onInit: H
1811
- }, bt = {
1812
- name: "arrowNext",
1813
- className: "pswp__button--arrow--next",
1814
- title: "Next",
1815
- order: 11,
1816
- isButton: !0,
1817
- appendTo: "wrapper",
1818
- html: {
1819
- isCustomSVG: !0,
1820
- size: 60,
1821
- inner: '<use xlink:href="#pswp__icn-arrow"/>',
1822
- outlineID: "pswp__icn-arrow"
1823
- },
1824
- onClick: "next",
1825
- onInit: (r, t) => {
1826
- H(r, t, !0);
1827
- }
1828
- }, At = {
1829
- name: "close",
1830
- title: "Close",
1831
- order: 20,
1832
- isButton: !0,
1833
- html: {
1834
- isCustomSVG: !0,
1835
- inner: '<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',
1836
- outlineID: "pswp__icn-close"
1837
- },
1838
- onClick: "close"
1839
- }, Lt = {
1840
- name: "zoom",
1841
- title: "Zoom",
1842
- order: 10,
1843
- isButton: !0,
1844
- html: {
1845
- isCustomSVG: !0,
1846
- // eslint-disable-next-line max-len
1847
- inner: '<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',
1848
- outlineID: "pswp__icn-zoom"
1849
- },
1850
- onClick: "toggleZoom"
1851
- }, Ct = {
1852
- name: "preloader",
1853
- appendTo: "bar",
1854
- order: 7,
1855
- html: {
1856
- isCustomSVG: !0,
1857
- // eslint-disable-next-line max-len
1858
- inner: '<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',
1859
- outlineID: "pswp__icn-loading"
1860
- },
1861
- onInit: (r, t) => {
1862
- let i, e = null;
1863
- const s = (a, h) => {
1864
- r.classList.toggle("pswp__preloader--" + a, h);
1865
- }, n = (a) => {
1866
- i !== a && (i = a, s("active", a));
1867
- }, o = () => {
1868
- var a;
1869
- if (!((a = t.currSlide) !== null && a !== void 0 && a.content.isLoading())) {
1870
- n(!1), e && (clearTimeout(e), e = null);
1871
- return;
1872
- }
1873
- e || (e = setTimeout(() => {
1874
- var h;
1875
- n(!!(!((h = t.currSlide) === null || h === void 0) && h.content.isLoading())), e = null;
1876
- }, t.options.preloaderDelay));
1877
- };
1878
- t.on("change", o), t.on("loadComplete", (a) => {
1879
- t.currSlide === a.slide && o();
1880
- }), t.ui && (t.ui.updatePreloaderVisibility = o);
1881
- }
1882
- }, Tt = {
1883
- name: "counter",
1884
- order: 5,
1885
- onInit: (r, t) => {
1886
- t.on("change", () => {
1887
- r.innerText = t.currIndex + 1 + t.options.indexIndicatorSep + t.getNumItems();
1888
- });
1889
- }
1890
- };
1891
- function D(r, t) {
1892
- r.classList.toggle("pswp--zoomed-in", t);
1893
- }
1894
- class zt {
1895
- /**
1896
- * @param {PhotoSwipe} pswp
1897
- */
1898
- constructor(t) {
1899
- this.pswp = t, this.isRegistered = !1, this.uiElementsData = [], this.items = [], this.updatePreloaderVisibility = () => {
1900
- }, this._lastUpdatedZoomLevel = void 0;
1901
- }
1902
- init() {
1903
- const {
1904
- pswp: t
1905
- } = this;
1906
- this.isRegistered = !1, this.uiElementsData = [At, It, bt, Lt, Ct, Tt], t.dispatch("uiRegister"), this.uiElementsData.sort((i, e) => (i.order || 0) - (e.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((i) => {
1907
- this.registerElement(i);
1908
- }), t.on("change", () => {
1909
- var i;
1910
- (i = t.element) === null || i === void 0 || i.classList.toggle("pswp--one-slide", t.getNumItems() === 1);
1911
- }), t.on("zoomPanUpdate", () => this._onZoomPanUpdate());
1912
- }
1913
- /**
1914
- * @param {UIElementData} elementData
1915
- */
1916
- registerElement(t) {
1917
- this.isRegistered ? this.items.push(new xt(this.pswp, t)) : this.uiElementsData.push(t);
1918
- }
1919
- /**
1920
- * Fired each time zoom or pan position is changed.
1921
- * Update classes that control visibility of zoom button and cursor icon.
1922
- *
1923
- * @private
1924
- */
1925
- _onZoomPanUpdate() {
1926
- const {
1927
- template: t,
1928
- currSlide: i,
1929
- options: e
1930
- } = this.pswp;
1931
- if (this.pswp.opener.isClosing || !t || !i)
1932
- return;
1933
- let {
1934
- currZoomLevel: s
1935
- } = i;
1936
- if (this.pswp.opener.isOpen || (s = i.zoomLevels.initial), s === this._lastUpdatedZoomLevel)
1937
- return;
1938
- this._lastUpdatedZoomLevel = s;
1939
- const n = i.zoomLevels.initial - i.zoomLevels.secondary;
1940
- if (Math.abs(n) < 0.01 || !i.isZoomable()) {
1941
- D(t, !1), t.classList.remove("pswp--zoom-allowed");
1942
- return;
1943
- }
1944
- t.classList.add("pswp--zoom-allowed");
1945
- const o = s === i.zoomLevels.initial ? i.zoomLevels.secondary : i.zoomLevels.initial;
1946
- D(t, o <= s), (e.imageClickAction === "zoom" || e.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
1947
- }
1948
- }
1949
- function Et(r) {
1950
- const t = r.getBoundingClientRect();
1951
- return {
1952
- x: t.left,
1953
- y: t.top,
1954
- w: t.width
1955
- };
1956
- }
1957
- function Ot(r, t, i) {
1958
- const e = r.getBoundingClientRect(), s = e.width / t, n = e.height / i, o = s > n ? s : n, a = (e.width - t * o) / 2, h = (e.height - i * o) / 2, l = {
1959
- x: e.left + a,
1960
- y: e.top + h,
1961
- w: t * o
1962
- };
1963
- return l.innerRect = {
1964
- w: e.width,
1965
- h: e.height,
1966
- x: a,
1967
- y: h
1968
- }, l;
1969
- }
1970
- function Zt(r, t, i) {
1971
- const e = i.dispatch("thumbBounds", {
1972
- index: r,
1973
- itemData: t,
1974
- instance: i
1975
- });
1976
- if (e.thumbBounds)
1977
- return e.thumbBounds;
1978
- const {
1979
- element: s
1980
- } = t;
1981
- let n, o;
1982
- if (s && i.options.thumbSelector !== !1) {
1983
- const a = i.options.thumbSelector || "img";
1984
- o = s.matches(a) ? s : (
1985
- /** @type {HTMLElement | null} */
1986
- s.querySelector(a)
1987
- );
1988
- }
1989
- return o = i.applyFilters("thumbEl", o, t, r), o && (t.thumbCropped ? n = Ot(o, t.width || t.w || 0, t.height || t.h || 0) : n = Et(o)), i.applyFilters("thumbBounds", n, t, r);
1990
- }
1991
- class Dt {
1992
- /**
1993
- * @param {T} type
1994
- * @param {PhotoSwipeEventsMap[T]} [details]
1995
- */
1996
- constructor(t, i) {
1997
- this.type = t, this.defaultPrevented = !1, i && Object.assign(this, i);
1998
- }
1999
- preventDefault() {
2000
- this.defaultPrevented = !0;
2001
- }
2002
- }
2003
- class Mt {
2004
- constructor() {
2005
- this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
2006
- }
2007
- /**
2008
- * @template {keyof PhotoSwipeFiltersMap} T
2009
- * @param {T} name
2010
- * @param {PhotoSwipeFiltersMap[T]} fn
2011
- * @param {number} priority
2012
- */
2013
- addFilter(t, i, e = 100) {
2014
- var s, n, o;
2015
- this._filters[t] || (this._filters[t] = []), (s = this._filters[t]) === null || s === void 0 || s.push({
2016
- fn: i,
2017
- priority: e
2018
- }), (n = this._filters[t]) === null || n === void 0 || n.sort((a, h) => a.priority - h.priority), (o = this.pswp) === null || o === void 0 || o.addFilter(t, i, e);
2019
- }
2020
- /**
2021
- * @template {keyof PhotoSwipeFiltersMap} T
2022
- * @param {T} name
2023
- * @param {PhotoSwipeFiltersMap[T]} fn
2024
- */
2025
- removeFilter(t, i) {
2026
- this._filters[t] && (this._filters[t] = this._filters[t].filter((e) => e.fn !== i)), this.pswp && this.pswp.removeFilter(t, i);
2027
- }
2028
- /**
2029
- * @template {keyof PhotoSwipeFiltersMap} T
2030
- * @param {T} name
2031
- * @param {Parameters<PhotoSwipeFiltersMap[T]>} args
2032
- * @returns {Parameters<PhotoSwipeFiltersMap[T]>[0]}
2033
- */
2034
- applyFilters(t, ...i) {
2035
- var e;
2036
- return (e = this._filters[t]) === null || e === void 0 || e.forEach((s) => {
2037
- i[0] = s.fn.apply(this, i);
2038
- }), i[0];
2039
- }
2040
- /**
2041
- * @template {keyof PhotoSwipeEventsMap} T
2042
- * @param {T} name
2043
- * @param {EventCallback<T>} fn
2044
- */
2045
- on(t, i) {
2046
- var e, s;
2047
- this._listeners[t] || (this._listeners[t] = []), (e = this._listeners[t]) === null || e === void 0 || e.push(i), (s = this.pswp) === null || s === void 0 || s.on(t, i);
2048
- }
2049
- /**
2050
- * @template {keyof PhotoSwipeEventsMap} T
2051
- * @param {T} name
2052
- * @param {EventCallback<T>} fn
2053
- */
2054
- off(t, i) {
2055
- var e;
2056
- this._listeners[t] && (this._listeners[t] = this._listeners[t].filter((s) => i !== s)), (e = this.pswp) === null || e === void 0 || e.off(t, i);
2057
- }
2058
- /**
2059
- * @template {keyof PhotoSwipeEventsMap} T
2060
- * @param {T} name
2061
- * @param {PhotoSwipeEventsMap[T]} [details]
2062
- * @returns {AugmentedEvent<T>}
2063
- */
2064
- dispatch(t, i) {
2065
- var e;
2066
- if (this.pswp)
2067
- return this.pswp.dispatch(t, i);
2068
- const s = (
2069
- /** @type {AugmentedEvent<T>} */
2070
- new Dt(t, i)
2071
- );
2072
- return (e = this._listeners[t]) === null || e === void 0 || e.forEach((n) => {
2073
- n.call(this, s);
2074
- }), s;
2075
- }
2076
- }
2077
- class Rt {
2078
- /**
2079
- * @param {string | false} imageSrc
2080
- * @param {HTMLElement} container
2081
- */
2082
- constructor(t, i) {
2083
- if (this.element = f("pswp__img pswp__img--placeholder", t ? "img" : "div", i), t) {
2084
- const e = (
2085
- /** @type {HTMLImageElement} */
2086
- this.element
2087
- );
2088
- e.decoding = "async", e.alt = "", e.src = t, e.setAttribute("role", "presentation");
2089
- }
2090
- this.element.setAttribute("aria-hidden", "true");
2091
- }
2092
- /**
2093
- * @param {number} width
2094
- * @param {number} height
2095
- */
2096
- setDisplayedSize(t, i) {
2097
- this.element && (this.element.tagName === "IMG" ? (L(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = I(0, 0, t / 250)) : L(this.element, t, i));
2098
- }
2099
- destroy() {
2100
- var t;
2101
- (t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
2102
- }
2103
- }
2104
- class Ft {
2105
- /**
2106
- * @param {SlideData} itemData Slide data
2107
- * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
2108
- * @param {number} index
2109
- */
2110
- constructor(t, i, e) {
2111
- this.instance = i, this.data = t, this.index = e, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state = _.IDLE, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {
2112
- content: this
2113
- });
2114
- }
2115
- removePlaceholder() {
2116
- this.placeholder && !this.keepPlaceholder() && setTimeout(() => {
2117
- this.placeholder && (this.placeholder.destroy(), this.placeholder = void 0);
2118
- }, 1e3);
2119
- }
2120
- /**
2121
- * Preload content
2122
- *
2123
- * @param {boolean} isLazy
2124
- * @param {boolean} [reload]
2125
- */
2126
- load(t, i) {
2127
- if (this.slide && this.usePlaceholder())
2128
- if (this.placeholder) {
2129
- const e = this.placeholder.element;
2130
- e && !e.parentElement && this.slide.container.prepend(e);
2131
- } else {
2132
- const e = this.instance.applyFilters(
2133
- "placeholderSrc",
2134
- // use image-based placeholder only for the first slide,
2135
- // as rendering (even small stretched thumbnail) is an expensive operation
2136
- this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
2137
- this
2138
- );
2139
- this.placeholder = new Rt(e, this.slide.container);
2140
- }
2141
- this.element && !i || this.instance.dispatch("contentLoad", {
2142
- content: this,
2143
- isLazy: t
2144
- }).defaultPrevented || (this.isImageContent() ? (this.element = f("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = f("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), i && this.slide && this.slide.updateContentSize(!0));
2145
- }
2146
- /**
2147
- * Preload image
2148
- *
2149
- * @param {boolean} isLazy
2150
- */
2151
- loadImage(t) {
2152
- var i, e;
2153
- if (!this.isImageContent() || !this.element || this.instance.dispatch("contentLoadImage", {
2154
- content: this,
2155
- isLazy: t
2156
- }).defaultPrevented)
2157
- return;
2158
- const s = (
2159
- /** @type HTMLImageElement */
2160
- this.element
2161
- );
2162
- this.updateSrcsetSizes(), this.data.srcset && (s.srcset = this.data.srcset), s.src = (i = this.data.src) !== null && i !== void 0 ? i : "", s.alt = (e = this.data.alt) !== null && e !== void 0 ? e : "", this.state = _.LOADING, s.complete ? this.onLoaded() : (s.onload = () => {
2163
- this.onLoaded();
2164
- }, s.onerror = () => {
2165
- this.onError();
2166
- });
2167
- }
2168
- /**
2169
- * Assign slide to content
2170
- *
2171
- * @param {Slide} slide
2172
- */
2173
- setSlide(t) {
2174
- this.slide = t, this.hasSlide = !0, this.instance = t.pswp;
2175
- }
2176
- /**
2177
- * Content load success handler
2178
- */
2179
- onLoaded() {
2180
- this.state = _.LOADED, this.slide && this.element && (this.instance.dispatch("loadComplete", {
2181
- slide: this.slide,
2182
- content: this
2183
- }), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state === _.LOADED || this.state === _.ERROR) && this.removePlaceholder());
2184
- }
2185
- /**
2186
- * Content load error handler
2187
- */
2188
- onError() {
2189
- this.state = _.ERROR, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", {
2190
- slide: this.slide,
2191
- isError: !0,
2192
- content: this
2193
- }), this.instance.dispatch("loadError", {
2194
- slide: this.slide,
2195
- content: this
2196
- }));
2197
- }
2198
- /**
2199
- * @returns {Boolean} If the content is currently loading
2200
- */
2201
- isLoading() {
2202
- return this.instance.applyFilters("isContentLoading", this.state === _.LOADING, this);
2203
- }
2204
- /**
2205
- * @returns {Boolean} If the content is in error state
2206
- */
2207
- isError() {
2208
- return this.state === _.ERROR;
2209
- }
2210
- /**
2211
- * @returns {boolean} If the content is image
2212
- */
2213
- isImageContent() {
2214
- return this.type === "image";
2215
- }
2216
- /**
2217
- * Update content size
2218
- *
2219
- * @param {Number} width
2220
- * @param {Number} height
2221
- */
2222
- setDisplayedSize(t, i) {
2223
- if (this.element && (this.placeholder && this.placeholder.setDisplayedSize(t, i), !this.instance.dispatch("contentResize", {
2224
- content: this,
2225
- width: t,
2226
- height: i
2227
- }).defaultPrevented && (L(this.element, t, i), this.isImageContent() && !this.isError()))) {
2228
- const e = !this.displayedImageWidth && t;
2229
- this.displayedImageWidth = t, this.displayedImageHeight = i, e ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
2230
- slide: this.slide,
2231
- width: t,
2232
- height: i,
2233
- content: this
2234
- });
2235
- }
2236
- }
2237
- /**
2238
- * @returns {boolean} If the content can be zoomed
2239
- */
2240
- isZoomable() {
2241
- return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== _.ERROR, this);
2242
- }
2243
- /**
2244
- * Update image srcset sizes attribute based on width and height
2245
- */
2246
- updateSrcsetSizes() {
2247
- if (!this.isImageContent() || !this.element || !this.data.srcset)
2248
- return;
2249
- const t = (
2250
- /** @type HTMLImageElement */
2251
- this.element
2252
- ), i = this.instance.applyFilters("srcsetSizesWidth", this.displayedImageWidth, this);
2253
- (!t.dataset.largestUsedSize || i > parseInt(t.dataset.largestUsedSize, 10)) && (t.sizes = i + "px", t.dataset.largestUsedSize = String(i));
2254
- }
2255
- /**
2256
- * @returns {boolean} If content should use a placeholder (from msrc by default)
2257
- */
2258
- usePlaceholder() {
2259
- return this.instance.applyFilters("useContentPlaceholder", this.isImageContent(), this);
2260
- }
2261
- /**
2262
- * Preload content with lazy-loading param
2263
- */
2264
- lazyLoad() {
2265
- this.instance.dispatch("contentLazyLoad", {
2266
- content: this
2267
- }).defaultPrevented || this.load(!0);
2268
- }
2269
- /**
2270
- * @returns {boolean} If placeholder should be kept after content is loaded
2271
- */
2272
- keepPlaceholder() {
2273
- return this.instance.applyFilters("isKeepingPlaceholder", this.isLoading(), this);
2274
- }
2275
- /**
2276
- * Destroy the content
2277
- */
2278
- destroy() {
2279
- this.hasSlide = !1, this.slide = void 0, !this.instance.dispatch("contentDestroy", {
2280
- content: this
2281
- }).defaultPrevented && (this.remove(), this.placeholder && (this.placeholder.destroy(), this.placeholder = void 0), this.isImageContent() && this.element && (this.element.onload = null, this.element.onerror = null, this.element = void 0));
2282
- }
2283
- /**
2284
- * Display error message
2285
- */
2286
- displayError() {
2287
- if (this.slide) {
2288
- var t, i;
2289
- let e = f("pswp__error-msg", "div");
2290
- e.innerText = (t = (i = this.instance.options) === null || i === void 0 ? void 0 : i.errorMsg) !== null && t !== void 0 ? t : "", e = /** @type {HTMLDivElement} */
2291
- this.instance.applyFilters("contentErrorElement", e, this), this.element = f("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(e), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder();
2292
- }
2293
- }
2294
- /**
2295
- * Append the content
2296
- */
2297
- append() {
2298
- if (this.isAttached || !this.element)
2299
- return;
2300
- if (this.isAttached = !0, this.state === _.ERROR) {
2301
- this.displayError();
2302
- return;
2303
- }
2304
- if (this.instance.dispatch("contentAppend", {
2305
- content: this
2306
- }).defaultPrevented)
2307
- return;
2308
- const t = "decode" in this.element;
2309
- this.isImageContent() ? t && this.slide && (!this.slide.isActive || C()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
2310
- }).finally(() => {
2311
- this.isDecoding = !1, this.appendImage();
2312
- })) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
2313
- }
2314
- /**
2315
- * Activate the slide,
2316
- * active slide is generally the current one,
2317
- * meaning the user can see it.
2318
- */
2319
- activate() {
2320
- this.instance.dispatch("contentActivate", {
2321
- content: this
2322
- }).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !C() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
2323
- }
2324
- /**
2325
- * Deactivate the content
2326
- */
2327
- deactivate() {
2328
- this.instance.dispatch("contentDeactivate", {
2329
- content: this
2330
- }), this.slide && this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "true");
2331
- }
2332
- /**
2333
- * Remove the content from DOM
2334
- */
2335
- remove() {
2336
- this.isAttached = !1, !this.instance.dispatch("contentRemove", {
2337
- content: this
2338
- }).defaultPrevented && (this.element && this.element.parentNode && this.element.remove(), this.placeholder && this.placeholder.element && this.placeholder.element.remove());
2339
- }
2340
- /**
2341
- * Append the image content to slide container
2342
- */
2343
- appendImage() {
2344
- this.isAttached && (this.instance.dispatch("contentAppendImage", {
2345
- content: this
2346
- }).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === _.LOADED || this.state === _.ERROR) && this.removePlaceholder()));
2347
- }
2348
- }
2349
- const Bt = 5;
2350
- function W(r, t, i) {
2351
- const e = t.createContentFromData(r, i);
2352
- let s;
2353
- const {
2354
- options: n
2355
- } = t;
2356
- if (n) {
2357
- s = new k(n, r, -1);
2358
- let o;
2359
- t.pswp ? o = t.pswp.viewportSize : o = B(n, t);
2360
- const a = N(n, o, r, i);
2361
- s.update(e.width, e.height, a);
2362
- }
2363
- return e.lazyLoad(), s && e.setDisplayedSize(Math.ceil(e.width * s.initial), Math.ceil(e.height * s.initial)), e;
2364
- }
2365
- function Nt(r, t) {
2366
- const i = t.getItemData(r);
2367
- if (!t.dispatch("lazyLoadSlide", {
2368
- index: r,
2369
- itemData: i
2370
- }).defaultPrevented)
2371
- return W(i, t, r);
2372
- }
2373
- class kt {
2374
- /**
2375
- * @param {PhotoSwipe} pswp
2376
- */
2377
- constructor(t) {
2378
- this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, Bt), this._cachedItems = [];
2379
- }
2380
- /**
2381
- * Lazy load nearby slides based on `preload` option.
2382
- *
2383
- * @param {number} [diff] Difference between slide indexes that was changed recently, or 0.
2384
- */
2385
- updateLazy(t) {
2386
- const {
2387
- pswp: i
2388
- } = this;
2389
- if (i.dispatch("lazyLoad").defaultPrevented)
2390
- return;
2391
- const {
2392
- preload: e
2393
- } = i.options, s = t === void 0 ? !0 : t >= 0;
2394
- let n;
2395
- for (n = 0; n <= e[1]; n++)
2396
- this.loadSlideByIndex(i.currIndex + (s ? n : -n));
2397
- for (n = 1; n <= e[0]; n++)
2398
- this.loadSlideByIndex(i.currIndex + (s ? -n : n));
2399
- }
2400
- /**
2401
- * @param {number} initialIndex
2402
- */
2403
- loadSlideByIndex(t) {
2404
- const i = this.pswp.getLoopedIndex(t);
2405
- let e = this.getContentByIndex(i);
2406
- e || (e = Nt(i, this.pswp), e && this.addToCache(e));
2407
- }
2408
- /**
2409
- * @param {Slide} slide
2410
- * @returns {Content}
2411
- */
2412
- getContentBySlide(t) {
2413
- let i = this.getContentByIndex(t.index);
2414
- return i || (i = this.pswp.createContentFromData(t.data, t.index), this.addToCache(i)), i.setSlide(t), i;
2415
- }
2416
- /**
2417
- * @param {Content} content
2418
- */
2419
- addToCache(t) {
2420
- if (this.removeByIndex(t.index), this._cachedItems.push(t), this._cachedItems.length > this.limit) {
2421
- const i = this._cachedItems.findIndex((e) => !e.isAttached && !e.hasSlide);
2422
- i !== -1 && this._cachedItems.splice(i, 1)[0].destroy();
2423
- }
2424
- }
2425
- /**
2426
- * Removes an image from cache, does not destroy() it, just removes.
2427
- *
2428
- * @param {number} index
2429
- */
2430
- removeByIndex(t) {
2431
- const i = this._cachedItems.findIndex((e) => e.index === t);
2432
- i !== -1 && this._cachedItems.splice(i, 1);
2433
- }
2434
- /**
2435
- * @param {number} index
2436
- * @returns {Content | undefined}
2437
- */
2438
- getContentByIndex(t) {
2439
- return this._cachedItems.find((i) => i.index === t);
2440
- }
2441
- destroy() {
2442
- this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
2443
- }
2444
- }
2445
- class Ht extends Mt {
2446
- /**
2447
- * Get total number of slides
2448
- *
2449
- * @returns {number}
2450
- */
2451
- getNumItems() {
2452
- var t;
2453
- let i = 0;
2454
- const e = (t = this.options) === null || t === void 0 ? void 0 : t.dataSource;
2455
- e && "length" in e ? i = e.length : e && "gallery" in e && (e.items || (e.items = this._getGalleryDOMElements(e.gallery)), e.items && (i = e.items.length));
2456
- const s = this.dispatch("numItems", {
2457
- dataSource: e,
2458
- numItems: i
2459
- });
2460
- return this.applyFilters("numItems", s.numItems, e);
2461
- }
2462
- /**
2463
- * @param {SlideData} slideData
2464
- * @param {number} index
2465
- * @returns {Content}
2466
- */
2467
- createContentFromData(t, i) {
2468
- return new Ft(t, this, i);
2469
- }
2470
- /**
2471
- * Get item data by index.
2472
- *
2473
- * "item data" should contain normalized information that PhotoSwipe needs to generate a slide.
2474
- * For example, it may contain properties like
2475
- * `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.
2476
- *
2477
- * @param {number} index
2478
- * @returns {SlideData}
2479
- */
2480
- getItemData(t) {
2481
- var i;
2482
- const e = (i = this.options) === null || i === void 0 ? void 0 : i.dataSource;
2483
- let s = {};
2484
- Array.isArray(e) ? s = e[t] : e && "gallery" in e && (e.items || (e.items = this._getGalleryDOMElements(e.gallery)), s = e.items[t]);
2485
- let n = s;
2486
- n instanceof Element && (n = this._domElementToItemData(n));
2487
- const o = this.dispatch("itemData", {
2488
- itemData: n || {},
2489
- index: t
2490
- });
2491
- return this.applyFilters("itemData", o.itemData, t);
2492
- }
2493
- /**
2494
- * Get array of gallery DOM elements,
2495
- * based on childSelector and gallery element.
2496
- *
2497
- * @param {HTMLElement} galleryElement
2498
- * @returns {HTMLElement[]}
2499
- */
2500
- _getGalleryDOMElements(t) {
2501
- var i, e;
2502
- return (i = this.options) !== null && i !== void 0 && i.children || (e = this.options) !== null && e !== void 0 && e.childSelector ? K(this.options.children, this.options.childSelector, t) || [] : [t];
2503
- }
2504
- /**
2505
- * Converts DOM element to item data object.
2506
- *
2507
- * @param {HTMLElement} element DOM element
2508
- * @returns {SlideData}
2509
- */
2510
- _domElementToItemData(t) {
2511
- const i = {
2512
- element: t
2513
- }, e = (
2514
- /** @type {HTMLAnchorElement} */
2515
- t.tagName === "A" ? t : t.querySelector("a")
2516
- );
2517
- if (e) {
2518
- i.src = e.dataset.pswpSrc || e.href, e.dataset.pswpSrcset && (i.srcset = e.dataset.pswpSrcset), i.width = e.dataset.pswpWidth ? parseInt(e.dataset.pswpWidth, 10) : 0, i.height = e.dataset.pswpHeight ? parseInt(e.dataset.pswpHeight, 10) : 0, i.w = i.width, i.h = i.height, e.dataset.pswpType && (i.type = e.dataset.pswpType);
2519
- const n = t.querySelector("img");
2520
- if (n) {
2521
- var s;
2522
- i.msrc = n.currentSrc || n.src, i.alt = (s = n.getAttribute("alt")) !== null && s !== void 0 ? s : "";
2523
- }
2524
- (e.dataset.pswpCropped || e.dataset.cropped) && (i.thumbCropped = !0);
2525
- }
2526
- return this.applyFilters("domItemData", i, t, e);
2527
- }
2528
- /**
2529
- * Lazy-load by slide data
2530
- *
2531
- * @param {SlideData} itemData Data about the slide
2532
- * @param {number} index
2533
- * @returns {Content} Image that is being decoded or false.
2534
- */
2535
- lazyLoadData(t, i) {
2536
- return W(t, this, i);
2537
- }
2538
- }
2539
- const P = 3e-3;
2540
- class Wt {
2541
- /**
2542
- * @param {PhotoSwipe} pswp
2543
- */
2544
- constructor(t) {
2545
- this.pswp = t, this.isClosed = !0, this.isOpen = !1, this.isClosing = !1, this.isOpening = !1, this._duration = void 0, this._useAnimation = !1, this._croppedZoom = !1, this._animateRootOpacity = !1, this._animateBgOpacity = !1, this._placeholder = void 0, this._opacityElement = void 0, this._cropContainer1 = void 0, this._cropContainer2 = void 0, this._thumbBounds = void 0, this._prepareOpen = this._prepareOpen.bind(this), t.on("firstZoomPan", this._prepareOpen);
2546
- }
2547
- open() {
2548
- this._prepareOpen(), this._start();
2549
- }
2550
- close() {
2551
- if (this.isClosed || this.isClosing || this.isOpening)
2552
- return;
2553
- const t = this.pswp.currSlide;
2554
- this.isOpen = !1, this.isOpening = !1, this.isClosing = !0, this._duration = this.pswp.options.hideAnimationDuration, t && t.currZoomLevel * t.width >= this.pswp.options.maxWidthToAnimate && (this._duration = 0), this._applyStartProps(), setTimeout(() => {
2555
- this._start();
2556
- }, this._croppedZoom ? 30 : 0);
2557
- }
2558
- /** @private */
2559
- _prepareOpen() {
2560
- if (this.pswp.off("firstZoomPan", this._prepareOpen), !this.isOpening) {
2561
- const t = this.pswp.currSlide;
2562
- this.isOpening = !0, this.isClosing = !1, this._duration = this.pswp.options.showAnimationDuration, t && t.zoomLevels.initial * t.width >= this.pswp.options.maxWidthToAnimate && (this._duration = 0), this._applyStartProps();
2563
- }
2564
- }
2565
- /** @private */
2566
- _applyStartProps() {
2567
- const {
2568
- pswp: t
2569
- } = this, i = this.pswp.currSlide, {
2570
- options: e
2571
- } = t;
2572
- if (e.showHideAnimationType === "fade" ? (e.showHideOpacity = !0, this._thumbBounds = void 0) : e.showHideAnimationType === "none" ? (e.showHideOpacity = !1, this._duration = 0, this._thumbBounds = void 0) : this.isOpening && t._initialThumbBounds ? this._thumbBounds = t._initialThumbBounds : this._thumbBounds = this.pswp.getThumbBounds(), this._placeholder = i == null ? void 0 : i.getPlaceholderElement(), t.animations.stopAll(), this._useAnimation = !!(this._duration && this._duration > 50), this._animateZoom = !!this._thumbBounds && (i == null ? void 0 : i.content.usePlaceholder()) && (!this.isClosing || !t.mainScroll.isShifted()), !this._animateZoom)
2573
- this._animateRootOpacity = !0, this.isOpening && i && (i.zoomAndPanToInitial(), i.applyCurrentZoomPan());
2574
- else {
2575
- var s;
2576
- this._animateRootOpacity = (s = e.showHideOpacity) !== null && s !== void 0 ? s : !1;
2577
- }
2578
- if (this._animateBgOpacity = !this._animateRootOpacity && this.pswp.options.bgOpacity > P, this._opacityElement = this._animateRootOpacity ? t.element : t.bg, !this._useAnimation) {
2579
- this._duration = 0, this._animateZoom = !1, this._animateBgOpacity = !1, this._animateRootOpacity = !0, this.isOpening && (t.element && (t.element.style.opacity = String(P)), t.applyBgOpacity(1));
2580
- return;
2581
- }
2582
- if (this._animateZoom && this._thumbBounds && this._thumbBounds.innerRect) {
2583
- var n;
2584
- this._croppedZoom = !0, this._cropContainer1 = this.pswp.container, this._cropContainer2 = (n = this.pswp.currSlide) === null || n === void 0 ? void 0 : n.holderElement, t.container && (t.container.style.overflow = "hidden", t.container.style.width = t.viewportSize.x + "px");
2585
- } else
2586
- this._croppedZoom = !1;
2587
- this.isOpening ? (this._animateRootOpacity ? (t.element && (t.element.style.opacity = String(P)), t.applyBgOpacity(1)) : (this._animateBgOpacity && t.bg && (t.bg.style.opacity = String(P)), t.element && (t.element.style.opacity = "1")), this._animateZoom && (this._setClosedStateZoomPan(), this._placeholder && (this._placeholder.style.willChange = "transform", this._placeholder.style.opacity = String(P)))) : this.isClosing && (t.mainScroll.itemHolders[0] && (t.mainScroll.itemHolders[0].el.style.display = "none"), t.mainScroll.itemHolders[2] && (t.mainScroll.itemHolders[2].el.style.display = "none"), this._croppedZoom && t.mainScroll.x !== 0 && (t.mainScroll.resetPosition(), t.mainScroll.resize()));
2588
- }
2589
- /** @private */
2590
- _start() {
2591
- this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
2592
- let i = !1, e = !0;
2593
- q(
2594
- /** @type {HTMLImageElement} */
2595
- this._placeholder
2596
- ).finally(() => {
2597
- i = !0, e || t(!0);
2598
- }), setTimeout(() => {
2599
- e = !1, i && t(!0);
2600
- }, 50), setTimeout(t, 250);
2601
- }).finally(() => this._initiate()) : this._initiate();
2602
- }
2603
- /** @private */
2604
- _initiate() {
2605
- var t, i;
2606
- (t = this.pswp.element) === null || t === void 0 || t.style.setProperty("--pswp-transition-duration", this._duration + "ms"), this.pswp.dispatch(this.isOpening ? "openingAnimationStart" : "closingAnimationStart"), this.pswp.dispatch(
2607
- /** @type {'initialZoomIn' | 'initialZoomOut'} */
2608
- "initialZoom" + (this.isOpening ? "In" : "Out")
2609
- ), (i = this.pswp.element) === null || i === void 0 || i.classList.toggle("pswp--ui-visible", this.isOpening), this.isOpening ? (this._placeholder && (this._placeholder.style.opacity = "1"), this._animateToOpenState()) : this.isClosing && this._animateToClosedState(), this._useAnimation || this._onAnimationComplete();
2610
- }
2611
- /** @private */
2612
- _onAnimationComplete() {
2613
- const {
2614
- pswp: t
2615
- } = this;
2616
- if (this.isOpen = this.isOpening, this.isClosed = this.isClosing, this.isOpening = !1, this.isClosing = !1, t.dispatch(this.isOpen ? "openingAnimationEnd" : "closingAnimationEnd"), t.dispatch(
2617
- /** @type {'initialZoomInEnd' | 'initialZoomOutEnd'} */
2618
- "initialZoom" + (this.isOpen ? "InEnd" : "OutEnd")
2619
- ), this.isClosed)
2620
- t.destroy();
2621
- else if (this.isOpen) {
2622
- var i;
2623
- this._animateZoom && t.container && (t.container.style.overflow = "visible", t.container.style.width = "100%"), (i = t.currSlide) === null || i === void 0 || i.applyCurrentZoomPan();
2624
- }
2625
- }
2626
- /** @private */
2627
- _animateToOpenState() {
2628
- const {
2629
- pswp: t
2630
- } = this;
2631
- this._animateZoom && (this._croppedZoom && this._cropContainer1 && this._cropContainer2 && (this._animateTo(this._cropContainer1, "transform", "translate3d(0,0,0)"), this._animateTo(this._cropContainer2, "transform", "none")), t.currSlide && (t.currSlide.zoomAndPanToInitial(), this._animateTo(t.currSlide.container, "transform", t.currSlide.getCurrentTransform()))), this._animateBgOpacity && t.bg && this._animateTo(t.bg, "opacity", String(t.options.bgOpacity)), this._animateRootOpacity && t.element && this._animateTo(t.element, "opacity", "1");
2632
- }
2633
- /** @private */
2634
- _animateToClosedState() {
2635
- const {
2636
- pswp: t
2637
- } = this;
2638
- this._animateZoom && this._setClosedStateZoomPan(!0), this._animateBgOpacity && t.bgOpacity > 0.01 && t.bg && this._animateTo(t.bg, "opacity", "0"), this._animateRootOpacity && t.element && this._animateTo(t.element, "opacity", "0");
2639
- }
2640
- /**
2641
- * @private
2642
- * @param {boolean} [animate]
2643
- */
2644
- _setClosedStateZoomPan(t) {
2645
- if (!this._thumbBounds) return;
2646
- const {
2647
- pswp: i
2648
- } = this, {
2649
- innerRect: e
2650
- } = this._thumbBounds, {
2651
- currSlide: s,
2652
- viewportSize: n
2653
- } = i;
2654
- if (this._croppedZoom && e && this._cropContainer1 && this._cropContainer2) {
2655
- const o = -n.x + (this._thumbBounds.x - e.x) + e.w, a = -n.y + (this._thumbBounds.y - e.y) + e.h, h = n.x - e.w, l = n.y - e.h;
2656
- t ? (this._animateTo(this._cropContainer1, "transform", I(o, a)), this._animateTo(this._cropContainer2, "transform", I(h, l))) : (y(this._cropContainer1, o, a), y(this._cropContainer2, h, l));
2657
- }
2658
- s && (p(s.pan, e || this._thumbBounds), s.currZoomLevel = this._thumbBounds.w / s.width, t ? this._animateTo(s.container, "transform", s.getCurrentTransform()) : s.applyCurrentZoomPan());
2659
- }
2660
- /**
2661
- * @private
2662
- * @param {HTMLElement} target
2663
- * @param {'transform' | 'opacity'} prop
2664
- * @param {string} propValue
2665
- */
2666
- _animateTo(t, i, e) {
2667
- if (!this._duration) {
2668
- t.style[i] = e;
2669
- return;
2670
- }
2671
- const {
2672
- animations: s
2673
- } = this.pswp, n = {
2674
- duration: this._duration,
2675
- easing: this.pswp.options.easing,
2676
- onComplete: () => {
2677
- s.activeAnimations.length || this._onAnimationComplete();
2678
- },
2679
- target: t
2680
- };
2681
- n[i] = e, s.startTransition(n);
2682
- }
2683
- }
2684
- const Vt = {
2685
- allowPanToNext: !0,
2686
- spacing: 0.1,
2687
- loop: !0,
2688
- pinchToClose: !0,
2689
- closeOnVerticalDrag: !0,
2690
- hideAnimationDuration: 333,
2691
- showAnimationDuration: 333,
2692
- zoomAnimationDuration: 333,
2693
- escKey: !0,
2694
- arrowKeys: !0,
2695
- trapFocus: !0,
2696
- returnFocus: !0,
2697
- maxWidthToAnimate: 4e3,
2698
- clickToCloseNonZoomable: !0,
2699
- imageClickAction: "zoom-or-close",
2700
- bgClickAction: "close",
2701
- tapAction: "toggle-controls",
2702
- doubleTapAction: "zoom",
2703
- indexIndicatorSep: " / ",
2704
- preloaderDelay: 2e3,
2705
- bgOpacity: 0.8,
2706
- index: 0,
2707
- errorMsg: "The image cannot be loaded",
2708
- preload: [1, 2],
2709
- easing: "cubic-bezier(.4,0,.22,1)"
2710
- };
2711
- class $t extends Ht {
2712
- /**
2713
- * @param {PhotoSwipeOptions} [options]
2714
- */
2715
- constructor(t) {
2716
- super(), this.options = this._prepareOptions(t || {}), this.offset = {
2717
- x: 0,
2718
- y: 0
2719
- }, this._prevViewportSize = {
2720
- x: 0,
2721
- y: 0
2722
- }, this.viewportSize = {
2723
- x: 0,
2724
- y: 0
2725
- }, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new X(), this.animations = new wt(), this.mainScroll = new dt(this), this.gestures = new lt(this), this.opener = new Wt(this), this.keyboard = new ut(this), this.contentLoader = new kt(this);
2726
- }
2727
- /** @returns {boolean} */
2728
- init() {
2729
- if (this.isOpen || this.isDestroying)
2730
- return !1;
2731
- this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
2732
- let t = "pswp--open";
2733
- return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new Pt(this), (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) && (this.currIndex = 0), this.gestures.supportsTouch || this.mouseDetected(), this.updateSize(), this.offset.y = window.pageYOffset, this._initialItemData = this.getItemData(this.currIndex), this.dispatch("gettingData", {
2734
- index: this.currIndex,
2735
- data: this._initialItemData,
2736
- slide: void 0
2737
- }), this._initialThumbBounds = this.getThumbBounds(), this.dispatch("initialLayout"), this.on("openingAnimationEnd", () => {
2738
- const {
2739
- itemHolders: i
2740
- } = this.mainScroll;
2741
- i[0] && (i[0].el.style.display = "block", this.setContent(i[0], this.currIndex - 1)), i[2] && (i[2].el.style.display = "block", this.setContent(i[2], this.currIndex + 1)), this.appendHeavy(), this.contentLoader.updateLazy(), this.events.add(window, "resize", this._handlePageResize.bind(this)), this.events.add(window, "scroll", this._updatePageScrollOffset.bind(this)), this.dispatch("bindEvents");
2742
- }), this.mainScroll.itemHolders[1] && this.setContent(this.mainScroll.itemHolders[1], this.currIndex), this.dispatch("change"), this.opener.open(), this.dispatch("afterInit"), !0;
2743
- }
2744
- /**
2745
- * Get looped slide index
2746
- * (for example, -1 will return the last slide)
2747
- *
2748
- * @param {number} index
2749
- * @returns {number}
2750
- */
2751
- getLoopedIndex(t) {
2752
- const i = this.getNumItems();
2753
- return this.options.loop && (t > i - 1 && (t -= i), t < 0 && (t += i)), b(t, 0, i - 1);
2754
- }
2755
- appendHeavy() {
2756
- this.mainScroll.itemHolders.forEach((t) => {
2757
- var i;
2758
- (i = t.slide) === null || i === void 0 || i.appendHeavy();
2759
- });
2760
- }
2761
- /**
2762
- * Change the slide
2763
- * @param {number} index New index
2764
- */
2765
- goTo(t) {
2766
- this.mainScroll.moveIndexBy(this.getLoopedIndex(t) - this.potentialIndex);
2767
- }
2768
- /**
2769
- * Go to the next slide.
2770
- */
2771
- next() {
2772
- this.goTo(this.potentialIndex + 1);
2773
- }
2774
- /**
2775
- * Go to the previous slide.
2776
- */
2777
- prev() {
2778
- this.goTo(this.potentialIndex - 1);
2779
- }
2780
- /**
2781
- * @see slide/slide.js zoomTo
2782
- *
2783
- * @param {Parameters<Slide['zoomTo']>} args
2784
- */
2785
- zoomTo(...t) {
2786
- var i;
2787
- (i = this.currSlide) === null || i === void 0 || i.zoomTo(...t);
2788
- }
2789
- /**
2790
- * @see slide/slide.js toggleZoom
2791
- */
2792
- toggleZoom() {
2793
- var t;
2794
- (t = this.currSlide) === null || t === void 0 || t.toggleZoom();
2795
- }
2796
- /**
2797
- * Close the gallery.
2798
- * After closing transition ends - destroy it
2799
- */
2800
- close() {
2801
- !this.opener.isOpen || this.isDestroying || (this.isDestroying = !0, this.dispatch("close"), this.events.removeAll(), this.opener.close());
2802
- }
2803
- /**
2804
- * Destroys the gallery:
2805
- * - instantly closes the gallery
2806
- * - unbinds events,
2807
- * - cleans intervals and timeouts
2808
- * - removes elements from DOM
2809
- */
2810
- destroy() {
2811
- var t;
2812
- if (!this.isDestroying) {
2813
- this.options.showHideAnimationType = "none", this.close();
2814
- return;
2815
- }
2816
- this.dispatch("destroy"), this._listeners = {}, this.scrollWrap && (this.scrollWrap.ontouchmove = null, this.scrollWrap.ontouchend = null), (t = this.element) === null || t === void 0 || t.remove(), this.mainScroll.itemHolders.forEach((i) => {
2817
- var e;
2818
- (e = i.slide) === null || e === void 0 || e.destroy();
2819
- }), this.contentLoader.destroy(), this.events.removeAll();
2820
- }
2821
- /**
2822
- * Refresh/reload content of a slide by its index
2823
- *
2824
- * @param {number} slideIndex
2825
- */
2826
- refreshSlideContent(t) {
2827
- this.contentLoader.removeByIndex(t), this.mainScroll.itemHolders.forEach((i, e) => {
2828
- var s, n;
2829
- let o = ((s = (n = this.currSlide) === null || n === void 0 ? void 0 : n.index) !== null && s !== void 0 ? s : 0) - 1 + e;
2830
- if (this.canLoop() && (o = this.getLoopedIndex(o)), o === t && (this.setContent(i, t, !0), e === 1)) {
2831
- var a;
2832
- this.currSlide = i.slide, (a = i.slide) === null || a === void 0 || a.setIsActive(!0);
2833
- }
2834
- }), this.dispatch("change");
2835
- }
2836
- /**
2837
- * Set slide content
2838
- *
2839
- * @param {ItemHolder} holder mainScroll.itemHolders array item
2840
- * @param {number} index Slide index
2841
- * @param {boolean} [force] If content should be set even if index wasn't changed
2842
- */
2843
- setContent(t, i, e) {
2844
- if (this.canLoop() && (i = this.getLoopedIndex(i)), t.slide) {
2845
- if (t.slide.index === i && !e)
2846
- return;
2847
- t.slide.destroy(), t.slide = void 0;
2848
- }
2849
- if (!this.canLoop() && (i < 0 || i >= this.getNumItems()))
2850
- return;
2851
- const s = this.getItemData(i);
2852
- t.slide = new j(s, i, this), i === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
2853
- }
2854
- /** @returns {Point} */
2855
- getViewportCenterPoint() {
2856
- return {
2857
- x: this.viewportSize.x / 2,
2858
- y: this.viewportSize.y / 2
2859
- };
2860
- }
2861
- /**
2862
- * Update size of all elements.
2863
- * Executed on init and on page resize.
2864
- *
2865
- * @param {boolean} [force] Update size even if size of viewport was not changed.
2866
- */
2867
- updateSize(t) {
2868
- if (this.isDestroying)
2869
- return;
2870
- const i = B(this.options, this);
2871
- !t && x(i, this._prevViewportSize) || (p(this._prevViewportSize, i), this.dispatch("beforeResize"), p(this.viewportSize, this._prevViewportSize), this._updatePageScrollOffset(), this.dispatch("viewportSize"), this.mainScroll.resize(this.opener.isOpen), !this.hasMouse && window.matchMedia("(any-hover: hover)").matches && this.mouseDetected(), this.dispatch("resize"));
2872
- }
2873
- /**
2874
- * @param {number} opacity
2875
- */
2876
- applyBgOpacity(t) {
2877
- this.bgOpacity = Math.max(t, 0), this.bg && (this.bg.style.opacity = String(this.bgOpacity * this.options.bgOpacity));
2878
- }
2879
- /**
2880
- * Whether mouse is detected
2881
- */
2882
- mouseDetected() {
2883
- if (!this.hasMouse) {
2884
- var t;
2885
- this.hasMouse = !0, (t = this.element) === null || t === void 0 || t.classList.add("pswp--has_mouse");
2886
- }
2887
- }
2888
- /**
2889
- * Page resize event handler
2890
- *
2891
- * @private
2892
- */
2893
- _handlePageResize() {
2894
- this.updateSize(), /iPhone|iPad|iPod/i.test(window.navigator.userAgent) && setTimeout(() => {
2895
- this.updateSize();
2896
- }, 500);
2897
- }
2898
- /**
2899
- * Page scroll offset is used
2900
- * to get correct coordinates
2901
- * relative to PhotoSwipe viewport.
2902
- *
2903
- * @private
2904
- */
2905
- _updatePageScrollOffset() {
2906
- this.setScrollOffset(0, window.pageYOffset);
2907
- }
2908
- /**
2909
- * @param {number} x
2910
- * @param {number} y
2911
- */
2912
- setScrollOffset(t, i) {
2913
- this.offset.x = t, this.offset.y = i, this.dispatch("updateScrollOffset");
2914
- }
2915
- /**
2916
- * Create main HTML structure of PhotoSwipe,
2917
- * and add it to DOM
2918
- *
2919
- * @private
2920
- */
2921
- _createMainStructure() {
2922
- this.element = f("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = f("pswp__bg", "div", this.element), this.scrollWrap = f("pswp__scroll-wrap", "section", this.element), this.container = f("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new zt(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
2923
- }
2924
- /**
2925
- * Get position and dimensions of small thumbnail
2926
- * {x:,y:,w:}
2927
- *
2928
- * Height is optional (calculated based on the large image)
2929
- *
2930
- * @returns {Bounds | undefined}
2931
- */
2932
- getThumbBounds() {
2933
- return Zt(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
2934
- }
2935
- /**
2936
- * If the PhotoSwipe can have continuous loop
2937
- * @returns Boolean
2938
- */
2939
- canLoop() {
2940
- return this.options.loop && this.getNumItems() > 2;
2941
- }
2942
- /**
2943
- * @private
2944
- * @param {PhotoSwipeOptions} options
2945
- * @returns {PreparedPhotoSwipeOptions}
2946
- */
2947
- _prepareOptions(t) {
2948
- return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
2949
- ...Vt,
2950
- ...t
2951
- };
2952
- }
2953
- }
2954
- export {
2955
- $t as default
2956
- };