trestle 0.9.9 → 0.10.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +31 -3
  3. data/.gitignore +3 -0
  4. data/Gemfile +5 -1
  5. data/README.md +2 -1
  6. data/app/assets/bundle/trestle/admin.css +23 -0
  7. data/app/assets/bundle/trestle/admin.js +83 -0
  8. data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
  9. data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
  10. data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
  11. data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
  12. data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
  13. data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
  14. data/app/assets/bundle/trestle/locale/cs.js +110 -0
  15. data/app/assets/bundle/trestle/locale/de.js +116 -0
  16. data/app/assets/bundle/trestle/locale/en.js +329 -0
  17. data/app/assets/bundle/trestle/locale/es-MX.js +109 -0
  18. data/app/assets/bundle/trestle/locale/es.js +109 -0
  19. data/app/assets/bundle/trestle/locale/fr.js +111 -0
  20. data/app/assets/bundle/trestle/locale/ko.js +111 -0
  21. data/app/assets/bundle/trestle/locale/lv.js +109 -0
  22. data/app/assets/bundle/trestle/locale/nl.js +96 -0
  23. data/app/assets/bundle/trestle/locale/pl.js +99 -0
  24. data/app/assets/bundle/trestle/locale/pt-BR.js +98 -0
  25. data/app/assets/bundle/trestle/locale/vi.js +116 -0
  26. data/app/assets/bundle/trestle/locale/zh-CN.js +109 -0
  27. data/app/assets/bundle/trestle/photoswipe-7aa1aec9c3c1fd65c382.digested.js +6 -0
  28. data/app/assets/sprockets/trestle/custom.css +1 -0
  29. data/app/assets/sprockets/trestle/icons/font-awesome.css.erb +32 -0
  30. data/app/assets/sprockets/trestle/manifest.js +4 -0
  31. data/app/assets/stylesheets/trestle/custom.css +6 -1
  32. data/app/controllers/concerns/trestle/controller/helpers.rb +2 -0
  33. data/app/controllers/concerns/trestle/controller/location.rb +1 -6
  34. data/app/controllers/concerns/trestle/controller/modal.rb +23 -0
  35. data/app/controllers/concerns/trestle/controller/turbo.rb +21 -0
  36. data/app/controllers/concerns/trestle/resource/controller/actions.rb +39 -28
  37. data/app/controllers/concerns/trestle/resource/controller/redirection.rb +5 -5
  38. data/app/controllers/trestle/application_controller.rb +2 -1
  39. data/app/helpers/trestle/flash_helper.rb +10 -0
  40. data/app/helpers/trestle/form_helper.rb +3 -2
  41. data/app/helpers/trestle/format_helper.rb +2 -1
  42. data/app/helpers/trestle/i18n_helper.rb +46 -7
  43. data/app/helpers/trestle/modal_helper.rb +34 -0
  44. data/app/helpers/trestle/tab_helper.rb +1 -1
  45. data/app/helpers/trestle/turbo_frame_helper.rb +34 -0
  46. data/app/helpers/trestle/url_helper.rb +7 -4
  47. data/app/views/layouts/trestle/admin.html.erb +16 -18
  48. data/app/views/layouts/trestle/admin.turbo_stream.erb +11 -0
  49. data/app/views/layouts/trestle/modal.html.erb +5 -0
  50. data/app/views/trestle/_i18n.html.erb +12 -0
  51. data/app/views/trestle/_theme.html.erb +15 -0
  52. data/app/views/trestle/application/_header.html.erb +1 -1
  53. data/app/views/trestle/application/_layout.html.erb +6 -3
  54. data/app/views/trestle/application/_modal.html.erb +36 -0
  55. data/app/views/trestle/application/_tabs.html.erb +4 -4
  56. data/app/views/trestle/flash/_alert.html.erb +1 -1
  57. data/app/views/trestle/flash/_debug.html.erb +1 -1
  58. data/app/views/trestle/resource/_form.html.erb +5 -0
  59. data/app/views/trestle/resource/create.turbo_stream.erb +5 -0
  60. data/app/views/trestle/resource/destroy.turbo_stream.erb +1 -0
  61. data/app/views/trestle/resource/edit.html.erb +4 -2
  62. data/app/views/trestle/resource/index.html.erb +12 -10
  63. data/app/views/trestle/resource/new.html.erb +4 -2
  64. data/app/views/trestle/resource/show.html.erb +4 -2
  65. data/app/views/trestle/resource/update.turbo_stream.erb +5 -0
  66. data/app/views/trestle/shared/_sidebar.html.erb +9 -9
  67. data/frontend/css/components/_alerts.scss +19 -17
  68. data/frontend/css/components/_background.scss +7 -35
  69. data/frontend/css/components/_badges.scss +31 -0
  70. data/frontend/css/components/_breadcrumbs.scss +4 -4
  71. data/frontend/css/components/_buttons.scss +5 -4
  72. data/frontend/css/components/_datepicker.scss +12 -8
  73. data/frontend/css/components/_dropdown.scss +23 -3
  74. data/frontend/css/components/{_fields.scss → _forms.scss} +16 -3
  75. data/frontend/css/components/_media-grid.scss +52 -44
  76. data/frontend/css/components/_modal.scss +33 -4
  77. data/frontend/css/components/_pagination.scss +1 -1
  78. data/frontend/css/components/_photoswipe.scss +8 -0
  79. data/frontend/css/components/_popover.scss +1 -0
  80. data/frontend/css/components/_scopes.scss +1 -1
  81. data/frontend/css/components/_select.scss +161 -31
  82. data/frontend/css/components/_table.scss +60 -65
  83. data/frontend/css/components/_tabs.scss +10 -3
  84. data/frontend/css/components/_tags.scss +71 -16
  85. data/frontend/css/components/_toolbars.scss +16 -11
  86. data/frontend/css/components/_turbo.scss +3 -0
  87. data/frontend/css/core/_bootstrap.scss +46 -0
  88. data/frontend/css/core/_dependencies.scss +4 -3
  89. data/frontend/css/core/_functions.scss +39 -0
  90. data/frontend/css/core/_mixins.scss +2 -36
  91. data/frontend/css/core/_theme.scss +258 -0
  92. data/frontend/css/core/_typography.scss +10 -1
  93. data/frontend/css/icons/_fontawesome.scss +3 -15
  94. data/frontend/css/index.scss +12 -6
  95. data/frontend/css/layout/_base.scss +3 -3
  96. data/frontend/css/layout/_content.scss +10 -6
  97. data/frontend/css/layout/_footer.scss +1 -1
  98. data/frontend/css/layout/_header.scss +5 -3
  99. data/frontend/css/layout/_navigation.scss +2 -2
  100. data/frontend/css/layout/_sidebar.scss +19 -9
  101. data/frontend/css/support/_sprockets.scss +2 -0
  102. data/frontend/css/support/_webpack.scss +2 -0
  103. data/frontend/css/variables/_bootstrap.scss +134 -40
  104. data/frontend/css/variables/_maps.scss +15 -0
  105. data/frontend/css/variables/_trestle.scss +55 -26
  106. data/frontend/js/controllers/application_controller.js +17 -0
  107. data/frontend/js/controllers/checkbox_select_controller.js +43 -0
  108. data/frontend/js/controllers/confirm_controller.js +115 -0
  109. data/frontend/js/controllers/confirm_delete_controller.js +11 -0
  110. data/frontend/js/controllers/datepicker_controller.js +12 -0
  111. data/frontend/js/controllers/datetimepicker_controller.js +13 -0
  112. data/frontend/js/controllers/deprecated/init_controller.js +9 -0
  113. data/frontend/js/controllers/flatpickr_controller.js +50 -0
  114. data/frontend/js/controllers/follow_url_controller.js +36 -0
  115. data/frontend/js/controllers/form_error_controller.js +24 -0
  116. data/frontend/js/controllers/form_loading_controller.js +50 -0
  117. data/frontend/js/controllers/gallery_controller.js +10 -0
  118. data/frontend/js/controllers/index.js +19 -0
  119. data/frontend/js/controllers/keyboard_submit_controller.js +25 -0
  120. data/frontend/js/controllers/lightbox_controller.js +160 -0
  121. data/frontend/js/controllers/mobile_sidebar_controller.js +30 -0
  122. data/frontend/js/controllers/modal_controller.js +36 -0
  123. data/frontend/js/controllers/modal_frame_controller.js +11 -0
  124. data/frontend/js/controllers/modal_trigger_controller.js +74 -0
  125. data/frontend/js/{components/navigation.js → controllers/navigation_controller.js} +14 -10
  126. data/frontend/js/controllers/navigation_tooltip_controller.js +32 -0
  127. data/frontend/js/controllers/popover_controller.js +87 -0
  128. data/frontend/js/controllers/reloadable_controller.js +34 -0
  129. data/frontend/js/controllers/select_controller.js +49 -0
  130. data/frontend/js/controllers/sidebar_controller.js +33 -0
  131. data/frontend/js/controllers/tab_errors_controller.js +45 -0
  132. data/frontend/js/controllers/tabs_controller.js +45 -0
  133. data/frontend/js/controllers/timepicker_controller.js +14 -0
  134. data/frontend/js/controllers/toggle_attr_controller.js +27 -0
  135. data/frontend/js/controllers/toggle_class_controller.js +27 -0
  136. data/frontend/js/controllers/tooltip_controller.js +13 -0
  137. data/frontend/js/controllers/wrapper_controller.js +43 -0
  138. data/frontend/js/core/backdrop.js +100 -0
  139. data/frontend/js/core/error_modal.js +65 -0
  140. data/frontend/js/core/fetch.js +32 -0
  141. data/frontend/js/core/i18n.js +24 -10
  142. data/frontend/js/core/modal.js +52 -0
  143. data/frontend/js/core/stream_actions.js +56 -0
  144. data/frontend/js/core/turbo_errors.js +9 -0
  145. data/frontend/js/{core → deprecated}/events.js +1 -8
  146. data/frontend/js/deprecated/tooltip.js +8 -0
  147. data/frontend/js/index.js +28 -40
  148. data/frontend/js/mixins/index.js +5 -0
  149. data/frontend/js/mixins/photoswipe.js +10 -0
  150. data/frontend/js/util/bootstrap.js +93 -0
  151. data/i18n/config.yml +14 -0
  152. data/i18n/environment.rb +8 -0
  153. data/i18n/export +3 -0
  154. data/i18n/template.erb +1 -0
  155. data/lib/generators/trestle/install/install_generator.rb +3 -8
  156. data/lib/generators/trestle/install/templates/trestle.rb.erb +5 -5
  157. data/lib/trestle/color.rb +113 -0
  158. data/lib/trestle/configuration.rb +16 -8
  159. data/lib/trestle/engine.rb +23 -17
  160. data/lib/trestle/form/fields/check_box_helpers.rb +7 -18
  161. data/lib/trestle/form/fields/collection_select.rb +1 -1
  162. data/lib/trestle/form/fields/color_field.rb +4 -0
  163. data/lib/trestle/form/fields/date_field.rb +4 -0
  164. data/lib/trestle/form/fields/date_picker.rb +10 -4
  165. data/lib/trestle/form/fields/date_select.rb +1 -1
  166. data/lib/trestle/form/fields/datetime_field.rb +4 -0
  167. data/lib/trestle/form/fields/datetime_select.rb +1 -1
  168. data/lib/trestle/form/fields/file_field.rb +3 -28
  169. data/lib/trestle/form/fields/form_control.rb +2 -2
  170. data/lib/trestle/form/fields/form_group.rb +1 -1
  171. data/lib/trestle/form/fields/grouped_collection_select.rb +1 -1
  172. data/lib/trestle/form/fields/radio_button_helpers.rb +5 -17
  173. data/lib/trestle/form/fields/range_field.rb +1 -5
  174. data/lib/trestle/form/fields/select.rb +17 -1
  175. data/lib/trestle/form/fields/time_field.rb +4 -0
  176. data/lib/trestle/form/fields/time_select.rb +1 -1
  177. data/lib/trestle/form/fields/time_zone_select.rb +1 -1
  178. data/lib/trestle/form/renderer.rb +3 -0
  179. data/lib/trestle/form.rb +16 -1
  180. data/lib/trestle/resource/toolbar.rb +2 -2
  181. data/lib/trestle/table/actions_column.rb +2 -2
  182. data/lib/trestle/table/row.rb +2 -1
  183. data/lib/trestle/table/select_column.rb +3 -6
  184. data/lib/trestle/table.rb +6 -1
  185. data/lib/trestle/toolbar/item.rb +1 -1
  186. data/lib/trestle/toolbar/menu.rb +3 -6
  187. data/lib/trestle/version.rb +1 -1
  188. data/lib/trestle.rb +2 -23
  189. data/package.json +31 -27
  190. data/trestle.gemspec +2 -3
  191. data/webpack.config.js +10 -10
  192. data/yarn.lock +1456 -1194
  193. metadata +166 -164
  194. data/app/assets/bundle/trestle/bundle.css +0 -12
  195. data/app/assets/bundle/trestle/bundle.js +0 -89
  196. data/app/assets/bundle/trestle/fa-brands-400.eot +0 -0
  197. data/app/assets/bundle/trestle/fa-brands-400.svg +0 -3717
  198. data/app/assets/bundle/trestle/fa-brands-400.woff +0 -0
  199. data/app/assets/bundle/trestle/fa-regular-400.eot +0 -0
  200. data/app/assets/bundle/trestle/fa-regular-400.svg +0 -801
  201. data/app/assets/bundle/trestle/fa-regular-400.woff +0 -0
  202. data/app/assets/bundle/trestle/fa-solid-900.eot +0 -0
  203. data/app/assets/bundle/trestle/fa-solid-900.svg +0 -5034
  204. data/app/assets/bundle/trestle/fa-solid-900.woff +0 -0
  205. data/app/assets/javascripts/trestle/admin.js +0 -3
  206. data/app/assets/javascripts/trestle/i18n.js.erb +0 -8
  207. data/app/assets/stylesheets/trestle/admin.css +0 -2
  208. data/app/assets/stylesheets/trestle/icons/_font-awesome.css.erb +0 -40
  209. data/app/controllers/concerns/trestle/controller/dialog.rb +0 -16
  210. data/app/views/trestle/application/_dialog.html.erb +0 -34
  211. data/frontend/css/components/_color-vars.scss +0 -10
  212. data/frontend/css/components/_custom-forms.scss +0 -35
  213. data/frontend/css/components/_magnific-popup.scss +0 -36
  214. data/frontend/css/components/_turbolinks.scss +0 -3
  215. data/frontend/js/components/confirmation.js +0 -32
  216. data/frontend/js/components/datepicker.js +0 -69
  217. data/frontend/js/components/dialog.js +0 -149
  218. data/frontend/js/components/file.js +0 -7
  219. data/frontend/js/components/form.js +0 -100
  220. data/frontend/js/components/gallery.js +0 -33
  221. data/frontend/js/components/pagination.js +0 -51
  222. data/frontend/js/components/select.js +0 -18
  223. data/frontend/js/components/sidebar.js +0 -75
  224. data/frontend/js/components/table.js +0 -61
  225. data/frontend/js/components/tabs.js +0 -59
  226. data/frontend/js/components/tooltips.js +0 -25
  227. data/frontend/js/core/contexts.js +0 -17
  228. data/frontend/js/core/turbolinks.js +0 -3
  229. data/frontend/js/core/visit.js +0 -16
  230. data/frontend/theme/trestle/_theme.scss +0 -4
  231. data/frontend/theme/trestle/_variables.scss +0 -4
  232. data/frontend/theme/trestle/theme/_defaults.scss +0 -152
  233. data/frontend/theme/trestle/theme/_functions.scss +0 -44
  234. data/frontend/theme/trestle/theme/_variables.scss +0 -15
  235. data/frontend/theme/trestle/theme/bootstrap/_alert.scss +0 -19
  236. data/frontend/theme/trestle/theme/bootstrap/_badge.scss +0 -25
  237. data/frontend/theme/trestle/theme/bootstrap/_buttons.scss +0 -93
  238. data/frontend/theme/trestle/theme/bootstrap/_color-vars.scss +0 -11
  239. data/frontend/theme/trestle/theme/bootstrap/_custom-forms.scss +0 -93
  240. data/frontend/theme/trestle/theme/bootstrap/_dropdown.scss +0 -6
  241. data/frontend/theme/trestle/theme/bootstrap/_forms.scss +0 -6
  242. data/frontend/theme/trestle/theme/bootstrap/_links.scss +0 -7
  243. data/frontend/theme/trestle/theme/bootstrap/_list-group.scss +0 -31
  244. data/frontend/theme/trestle/theme/bootstrap/_nav.scss +0 -6
  245. data/frontend/theme/trestle/theme/bootstrap/_pagination.scss +0 -18
  246. data/frontend/theme/trestle/theme/bootstrap/_progress.scss +0 -3
  247. data/frontend/theme/trestle/theme/bootstrap/_tables.scss +0 -41
  248. data/frontend/theme/trestle/theme/bootstrap/_utilities.scss +0 -3
  249. data/frontend/theme/trestle/theme/bootstrap/utilities/_background.scss +0 -17
  250. data/frontend/theme/trestle/theme/bootstrap/utilities/_borders.scss +0 -5
  251. data/frontend/theme/trestle/theme/bootstrap/utilities/_text.scss +0 -18
  252. data/frontend/theme/trestle/theme/trestle/_background.scss +0 -61
  253. data/frontend/theme/trestle/theme/trestle/_datepicker.scss +0 -58
  254. data/frontend/theme/trestle/theme/trestle/_headers.scss +0 -4
  255. data/frontend/theme/trestle/theme/trestle/_navbar.scss +0 -15
  256. data/frontend/theme/trestle/theme/trestle/_navigation.scss +0 -5
  257. data/frontend/theme/trestle/theme/trestle/_select2.scss +0 -22
  258. data/frontend/theme/trestle/theme/trestle/_tags.scss +0 -12
  259. data/frontend/theme/trestle/theme/trestle/_turbolinks.scss +0 -3
  260. data/frontend/theme/trestle/theme.scss +0 -29
  261. data/lib/generators/trestle/install/templates/_theme.scss +0 -13
  262. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar-dz.js +0 -0
  263. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ar.js +0 -0
  264. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/at.js +0 -0
  265. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/az.js +0 -0
  266. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/be.js +0 -0
  267. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bg.js +0 -0
  268. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bn.js +0 -0
  269. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/bs.js +0 -0
  270. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cat.js +0 -0
  271. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ckb.js +0 -0
  272. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cs.js +0 -0
  273. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/cy.js +0 -0
  274. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/da.js +0 -0
  275. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/de.js +0 -0
  276. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/default.js +0 -0
  277. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/eo.js +0 -0
  278. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/es.js +0 -0
  279. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/et.js +0 -0
  280. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fa.js +0 -0
  281. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fi.js +0 -0
  282. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fo.js +0 -0
  283. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/fr.js +0 -0
  284. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ga.js +0 -0
  285. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/gr.js +0 -0
  286. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/he.js +0 -0
  287. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hi.js +0 -0
  288. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hr.js +0 -0
  289. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hu.js +0 -0
  290. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/hy.js +0 -0
  291. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/id.js +0 -0
  292. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/is.js +0 -0
  293. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/it.js +0 -0
  294. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ja.js +0 -0
  295. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ka.js +0 -0
  296. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/km.js +0 -0
  297. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ko.js +0 -0
  298. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/kz.js +0 -0
  299. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lt.js +0 -0
  300. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/lv.js +0 -0
  301. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mk.js +0 -0
  302. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/mn.js +0 -0
  303. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ms.js +0 -0
  304. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/my.js +0 -0
  305. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nl.js +0 -0
  306. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/nn.js +0 -0
  307. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/no.js +0 -0
  308. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pa.js +0 -0
  309. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pl.js +0 -0
  310. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/pt.js +0 -0
  311. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ro.js +0 -0
  312. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/ru.js +0 -0
  313. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/si.js +0 -0
  314. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sk.js +0 -0
  315. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sl.js +0 -0
  316. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sq.js +0 -0
  317. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr-cyr.js +0 -0
  318. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sr.js +0 -0
  319. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/sv.js +0 -0
  320. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/th.js +0 -0
  321. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/tr.js +0 -0
  322. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uk.js +0 -0
  323. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz.js +0 -0
  324. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/uz_latn.js +0 -0
  325. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/vn.js +0 -0
  326. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh-tw.js +0 -0
  327. /data/app/assets/bundle/trestle/{flatpickr → locale/flatpickr}/zh.js +0 -0
  328. /data/app/assets/{stylesheets → sprockets}/trestle/_custom.css +0 -0
