lightgallery 2.9.0 → 3.0.0-beta.3

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 (619) hide show
  1. package/LICENSE +690 -0
  2. package/README.md +31 -21
  3. package/dist/README.md +229 -0
  4. package/{css → dist/css}/lg-autoplay.css +7 -4
  5. package/{css → dist/css}/lg-autoplay.css.map +1 -1
  6. package/{css → dist/css}/lg-comments.css +0 -6
  7. package/{css → dist/css}/lg-comments.css.map +1 -1
  8. package/dist/css/lg-fullscreen.css +11 -0
  9. package/dist/css/lg-fullscreen.css.map +1 -0
  10. package/dist/css/lg-justified.css +37 -0
  11. package/dist/css/lg-justified.css.map +1 -0
  12. package/{css → dist/css}/lg-pager.css.map +1 -1
  13. package/{css → dist/css}/lg-rotate.css +0 -16
  14. package/{css → dist/css}/lg-rotate.css.map +1 -1
  15. package/dist/css/lg-rtl.css +94 -0
  16. package/dist/css/lg-rtl.css.map +1 -0
  17. package/{css → dist/css}/lg-share.css +4 -32
  18. package/dist/css/lg-share.css.map +1 -0
  19. package/{css → dist/css}/lg-thumbnail.css +7 -3
  20. package/dist/css/lg-thumbnail.css.map +1 -0
  21. package/{css → dist/css}/lg-transitions.css +10 -0
  22. package/dist/css/lg-transitions.css.map +1 -0
  23. package/{css → dist/css}/lg-zoom.css +20 -9
  24. package/dist/css/lg-zoom.css.map +1 -0
  25. package/{css → dist/css}/lightgallery-bundle.css +150 -118
  26. package/dist/css/lightgallery-bundle.css.map +1 -0
  27. package/dist/css/lightgallery-bundle.min.css +1 -0
  28. package/{css → dist/css}/lightgallery-core.css +49 -7
  29. package/dist/css/lightgallery-core.css.map +1 -0
  30. package/{css → dist/css}/lightgallery.css +105 -44
  31. package/dist/css/lightgallery.css.map +1 -0
  32. package/dist/lightgallery.es5.js +3797 -0
  33. package/dist/lightgallery.es5.js.map +1 -0
  34. package/dist/lightgallery.min.js +1 -0
  35. package/dist/lightgallery.umd.js +3800 -0
  36. package/dist/lightgallery.umd.js.map +1 -0
  37. package/dist/package.json +33 -0
  38. package/dist/plugins/autoplay/lg-autoplay.es5.js +193 -0
  39. package/dist/plugins/autoplay/lg-autoplay.es5.js.map +1 -0
  40. package/dist/plugins/autoplay/lg-autoplay.min.js +1 -0
  41. package/dist/plugins/autoplay/lg-autoplay.umd.js +196 -0
  42. package/dist/plugins/autoplay/lg-autoplay.umd.js.map +1 -0
  43. package/dist/plugins/autoplay/package.json +7 -0
  44. package/dist/plugins/comment/lg-comment.es5.js +136 -0
  45. package/dist/plugins/comment/lg-comment.es5.js.map +1 -0
  46. package/dist/plugins/comment/lg-comment.min.js +1 -0
  47. package/dist/plugins/comment/lg-comment.umd.js +139 -0
  48. package/dist/plugins/comment/lg-comment.umd.js.map +1 -0
  49. package/dist/plugins/comment/package.json +7 -0
  50. package/dist/plugins/fullscreen/lg-fullscreen.es5.js +114 -0
  51. package/dist/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -0
  52. package/dist/plugins/fullscreen/lg-fullscreen.min.js +1 -0
  53. package/dist/plugins/fullscreen/lg-fullscreen.umd.js +117 -0
  54. package/dist/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -0
  55. package/dist/plugins/fullscreen/package.json +7 -0
  56. package/dist/plugins/hash/lg-hash.es5.js +207 -0
  57. package/dist/plugins/hash/lg-hash.es5.js.map +1 -0
  58. package/dist/plugins/hash/lg-hash.min.js +1 -0
  59. package/dist/plugins/hash/lg-hash.umd.js +210 -0
  60. package/dist/plugins/hash/lg-hash.umd.js.map +1 -0
  61. package/dist/plugins/hash/package.json +7 -0
  62. package/dist/plugins/justified/lg-justified.es5.js +415 -0
  63. package/dist/plugins/justified/lg-justified.es5.js.map +1 -0
  64. package/dist/plugins/justified/lg-justified.min.js +1 -0
  65. package/dist/plugins/justified/lg-justified.umd.js +418 -0
  66. package/dist/plugins/justified/lg-justified.umd.js.map +1 -0
  67. package/dist/plugins/justified/package.json +7 -0
  68. package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js +95 -0
  69. package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -0
  70. package/dist/plugins/mediumZoom/lg-medium-zoom.min.js +1 -0
  71. package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js +98 -0
  72. package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -0
  73. package/dist/plugins/mediumZoom/package.json +7 -0
  74. package/dist/plugins/originCrop/lg-origin-crop.es5.js +622 -0
  75. package/dist/plugins/originCrop/lg-origin-crop.es5.js.map +1 -0
  76. package/dist/plugins/originCrop/lg-origin-crop.min.js +1 -0
  77. package/dist/plugins/originCrop/lg-origin-crop.umd.js +625 -0
  78. package/dist/plugins/originCrop/lg-origin-crop.umd.js.map +1 -0
  79. package/dist/plugins/pager/lg-pager.es5.js +96 -0
  80. package/dist/plugins/pager/lg-pager.es5.js.map +1 -0
  81. package/dist/plugins/pager/lg-pager.min.js +1 -0
  82. package/dist/plugins/pager/lg-pager.umd.js +99 -0
  83. package/dist/plugins/pager/lg-pager.umd.js.map +1 -0
  84. package/dist/plugins/pager/package.json +7 -0
  85. package/dist/plugins/relativeCaption/lg-relative-caption.es5.js +98 -0
  86. package/dist/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -0
  87. package/dist/plugins/relativeCaption/lg-relative-caption.min.js +1 -0
  88. package/dist/plugins/relativeCaption/lg-relative-caption.umd.js +101 -0
  89. package/dist/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -0
  90. package/dist/plugins/relativeCaption/package.json +7 -0
  91. package/dist/plugins/rotate/lg-rotate.es5.js +226 -0
  92. package/dist/plugins/rotate/lg-rotate.es5.js.map +1 -0
  93. package/dist/plugins/rotate/lg-rotate.min.js +1 -0
  94. package/dist/plugins/rotate/lg-rotate.umd.js +229 -0
  95. package/dist/plugins/rotate/lg-rotate.umd.js.map +1 -0
  96. package/dist/plugins/rotate/package.json +7 -0
  97. package/dist/plugins/share/lg-share.es5.js +309 -0
  98. package/dist/plugins/share/lg-share.es5.js.map +1 -0
  99. package/dist/plugins/share/lg-share.min.js +1 -0
  100. package/dist/plugins/share/lg-share.umd.js +312 -0
  101. package/dist/plugins/share/lg-share.umd.js.map +1 -0
  102. package/dist/plugins/share/package.json +7 -0
  103. package/dist/plugins/thumbnail/lg-thumbnail.es5.js +792 -0
  104. package/dist/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -0
  105. package/dist/plugins/thumbnail/lg-thumbnail.min.js +1 -0
  106. package/dist/plugins/thumbnail/lg-thumbnail.umd.js +795 -0
  107. package/dist/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -0
  108. package/dist/plugins/thumbnail/package.json +7 -0
  109. package/dist/plugins/video/lg-video.es5.js +518 -0
  110. package/dist/plugins/video/lg-video.es5.js.map +1 -0
  111. package/dist/plugins/video/lg-video.min.js +1 -0
  112. package/dist/plugins/video/lg-video.umd.js +521 -0
  113. package/dist/plugins/video/lg-video.umd.js.map +1 -0
  114. package/dist/plugins/video/package.json +7 -0
  115. package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +72 -0
  116. package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
  117. package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +1 -0
  118. package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +75 -0
  119. package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
  120. package/dist/plugins/vimeoThumbnail/package.json +7 -0
  121. package/dist/plugins/zoom/lg-zoom.es5.js +1412 -0
  122. package/dist/plugins/zoom/lg-zoom.es5.js.map +1 -0
  123. package/dist/plugins/zoom/lg-zoom.min.js +1 -0
  124. package/dist/plugins/zoom/lg-zoom.umd.js +1415 -0
  125. package/dist/plugins/zoom/lg-zoom.umd.js.map +1 -0
  126. package/dist/plugins/zoom/package.json +7 -0
  127. package/{scss → dist/scss}/_lg-theme-default.scss +68 -18
  128. package/{scss → dist/scss}/_lg-variables.scss +0 -1
  129. package/{scss → dist/scss}/lg-autoplay.scss +10 -4
  130. package/{scss → dist/scss}/lg-comments.scss +0 -8
  131. package/dist/scss/lg-fullscreen.scss +15 -0
  132. package/dist/scss/lg-justified.scss +63 -0
  133. package/{scss → dist/scss}/lg-rotate.scss +0 -24
  134. package/dist/scss/lg-rtl.scss +145 -0
  135. package/{scss → dist/scss}/lg-share.scss +6 -33
  136. package/{scss → dist/scss}/lg-thumbnail.scss +16 -5
  137. package/{scss → dist/scss}/lg-zoom.scss +46 -9
  138. package/{scss → dist/scss}/lightgallery-bundle.scss +0 -1
  139. package/{scss → dist/scss}/lightgallery-core.scss +73 -6
  140. package/{scss → dist/scss}/lightgallery.scss +0 -1
  141. package/{scss → dist/scss}/transitions/_lg-scale-up.scss +6 -0
  142. package/{scss → dist/scss}/transitions/_lg-slide-circular-vertical.scss +6 -0
  143. package/{scss → dist/scss}/transitions/_lg-slide-circular.scss +6 -0
  144. package/{scss → dist/scss}/transitions/_lg-soft-zoom.scss +6 -0
  145. package/{scss → dist/scss}/transitions/_lg-zoom-in-big.scss +6 -0
  146. package/{scss → dist/scss}/transitions/_lg-zoom-in-out.scss +6 -0
  147. package/{scss → dist/scss}/transitions/_lg-zoom-in.scss +6 -0
  148. package/{scss → dist/scss}/transitions/_lg-zoom-out-big.scss +6 -0
  149. package/{scss → dist/scss}/transitions/_lg-zoom-out-in.scss +6 -0
  150. package/{scss → dist/scss}/transitions/_lg-zoom-out.scss +6 -0
  151. package/dist/types/headless/announce.d.ts +22 -0
  152. package/dist/types/headless/emitter.d.ts +14 -0
  153. package/dist/types/headless/gestures.d.ts +128 -0
  154. package/dist/types/headless/hash-driver.d.ts +77 -0
  155. package/dist/types/headless/icons.d.ts +56 -0
  156. package/dist/types/headless/index.d.ts +34 -0
  157. package/dist/types/headless/items.d.ts +92 -0
  158. package/dist/types/headless/justified-layout.d.ts +71 -0
  159. package/dist/types/headless/license.d.ts +35 -0
  160. package/dist/types/headless/origin-crop.d.ts +135 -0
  161. package/dist/types/headless/origin.d.ts +65 -0
  162. package/dist/types/headless/plugin-slices.d.ts +64 -0
  163. package/dist/types/headless/preload.d.ts +36 -0
  164. package/dist/types/headless/responsive.d.ts +90 -0
  165. package/dist/types/headless/settings.d.ts +268 -0
  166. package/dist/types/headless/share-urls.d.ts +60 -0
  167. package/dist/types/headless/spring.d.ts +42 -0
  168. package/dist/types/headless/state.d.ts +63 -0
  169. package/dist/types/headless/thumb-math.d.ts +85 -0
  170. package/dist/types/headless/toolbar-overflow.d.ts +61 -0
  171. package/dist/types/headless/transition.d.ts +33 -0
  172. package/dist/types/headless/velocity.d.ts +31 -0
  173. package/dist/types/headless/video-urls.d.ts +64 -0
  174. package/dist/types/headless/zoom-math.d.ts +89 -0
  175. package/{index.d.ts → dist/types/index.d.ts} +9 -4
  176. package/{lg-events.d.ts → dist/types/lg-events.d.ts} +300 -300
  177. package/dist/types/lg-icons.d.ts +27 -0
  178. package/{lg-plugin.d.ts → dist/types/lg-plugin.d.ts} +7 -7
  179. package/{lg-settings.d.ts → dist/types/lg-settings.d.ts} +549 -425
  180. package/dist/types/lg-spring-runner.d.ts +14 -0
  181. package/dist/types/lg-toolbar-overflow.d.ts +36 -0
  182. package/{lg-utils.d.ts → dist/types/lg-utils.d.ts} +236 -228
  183. package/{lgQuery.d.ts → dist/types/lgQuery.d.ts} +56 -56
  184. package/{lightgallery.d.ts → dist/types/lightgallery.d.ts} +384 -305
  185. package/{plugins → dist/types/plugins}/autoplay/lg-autoplay-settings.d.ts +41 -38
  186. package/{plugins → dist/types/plugins}/autoplay/lg-autoplay.d.ts +22 -22
  187. package/{plugins → dist/types/plugins}/comment/lg-comment-settings.d.ts +36 -33
  188. package/{plugins → dist/types/plugins}/comment/lg-comment.d.ts +25 -25
  189. package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen-settings.d.ts +17 -14
  190. package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen.d.ts +16 -16
  191. package/dist/types/plugins/hash/lg-hash-settings.d.ts +28 -0
  192. package/{plugins → dist/types/plugins}/hash/lg-hash.d.ts +25 -23
  193. package/dist/types/plugins/justified/lg-justified-settings.d.ts +42 -0
  194. package/dist/types/plugins/justified/lg-justified.d.ts +55 -0
  195. package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom-settings.d.ts +16 -16
  196. package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom.d.ts +12 -12
  197. package/dist/types/plugins/originCrop/lg-origin-crop-settings.d.ts +12 -0
  198. package/dist/types/plugins/originCrop/lg-origin-crop.d.ts +79 -0
  199. package/{plugins → dist/types/plugins}/pager/lg-pager-settings.d.ts +7 -7
  200. package/{plugins → dist/types/plugins}/pager/lg-pager.d.ts +13 -13
  201. package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption-settings.d.ts +7 -7
  202. package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption.d.ts +14 -14
  203. package/{plugins → dist/types/plugins}/rotate/lg-rotate-settings.d.ts +47 -45
  204. package/{plugins → dist/types/plugins}/rotate/lg-rotate.d.ts +25 -24
  205. package/{plugins → dist/types/plugins}/share/lg-fb-share-utils.d.ts +2 -2
  206. package/{plugins → dist/types/plugins}/share/lg-pinterest-share-utils.d.ts +2 -2
  207. package/{plugins → dist/types/plugins}/share/lg-share-settings.d.ts +71 -56
  208. package/dist/types/plugins/share/lg-share.d.ts +33 -0
  209. package/dist/types/plugins/share/lg-twitter-share-utils.d.ts +4 -0
  210. package/{plugins → dist/types/plugins}/share/types.d.ts +6 -6
  211. package/{plugins → dist/types/plugins}/thumbnail/lg-thumbnail-settings.d.ts +85 -70
  212. package/dist/types/plugins/thumbnail/lg-thumbnail.d.ts +88 -0
  213. package/{plugins → dist/types/plugins}/video/lg-video-settings.d.ts +94 -71
  214. package/{plugins → dist/types/plugins}/video/lg-video.d.ts +116 -104
  215. package/{plugins → dist/types/plugins}/video/types.d.ts +8 -8
  216. package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -11
  217. package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -14
  218. package/{plugins → dist/types/plugins}/zoom/lg-zoom-settings.d.ts +54 -51
  219. package/{plugins → dist/types/plugins}/zoom/lg-zoom.d.ts +145 -108
  220. package/{types.d.ts → dist/types/types.d.ts} +40 -40
  221. package/package.json +222 -8
  222. package/angular/10/README.md +0 -24
  223. package/angular/10/bundles/lightgallery-angular-10.umd.js +0 -289
  224. package/angular/10/bundles/lightgallery-angular-10.umd.js.map +0 -1
  225. package/angular/10/bundles/lightgallery-angular-10.umd.min.js +0 -2
  226. package/angular/10/bundles/lightgallery-angular-10.umd.min.js.map +0 -1
  227. package/angular/10/esm2015/lib/lightgallery-angular.component.js +0 -225
  228. package/angular/10/esm2015/lib/lightgallery-angular.module.js +0 -17
  229. package/angular/10/esm2015/lib/lightgallery-angular.service.js +0 -14
  230. package/angular/10/esm2015/lightgallery-angular-10.js +0 -5
  231. package/angular/10/esm2015/public-api.js +0 -7
  232. package/angular/10/fesm2015/lightgallery-angular-10.js +0 -261
  233. package/angular/10/fesm2015/lightgallery-angular-10.js.map +0 -1
  234. package/angular/10/lib/lightgallery-angular.component.d.ts +0 -39
  235. package/angular/10/lib/lightgallery-angular.component.d.ts.map +0 -1
  236. package/angular/10/lib/lightgallery-angular.module.d.ts +0 -7
  237. package/angular/10/lib/lightgallery-angular.module.d.ts.map +0 -1
  238. package/angular/10/lib/lightgallery-angular.service.d.ts +0 -7
  239. package/angular/10/lib/lightgallery-angular.service.d.ts.map +0 -1
  240. package/angular/10/lightgallery-angular-10.d.ts +0 -6
  241. package/angular/10/lightgallery-angular-10.d.ts.map +0 -1
  242. package/angular/10/package.json +0 -21
  243. package/angular/10/public-api.d.ts +0 -4
  244. package/angular/10/public-api.d.ts.map +0 -1
  245. package/angular/11/README.md +0 -24
  246. package/angular/11/bundles/lightgallery-angular-11.umd.js +0 -290
  247. package/angular/11/bundles/lightgallery-angular-11.umd.js.map +0 -1
  248. package/angular/11/bundles/lightgallery-angular-11.umd.min.js +0 -2
  249. package/angular/11/bundles/lightgallery-angular-11.umd.min.js.map +0 -1
  250. package/angular/11/esm2015/lib/lightgallery-angular.component.js +0 -225
  251. package/angular/11/esm2015/lib/lightgallery-angular.module.js +0 -18
  252. package/angular/11/esm2015/lib/lightgallery-angular.service.js +0 -14
  253. package/angular/11/esm2015/lightgallery-angular-11.js +0 -5
  254. package/angular/11/esm2015/public-api.js +0 -7
  255. package/angular/11/fesm2015/lightgallery-angular-11.js +0 -262
  256. package/angular/11/fesm2015/lightgallery-angular-11.js.map +0 -1
  257. package/angular/11/lib/lightgallery-angular.component.d.ts +0 -39
  258. package/angular/11/lib/lightgallery-angular.component.d.ts.map +0 -1
  259. package/angular/11/lib/lightgallery-angular.module.d.ts +0 -8
  260. package/angular/11/lib/lightgallery-angular.module.d.ts.map +0 -1
  261. package/angular/11/lib/lightgallery-angular.service.d.ts +0 -7
  262. package/angular/11/lib/lightgallery-angular.service.d.ts.map +0 -1
  263. package/angular/11/lightgallery-angular-11.d.ts +0 -6
  264. package/angular/11/lightgallery-angular-11.d.ts.map +0 -1
  265. package/angular/11/package.json +0 -21
  266. package/angular/11/public-api.d.ts +0 -4
  267. package/angular/11/public-api.d.ts.map +0 -1
  268. package/angular/12/README.md +0 -24
  269. package/angular/12/bundles/lightgallery-angular-12.umd.js +0 -296
  270. package/angular/12/bundles/lightgallery-angular-12.umd.js.map +0 -1
  271. package/angular/12/esm2015/lib/lightgallery-angular.component.js +0 -221
  272. package/angular/12/esm2015/lib/lightgallery-angular.module.js +0 -17
  273. package/angular/12/esm2015/lib/lightgallery-angular.service.js +0 -14
  274. package/angular/12/esm2015/lightgallery-angular-12.js +0 -5
  275. package/angular/12/esm2015/public-api.js +0 -7
  276. package/angular/12/fesm2015/lightgallery-angular-12.js +0 -258
  277. package/angular/12/fesm2015/lightgallery-angular-12.js.map +0 -1
  278. package/angular/12/lib/lightgallery-angular.component.d.ts +0 -38
  279. package/angular/12/lib/lightgallery-angular.module.d.ts +0 -7
  280. package/angular/12/lib/lightgallery-angular.service.d.ts +0 -6
  281. package/angular/12/lightgallery-angular-12.d.ts +0 -5
  282. package/angular/12/package.json +0 -18
  283. package/angular/12/public-api.d.ts +0 -3
  284. package/angular/13/README.md +0 -24
  285. package/angular/13/esm2020/lib/lightgallery-angular.component.mjs +0 -221
  286. package/angular/13/esm2020/lib/lightgallery-angular.module.mjs +0 -17
  287. package/angular/13/esm2020/lib/lightgallery-angular.service.mjs +0 -14
  288. package/angular/13/esm2020/lightgallery-angular-13.mjs +0 -5
  289. package/angular/13/esm2020/public-api.mjs +0 -7
  290. package/angular/13/fesm2015/lightgallery-angular-13.mjs +0 -258
  291. package/angular/13/fesm2015/lightgallery-angular-13.mjs.map +0 -1
  292. package/angular/13/fesm2020/lightgallery-angular-13.mjs +0 -258
  293. package/angular/13/fesm2020/lightgallery-angular-13.mjs.map +0 -1
  294. package/angular/13/lib/lightgallery-angular.component.d.ts +0 -38
  295. package/angular/13/lib/lightgallery-angular.module.d.ts +0 -7
  296. package/angular/13/lib/lightgallery-angular.service.d.ts +0 -6
  297. package/angular/13/lightgallery-angular-13.d.ts +0 -5
  298. package/angular/13/package.json +0 -31
  299. package/angular/13/public-api.d.ts +0 -3
  300. package/angular/14/README.md +0 -24
  301. package/angular/14/esm2020/lib/lightgallery-angular.component.mjs +0 -217
  302. package/angular/14/esm2020/lib/lightgallery-angular.module.mjs +0 -17
  303. package/angular/14/esm2020/lib/lightgallery-angular.service.mjs +0 -14
  304. package/angular/14/esm2020/lightgallery-angular-14.mjs +0 -5
  305. package/angular/14/esm2020/public-api.mjs +0 -7
  306. package/angular/14/fesm2015/lightgallery-angular-14.mjs +0 -254
  307. package/angular/14/fesm2015/lightgallery-angular-14.mjs.map +0 -1
  308. package/angular/14/fesm2020/lightgallery-angular-14.mjs +0 -254
  309. package/angular/14/fesm2020/lightgallery-angular-14.mjs.map +0 -1
  310. package/angular/14/index.d.ts +0 -5
  311. package/angular/14/lib/lightgallery-angular.component.d.ts +0 -38
  312. package/angular/14/lib/lightgallery-angular.module.d.ts +0 -7
  313. package/angular/14/lib/lightgallery-angular.service.d.ts +0 -6
  314. package/angular/14/package.json +0 -31
  315. package/angular/14/public-api.d.ts +0 -3
  316. package/angular/15/README.md +0 -24
  317. package/angular/15/esm2022/lib/lightgallery-angular.component.mjs +0 -218
  318. package/angular/15/esm2022/lib/lightgallery-angular.module.mjs +0 -18
  319. package/angular/15/esm2022/lib/lightgallery-angular.service.mjs +0 -15
  320. package/angular/15/esm2022/lightgallery-angular-15.mjs +0 -5
  321. package/angular/15/esm2022/public-api.mjs +0 -7
  322. package/angular/15/fesm2022/lightgallery-angular-15.mjs +0 -254
  323. package/angular/15/fesm2022/lightgallery-angular-15.mjs.map +0 -1
  324. package/angular/15/index.d.ts +0 -5
  325. package/angular/15/lib/lightgallery-angular.component.d.ts +0 -38
  326. package/angular/15/lib/lightgallery-angular.module.d.ts +0 -7
  327. package/angular/15/lib/lightgallery-angular.service.d.ts +0 -6
  328. package/angular/15/package.json +0 -25
  329. package/angular/15/public-api.d.ts +0 -3
  330. package/angular/16/README.md +0 -24
  331. package/angular/16/esm2022/lib/lightgallery-angular.component.mjs +0 -218
  332. package/angular/16/esm2022/lib/lightgallery-angular.module.mjs +0 -18
  333. package/angular/16/esm2022/lib/lightgallery-angular.service.mjs +0 -15
  334. package/angular/16/esm2022/lightgallery-angular-16.mjs +0 -5
  335. package/angular/16/esm2022/public-api.mjs +0 -7
  336. package/angular/16/fesm2022/lightgallery-angular-16.mjs +0 -254
  337. package/angular/16/fesm2022/lightgallery-angular-16.mjs.map +0 -1
  338. package/angular/16/index.d.ts +0 -5
  339. package/angular/16/lib/lightgallery-angular.component.d.ts +0 -38
  340. package/angular/16/lib/lightgallery-angular.module.d.ts +0 -7
  341. package/angular/16/lib/lightgallery-angular.service.d.ts +0 -6
  342. package/angular/16/package.json +0 -25
  343. package/angular/16/public-api.d.ts +0 -3
  344. package/angular/9/README.md +0 -24
  345. package/angular/9/bundles/lightgallery-angular-9.umd.js +0 -271
  346. package/angular/9/bundles/lightgallery-angular-9.umd.js.map +0 -1
  347. package/angular/9/bundles/lightgallery-angular-9.umd.min.js +0 -2
  348. package/angular/9/bundles/lightgallery-angular-9.umd.min.js.map +0 -1
  349. package/angular/9/esm2015/lib/lightgallery-angular.component.js +0 -225
  350. package/angular/9/esm2015/lib/lightgallery-angular.module.js +0 -17
  351. package/angular/9/esm2015/lib/lightgallery-angular.service.js +0 -14
  352. package/angular/9/esm2015/lightgallery-angular-9.js +0 -5
  353. package/angular/9/esm2015/public-api.js +0 -7
  354. package/angular/9/esm5/lib/lightgallery-angular.component.js +0 -228
  355. package/angular/9/esm5/lib/lightgallery-angular.module.js +0 -21
  356. package/angular/9/esm5/lib/lightgallery-angular.service.js +0 -17
  357. package/angular/9/esm5/lightgallery-angular-9.js +0 -5
  358. package/angular/9/esm5/public-api.js +0 -7
  359. package/angular/9/fesm2015/lightgallery-angular-9.js +0 -261
  360. package/angular/9/fesm2015/lightgallery-angular-9.js.map +0 -1
  361. package/angular/9/fesm5/lightgallery-angular-9.js +0 -268
  362. package/angular/9/fesm5/lightgallery-angular-9.js.map +0 -1
  363. package/angular/9/lib/lightgallery-angular.component.d.ts +0 -38
  364. package/angular/9/lib/lightgallery-angular.module.d.ts +0 -6
  365. package/angular/9/lib/lightgallery-angular.service.d.ts +0 -6
  366. package/angular/9/lightgallery-angular-9.d.ts +0 -5
  367. package/angular/9/package.json +0 -23
  368. package/angular/9/public-api.d.ts +0 -3
  369. package/angular/README.md +0 -24
  370. package/angular/esm2022/lib/lightgallery-angular.component.mjs +0 -218
  371. package/angular/esm2022/lib/lightgallery-angular.module.mjs +0 -18
  372. package/angular/esm2022/lib/lightgallery-angular.service.mjs +0 -15
  373. package/angular/esm2022/lightgallery-angular.mjs +0 -5
  374. package/angular/esm2022/public-api.mjs +0 -7
  375. package/angular/fesm2022/lightgallery-angular.mjs +0 -254
  376. package/angular/fesm2022/lightgallery-angular.mjs.map +0 -1
  377. package/angular/index.d.ts +0 -5
  378. package/angular/lib/lightgallery-angular.component.d.ts +0 -38
  379. package/angular/lib/lightgallery-angular.module.d.ts +0 -7
  380. package/angular/lib/lightgallery-angular.service.d.ts +0 -6
  381. package/angular/package.json +0 -25
  382. package/angular/public-api.d.ts +0 -3
  383. package/css/lg-fullscreen.css +0 -8
  384. package/css/lg-fullscreen.css.map +0 -1
  385. package/css/lg-share.css.map +0 -1
  386. package/css/lg-thumbnail.css.map +0 -1
  387. package/css/lg-transitions.css.map +0 -1
  388. package/css/lg-zoom.css.map +0 -1
  389. package/css/lightgallery-bundle.css.map +0 -1
  390. package/css/lightgallery-bundle.min.css +0 -1
  391. package/css/lightgallery-core.css.map +0 -1
  392. package/css/lightgallery.css.map +0 -1
  393. package/fonts/lg.svg +0 -54
  394. package/fonts/lg.ttf +0 -0
  395. package/fonts/lg.woff +0 -0
  396. package/fonts/lg.woff2 +0 -0
  397. package/lib/index.js +0 -8
  398. package/lib/index.js.map +0 -1
  399. package/lib/lg-events.js +0 -37
  400. package/lib/lg-events.js.map +0 -1
  401. package/lib/lg-plugin.js +0 -13
  402. package/lib/lg-plugin.js.map +0 -1
  403. package/lib/lg-settings.js +0 -83
  404. package/lib/lg-settings.js.map +0 -1
  405. package/lib/lg-utils.js +0 -328
  406. package/lib/lg-utils.js.map +0 -1
  407. package/lib/lgQuery.js +0 -385
  408. package/lib/lgQuery.js.map +0 -1
  409. package/lib/lightgallery.js +0 -1949
  410. package/lib/lightgallery.js.map +0 -1
  411. package/lib/plugins/autoplay/lg-autoplay-settings.js +0 -16
  412. package/lib/plugins/autoplay/lg-autoplay-settings.js.map +0 -1
  413. package/lib/plugins/autoplay/lg-autoplay.js +0 -184
  414. package/lib/plugins/autoplay/lg-autoplay.js.map +0 -1
  415. package/lib/plugins/comment/lg-comment-settings.js +0 -17
  416. package/lib/plugins/comment/lg-comment-settings.js.map +0 -1
  417. package/lib/plugins/comment/lg-comment.js +0 -140
  418. package/lib/plugins/comment/lg-comment.js.map +0 -1
  419. package/lib/plugins/fullscreen/lg-fullscreen-settings.js +0 -10
  420. package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +0 -1
  421. package/lib/plugins/fullscreen/lg-fullscreen.js +0 -108
  422. package/lib/plugins/fullscreen/lg-fullscreen.js.map +0 -1
  423. package/lib/plugins/hash/lg-hash-settings.js +0 -9
  424. package/lib/plugins/hash/lg-hash-settings.js.map +0 -1
  425. package/lib/plugins/hash/lg-hash.js +0 -139
  426. package/lib/plugins/hash/lg-hash.js.map +0 -1
  427. package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js +0 -9
  428. package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js.map +0 -1
  429. package/lib/plugins/mediumZoom/lg-medium-zoom.js +0 -73
  430. package/lib/plugins/mediumZoom/lg-medium-zoom.js.map +0 -1
  431. package/lib/plugins/pager/lg-pager-settings.js +0 -7
  432. package/lib/plugins/pager/lg-pager-settings.js.map +0 -1
  433. package/lib/plugins/pager/lg-pager.js +0 -82
  434. package/lib/plugins/pager/lg-pager.js.map +0 -1
  435. package/lib/plugins/relativeCaption/lg-relative-caption-settings.js +0 -7
  436. package/lib/plugins/relativeCaption/lg-relative-caption-settings.js.map +0 -1
  437. package/lib/plugins/relativeCaption/lg-relative-caption.js +0 -97
  438. package/lib/plugins/relativeCaption/lg-relative-caption.js.map +0 -1
  439. package/lib/plugins/rotate/lg-rotate-settings.js +0 -18
  440. package/lib/plugins/rotate/lg-rotate-settings.js.map +0 -1
  441. package/lib/plugins/rotate/lg-rotate.js +0 -206
  442. package/lib/plugins/rotate/lg-rotate.js.map +0 -1
  443. package/lib/plugins/share/lg-fb-share-utils.js +0 -10
  444. package/lib/plugins/share/lg-fb-share-utils.js.map +0 -1
  445. package/lib/plugins/share/lg-pinterest-share-utils.js +0 -17
  446. package/lib/plugins/share/lg-pinterest-share-utils.js.map +0 -1
  447. package/lib/plugins/share/lg-share-settings.js +0 -15
  448. package/lib/plugins/share/lg-share-settings.js.map +0 -1
  449. package/lib/plugins/share/lg-share.js +0 -130
  450. package/lib/plugins/share/lg-share.js.map +0 -1
  451. package/lib/plugins/share/lg-twitter-share-utils.js +0 -11
  452. package/lib/plugins/share/lg-twitter-share-utils.js.map +0 -1
  453. package/lib/plugins/share/types.js +0 -3
  454. package/lib/plugins/share/types.js.map +0 -1
  455. package/lib/plugins/thumbnail/lg-thumbnail-settings.js +0 -23
  456. package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +0 -1
  457. package/lib/plugins/thumbnail/lg-thumbnail.js +0 -414
  458. package/lib/plugins/thumbnail/lg-thumbnail.js.map +0 -1
  459. package/lib/plugins/video/lg-video-settings.js +0 -15
  460. package/lib/plugins/video/lg-video-settings.js.map +0 -1
  461. package/lib/plugins/video/lg-video-utils.js +0 -84
  462. package/lib/plugins/video/lg-video-utils.js.map +0 -1
  463. package/lib/plugins/video/lg-video.js +0 -411
  464. package/lib/plugins/video/lg-video.js.map +0 -1
  465. package/lib/plugins/video/types.js +0 -3
  466. package/lib/plugins/video/types.js.map +0 -1
  467. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +0 -8
  468. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +0 -1
  469. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +0 -122
  470. package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +0 -1
  471. package/lib/plugins/zoom/lg-zoom-settings.js +0 -21
  472. package/lib/plugins/zoom/lg-zoom-settings.js.map +0 -1
  473. package/lib/plugins/zoom/lg-zoom.js +0 -909
  474. package/lib/plugins/zoom/lg-zoom.js.map +0 -1
  475. package/lib/types.js +0 -3
  476. package/lib/types.js.map +0 -1
  477. package/lightgallery-2.9.0.tgz +0 -0
  478. package/lightgallery.es5.js +0 -2786
  479. package/lightgallery.es5.js.map +0 -1
  480. package/lightgallery.min.js +0 -8
  481. package/lightgallery.umd.js +0 -2794
  482. package/lightgallery.umd.js.map +0 -1
  483. package/lit/custom-elements.json +0 -82
  484. package/lit/lightgallery.esm.js +0 -59
  485. package/lit/lightgallery.umd.js +0 -37
  486. package/lit/package.json +0 -8
  487. package/plugins/autoplay/lg-autoplay.es5.js +0 -250
  488. package/plugins/autoplay/lg-autoplay.es5.js.map +0 -1
  489. package/plugins/autoplay/lg-autoplay.min.js +0 -8
  490. package/plugins/autoplay/lg-autoplay.umd.js +0 -258
  491. package/plugins/autoplay/lg-autoplay.umd.js.map +0 -1
  492. package/plugins/autoplay/package.json +0 -7
  493. package/plugins/comment/lg-comment.es5.js +0 -205
  494. package/plugins/comment/lg-comment.es5.js.map +0 -1
  495. package/plugins/comment/lg-comment.min.js +0 -8
  496. package/plugins/comment/lg-comment.umd.js +0 -213
  497. package/plugins/comment/lg-comment.umd.js.map +0 -1
  498. package/plugins/comment/package.json +0 -7
  499. package/plugins/fullscreen/lg-fullscreen.es5.js +0 -135
  500. package/plugins/fullscreen/lg-fullscreen.es5.js.map +0 -1
  501. package/plugins/fullscreen/lg-fullscreen.min.js +0 -8
  502. package/plugins/fullscreen/lg-fullscreen.umd.js +0 -143
  503. package/plugins/fullscreen/lg-fullscreen.umd.js.map +0 -1
  504. package/plugins/fullscreen/package.json +0 -7
  505. package/plugins/hash/lg-hash-settings.d.ts +0 -16
  506. package/plugins/hash/lg-hash.es5.js +0 -198
  507. package/plugins/hash/lg-hash.es5.js.map +0 -1
  508. package/plugins/hash/lg-hash.min.js +0 -8
  509. package/plugins/hash/lg-hash.umd.js +0 -206
  510. package/plugins/hash/lg-hash.umd.js.map +0 -1
  511. package/plugins/hash/package.json +0 -7
  512. package/plugins/mediumZoom/lg-medium-zoom.es5.js +0 -132
  513. package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +0 -1
  514. package/plugins/mediumZoom/lg-medium-zoom.min.js +0 -8
  515. package/plugins/mediumZoom/lg-medium-zoom.umd.js +0 -140
  516. package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +0 -1
  517. package/plugins/mediumZoom/package.json +0 -7
  518. package/plugins/pager/lg-pager.es5.js +0 -139
  519. package/plugins/pager/lg-pager.es5.js.map +0 -1
  520. package/plugins/pager/lg-pager.min.js +0 -8
  521. package/plugins/pager/lg-pager.umd.js +0 -147
  522. package/plugins/pager/lg-pager.umd.js.map +0 -1
  523. package/plugins/pager/package.json +0 -7
  524. package/plugins/relativeCaption/lg-relative-caption.es5.js +0 -154
  525. package/plugins/relativeCaption/lg-relative-caption.es5.js.map +0 -1
  526. package/plugins/relativeCaption/lg-relative-caption.min.js +0 -8
  527. package/plugins/relativeCaption/lg-relative-caption.umd.js +0 -162
  528. package/plugins/relativeCaption/lg-relative-caption.umd.js.map +0 -1
  529. package/plugins/relativeCaption/package.json +0 -7
  530. package/plugins/rotate/lg-rotate.es5.js +0 -274
  531. package/plugins/rotate/lg-rotate.es5.js.map +0 -1
  532. package/plugins/rotate/lg-rotate.min.js +0 -8
  533. package/plugins/rotate/lg-rotate.umd.js +0 -282
  534. package/plugins/rotate/lg-rotate.umd.js.map +0 -1
  535. package/plugins/rotate/package.json +0 -7
  536. package/plugins/share/lg-share.d.ts +0 -15
  537. package/plugins/share/lg-share.es5.js +0 -219
  538. package/plugins/share/lg-share.es5.js.map +0 -1
  539. package/plugins/share/lg-share.min.js +0 -8
  540. package/plugins/share/lg-share.umd.js +0 -227
  541. package/plugins/share/lg-share.umd.js.map +0 -1
  542. package/plugins/share/lg-twitter-share-utils.d.ts +0 -2
  543. package/plugins/share/package.json +0 -7
  544. package/plugins/thumbnail/lg-thumbnail.d.ts +0 -48
  545. package/plugins/thumbnail/lg-thumbnail.es5.js +0 -487
  546. package/plugins/thumbnail/lg-thumbnail.es5.js.map +0 -1
  547. package/plugins/thumbnail/lg-thumbnail.min.js +0 -8
  548. package/plugins/thumbnail/lg-thumbnail.umd.js +0 -495
  549. package/plugins/thumbnail/lg-thumbnail.umd.js.map +0 -1
  550. package/plugins/thumbnail/package.json +0 -7
  551. package/plugins/video/lg-video-utils.d.ts +0 -10
  552. package/plugins/video/lg-video.es5.js +0 -545
  553. package/plugins/video/lg-video.es5.js.map +0 -1
  554. package/plugins/video/lg-video.min.js +0 -8
  555. package/plugins/video/lg-video.umd.js +0 -553
  556. package/plugins/video/lg-video.umd.js.map +0 -1
  557. package/plugins/video/package.json +0 -7
  558. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +0 -182
  559. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +0 -1
  560. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +0 -8
  561. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +0 -190
  562. package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +0 -1
  563. package/plugins/vimeoThumbnail/package.json +0 -7
  564. package/plugins/zoom/lg-zoom.es5.js +0 -980
  565. package/plugins/zoom/lg-zoom.es5.js.map +0 -1
  566. package/plugins/zoom/lg-zoom.min.js +0 -8
  567. package/plugins/zoom/lg-zoom.umd.js +0 -988
  568. package/plugins/zoom/lg-zoom.umd.js.map +0 -1
  569. package/plugins/zoom/package.json +0 -7
  570. package/react/Lightgallery.d.ts +0 -33
  571. package/react/Lightgallery.es5.js +0 -2988
  572. package/react/Lightgallery.es5.js.map +0 -1
  573. package/react/Lightgallery.umd.js +0 -2994
  574. package/react/Lightgallery.umd.js.map +0 -1
  575. package/react/package.json +0 -7
  576. package/scss/_lg-fonts.scss +0 -27
  577. package/scss/lg-fullscreen.scss +0 -9
  578. package/vue/LightGallery.vue.d.ts +0 -37
  579. package/vue/LightGalleryVue.common.js +0 -9343
  580. package/vue/LightGalleryVue.common.js.map +0 -1
  581. package/vue/LightGalleryVue.umd.js +0 -9353
  582. package/vue/LightGalleryVue.umd.js.map +0 -1
  583. package/vue/LightGalleryVue.umd.min.js +0 -8
  584. package/vue/LightGalleryVue.umd.min.js.map +0 -1
  585. package/vue/package.json +0 -7
  586. /package/{css → dist/css}/lg-medium-zoom.css +0 -0
  587. /package/{css → dist/css}/lg-medium-zoom.css.map +0 -0
  588. /package/{css → dist/css}/lg-pager.css +0 -0
  589. /package/{css → dist/css}/lg-relative-caption.css +0 -0
  590. /package/{css → dist/css}/lg-relative-caption.css.map +0 -0
  591. /package/{css → dist/css}/lg-video.css +0 -0
  592. /package/{css → dist/css}/lg-video.css.map +0 -0
  593. /package/{images → dist/images}/loading.gif +0 -0
  594. /package/{scss → dist/scss}/_lg-mixins.scss +0 -0
  595. /package/{scss → dist/scss}/lg-medium-zoom.scss +0 -0
  596. /package/{scss → dist/scss}/lg-pager.scss +0 -0
  597. /package/{scss → dist/scss}/lg-relative-caption.scss +0 -0
  598. /package/{scss → dist/scss}/lg-transitions.scss +0 -0
  599. /package/{scss → dist/scss}/lg-video.scss +0 -0
  600. /package/{scss → dist/scss}/transitions/_index.scss +0 -0
  601. /package/{scss → dist/scss}/transitions/_lg-lollipop-rev.scss +0 -0
  602. /package/{scss → dist/scss}/transitions/_lg-lollipop.scss +0 -0
  603. /package/{scss → dist/scss}/transitions/_lg-rotate-rev.scss +0 -0
  604. /package/{scss → dist/scss}/transitions/_lg-rotate.scss +0 -0
  605. /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross-rev.scss +0 -0
  606. /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross.scss +0 -0
  607. /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-rev.scss +0 -0
  608. /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y-rev.scss +0 -0
  609. /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y.scss +0 -0
  610. /package/{scss → dist/scss}/transitions/_lg-slide-skew-only.scss +0 -0
  611. /package/{scss → dist/scss}/transitions/_lg-slide-skew-rev.scss +0 -0
  612. /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross-rev.scss +0 -0
  613. /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross.scss +0 -0
  614. /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-rev.scss +0 -0
  615. /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver.scss +0 -0
  616. /package/{scss → dist/scss}/transitions/_lg-slide-skew.scss +0 -0
  617. /package/{scss → dist/scss}/transitions/_lg-slide-vertical-growth.scss +0 -0
  618. /package/{scss → dist/scss}/transitions/_lg-slide-vertical.scss +0 -0
  619. /package/{scss → dist/scss}/transitions/_lg-tube.scss +0 -0