@@ -0,0 +1,98 @@
1
+ Trestle.i18n.store({
2
+ "pt-BR": {
3
+ "admin": {
4
+ "breadcrumbs": {
5
+ "home": "Home"
6
+ },
7
+ "buttons": {
8
+ "delete": "Excluir %{model_name}",
9
+ "new": "Novo %{model_name}",
10
+ "save": "Salvar %{model_name}"
11
+ },
12
+ "flash": {
13
+ "create": {
14
+ "failure": {
15
+ "message": "Por favor corrija os erros abaixo.",
16
+ "title": "Atenção!"
17
+ },
18
+ "success": {
19
+ "message": "O %{model_name} foi criado com sucesso.",
20
+ "title": "Sucesso!"
21
+ }
22
+ },
23
+ "destroy": {
24
+ "failure": {
25
+ "message": "Falha ao excluir %{model_name}.",
26
+ "title": "Atenção!"
27
+ },
28
+ "success": {
29
+ "message": "O %{model_name} foi deletado com sucesso.",
30
+ "title": "Sucesso!"
31
+ }
32
+ },
33
+ "update": {
34
+ "failure": {
35
+ "message": "Por favor corrija os erros abaixo.",
36
+ "title": "Atenção!"
37
+ },
38
+ "success": {
39
+ "message": "O %{model_name} foi atualizado com sucesso.",
40
+ "title": "Sucesso!"
41
+ }
42
+ }
43
+ },
44
+ "form": {
45
+ "select": {
46
+ "prompt": "- Selecione %{attribute_name} -"
47
+ }
48
+ },
49
+ "format": {
50
+ "blank": "Nenhum"
51
+ },
52
+ "table": {
53
+ "headers": {
54
+ "id": "ID"
55
+ }
56
+ },
57
+ "titles": {
58
+ "edit": "Editando %{model_name}",
59
+ "index": "Listando %{pluralized_model_name}",
60
+ "new": "Novo %{model_name}"
61
+ }
62
+ },
63
+ "trestle": {
64
+ "confirmation": {
65
+ "cancel": "Cancelar",
66
+ "delete": "Excluir",
67
+ "title": "Você tem certeza?"
68
+ },
69
+ "footer": "Powered by Trestle",
70
+ "helpers": {
71
+ "page_entries_info": {
72
+ "more_pages": {
73
+ "display_entries": "Mostrando %{entry_name} <strong>%{first}&nbsp;-&nbsp;%{last}</strong> de <b>%{total}</b>"
74
+ },
75
+ "one_page": {
76
+ "display_entries": {
77
+ "one": "Mostrando <strong>1</strong> %{entry_name}",
78
+ "other": "Mostrando <strong>all %{count}</strong> %{entry_name}",
79
+ "zero": "Nenhum %{entry_name} encontrado"
80
+ }
81
+ }
82
+ }
83
+ },
84
+ "onboarding": {
85
+ "no_admins": "Para começar, crie um admin dentro de <code>app/admin</code>.",
86
+ "no_form": "Defina um bloco de formulário ou crie um <code>_form.html</code> parcial.",
87
+ "no_template": "Para personalizar este template, crie <code>%{path}</code>.",
88
+ "welcome": "Bem-vindo ao Trestle"
89
+ },
90
+ "title": "Trestle Admin",
91
+ "ui": {
92
+ "toggle_navigation": "Alternar naveção",
93
+ "toggle_sidebar": "Alternar barra lateral"
94
+ },
95
+ "version": "Versão"
96
+ }
97
+ }
98
+ });
@@ -0,0 +1,116 @@
1
+ Trestle.i18n.store({
2
+ "vi": {
3
+ "admin": {
4
+ "breadcrumbs": {
5
+ "home": "Trang Chủ"
6
+ },
7
+ "buttons": {
8
+ "delete": "Xoá %{model_name}",
9
+ "edit": "Chỉnh sửa %{model_name}",
10
+ "new": "Tạo mới %{model_name}",
11
+ "ok": "Đồng ý",
12
+ "save": "Lưu %{model_name}",
13
+ "show": "Xem %{model_name}"
14
+ },
15
+ "datepicker": {
16
+ "formats": {
17
+ "date": "m/d/Y",
18
+ "datetime": "m/d/Y h:i K",
19
+ "time": "h:i K"
20
+ }
21
+ },
22
+ "flash": {
23
+ "create": {
24
+ "failure": {
25
+ "message": "Vui lòng chính xác các thông tin bên dưới!",
26
+ "title": "Cảnh báo!"
27
+ },
28
+ "success": {
29
+ "message": "%{lowercase_model_name} được tạo mới thành công!",
30
+ "title": "Thành công!"
31
+ }
32
+ },
33
+ "destroy": {
34
+ "failure": {
35
+ "message": "Không thể xoá %{lowercase_model_name}.",
36
+ "title": "Cảnh báo!"
37
+ },
38
+ "success": {
39
+ "message": "%{lowercase_model_name} đã được xoá thành công!",
40
+ "title": "Thành công!"
41
+ }
42
+ },
43
+ "update": {
44
+ "failure": {
45
+ "message": "Vui lòng chính xác các thông tin bên dưới!.",
46
+ "title": "Cảnh báo!"
47
+ },
48
+ "success": {
49
+ "message": "%{lowercase_model_name} đã được cập nhật thành công!",
50
+ "title": "Thành công!"
51
+ }
52
+ }
53
+ },
54
+ "form": {
55
+ "select": {
56
+ "prompt": "- Chọn %{attribute_name} -"
57
+ }
58
+ },
59
+ "format": {
60
+ "blank": "Chưa có"
61
+ },
62
+ "table": {
63
+ "headers": {
64
+ "id": "ID"
65
+ }
66
+ },
67
+ "titles": {
68
+ "edit": "Chỉnh sửa %{model_name}",
69
+ "index": "Danh sách %{pluralized_model_name}",
70
+ "new": "Tạo mới %{model_name}"
71
+ }
72
+ },
73
+ "trestle": {
74
+ "confirmation": {
75
+ "cancel": "Huỷ",
76
+ "delete": "Xoá",
77
+ "title": "Bạn có chắc?"
78
+ },
79
+ "dialog": {
80
+ "error": "Yêu cầu chưa hoàn thành."
81
+ },
82
+ "file": {
83
+ "browse": "Tải lên",
84
+ "choose_file": "Chọn tập tin..."
85
+ },
86
+ "footer": "Powered by Trestle",
87
+ "helpers": {
88
+ "page_entries_info": {
89
+ "more_pages": {
90
+ "display_entries": "Hiển thị %{entry_name} <strong>%{first}&nbsp;-&nbsp;%{last}</strong> của <b>%{total}</b>"
91
+ },
92
+ "one_page": {
93
+ "display_entries": {
94
+ "one": "Hiển thị <strong>1</strong> %{entry_name}",
95
+ "other": "Hiển thị <strong>tất cả %{count}</strong> %{entry_name}",
96
+ "zero": "Không có %{entry_name} được tìm thấy"
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "onboarding": {
102
+ "no_admins": "To begin, please create an admin within <code>app/admin</code>.",
103
+ "no_form": "Please define a form block or create a <code>_form.html</code> partial.",
104
+ "no_template": "To customize this template, please create <code>%{path}</code>.",
105
+ "welcome": "Welcome to Trestle"
106
+ },
107
+ "title": "Trestle Admin",
108
+ "ui": {
109
+ "toggle_dropdown": "Toggle dropdown",
110
+ "toggle_navigation": "Toggle navigation",
111
+ "toggle_sidebar": "Toggle sidebar"
112
+ },
113
+ "version": "Version"
114
+ }
115
+ }
116
+ });
@@ -0,0 +1,109 @@
1
+ Trestle.i18n.store({
2
+ "zh-CN": {
3
+ "admin": {
4
+ "breadcrumbs": {
5
+ "home": "首页"
6
+ },
7
+ "buttons": {
8
+ "delete": "删除%{model_name}",
9
+ "new": "新建%{model_name}",
10
+ "ok": "确定",
11
+ "save": "保存%{model_name}"
12
+ },
13
+ "datepicker": {
14
+ "formats": {
15
+ "date": "Y年m月d日",
16
+ "datetime": "Y年m月d日 H:i",
17
+ "time": "H:i"
18
+ }
19
+ },
20
+ "flash": {
21
+ "create": {
22
+ "failure": {
23
+ "message": "请修正以下错误。",
24
+ "title": "警告!"
25
+ },
26
+ "success": {
27
+ "message": "%{lowercase_model_name}创建成功。",
28
+ "title": "成功!"
29
+ }
30
+ },
31
+ "destroy": {
32
+ "failure": {
33
+ "message": "不能删除%{lowercase_model_name}。",
34
+ "title": "警告!"
35
+ },
36
+ "success": {
37
+ "message": "%{lowercase_model_name}删除成功。",
38
+ "title": "成功!"
39
+ }
40
+ },
41
+ "update": {
42
+ "failure": {
43
+ "message": "请修正以下错误。",
44
+ "title": "警告!"
45
+ },
46
+ "success": {
47
+ "message": "%{lowercase_model_name}更新成功。",
48
+ "title": "成功!"
49
+ }
50
+ }
51
+ },
52
+ "form": {
53
+ "select": {
54
+ "prompt": "- 选择%{attribute_name} -"
55
+ }
56
+ },
57
+ "format": {
58
+ "blank": "无"
59
+ },
60
+ "table": {
61
+ "headers": {
62
+ "id": "ID"
63
+ }
64
+ },
65
+ "titles": {
66
+ "edit": "编辑%{model_name}",
67
+ "index": "%{pluralized_model_name}列表",
68
+ "new": "新建%{model_name}"
69
+ }
70
+ },
71
+ "trestle": {
72
+ "confirmation": {
73
+ "cancel": "取消",
74
+ "delete": "删除",
75
+ "title": "真的要删除吗?"
76
+ },
77
+ "dialog": {
78
+ "error": "无法完成该请求。"
79
+ },
80
+ "footer": "由 Trestle 强力驱动",
81
+ "helpers": {
82
+ "page_entries_info": {
83
+ "more_pages": {
84
+ "display_entries": "显示 %{entry_name} <strong>%{first}&nbsp;-&nbsp;%{last}</strong>,总共 <b>%{total} 条记录</b>"
85
+ },
86
+ "one_page": {
87
+ "display_entries": {
88
+ "one": "已显示 <strong>1</strong> 条%{entry_name}记录",
89
+ "other": "已显示<strong>全部 %{count}</strong> 条%{entry_name}记录",
90
+ "zero": "没找到%{entry_name}"
91
+ }
92
+ }
93
+ }
94
+ },
95
+ "onboarding": {
96
+ "no_admins": "要开始使用,请在 <code>app/admin</code> 里创建管理资源。",
97
+ "no_form": "请定义一个表单块或者创建一个 <code>_form.html</code> 文件。",
98
+ "no_template": "要自定义此模板,请创建 <code>%{path}</code>。",
99
+ "welcome": "欢迎使用 Trestle"
100
+ },
101
+ "title": "Trestle Admin",
102
+ "ui": {
103
+ "toggle_navigation": "打开/隐藏导航",
104
+ "toggle_sidebar": "打开/隐藏侧边栏"
105
+ },
106
+ "version": "版本"
107
+ }
108
+ }
109
+ });
@@ -0,0 +1,6 @@
1
+ "use strict";(self.webpackChunkTrestle=self.webpackChunkTrestle||[]).push([[641],{8300:function(t,i,e){
2
+ /*!
3
+ * PhotoSwipe 5.4.4 - https://photoswipe.com
4
+ * (c) 2024 Dmytro Semenov
5
+ */
6
+ function s(t,i,e){const s=document.createElement(i);return t&&(s.className=t),e&&e.appendChild(s),s}function n(t,i){return t.x=i.x,t.y=i.y,void 0!==i.id&&(t.id=i.id),t}function o(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function a(t,i){const e=Math.abs(t.x-i.x),s=Math.abs(t.y-i.y);return Math.sqrt(e*e+s*s)}function h(t,i){return t.x===i.x&&t.y===i.y}function r(t,i,e){return Math.min(Math.max(t,i),e)}function l(t,i,e){let s=`translate3d(${t}px,${i||0}px,0)`;return void 0!==e&&(s+=` scale3d(${e},${e},1)`),s}function p(t,i,e,s){t.style.transform=l(i,e,s)}e.r(i),e.d(i,{default:function(){return lt}});const d="cubic-bezier(.4,0,.22,1)";function c(t,i,e,s){t.style.transition=i?`${i} ${e}ms ${s||d}`:"none"}function m(t,i,e){t.style.width="number"==typeof i?`${i}px`:i,t.style.height="number"==typeof e?`${e}px`:e}const u="idle",v="loading",_="loaded",g="error";function y(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}let f=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{f=!0}}))}catch(t){}class w{constructor(){this._pool=[]}add(t,i,e,s){this._toggleListener(t,i,e,s)}remove(t,i,e,s){this._toggleListener(t,i,e,s,!0)}removeAll(){this._pool.forEach((t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)})),this._pool=[]}_toggleListener(t,i,e,s,n,o){if(!t)return;const a=n?"removeEventListener":"addEventListener";i.split(" ").forEach((i=>{if(i){o||(n?this._pool=this._pool.filter((s=>s.type!==i||s.listener!==e||s.target!==t)):this._pool.push({target:t,type:i,listener:e,passive:s}));const h=!!f&&{passive:s||!1};t[a](i,e,h)}}))}}function x(t,i){if(t.getViewportSizeFn){const e=t.getViewportSizeFn(t,i);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function P(t,i,e,s,n){let o=0;if(i.paddingFn)o=i.paddingFn(e,s,n)[t];else if(i.padding)o=i.padding[t];else{const e="padding"+t[0].toUpperCase()+t.slice(1);i[e]&&(o=i[e])}return Number(o)||0}function S(t,i,e,s){return{x:i.x-P("left",t,i,e,s)-P("right",t,i,e,s),y:i.y-P("top",t,i,e,s)-P("bottom",t,i,e,s)}}class b{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,e=this.slide["x"===t?"width":"height"]*this.currZoomLevel,s=P("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),n=this.slide.panAreaSize[t];this.center[t]=Math.round((n-e)/2)+s,this.max[t]=e>n?Math.round(n-e)+s:this.center[t],this.min[t]=e>n?s:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return r(i,this.max[t],this.min[t])}}class z{constructor(t,i,e,s){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}update(t,i,e){const s={x:t,y:i};this.elementSize=s,this.panAreaSize=e;const n=e.x/s.x,o=e.y/s.y;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",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const i=t+"ZoomLevel",e=this.options[i];if(e)return"function"==typeof e?e(this):"fill"===e?this.fill:"fit"===e?this.fit:Number(e)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}}class C{constructor(t,i,e){this.data=t,this.index=i,this.pswp=e,this.isActive=i===e.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!e.opener.isOpen,this.zoomLevels=new z(e.options,t,i,e),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=s("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 b(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){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",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){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",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const e=Math.round(this.width*i)||this.pswp.viewportSize.x,s=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(e,s)||t)&&this.content.setDisplayedSize(e,s)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){var t;return null===(t=this.content.placeholder)||void 0===t?void 0:t.element}zoomTo(t,i,e,s){const{pswp:n}=this;if(!this.isZoomable()||n.mainScroll.isShifted())return;n.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:i,transitionDuration:e}),n.animations.stopAllPan();const a=this.currZoomLevel;s||(t=r(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",i,a),this.pan.y=this.calculateZoomToPanOffset("y",i,a),o(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};e?n.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:e,easing:n.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,e){if(0===this.bounds.max[t]-this.bounds.min[t])return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),e||(e=this.zoomLevels.initial);const s=this.currZoomLevel/e;return this.bounds.correctPan(t,(this.pan[t]-i[t])*s+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),n(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,e){e/=this.currentResolution||this.zoomLevels.initial,p(this.container,t,i,e)}calculateSize(){const{pswp:t}=this;n(this.panAreaSize,S(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return l(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}class I{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&n(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:i,dragAxis:e}=this.gestures,{currSlide:s}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&s&&s.currZoomLevel<=s.zoomLevels.fit&&!this.gestures.isMultitouch){const e=s.pan.y+(t.y-i.y);if(!this.pswp.dispatch("verticalDrag",{panY:e}).defaultPrevented){this._setPanWithFriction("y",e,.6);const t=1-Math.abs(this._getVerticalDragRatio(s.pan.y));this.pswp.applyBgOpacity(t),s.applyCurrentZoomPan()}}else{this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),s&&(o(s.pan),s.applyCurrentZoomPan()))}}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:e}=this.pswp;let s=0;if(this.pswp.animations.stopAll(),i.isShifted()){const e=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&e<0||t.x<.1&&e<-.5?(s=1,t.x=Math.min(t.x,0)):(t.x>.5&&e>0||t.x>-.1&&e>.5)&&(s=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(s,!0,t.x)}e&&e.currZoomLevel>e.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:s,bounds:n}=e,o=s[t],a=this.pswp.bgOpacity<1&&"y"===t,h=o+function(t,i){return t*i/(1-i)}(i[t],.995);if(a){const t=this._getVerticalDragRatio(o),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const l=n.correctPan(t,h);if(o===l)return;const p=l===h?1:.82,d=this.pswp.bgOpacity,c=l-o;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:o,end:l,velocity:i[t],dampingRatio:p,onUpdate:i=>{if(a&&this.pswp.bgOpacity<1){const t=1-(l-i)/c;this.pswp.applyBgOpacity(r(d+(1-d)*t,0,1))}s[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:e,prevP1:s,isMultitouch:n}=this.gestures,{currSlide:o,mainScroll:a}=this.pswp,h=i[t]-s[t],r=a.x+h;if(!h||!o)return!1;if("x"===t&&!o.isPannable()&&!n)return a.moveTo(r,!0),!0;const{bounds:l}=o,p=o.pan[t]+h;if(this.pswp.options.allowPanToNext&&"x"===e&&"x"===t&&!n){const i=a.getCurrSlideX(),e=a.x-i,s=h>0,n=!s;if(p>l.min[t]&&s){if(l.min[t]<=this.startPan[t])return a.moveTo(r,!0),!0;this._setPanWithFriction(t,p)}else if(p<l.max[t]&&n){if(this.startPan[t]<=l.max[t])return a.moveTo(r,!0),!0;this._setPanWithFriction(t,p)}else if(0!==e){if(e>0)return a.moveTo(Math.max(r,i),!0),!0;if(e<0)return a.moveTo(Math.min(r,i),!0),!0}else this._setPanWithFriction(t,p)}else"y"===t&&(a.isShifted()||l.min.y===l.max.y)||this._setPanWithFriction(t,p);return!1}_getVerticalDragRatio(t){var i,e;return(t-(null!==(i=null===(e=this.pswp.currSlide)||void 0===e?void 0:e.bounds.center.y)&&void 0!==i?i:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,e){const{currSlide:s}=this.pswp;if(!s)return;const{pan:n,bounds:o}=s;if(o.correctPan(t,i)!==i||e){const s=Math.round(i-n[t]);n[t]+=s*(e||.35)}else n[t]=i}}function L(t,i,e){return t.x=(i.x+e.x)/2,t.y=(i.y+e.y)/2,t}class A{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,n(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:e,startP2:s,pswp:n}=this.gestures,{currSlide:o}=n;if(!o)return;const h=o.zoomLevels.min,r=o.zoomLevels.max;if(!o.isZoomable()||n.mainScroll.isShifted())return;L(this._startZoomPoint,i,s),L(this._zoomPoint,t,e);let l=1/a(i,s)*a(t,e)*this._startZoomLevel;if(l>o.zoomLevels.initial+o.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),l<h)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=o.zoomLevels.initial){const t=1-(h-l)/(h/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else l=h-.15*(h-l);else l>r&&(l=r+.05*(l-r));o.pan.x=this._calculatePanForZoomLevel("x",l),o.pan.y=this._calculatePanForZoomLevel("y",l),o.setZoomLevel(l),o.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const e=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*e}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:e}=i;if(null==e||!e.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const s=e.currZoomLevel;let o,a=!0;s<e.zoomLevels.initial?o=e.zoomLevels.initial:s>e.zoomLevels.max?o=e.zoomLevels.max:(a=!1,o=s);const l=i.bgOpacity,p=i.bgOpacity<1,d=n({x:0,y:0},e.pan);let c=n({x:0,y:0},d);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=s,n(this._startPan,d)),a&&(c={x:this._calculatePanForZoomLevel("x",o),y:this._calculatePanForZoomLevel("y",o)}),e.setZoomLevel(o),c={x:e.bounds.correctPan("x",c.x),y:e.bounds.correctPan("y",c.y)},e.setZoomLevel(s);const m=!h(c,d);if(!m&&!a&&!p)return e._setResolution(o),void e.applyCurrentZoomPan();i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,m||a){if(m&&(e.pan.x=d.x+(c.x-d.x)*t,e.pan.y=d.y+(c.y-d.y)*t),a){const i=s+(o-s)*t;e.setZoomLevel(i)}e.applyCurrentZoomPan()}p&&i.bgOpacity<1&&i.applyBgOpacity(r(l+(1-l)*t,0,1))},onComplete:()=>{e._setResolution(o),e.applyCurrentZoomPan()}})}}function T(t){return!!t.target.closest(".pswp__container")}class Z{constructor(t){this.gestures=t}click(t,i){const e=i.target.classList,s=e.contains("pswp__img"),n=e.contains("pswp__item")||e.contains("pswp__zoom-wrap");s?this._doClickOrTapAction("imageClick",t,i):n&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){T(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){T(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,e){var s;const{pswp:n}=this.gestures,{currSlide:o}=n,a=t+"Action",h=n.options[a];if(!n.dispatch(a,{point:i,originalEvent:e}).defaultPrevented)if("function"!=typeof h)switch(h){case"close":case"next":n[h]();break;case"zoom":null==o||o.toggleZoom(i);break;case"zoom-or-close":null!=o&&o.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):n.options.clickToCloseNonZoomable&&n.close();break;case"toggle-controls":null===(s=this.gestures.pswp.element)||void 0===s||s.classList.toggle("pswp--ui-visible")}else h.call(n,i,e)}}class O{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},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 I(this),this.zoomLevels=new A(this),this.tapHandler=new Z(this),t.on("bindEvents",(()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")}))}_bindEvents(t,i,e,s){const{pswp:n}=this,{events:o}=n,a=s?t+s:"";o.add(n.scrollWrap,t+i,this.onPointerDown.bind(this)),o.add(window,t+"move",this.onPointerMove.bind(this)),o.add(window,t+e,this.onPointerUp.bind(this)),a&&o.add(n.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i="mousedown"===t.type||"mouse"===t.pointerType;if(i&&t.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(e.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),e.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,n(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(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,n(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?h(this.p1,this.prevP1)||this.drag.change():h(this.p1,this.prevP1)&&h(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),e=i-this._intervalTime;e<50&&!t||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=i,n(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted())return void i.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const e=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),a(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(n(this._lastStartP1,this.startP1),this._tapTimer=setTimeout((()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()}),e))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const e=this.p1[t]-this._intervalP1[t];return Math.abs(e)>1&&i>5?e/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const e=t,s=this._ongoingPointers.findIndex((t=>t.id===e.pointerId));"up"===i&&s>-1?this._ongoingPointers.splice(s,1):"down"===i&&-1===s?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):s>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[s]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&n(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&n(this.p2,this._ongoingPointers[1])}else{const e=t;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(t,this.p1),"up"===i?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){n(this.prevP1,this.p1),n(this.prevP2,this.p2)}_updateStartPoints(){n(this.startP1,this.p1),n(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}class D{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,e=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),s=e!==this.slideWidth;s&&(this.slideWidth=e,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach(((i,e)=>{s&&p(i.el,(e+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()}))}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=s("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,e){const{pswp:s}=this;let n=s.potentialIndex+t;const o=s.getNumItems();if(s.canLoop()){n=s.getLoopedIndex(n);const i=(t+o)%o;t=i<=o/2?i:i-o}else n<0?n=0:n>=o&&(n=o-1),t=n-s.potentialIndex;s.potentialIndex=n,this._currPositionIndex-=t,s.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){s.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:e||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),s.appendHeavy()}});let t=s.potentialIndex-s.currIndex;if(s.canLoop()){const i=(t+o)%o;t=i<=o/2?i:i-o}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:i}=this,e=this._prevPositionIndex-this._currPositionIndex;if(!e)return;this._prevPositionIndex=this._currPositionIndex,i.currIndex=i.potentialIndex;let s,n=Math.abs(e);n>=3&&(this._containerShiftIndex+=e+(e>0?-3:3),n=3,this.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.destroy(),t.slide=void 0})));for(let t=0;t<n;t++)e>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,p(s.el,(this._containerShiftIndex+2)*this.slideWidth),i.setContent(s,i.currIndex-n+t+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,p(s.el,this._containerShiftIndex*this.slideWidth),i.setContent(s,i.currIndex+n-t-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),i.animations.stopAllPan(),this.itemHolders.forEach(((t,i)=>{t.slide&&t.slide.setIsActive(1===i)})),i.currSlide=null===(t=this.itemHolders[1])||void 0===t?void 0:t.slide,i.contentLoader.updateLazy(e),i.currSlide&&i.currSlide.applyCurrentZoomPan(),i.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const e=Math.round(t-this.x);(i<0&&e>0||i>=this.pswp.getNumItems()-1&&e<0)&&(t=this.x+.35*e)}this.x=t,this.pswp.container&&p(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:null!=i&&i})}}const E={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},M=(t,i)=>i?t:E[t];class F{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",(()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))}));const i=document.activeElement;t.on("destroy",(()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()}))}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(function(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}(t))return;let e,s,n=!1;const o="key"in t;switch(o?t.key:t.keyCode){case M("Escape",o):i.options.escKey&&(e="close");break;case M("z",o):e="toggleZoom";break;case M("ArrowLeft",o):s="x";break;case M("ArrowUp",o):s="y";break;case M("ArrowRight",o):s="x",n=!0;break;case M("ArrowDown",o):n=!0,s="y";break;case M("Tab",o):this._focusRoot()}if(s){t.preventDefault();const{currSlide:o}=i;i.options.arrowKeys&&"x"===s&&i.getNumItems()>1?e=n?"next":"prev":o&&o.currZoomLevel>o.zoomLevels.fit&&(o.pan[s]+=n?-80:80,o.panTo(o.pan.x,o.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}const B="cubic-bezier(.4,0,.22,1)";class R{constructor(t){var i;this.props=t;const{target:e,onComplete:s,transform:n,onFinish:o=(()=>{}),duration:a=333,easing:h=B}=t;this.onFinish=o;const r=n?"transform":"opacity",l=null!==(i=t[r])&&void 0!==i?i:"";this._target=e,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout((()=>{c(e,r,a,h),this._helperTimeout=setTimeout((()=>{e.addEventListener("transitionend",this._onTransitionEnd,!1),e.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout((()=>{this._finalizeAnimation()}),a+500),e.style[r]=l}),30)}),0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),c(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class k{constructor(t,i,e){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=e||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let e,s=0;i/=1e3;const n=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)e=this.velocity+this._naturalFrequency*t,s=(t+e*i)*n,this.velocity=s*-this._naturalFrequency+e*n;else if(this._dampingRatio<1){e=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const o=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);s=n*(t*o+e*a),this.velocity=s*-this._naturalFrequency*this._dampingRatio+n*(-this._dampedFrequency*t*a+this._dampedFrequency*e*o)}return s}}class H{constructor(t){this.props=t,this._raf=0;const{start:i,end:e,velocity:s,onUpdate:n,onComplete:o,onFinish:a=(()=>{}),dampingRatio:h,naturalFrequency:r}=t;this.onFinish=a;const l=new k(s,h,r);let p=Date.now(),d=i-e;const c=()=>{this._raf&&(d=l.easeFrame(d,Date.now()-p),Math.abs(d)<1&&Math.abs(l.velocity)<50?(n(e),o&&o(),this.onFinish()):(p=Date.now(),n(d+e),this._raf=requestAnimationFrame(c)))};this._raf=requestAnimationFrame(c)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class W{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const e=i?new H(t):new R(t);return this.activeAnimations.push(e),e.onFinish=()=>this.stop(e),e}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach((t=>{t.destroy()})),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter((t=>!t.props.isPan||(t.destroy(),!1)))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter((t=>!t.props.isMainScroll||(t.destroy(),!1)))}isPanRunning(){return this.activeAnimations.some((t=>t.props.isPan))}}class N{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:e,deltaY:s}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let e=-s;1===t.deltaMode?e*=.05:e*=t.deltaMode?1:.002,e=2**e;const n=i.currZoomLevel*e;i.zoomTo(n,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(e*=18,s*=18),i.panTo(i.pan.x-e,i.pan.y-s))}}class V{constructor(t,i){var e;const n=i.name||i.className;let o=i.html;if(!1===t.options[n])return;"string"==typeof t.options[n+"SVG"]&&(o=t.options[n+"SVG"]),t.dispatch("uiElementCreate",{data:i});let a="";i.isButton?(a+="pswp__button ",a+=i.className||`pswp__button--${i.name}`):a+=i.className||`pswp__${i.name}`;let h=i.isButton?i.tagName||"button":i.tagName||"div";h=h.toLowerCase();const r=s(a,h);if(i.isButton){"button"===h&&(r.type="button");let{title:e}=i;const{ariaLabel:s}=i;"string"==typeof t.options[n+"Title"]&&(e=t.options[n+"Title"]),e&&(r.title=e);const o=s||e;o&&r.setAttribute("aria-label",o)}r.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(i.size||32),i.outlineID&&(e+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),e+=i.inner,e+="</svg>",e}(o),i.onInit&&i.onInit(r,t),i.onClick&&(r.onclick=e=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(e,r,t)});const l=i.appendTo||"bar";let p=t.element;"bar"===l?(t.topBar||(t.topBar=s("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(r.classList.add("pswp__hide-on-close"),"wrapper"===l&&(p=t.scrollWrap)),null===(e=p)||void 0===e||e.appendChild(t.applyFilters("uiElement",r,i))}}function q(t,i,e){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",(()=>{i.options.loop||(t.disabled=e?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))}))}const U={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:q},G={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{q(t,i,!0)}},K={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,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"/>',outlineID:"pswp__icn-close"},onClick:"close"},$={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,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"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},X={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,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"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let e,s=null;const n=i=>{var s,n;e!==i&&(e=i,s="active",n=i,t.classList.toggle("pswp__preloader--"+s,n))},o=()=>{var t;if(null===(t=i.currSlide)||void 0===t||!t.content.isLoading())return n(!1),void(s&&(clearTimeout(s),s=null));s||(s=setTimeout((()=>{var t;n(Boolean(null===(t=i.currSlide)||void 0===t?void 0:t.content.isLoading())),s=null}),i.options.preloaderDelay))};i.on("change",o),i.on("loadComplete",(t=>{i.currSlide===t.slide&&o()})),i.ui&&(i.ui.updatePreloaderVisibility=o)}},Y={name:"counter",order:5,onInit:(t,i)=>{i.on("change",(()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()}))}};function j(t,i){t.classList.toggle("pswp--zoomed-in",i)}class J{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[K,U,G,$,X,Y],t.dispatch("uiRegister"),this.uiElementsData.sort(((t,i)=>(t.order||0)-(i.order||0))),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach((t=>{this.registerElement(t)})),t.on("change",(()=>{var i;null===(i=t.element)||void 0===i||i.classList.toggle("pswp--one-slide",1===t.getNumItems())})),t.on("zoomPanUpdate",(()=>this._onZoomPanUpdate()))}registerElement(t){this.isRegistered?this.items.push(new V(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:e}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:s}=i;if(this.pswp.opener.isOpen||(s=i.zoomLevels.initial),s===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=s;const n=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(n)<.01||!i.isZoomable())return j(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");j(t,(s===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=s),"zoom"!==e.imageClickAction&&"zoom-or-close"!==e.imageClickAction||t.classList.add("pswp--click-to-zoom")}}class Q{constructor(t,i){this.type=t,this.defaultPrevented=!1,i&&Object.assign(this,i)}preventDefault(){this.defaultPrevented=!0}}class tt{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,i,e=100){var s,n,o;this._filters[t]||(this._filters[t]=[]),null===(s=this._filters[t])||void 0===s||s.push({fn:i,priority:e}),null===(n=this._filters[t])||void 0===n||n.sort(((t,i)=>t.priority-i.priority)),null===(o=this.pswp)||void 0===o||o.addFilter(t,i,e)}removeFilter(t,i){this._filters[t]&&(this._filters[t]=this._filters[t].filter((t=>t.fn!==i))),this.pswp&&this.pswp.removeFilter(t,i)}applyFilters(t,...i){var e;return null===(e=this._filters[t])||void 0===e||e.forEach((t=>{i[0]=t.fn.apply(this,i)})),i[0]}on(t,i){var e,s;this._listeners[t]||(this._listeners[t]=[]),null===(e=this._listeners[t])||void 0===e||e.push(i),null===(s=this.pswp)||void 0===s||s.on(t,i)}off(t,i){var e;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter((t=>i!==t))),null===(e=this.pswp)||void 0===e||e.off(t,i)}dispatch(t,i){var e;if(this.pswp)return this.pswp.dispatch(t,i);const s=new Q(t,i);return null===(e=this._listeners[t])||void 0===e||e.forEach((t=>{t.call(this,s)})),s}}class it{constructor(t,i){if(this.element=s("pswp__img pswp__img--placeholder",t?"img":"div",i),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,i){this.element&&("IMG"===this.element.tagName?(m(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=l(0,0,t/250)):m(this.element,t,i))}destroy(){var t;null!==(t=this.element)&&void 0!==t&&t.parentNode&&this.element.remove(),this.element=null}}class et{constructor(t,i,e){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=u,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout((()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)}),1e3)}load(t,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else{const t=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new it(t,this.slide.container)}this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=s("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=s("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var i,e;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const s=this.element;this.updateSrcsetSizes(),this.data.srcset&&(s.srcset=this.data.srcset),s.src=null!==(i=this.data.src)&&void 0!==i?i:"",s.alt=null!==(e=this.data.alt)&&void 0!==e?e:"",this.state=v,s.complete?this.onLoaded():(s.onload=()=>{this.onLoaded()},s.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=_,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==_&&this.state!==g||this.removePlaceholder())}onError(){this.state=g,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===v,this)}isError(){return this.state===g}isImageContent(){return"image"===this.type}setDisplayedSize(t,i){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,i),!this.instance.dispatch("contentResize",{content:this,width:t,height:i}).defaultPrevented&&(m(this.element,t,i),this.isImageContent()&&!this.isError()))){const e=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=i,e?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:i,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==g,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,i=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||i>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=i+"px",t.dataset.largestUsedSize=String(i))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).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))}displayError(){if(this.slide){var t,i;let e=s("pswp__error-msg","div");e.innerText=null!==(t=null===(i=this.instance.options)||void 0===i?void 0:i.errorMsg)&&void 0!==t?t:"",e=this.instance.applyFilters("contentErrorElement",e,this),this.element=s("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()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===g)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||y())?(this.isDecoding=!0,this.element.decode().catch((()=>{})).finally((()=>{this.isDecoding=!1,this.appendImage()}))):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!y()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==_&&this.state!==g||this.removePlaceholder()))}}function st(t,i,e){const s=i.createContentFromData(t,e);let n;const{options:o}=i;if(o){let a;n=new z(o,t,-1),a=i.pswp?i.pswp.viewportSize:x(o,i);const h=S(o,a,t,e);n.update(s.width,s.height,h)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}class nt{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:i}=this;if(i.dispatch("lazyLoad").defaultPrevented)return;const{preload:e}=i.options,s=void 0===t||t>=0;let n;for(n=0;n<=e[1];n++)this.loadSlideByIndex(i.currIndex+(s?n:-n));for(n=1;n<=e[0];n++)this.loadSlideByIndex(i.currIndex+(s?-n:n))}loadSlideByIndex(t){const i=this.pswp.getLoopedIndex(t);let e=this.getContentByIndex(i);e||(e=function(t,i){const e=i.getItemData(t);if(!i.dispatch("lazyLoadSlide",{index:t,itemData:e}).defaultPrevented)return st(e,i,t)}(i,this.pswp),e&&this.addToCache(e))}getContentBySlide(t){let i=this.getContentByIndex(t.index);return i||(i=this.pswp.createContentFromData(t.data,t.index),this.addToCache(i)),i.setSlide(t),i}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex((t=>!t.isAttached&&!t.hasSlide));if(-1!==t){this._cachedItems.splice(t,1)[0].destroy()}}}removeByIndex(t){const i=this._cachedItems.findIndex((i=>i.index===t));-1!==i&&this._cachedItems.splice(i,1)}getContentByIndex(t){return this._cachedItems.find((i=>i.index===t))}destroy(){this._cachedItems.forEach((t=>t.destroy())),this._cachedItems=[]}}class ot extends tt{getNumItems(){var t;let i=0;const e=null===(t=this.options)||void 0===t?void 0:t.dataSource;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));const s=this.dispatch("numItems",{dataSource:e,numItems:i});return this.applyFilters("numItems",s.numItems,e)}createContentFromData(t,i){return new et(t,this,i)}getItemData(t){var i;const e=null===(i=this.options)||void 0===i?void 0:i.dataSource;let s={};Array.isArray(e)?s=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),s=e.items[t]);let n=s;n instanceof Element&&(n=this._domElementToItemData(n));const o=this.dispatch("itemData",{itemData:n||{},index:t});return this.applyFilters("itemData",o.itemData,t)}_getGalleryDOMElements(t){var i,e;return null!==(i=this.options)&&void 0!==i&&i.children||null!==(e=this.options)&&void 0!==e&&e.childSelector?function(t,i,e=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:i;n&&(s=Array.from(e.querySelectorAll(n)))}return s}(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){const i={element:t},e="A"===t.tagName?t:t.querySelector("a");if(e){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);const n=t.querySelector("img");var s;if(n)i.msrc=n.currentSrc||n.src,i.alt=null!==(s=n.getAttribute("alt"))&&void 0!==s?s:"";(e.dataset.pswpCropped||e.dataset.cropped)&&(i.thumbCropped=!0)}return this.applyFilters("domItemData",i,t,e)}lazyLoadData(t,i){return st(t,this,i)}}const at=.003;class ht{constructor(t){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)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;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((()=>{this._start()}),this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;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()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:e}=t;var s,n;("fade"===e.showHideAnimationType?(e.showHideOpacity=!0,this._thumbBounds=void 0):"none"===e.showHideAnimationType?(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=null==i?void 0:i.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&(null==i?void 0:i.content.usePlaceholder())&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom)?this._animateRootOpacity=null!==(s=e.showHideOpacity)&&void 0!==s&&s:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan()));if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>at,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(at)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=null===(n=this.pswp.currSlide)||void 0===n?void 0:n.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(at)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(at)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(at)))):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&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise((t=>{let i=!1,e=!0;var s;(s=this._placeholder,"decode"in s?s.decode().catch((()=>{})):s.complete?Promise.resolve(s):new Promise(((t,i)=>{s.onload=()=>t(s),s.onerror=i}))).finally((()=>{i=!0,e||t(!0)})),setTimeout((()=>{e=!1,i&&t(!0)}),50),setTimeout(t,250)})).finally((()=>this._initiate())):this._initiate()}_initiate(){var t,i;null===(t=this.pswp.element)||void 0===t||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),null===(i=this.pswp.element)||void 0===i||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()}_onAnimationComplete(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var i;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),null===(i=t.currSlide)||void 0===i||i.applyCurrentZoomPan()}}_animateToOpenState(){const{pswp:t}=this;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")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:e}=this._thumbBounds,{currSlide:s,viewportSize:o}=i;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const i=-o.x+(this._thumbBounds.x-e.x)+e.w,s=-o.y+(this._thumbBounds.y-e.y)+e.h,n=o.x-e.w,a=o.y-e.h;t?(this._animateTo(this._cropContainer1,"transform",l(i,s)),this._animateTo(this._cropContainer2,"transform",l(n,a))):(p(this._cropContainer1,i,s),p(this._cropContainer2,n,a))}s&&(n(s.pan,e||this._thumbBounds),s.currZoomLevel=this._thumbBounds.w/s.width,t?this._animateTo(s.container,"transform",s.getCurrentTransform()):s.applyCurrentZoomPan())}_animateTo(t,i,e){if(!this._duration)return void(t.style[i]=e);const{animations:s}=this.pswp,n={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{s.activeAnimations.length||this._onAnimationComplete()},target:t};n[i]=e,s.startTransition(n)}}const rt={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class lt extends ot{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},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 w,this.animations=new W,this.mainScroll=new D(this),this.gestures=new O(this),this.opener=new ht(this),this.keyboard=new F(this),this.contentLoader=new nt(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";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 N(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",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",(()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[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")})),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),r(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.appendHeavy()}))}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var i;null===(i=this.currSlide)||void 0===i||i.zoomTo(...t)}toggleZoom(){var t;null===(t=this.currSlide)||void 0===t||t.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),null===(t=this.element)||void 0===t||t.remove(),this.mainScroll.itemHolders.forEach((t=>{var i;null===(i=t.slide)||void 0===i||i.destroy()})),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach(((i,e)=>{var s,n;let o=(null!==(s=null===(n=this.currSlide)||void 0===n?void 0:n.index)&&void 0!==s?s:0)-1+e;var a;(this.canLoop()&&(o=this.getLoopedIndex(o)),o===t)&&(this.setContent(i,t,!0),1===e&&(this.currSlide=i.slide,null===(a=i.slide)||void 0===a||a.setIsActive(!0)))})),this.dispatch("change")}setContent(t,i,e){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!e)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const s=this.getItemData(i);t.slide=new C(s,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=x(this.options,this);!t&&h(i,this._prevViewportSize)||(n(this._prevViewportSize,i),this.dispatch("beforeResize"),n(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"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){var t;this.hasMouse||(this.hasMouse=!0,null===(t=this.element)||void 0===t||t.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout((()=>{this.updateSize()}),500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=s("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=s("pswp__bg","div",this.element),this.scrollWrap=s("pswp__scroll-wrap","section",this.element),this.container=s("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 J(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,e){const s=e.dispatch("thumbBounds",{index:t,itemData:i,instance:e});if(s.thumbBounds)return s.thumbBounds;const{element:n}=i;let o,a;if(n&&!1!==e.options.thumbSelector){const t=e.options.thumbSelector||"img";a=n.matches(t)?n:n.querySelector(t)}return a=e.applyFilters("thumbEl",a,i,t),a&&(o=i.thumbCropped?function(t,i,e){const s=t.getBoundingClientRect(),n=s.width/i,o=s.height/e,a=n>o?n:o,h=(s.width-i*a)/2,r=(s.height-e*a)/2,l={x:s.left+h,y:s.top+r,w:i*a};return l.innerRect={w:s.width,h:s.height,x:h,y:r},l}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),e.applyFilters("thumbBounds",o,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...rt,...t}}}}}]);
@@ -0,0 +1 @@
1
+ //= require trestle/_custom
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com
3
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
4
+ * Copyright 2024 Fonticons, Inc.
5
+ */
6
+
7
+ @font-face {
8
+ font-family: 'Font Awesome 6 Free';
9
+ font-style: normal;
10
+ font-weight: 400;
11
+ font-display: block;
12
+ src: url(<%= asset_path('trestle/fa-regular-400.woff2') %>) format('woff2'),
13
+ url(<%= asset_path('trestle/fa-regular-400.ttf') %>) format('truetype');
14
+ }
15
+
16
+ @font-face {
17
+ font-family: 'Font Awesome 6 Free';
18
+ font-style: normal;
19
+ font-weight: 900;
20
+ font-display: block;
21
+ src: url(<%= asset_path('trestle/fa-solid-900.woff2') %>) format('woff2'),
22
+ url(<%= asset_path('trestle/fa-solid-900.ttf') %>) format('truetype');
23
+ }
24
+
25
+ @font-face {
26
+ font-family: 'Font Awesome 6 Brands';
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ font-display: block;
30
+ src: url(<%= asset_path('trestle/fa-brands-400.woff2') %>) format('woff2'),
31
+ url(<%= asset_path('trestle/fa-brands-400.ttf') %>) format('truetype')
32
+ }
@@ -0,0 +1,4 @@
1
+ //= link_tree ../../bundle
2
+ //= link trestle/custom.js
3
+ //= link trestle/custom.css
4
+ //= link trestle/icons/font-awesome.css
@@ -1 +1,6 @@
1
- //= require trestle/_custom
1
+ /*
2
+ * This file is left as an extension point for user customization.
3
+ *
4
+ * It will be overridden by the similarly named file within
5
+ * the app/assets folder of the Rails application.
6
+ */
@@ -3,6 +3,8 @@ module Trestle
3
3
  module Helpers
4
4
  extend ActiveSupport::Concern
5
5
 
6
+ include Trestle::FlashHelper
7
+
6
8
  included do
7
9
  # Allow inclusion of helpers from Rails application
8
10
  self.helpers_path += Rails.application.helpers_paths
@@ -10,15 +10,10 @@ module Trestle
10
10
  # The X-Trestle-Location header is set to indicate that the remote form has triggered
11
11
  # a new page URL (e.g. new -> show) without demanding a full page refresh.
12
12
  def set_trestle_location_header
13
- unless dialog_request? || response.location
13
+ unless modal_request? || response.location
14
14
  headers["X-Trestle-Location"] = request.path
15
15
  end
16
16
  end
17
-
18
- # Do not use Turbolinks for redirects from a dialog request
19
- def visit_location_with_turbolinks(location, action)
20
- super unless dialog_request?
21
- end
22
17
  end
23
18
  end
24
19
  end
@@ -0,0 +1,23 @@
1
+ module Trestle
2
+ module Controller
3
+ module Modal
4
+ extend ActiveSupport::Concern
5
+
6
+ include Trestle::ModalHelper
7
+
8
+ included do
9
+ helper_method :modal_request?, :dialog_request?
10
+ end
11
+
12
+ protected
13
+ def modal_request?
14
+ request.headers["X-Trestle-Modal"] || request.headers["X-Trestle-Dialog"]
15
+ end
16
+
17
+ def dialog_request?
18
+ Trestle.deprecator.warn("The #dialog_request? helper has been renamed to #modal_request?")
19
+ modal_request?
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ module Trestle
2
+ module Controller
3
+ module Turbo
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ etag { :frame if turbo_frame_request? }
8
+ helper_method :turbo_frame_request?, :turbo_frame_request_id
9
+ end
10
+
11
+ private
12
+ def turbo_frame_request?
13
+ turbo_frame_request_id.present?
14
+ end
15
+
16
+ def turbo_frame_request_id
17
+ request.headers["Turbo-Frame"]
18
+ end
19
+ end
20
+ end
21
+ end