@@ -0,0 +1,210 @@
1
+ (function(global, factory) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.lgHash = factory());
3
+ })(this, function() {
4
+ "use strict";/*!
5
+ * lightgallery | 3.0.0-beta.3 | October 1st 2026
6
+ * http://www.lightgalleryjs.com/
7
+ * Copyright (c) 2020 Sachin Neravath;
8
+ * @license GPLv3
9
+ */
10
+
11
+ function createHistoryHashDriver(win) {
12
+ return {
13
+ kind: "history",
14
+ getHash: () => win.location.hash || "",
15
+ replaceHash: (hash) => win.history.replaceState(
16
+ null,
17
+ "",
18
+ win.location.pathname + win.location.search + hash
19
+ ),
20
+ clearHash: () => win.history.replaceState(
21
+ null,
22
+ "",
23
+ win.location.pathname + win.location.search
24
+ ),
25
+ subscribe: (onChange) => {
26
+ win.addEventListener("hashchange", onChange);
27
+ return () => win.removeEventListener("hashchange", onChange);
28
+ }
29
+ };
30
+ }
31
+ function settleNavigateResult(result) {
32
+ var _a, _b, _c, _d;
33
+ const promises = result;
34
+ (_b = (_a = promises == null ? void 0 : promises.committed) == null ? void 0 : _a.catch) == null ? void 0 : _b.call(_a, () => void 0);
35
+ (_d = (_c = promises == null ? void 0 : promises.finished) == null ? void 0 : _c.catch) == null ? void 0 : _d.call(_c, () => void 0);
36
+ }
37
+ function createNavigationHashDriver(win, navigation) {
38
+ const getHash = () => {
39
+ var _a;
40
+ const url = (_a = navigation.currentEntry) == null ? void 0 : _a.url;
41
+ if (typeof url === "string") {
42
+ const index = url.indexOf("#");
43
+ return index === -1 ? "" : url.slice(index);
44
+ }
45
+ return win.location.hash || "";
46
+ };
47
+ return {
48
+ kind: "navigation",
49
+ getHash,
50
+ replaceHash: (hash) => settleNavigateResult(
51
+ navigation.navigate(
52
+ win.location.pathname + win.location.search + hash,
53
+ { history: "replace", state: { lgHash: hash } }
54
+ )
55
+ ),
56
+ clearHash: () => (
57
+ // Not navigate(): a destination without a fragment is a
58
+ // *cross-document* navigation (the same-document fast path
59
+ // requires the destination to have one), so clearing the hash
60
+ // through it reloads the page every time a gallery closes.
61
+ // replaceState drops the fragment in place, and the entry
62
+ // change still reaches `currententrychange` subscribers.
63
+ win.history.replaceState(
64
+ null,
65
+ "",
66
+ win.location.pathname + win.location.search
67
+ )
68
+ ),
69
+ subscribe: (onChange) => {
70
+ navigation.addEventListener("currententrychange", onChange);
71
+ return () => navigation.removeEventListener("currententrychange", onChange);
72
+ }
73
+ };
74
+ }
75
+ function createHashDriver(win, preference = "auto") {
76
+ const navigation = win.navigation;
77
+ const navigationCapable = !!navigation && typeof navigation.navigate === "function" && typeof navigation.addEventListener === "function" && typeof navigation.removeEventListener === "function";
78
+ if (preference !== "history" && navigationCapable) {
79
+ return createNavigationHashDriver(win, navigation);
80
+ }
81
+ return createHistoryHashDriver(win);
82
+ }
83
+ const lGEvents = {
84
+ afterSlide: "lgAfterSlide",
85
+ afterClose: "lgAfterClose"
86
+ };
87
+ const hashSettings = {
88
+ hash: true,
89
+ hashDriver: "auto",
90
+ galleryId: "1",
91
+ customSlideName: false
92
+ };
93
+ var __defProp = Object.defineProperty;
94
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
95
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
96
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
97
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
98
+ var __spreadValues = (a, b) => {
99
+ for (var prop in b || (b = {}))
100
+ if (__hasOwnProp.call(b, prop))
101
+ __defNormalProp(a, prop, b[prop]);
102
+ if (__getOwnPropSymbols)
103
+ for (var prop of __getOwnPropSymbols(b)) {
104
+ if (__propIsEnum.call(b, prop))
105
+ __defNormalProp(a, prop, b[prop]);
106
+ }
107
+ return a;
108
+ };
109
+ class Hash {
110
+ constructor(instance, $LG) {
111
+ this.core = instance;
112
+ this.$LG = $LG;
113
+ this.settings = __spreadValues(__spreadValues({}, hashSettings), this.core.settings);
114
+ return this;
115
+ }
116
+ init() {
117
+ if (!this.settings.hash) {
118
+ return;
119
+ }
120
+ this.driver = createHashDriver(
121
+ window,
122
+ this.settings.hashDriver
123
+ );
124
+ this.oldHash = this.driver.getHash();
125
+ setTimeout(() => {
126
+ this.buildFromHash();
127
+ }, 100);
128
+ this.core.LGel.on(
129
+ `${lGEvents.afterSlide}.hash`,
130
+ this.onAfterSlide.bind(this)
131
+ );
132
+ this.core.LGel.on(
133
+ `${lGEvents.afterClose}.hash`,
134
+ this.onCloseAfter.bind(this)
135
+ );
136
+ this.unsubscribeDriver = this.driver.subscribe(
137
+ this.onHashchange.bind(this)
138
+ );
139
+ }
140
+ onAfterSlide(event) {
141
+ let slideName = this.core.galleryItems[event.detail.index].slideName;
142
+ slideName = this.settings.customSlideName ? slideName || event.detail.index : event.detail.index;
143
+ this.driver.replaceHash(
144
+ "#lg=" + this.settings.galleryId + "&slide=" + slideName
145
+ );
146
+ }
147
+ /**
148
+ * Get index of the slide from custom slideName. Has to be a public method. Used in hash plugin
149
+ * @param {String} hash
150
+ * @returns {Number} Index of the slide.
151
+ */
152
+ getIndexFromUrl(hash = this.driver.getHash()) {
153
+ const slideName = hash.split("&slide=")[1];
154
+ let _idx = 0;
155
+ if (this.settings.customSlideName) {
156
+ for (let index = 0; index < this.core.galleryItems.length; index++) {
157
+ const dynamicEl = this.core.galleryItems[index];
158
+ if (dynamicEl.slideName === slideName) {
159
+ _idx = index;
160
+ break;
161
+ }
162
+ }
163
+ } else {
164
+ _idx = parseInt(slideName, 10);
165
+ }
166
+ return isNaN(_idx) ? 0 : _idx;
167
+ }
168
+ // Build Gallery if gallery id exist in the URL
169
+ buildFromHash() {
170
+ const _hash = this.driver.getHash();
171
+ if (_hash.indexOf("lg=" + this.settings.galleryId) > 0) {
172
+ this.$LG(document.body).addClass("lg-from-hash");
173
+ const index = this.getIndexFromUrl(_hash);
174
+ this.core.openGallery(index);
175
+ return true;
176
+ }
177
+ }
178
+ onCloseAfter() {
179
+ if (this.oldHash && this.oldHash.indexOf("lg=" + this.settings.galleryId) < 0) {
180
+ this.driver.replaceHash(this.oldHash);
181
+ } else {
182
+ this.driver.clearHash();
183
+ }
184
+ }
185
+ onHashchange() {
186
+ if (!this.core.lgOpened) return;
187
+ const _hash = this.driver.getHash();
188
+ const index = this.getIndexFromUrl(_hash);
189
+ if (_hash.indexOf("lg=" + this.settings.galleryId) > -1) {
190
+ this.core.slide(index, false, false);
191
+ } else if (this.core.lGalleryOn) {
192
+ this.core.closeGallery();
193
+ }
194
+ }
195
+ closeGallery() {
196
+ if (this.settings.hash) {
197
+ this.$LG(document.body).removeClass("lg-from-hash");
198
+ }
199
+ }
200
+ destroy() {
201
+ var _a;
202
+ this.core.LGel.off(".lg.hash");
203
+ this.core.LGel.off(".hash");
204
+ (_a = this.unsubscribeDriver) == null ? void 0 : _a.call(this);
205
+ this.unsubscribeDriver = void 0;
206
+ }
207
+ }
208
+ return Hash;
209
+ });
210
+ //# sourceMappingURL=lg-hash.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lg-hash.umd.js","sources":["../../../packages/headless/src/hash-driver.ts","../../../src/lg-events.ts","../../../src/plugins/hash/lg-hash-settings.ts","../../../src/plugins/hash/lg-hash.ts"],"sourcesContent":["/**\n * URL-hash drivers for the hash plugin (plan 012). The plugin's history\n * side-effects — replace-write the deep link, restore/clear on close,\n * follow back/forward — sit behind one interface with two engines:\n *\n * - `history`: today's behavior (history.replaceState + `hashchange`) —\n * the default fallback everywhere.\n * - `navigation`: the Navigation API (Baseline Newly Available, Jan\n * 2026) — replace-navigations carry entry state, and back/forward is\n * observed via `currententrychange`. Strictly a feature-detected\n * enhancement: nothing here is load-bearing (Safari's missing\n * `precommitHandler` is irrelevant — we never intercept), and any\n * missing capability falls back to the history driver.\n *\n * The deep-link URL format (`#lg=<galleryId>&slide=<index|name>`) is\n * public API and identical across drivers — pinned by the parity tests.\n *\n * Everything is structurally typed (the runtimes pass `window`); nothing\n * in this module touches DOM globals directly.\n *\n * Revisit note: flip the docs' default emphasis toward `navigation` once\n * the API reaches Widely Available (~2028 per current projection).\n */\n\nexport interface HashDriver {\n /** Which engine this driver runs on (also used by the parity tests). */\n readonly kind: 'history' | 'navigation';\n /** The current URL hash including the leading '#', or ''. */\n getHash(): string;\n /** Replace the current entry's hash (never grows history). */\n replaceHash(hash: string): void;\n /** Replace the current entry with the bare URL (drops the hash). */\n clearHash(): void;\n /**\n * Notify on URL changes the driver did not itself cause is NOT\n * guaranteed — subscribers must be re-entrant-safe (the hash plugin's\n * handlers already are: same-slide jumps no-op and close checks the\n * open flag).\n */\n subscribe(onChange: () => void): () => void;\n}\n\nexport interface HashHistoryWindow {\n location: { hash: string; pathname: string; search: string };\n history: {\n replaceState(data: unknown, unused: string, url?: string): void;\n };\n addEventListener(type: string, listener: () => void): void;\n removeEventListener(type: string, listener: () => void): void;\n}\n\n/** Structural slice of the Navigation API the driver uses. */\nexport interface NavigationLike {\n currentEntry?: { url?: string | null } | null;\n navigate(\n url: string,\n options?: {\n history?: 'auto' | 'push' | 'replace';\n state?: unknown;\n },\n ): unknown;\n addEventListener(type: string, listener: () => void): void;\n removeEventListener(type: string, listener: () => void): void;\n}\n\nexport interface HashNavigationWindow extends HashHistoryWindow {\n navigation?: NavigationLike;\n}\n\nexport type HashDriverPreference = 'auto' | 'history' | 'navigation';\n\nexport function createHistoryHashDriver(win: HashHistoryWindow): HashDriver {\n return {\n kind: 'history',\n getHash: () => win.location.hash || '',\n replaceHash: (hash) =>\n win.history.replaceState(\n null,\n '',\n win.location.pathname + win.location.search + hash,\n ),\n clearHash: () =>\n win.history.replaceState(\n null,\n '',\n win.location.pathname + win.location.search,\n ),\n subscribe: (onChange) => {\n win.addEventListener('hashchange', onChange);\n return () => win.removeEventListener('hashchange', onChange);\n },\n };\n}\n\n/** Swallow the navigate() result promises — a dismissed/aborted\n * navigation has nothing to clean up (same posture as the share sheet). */\nfunction settleNavigateResult(result: unknown): void {\n const promises = result as {\n committed?: Promise<unknown>;\n finished?: Promise<unknown>;\n } | null;\n promises?.committed?.catch?.(() => undefined);\n promises?.finished?.catch?.(() => undefined);\n}\n\nexport function createNavigationHashDriver(\n win: HashHistoryWindow,\n navigation: NavigationLike,\n): HashDriver {\n const getHash = (): string => {\n const url = navigation.currentEntry?.url;\n if (typeof url === 'string') {\n const index = url.indexOf('#');\n return index === -1 ? '' : url.slice(index);\n }\n return win.location.hash || '';\n };\n return {\n kind: 'navigation',\n getHash,\n replaceHash: (hash) =>\n settleNavigateResult(\n navigation.navigate(\n win.location.pathname + win.location.search + hash,\n { history: 'replace', state: { lgHash: hash } },\n ),\n ),\n clearHash: () =>\n // Not navigate(): a destination without a fragment is a\n // *cross-document* navigation (the same-document fast path\n // requires the destination to have one), so clearing the hash\n // through it reloads the page every time a gallery closes.\n // replaceState drops the fragment in place, and the entry\n // change still reaches `currententrychange` subscribers.\n win.history.replaceState(\n null,\n '',\n win.location.pathname + win.location.search,\n ),\n subscribe: (onChange) => {\n // currententrychange also fires for the driver's own replace\n // navigations — safe by contract (see HashDriver.subscribe).\n navigation.addEventListener('currententrychange', onChange);\n return () =>\n navigation.removeEventListener('currententrychange', onChange);\n },\n };\n}\n\n/**\n * Pick a driver: `navigation` when preferred-or-auto and the Navigation\n * API is present with everything the driver needs; the history driver in\n * every other case (including an explicit `navigation` preference on a\n * browser without support — the enhancement is never load-bearing).\n */\nexport function createHashDriver(\n win: HashNavigationWindow,\n preference: HashDriverPreference = 'auto',\n): HashDriver {\n const navigation = win.navigation;\n const navigationCapable =\n !!navigation &&\n typeof navigation.navigate === 'function' &&\n typeof navigation.addEventListener === 'function' &&\n typeof navigation.removeEventListener === 'function';\n if (preference !== 'history' && navigationCapable) {\n return createNavigationHashDriver(win, navigation);\n }\n return createHistoryHashDriver(win);\n}\n","import { LightGallery } from './lightgallery';\nimport { VideoSource } from './plugins/video/types';\n\n/**\n * List of lightGallery events\n * All events should be documented here\n * Below interfaces are used to build the website documentations\n * */\nexport const lGEvents: {\n [key: string]: string;\n} = {\n afterAppendSlide: 'lgAfterAppendSlide',\n init: 'lgInit',\n hasVideo: 'lgHasVideo',\n containerResize: 'lgContainerResize',\n updateSlides: 'lgUpdateSlides',\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\n beforeOpen: 'lgBeforeOpen',\n afterOpen: 'lgAfterOpen',\n slideItemLoad: 'lgSlideItemLoad',\n beforeSlide: 'lgBeforeSlide',\n afterSlide: 'lgAfterSlide',\n posterClick: 'lgPosterClick',\n dragStart: 'lgDragStart',\n dragMove: 'lgDragMove',\n dragEnd: 'lgDragEnd',\n beforeNextSlide: 'lgBeforeNextSlide',\n beforePrevSlide: 'lgBeforePrevSlide',\n beforeClose: 'lgBeforeClose',\n afterClose: 'lgAfterClose',\n rotateLeft: 'lgRotateLeft',\n rotateRight: 'lgRotateRight',\n flipHorizontal: 'lgFlipHorizontal',\n flipVertical: 'lgFlipVertical',\n autoplay: 'lgAutoplay',\n autoplayStart: 'lgAutoplayStart',\n autoplayStop: 'lgAutoplayStop',\n};\n\n// Follow the below format for the event documentation\n// @method is the method name when event is used with Angular/React components\n\n/**\n * Fired only once when lightGallery is initialized\n * @name lgInit\n * @method onInit\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action on lightGallery initialization.\n * // Init event returns the plugin instance that can be used to call any lightGalley public method\n * let pluginInstance = null;\n * lg.addEventListener('lgInit', (event) => {\n * pluginInstance = event.detail.instance;\n * });\n * lightGallery(lg);\n * @see <a href=\"/docs/methods/\">Methods</a>\n */\nexport interface InitDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired when the slide content has been inserted into it's slide container.\n * @name lgAfterAppendSlide\n * @method onAfterAppendSlide\n */\nexport interface AfterAppendSlideEventDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired immediately before opening the gallery\n * @name lgBeforeOpen\n * @method onBeforeOpen\n */\nexport interface BeforeOpenDetail {}\n\n/**\n * Fired immediately after opening the gallery\n * @name lgAfterOpen\n * @method onAfterOpen\n */\nexport interface AfterOpenDetail {}\n\n/**\n * Fired once the media inside the slide has been completely loaded .\n * @name lgSlideItemLoad\n * @method onSlideItemLoad\n */\nexport interface SlideItemLoadDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * For the first slide, lightGallery adds some delay for displaying the loaded slide item.\n * This delay is required for the transition effect when the slide item is displayed\n * Respect the delay when you use this event\n */\n delay: number;\n\n // Will be true for the first slide\n isFirstSlide: boolean;\n}\n\n/**\n * Fired immediately before each slide transition.\n * @name lgBeforeSlide\n * @method onBeforeSlide\n * @example\n * const lg = document.getElementById('custom-events-demo');\n * // Perform any action before each slide transition\n * lg.addEventListener('lgBeforeSlide', (event) => {\n * const { index, prevIndex } = event.detail;\n * alert(index, prevIndex);\n * });\n * lightGallery(lg);\n */\nexport interface BeforeSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired immediately after each slide transition.\n * @name lgAfterSlide\n * @method onAfterSlide\n */\nexport interface AfterSlideDetail {\n /**\n * Index of the previous slide\n */\n prevIndex: number;\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n /**\n * true if slide function called via thumbnail click\n */\n fromThumb: boolean;\n}\n\n/**\n * Fired when the video poster is clicked.\n * @name lgPosterClick\n * @method onPosterClick\n */\nexport interface PosterClickDetail {}\n\n/**\n * Fired when the drag event to move to different slide starts.\n * @name lgDragStart\n * @method onDragStart\n */\nexport interface DragStartDetail {}\n\n/**\n * Fired periodically during the drag operation.\n * @name lgDragMove\n * @method onDragMove\n */\nexport interface DragMoveDetail {}\n\n/**\n * Fired when the user has finished the drag operation\n * @name lgDragEnd\n * @method onDragEnd\n */\nexport interface DragEndDetail {}\n\n/**\n * Fired immediately before the start of the close process.\n * @name lgBeforeClose\n * @method onBeforeClose\n */\nexport interface BeforeCloseDetail {}\n\n/**\n * Fired immediately once lightGallery is closed.\n * @name lgAfterClose\n * @method onAfterClose\n */\nexport interface AfterCloseDetail {\n /**\n * lightGallery plugin instance\n */\n instance: LightGallery;\n}\n\n/**\n * Fired immediately before each \"next\" slide transition\n * @name lgBeforeNextSlide\n * @method onBeforeNextSlide\n */\nexport interface BeforeNextSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired immediately before each \"prev\" slide transition\n * @name lgBeforePrevSlide\n * @method onBeforePrevSlide\n */\nexport interface BeforePrevSlideDetail {\n /**\n * Index of the slide\n */\n index: number;\n /**\n * true if slide function called via touch event or mouse drag\n */\n fromTouch: boolean;\n}\n\n/**\n * Fired when the sub-html content (ex : title/ description) has been appended into the slide.\n * @name lgAfterAppendSubHtml\n * @method onAfterAppendSubHtml\n */\nexport interface AfterAppendSubHtmlDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the lightGallery container has been resized.\n * @name lgContainerResize\n * @method onContainerResize\n */\nexport interface ContainerResizeDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when lightGallery detects video slide\n * @name lgHasVideo\n * @method onHasVideo\n */\nexport interface HasVideoDetail {\n /**\n * Index of the slide,\n */\n index: number;\n /**\n * Video source\n */\n src: string;\n /**\n * HTML5 video source if available\n * <p>\n HTML5 video source = source: {\n src: string;\n type: string;\n }[];\n attributes: HTMLVideoElement;\n * </p>\n */\n html5Video: VideoSource;\n /**\n * True if video has poster\n */\n hasPoster: boolean;\n}\n\n/**\n * Fired when the image is rotated in anticlockwise direction\n * @name lgRotateLeft\n * @method onRotateLeft\n */\nexport interface RotateLeftDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is rotated in clockwise direction\n * @name lgRotateRight\n * @method onRotateRight\n */\nexport interface RotateRightDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped horizontally\n * @name lgFlipHorizontal\n * @method onFlipHorizontal\n */\nexport interface FlipHorizontalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n\n/**\n * Fired when the image is flipped vertically\n * @name lgFlipVertical\n * @method onFlipVertical\n */\nexport interface FlipVerticalDetail {\n /**\n * Index of the slide\n */\n index: number;\n}\n","import { HashDriverPreference } from '@lightgallery/headless';\n\nexport interface HashSettings {\n /**\n * Enable/Disable hash option\n */\n hash: boolean;\n\n /**\n * URL engine behind the hash syncing.\n * @description 'auto' uses the Navigation API where the browser\n * supports it and falls back to the History API everywhere else;\n * 'history' and 'navigation' force an engine (an unsupported\n * 'navigation' quietly falls back, the enhancement is never\n * load-bearing). The deep-link URL format is identical either way.\n * See <a href=\"/docs/hash-drivers/\">Hash drivers</a>.\n * @version V3.0.0\n */\n hashDriver: HashDriverPreference;\n\n /**\n * Unique id for each gallery.\n * @description It is mandatory when you use hash plugin for multiple galleries on the same page.\n */\n galleryId: string;\n\n /**\n * Custom slide name to use in the url when hash plugin is enabled\n */\n customSlideName: boolean;\n}\n\nexport const hashSettings: HashSettings = {\n hash: true,\n hashDriver: 'auto',\n galleryId: '1',\n customSlideName: false,\n};\n","import {\n createHashDriver,\n type HashDriver,\n type HashNavigationWindow,\n} from '@lightgallery/headless';\n\nimport { lGEvents } from '../../lg-events';\nimport { LgQuery } from '../../lgQuery';\nimport { LightGallery } from '../../lightgallery';\nimport { hashSettings, HashSettings } from './lg-hash-settings';\n\nexport default class Hash {\n core: LightGallery;\n settings: HashSettings;\n oldHash!: string;\n private $LG!: LgQuery;\n // URL engine (plan 012): History API today, Navigation API where the\n // browser has it, same URLs either way.\n private driver!: HashDriver;\n private unsubscribeDriver?: () => void;\n constructor(instance: LightGallery, $LG: LgQuery) {\n // get lightGallery core plugin instance\n this.core = instance;\n this.$LG = $LG;\n // extend module default settings with lightGallery core settings\n this.settings = { ...hashSettings, ...this.core.settings };\n return this;\n }\n\n public init(): void {\n if (!this.settings.hash) {\n return;\n }\n this.driver = createHashDriver(\n window as unknown as HashNavigationWindow,\n this.settings.hashDriver,\n );\n this.oldHash = this.driver.getHash();\n setTimeout(() => {\n this.buildFromHash();\n }, 100);\n // Change hash value on after each slide transition\n this.core.LGel.on(\n `${lGEvents.afterSlide}.hash`,\n this.onAfterSlide.bind(this),\n );\n this.core.LGel.on(\n `${lGEvents.afterClose}.hash`,\n this.onCloseAfter.bind(this),\n );\n\n // Follow back/forward URL changes (hashchange on the history\n // driver, currententrychange on the navigation driver).\n this.unsubscribeDriver = this.driver.subscribe(\n this.onHashchange.bind(this),\n );\n }\n\n private onAfterSlide(event: CustomEvent) {\n let slideName = this.core.galleryItems[event.detail.index].slideName;\n slideName = this.settings.customSlideName\n ? slideName || event.detail.index\n : event.detail.index;\n this.driver.replaceHash(\n '#lg=' + this.settings.galleryId + '&slide=' + slideName,\n );\n }\n\n /**\n * Get index of the slide from custom slideName. Has to be a public method. Used in hash plugin\n * @param {String} hash\n * @returns {Number} Index of the slide.\n */\n getIndexFromUrl(hash = this.driver.getHash()): number {\n const slideName = hash.split('&slide=')[1];\n let _idx = 0;\n\n if (this.settings.customSlideName) {\n for (\n let index = 0;\n index < this.core.galleryItems.length;\n index++\n ) {\n const dynamicEl = this.core.galleryItems[index];\n if (dynamicEl.slideName === slideName) {\n _idx = index;\n break;\n }\n }\n } else {\n _idx = parseInt(slideName, 10);\n }\n\n return isNaN(_idx) ? 0 : _idx;\n }\n\n // Build Gallery if gallery id exist in the URL\n buildFromHash(): boolean | undefined {\n // if dynamic option is enabled execute immediately\n const _hash = this.driver.getHash();\n if (_hash.indexOf('lg=' + this.settings.galleryId) > 0) {\n // This class is used to remove the initial animation if galleryId present in the URL\n this.$LG(document.body).addClass('lg-from-hash');\n\n const index = this.getIndexFromUrl(_hash);\n\n this.core.openGallery(index);\n return true;\n }\n }\n\n private onCloseAfter() {\n // Reset to old hash value\n if (\n this.oldHash &&\n this.oldHash.indexOf('lg=' + this.settings.galleryId) < 0\n ) {\n this.driver.replaceHash(this.oldHash);\n } else {\n this.driver.clearHash();\n }\n }\n\n private onHashchange() {\n if (!this.core.lgOpened) return;\n const _hash = this.driver.getHash();\n const index = this.getIndexFromUrl(_hash);\n\n // it galleryId doesn't exist in the url close the gallery\n if (_hash.indexOf('lg=' + this.settings.galleryId) > -1) {\n this.core.slide(index, false, false);\n } else if (this.core.lGalleryOn) {\n this.core.closeGallery();\n }\n }\n\n closeGallery(): void {\n if (this.settings.hash) {\n this.$LG(document.body).removeClass('lg-from-hash');\n }\n }\n\n destroy(): void {\n this.core.LGel.off('.lg.hash');\n this.core.LGel.off('.hash');\n this.unsubscribeDriver?.();\n this.unsubscribeDriver = undefined;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAuEO,WAAS,wBAAwB,KAAoC;AACxE,WAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,MAAM,IAAI,SAAS,QAAQ;AAAA,MACpC,aAAa,CAAC,SACV,IAAI,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA,IAAI,SAAS,WAAW,IAAI,SAAS,SAAS;AAAA,MAAA;AAAA,MAEtD,WAAW,MACP,IAAI,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA,IAAI,SAAS,WAAW,IAAI,SAAS;AAAA,MAAA;AAAA,MAE7C,WAAW,CAAC,aAAa;AACrB,YAAI,iBAAiB,cAAc,QAAQ;AAC3C,eAAO,MAAM,IAAI,oBAAoB,cAAc,QAAQ;AAAA,MAC/D;AAAA,IAAA;AAAA,EAER;AAIA,WAAS,qBAAqB,QAAuB;AAhGrD,QAAA,IAAA,IAAA,IAAA;AAiGI,UAAM,WAAW;AAIjB,KAAA,MAAA,KAAA,YAAA,OAAA,SAAA,SAAU,cAAV,OAAA,SAAA,GAAqB,UAArB,OAAA,SAAA,GAAA,KAAA,IAA6B,MAAM,MAAA;AACnC,KAAA,MAAA,KAAA,YAAA,OAAA,SAAA,SAAU,aAAV,OAAA,SAAA,GAAoB,UAApB,OAAA,SAAA,GAAA,KAAA,IAA4B,MAAM,MAAA;AAAA,EACtC;AAEO,WAAS,2BACZ,KACA,YACU;AACV,UAAM,UAAU,MAAc;AA7GlC,UAAA;AA8GQ,YAAM,OAAM,KAAA,WAAW,iBAAX,OAAA,SAAA,GAAyB;AACrC,UAAI,OAAO,QAAQ,UAAU;AACzB,cAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,eAAO,UAAU,KAAK,KAAK,IAAI,MAAM,KAAK;AAAA,MAC9C;AACA,aAAO,IAAI,SAAS,QAAQ;AAAA,IAChC;AACA,WAAO;AAAA,MACH,MAAM;AAAA,MACN;AAAA,MACA,aAAa,CAAC,SACV;AAAA,QACI,WAAW;AAAA,UACP,IAAI,SAAS,WAAW,IAAI,SAAS,SAAS;AAAA,UAC9C,EAAE,SAAS,WAAW,OAAO,EAAE,QAAQ,OAAK;AAAA,QAAE;AAAA,MAClD;AAAA,MAER,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOP,IAAI,QAAQ;AAAA,UACR;AAAA,UACA;AAAA,UACA,IAAI,SAAS,WAAW,IAAI,SAAS;AAAA,QAAA;AAAA;AAAA,MAE7C,WAAW,CAAC,aAAa;AAGrB,mBAAW,iBAAiB,sBAAsB,QAAQ;AAC1D,eAAO,MACH,WAAW,oBAAoB,sBAAsB,QAAQ;AAAA,MACrE;AAAA,IAAA;AAAA,EAER;AAQO,WAAS,iBACZ,KACA,aAAmC,QACzB;AACV,UAAM,aAAa,IAAI;AACvB,UAAM,oBACF,CAAC,CAAC,cACF,OAAO,WAAW,aAAa,cAC/B,OAAO,WAAW,qBAAqB,cACvC,OAAO,WAAW,wBAAwB;AAC9C,QAAI,eAAe,aAAa,mBAAmB;AAC/C,aAAO,2BAA2B,KAAK,UAAU;AAAA,IACrD;AACA,WAAO,wBAAwB,GAAG;AAAA,EACtC;ACjKO,QAAM,WAET;AAAA,IAWA,YAAY;AAAA,IAQZ,YAAY;AAAA,EAQhB;ACLO,QAAM,eAA6B;AAAA,IACtC,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,iBAAiB;AAAA,EACrB;;;;;;;;;;;;;;;;;EC1BA,MAAqB,KAAK;AAAA,IAStB,YAAY,UAAwB,KAAc;AAE9C,WAAK,OAAO;AACZ,WAAK,MAAM;AAEX,WAAK,WAAW,eAAA,eAAA,CAAA,GAAK,YAAA,GAAiB,KAAK,KAAK,QAAA;AAChD,aAAO;AAAA,IACX;AAAA,IAEO,OAAa;AAChB,UAAI,CAAC,KAAK,SAAS,MAAM;AACrB;AAAA,MACJ;AACA,WAAK,SAAS;AAAA,QACV;AAAA,QACA,KAAK,SAAS;AAAA,MAAA;AAElB,WAAK,UAAU,KAAK,OAAO,QAAA;AAC3B,iBAAW,MAAM;AACb,aAAK,cAAA;AAAA,MACT,GAAG,GAAG;AAEN,WAAK,KAAK,KAAK;AAAA,QACX,GAAG,SAAS,UAAU;AAAA,QACtB,KAAK,aAAa,KAAK,IAAI;AAAA,MAAA;AAE/B,WAAK,KAAK,KAAK;AAAA,QACX,GAAG,SAAS,UAAU;AAAA,QACtB,KAAK,aAAa,KAAK,IAAI;AAAA,MAAA;AAK/B,WAAK,oBAAoB,KAAK,OAAO;AAAA,QACjC,KAAK,aAAa,KAAK,IAAI;AAAA,MAAA;AAAA,IAEnC;AAAA,IAEQ,aAAa,OAAoB;AACrC,UAAI,YAAY,KAAK,KAAK,aAAa,MAAM,OAAO,KAAK,EAAE;AAC3D,kBAAY,KAAK,SAAS,kBACpB,aAAa,MAAM,OAAO,QAC1B,MAAM,OAAO;AACnB,WAAK,OAAO;AAAA,QACR,SAAS,KAAK,SAAS,YAAY,YAAY;AAAA,MAAA;AAAA,IAEvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,gBAAgB,OAAO,KAAK,OAAO,WAAmB;AAClD,YAAM,YAAY,KAAK,MAAM,SAAS,EAAE,CAAC;AACzC,UAAI,OAAO;AAEX,UAAI,KAAK,SAAS,iBAAiB;AAC/B,iBACQ,QAAQ,GACZ,QAAQ,KAAK,KAAK,aAAa,QAC/B,SACF;AACE,gBAAM,YAAY,KAAK,KAAK,aAAa,KAAK;AAC9C,cAAI,UAAU,cAAc,WAAW;AACnC,mBAAO;AACP;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ,OAAO;AACH,eAAO,SAAS,WAAW,EAAE;AAAA,MACjC;AAEA,aAAO,MAAM,IAAI,IAAI,IAAI;AAAA,IAC7B;AAAA;AAAA,IAGA,gBAAqC;AAEjC,YAAM,QAAQ,KAAK,OAAO,QAAA;AAC1B,UAAI,MAAM,QAAQ,QAAQ,KAAK,SAAS,SAAS,IAAI,GAAG;AAEpD,aAAK,IAAI,SAAS,IAAI,EAAE,SAAS,cAAc;AAE/C,cAAM,QAAQ,KAAK,gBAAgB,KAAK;AAExC,aAAK,KAAK,YAAY,KAAK;AAC3B,eAAO;AAAA,MACX;AAAA,IACJ;AAAA,IAEQ,eAAe;AAEnB,UACI,KAAK,WACL,KAAK,QAAQ,QAAQ,QAAQ,KAAK,SAAS,SAAS,IAAI,GAC1D;AACE,aAAK,OAAO,YAAY,KAAK,OAAO;AAAA,MACxC,OAAO;AACH,aAAK,OAAO,UAAA;AAAA,MAChB;AAAA,IACJ;AAAA,IAEQ,eAAe;AACnB,UAAI,CAAC,KAAK,KAAK,SAAU;AACzB,YAAM,QAAQ,KAAK,OAAO,QAAA;AAC1B,YAAM,QAAQ,KAAK,gBAAgB,KAAK;AAGxC,UAAI,MAAM,QAAQ,QAAQ,KAAK,SAAS,SAAS,IAAI,IAAI;AACrD,aAAK,KAAK,MAAM,OAAO,OAAO,KAAK;AAAA,MACvC,WAAW,KAAK,KAAK,YAAY;AAC7B,aAAK,KAAK,aAAA;AAAA,MACd;AAAA,IACJ;AAAA,IAEA,eAAqB;AACjB,UAAI,KAAK,SAAS,MAAM;AACpB,aAAK,IAAI,SAAS,IAAI,EAAE,YAAY,cAAc;AAAA,MACtD;AAAA,IACJ;AAAA,IAEA,UAAgB;AA9IpB,UAAA;AA+IQ,WAAK,KAAK,KAAK,IAAI,UAAU;AAC7B,WAAK,KAAK,KAAK,IAAI,OAAO;AAC1B,OAAA,KAAA,KAAK,sBAAL,OAAA,SAAA,GAAA,KAAA,IAAA;AACA,WAAK,oBAAoB;AAAA,IAC7B;AAAA,EACJ;;;"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "lightgallery/plugins/hash",
3
+ "private": true,
4
+ "main": "lg-hash.umd.js",
5
+ "module": "lg-hash.es5.js",
6
+ "typings": "lg-hash.d.ts"
7
+ }
@@ -0,0 +1,415 @@
1
+ /*!
2
+ * lightgallery | 3.0.0-beta.3 | October 1st 2026
3
+ * http://www.lightgalleryjs.com/
4
+ * Copyright (c) 2020 Sachin Neravath;
5
+ * @license GPLv3
6
+ */
7
+ function parseImageSize(lgSize, viewportWidth) {
8
+ if (!lgSize) {
9
+ return void 0;
10
+ }
11
+ let size = lgSize;
12
+ const responsiveSizes = lgSize.split(",");
13
+ if (responsiveSizes[1]) {
14
+ for (let i = 0; i < responsiveSizes.length; i++) {
15
+ const candidate = responsiveSizes[i].trim();
16
+ const responsiveWidth = parseInt(candidate.split("-")[2], 10);
17
+ if (responsiveWidth > viewportWidth) {
18
+ size = candidate;
19
+ break;
20
+ }
21
+ if (i === responsiveSizes.length - 1) {
22
+ size = candidate;
23
+ }
24
+ }
25
+ }
26
+ const parts = size.trim().split("-");
27
+ const width = parseInt(parts[0], 10);
28
+ const height = parseInt(parts[1], 10);
29
+ if (!Number.isFinite(width) || !Number.isFinite(height)) {
30
+ return void 0;
31
+ }
32
+ return { width, height };
33
+ }
34
+ const DEFAULT_TARGET_ROW_HEIGHT = 180;
35
+ const DEFAULT_GAP = 8;
36
+ const DEFAULT_MAX_SCALE = 1.75;
37
+ function sanitizeRatios(ratios) {
38
+ let warned = false;
39
+ return ratios.map((ratio) => {
40
+ if (Number.isFinite(ratio) && ratio > 0) {
41
+ return ratio;
42
+ }
43
+ if (!warned && typeof console !== "undefined") {
44
+ warned = true;
45
+ console.warn(
46
+ "lightGallery justified layout: invalid aspect ratio, treating as 1 (square). See https://www.lightgalleryjs.com/docs/justified-layout/"
47
+ );
48
+ }
49
+ return 1;
50
+ });
51
+ }
52
+ function renderRow(options) {
53
+ const { row, firstIndex, top, containerWidth, gap, fill, boxes } = options;
54
+ const height = Math.round(options.height);
55
+ let start = 0;
56
+ row.forEach((ratio, offset) => {
57
+ let width = Math.round(ratio * height);
58
+ if (fill && offset === row.length - 1) {
59
+ width = containerWidth - start;
60
+ }
61
+ boxes[firstIndex + offset] = { top, start, width, height };
62
+ start += width + gap;
63
+ });
64
+ return height;
65
+ }
66
+ function getJustifiedLayout(options) {
67
+ const {
68
+ containerWidth,
69
+ targetRowHeight = DEFAULT_TARGET_ROW_HEIGHT,
70
+ gap = DEFAULT_GAP,
71
+ lastRow = "start",
72
+ maxScale = DEFAULT_MAX_SCALE
73
+ } = options;
74
+ const ratios = sanitizeRatios(options.ratios);
75
+ const boxes = new Array(ratios.length);
76
+ const maxHeight = targetRowHeight * maxScale;
77
+ const fillHeight = (row2) => {
78
+ const available = containerWidth - gap * (row2.length - 1);
79
+ const ratioSum = row2.reduce((sum, ratio) => sum + ratio, 0);
80
+ return available / ratioSum;
81
+ };
82
+ let top = 0;
83
+ let row = [];
84
+ let firstIndex = 0;
85
+ const closeRow = (height, fill) => {
86
+ const rendered = renderRow({
87
+ row,
88
+ firstIndex,
89
+ top,
90
+ height: Math.min(height, maxHeight),
91
+ containerWidth,
92
+ gap,
93
+ // A clamped row no longer fills the width — never stretch it.
94
+ fill: fill && height <= maxHeight,
95
+ boxes
96
+ });
97
+ top += rendered + gap;
98
+ firstIndex += row.length;
99
+ row = [];
100
+ };
101
+ ratios.forEach((ratio) => {
102
+ row.push(ratio);
103
+ const height = fillHeight(row);
104
+ if (height > targetRowHeight) {
105
+ return;
106
+ }
107
+ const heightWithout = row.length > 1 ? fillHeight(row.slice(0, -1)) : null;
108
+ if (heightWithout !== null && heightWithout - targetRowHeight < targetRowHeight - height) {
109
+ const carried = row.pop();
110
+ closeRow(heightWithout, true);
111
+ row = [carried];
112
+ if (fillHeight(row) <= targetRowHeight) {
113
+ closeRow(fillHeight(row), true);
114
+ }
115
+ } else {
116
+ closeRow(height, true);
117
+ }
118
+ });
119
+ if (row.length > 0) {
120
+ if (lastRow === "hide") {
121
+ row.forEach((_, offset) => {
122
+ boxes[firstIndex + offset] = {
123
+ top: 0,
124
+ start: 0,
125
+ width: 0,
126
+ height: 0
127
+ };
128
+ });
129
+ } else if (lastRow === "justify") {
130
+ closeRow(fillHeight(row), true);
131
+ } else {
132
+ closeRow(targetRowHeight, false);
133
+ }
134
+ }
135
+ return {
136
+ boxes,
137
+ containerHeight: firstIndex > 0 || row.length > 0 ? Math.max(top - gap, 0) : 0
138
+ };
139
+ }
140
+ function getJustifiedRows(boxes) {
141
+ const rows = [];
142
+ let rowTop = -1;
143
+ boxes.forEach((box, index) => {
144
+ if (box.width === 0 && box.height === 0) {
145
+ return;
146
+ }
147
+ if (!rows.length || box.top !== rowTop) {
148
+ rows.push([]);
149
+ rowTop = box.top;
150
+ }
151
+ rows[rows.length - 1].push(index);
152
+ });
153
+ return rows;
154
+ }
155
+ function getRevealableItems(rows, isLoaded, reveal) {
156
+ if (reveal === "image") {
157
+ return [].concat(...rows).filter(isLoaded);
158
+ }
159
+ const revealable = [];
160
+ for (const row of rows) {
161
+ if (!row.every(isLoaded)) {
162
+ break;
163
+ }
164
+ revealable.push(...row);
165
+ }
166
+ return revealable;
167
+ }
168
+ const lGEvents = {
169
+ updateSlides: "lgUpdateSlides"
170
+ };
171
+ const justifiedSettings = {
172
+ justified: true,
173
+ justifiedRowHeight: 180,
174
+ justifiedGap: 8,
175
+ justifiedLastRow: "start",
176
+ justifiedMaxScale: 1.75,
177
+ justifiedReveal: "row"
178
+ };
179
+ var __defProp = Object.defineProperty;
180
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
181
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
182
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
183
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
184
+ var __spreadValues = (a, b) => {
185
+ for (var prop in b || (b = {}))
186
+ if (__hasOwnProp.call(b, prop))
187
+ __defNormalProp(a, prop, b[prop]);
188
+ if (__getOwnPropSymbols)
189
+ for (var prop of __getOwnPropSymbols(b)) {
190
+ if (__propIsEnum.call(b, prop))
191
+ __defNormalProp(a, prop, b[prop]);
192
+ }
193
+ return a;
194
+ };
195
+ class Justified {
196
+ constructor(instance, $LG) {
197
+ this.triggers = [];
198
+ this.ratios = [];
199
+ this.layoutWidth = 0;
200
+ this.pendingLoads = [];
201
+ this.rows = [];
202
+ this.loaded = /* @__PURE__ */ new Set();
203
+ this.loadWatchers = /* @__PURE__ */ new Map();
204
+ this.originalContainerStyle = "";
205
+ this.originalTriggerStyles = /* @__PURE__ */ new Map();
206
+ this.core = instance;
207
+ this.$LG = $LG;
208
+ this.settings = __spreadValues(__spreadValues({}, justifiedSettings), this.core.settings);
209
+ return this;
210
+ }
211
+ init() {
212
+ if (!this.settings.justified || this.core.settings.dynamic) {
213
+ return;
214
+ }
215
+ this.collectTriggers();
216
+ if (!this.triggers.length) {
217
+ return;
218
+ }
219
+ this.originalContainerStyle = this.core.el.getAttribute("style") || "";
220
+ this.core.el.classList.add("lg-justified", "lg-justified-reveal");
221
+ this.resolveRatios();
222
+ this.layout();
223
+ this.core.LGel.on(`${lGEvents.updateSlides}.justified`, () => {
224
+ this.pendingLoads.forEach((cancel) => cancel());
225
+ this.pendingLoads = [];
226
+ this.cancelLoadWatchers();
227
+ this.collectTriggers();
228
+ this.resolveRatios();
229
+ this.layout();
230
+ });
231
+ if (typeof ResizeObserver !== "undefined") {
232
+ this.resizeObserver = new ResizeObserver(() => {
233
+ if (this.core.el.clientWidth !== this.layoutWidth) {
234
+ this.layout();
235
+ }
236
+ });
237
+ this.resizeObserver.observe(this.core.el);
238
+ }
239
+ }
240
+ /** Adopt the core's current trigger list into the layout. */
241
+ collectTriggers() {
242
+ this.triggers = Array.prototype.slice.call(this.core.items);
243
+ this.triggers.forEach((trigger) => {
244
+ if (!this.originalTriggerStyles.has(trigger)) {
245
+ this.originalTriggerStyles.set(
246
+ trigger,
247
+ trigger.getAttribute("style") || ""
248
+ );
249
+ }
250
+ trigger.classList.add("lg-justified-item");
251
+ });
252
+ }
253
+ /** Best-known aspect ratio per trigger; unknowns resolve on load. */
254
+ resolveRatios() {
255
+ this.ratios = this.triggers.map((trigger, index) => {
256
+ const size = parseImageSize(
257
+ trigger.getAttribute("data-lg-size") || void 0,
258
+ window.innerWidth
259
+ );
260
+ if (size) {
261
+ return size.width / size.height;
262
+ }
263
+ const img = trigger.querySelector("img");
264
+ if (!img) {
265
+ return 1;
266
+ }
267
+ const width = parseInt(img.getAttribute("width") || "", 10);
268
+ const height = parseInt(img.getAttribute("height") || "", 10);
269
+ if (width > 0 && height > 0) {
270
+ return width / height;
271
+ }
272
+ if (img.complete && img.naturalWidth > 0) {
273
+ return img.naturalWidth / img.naturalHeight;
274
+ }
275
+ this.watchImageLoad(img, index);
276
+ return null;
277
+ });
278
+ }
279
+ /** Relayout once when the last unknown thumbnail resolves. */
280
+ watchImageLoad(img, index) {
281
+ const cancel = () => {
282
+ img.removeEventListener("load", onDone);
283
+ img.removeEventListener("error", onDone);
284
+ };
285
+ const onDone = () => {
286
+ cancel();
287
+ this.pendingLoads = this.pendingLoads.filter((c) => c !== cancel);
288
+ this.ratios[index] = img.naturalWidth > 0 ? img.naturalWidth / img.naturalHeight : 1;
289
+ if (this.ratios.every((ratio) => ratio !== null)) {
290
+ this.layout();
291
+ }
292
+ };
293
+ img.addEventListener("load", onDone);
294
+ img.addEventListener("error", onDone);
295
+ this.pendingLoads.push(cancel);
296
+ }
297
+ layout() {
298
+ const containerWidth = this.core.el.clientWidth;
299
+ if (!containerWidth) {
300
+ return;
301
+ }
302
+ this.layoutWidth = containerWidth;
303
+ const { boxes, containerHeight } = getJustifiedLayout({
304
+ // Unknown ratios render square until their image resolves.
305
+ ratios: this.ratios.map((ratio) => ratio != null ? ratio : 1),
306
+ containerWidth,
307
+ targetRowHeight: this.settings.justifiedRowHeight,
308
+ gap: this.settings.justifiedGap,
309
+ lastRow: this.settings.justifiedLastRow,
310
+ maxScale: this.settings.justifiedMaxScale
311
+ });
312
+ const startSide = this.core.settings.direction === "rtl" ? "right" : "left";
313
+ const endSide = startSide === "left" ? "right" : "left";
314
+ this.core.el.style.height = `${containerHeight}px`;
315
+ this.triggers.forEach((trigger, index) => {
316
+ const box = boxes[index];
317
+ const hidden = box.width === 0 && box.height === 0;
318
+ trigger.classList.toggle("lg-justified-item-hidden", hidden);
319
+ if (hidden) {
320
+ return;
321
+ }
322
+ trigger.style.top = `${box.top}px`;
323
+ trigger.style[startSide] = `${box.start}px`;
324
+ trigger.style[endSide] = "auto";
325
+ trigger.style.width = `${box.width}px`;
326
+ trigger.style.height = `${box.height}px`;
327
+ const img = trigger.querySelector("img");
328
+ if (img && img.hasAttribute("srcset")) {
329
+ img.setAttribute("sizes", `${box.width}px`);
330
+ }
331
+ this.watchLoad(trigger, img);
332
+ });
333
+ this.rows = getJustifiedRows(boxes).map(
334
+ (row) => row.map((index) => this.triggers[index])
335
+ );
336
+ this.reveal();
337
+ }
338
+ /** Track when the trigger's thumbnail has settled (loaded or failed). */
339
+ watchLoad(trigger, img) {
340
+ if (this.loaded.has(trigger) || this.loadWatchers.has(trigger)) {
341
+ return;
342
+ }
343
+ if (!img || img.complete) {
344
+ this.loaded.add(trigger);
345
+ return;
346
+ }
347
+ const onDone = () => {
348
+ cancel();
349
+ this.loaded.add(trigger);
350
+ this.reveal();
351
+ };
352
+ const cancel = () => {
353
+ img.removeEventListener("load", onDone);
354
+ img.removeEventListener("error", onDone);
355
+ this.loadWatchers.delete(trigger);
356
+ };
357
+ img.addEventListener("load", onDone);
358
+ img.addEventListener("error", onDone);
359
+ this.loadWatchers.set(trigger, cancel);
360
+ }
361
+ /**
362
+ * Fade in what may show now (see `justifiedReveal`). Never re-hides:
363
+ * a relayout regroups the rows, already visible triggers stay.
364
+ */
365
+ reveal() {
366
+ getRevealableItems(
367
+ this.rows,
368
+ (trigger) => this.loaded.has(trigger),
369
+ this.settings.justifiedReveal
370
+ ).forEach((trigger) => {
371
+ trigger.classList.add("lg-justified-item-visible");
372
+ });
373
+ }
374
+ cancelLoadWatchers() {
375
+ Array.from(this.loadWatchers.values()).forEach((cancel) => cancel());
376
+ }
377
+ closeGallery() {
378
+ }
379
+ destroy() {
380
+ var _a;
381
+ (_a = this.resizeObserver) == null ? void 0 : _a.disconnect();
382
+ this.pendingLoads.forEach((cancel) => cancel());
383
+ this.pendingLoads = [];
384
+ this.cancelLoadWatchers();
385
+ this.loaded.clear();
386
+ this.rows = [];
387
+ if (!this.triggers.length) {
388
+ return;
389
+ }
390
+ this.core.LGel.off(".justified");
391
+ this.core.el.classList.remove("lg-justified", "lg-justified-reveal");
392
+ if (this.originalContainerStyle) {
393
+ this.core.el.setAttribute("style", this.originalContainerStyle);
394
+ } else {
395
+ this.core.el.removeAttribute("style");
396
+ }
397
+ this.triggers.forEach((trigger) => {
398
+ trigger.classList.remove(
399
+ "lg-justified-item",
400
+ "lg-justified-item-hidden",
401
+ "lg-justified-item-visible"
402
+ );
403
+ const original = this.originalTriggerStyles.get(trigger);
404
+ if (original) {
405
+ trigger.setAttribute("style", original);
406
+ } else {
407
+ trigger.removeAttribute("style");
408
+ }
409
+ });
410
+ }
411
+ }
412
+ export {
413
+ Justified as default
414
+ };
415
+ //# sourceMappingURL=lg-justified.es5.js.map