@nulib/clover 4.0.0-beta.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/README.md +7 -7
  2. package/dist/components/Annotations/Annotations.mjs +165 -204
  3. package/dist/components/Annotations/EntryBodies.mjs +28 -3
  4. package/dist/components/Annotations/languages.mjs +1 -17
  5. package/dist/components/Body/BodyAlert.mjs +2 -1
  6. package/dist/components/Body/Caption.mjs +2 -1
  7. package/dist/components/Body/CaptionDetails.mjs +2 -1
  8. package/dist/components/Body/glyphs.mjs +9 -0
  9. package/dist/components/Canvas/AnnotationMenu.mjs +76 -60
  10. package/dist/components/Canvas/AnnotationState.mjs +9 -2
  11. package/dist/components/Canvas/Annotations.mjs +16 -7
  12. package/dist/components/Canvas/CanvasView.mjs +173 -32
  13. package/dist/components/Canvas/ChoiceMenu.mjs +51 -31
  14. package/dist/components/Canvas/Connected.mjs +38 -4
  15. package/dist/components/Canvas/ControlMenu.mjs +6 -4
  16. package/dist/components/Canvas/Controls.mjs +17 -1
  17. package/dist/components/Canvas/FrameAnimation.mjs +568 -167
  18. package/dist/components/Canvas/LoadedCanvas.mjs +5 -3
  19. package/dist/components/Canvas/PlaceBox.mjs +74 -0
  20. package/dist/components/Canvas/Placeholder.mjs +2 -1
  21. package/dist/components/Canvas/fromManifest.mjs +2 -1
  22. package/dist/components/Canvas/layout.mjs +121 -32
  23. package/dist/components/Canvas/media/MediaBody.mjs +32 -6
  24. package/dist/components/Canvas/media/Player.mjs +11 -25
  25. package/dist/components/Canvas/media/Transport.mjs +94 -61
  26. package/dist/components/Canvas/media/TransportButton.mjs +2 -1
  27. package/dist/components/Canvas/media/placeMenu.mjs +19 -0
  28. package/dist/components/Canvas/media/seekGaps.mjs +43 -0
  29. package/dist/components/Canvas/media/sequence.mjs +96 -0
  30. package/dist/components/Canvas/media/useMediaElement.mjs +22 -3
  31. package/dist/components/Collection/Collection.mjs +2 -1
  32. package/dist/components/CollectionSelect/CollectionSelect.mjs +5 -2
  33. package/dist/components/Contents/Contents.mjs +163 -34
  34. package/dist/components/Download/Download.mjs +34 -38
  35. package/dist/components/Download/downloads.mjs +40 -0
  36. package/dist/components/Items/AnnotationItems.mjs +165 -0
  37. package/dist/components/Items/CountMenu.mjs +89 -0
  38. package/dist/components/Items/Item.mjs +24 -17
  39. package/dist/components/Items/Items.mjs +65 -37
  40. package/dist/components/Items/Pager.mjs +39 -79
  41. package/dist/components/Items/PagerLayout.mjs +41 -0
  42. package/dist/components/Items/Position.mjs +103 -0
  43. package/dist/components/Items/StandaloneItems.mjs +12 -4
  44. package/dist/components/Items/TargetItems.mjs +202 -0
  45. package/dist/components/Label/Label.mjs +2 -1
  46. package/dist/components/Map/MapView.mjs +367 -57
  47. package/dist/components/Panel/About.mjs +36 -7
  48. package/dist/components/Panel/AboutActions.mjs +117 -0
  49. package/dist/components/Panel/Panel.mjs +58 -18
  50. package/dist/components/Panel/PartOfManifest.mjs +4 -3
  51. package/dist/components/Panel/ReadingLanguages.mjs +20 -0
  52. package/dist/components/Primitives/Primitives.mjs +18 -3
  53. package/dist/components/Provider/Provider.mjs +19 -5
  54. package/dist/components/Root/Announcer.mjs +3 -2
  55. package/dist/components/Root/Root.mjs +5 -2
  56. package/dist/components/Root/useRootState.mjs +14 -2
  57. package/dist/components/Scene/SceneView.mjs +23 -6
  58. package/dist/components/Search/Search.mjs +3 -2
  59. package/dist/components/Split/Split.mjs +4 -1
  60. package/dist/components/Status/Status.mjs +10 -2
  61. package/dist/components/Timeline/playerSurface.mjs +2 -1
  62. package/dist/components/Transcript/Transcript.mjs +42 -23
  63. package/dist/core/annotation-bodies.mjs +25 -5
  64. package/dist/core/annotation-collection.mjs +3 -2
  65. package/dist/core/annotation-name.mjs +12 -9
  66. package/dist/core/annotation-sets.mjs +139 -10
  67. package/dist/core/annotations-content.mjs +8 -1
  68. package/dist/core/annotations.mjs +8 -1
  69. package/dist/core/choice-key.mjs +5 -0
  70. package/dist/core/clover.mjs +105 -20
  71. package/dist/core/content-state-reader.mjs +33 -2
  72. package/dist/core/dates-format.mjs +30 -0
  73. package/dist/core/dates.mjs +19 -0
  74. package/dist/core/geo.mjs +46 -5
  75. package/dist/core/image-layers.mjs +96 -0
  76. package/dist/core/items.mjs +4 -2
  77. package/dist/core/language-choice.mjs +30 -0
  78. package/dist/core/link.mjs +15 -1
  79. package/dist/core/load.mjs +4 -2
  80. package/dist/core/pages.mjs +20 -1
  81. package/dist/core/presentation.mjs +6 -4
  82. package/dist/core/range-regions.mjs +70 -0
  83. package/dist/core/ranges.mjs +52 -18
  84. package/dist/core/region.mjs +7 -2
  85. package/dist/core/sanitize.mjs +86 -1
  86. package/dist/core/save-file.mjs +33 -0
  87. package/dist/core/selectors.mjs +12 -0
  88. package/dist/core/upgrade.mjs +23 -0
  89. package/dist/core/value.mjs +11 -23
  90. package/dist/hooks/useFullscreenExit.mjs +26 -0
  91. package/dist/hooks/useHighContrast.mjs +27 -0
  92. package/dist/i18n/autonym.mjs +11 -0
  93. package/dist/i18n/config.mjs +3 -8
  94. package/dist/{core → i18n}/direction.mjs +5 -1
  95. package/dist/i18n/languages.mjs +44 -0
  96. package/dist/i18n/locales/en.json.mjs +1 -1
  97. package/dist/i18n/locales/es.json.mjs +1 -1
  98. package/dist/i18n/locales/fi.json.mjs +1 -1
  99. package/dist/i18n/locales/fr.json.mjs +1 -1
  100. package/dist/i18n/locales/nb.json.mjs +1 -1
  101. package/dist/i18n/locales/nn.json.mjs +1 -1
  102. package/dist/i18n/locales/no.json.mjs +1 -1
  103. package/dist/i18n/locales/pt.json.mjs +1 -1
  104. package/dist/{ui → i18n}/useContainerName.mjs +5 -4
  105. package/dist/{react/language.mjs → i18n/useRootLanguage.mjs} +2 -2
  106. package/dist/index.d.mts +393 -53
  107. package/dist/index.mjs +6 -2
  108. package/dist/lib/fullscreen.mjs +6 -1
  109. package/dist/lib/renderer/CanvasRenderer.mjs +28 -5
  110. package/dist/lib/renderer/math/affine.mjs +14 -0
  111. package/dist/lib/renderer/scene/planFrame.mjs +12 -12
  112. package/dist/lib/renderer/scene/regions.mjs +11 -1
  113. package/dist/lib/renderer/scene/sceneItem.mjs +72 -9
  114. package/dist/lib/time.mjs +10 -0
  115. package/dist/map/index.d.mts +26 -4
  116. package/dist/react/fetchManifest.mjs +19 -0
  117. package/dist/react/hooks.mjs +7 -1
  118. package/dist/react/readingLanguages.mjs +16 -0
  119. package/dist/react/usePagesReached.mjs +42 -0
  120. package/dist/styles.css +1 -1
  121. package/dist/templates/default/Default.mjs +87 -9
  122. package/dist/templates/document/Document.mjs +5 -1
  123. package/dist/templates/index.d.mts +21 -3
  124. package/dist/templates.css +1 -1
  125. package/dist/ui/BodyUnloadable.mjs +34 -0
  126. package/dist/ui/Button.mjs +2 -1
  127. package/dist/ui/Chevron.mjs +34 -0
  128. package/dist/ui/ControlCluster.mjs +6 -3
  129. package/dist/ui/EntryThumbnail.mjs +60 -0
  130. package/dist/ui/ExitFullscreen.mjs +2 -1
  131. package/dist/ui/FieldPill.mjs +5 -4
  132. package/dist/ui/HideToggle.mjs +2 -1
  133. package/dist/ui/LanguageChoice.mjs +45 -0
  134. package/dist/ui/ListEnd.mjs +29 -0
  135. package/dist/ui/Markup.mjs +27 -8
  136. package/dist/ui/NavDate.mjs +29 -0
  137. package/dist/ui/ReadMore.mjs +3 -2
  138. package/dist/ui/Sections.mjs +19 -28
  139. package/dist/ui/Steps.mjs +4 -3
  140. package/dist/ui/Tip.mjs +9 -4
  141. package/dist/web-components/About-DhOGPFaI.mjs +1 -0
  142. package/dist/web-components/AnnotationItems-CNP4CJiT.mjs +1 -0
  143. package/dist/web-components/AnnotationMenu-BCwwwfbb.mjs +1 -0
  144. package/dist/web-components/AnnotationState-CavxnAAq.mjs +1 -0
  145. package/dist/web-components/Annotations-DDjSrBL5.mjs +2 -0
  146. package/dist/web-components/Annotations-rBmeI5sR.mjs +1 -0
  147. package/dist/web-components/Body-DaY1UJIy.mjs +1 -0
  148. package/dist/web-components/BodyAlert-COKp19lq.mjs +1 -0
  149. package/dist/web-components/BodyUnloadable-DcTM7hHF.mjs +1 -0
  150. package/dist/web-components/Button-DLFYqtz9.mjs +1 -0
  151. package/dist/web-components/{Camera-cdCqKMup.mjs → Camera-Cp5ma-6C.mjs} +1 -1
  152. package/dist/web-components/{Canvas2DBackend-CnLEHRs4.mjs → Canvas2DBackend-3PToh87Z.mjs} +1 -1
  153. package/dist/web-components/CanvasView-BWQ4SK2b.mjs +2 -0
  154. package/dist/web-components/CaptionDetails-DSziiuQV.mjs +1 -0
  155. package/dist/web-components/Chevron-r-_hUPn8.mjs +1 -0
  156. package/dist/web-components/ChoiceMenu-DTuEEUeM.mjs +1 -0
  157. package/dist/web-components/Collection-B9swJtPW.mjs +1 -0
  158. package/dist/web-components/CollectionSelect-CBWUbqQi.mjs +1 -0
  159. package/dist/web-components/Connected-B2d6EoFl.mjs +1 -0
  160. package/dist/web-components/Connected-BSRM9FJY.mjs +1 -0
  161. package/dist/web-components/Connected-BnpxYeJN.mjs +1 -0
  162. package/dist/web-components/Contents-D7FPxSH-.mjs +1 -0
  163. package/dist/web-components/ControlMenu-Crtho2cs.mjs +1 -0
  164. package/dist/web-components/CountMenu-DyTp_J4k.mjs +1 -0
  165. package/dist/web-components/Cue-CbZaGwZh.mjs +1 -0
  166. package/dist/web-components/Document-BfltLWZZ.mjs +1 -0
  167. package/dist/web-components/DocumentPanel-ZSe40cV4.mjs +1 -0
  168. package/dist/web-components/{DomLayers-BD4QPbl6.mjs → DomLayers-CTGub6wo.mjs} +1 -1
  169. package/dist/web-components/Download-BOYNIb7C.mjs +1 -0
  170. package/dist/web-components/EntryBodies-Bfd2Z42z.mjs +1 -0
  171. package/dist/web-components/EntryThumbnail-DQE8ajI9.mjs +1 -0
  172. package/dist/web-components/FieldPill-D5DNJWLy.mjs +1 -0
  173. package/dist/web-components/FrameAnimation-IfR1czfc.mjs +1 -0
  174. package/dist/web-components/Gallery-DD06BDQo.mjs +1 -0
  175. package/dist/web-components/HideToggle-DL911R1Z.mjs +1 -0
  176. package/dist/web-components/Items-BHzT9A73.mjs +1 -0
  177. package/dist/web-components/Label-KabnxuMN.mjs +1 -0
  178. package/dist/web-components/LanguageChoice-DT1UPiDn.mjs +1 -0
  179. package/dist/web-components/LightboxBody-BhRhdXo6.mjs +1 -0
  180. package/dist/web-components/ListEnd-CbwNlty-.mjs +1 -0
  181. package/dist/web-components/{Loaded-D5xmFRSo.mjs → Loaded-BWfEBJyg.mjs} +1 -1
  182. package/dist/web-components/LoadedCanvas-CdZ5WOWz.mjs +1 -0
  183. package/dist/web-components/LoadedMap-DQyQVRVQ.mjs +1 -0
  184. package/dist/web-components/{Loading-CBKfwsML.mjs → Loading-zw74TdAz.mjs} +1 -1
  185. package/dist/web-components/{Map-Bcgp_R8H.mjs → Map--dJhk0_0.mjs} +1 -1
  186. package/dist/web-components/MapView-duA5WGsu.mjs +3 -0
  187. package/dist/web-components/Markup-D-kioDf9.mjs +2 -0
  188. package/dist/web-components/MediaBody-CoOiVXcv.mjs +1 -0
  189. package/dist/web-components/MediaBody-d8ErTuwT.mjs +1 -0
  190. package/dist/web-components/NavDate-BQHuyLOC.mjs +1 -0
  191. package/dist/web-components/{Navigator-BSJbEbuJ.mjs → Navigator-B3U21_ti.mjs} +1 -1
  192. package/dist/web-components/Pager-DnJknq92.mjs +1 -0
  193. package/dist/web-components/PagerLayout-CvOmKtSW.mjs +1 -0
  194. package/dist/web-components/Panel-CIdjOznL.mjs +1 -0
  195. package/dist/web-components/{PanelToggle-mUDw73zI.mjs → PanelToggle-CFtWIeWv.mjs} +1 -1
  196. package/dist/web-components/PartOfManifest-F87jIrf9.mjs +1 -0
  197. package/dist/web-components/{Pending-BPOQ2z1L.mjs → Pending-CYAQajKu.mjs} +1 -1
  198. package/dist/web-components/PlaceBox-BtIbIotm.mjs +1 -0
  199. package/dist/web-components/Placeholder-TIyj4ZjR.mjs +1 -0
  200. package/dist/web-components/Position-BkWBRBfW.mjs +1 -0
  201. package/dist/web-components/Primitives-BmODPlnK.mjs +1 -0
  202. package/dist/web-components/Provider-C8se8i4I.mjs +1 -0
  203. package/dist/web-components/ReadMore-BwGFsLS2.mjs +1 -0
  204. package/dist/web-components/Root-CAJB0-Mh.mjs +1 -0
  205. package/dist/web-components/Scene-Ctcdt7CD.mjs +1 -0
  206. package/dist/web-components/SceneView-B6bEx_7x.mjs +1 -0
  207. package/dist/web-components/Search-CbmK9vLp.mjs +1 -0
  208. package/dist/web-components/Sections-Dy5_pkyQ.mjs +2 -0
  209. package/dist/web-components/StandaloneItems-BmUnBp0H.mjs +1 -0
  210. package/dist/web-components/Status-Dww3Pyf4.mjs +1 -0
  211. package/dist/web-components/Steps-o_UprQfZ.mjs +1 -0
  212. package/dist/web-components/TargetItems-BBOGDubv.mjs +1 -0
  213. package/dist/web-components/Timeline-CfIF4APc.mjs +1 -0
  214. package/dist/web-components/Tip-BbexILXs.mjs +1 -0
  215. package/dist/web-components/Transcript-ZVXM3ZDA.mjs +1 -0
  216. package/dist/web-components/annotation-collection-7SS1ELcO.mjs +1 -0
  217. package/dist/web-components/annotation-name-CYkZopdd.mjs +1 -0
  218. package/dist/web-components/annotations-content-Bdtn50sf.mjs +1 -0
  219. package/dist/web-components/body-CkOBHlJ0.mjs +1 -0
  220. package/dist/web-components/canvas-CWf_Fag8.mjs +1 -0
  221. package/dist/web-components/choice-key-BUNebLKe.mjs +1 -0
  222. package/dist/web-components/{cloverEngine-B4LinbSt.mjs → cloverEngine-6djEHNCD.mjs} +2 -2
  223. package/dist/web-components/content-state-reader-Ahh6artg.mjs +1 -0
  224. package/dist/web-components/{controls-Dj2BybWb.mjs → controls-BJrZVQkS.mjs} +1 -1
  225. package/dist/web-components/custom-elements.json +109 -13
  226. package/dist/web-components/dates-DR3gfcON.mjs +1 -0
  227. package/dist/web-components/downloads-CqVWo-yn.mjs +1 -0
  228. package/dist/web-components/{engine-BSt8LTso.mjs → engine-B-sscpLa.mjs} +1 -1
  229. package/dist/web-components/{engines-CC0OEsVE.mjs → engines-DfCHjbt3.mjs} +1 -1
  230. package/dist/web-components/es-BYfHUZ7P.mjs +1 -0
  231. package/dist/web-components/fetchManifest-BIzne1Pj.mjs +1 -0
  232. package/dist/web-components/fi-B5y2qr8T.mjs +1 -0
  233. package/dist/web-components/fr-ChezCx6V.mjs +1 -0
  234. package/dist/web-components/fromManifest-gg5Wx14y.mjs +1 -0
  235. package/dist/web-components/glyphs-JYl2STEr.mjs +1 -0
  236. package/dist/web-components/hooks-x7rO95CS.mjs +1 -0
  237. package/dist/web-components/image-layers-BjbeyHBS.mjs +1 -0
  238. package/dist/web-components/{imageService-dsdmcegU.mjs → imageService-0eTvQ-3h.mjs} +1 -1
  239. package/dist/web-components/index-BZ7b9k0N.mjs +1 -0
  240. package/dist/web-components/index.d.mts +95 -10
  241. package/dist/web-components/index.mjs +1 -1
  242. package/dist/web-components/items-CnAIl9fS.mjs +1 -0
  243. package/dist/web-components/items-F6hJgdAS.mjs +1 -0
  244. package/dist/web-components/label-CI88KH2_.mjs +1 -0
  245. package/dist/web-components/layout-De1MOSYe.mjs +1 -0
  246. package/dist/web-components/link-GEdiEwlR.mjs +1 -0
  247. package/dist/web-components/logo-Ckwj7FlP.mjs +1 -0
  248. package/dist/web-components/models-59cEeiAA.mjs +1 -0
  249. package/dist/web-components/nb-8J22f9Td.mjs +1 -0
  250. package/dist/web-components/nn-Dv1EvzI1.mjs +1 -0
  251. package/dist/web-components/no-8J22f9Td.mjs +1 -0
  252. package/dist/web-components/{nodes-B7JRwBgl.mjs → nodes-CTw9OqlA.mjs} +1 -1
  253. package/dist/web-components/{overlayImage-0OgQl1TL.mjs → overlayImage-BMt4UTlR.mjs} +1 -1
  254. package/dist/web-components/{panel-CjXfre-g.mjs → panel-C17Rl9Ya.mjs} +1 -1
  255. package/dist/web-components/part-CXts97_M.mjs +1 -0
  256. package/dist/web-components/playerSurface-HYwEwPK6.mjs +1 -0
  257. package/dist/web-components/presentation-2-C-U79S_T.mjs +1 -0
  258. package/dist/web-components/{provider-C1wKfdjb.mjs → provider-BpxorEiq.mjs} +1 -1
  259. package/dist/web-components/pt-DWYQkATt.mjs +1 -0
  260. package/dist/web-components/range-regions-BGQy4E9U.mjs +1 -0
  261. package/dist/web-components/read-more-BDM_6CVc.mjs +1 -0
  262. package/dist/web-components/readingLanguages-fs_HqvqQ.mjs +1 -0
  263. package/dist/web-components/rendererSurface-C0aKlE0v.mjs +22 -0
  264. package/dist/web-components/{renderers-BMSWEFUR.mjs → renderers-CiB74bQh.mjs} +1 -1
  265. package/dist/web-components/{resource-DLHocQ1C.mjs → resource-CRbpf9pX.mjs} +1 -1
  266. package/dist/web-components/sanitize-qIOeyIww.mjs +3 -0
  267. package/dist/web-components/save-file-CCuZEuQr.mjs +1 -0
  268. package/dist/web-components/search-CkM0O0Z1.mjs +1 -0
  269. package/dist/web-components/sequence-C28xoNmD.mjs +1 -0
  270. package/dist/web-components/shared-MTsMddHx.mjs +1 -0
  271. package/dist/web-components/{show-link-CyzYE1eS.mjs → show-link-BXm7SNIC.mjs} +1 -1
  272. package/dist/web-components/{sizedImage-uv_NlE0l.mjs → sizedImage-k4Q-eyOB.mjs} +1 -1
  273. package/dist/web-components/{split-CYuMjp89.mjs → split-Hp6z-v4h.mjs} +1 -1
  274. package/dist/web-components/{status-Ms5L0ghK.mjs → status-BmtuKfAG.mjs} +1 -1
  275. package/dist/web-components/styles-CZV1nbBQ.mjs +1 -0
  276. package/dist/web-components/three.mjs +1 -1
  277. package/dist/web-components/thumbnail-Dp7a8oom.mjs +1 -0
  278. package/dist/web-components/{tip-dWhupWSr.mjs → tip-C-oovDZK.mjs} +1 -1
  279. package/dist/web-components/{toggle-BQTjR1I3.mjs → toggle-C7ODWDEZ.mjs} +1 -1
  280. package/dist/web-components/upgrade-eNW0DPXq.mjs +1 -0
  281. package/dist/web-components/upgrader-BlbMUEH6.mjs +1 -0
  282. package/dist/web-components/useContainerName-CrOmY-km.mjs +1 -0
  283. package/dist/web-components/useNearViewport-BqXi9Gn4.mjs +1 -0
  284. package/dist/web-components/{useScrollTrack-WbG28FPD.mjs → useScrollTrack-CEsOU2yT.mjs} +1 -1
  285. package/dist/web-components/viewer/AnnotationItems-CyhVcRFc.mjs +1 -0
  286. package/dist/web-components/viewer/AnnotationMenu-DPOSehBo.mjs +1 -0
  287. package/dist/web-components/viewer/AnnotationState-Bjztkobn.mjs +1 -0
  288. package/dist/web-components/viewer/Annotations-Dh_8Tzi0.mjs +2 -0
  289. package/dist/web-components/viewer/Annotations-wwuOCxzI.mjs +1 -0
  290. package/dist/web-components/viewer/{Canvas2DBackend-CAmzJD5P.mjs → Canvas2DBackend-BTK6ZJh0.mjs} +1 -1
  291. package/dist/web-components/viewer/CaptionDetails-BwCTovy_.mjs +1 -0
  292. package/dist/web-components/viewer/ChoiceMenu-DQ1x572Y.mjs +1 -0
  293. package/dist/web-components/viewer/Collection-DSBxCmXw.mjs +1 -0
  294. package/dist/web-components/viewer/Connected-CL3N8F2J.mjs +1 -0
  295. package/dist/web-components/viewer/Connected-DTk1jlyI.mjs +1 -0
  296. package/dist/web-components/viewer/Contents-DrXckx7d.mjs +1 -0
  297. package/dist/web-components/viewer/ControlMenu-Bp91s-g_.mjs +1 -0
  298. package/dist/web-components/viewer/CountMenu-4u6U6yqb.mjs +1 -0
  299. package/dist/web-components/viewer/Cue-C-aF8peC.mjs +1 -0
  300. package/dist/web-components/viewer/Document-BN1rICu3.mjs +1 -0
  301. package/dist/web-components/viewer/DocumentPanel-CEesxdeY.mjs +1 -0
  302. package/dist/web-components/viewer/{DomLayers-DRdQSEtN.mjs → DomLayers-CGkDtemL.mjs} +1 -1
  303. package/dist/web-components/viewer/Download-CawEl9MN.mjs +1 -0
  304. package/dist/web-components/viewer/EntryBodies-nYHMwSSM.mjs +1 -0
  305. package/dist/web-components/viewer/EntryThumbnail-DrO_0SzR.mjs +1 -0
  306. package/dist/web-components/viewer/FieldPill-DFXGWrvB.mjs +1 -0
  307. package/dist/web-components/viewer/FrameAnimation-CZfzpxaD.mjs +1 -0
  308. package/dist/web-components/viewer/Gallery-MWHtvjti.mjs +1 -0
  309. package/dist/web-components/viewer/HideToggle-DP5kHzWM.mjs +1 -0
  310. package/dist/web-components/viewer/LanguageChoice-C50T7dPI.mjs +1 -0
  311. package/dist/web-components/viewer/{LightboxBody-CXMc1xOH.mjs → LightboxBody-C2T7IC29.mjs} +1 -1
  312. package/dist/web-components/viewer/ListEnd-BDuOx__m.mjs +1 -0
  313. package/dist/web-components/viewer/MapView-BN9wXQKV.mjs +3 -0
  314. package/dist/web-components/viewer/MediaBody-CEyswliX.mjs +1 -0
  315. package/dist/web-components/viewer/MediaBody-Dw3DWDjc.mjs +1 -0
  316. package/dist/web-components/viewer/NavDate-C2-wwLuB.mjs +1 -0
  317. package/dist/web-components/viewer/{Navigator-CKwDgG2x.mjs → Navigator-C3jghOd3.mjs} +1 -1
  318. package/dist/web-components/viewer/PagerLayout-Cg2NpqoD.mjs +1 -0
  319. package/dist/web-components/viewer/PartOfManifest-D22yMgCf.mjs +1 -0
  320. package/dist/web-components/viewer/PlaceBox-Dckw4Sfk.mjs +1 -0
  321. package/dist/web-components/viewer/Placeholder-NYVWYg5Q.mjs +1 -0
  322. package/dist/web-components/viewer/Search-DC259m4f.mjs +1 -0
  323. package/dist/web-components/viewer/StandaloneItems-E4kpMne9.mjs +1 -0
  324. package/dist/web-components/viewer/Steps-Bw32X5xO.mjs +1 -0
  325. package/dist/web-components/viewer/TargetItems-DLhUH1Gq.mjs +1 -0
  326. package/dist/web-components/viewer/Transcript-D_VGJQxn.mjs +1 -0
  327. package/dist/web-components/viewer/annotation-collection-DZHa18ir.mjs +1 -0
  328. package/dist/web-components/viewer/annotation-name-BaNdW2Xk.mjs +1 -0
  329. package/dist/web-components/viewer/annotations-content-CbA3eOIC.mjs +1 -0
  330. package/dist/web-components/viewer/{cloverEngine-CynoKdta.mjs → cloverEngine-C04bCSFR.mjs} +2 -2
  331. package/dist/web-components/viewer/content-state-reader-C7UBMOq3.mjs +1 -0
  332. package/dist/web-components/viewer/fetchManifest-C2Yxg3x9.mjs +1 -0
  333. package/dist/web-components/viewer/{host-DlCltI_c.mjs → host-CZeyjCKR.mjs} +1 -1
  334. package/dist/web-components/viewer/image-layers-B09fporZ.mjs +1 -0
  335. package/dist/web-components/viewer/index.mjs +1 -1
  336. package/dist/web-components/viewer/link-DssZ0Z2N.mjs +1 -0
  337. package/dist/web-components/viewer/overlayImage-BR3eJCKq.mjs +1 -0
  338. package/dist/web-components/viewer/range-regions-By6L5JOK.mjs +1 -0
  339. package/dist/web-components/viewer/{renderers-C_wdmw9v.mjs → renderers-DLoqv3QO.mjs} +1 -1
  340. package/dist/web-components/viewer/save-file-CJT5p5Hg.mjs +1 -0
  341. package/dist/web-components/viewer/{search-BHLyNxZ6.mjs → search-PhOwMKHi.mjs} +1 -1
  342. package/dist/web-components/viewer/styles-NZLnZPAC.mjs +1 -0
  343. package/dist/web-components/viewer/viewer-D30YHqyF.mjs +29 -0
  344. package/dist/web-components/viewer/{vtt-XiS_-5Ao.mjs → vtt-1Pk7Dhsj.mjs} +1 -1
  345. package/dist/web-components/viewer-CH7re5OO.mjs +1 -0
  346. package/dist/web-components/{vtt-DYAOuQoK.mjs → vtt-CacHieeN.mjs} +1 -1
  347. package/package.json +8 -4
  348. package/dist/i18n/reader.mjs +0 -13
  349. package/dist/web-components/About-DbrFSVBm.mjs +0 -1
  350. package/dist/web-components/AnnotationMenu-EBjIQpQl.mjs +0 -1
  351. package/dist/web-components/AnnotationState-DQTaO6Gz.mjs +0 -1
  352. package/dist/web-components/Annotations-Cb9U7HJ_.mjs +0 -2
  353. package/dist/web-components/Annotations-Dl0SgHBS.mjs +0 -1
  354. package/dist/web-components/Body-DxSz3iST.mjs +0 -1
  355. package/dist/web-components/BodyAlert-C8EOXz24.mjs +0 -1
  356. package/dist/web-components/Button-uWgfvqsL.mjs +0 -1
  357. package/dist/web-components/CanvasView-BI3YzNdK.mjs +0 -1
  358. package/dist/web-components/CaptionDetails-B80ZhZ7v.mjs +0 -1
  359. package/dist/web-components/ChoiceMenu-DCp7-co7.mjs +0 -1
  360. package/dist/web-components/Collection-B1Le2_TU.mjs +0 -1
  361. package/dist/web-components/CollectionSelect-BL_jQog-.mjs +0 -1
  362. package/dist/web-components/Connected-BxqaRL9o.mjs +0 -1
  363. package/dist/web-components/Connected-DCBI-j9H.mjs +0 -1
  364. package/dist/web-components/Connected-DkhfVWxd.mjs +0 -1
  365. package/dist/web-components/Contents-zYEGHLfe.mjs +0 -1
  366. package/dist/web-components/ControlMenu-CAHiLAtl.mjs +0 -1
  367. package/dist/web-components/Cue-BT2V9VAq.mjs +0 -1
  368. package/dist/web-components/Document-BdCjGnJN.mjs +0 -1
  369. package/dist/web-components/DocumentPanel-X_Rta0Wu.mjs +0 -1
  370. package/dist/web-components/Download-DqU-goFi.mjs +0 -1
  371. package/dist/web-components/EntryBodies-DXAQH0vR.mjs +0 -1
  372. package/dist/web-components/ErrorBoundary-chQaO-Up.mjs +0 -1
  373. package/dist/web-components/FieldPill-CyEssPVm.mjs +0 -1
  374. package/dist/web-components/FrameAnimation-Bb0pOoRl.mjs +0 -1
  375. package/dist/web-components/Gallery-BXU3TcT3.mjs +0 -1
  376. package/dist/web-components/HideToggle-BwMrOBMu.mjs +0 -1
  377. package/dist/web-components/Items-DRj1UEpC.mjs +0 -1
  378. package/dist/web-components/Label-D6aVJB9s.mjs +0 -1
  379. package/dist/web-components/LightboxBody-BzXQGMDn.mjs +0 -1
  380. package/dist/web-components/LoadedCanvas-DOjtxLSe.mjs +0 -1
  381. package/dist/web-components/LoadedMap-DouDS2lO.mjs +0 -1
  382. package/dist/web-components/MapView-CD5zkTs8.mjs +0 -1
  383. package/dist/web-components/Markup-C1hMA8wk.mjs +0 -2
  384. package/dist/web-components/MediaBody-B_Gii4we.mjs +0 -1
  385. package/dist/web-components/MediaBody-BfrKIPte.mjs +0 -1
  386. package/dist/web-components/Pager-Di_2hHM3.mjs +0 -1
  387. package/dist/web-components/Panel-DbsC8A9V.mjs +0 -1
  388. package/dist/web-components/PartOfManifest-7eOwURrF.mjs +0 -1
  389. package/dist/web-components/Primitives-XQO3m1wG.mjs +0 -1
  390. package/dist/web-components/Provider-B61118lU.mjs +0 -1
  391. package/dist/web-components/ReadMore-BJH-qqte.mjs +0 -1
  392. package/dist/web-components/Root-Dj277K6p.mjs +0 -1
  393. package/dist/web-components/Scene-BTWpLeec.mjs +0 -1
  394. package/dist/web-components/SceneView-BYo7WmPt.mjs +0 -1
  395. package/dist/web-components/Search-ZV8FFN4p.mjs +0 -1
  396. package/dist/web-components/Sections-ejwu1_Sm.mjs +0 -2
  397. package/dist/web-components/StandaloneItems-BYaiyCca.mjs +0 -1
  398. package/dist/web-components/Status-YbQK2KzY.mjs +0 -1
  399. package/dist/web-components/Timeline-ByyVSd7B.mjs +0 -1
  400. package/dist/web-components/Tip-IO11xX4x.mjs +0 -1
  401. package/dist/web-components/Transcript-D0gUxUoA.mjs +0 -1
  402. package/dist/web-components/annotation-collection-Csv7WIlm.mjs +0 -1
  403. package/dist/web-components/annotations-content-BS_OFz5Z.mjs +0 -1
  404. package/dist/web-components/body-CKjwwFep.mjs +0 -1
  405. package/dist/web-components/canvas-CIzpp-Uz.mjs +0 -1
  406. package/dist/web-components/content-state-reader-D1BkpICh.mjs +0 -1
  407. package/dist/web-components/es-BwMkoRod.mjs +0 -1
  408. package/dist/web-components/fi-gPFOn9RK.mjs +0 -1
  409. package/dist/web-components/fr-DUHmgdJo.mjs +0 -1
  410. package/dist/web-components/fromManifest-BhemHaoA.mjs +0 -1
  411. package/dist/web-components/glyphs-drROkef9.mjs +0 -1
  412. package/dist/web-components/hooks-BXzQSllm.mjs +0 -1
  413. package/dist/web-components/index-B7nZdqLg.mjs +0 -1
  414. package/dist/web-components/items-CB2Uk7ts.mjs +0 -1
  415. package/dist/web-components/items-jfQ5XzEj.mjs +0 -1
  416. package/dist/web-components/keep-fragments-B5nlv2ck.mjs +0 -1
  417. package/dist/web-components/label-Vbg_cMOJ.mjs +0 -1
  418. package/dist/web-components/layout-mMHI0lsj.mjs +0 -1
  419. package/dist/web-components/link-ZRnv5NFR.mjs +0 -1
  420. package/dist/web-components/logo-Boy6u4m2.mjs +0 -1
  421. package/dist/web-components/models-D1EE_CmH.mjs +0 -1
  422. package/dist/web-components/nb-BSvnQ6jd.mjs +0 -1
  423. package/dist/web-components/nn-Dg2_HdZu.mjs +0 -1
  424. package/dist/web-components/no-BSvnQ6jd.mjs +0 -1
  425. package/dist/web-components/part-cUiPs2-y.mjs +0 -1
  426. package/dist/web-components/playerSurface-CU5XxI1j.mjs +0 -1
  427. package/dist/web-components/pt-B3J80JgO.mjs +0 -1
  428. package/dist/web-components/read-more-DNHNtG-a.mjs +0 -1
  429. package/dist/web-components/rendererSurface-DhIlOjGT.mjs +0 -22
  430. package/dist/web-components/sanitize-Dc7nOsgO.mjs +0 -3
  431. package/dist/web-components/search-CLy2Wj01.mjs +0 -1
  432. package/dist/web-components/shared-YUjOSBKO.mjs +0 -1
  433. package/dist/web-components/styles-CyuM_fB1.mjs +0 -1
  434. package/dist/web-components/thumbnail-c2K_iQsD.mjs +0 -1
  435. package/dist/web-components/time-B9GZoYcm.mjs +0 -1
  436. package/dist/web-components/upgrader-XNxI-5jo.mjs +0 -1
  437. package/dist/web-components/useContainerName-BpJ3IWY0.mjs +0 -1
  438. package/dist/web-components/useNearViewport-CtLyYg9n.mjs +0 -1
  439. package/dist/web-components/viewer/AnnotationMenu-ZKyBeyUU.mjs +0 -1
  440. package/dist/web-components/viewer/AnnotationState-DO33zokc.mjs +0 -1
  441. package/dist/web-components/viewer/Annotations-BOjhr5ks.mjs +0 -1
  442. package/dist/web-components/viewer/Annotations-DkLueFLK.mjs +0 -2
  443. package/dist/web-components/viewer/CaptionDetails-DOJlUtOn.mjs +0 -1
  444. package/dist/web-components/viewer/ChoiceMenu-BDq6H34G.mjs +0 -1
  445. package/dist/web-components/viewer/Collection-By3puO0V.mjs +0 -1
  446. package/dist/web-components/viewer/Connected-DZNO2CPf.mjs +0 -1
  447. package/dist/web-components/viewer/Connected-ESg5y49m.mjs +0 -1
  448. package/dist/web-components/viewer/Contents-B_FqDwTW.mjs +0 -1
  449. package/dist/web-components/viewer/ControlMenu-DdQl-dTf.mjs +0 -1
  450. package/dist/web-components/viewer/Cue-BTRHfiWQ.mjs +0 -1
  451. package/dist/web-components/viewer/Document-B9_PyD2w.mjs +0 -1
  452. package/dist/web-components/viewer/DocumentPanel-CtEJVPoE.mjs +0 -1
  453. package/dist/web-components/viewer/EntryBodies-CJuTRcTq.mjs +0 -1
  454. package/dist/web-components/viewer/FieldPill-06uwrNwE.mjs +0 -1
  455. package/dist/web-components/viewer/FrameAnimation-3dcDHf5q.mjs +0 -1
  456. package/dist/web-components/viewer/Gallery-BYasTqZc.mjs +0 -1
  457. package/dist/web-components/viewer/HideToggle-BxkNMX-T.mjs +0 -1
  458. package/dist/web-components/viewer/MapView-DCerrRRV.mjs +0 -1
  459. package/dist/web-components/viewer/MediaBody-BdkJcyGy.mjs +0 -1
  460. package/dist/web-components/viewer/MediaBody-waF4KvHp.mjs +0 -1
  461. package/dist/web-components/viewer/PartOfManifest-DalHJFwC.mjs +0 -1
  462. package/dist/web-components/viewer/Search-Di_QQfDb.mjs +0 -1
  463. package/dist/web-components/viewer/StandaloneItems-B9J6nnWn.mjs +0 -1
  464. package/dist/web-components/viewer/Transcript-aHOixfna.mjs +0 -1
  465. package/dist/web-components/viewer/annotation-collection-I2UkdobR.mjs +0 -1
  466. package/dist/web-components/viewer/annotations-content-D-i4j9pD.mjs +0 -1
  467. package/dist/web-components/viewer/content-state-reader-D7GIMcKK.mjs +0 -1
  468. package/dist/web-components/viewer/link-BX-wzj1u.mjs +0 -1
  469. package/dist/web-components/viewer/overlayImage-CHqn1fG8.mjs +0 -1
  470. package/dist/web-components/viewer/styles-BRCkEU3w.mjs +0 -1
  471. package/dist/web-components/viewer/viewer-ipqAA-xQ.mjs +0 -28
  472. package/dist/web-components/viewer-DEHIsIHd.mjs +0 -1
  473. /package/dist/{ui → i18n}/languageCode.mjs +0 -0
@@ -1 +1 @@
1
- import{d as n,i as o}from"./index-B7nZdqLg.mjs";export{n as defineCloverElements,o as initCloverI18n};
1
+ import{d as n,i as o}from"./index-BZ7b9k0N.mjs";export{n as defineCloverElements,o as initCloverI18n};
@@ -0,0 +1 @@
1
+ import{T as m,u as r}from"./shared-MTsMddHx.mjs";import{I as o}from"./Items-BHzT9A73.mjs";import{w as n}from"./nodes-CTw9OqlA.mjs";function I({props:t}){const e=m(()=>n(t,["renderItem"]),[t]);return r(o,{...e})}export{I as ItemsElement};
@@ -0,0 +1 @@
1
+ import{O as p,W as l,E as r,r as g,a9 as v}from"./shared-MTsMddHx.mjs";function h(t){var i;return(i=v(t).find(({body:a})=>a.type))==null?void 0:i.body.type}function y(t){const i=h(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:i}}const f=new WeakMap;function O(t){if(!t)return[];let i=f.get(t);if(!i){const{canvases:a,views:e}=r(t);i=e.map(u=>{const n=u.map(s=>y(a[s]));return{id:n[0].id,parts:n,label:n.length===1?n[0].label:{none:[n.map(s=>g(s.label).text).filter(Boolean).join(" \u2013 ")]}}}),f.set(t,i)}return i}const d=new WeakMap;function o(t){if(!t)return[];let i=d.get(t);return i||(i=p(t.items).filter(a=>a==null?void 0:a.id).map(a=>{var e;return{id:a.id,parts:[y(a)],label:a.label,summary:a.summary,...typeof a.navDate=="string"?{navDate:a.navDate}:{},href:((e=p(a.homepage)[0])==null?void 0:e.id)??a.id,...l(p(a.homepage)[0])?{hrefLang:l(p(a.homepage)[0])}:{}}}),d.set(t,i)),i}function A(t){return t?Array.isArray(t)?o({items:t}):t.type==="Collection"?o(t):O(t):[]}export{O as a,A as b,o as i};
@@ -0,0 +1 @@
1
+ import{u as e}from"./shared-MTsMddHx.mjs";import{L as o}from"./Label-KabnxuMN.mjs";function n({props:r}){return e(o,{...r})}export{n as LabelElement};
@@ -0,0 +1 @@
1
+ import{a4 as K,a5 as O,O as g,a6 as j,a7 as E,w as G}from"./shared-MTsMddHx.mjs";import{b as H}from"./imageService-0eTvQ-3h.mjs";import{c as J}from"./choice-key-BUNebLKe.mjs";const Q=/^((application|audio|video)\/)?(vnd\.apple\.|x-)?mpegurl$/i,U=(t,o)=>!!(t&&/\.m3u8$/i.test(t.split(/[?#]/)[0]))||!!(o&&Q.test(o)),X={width:1600,height:900};function tt(t,o){const e=new Array(t.length);if(!t.length)return e;const n=t.map(N),i=o==="left-to-right"||o==="right-to-left",s=o==="right-to-left"||o==="bottom-to-top",u=i?n[0].height:n[0].width,r=t.map((a,d)=>d);s&&r.reverse();let c=0;for(const a of r){const d=n[a],f=u/(i?d.height:d.width),y=d.width*f,p=d.height*f;e[a]=i?{x:c,y:0,width:y,height:p}:{x:0,y:c,width:y,height:p},c+=i?y:p}return e}function N(t){var s,u;if(t.width&&t.height)return{width:t.width,height:t.height};const o=L(t);if(o!=null&&o.width&&o.height)return{width:o.width,height:o.height};const e=((s=k(t)[0])==null?void 0:s.body)??((u=W(t)[0])==null?void 0:u.body),n=Number(e==null?void 0:e.width),i=Number(e==null?void 0:e.height);return n>0&&i>0?{width:n,height:i}:X}function L(t){return t.accompanyingContainer??t.placeholderContainer}function ot(t,o,e,n,i){return J(t.id,o.id,e,n,i)}function pt(t){const o=[];for(const e of t)R(e,(n,i)=>{const s=n;if((s==null?void 0:s.type)!=="Choice")return;const u=g(s.items).filter(r=>!!r&&typeof r=="object");u.length>1&&o.push({key:i,canvasId:e.id,label:s.label,items:u.map(r=>({label:r.label,id:r.id,...typeof r.type=="string"?{type:r.type}:{},...typeof r.format=="string"?{format:r.format}:{}}))})});return o}const F={};function et(t){if(t.type!=="Video"&&!E(t.type)||!t.format||U(t.id,t.format)||typeof document>"u")return true;const o=t.type==="Video"?"video":"audio",e=F[o]??(F[o]=document.createElement(o));return typeof e.canPlayType!="function"?true:e.canPlayType(t.format)!==""}function lt(t){const o={};for(const e of t){const n=e.items.findIndex(et);n>0&&(o[e.key]=n)}return o}const V=new WeakMap,z=[];function nt(t){return j(t).some(o=>((o==null?void 0:o.type)==="Choice"?g(o.items):[o]).some(n=>(n==null?void 0:n.type)==="Video"||E(n==null?void 0:n.type)))}function it(t){var u;const o=V.get(t);if(o)return o;const e=[];for(const r of t.items??[])for(const c of r.items??[]){if(!K(c))continue;const a=c.target?(u=O(c.target))==null?void 0:u.t:void 0;if(!a)continue;const[d,f]=a.split(",").map(Number);Number.isFinite(d)&&e.push({annotation:c,start:d,end:Number.isFinite(f)?f:NaN})}if(e.every(r=>nt(r.annotation)))return V.set(t,z),z;e.sort((r,c)=>r.start-c.start);const n=Number(t.duration),i=Number.isFinite(n)&&n/e.length||.5;e.forEach((r,c)=>{var d;const a=(d=e[c+1])==null?void 0:d.start;r.end>r.start||(a!=null?r.end=a>r.start?a:r.start+i:Number.isFinite(n)&&n>r.start?r.end=n:r.end>r.start||(r.end=r.start+i))});const s=e.length>1?e:z;return V.set(t,s),s}const A=t=>`frame:${t.id}`;function R(t,o){(t.items??[]).forEach((e,n)=>{(e.items??[]).forEach((i,s)=>{K(i)&&j(i).forEach((u,r)=>o(u,ot(t,i,n,s,r),i))})})}function k(t,o={},{allFrames:e=false}={}){const n=[];return D(t,o,(i,s,u)=>{i.body.type==="Image"&&n.push({body:i.body,region:i.region,...i.rotation?{rotation:i.rotation}:{},target:s,...u>=0?{frame:u}:{}})},e),n}function W(t,o={}){const e=[];return D(t,o,(n,i,s,u)=>{const r=n.body.type;if(r!=="Video"&&!E(r))return;const c=G(u);e.push({kind:r==="Video"?"video":"audio",body:n.body,target:i,...c?{time:c}:{}})}),e}function rt(t){const o=t.filter(n=>n.time&&typeof n.body.id=="string"),e=new Set(o.map(n=>n.time.start));if(!(o.length<2||e.size!==o.length))return o.sort((n,i)=>n.time.start-i.time.start).map(n=>{const i=Number(n.body.duration)||(n.time.end!==void 0?n.time.end-n.time.start:void 0);return{src:n.body.id,...n.body.format?{format:n.body.format}:{},start:n.time.start,...i?{duration:i}:{}}})}function D(t,o,e,n=false){const i=t.width??0,s=t.height??0,u=it(t),r=Math.min(o[A(t)]??0,Math.max(0,u.length-1));R(t,(c,a,d)=>{const f=u.findIndex(x=>x.annotation===d);if(!n&&f>=0&&f!==r)return;const y=M(c,o[a]??0);if(!y)return;const p=d.target?O(d.target):void 0,b=p==null?void 0:p.rect;e(y,b?{x:b.x,y:b.y,width:b.w,height:b.h}:{x:0,y:0,width:i||Number(y.body.width)||0,height:s||Number(y.body.height)||0},f,p==null?void 0:p.t)})}function st(t){return ut(t).filter(o=>o.kind!=="transcript")}function ct(t){const o=g(t.provides);return o.includes("closedCaptions")?"captions":o.includes("subtitles")||o.includes("translation")?"subtitles":o.includes("transcript")?"transcript":"captions"}function ut(t){const o=[],e=[...t.annotations??[],...t.items??[]];for(const n of e)for(const i of n.items??[])if(g(i.motivation).includes("supplementing"))for(const s of g(i.body)){const u=s,r=(u==null?void 0:u.type)==="Choice"?g(u.items):[u];for(const c of r){const a=c==null?void 0:c.id;!((c==null?void 0:c.format)==="text/vtt"||typeof a=="string"&&/\.vtt(\?|$)/i.test(a))||typeof a!="string"||o.push({id:a,label:c.label,language:g(c.language)[0],kind:ct(i)})}}return o}function yt(t){const o=[],e=i=>{const s=i,u=s==null?void 0:s.id;if(typeof u!="string"||o.some(c=>c.id===u))return;const r=s==null?void 0:s.format;(r?r!=="text/plain":!/\.txt(\?|$)/i.test(u))||o.push({id:u,label:s==null?void 0:s.label,language:g(s==null?void 0:s.language)[0]})},n=[...t.annotations??[],...t.items??[]];for(const i of n)for(const s of i.items??[])if(g(s.motivation).includes("supplementing"))for(const u of g(s.body)){const r=u;((r==null?void 0:r.type)==="Choice"?g(r.items):[r]).forEach(e)}return g(t.rendering).forEach(e),o}function M(t,o=0){if(!t||typeof t!="object")return null;const e=t;if(e.type==="Choice"){const n=g(e.items);return M(n[o]??n[0])}if(e.type==="SpecificResource"&&e.source){const n=typeof e.source=="string"?{id:e.source}:e.source,i=g(e.selector).find(r=>(r==null?void 0:r.type)==="ImageApiSelector"),s=M({type:"Image",...n});if(!s)return null;const u=(i==null?void 0:i.rotation)!=null?String(i.rotation):void 0;return{...s,region:(i==null?void 0:i.region)||s.region,...u?{rotation:u}:{}}}return e.type!=="Image"&&e.type!=="Video"&&!E(e.type)?null:{body:e,region:typeof e.region=="string"?e.region:void 0}}function mt(t,o,e={},{standIns:n=true}={}){const i=tt(t,o),s=[],u=[],r={};return t.forEach((c,a)=>{const d=i[a],f=N(c),y=d.width/f.width,p=d.height/f.height,b=h=>({x:d.x+h.x*y,y:d.y+h.y*p,width:h.width*y,height:h.height*p}),x=W(c,e),I=k(c,e,{allFrames:true}).map(h=>({...h,canvas:c})),S=L(c);if(n&&!I.length&&x.some(h=>h.kind==="audio")&&S){const h=N(S);for(const l of k(S))I.push({...l,canvas:S,target:{x:l.target.x/h.width*f.width,y:l.target.y/h.height*f.height,width:l.target.width/h.width*f.width,height:l.target.height/h.height*f.height}})}const Y=e[A(c)]??0;I.forEach(({body:h,target:l,region:T,rotation:$,frame:w,canvas:Z},q)=>{var P;const C=H(h.service);if(!C&&!h.id)return;const _=`${Z.id}|${q}|${h.id??C}|${T??""}|${$??""}`,B=!(C&&T);if(s.push({id:_,service:C,url:h.id,width:B&&Number(h.width)||void 0,height:B&&Number(h.height)||void 0,region:T,...$?{rotation:$}:{},placement:b(l),...w!=null&&w!==Y?{hidden:true}:{}}),w!=null){const v=r[P=A(c)]??(r[P]=[]);(v[w]??(v[w]=[])).push(_)}});const[m]=x;if(m!=null&&m.body.id){const h=rt(x),l=h?h[0]:void 0;u.push({id:`${c.id}|media|${m.body.id}`,kind:m.kind,src:(l==null?void 0:l.src)??m.body.id,format:l?l.format:m.body.format,placement:b(m.target),duration:h?Number(c.duration)||void 0:Number(m.body.duration??c.duration)||void 0,...h?{segments:h}:{},poster:ht(c),captions:st(c)})}}),{images:s,media:u,placements:i,frames:r}}function ht(t){var o;return(o=dt(t))==null?void 0:o.source}const bt=1280;function dt(t){var c;const o=t.placeholderContainer;if(!o)return;const e=(c=k(o)[0])==null?void 0:c.body;if(!e)return;const n=H(e.service),i=typeof e.id=="string"?e.id:void 0,s=n?{service:n,fallback:i}:i?{src:i}:void 0;if(!s)return;const{width:u,height:r}=N(o);return{source:s,width:u,height:r}}function wt(t,o,e){const n=N(t),i=o.width/n.width,s=o.height/n.height;return{x:o.x+e.x*i,y:o.y+e.y*s,width:e.width*i,height:e.height*s}}export{bt as S,yt as a,it as b,ut as c,mt as d,A as e,pt as f,wt as g,N as h,W as i,st as j,U as k,et as l,dt as p,M as r,lt as s};
@@ -0,0 +1 @@
1
+ import{O as n,a6 as p,a5 as c}from"./shared-MTsMddHx.mjs";function g(r){if(n(r==null?void 0:r.motivation).includes("linking"))for(const i of p(r)){if((i==null?void 0:i.type)==="TextualBody"||typeof(i==null?void 0:i.value)=="string")continue;const t=(i==null?void 0:i.type)==="SpecificResource"?i.source:i,e=typeof t=="string"?t:t==null?void 0:t.id;if(!(typeof e!="string"||!e)){if((t==null?void 0:t.type)==="Canvas"){const f=n(t.partOf).find(s=>(s==null?void 0:s.id)&&(!s.type||s.type==="Manifest")),u=c(e).id;return{id:e,canvasId:u,...f?{manifestId:f.id}:{}}}if((t==null?void 0:t.type)==="Manifest"||(t==null?void 0:t.type)==="Collection")return{id:e,manifestId:e};if(/^https?:\/\//i.test(e))return{id:e}}}}function o(r){const i=n(r==null?void 0:r.motivation);if(!(!i.includes("tagging")&&!i.includes("identifying")))for(const t of p(r)){if((t==null?void 0:t.type)==="TextualBody"||typeof(t==null?void 0:t.value)=="string")continue;const e=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,f=typeof e=="string"?e:e==null?void 0:e.id;if(typeof f=="string"&&/^https?:\/\//i.test(f))return{id:f}}}export{o as a,g as r};
@@ -0,0 +1 @@
1
+ import{u as t}from"./shared-MTsMddHx.mjs";import{L as n}from"./Provider-C8se8i4I.mjs";function i({hosted:o,props:r}){var e;return((e=o.element.parentElement)==null?void 0:e.localName)==="clover-provider"?null:t(n,{...r})}export{i as LogoElement};
@@ -0,0 +1 @@
1
+ import{a4 as M,a6 as l,O as f}from"./shared-MTsMddHx.mjs";const m=45,d=75*Math.PI/180,h=5*Math.PI/180,p=Math.PI-h,y=1.1,g=.35,I=4;function P(n,a=1){const t=m*Math.PI/180,o=2*Math.atan(Math.tan(t/2)*a),s=Math.min(t,o);return Math.max(n,1e-6)/Math.sin(s/2)*y}function x(n,a=1){return{theta:0,phi:d,distance:P(n.radius,a)}}function E(n,a,t){return{...n,theta:n.theta+a,phi:Math.min(p,Math.max(h,n.phi+t))}}function R(n,a,t){const o=n.distance/a;return{...n,distance:Math.min(t.distance*I,Math.max(t.distance*g,o))}}function z(n,a){const{theta:t,phi:o,distance:s}=n;return[a[0]+s*Math.sin(o)*Math.sin(t),a[1]+s*Math.cos(o),a[2]+s*Math.sin(o)*Math.cos(t)]}function A(n,a){const t=(s,i)=>Math.abs(s-i)<1e-6,o=(n.theta-a.theta)%(2*Math.PI);return(t(o,0)||t(Math.abs(o),2*Math.PI))&&t(n.phi,a.phi)&&t(n.distance,a.distance)}const O=["model/gltf-binary","model/gltf+json"],c=(n,a)=>{const t=Number(n);return Number.isFinite(t)?t:a};function F(n){return n.format?O.includes(n.format.toLowerCase()):/\.(glb|gltf)(\?|#|$)/i.test(n.src)}function b(n){return f(n.transform).flatMap(a=>{const t=a,o=(t==null?void 0:t.type)==="ScaleTransform"?"scale":(t==null?void 0:t.type)==="RotateTransform"?"rotate":(t==null?void 0:t.type)==="TranslateTransform"?"translate":null;if(!o||!t)return[];const s=o==="scale"?1:0;return[{type:o,x:c(t.x,s),y:c(t.y,s),z:c(t.z,s)}]})}function S(n){for(const a of f(n)){const t=a;if((t==null?void 0:t.type)!=="SpecificResource")continue;const o=f(t.selector).find(s=>(s==null?void 0:s.type)==="PointSelector");if(o)return[c(o.x,0),c(o.y,0),c(o.z,0)]}return[0,0,0]}const u=new WeakMap;function _(n){const a=u.get(n);if(a)return a;const t=[];for(const o of n.items??[])for(const s of(o==null?void 0:o.items)??[])if(M(s))for(let i of l(s)){(i==null?void 0:i.type)==="Choice"&&(i=f(i.items)[0]);const r=(i==null?void 0:i.type)==="SpecificResource"?i:null,e=r?typeof r.source=="string"?{id:r.source,type:"Model"}:r.source:i;(e==null?void 0:e.type)!=="Model"||typeof e.id!="string"||t.push({id:String(s.id??e.id),src:e.id,...typeof e.format=="string"?{format:e.format}:{},...e.label?{label:e.label}:{},position:S(s.target),transforms:r?b(r):[]})}return u.set(n,t),t}function w(n){const a=n.backgroundColor;return typeof a=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a)?a:void 0}export{m as F,O as M,w as a,A as b,z as c,x as h,F as i,_ as s,E as t,R as z};
@@ -0,0 +1 @@
1
+ const e=JSON.parse('{"commonClose":"Lukk","commonNext":"Neste","commonPrevious":"Forrige","commonSearch":"S\xF8k","commonViewAll":"Se alle","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Laster inn...","contentSearchPlaceholder":"S\xF8k","contentSearchResultsNone":"Ingen resultat","contentSearchResult":"1 resultat","contentSearchResults":"{{count}} resultater","contentSearchError":"S\xF8ket kunne ikke fullf\xF8res.","contentSearchPosition":"Resultat {{index}} av {{total}}","contentSearchClear":"T\xF8m s\xF8ket","canvasPosition":"Element {{index}} av {{total}}","canvasImage":"Bilde","bodyUnloadableImage":"Dette bildet kunne ikke lastes inn.","bodyUnloadableVideo":"Denne videoen kunne ikke lastes inn.","bodyUnloadableAudio":"Denne lyden kunne ikke lastes inn.","bodyUnloadableModel":"Denne modellen kunne ikke lastes inn.","canvasRoleDescription":"zoombart bilde","canvasKeysImage":"Bruk piltastene for \xE5 flytte bildet, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visningen, og R eller Shift+R for \xE5 rotere.","canvasKeysMedia":"Trykk mellomrom eller K for \xE5 spille av eller pause, J eller L for \xE5 spole ti sekunder bakover eller fremover, og M for \xE5 sl\xE5 lyden av eller p\xE5.","canvasKeysAnnotations":"Trykk Esc for \xE5 fjerne valget av annoteringen.","sceneModel":"3D-modell","sceneRoleDescription":"roterbar 3D-modell","sceneKeys":"Bruk piltastene for \xE5 rotere modellen, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visningen, og R eller Shift+R for \xE5 rotere den mot h\xF8yre eller venstre.","sceneRotateUp":"Roter oppover","sceneRotateDown":"Roter nedover","sceneRotate":"Roter","sceneResetView":"Tilbakestill visningen","statusLoading":"Laster inn\u2026","statusError":"Dette kunne ikke lastes inn.","itemsLabel":"Elementer","download":"Last ned","downloadPage":"Denne siden","downloadAll":"Alle sider","templateSidebar":"Elementer","templateSidebarToggle":"Vis elementer","collectionLabel":"Samling","itemsScrollBack":"Vis forrige elementer","itemsScrollForward":"Vis flere elementer","aboutRights":"Rettigheter","aboutDate":"Dato","aboutHomepage":"Hjemmeside","aboutSeeAlso":"Se ogs\xE5","aboutProvider":"Leverand\xF8r","logo":"Logo","aboutManifest":"IIIF-manifest","aboutCanvas":"IIIF-lerret","aboutPartOf":"Del av","aboutOpenManifest":"\xC5pne hele manifestet","aboutCollection":"IIIF-samling","readingLanguage":"Spr\xE5k","annotationsHide":"Skjul annoteringer","annotationsHideTip":"Skjul","readMore":"Les mer","readLess":"Les mindre","annotationsShow":"Vis p\xE5 bildet","annotationsShowTime":"Vis i opptaket","annotationsImage":"Bilde","annotationsLanguage":"Spr\xE5k","annotationsOpenLink":"\xC5pne lenken","transcriptLabel":"Transkripsjon","imageViewerOpen":"\xC5pne bildeviseren","imageViewerClose":"Lukk bildeviseren","canvasChoice":"Valg","imageFullScreen":"Fullskjerm","imageExitFullScreen":"Avslutt fullskjerm","imageResetZoom":"Tilbakestill zoom","imageRotateLeft":"Roter mot venstre","imageRotateRight":"Roter mot h\xF8yre","imageZoomIn":"Zoom inn","imageZoomOut":"Zoom ut","informationPanelTabs":"Informasjonspanel","sectionsScrollBack":"Vis forrige faner","sectionsScrollForward":"Vis flere faner","informationPanelClose":"Lukk informasjonspanelet","informationPanelTabsAbout":"Om","informationPanelTabsAnnotations":"Annoteringer","informationPanelTabsSearch":"S\xF8k","informationPanelTabsContents":"Innhold","contentsSectionsIn":"Deler av","informationPanelTabsMap":"Kart","informationPanelTabsCollection":"Samling","informationPanelTabsTargets":"Visninger","mapUnavailable":"Kartet kunne ikke vises.","mapLabel":"Kart","mapAttribution":"Kartkreditering","mapPlaceUntitled":"Sted {{number}}","mapOverlay":"Georeferert bilde","mapPlacesListed":"Steder oppf\xF8rt etter kartet: {{count}}","informationPanelToggle":"Mer informasjon","playerPlay":"Spill av","playerPause":"Pause","playerClose":"Lukk avspilleren","playerMute":"Demp","playerUnmute":"Sl\xE5 p\xE5 lyd","playerVolume":"Volum","playerSeek":"Avspillingsposisjon","playerCaptions":"Teksting","playerCaptionsOff":"Av","playerChapters":"Kapitler","frameRepeat":"Gjenta","playerCurrentTime":"N\xE5v\xE6rende tid","playerDuration":"Varighet","splitHandle":"Endre st\xF8rrelse p\xE5 panelene"}');export{e as default};
@@ -0,0 +1 @@
1
+ const e=JSON.parse('{"commonClose":"Lukk","commonNext":"Neste","commonPrevious":"F\xF8rre","commonSearch":"S\xF8k","commonViewAll":"Sj\xE5 alle","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Lastar inn...","contentSearchPlaceholder":"S\xF8k","contentSearchResultsNone":"Ingen resultat","contentSearchResult":"1 resultat","contentSearchResults":"{{count}} resultat","contentSearchError":"S\xF8ket kunne ikkje fullf\xF8rast.","contentSearchPosition":"Resultat {{index}} av {{total}}","contentSearchClear":"T\xF8m s\xF8ket","canvasPosition":"Element {{index}} av {{total}}","canvasImage":"Bilete","bodyUnloadableImage":"Dette biletet kunne ikkje lastast inn.","bodyUnloadableVideo":"Denne videoen kunne ikkje lastast inn.","bodyUnloadableAudio":"Denne lyden kunne ikkje lastast inn.","bodyUnloadableModel":"Denne modellen kunne ikkje lastast inn.","canvasRoleDescription":"zoombart bilete","canvasKeysImage":"Bruk piltastane for \xE5 flytte biletet, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visinga, og R eller Shift+R for \xE5 rotere.","canvasKeysMedia":"Trykk mellomrom eller K for \xE5 spele av eller pause, J eller L for \xE5 spole ti sekund bakover eller framover, og M for \xE5 sl\xE5 lyden av eller p\xE5.","canvasKeysAnnotations":"Trykk Esc for \xE5 fjerne valet av annoteringa.","sceneModel":"3D-modell","sceneRoleDescription":"roterbar 3D-modell","sceneKeys":"Bruk piltastane for \xE5 rotere modellen, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visinga, og R eller Shift+R for \xE5 rotere han mot h\xF8gre eller venstre.","sceneRotateUp":"Roter oppover","sceneRotateDown":"Roter nedover","sceneRotate":"Roter","sceneResetView":"Tilbakestill visinga","statusLoading":"Lastar inn\u2026","statusError":"Dette kunne ikkje lastast inn.","itemsLabel":"Element","download":"Last ned","downloadPage":"Denne sida","downloadAll":"Alle sider","templateSidebar":"Element","templateSidebarToggle":"Vis element","collectionLabel":"Samling","itemsScrollBack":"Vis f\xF8rre element","itemsScrollForward":"Vis fleire element","aboutRights":"Rettigheiter","aboutDate":"Dato","aboutHomepage":"Heimeside","aboutSeeAlso":"Sj\xE5 ogs\xE5","aboutProvider":"Leverand\xF8r","logo":"Logo","aboutManifest":"IIIF-manifest","aboutCanvas":"IIIF-lerret","aboutPartOf":"Del av","aboutOpenManifest":"Opne heile manifestet","aboutCollection":"IIIF-samling","readingLanguage":"Spr\xE5k","annotationsHide":"Skjul annoteringar","annotationsHideTip":"Skjul","readMore":"Les meir","readLess":"Les mindre","annotationsShow":"Vis p\xE5 biletet","annotationsShowTime":"Vis i opptaket","annotationsImage":"Bilete","annotationsLanguage":"Spr\xE5k","annotationsOpenLink":"Opne lenkja","transcriptLabel":"Transkripsjon","imageViewerOpen":"Opne biletvisaren","imageViewerClose":"Lukk biletvisaren","canvasChoice":"Val","imageFullScreen":"Fullskjerm","imageExitFullScreen":"Avslutt fullskjerm","imageResetZoom":"Tilbakestill zoom","imageRotateLeft":"Roter mot venstre","imageRotateRight":"Roter mot h\xF8gre","imageZoomIn":"Zoom inn","imageZoomOut":"Zoom ut","informationPanelTabs":"Informasjonspanel","sectionsScrollBack":"Vis f\xF8rre faner","sectionsScrollForward":"Vis fleire faner","informationPanelClose":"Lukk informasjonspanelet","informationPanelTabsAbout":"Om","informationPanelTabsAnnotations":"Annoteringar","informationPanelTabsSearch":"S\xF8k","informationPanelTabsContents":"Innhald","contentsSectionsIn":"Delar av","informationPanelTabsMap":"Kart","informationPanelTabsCollection":"Samling","informationPanelTabsTargets":"Visingar","mapUnavailable":"Kartet kunne ikkje visast.","mapLabel":"Kart","mapAttribution":"Kartkreditering","mapPlaceUntitled":"Stad {{number}}","mapOverlay":"Georeferert bilete","mapPlacesListed":"Stader lista opp etter kartet: {{count}}","informationPanelToggle":"Meir informasjon","playerPlay":"Spel av","playerPause":"Pause","playerClose":"Lukk avspelaren","playerMute":"Demp","playerUnmute":"Sl\xE5 p\xE5 lyd","playerVolume":"Volum","playerSeek":"Avspelingsposisjon","playerCaptions":"Teksting","playerCaptionsOff":"Av","playerChapters":"Kapittel","frameRepeat":"Gjenta","playerCurrentTime":"Noverande tid","playerDuration":"Varigheit","splitHandle":"Endre storleiken p\xE5 panela"}');export{e as default};
@@ -0,0 +1 @@
1
+ const e=JSON.parse('{"commonClose":"Lukk","commonNext":"Neste","commonPrevious":"Forrige","commonSearch":"S\xF8k","commonViewAll":"Se alle","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Laster inn...","contentSearchPlaceholder":"S\xF8k","contentSearchResultsNone":"Ingen resultat","contentSearchResult":"1 resultat","contentSearchResults":"{{count}} resultater","contentSearchError":"S\xF8ket kunne ikke fullf\xF8res.","contentSearchPosition":"Resultat {{index}} av {{total}}","contentSearchClear":"T\xF8m s\xF8ket","canvasPosition":"Element {{index}} av {{total}}","canvasImage":"Bilde","bodyUnloadableImage":"Dette bildet kunne ikke lastes inn.","bodyUnloadableVideo":"Denne videoen kunne ikke lastes inn.","bodyUnloadableAudio":"Denne lyden kunne ikke lastes inn.","bodyUnloadableModel":"Denne modellen kunne ikke lastes inn.","canvasRoleDescription":"zoombart bilde","canvasKeysImage":"Bruk piltastene for \xE5 flytte bildet, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visningen, og R eller Shift+R for \xE5 rotere.","canvasKeysMedia":"Trykk mellomrom eller K for \xE5 spille av eller pause, J eller L for \xE5 spole ti sekunder bakover eller fremover, og M for \xE5 sl\xE5 lyden av eller p\xE5.","canvasKeysAnnotations":"Trykk Esc for \xE5 fjerne valget av annoteringen.","sceneModel":"3D-modell","sceneRoleDescription":"roterbar 3D-modell","sceneKeys":"Bruk piltastene for \xE5 rotere modellen, med Shift for lengre steg, pluss og minus for \xE5 zoome, 0 for \xE5 tilbakestille visningen, og R eller Shift+R for \xE5 rotere den mot h\xF8yre eller venstre.","sceneRotateUp":"Roter oppover","sceneRotateDown":"Roter nedover","sceneRotate":"Roter","sceneResetView":"Tilbakestill visningen","statusLoading":"Laster inn\u2026","statusError":"Dette kunne ikke lastes inn.","itemsLabel":"Elementer","download":"Last ned","downloadPage":"Denne siden","downloadAll":"Alle sider","templateSidebar":"Elementer","templateSidebarToggle":"Vis elementer","collectionLabel":"Samling","itemsScrollBack":"Vis forrige elementer","itemsScrollForward":"Vis flere elementer","aboutRights":"Rettigheter","aboutDate":"Dato","aboutHomepage":"Hjemmeside","aboutSeeAlso":"Se ogs\xE5","aboutProvider":"Leverand\xF8r","logo":"Logo","aboutManifest":"IIIF-manifest","aboutCanvas":"IIIF-lerret","aboutPartOf":"Del av","aboutOpenManifest":"\xC5pne hele manifestet","aboutCollection":"IIIF-samling","readingLanguage":"Spr\xE5k","annotationsHide":"Skjul annoteringer","annotationsHideTip":"Skjul","readMore":"Les mer","readLess":"Les mindre","annotationsShow":"Vis p\xE5 bildet","annotationsShowTime":"Vis i opptaket","annotationsImage":"Bilde","annotationsLanguage":"Spr\xE5k","annotationsOpenLink":"\xC5pne lenken","transcriptLabel":"Transkripsjon","imageViewerOpen":"\xC5pne bildeviseren","imageViewerClose":"Lukk bildeviseren","canvasChoice":"Valg","imageFullScreen":"Fullskjerm","imageExitFullScreen":"Avslutt fullskjerm","imageResetZoom":"Tilbakestill zoom","imageRotateLeft":"Roter mot venstre","imageRotateRight":"Roter mot h\xF8yre","imageZoomIn":"Zoom inn","imageZoomOut":"Zoom ut","informationPanelTabs":"Informasjonspanel","sectionsScrollBack":"Vis forrige faner","sectionsScrollForward":"Vis flere faner","informationPanelClose":"Lukk informasjonspanelet","informationPanelTabsAbout":"Om","informationPanelTabsAnnotations":"Annoteringer","informationPanelTabsSearch":"S\xF8k","informationPanelTabsContents":"Innhold","contentsSectionsIn":"Deler av","informationPanelTabsMap":"Kart","informationPanelTabsCollection":"Samling","informationPanelTabsTargets":"Visninger","mapUnavailable":"Kartet kunne ikke vises.","mapLabel":"Kart","mapAttribution":"Kartkreditering","mapPlaceUntitled":"Sted {{number}}","mapOverlay":"Georeferert bilde","mapPlacesListed":"Steder oppf\xF8rt etter kartet: {{count}}","informationPanelToggle":"Mer informasjon","playerPlay":"Spill av","playerPause":"Pause","playerClose":"Lukk avspilleren","playerMute":"Demp","playerUnmute":"Sl\xE5 p\xE5 lyd","playerVolume":"Volum","playerSeek":"Avspillingsposisjon","playerCaptions":"Teksting","playerCaptionsOff":"Av","playerChapters":"Kapitler","frameRepeat":"Gjenta","playerCurrentTime":"N\xE5v\xE6rende tid","playerDuration":"Varighet","splitHandle":"Endre st\xF8rrelse p\xE5 panelene"}');export{e as default};
@@ -1 +1 @@
1
- import{A as i,q as f,C as p,_ as l,u as a}from"./shared-YUjOSBKO.mjs";const b={childList:true,subtree:true,attributes:true,attributeFilter:["value","label","slot","controls"]};function h(t,e,n){const r=i(null),o=f(s=>{const u=new MutationObserver(s);return u.observe(t,b),()=>u.disconnect()},[t]);return p(o,()=>{const s=e();return r.current&&n(r.current.value,s)?r.current.value:(r.current={value:s},s)})}const v=(t,e)=>[...t.children].find(n=>n.getAttribute("slot")===e)??null;function y(t,e){return h(t,()=>v(t,e),Object.is)}function C({of:t}){const e=i(null);return l(()=>{const n=e.current;if(!n)return;const r=()=>n.replaceChildren(...[...t.childNodes].map(c=>c.cloneNode(true)));r();const o=new MutationObserver(r);return o.observe(t,{childList:true,subtree:true,characterData:true,attributes:true}),()=>o.disconnect()},[t]),a("span",{ref:e,style:{display:"contents"}})}function M({from:t,stays:e}){const n=i(null);return l(()=>{const r=n.current;if(!r)return;const o=()=>{for(const s of[...t.childNodes])e(s)||r.append(s)};o();const c=new MutationObserver(o);return c.observe(t,{childList:true}),()=>{c.disconnect(),t.append(...r.childNodes)}},[t,e]),a("div",{ref:n,style:{display:"contents"}})}function O({from:t,picks:e}){const n=i(null);return l(()=>{const r=n.current;if(!r)return;let o=[];const c=()=>{const u=[...t.childNodes].filter(e);u.length&&(o=o.filter(d=>d.parentNode===r.parentNode),(o.at(-1)??r).after(...u),o.push(...u))};c();const s=new MutationObserver(c);return s.observe(t,{childList:true}),()=>{s.disconnect();for(const u of o)u.parentNode===r.parentNode&&t.append(u)}},[t,e]),a("span",{ref:n,hidden:true})}function N({value:t}){const e=i(null);return l(()=>{var n;(n=e.current)==null||n.replaceChildren(t instanceof Node?t:String(t))},[t]),a("span",{ref:e,style:{display:"contents"}})}function g(t,e){let n=t;for(const r of e){const o=t[r];typeof o=="function"&&(n={...n,[r]:(...c)=>{const s=o(...c);return s==null?s:a(N,{value:s})}})}return n}export{C,M,O as P,y as a,v as s,h as u,g as w};
1
+ import{A as i,q as f,C as p,_ as l,u as a}from"./shared-MTsMddHx.mjs";const b={childList:true,subtree:true,attributes:true,attributeFilter:["value","label","slot","controls"]};function h(t,e,n){const r=i(null),o=f(s=>{const u=new MutationObserver(s);return u.observe(t,b),()=>u.disconnect()},[t]);return p(o,()=>{const s=e();return r.current&&n(r.current.value,s)?r.current.value:(r.current={value:s},s)})}const v=(t,e)=>[...t.children].find(n=>n.getAttribute("slot")===e)??null;function y(t,e){return h(t,()=>v(t,e),Object.is)}function C({of:t}){const e=i(null);return l(()=>{const n=e.current;if(!n)return;const r=()=>n.replaceChildren(...[...t.childNodes].map(c=>c.cloneNode(true)));r();const o=new MutationObserver(r);return o.observe(t,{childList:true,subtree:true,characterData:true,attributes:true}),()=>o.disconnect()},[t]),a("span",{ref:e,style:{display:"contents"}})}function M({from:t,stays:e}){const n=i(null);return l(()=>{const r=n.current;if(!r)return;const o=()=>{for(const s of[...t.childNodes])e(s)||r.append(s)};o();const c=new MutationObserver(o);return c.observe(t,{childList:true}),()=>{c.disconnect(),t.append(...r.childNodes)}},[t,e]),a("div",{ref:n,style:{display:"contents"}})}function O({from:t,picks:e}){const n=i(null);return l(()=>{const r=n.current;if(!r)return;let o=[];const c=()=>{const u=[...t.childNodes].filter(e);u.length&&(o=o.filter(d=>d.parentNode===r.parentNode),(o.at(-1)??r).after(...u),o.push(...u))};c();const s=new MutationObserver(c);return s.observe(t,{childList:true}),()=>{s.disconnect();for(const u of o)u.parentNode===r.parentNode&&t.append(u)}},[t,e]),a("span",{ref:n,hidden:true})}function N({value:t}){const e=i(null);return l(()=>{var n;(n=e.current)==null||n.replaceChildren(t instanceof Node?t:String(t))},[t]),a("span",{ref:e,style:{display:"contents"}})}function g(t,e){let n=t;for(const r of e){const o=t[r];typeof o=="function"&&(n={...n,[r]:(...c)=>{const s=o(...c);return s==null?s:a(N,{value:s})}})}return n}export{C,M,O as P,y as a,v as s,h as u,g as w};
@@ -1 +1 @@
1
- import{f as c,b as s}from"./imageService-dsdmcegU.mjs";import{s as a}from"./sizedImage-uv_NlE0l.mjs";async function l(r,o,i){const t=typeof r.id=="string"?r.id:void 0,e=c(r.service);if(!e)return t;try{const n=await s(e,{request:i});return a(n,o)??t}catch{return t}}export{l as overlayImageUrl};
1
+ import{b as c,f as s}from"./imageService-0eTvQ-3h.mjs";import{s as a}from"./sizedImage-k4Q-eyOB.mjs";async function l(r,o,i){const t=typeof r.id=="string"?r.id:void 0,e=c(r.service);if(!e)return t;try{const n=await s(e,{request:i});return a(n,o)??t}catch{return t}}export{l as overlayImageUrl};
@@ -1 +1 @@
1
- import{d as v,A as g,y as p,u as s}from"./shared-YUjOSBKO.mjs";import{T as y,P as S}from"./Panel-DbsC8A9V.mjs";import{u as b,M as C,C as w,s as A}from"./nodes-B7JRwBgl.mjs";const k=l=>[...l.children].filter(t=>t.localName==="clover-tab").map((t,e)=>{const n=t.getAttribute("value")||String(e);return{element:t,value:n,label:t.getAttribute("label")||n,labelSlot:A(t,"label")}}),E=(l,t)=>l.length===t.length&&l.every((e,n)=>e.element===t[n].element&&e.value===t[n].value&&e.label===t[n].label&&e.labelSlot===t[n].labelSlot),M=l=>l instanceof Element&&l.getAttribute("slot")==="label",a=new WeakMap;let O=0;const P=l=>(a.has(l)||a.set(l,++O),a.get(l));function T(l){const t=l.ownerDocument;for(let e=l;e&&e!==t.body;e=e.parentElement){if(!e.id)continue;const n=e.id.replace(/["\\]/g,"\\$&");if(t.querySelector(`[aria-controls~="${n}"]`)){e.hidden=true;return}}l.hidden=true}function q({hosted:l,props:t}){const e=l.element,n=b(e,()=>k(e),E),{value:r,closable:i,onValueChange:m,onClose:f,...d}=t,[h,c]=v(r),u=g(r);return p(()=>{r!==u.current&&(u.current=r,r&&c(r))},[r]),s(S,{...d,value:h,onValueChange:o=>{c(o),m(o)},onClose:i?()=>{f()&&T(e)}:void 0,children:n.length?n.map(o=>s(y,{value:o.value,label:o.labelSlot?s(w,{of:o.labelSlot}):o.label,children:s(C,{from:o.element,stays:M})},P(o.element))):null})}export{q as PanelElement};
1
+ import{d as v,A as g,y as p,u as s}from"./shared-MTsMddHx.mjs";import{T as y,P as S}from"./Panel-CIdjOznL.mjs";import{u as b,M as C,C as w,s as A}from"./nodes-CTw9OqlA.mjs";const k=l=>[...l.children].filter(t=>t.localName==="clover-tab").map((t,e)=>{const n=t.getAttribute("value")||String(e);return{element:t,value:n,label:t.getAttribute("label")||n,labelSlot:A(t,"label")}}),E=(l,t)=>l.length===t.length&&l.every((e,n)=>e.element===t[n].element&&e.value===t[n].value&&e.label===t[n].label&&e.labelSlot===t[n].labelSlot),M=l=>l instanceof Element&&l.getAttribute("slot")==="label",a=new WeakMap;let O=0;const P=l=>(a.has(l)||a.set(l,++O),a.get(l));function T(l){const t=l.ownerDocument;for(let e=l;e&&e!==t.body;e=e.parentElement){if(!e.id)continue;const n=e.id.replace(/["\\]/g,"\\$&");if(t.querySelector(`[aria-controls~="${n}"]`)){e.hidden=true;return}}l.hidden=true}function q({hosted:l,props:t}){const e=l.element,n=b(e,()=>k(e),E),{value:r,closable:i,onValueChange:m,onClose:f,...d}=t,[h,c]=v(r),u=g(r);return p(()=>{r!==u.current&&(u.current=r,r&&c(r))},[r]),s(S,{...d,value:h,onValueChange:o=>{c(o),m(o)},onClose:i?()=>{f()&&T(e)}:void 0,children:n.length?n.map(o=>s(y,{value:o.value,label:o.labelSlot?s(w,{of:o.labelSlot}):o.label,children:s(C,{from:o.element,stays:M})},P(o.element))):null})}export{q as PanelElement};
@@ -0,0 +1 @@
1
+ import{T as i,u as e}from"./shared-MTsMddHx.mjs";import{w as u}from"./nodes-CTw9OqlA.mjs";function a(r,t=[]){return function({props:n}){const o=i(()=>u(n,t),[n]);return e(r,{...o})}}export{a as drawn};
@@ -0,0 +1 @@
1
+ import{a as y,c as E,b as v,T as S}from"./BodyUnloadable-DcTM7hHF.mjs";const M=r=>{const s=new Map,p=e=>{var t;return(t=s.get(e))==null?void 0:t.forEach(i=>i())};let a=false,o=null,n=null,d=false,l=null;const u=e=>{y(e)&&(d=true)},m=e=>{l=e.isPrimary&&e.button===0&&(e.target===r||e.target===n)?{x:e.clientX,y:e.clientY,t:e.timeStamp,direct:E(e.pointerType,d)}:null},f=e=>{const t=l;l=null,!(!t||e.timeStamp-t.t>=v||Math.hypot(e.clientX-t.x,e.clientY-t.y)>S)&&!(o!=null&&o())&&!t.direct&&p("tap")},c=e=>{e!==n&&(n==null||n.remove(),n=e,n&&(Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",objectFit:"contain"}),n.classList.add("clover-canvas-dom-media"),r.append(n)))};return r.addEventListener("pointermove",u),r.addEventListener("pointerdown",m),r.addEventListener("pointerup",f),{host:r,get isOpen(){return a},on(e,t){const i=s.get(e)??new Set;return s.set(e,i.add(t)),()=>i.delete(t)},async setImages(e,{world:t}={}){var g,L;const i=(L=(g=e.find(w=>w.media))==null?void 0:g.media)==null?void 0:L.element;c(i instanceof HTMLVideoElement?i:null),!(!t&&!e.length)&&(p(a?"change":"open"),a=true)},clear:()=>c(null),setDismiss(e){o=e},setGestures(){},dispose(){c(null),s.clear(),r.removeEventListener("pointermove",u),r.removeEventListener("pointerdown",m),r.removeEventListener("pointerup",f)}}};export{M as p};
@@ -0,0 +1 @@
1
+ function h(e){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(e)}function U(e,t){if(h(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t);if(h(r)!="object")return r;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W(e){var t=U(e,"string");return h(t)=="symbol"?t:t+""}function d(e,t,i){return(t=W(t))in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i,e}function E(e){return Array.isArray(e)?e:e?[e]:[]}function o(e){for(let t in e)(e[t]===void 0||e[t]===null)&&delete e[t];return e}const N="http://library.stanford.edu/iiif/image-api/compliance.html#level0",F="http://library.stanford.edu/iiif/image-api/compliance.html#level1",w="http://library.stanford.edu/iiif/image-api/compliance.html#level2",H="http://library.stanford.edu/iiif/image-api/conformance.html#level0",B="http://library.stanford.edu/iiif/image-api/conformance.html#level1",j="http://library.stanford.edu/iiif/image-api/conformance.html#level2",z="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",G="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",S="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",J="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",K="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",L="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",V="http://iiif.io/api/image/1/level0.json",X="http://iiif.io/api/image/1/profiles/level0.json",Y="http://iiif.io/api/image/1/level1.json",Z="http://iiif.io/api/image/1/profiles/level1.json",$="http://iiif.io/api/image/1/level2.json",R="http://iiif.io/api/image/1/profiles/level2.json",_="http://iiif.io/api/image/2/level0.json",Q="http://iiif.io/api/image/2/profiles/level0.json",tt="http://iiif.io/api/image/2/level1.json",et="http://iiif.io/api/image/2/profiles/level1.json",I="http://iiif.io/api/image/2/level2.json",T="http://iiif.io/api/image/2/profiles/level2.json",it="level0",rt="level1",k="level2",nt="http://iiif.io/api/image/2/level0",at="http://iiif.io/api/image/2/level1",M="http://iiif.io/api/image/2/level2",st=[M,w,j,S,L,$,R,I,T,k],ot=[nt,at,M,N,F,w,H,B,j,z,G,S,J,K,L,V,X,Y,Z,$,R,_,Q,tt,et,I,T,it,rt,k],lt=ot,ct=["http://iiif.io/api/image/2/level1","http://iiif.io/api/image/2/level2","http://library.stanford.edu/iiif/image-api/compliance.html#level1","http://library.stanford.edu/iiif/image-api/compliance.html#level2","http://library.stanford.edu/iiif/image-api/conformance.html#level1","http://library.stanford.edu/iiif/image-api/conformance.html#level2","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1","http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2","http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1","http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2","http://iiif.io/api/image/1/level1.json","http://iiif.io/api/image/1/profiles/level1.json","http://iiif.io/api/image/1/level2.json","http://iiif.io/api/image/1/profiles/level2.json","http://iiif.io/api/image/2/level1.json","http://iiif.io/api/image/2/profiles/level1.json","http://iiif.io/api/image/2/level2.json","http://iiif.io/api/image/2/profiles/level2.json","level1","level2"],A=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function pt(e){if(e==null)throw Error("Null or undefined is not a valid entity.");if(Array.isArray(e))throw Error("Array is not a valid entity");if(typeof e!="object")throw Error(`${typeof e} is not a valid entity`);if(typeof e["@type"]=="string"){let t=A.indexOf(e["@type"]);if(t!==-1)return A[t]}if(e.profile)return"Service";if(e.format||e["@type"])return"ContentResource";throw Error("Resource type is not known")}var ut=class O{constructor(t,i={}){d(this,"traversals",void 0),d(this,"options",void 0),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...t},this.options={convertPropsToArray:true,mergeMemberProperties:true,allowUndefinedReturn:false,...i}}static all(t){return new O({collection:[t],manifest:[t],canvas:[t],annotationList:[t],sequence:[t],annotation:[t],contentResource:[t],choice:[t],range:[t],service:[t],layer:[t]})}traverseCollection(t){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(t))),this.traversals.collection)}traverseCollectionItems(t){if(this.options.mergeMemberProperties){let i=[...(t.manifests||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:(n["@type"]||(n["@type"]="sc:Manifest"),n)),...(t.collections||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n),...t.members||[]],r=[],a=i.filter(n=>r.includes(n["@id"])?false:(r.push(n["@id"]),true));delete t.collections,delete t.manifests,t.members=a}return t.manifests&&(t.manifests=t.manifests.map(i=>{let r=i;return typeof i=="string"&&(r={"@id":i,"@type":"sc:Manifest"}),r["@type"]||(r["@type"]="sc:Manifest"),this.traverseManifest(r)})),t.collections&&(t.collections=t.collections.map(i=>this.traverseCollection(typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i))),t.members&&(t.members=t.members.map(i=>typeof i=="string"?i:i["@type"]==="sc:Collection"?this.traverseCollection(i):i["@type"]==="sc:Manifest"?this.traverseManifest(i):this.traverseUnknown(i))),t}traverseManifest(t){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(t))),this.traversals.manifest)}traverseManifestItems(t){return t.sequences&&(t.sequences=t.sequences.map(i=>this.traverseSequence(i))),t.structures&&(t.structures=t.structures.map(i=>this.traverseRange(i))),t}traverseSequence(t){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(t))),this.traversals.sequence)}traverseSequenceItems(t){return t.canvases&&(t.canvases=t.canvases.map(i=>this.traverseCanvas(i))),t}traverseCanvas(t){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(t))),this.traversals.canvas)}traverseCanvasItems(t){return t.images&&(t.images=t.images.map(i=>(i.on&&i["@type"]!=="oa:Annotation"&&i["@type"]!=="Annotation"&&(i["@type"]="oa:Annotation"),this.traverseAnnotation(i)))),t.otherContent&&(t.otherContent=t.otherContent.map(i=>this.traverseAnnotationList(i))),t}traverseRange(t){return t["@type"]!=="sc:Range"&&(t["@type"]="sc:Range"),this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(t))),this.traversals.range)}traverseRangeItems(t){if(this.options.mergeMemberProperties){let i=[...(t.ranges||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Range"}:r),...(t.canvases||[]).map(r=>typeof r=="string"?{"@id":r,"@type":"sc:Canvas"}:r),...t.members||[]];delete t.ranges,delete t.canvases,t.members=i.length?i.map(r=>this.traverseUnknown(r)):void 0}return t}traverseAnnotationList(t){let i=typeof t=="string"?{"@id":t,"@type":"sc:AnnotationList"}:t;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(i)),this.traversals.annotationList)}traverseAnnotationListItems(t){return t.resources&&(t.resources=t.resources.map(i=>this.traverseAnnotation(i))),t}traverseAnnotation(t){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(t))),this.traversals.annotation)}traverseAnnotationItems(t){return t.resource&&(Array.isArray(t.resource)?t.resource=t.resource.map(i=>this.traverseContentResource(i)):t.resource=this.traverseContentResource(t.resource)),t.on,t}traverseLayer(t){return this.traverseType(this.traverseLinking(this.traverseLayerItems(t)),this.traversals.layer)}traverseLayerItems(t){return t.otherContent&&(t.otherContent=t.otherContent.map(i=>this.traverseAnnotationList(i))),t}traverseChoice(t){return this.traverseType(this.traverseChoiceItems(t),this.traversals.choice)}traverseChoiceItems(t){return t.default&&t.default!=="rdf:nil"&&(t.default=this.traverseContentResource(t.default)),t.item&&t.item!=="rdf:nil"&&(t.item=t.item.map(i=>this.traverseContentResource(i))),t}traverseService(t){return this.traverseType(this.traverseLinking(t),this.traversals.service)}traverseContentResource(t){return t["@type"]==="oa:Choice"?this.traverseChoice(t):this.traverseType(this.traverseDescriptive(this.traverseLinking(t)),this.traversals.contentResource)}traverseUnknown(t){if(!t["@type"]||typeof t=="string")return t;switch(pt(t)){case"sc:Collection":return this.traverseCollection(t);case"sc:Manifest":return this.traverseManifest(t);case"sc:Canvas":return this.traverseCanvas(t);case"sc:Sequence":return this.traverseSequence(t);case"sc:Range":return this.traverseRange(t);case"oa:Annotation":return this.traverseAnnotation(t);case"sc:AnnotationList":return this.traverseAnnotationList(t);case"sc:Layer":return this.traverseLayer(t);case"Service":return this.traverseService(t);case"oa:Choice":return this.traverseChoice(t);case"ContentResource":return this.traverseContentResource(t)}return t.profile?this.traverseService(t):t}traverseImageResource(t){let i=Array.isArray(t),r=Array.isArray(t)?t:[t],a=[];for(let n of r)typeof n=="string"?a.push(this.traverseContentResource({"@id":n,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(n));return!i&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(t){return t.thumbnail&&(t.thumbnail=this.traverseImageResource(t.thumbnail)),t.logo&&(t.logo=this.traverseImageResource(t.logo)),t}traverseOneOrMoreServices(t){let i=Array.isArray(t),r=Array.isArray(t)?t:[t],a=[];for(let n of r)a.push(this.traverseService(n));return!i&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(t){return t.related&&(t.related=this.traverseOneOrManyType(t.related,this.traversals.contentResource)),t.rendering&&(t.rendering=this.traverseOneOrManyType(t.rendering,this.traversals.contentResource)),t.service&&(t.service=this.traverseOneOrMoreServices(t.service)),t.seeAlso&&(t.seeAlso=this.traverseOneOrManyType(t.seeAlso,this.traversals.contentResource)),t.within&&(typeof t.within=="string"||(t.within=this.traverseOneOrManyType(t.within,this.traversals.contentResource))),t.startCanvas&&(typeof t.startCanvas=="string"?t.startCanvas=this.traverseType({"@id":t.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):t.startCanvas&&this.traverseType(t.startCanvas,this.traversals.canvas)),t.contentLayer&&(typeof t.contentLayer=="string"?t.contentLayer=this.traverseLayer({"@id":t.contentLayer,"@type":"sc:Layer"}):t.contentLayer=this.traverseLayer(t.contentLayer)),t}traverseOneOrManyType(t,i){if(!Array.isArray(t))if(this.options.convertPropsToArray)t=[t];else return this.traverseType(t,i);return t.map(r=>this.traverseType(r,i))}traverseType(t,i){return i.reduce((r,a)=>{let n=a(r);return n===void 0&&!this.options.allowUndefinedReturn?r:n},t)}};const m={attributionLabel:"Attribution",providerId:"http://example.org/provider",providerName:""};function ft(e){if(typeof e=="string")return[e];if(!e)return[];let t=Array.isArray(e)?e:[e],i=[];for(let r of t){if(typeof r=="string"){i.push(r);continue}i.push({"@language":r["@language"]||r.language,"@value":r["@value"]||r.value})}return i}function f(e,t="none"){if(!e)return{none:[""]};let i=ft(e),r={};for(let a of i){if(typeof a=="string"){r[t]=r[t]?r[t]:[],r[t].push(a||"");continue}if(!a["@language"]){r[t]=r[t]?r[t]:[],r[t].push(a["@value"]||"");continue}let n=a["@language"];r[n]=r[n]?r[n]:[],r[n].push(a["@value"]||"")}return Object.keys(r).length===0?{none:[""]}:r}function D(e){if(Array.isArray(e))return D(e.find(t=>typeof t=="string"));if(st.indexOf(e)!==-1)return"level2";if(ct.indexOf(e)!==-1)return"level1";if(lt.indexOf(e)!==-1)return"level0";if(typeof e=="string")return e}function ht(e){let t=Array.isArray(e)?e:[e];for(let i of t)switch(i){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function vt(e){switch(e){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function b(e){for(let t of["sc","oa","dcterms","dctypes","iiif"])if(e.startsWith(`${t}:`))return e.slice(t.length+1);return e}const mt=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function g(e){let t=e["@id"]||e.id,i=e["@type"]||e.type,r=e.profile||void 0,a=e["@context"]||void 0;if(r){let n=vt(r);if(n)return n}if(a){let n=ht(a);if(n)return n}if(i){if(Array.isArray(i)){if(i.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(i.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";i=i[0]}for(let n of["sc","oa","dcterms","dctypes","iiif"])if(i.startsWith(`${n}:`)){i=i.slice(n.length+1);break}switch(i){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(i&&mt.indexOf(i)!==-1)return i;if(e.format){if(e.format.startsWith("image/"))return"Image";if(e.format.startsWith("text/")||e.format==="application/pdf")return"Text";if(e.format.startsWith("application/"))return"Dataset"}return t&&(t.endsWith(".jpg")||t.endsWith(".png")||t.endsWith(".jpeg"))?"Image":i||"unknown"}const yt=/^|["'\\>]http(s)?:\/\/(creativecommons.org|rightsstatements.org)\/[^"'\\<\n]+/gm;function gt(e){let t=e.match(yt);return t?t[0]:e}function dt(e,t="Rights/License",i="none"){let r=null,a=[],n=Array.isArray(e)?e:[e];for(let s of n){let p=s?gt(s):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){r=p.startsWith("https://")?`http://${p.slice(8)}`:p;continue}p&&a.push({label:{[i]:[t]},value:{[i]:[p]}})}return[r,a]}const At=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function bt(e){if(e){let t=Array.isArray(e)?e:[e],i=[];for(let r of t)r==="http://iiif.io/api/presentation/2/context.json"&&i.push("http://iiif.io/api/presentation/3/context.json"),At.indexOf(r)===-1&&i.push(r);if(t.length)return i.length===1?i[0]:i}}function Ct(e){return e?e.map(t=>({label:f(t.label),value:f(t.value)})):[]}let C=0;function xt(e){return encodeURI(e).replace(/%25([0-9A-Fa-f]{2})/g,"%$1")}function q(e,t){let i=xt(e.id||e["@id"]||"").trim();return i&&t?`${i}/${t}`:i||(C++,`http://example.org/${e["@type"]}${t?`/${t}`:""}/${C}`)}function l(e){let t=[...e.behavior||[]];e.viewingHint&&t.push(e.viewingHint);let i;return Array.isArray(e.motivation)?i=e.motivation.map(b):e.motivation&&(i=b(e.motivation)),{"@context":e["@context"]?bt(e["@context"]):void 0,id:(e["@id"]||q(e)).trim(),type:g(e),behavior:t.length?t:void 0,height:e.height?e.height:void 0,width:e.width?e.width:void 0,motivation:i,viewingDirection:e.viewingDirection,profile:e.profile,format:e.format?e.format:void 0,duration:void 0,timeMode:void 0}}function c(e){let[t,i]=dt(e.license),r=[...e.metadata?Ct(e.metadata):[],...i];return{rights:t,metadata:r.length?r:void 0,label:e.label?f(e.label):void 0,requiredStatement:e.attribution?{label:f(m.attributionLabel),value:f(e.attribution)}:void 0,navDate:e.navDate,summary:e.description?f(e.description):void 0,thumbnail:wt(e.thumbnail)}}function wt(e){return e&&(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?{id:t,type:"Image"}:(t.type==="unknown"&&(t.type="Image"),t))}function jt(e){if(!e.within)return;let t=Array.isArray(e.within)?e.within:[e.within],i=[];for(let r of t)if(typeof r=="string"){if(r)switch(e["@type"]){case"sc:Manifest":i.push({id:r,type:"Collection"});break}}else r["@id"]&&i.push({id:r["@id"],type:g(r)});return i.length?i:void 0}function u(e){let t=e.related?Array.isArray(e.related)?e.related:[e.related]:[],i=e.contentLayer;return{provider:e.logo||t.length?[{id:m.providerId,type:"Agent",homepage:t.length?[t[0]]:void 0,logo:e.logo?Array.isArray(e.logo)?e.logo:[e.logo]:void 0,label:f(m.providerName)}]:void 0,partOf:jt(e),rendering:e.rendering,seeAlso:e.seeAlso,start:e.startCanvas,service:e.service?E(e.service):void 0,supplementary:i?[i]:void 0}}function St(e){return{chars:e.chars,format:e.format?e.format:void 0,language:e.language}}function v(e,t){return e?typeof e=="string"?{id:e,type:t}:typeof(e==null?void 0:e["@id"])=="string"?{id:e["@id"],type:t}:typeof e.id=="string"?{id:e.id,type:t}:null:null}function Lt(e){let t={};if(e.first){let i=v(e.first,"Collection");i&&(t.first=i)}if((e.total||e.total===0)&&(t.total=e.total),e.prev){let i=v(e.prev,"Collection");i&&(t.prev=i)}if(e.next){let i=v(e.next,"Collection");i&&(t.next=i)}return t}function $t(e){let t=[];for(let i of e){let r={...i};r.items&&r.items.length===0&&delete r.items,t.push(r)}return t}function Rt(e){return o({...l(e),...c(e),...u(e),...Lt(e),items:$t(e.members)})}function It(e){let t=[],i=[],r,a;for(let s of e.sequences||[])s.canvases.length&&t.push(...s.canvases),s.behavior&&i.push(...s.behavior),s.viewingDirection&&(a=s.viewingDirection),s.startCanvas&&(r=s.startCanvas);let n=l(e);return i.length&&(n.behavior?n.behavior.push(...i):n.behavior=i),o({...n,...c(e),...u(e),viewingDirection:a,start:r,items:t,structures:Tt(e.structures)})}function Tt(e){if(!e)return e;let t=new Map;for(let r of e)t.set(r.id,r);let i=[];for(let r of e)r.items&&(r.items=r.items.map(a=>typeof a=="string"?(i.push(a),t.get(a)||a):a&&a.id?(i.push(a.id),t.get(a.id)||a):a));return e.filter(r=>i.indexOf(r.id)===-1)}function kt(e){return o({...l(e),...c(e),...u(e),annotations:e.otherContent&&e.otherContent.length?e.otherContent:void 0,items:e.images&&e.images.length?[{id:q(e,"annotation-page"),type:"AnnotationPage",items:e.images}]:void 0})}function Mt(e){return o({...l(e),...c(e),...u(e),items:e.resources&&e.resources.length?e.resources:void 0})}function Ot(e){return!e.canvases||e.canvases.length===0?{canvases:[],behavior:[]}:{canvases:e.canvases,behavior:e.viewingHint?[e.viewingHint]:[],viewingDirection:e.viewingDirection,startCanvas:e.startCanvas}}function Dt(e){function t(i){if(Array.isArray(i)){if(i.length>1)return{type:"List",items:i.map(t)};i=i[0]}if(typeof i=="string")return encodeURI(i).trim();if("@type"in i){let r;if(typeof i.full=="string")r=i.full;else if(i.full["@type"]==="dctypes:Image")r={id:i.full["@id"],type:"Image"};else if(i.full["@type"]==="sc:Canvas")r={id:i.full["@id"],type:"Canvas"};else throw Error(`Unsupported source type on annotation: ${i.full["@type"]}`);return{type:"SpecificResource",source:r,selector:y(i.selector)}}else return encodeURI(i["@id"]).trim()}return o({...l(e),...c(e),...u(e),target:t(e.on),body:Array.isArray(e.resource)?e.resource.map(x):x(e.resource)})}function x(e){return e.type==="Choice"?e:P(e)}function P(e){let t=e;return o({...l(t),...c(t),...u(t),...St(t)})}function qt(e){let t=[];return e.default&&e.default!=="rdf:nil"&&t.push(e.default),e.item&&e.item!=="rdf:nil"&&t.push(...e.item),o({...l(e),...c(e),items:t})}function Pt(e){return o({...l(e),...c(e),...u(e),items:e.members})}function Ut(e){let{"@id":t,"@type":i,"@context":r,profile:a,...n}=e,s={};return t&&(s["@id"]=t),s["@type"]=g(e),s["@type"]==="unknown"&&(r&&r.length&&(s["@context"]=r),s["@type"]="Service"),a&&(s.profile=D(a)),o({...s,...n})}function Wt(e){return o({...l(e),...c(e),...u(e)})}const Et=new ut({collection:[Rt],manifest:[It],canvas:[kt],annotationList:[Mt],sequence:[Ot],annotation:[Dt],contentResource:[P],choice:[qt],range:[Pt],service:[Ut],layer:[Wt]});function Nt(e){return e&&e["@context"]&&(e["@context"]==="http://iiif.io/api/presentation/2/context.json"||Array.isArray(e["@context"])&&e["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||e["@context"]==="http://www.shared-canvas.org/ns/context.json")||e["@context"]==="http://iiif.io/api/image/2/context.json"||e["@id"]&&e["@type"]==="sc:Collection"||e["@id"]&&e["@type"]==="sc:Manifest"?(e["@context"]||(e["@context"]="http://iiif.io/api/presentation/2/context.json"),Et.traverseUnknown(e)):e}function y(e){if((Array.isArray(e["@type"])&&e["@type"].includes("oa:SvgSelector")||e["@type"]=="oa:SvgSelector")&&("chars"in e||"value"in e))return{type:"SvgSelector",value:"chars"in e?e.chars:e.value};if(e["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:e.value};if(e["@type"]==="oa:Choice")return[y(e.default),...(Array.isArray(e.item)?e.item:[e.item]).map(y)];if(e["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in e?e.region:void 0,rotation:"rotation"in e?e.rotation:void 0};throw Error(`Unsupported selector type: ${e["@type"]}`)}export{ut as Traverse,f as convertLanguageMapping,Nt as convertPresentation2,D as getProfile,ht as getTypeFromContext,pt as identifyResource,Et as presentation2to3,A as types};
@@ -1 +1 @@
1
- import{u as r}from"./shared-YUjOSBKO.mjs";import{L as n,P as a}from"./Provider-B61118lU.mjs";import{u as i}from"./nodes-B7JRwBgl.mjs";const s=t=>[...t.children].filter(e=>e.localName==="clover-logo").map(e=>({element:e,alt:e.getAttribute("alt")??void 0})),c=(t,e)=>t.length===e.length&&t.every((l,o)=>l.element===e[o].element&&l.alt===e[o].alt);function u({hosted:t,props:e}){const l=i(t.element,()=>s(t.element),c);return r(a,{...e,children:l.length?l.map((o,m)=>r(n,{alt:o.alt},m)):void 0})}export{u as ProviderElement};
1
+ import{u as r}from"./shared-MTsMddHx.mjs";import{L as n,P as a}from"./Provider-C8se8i4I.mjs";import{u as i}from"./nodes-CTw9OqlA.mjs";const s=t=>[...t.children].filter(e=>e.localName==="clover-logo").map(e=>({element:e,alt:e.getAttribute("alt")??void 0})),c=(t,e)=>t.length===e.length&&t.every((l,o)=>l.element===e[o].element&&l.alt===e[o].alt);function u({hosted:t,props:e}){const l=i(t.element,()=>s(t.element),c);return r(a,{...e,children:l.length?l.map((o,m)=>r(n,{alt:o.alt},m)):void 0})}export{u as ProviderElement};
@@ -0,0 +1 @@
1
+ const a=JSON.parse('{"commonClose":"Fechar","commonNext":"Seguinte","commonPrevious":"Anterior","commonSearch":"Pesquisar","commonViewAll":"Ver tudo","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"A carregar...","contentSearchPlaceholder":"Pesquisar","contentSearchResultsNone":"Sem resultados","contentSearchResult":"1 resultado","contentSearchResults":"{{count}} resultados","contentSearchError":"N\xE3o foi poss\xEDvel concluir a pesquisa.","contentSearchPosition":"Resultado {{index}} de {{total}}","contentSearchClear":"Limpar a pesquisa","canvasPosition":"Item {{index}} de {{total}}","canvasImage":"Imagem","bodyUnloadableImage":"N\xE3o foi poss\xEDvel carregar esta imagem.","bodyUnloadableVideo":"N\xE3o foi poss\xEDvel carregar este v\xEDdeo.","bodyUnloadableAudio":"N\xE3o foi poss\xEDvel carregar este \xE1udio.","bodyUnloadableModel":"N\xE3o foi poss\xEDvel carregar este modelo.","canvasRoleDescription":"imagem ampli\xE1vel","canvasKeysImage":"Use as teclas de seta para deslocar a imagem, com Shift para ir mais longe, mais e menos para ampliar e reduzir, 0 para repor a vista, e R ou Shift+R para rodar.","canvasKeysMedia":"Prima Espa\xE7o ou K para reproduzir ou pausar, J ou L para recuar ou avan\xE7ar dez segundos, e M para silenciar ou ativar o som.","canvasKeysAnnotations":"Prima Esc para desmarcar a anota\xE7\xE3o.","sceneModel":"Modelo 3D","sceneRoleDescription":"modelo 3D rotativo","sceneKeys":"Use as teclas de seta para rodar o modelo, com Shift para ir mais longe, mais e menos para ampliar e reduzir, 0 para repor a vista, e R ou Shift+R para o rodar para a direita ou para a esquerda.","sceneRotateUp":"Rodar para cima","sceneRotateDown":"Rodar para baixo","sceneRotate":"Rodar","sceneResetView":"Repor a vista","statusLoading":"A carregar\u2026","statusError":"N\xE3o foi poss\xEDvel carregar este conte\xFAdo.","itemsLabel":"Itens","download":"Transferir","downloadPage":"Esta p\xE1gina","downloadAll":"Todas as p\xE1ginas","templateSidebar":"Itens","templateSidebarToggle":"Mostrar itens","collectionLabel":"Cole\xE7\xE3o","itemsScrollBack":"Mostrar itens anteriores","itemsScrollForward":"Mostrar mais itens","aboutRights":"Direitos","aboutDate":"Data","aboutHomepage":"P\xE1gina inicial","aboutSeeAlso":"Ver tamb\xE9m","aboutProvider":"Fornecedor","logo":"Log\xF3tipo","aboutManifest":"Manifesto IIIF","aboutCanvas":"Tela IIIF","aboutPartOf":"Parte de","aboutOpenManifest":"Abrir o manifesto completo","aboutCollection":"Cole\xE7\xE3o IIIF","readingLanguage":"Idioma","annotationsHide":"Ocultar anota\xE7\xF5es","annotationsHideTip":"Ocultar","readMore":"Ler mais","readLess":"Ler menos","annotationsShow":"Mostrar na imagem","annotationsShowTime":"Mostrar na grava\xE7\xE3o","annotationsImage":"Imagem","annotationsLanguage":"Idioma","annotationsOpenLink":"Abrir a liga\xE7\xE3o","transcriptLabel":"Transcri\xE7\xE3o","imageViewerOpen":"Abrir o visualizador de imagens","imageViewerClose":"Fechar o visualizador de imagens","canvasChoice":"Alternativas","imageFullScreen":"Ecr\xE3 completo","imageExitFullScreen":"Sair do ecr\xE3 completo","imageResetZoom":"Repor o zoom","imageRotateLeft":"Rodar para a esquerda","imageRotateRight":"Rodar para a direita","imageZoomIn":"Ampliar","imageZoomOut":"Reduzir","informationPanelTabs":"Painel de informa\xE7\xF5es","sectionsScrollBack":"Mostrar separadores anteriores","sectionsScrollForward":"Mostrar mais separadores","informationPanelClose":"Fechar o painel de informa\xE7\xF5es","informationPanelTabsAbout":"Sobre","informationPanelTabsAnnotations":"Anota\xE7\xF5es","informationPanelTabsSearch":"Pesquisa","informationPanelTabsContents":"Conte\xFAdo","contentsSectionsIn":"Sec\xE7\xF5es de","informationPanelTabsMap":"Mapa","informationPanelTabsCollection":"Cole\xE7\xE3o","informationPanelTabsTargets":"Vistas","mapUnavailable":"N\xE3o foi poss\xEDvel mostrar o mapa.","mapLabel":"Mapa","mapAttribution":"Cr\xE9ditos do mapa","mapPlaceUntitled":"Local {{number}}","mapOverlay":"Imagem georreferenciada","mapPlacesListed":"Locais listados depois do mapa: {{count}}","informationPanelToggle":"Mais informa\xE7\xF5es","playerPlay":"Reproduzir","playerPause":"Pausar","playerClose":"Fechar o reprodutor","playerMute":"Silenciar","playerUnmute":"Ativar o som","playerVolume":"Volume","playerSeek":"Posi\xE7\xE3o de reprodu\xE7\xE3o","playerCaptions":"Legendas","playerCaptionsOff":"Desativadas","playerChapters":"Cap\xEDtulos","frameRepeat":"Repetir","playerCurrentTime":"Tempo atual","playerDuration":"Dura\xE7\xE3o","splitHandle":"Redimensionar os pain\xE9is"}');export{a as default};
@@ -0,0 +1 @@
1
+ import{O as c,ar as l,a5 as g,as as v,K as O}from"./shared-MTsMddHx.mjs";const b=t=>t&&typeof t=="object"?Object.entries(t).flatMap(([i,r])=>c(r).filter(s=>typeof s=="string").map(s=>({value:s,...i!=="none"?{language:i}:{}}))):typeof t=="string"?[{value:t}]:[],a=new WeakMap;function j(t){if(!t)return null;if(a.has(t))return a.get(t);const i=[],r=new Set,s=n=>{if(!n||r.has(n.id??n))return;r.add(n.id??n);const w=typeof n.id=="string"&&!c(n.behavior).includes("no-nav"),d=b(n.label),h=c(n.items).filter(o=>(o==null?void 0:o.type)!=="Range"&&g(v(o)).id).length;let x=0;for(const o of c(n.items)){if((o==null?void 0:o.type)==="Range"){s(o);continue}const e=g(v(o));if(!e.id)continue;const f=x++;if(!w||!e.rect)continue;const{x:T,y:I,w:S,h:$}=e.rect,u=O(n.id,f);i.push({id:u,setId:l,canvasId:e.id,target:{id:e.id,rect:e.rect},motivation:["highlighting"],bodies:d,...h>1?{place:{index:f+1,total:h}}:{},annotation:{id:u,type:"Annotation",motivation:["highlighting"],...d.length&&{body:d.map(({value:E,language:y})=>({type:"TextualBody",value:E,...y?{language:y}:{}}))},target:`${e.id}#xywh=${T},${I},${S},${$}`}})}};c(t.structures).forEach(s);const p=i.length?{id:l,source:"contents",entries:i}:null;return a.set(t,p),p}export{j as contentsSet};
@@ -0,0 +1 @@
1
+ import{a as m,a1 as f,b,A as p,_ as n,u as v,l as g}from"./shared-MTsMddHx.mjs";import{u as L}from"./ReadMore-BwGFsLS2.mjs";import{u as A}from"./nodes-CTw9OqlA.mjs";const M=o=>[...o.children].find(r=>!r.classList.contains("clover-read-more-button"))??null;function k({hosted:o}){const r=o.element,e=A(r,()=>M(r),Object.is),{t:s}=m(),i=f(),a=b(),l=p(null);l.current=e;const{open:t,cut:c,toggle:d}=L(l);return n(()=>(r.classList.add("clover-read-more"),()=>r.classList.remove("clover-read-more")),[r]),n(()=>{if(!e)return;const u=e.id;return u||(e.id=a),()=>{u||e.removeAttribute("id"),e.removeAttribute("data-read-more")}},[e,a]),n(()=>{e==null||e.setAttribute("data-read-more",t?"open":"")},[e,t]),!e||!(c||t)?null:v("button",{type:"button",className:"clover-read-more-button","aria-expanded":t,"aria-controls":e.id||a,onClick:d,ref:i.ref,...g(i.langOf(t?"readLess":"readMore")),children:s(t?"readLess":"readMore")})}export{k as ReadMoreElement};
@@ -0,0 +1 @@
1
+ import{Y as a,r as c,e as u,c as l,T as g}from"./shared-MTsMddHx.mjs";function f(e,n,o){if(o&&e.includes(o))return o;if(!e.length)return;const s=a(e,n);return s==="none"?e[0]:s}const y=e=>e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e).filter(n=>n!=="none"&&n!=="@none"&&c({[n]:e[n]}).text):[];function i(e){if(!e)return[];const n=[...Array.isArray(e.metadata)?e.metadata:[],e.requiredStatement].filter(Boolean),s=[e.label,e.summary,...n.flatMap(t=>[t==null?void 0:t.label,t==null?void 0:t.value])].map(y).filter(t=>t.length>1);return[...new Set(s.flat())]}function d(){const{language:e,chooseLanguage:n}=u("About"),o=l(r=>r.manifest),s=g(()=>i(o),[o]),t=f(s,e);return t&&n?{languages:s,chosen:t,onChange:n}:null}export{f as s,d as u};
@@ -0,0 +1,22 @@
1
+ var bt=Object.defineProperty;var Tt=(s,t,e)=>t in s?bt(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var h=(s,t,e)=>Tt(s,typeof t!="symbol"?t+"":t,e);import{c as Et,r as V}from"./contexts-ByL3eA_T.mjs";import{c as k,s as L,t as _,a as Mt,u as lt,i as kt,b as dt,d as ut,e as Lt,f as A,r as _t}from"./CanvasView-BWQ4SK2b.mjs";import{a as D,w as Pt,v as N,f as Y,s as $,b as It,c as At}from"./Camera-Cp5ma-6C.mjs";import{i as Q,a as Rt,T as St,b as j,c as J,D as Bt,s as Ot}from"./BodyUnloadable-DcTM7hHF.mjs";import{Z as Ct,a0 as Ut}from"./shared-MTsMddHx.mjs";import{a as zt,i as tt,f as Wt}from"./imageService-0eTvQ-3h.mjs";function Ft(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement?s.complete&&s.naturalWidth>0:true}function Dt(s,t){if(!s.bleed)return{x:0,y:0};const e=s.transform,i=Math.hypot(e.a,e.b)*t,n=Math.hypot(e.c,e.d)*t;return{x:s.bleed.right&&i>0?1/i:0,y:s.bleed.bottom&&n>0?1/n:0}}const Nt=`#version 300 es
2
+ in vec2 a_position;
3
+ uniform mat3 u_matrix;
4
+ uniform vec4 u_crop;
5
+ out vec2 v_uv;
6
+
7
+ void main() {
8
+ vec3 clip = u_matrix * vec3(a_position, 1.0);
9
+ gl_Position = vec4(clip.xy, 0.0, 1.0);
10
+ v_uv = u_crop.xy + a_position * u_crop.zw;
11
+ }
12
+ `,Ht=`#version 300 es
13
+ precision highp float;
14
+ in vec2 v_uv;
15
+ uniform sampler2D u_texture;
16
+ uniform float u_opacity;
17
+ out vec4 outColor;
18
+
19
+ void main() {
20
+ outColor = texture(u_texture, v_uv) * u_opacity;
21
+ }
22
+ `;class R{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const n=Gt(e,Nt,Ht);this.program=n,this.uniforms={matrix:e.getUniformLocation(n,"u_matrix"),crop:e.getUniformLocation(n,"u_crop"),opacity:e.getUniformLocation(n,"u_opacity"),texture:e.getUniformLocation(n,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(n,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new R(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const n=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(e*i));this.canvas.width!==n&&(this.canvas.width=n),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Ft(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const n=t.crop??{x:0,y:0,width:t.width,height:t.height},o=Dt(t,this.pixelRatio),r=k(t.transform,_(n.x,n.y),L(n.width+o.x,n.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,Mt(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,n.x/t.width,n.y/t.height,n.width/t.width,n.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const n=(i==null?void 0:i.texture)??e.createTexture();if(!n)return null;e.bindTexture(e.TEXTURE_2D,n);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(n),Xt(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:n,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function Gt(s,t,e){const i=et(s,s.VERTEX_SHADER,t),n=et(s,s.FRAGMENT_SHADER,e),o=s.createProgram();if(!o)throw new Error("Could not create WebGL program");if(s.attachShader(o,i),s.attachShader(o,n),s.linkProgram(o),s.deleteShader(i),s.deleteShader(n),!s.getProgramParameter(o,s.LINK_STATUS)){const r=s.getProgramInfoLog(o);throw s.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function et(s,t,e){const i=s.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS)){const n=s.getShaderInfoLog(i);throw s.deleteShader(i),new Error(`Could not compile WebGL shader: ${n}`)}return i}function Xt(s){return typeof s=="object"&&s!==null&&s.name==="SecurityError"}const Zt=.09,Kt=1e-4,it=.05,qt=1e-4;class Vt{constructor(t,e=Zt){h(this,"current");h(this,"target",null);h(this,"timeConstant");this.current={...t},this.timeConstant=e}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){if(i||this.timeConstant===0){this.set(t.state);return}let n=t.anchor;if(n){const o=D(n.world,n.screen,t.state.zoom,t.state.rotation,e);Math.hypot(o.x-t.state.x,o.y-t.state.y)*t.state.zoom>it&&(n=void 0)}this.target={state:{...t.state},anchor:n}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const n=1-Math.exp(-Math.max(t,0)/this.timeConstant),o=this.current,r=i.state,a=Math.exp(Math.log(o.zoom)+(Math.log(r.zoom)-Math.log(o.zoom))*n),d=o.rotation+(r.rotation-o.rotation)*n;let l;return i.anchor?l=D(i.anchor.world,i.anchor.screen,a,d,e):l={x:o.x+(r.x-o.x)*n,y:o.y+(r.y-o.y)*n},this.current={x:l.x,y:l.y,zoom:a,rotation:d},Math.abs(Math.log(r.zoom/a))<Kt&&Math.abs(r.rotation-d)<qt&&Math.hypot(r.x-l.x,r.y-l.y)*a<it?(this.current={...r},this.target=null,false):true}}const H={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true},C=2,st=1.5,nt=.1,Yt=100,$t=200,Qt=.002,jt=.01;class Jt{constructor(t,e,i=H){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,n;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||Q(t2.target,this.element))return;(n=(i2=this.element).setPointerCapture)==null||n.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var n;Rt(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>St&&(this.down.moved=true),(n=this.down)!=null&&n.moved&&this.options.navigable&&this.target.panBy(o,r,false),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Yt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var d,l,f,m,c,u;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(l=(d=this.element).releasePointerCapture)==null||l.call(d,t2.pointerId),this.pointers.size===1){this.pinch=null;const[p]=this.pointers.values();this.samples=[{...p,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<j){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(J(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<j&&Math.hypot(i2.x-p.x,i2.y-p.y)<Bt?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/C,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable)return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const p=(r.x-o.x)/a*1e3,w=(r.y-o.y)/a*1e3;Math.hypot(p,w)>$t&&this.target.flick(p,w)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||J(this.lastPointerType,this.penHovers)||Q(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/C,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&Ot(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=te(t2),n=e2?jt:Qt;this.target.zoomBy(Math.exp(-i2*n),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*nt*(t2.shiftKey?3:1),n=e2.height*nt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,n,true);break;case"ArrowDown":this.target.panBy(0,-n,true);break;case"+":case"=":this.target.zoomBy(st,void 0,true);break;case"-":case"_":this.target.zoomBy(1/st,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(C,t,true)}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function te(s){return s.deltaMode===1?s.deltaY*16:s.deltaMode===2?s.deltaY*400:s.deltaY}class ft extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const ot=new Set;async function ee(s,t={}){const{signal:e,maxTextureSize:i,request:n}=t,o=Ct(n),r=se(s);if(typeof createImageBitmap!="function"||typeof fetch!="function")return U(s,{signal:e,cors:true,withCredentials:o});if(r&&ot.has(r))return U(s,{signal:e,cors:false,withCredentials:o});let a;try{a=await Ut(n,s,{mode:"cors",signal:e})}catch(c){if(ne(c,e))throw c;const u=await U(s,{signal:e,cors:false,withCredentials:o});return r&&ot.add(r),u}if(!a.ok)throw new ft(`Image request failed with ${a.status}`,s,a.status);const d=await a.blob();let l=await ie(d);const f=l.width,m=l.height;if(i&&(l.width>i||l.height>i)){const c=i/Math.max(l.width,l.height),u=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*c)),resizeHeight:Math.max(1,Math.floor(l.height*c)),resizeQuality:"high"});l.close(),l=u}if(e!=null&&e.aborted)throw l.close(),G();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:f,naturalHeight:m,opaque:false}}async function ie(s){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(s,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(s);throw e}}function U(s,{signal:t,cors:e,withCredentials:i}){return new Promise((n,o)=>{if(t!=null&&t.aborted){o(G());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),r.src="",o(G())};t==null||t.addEventListener("abort",d),r.onload=()=>{a();const l=()=>n({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(l,l):l()},r.onerror=()=>{a(),o(new ft("Image failed to load",s))},r.src=s})}function se(s){var t;try{return new URL(s,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function ne(s,t){return!!(t!=null&&t.aborted)||typeof s=="object"&&s!==null&&s.name==="AbortError"}function G(){const s=new Error("Aborted");return s.name="AbortError",s}function rt(s){s.kind==="bitmap"&&s.source.close()}const oe=192*1024*1024,re=6,ae=2;class he{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??oe,this.maxInFlight=t.maxInFlight??re}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var n;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((n=i==null?void 0:i.controller)==null||n.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:z(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=z(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const n=this.entries.get(e.url);if(n&&n.state!=="loading")return i();if(n){n.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,n)=>i.priority-n.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const n=this.entries.get(i.url);n&&(n.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,n={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,n),this.inFlight++,this.attempt(n,t,i,t.url)}attempt(t,e,i,n){t.attempts++,this.options.load(n,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){rt(o);return}t.state="ready",t.image=o,t.bytes=z(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<ae&&!ce(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(n=>n())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,n)=>i.lastUsed-n.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&rt(i.image),this.options.onEvict(i.url)}}}function z(s){return s.width*s.height*4}function ce(s,t){if(t.fallbackUrl)return false;const e=s==null?void 0:s.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const le=.1;class de{constructor(t,e=n=>requestAnimationFrame(n),i=n=>cancelAnimationFrame(n)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,le):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const ue=2*1024*1024;function fe(s,t,e=ue){const i=new Set;let n=e,o=false;return{get deferred(){return o},getTile(r){const a=s(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const d=a.width*a.height*4;if(i.size>0&&d>n){o=true;return}return n-=d,i.add(r),a}}}function me(s){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((s==null?void 0:s.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,n=!!t[1];return i||n?{degrees:i,mirror:n}:null}function pe(s,t,e){if(!s)return null;let i=s.trim().replace(/^xywh=/,""),n=false;i.startsWith("pct:")?(n=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(p=>!Number.isFinite(p)))return null;let[r,a,d,l]=o;n&&(r=r/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,r),m=Math.max(0,a),c=Math.min(t,r+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const W=512,ge=16e6;function mt(s,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:n=>({...n,url:s,region:{x:0,y:0,width:t,height:e}})}}function we(s){const{width:t,height:e}=s,i=[],n=s.regionByPx&&s.sizeByW,o=(c,u,p)=>{const w=Math.ceil(t/c),y=Math.ceil(e/c);return{scaleFactor:c,width:w,height:y,tileWidth:u,tileHeight:p,cols:Math.ceil(w/u),rows:Math.ceil(y/p)}},r=(c,u)=>({scaleFactor:t/c,width:c,height:u,tileWidth:c,tileHeight:u,cols:1,rows:1,whole:true}),a=s.tiles[0];if(a)for(const c of a.scaleFactors)i.push(o(c,a.width,a.height));else if(n)for(let c=1;;c*=2){const u=o(c,W,W);if(i.push(u),u.cols===1&&u.rows===1)break}const d=Math.max(0,...i.map(c=>c.scaleFactor));for(const c of s.sizes){const u=t/c.width;ye(s,c.width,c.height)&&u>d+1e-9&&i.push(r(c.width,c.height))}const l=i.reduce((c,u)=>!c||u.scaleFactor>c.scaleFactor?u:c,null);if(l&&l.cols*l.rows>1&&s.sizeByW){const c=Math.max(t,e)/W;i.push(r(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!n&&t*e<=ge)&&(i.some(c=>c.scaleFactor===1)||i.push(r(t,e)));const f=xe(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=zt(s);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,w=u.cols===1&&u.rows===1;let y,v,b;if(w)y={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),E=Math.round(c.row*u.tileHeight*p);y={x:I,y:E,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-E)},v=Math.ceil(y.width/p),b=Math.ceil(y.height/p)}return{...c,region:y,url:tt(s,y,v,b),fallbackUrl:m?tt(s,y,v,b,m):void 0}}}}function ye(s,t,e){return!(s.maxWidth&&t>s.maxWidth||s.maxHeight&&e>s.maxHeight||s.maxArea&&t*e>s.maxArea)}function xe(s){const t=new Map;for(const e of s){const i=`${e.width}x${e.height}`,n=t.get(i);(!n||n.cols*n.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function ve(s,t){const e=s.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function T(s,t,e){const i=s.levels[t],n=i.tileWidth*i.scaleFactor,o=i.tileHeight*i.scaleFactor,r=Math.max(0,e.x),a=Math.max(0,e.y),d=Math.min(s.width,e.x+e.width),l=Math.min(s.height,e.y+e.height);if(d<=r||l<=a)return[];const f=Math.max(0,Math.floor(r/n)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/n)),c=Math.max(0,Math.floor(a/o)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/o)),p=[];for(let w=c;w<=u;w++)for(let y=f;y<=m;y++)p.push({level:t,col:y,row:w});return p}async function be(s,t){if(s.media)return Te(s,s.media);let e=null,i=null;if(s.service)try{e=we(await Wt(s.service,t.infoOptions))}catch(c){i=c}if(!e){if(!s.url)throw i??new Error("Image has no source");const c=await t.loadStatic(s.url);t.cache.seed(s.url,c),e=mt(s.url,c.naturalWidth,c.naturalHeight)}const n=s.width&&s.height&&s.width>0&&s.height>0?{width:s.width,height:s.height}:{width:e.width,height:e.height},o=pe(s.region,n.width,n.height)??{x:0,y:0,width:n.width,height:n.height},r=e.width/n.width,a=e.height/n.height,d={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},l=me(s.rotation),f=l?Ee(d,l):void 0,m={id:s.id,spec:s,pyramid:e,size:n,clip:d,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.height},...f?{turn:f}:{}};return await t.cache.prefetch(T(e,0,d).map(c=>{const u=e.tile(c);return{url:u.url,fallbackUrl:u.fallbackUrl}})),m}const pt="media:";function Te(s,t){var a,d;const e=s.width||((a=s.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=s.height||((d=s.placement)==null?void 0:d.height)||t.element.videoHeight||900,n=`${pt}${s.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:s.id,spec:s,pyramid:mt(n,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Ee(s,{degrees:t,mirror:e}){const i=t*Math.PI/180,n=f=>Math.abs(f)<1e-12?0:f,o=n(Math.cos(i)),r=n(Math.sin(i)),a=Math.abs(s.width*o)+Math.abs(s.height*r),d=Math.abs(s.width*r)+Math.abs(s.height*o),l=k(_(a/2,d/2),{a:o,b:r,c:-r,d:o,e:0,f:0},L(e?-1:1,1),_(-(s.x+s.width/2),-(s.y+s.height/2)));return{orient:l,unorient:kt(l),width:a,height:d}}function gt(s){var t;return((t=s.turn)==null?void 0:t.orient)??_(-s.clip.x,-s.clip.y)}function Me(s,t){const{turn:e,clip:i}=s;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const n=ut(e.unorient,t),o=Math.max(n.x,i.x),r=Math.max(n.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(n.x+n.width,i.x+i.width)-o),height:Math.max(0,Math.min(n.y+n.height,i.y+i.height)-r)}}function ke(s,t){const{turn:e,clip:i}=s;return e?dt(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function at(s){const{turn:t,clip:e,contentClip:i}=s;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function Le(s){if(!s.length)return null;if(s.every(i=>i.spec.placement)){for(const i of s)i.rect={...i.spec.placement};return lt(s.map(i=>i.rect))}const t=at(s[0]).height;let e=0;for(const i of s){const n=at(i),o=n.width*t/n.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function S(s){const t=s.turn??s.clip;return{x:s.rect.width/t.width,y:s.rect.height/t.height}}function _e(s){const t=S(s);return k(_(s.rect.x,s.rect.y),L(t.x,t.y),gt(s))}function Pe(s,t){var e,i;return s.service===t.service&&s.url===t.url&&s.width===t.width&&s.height===t.height&&s.region===t.region&&s.rotation===t.rotation&&((e=s.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(s.placement)===JSON.stringify(t.placement)}const Ie=1e7,Ae=15e6,Re=2e7,Se=2;function Be(s){const{items:t,camera:e,viewport:i,pixelRatio:n,getTile:o,destination:r}=s,a=Pt(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const w=c.tile(u);l.push({url:w.url,fallbackUrl:w.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:w}=c,y=S(c);if(s.wantOverview)for(const g of T(u,0,p))m(u,g,Re);const v=ht(c,e,i,n),b=r?ht(c,r,i,n):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=g=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-g.x,P.y+P.height/2-g.y)};if(b){const g=I(b.center);for(const x of T(u,0,b.area))m(u,x,g(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Ie+g(x))}if(!v)continue;const{area:E,target:M}=v,X=I(v.center),B=T(u,0,E),Z=M===0?[]:T(u,M,E);if(b!==v){for(const x of B)m(u,x,X(x)/1e3);const g=M-Se;if(g>0)for(const x of T(u,g,E))m(u,x,Ae+X(x))}if(c.spec.hidden)continue;const yt=(M===0?B:Z).every(g=>o(u.tile(g).url)!==void 0)?[M]:Array.from({length:M+1},(g,x)=>x),xt=k(a,_(w.x,w.y),L(y.x,y.y),gt(c));for(const g of yt){const x=g===0?B:g===M?Z:T(u,g,E),P=u.levels[g].cols*u.levels[g].rows>1;for(const vt of x){const O=u.tile(vt),K=o(O.url);if(!K)continue;const q=Oe(c,O.region,K,xt,P);q&&d.push({...q,url:O.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:Ce(l),levels:f}}function ht(s,t,e,i){const{pyramid:n,rect:o}=s,r=N(t,e);if(!Lt(r,o))return null;const a=S(s),d=Math.max(r.x,o.x),l=Math.max(r.y,o.y),f=Math.min(r.x+r.width,o.x+o.width),m=Math.min(r.y+r.height,o.y+o.height),c=1/(a.x*t.zoom*i);return{area:Me(s,{x:(d-o.x)/a.x,y:(l-o.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:ke(s,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:ve(n,c)}}function Oe(s,t,e,i,n){const{clip:o}=s,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),d=Math.min(t.x+t.width,o.x+o.width),l=Math.min(t.y+t.height,o.y+o.height);if(d<=r||l<=a)return null;const f=e.width/t.width,m=e.height/t.height,c=1e-6;return{item:s,image:e,transform:k(i,_(t.x,t.y),L(1/f,1/m)),crop:{x:(r-t.x)*f,y:(a-t.y)*m,width:(d-r)*f,height:(l-a)*m},bleed:{right:n&&d<o.x+o.width-c,bottom:n&&l<o.y+o.height-c}}}function Ce(s){const t=new Set;return s.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const Ue={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,animationTime:.09,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},ze=2,We=3,Fe=.1,De=1e-6,wt={top:0,right:0,bottom:0,left:0};function Ne(s){if(typeof getComputedStyle!="function")return wt;const t=getComputedStyle(s),e=i=>parseFloat(i)||0;return{top:e(t.paddingTop),right:e(t.paddingRight),bottom:e(t.paddingBottom),left:e(t.paddingLeft)}}const He=(s,t)=>s.top===t.top&&s.right===t.right&&s.bottom===t.bottom&&s.left===t.left;let Ge;class Xe{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",wt);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var d,l;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i=this.camera.current,n=this.backend,o=fe(this.getTile,f=>n?n.has(f):true),r=Be({items:this.items,camera:i,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=r.wants.filter(f=>!f.url.startsWith(pt));return this.cache.update(a),r.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(r.draws),(d=this.overlays)==null||d.position(i,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!At(this.lastEmitted,i))&&(this.lastEmitted={...i},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...Ue,...F(e)},Ke()&&(this.options.animationTime=0),this.camera=new Vt({x:0,y:0,zoom:1,rotation:0},this.options.animationTime),this.loop=new de(this.tick),this.gestureOptions=F(e.gestures??{}),this.gestures=new Jt(t,this,{...H,...this.gestureOptions}),this.cache=new he({load:(i,n)=>this.loadTile(i,n),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:i=>{var n;return(n=this.backend)==null?void 0:n.release(i)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ze(t),this.visible?this.acquireBackend():this.holder.hiddenSince=ct(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const n=++this.generation,o=new Map(this.items.map(f=>[f.id,f])),r=await Promise.allSettled(t.map(f=>{const m=o.get(f.id);return m&&Pe(m.spec,f)?(m.spec=f,Promise.resolve(m)):be(f,{cache:this.cache,loadStatic:c=>this.loadTile(c),infoOptions:{request:this.options.request}})}));if(n!==this.generation||this.disposed)return;const a=r.filter(f=>f.status==="fulfilled").map(f=>f.value),d=r.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Le(a);if(this.worldBounds=e?l?lt([e,l]):e:l,this.contentVersion++,d.length&&this.emit("error",d),this.setUnloadable(t.length>0&&!a.length&&d.length>0),!this.worldBounds){this.invalidate();return}this.opened?i?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const n of this.items){const o=e.has(n.id);!!n.spec.hidden!==o&&(n.spec={...n.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(n=>n.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let n=0;n<i.rows;n++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:n}).url))return false;return true}fitBounds(t,e=false){const i=Y(t,this.viewport,this.camera.destination.rotation,0);this.atHome=false,this.animateTo(this.constrain(i,{allowBeyondLimits:true}),e)}fitItemRect(t,e,i=false){const n=this.itemRectToWorld(t,e);n&&this.fitAnnotation(n,i)}fitAnnotation(t,e=false){const i=this.items[0];if(!i)return;const n=i.rect.width*Fe;this.fitBounds({x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2},e)}getBounds(){return N(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var i;const t=((i=this.homeCamera())==null?void 0:i.zoom)??1,e=this.items.length?Math.min(...this.items.map(n=>S(n).x)):1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.options.maxZoomPixelRatio/e)}}home(t=false){const e=this.homeCamera();e&&(this.atHome=true,this.animateTo(e,t))}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-De)}zoomBy(t,e,i=true){const n=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=$(n,this.viewport,o),{min:a,max:d}=this.getZoomLimits(),l=A(n.zoom*t,a,d),f=D(r,o,l,n.rotation,this.viewport),m=this.constrain({...n,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:r,screen:o}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const n=i?this.camera.destination:this.camera.current,o=dt(k(L(1/n.zoom),_t(-n.rotation)),{x:t,y:e}),r=this.constrain({...n,x:n.x-o.x,y:n.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}flick(t,e){this.panBy(t*.25,e*.25,true)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,n=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:n}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...H,...this.gestureOptions,...F(t)})}setInteracting(t){t&&this.camera.stop()}worldToScreenPoint(t){return It(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return $(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:n,clip:o}=i;if(i.turn)return ut(k(_e(i),L(o.width/n.width,o.height/n.height)),e);const r=i.rect.width/n.width,a=i.rect.height/n.height;return{x:i.rect.x+(e.x-n.x)*r,y:i.rect.y+(e.y-n.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,n=false;return import("./Navigator-B3U21_ti.mjs").then(r=>{n||this.disposed||e!==this.navigatorAsked||(i=new r.Navigator(t,(a,d)=>this.panTo(a,d)),this.navigator=i,this.invalidate())}),()=>{n=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,n,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(n=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||n.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(d=>d()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const n=e.media.source,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>n.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>n.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],n=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&n&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-CTGub6wo.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return ee(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof R?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const t=2*Math.PI,e=Math.round(this.camera.destination.rotation/t)*t||0,{top:i,right:n,bottom:o,left:r}=this.inset,a=Y(this.worldBounds,{width:Math.max(1,this.viewport.width-r-n),height:Math.max(1,this.viewport.height-i-o)},e);return a.x-=(r-n)/2/a.zoom,a.y-=(i-o)/2/a.zoom,a}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:n,max:o}=this.getZoomLimits(),r=e?A(t.zoom,n,Math.max(o,t.zoom)):A(t.zoom,n,o);return{...t,zoom:r,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<We);let n=null;i&&(Et(this.holder)||this.backendPreference==="webgl2")&&(n=R.create(e,{onLost:this.onContextLost}),n||V(this.holder)),n?this.install(n):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Ge??(Ge=import("./Canvas2DBackend-3PToh87Z.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const d=a.create(e);d?this.install(d):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if(V(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=ct()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var d;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),n=Math.max(1,e.height),o=Ne(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,ze);if(i===this.viewport.width&&n===this.viewport.height&&r===this.pixelRatio&&He(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:n},this.inset=o,this.pixelRatio=r,(d=this.backend)==null||d.resize(i,n,r),this.opened)if(this.atHome)this.home(true);else{const l=this.camera.current,f=i/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*f}))}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,n;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(n=(i=this.dprQuery).addEventListener)==null||n.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(n=>n(e))}}const ct=()=>typeof performance<"u"?performance.now():Date.now();function Ze(s){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:n}=s.getBoundingClientRect();return t+n>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function Ke(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function F(s){return Object.fromEntries(Object.entries(s).filter(([,t])=>t!==void 0))}const ii=(s,t)=>new Xe(s,t);export{Dt as b,Ft as h,Be as p,ii as r};
@@ -1 +1 @@
1
- import{u as c,A as l,x as u,ai as p,_ as d,k as m}from"./shared-YUjOSBKO.mjs";import"./styles-CyuM_fB1.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
1
+ import{u as c,A as l,x as u,ay as p,_ as d,k as m}from"./shared-MTsMddHx.mjs";import"./styles-CZV1nbBQ.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
@@ -1 +1 @@
1
- import{x as n,Z as o,Q as r}from"./shared-YUjOSBKO.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
1
+ import{x as n,X as o,Q as r}from"./shared-MTsMddHx.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
@@ -0,0 +1,3 @@
1
+ /*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */function rn(n,o){(o==null||o>n.length)&&(o=n.length);for(var s=0,l=Array(o);s<o;s++)l[s]=n[s];return l}function mo(n){if(Array.isArray(n))return n}function ho(n,o){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var l,c,m,E,$=[],C=true,Dt=false;try{if(m=(s=s.call(n)).next,o!==0)for(;!(C=(l=m.call(s)).done)&&($.push(l.value),$.length!==o);C=true);}catch(nt){Dt=true,c=nt}finally{try{if(!C&&s.return!=null&&(E=s.return(),Object(E)!==E))return}finally{if(Dt)throw c}}return $}}function To(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function _o(n,o){return mo(n)||ho(n,o)||go(n,o)||To()}function go(n,o){if(n){if(typeof n=="string")return rn(n,o);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?rn(n,o):void 0}}const Sn=Object.entries,an=Object.setPrototypeOf,Ao=Object.isFrozen,bn=Object.getPrototypeOf,yn=Object.getOwnPropertyDescriptor;let y=Object.freeze,R=Object.seal,mt=Object.create,On=typeof Reflect<"u"&&Reflect,be=On.apply,ye=On.construct;y||(y=function(o){return o});R||(R=function(o){return o});be||(be=function(o,s){for(var l=arguments.length,c=new Array(l>2?l-2:0),m=2;m<l;m++)c[m-2]=arguments[m];return o.apply(s,c)});ye||(ye=function(o){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return new o(...l)});const W=g(Array.prototype.forEach),Eo=g(Array.prototype.lastIndexOf),sn=g(Array.prototype.pop),bt=g(Array.prototype.push),So=g(Array.prototype.slice),bo=g(Array.prototype.splice),dt=Array.isArray,me=Rn(Set),de=g(Set.prototype.add),yt=g(Set.prototype.has),et=g(String.prototype.toLowerCase),he=g(String.prototype.toString),ln=g(String.prototype.match),Ot=g(String.prototype.replace),cn=g(String.prototype.indexOf),yo=g(String.prototype.trim),Oo=g(Number.prototype.toString),Ro=g(Boolean.prototype.toString),un=typeof BigInt>"u"?null:g(BigInt.prototype.toString),fn=typeof Symbol>"u"?null:g(Symbol.prototype.toString),N=g(Object.prototype.hasOwnProperty),Rt=g(Object.prototype.toString),O=g(RegExp.prototype.test),G=Rn(TypeError);function g(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return be(n,o,l)}}function Rn(n){return function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return ye(n,s)}}function d(n,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;if(an&&an(n,null),!dt(o))return n;let l=o.length;for(;l--;){let c=o[l];if(typeof c=="string"){const m=s(c);m!==c&&(Ao(o)||(o[l]=m),c=m)}n[c]=true}return n}function Do(n){for(let o=0;o<n.length;o++)N(n,o)||(n[o]=null);return n}function M(n){const o=mt(null);for(const l of Sn(n)){var s=_o(l,2);const c=s[0],m=s[1];N(n,c)&&(dt(m)?o[c]=Do(m):m&&typeof m=="object"&&m.constructor===Object?o[c]=M(m):o[c]=m)}return o}function Lo(n){switch(typeof n){case"string":return n;case"number":return Oo(n);case"boolean":return Ro(n);case"bigint":return un?un(n):"0";case"symbol":return fn?fn(n):"Symbol()";case"undefined":return Rt(n);case"function":case"object":{if(n===null)return Rt(n);const o=n,s=P(o,"toString");if(typeof s=="function"){const l=s(o);return typeof l=="string"?l:Rt(l)}return Rt(n)}default:return Rt(n)}}function P(n,o){for(;n!==null;){const l=yn(n,o);if(l){if(l.get)return g(l.get);if(typeof l.value=="function")return g(l.value)}n=bn(n)}function s(){return null}return s}function wo(n,o){for(;n!==null;){const s=yn(n,o);if(s)return s.get?g(s.get):null;n=bn(n)}return null}function Io(n){try{return O(n,""),true}catch{return false}}const pn=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Te=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_e=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),No=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ge=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Co=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mn=y(["#text"]),dn=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ae=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hn=y(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zt=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Mo=R(/{{[\w\W]*|^[\w\W]*}}/g),vo=R(/<%[\w\W]*|^[\w\W]*%>/g),Po=R(/\${[\w\W]*/g),xo=R(/^data-[\-\w.\u00B7-\uFFFF]+$/),ko=R(/^aria-[\-\w]+$/),Tn=R(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uo=R(/^(?:\w+script|data):/i),zo=R(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fo=R(/^html$/i),Ho=R(/^[a-z][.\w]*(-[.\w]+)+$/i),Ee=R(/<[/\w!]/g),_n=R(/<[/\w]/g),Wo=R(/<\/no(script|embed|frames)/i),gn=R(/\/>/i),S={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Go=y(d({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Bo=function(){return typeof window>"u"?null:window},Yo=function(o,s){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let l=null;const c="data-tt-policy-suffix";s&&s.hasAttribute(c)&&(l=s.getAttribute(c));const m="dompurify"+(l?"#"+l:"");try{return o.createPolicy(m,{createHTML(E){return E},createScriptURL(E){return E}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},An=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(o,s,l,c){return N(o,s)&&dt(o[s])?d(c.base?M(c.base):{},o[s],c.transform):l},Se=function(o,s,l){const c=N(o,s)?o[s]:void 0;return c&&typeof c=="object"?M(c):l()};function Dn(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bo();const o=a=>Dn(a);if(o.version="3.4.17",o.removed=[],!n||!n.document||n.document.nodeType!==S.document||!n.Element)return o.isSupported=false,o;let s=n.document;const l=s,c=l.currentScript;n.DocumentFragment;const m=n.HTMLTemplateElement,E=n.Node,$=n.Element,C=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const Dt=n.DOMParser,nt=n.trustedTypes,F=$.prototype,vn=P(F,"cloneNode"),Ft=P(F,"remove"),Oe=P(F,"removeAttributeNode"),Pn=P(F,"nextSibling"),ht=P(F,"childNodes"),ot=P(F,"parentNode"),Ht=P(F,"shadowRoot"),Wt=P(F,"attributes"),X=E&&E.prototype?P(E.prototype,"nodeType"):null,rt=E&&E.prototype?P(E.prototype,"nodeName"):null,Lt=E&&E.prototype?P(E.prototype,"ownerDocument"):null,v=function(t){return X?X(t):t.nodeType},Tt=function(t){return rt?rt(t):t.nodeName},Re=wo(F,"namespaceURI"),Gt=function(t){return Re?Re(t):t.namespaceURI};if(typeof m=="function"){const a=s.createElement("template");a.content&&a.content.ownerDocument&&(s=a.content.ownerDocument)}let L,q="",Bt,De=false,_t=0;const Le=function(){if(_t>0)throw G('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},it=function(t){Le(),_t++;try{return L.createHTML(t)}finally{_t--}},xn=function(t){Le(),_t++;try{return L.createScriptURL(t)}finally{_t--}},kn=function(){return De||(Bt=Yo(nt,c),De=true),Bt},wt=s,Yt=wt.implementation,we=wt.createNodeIterator,Un=wt.createDocumentFragment,zn=wt.getElementsByTagName,Fn=l.importNode;let h=An();o.isSupported=typeof Sn=="function"&&typeof ot=="function"&&Yt&&Yt.createHTMLDocument!==void 0;const Hn=Mo,Wn=vo,Gn=Po,Bn=xo,Yn=ko,Vn=Uo,Ie=zo,jn=Ho;let Ne=Tn,T=null;const Vt=d({},[...pn,...Te,..._e,...ge,...mn]);let _=null;const jt=d({},[...dn,...Ae,...hn,...zt]);let k=Object.seal(mt(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}})),gt=null,Ce=null;const B=Object.seal(mt(null,{tagCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeCheck:{writable:true,configurable:false,enumerable:true,value:null}}));let Me=true,$t=true,ve=false,Xt=true,H=false,K=true,Z=false,qt=false,It=null,Nt=null,Kt=false,at=false,Ct=false,Mt=false,Pe=true,xe=false;const ke="user-content-";let Zt=true,Jt=false,J=null,st={},Q=null;const Ue=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let ze=null;const Fe=d({},["audio","video","img","source","image","track"]);let He=null;const We=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",Pt="http://www.w3.org/2000/svg",U="http://www.w3.org/1999/xhtml";let lt=U,Qt=false,te=null;const $n=d({},[vt,Pt,U],he),Ge=y(["mi","mo","mn","ms","mtext"]);let ee=d({},Ge);const Be=y(["annotation-xml"]);let ne=d({},Be);const Xn=d({},["title","style","font","a","script"]);let At=null;const qn=["application/xhtml+xml","text/html"],Kn="text/html";let A=null,ct=null;const Zn=s.createElement("form"),Ye=function(t){return t instanceof RegExp||t instanceof Function},oe=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ct&&ct===t)return;(!t||typeof t!="object")&&(t={}),t=M(t),At=qn.indexOf(t.PARSER_MEDIA_TYPE)===-1?Kn:t.PARSER_MEDIA_TYPE,A=At==="application/xhtml+xml"?he:et,T=j(t,"ALLOWED_TAGS",Vt,{transform:A}),_=j(t,"ALLOWED_ATTR",jt,{transform:A}),te=j(t,"ALLOWED_NAMESPACES",$n,{transform:he}),He=j(t,"ADD_URI_SAFE_ATTR",We,{transform:A,base:We}),ze=j(t,"ADD_DATA_URI_TAGS",Fe,{transform:A,base:Fe}),Q=j(t,"FORBID_CONTENTS",Ue,{transform:A}),gt=j(t,"FORBID_TAGS",M({}),{transform:A}),Ce=j(t,"FORBID_ATTR",M({}),{transform:A}),st=N(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?M(t.USE_PROFILES):t.USE_PROFILES:false,Me=t.ALLOW_ARIA_ATTR!==false,$t=t.ALLOW_DATA_ATTR!==false,ve=t.ALLOW_UNKNOWN_PROTOCOLS||false,Xt=t.ALLOW_SELF_CLOSE_IN_ATTR!==false,H=t.SAFE_FOR_TEMPLATES||false,K=t.SAFE_FOR_XML!==false,Z=t.WHOLE_DOCUMENT||false,at=t.RETURN_DOM||false,Ct=t.RETURN_DOM_FRAGMENT||false,Mt=t.RETURN_TRUSTED_TYPE||false,Kt=t.FORCE_BODY||false,Pe=t.SANITIZE_DOM!==false,xe=t.SANITIZE_NAMED_PROPS||false,Zt=t.KEEP_CONTENT!==false,Jt=t.IN_PLACE||false,Ne=Io(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:Tn,lt=typeof t.NAMESPACE=="string"?t.NAMESPACE:U,ee=Se(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>d({},Ge)),ne=Se(t,"HTML_INTEGRATION_POINTS",()=>d({},Be));const e=Se(t,"CUSTOM_ELEMENT_HANDLING",()=>mt(null));if(k=mt(null),N(e,"tagNameCheck")&&Ye(e.tagNameCheck)&&(k.tagNameCheck=e.tagNameCheck),N(e,"attributeNameCheck")&&Ye(e.attributeNameCheck)&&(k.attributeNameCheck=e.attributeNameCheck),N(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(k.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),R(k),H&&($t=false),Ct&&(at=true),st&&(T=d({},mn),_=mt(null),st.html===true&&(d(T,pn),d(_,dn)),st.svg===true&&(d(T,Te),d(_,Ae),d(_,zt)),st.svgFilters===true&&(d(T,_e),d(_,Ae),d(_,zt)),st.mathMl===true&&(d(T,ge),d(_,hn),d(_,zt))),B.tagCheck=null,B.attributeCheck=null,N(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?B.tagCheck=t.ADD_TAGS:dt(t.ADD_TAGS)&&(T===Vt&&(T=M(T)),d(T,t.ADD_TAGS,A))),N(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?B.attributeCheck=t.ADD_ATTR:dt(t.ADD_ATTR)&&(_===jt&&(_=M(_)),d(_,t.ADD_ATTR,A))),N(t,"ADD_FORBID_CONTENTS")&&dt(t.ADD_FORBID_CONTENTS)&&(Q===Ue&&(Q=M(Q)),d(Q,t.ADD_FORBID_CONTENTS,A)),Zt&&(T["#text"]=true),Z&&d(T,["html","head","body"]),T.table&&(d(T,["tbody"]),delete gt.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=L;L=t.TRUSTED_TYPES_POLICY;try{q=it("")}catch(i){throw L=r,i}}else t.TRUSTED_TYPES_POLICY===null?(L=void 0,q=""):(L===void 0&&(L=kn()),L&&typeof q=="string"&&(q=it("")));y&&y(t),ct=t},Ve=d({},[...Te,..._e,...No]),je=d({},[...ge,...Co]),Jn=function(t,e,r){return e.namespaceURI===U?t==="svg":e.namespaceURI===vt?t==="svg"&&(r==="annotation-xml"||ee[r]):!!Ve[t]},Qn=function(t,e,r){return e.namespaceURI===U?t==="math":e.namespaceURI===Pt?t==="math"&&ne[r]:!!je[t]},to=function(t,e,r){return e.namespaceURI===Pt&&!ne[r]||e.namespaceURI===vt&&!ee[r]?false:!je[t]&&(Xn[t]||!Ve[t])},eo=function(t){const e=Gt(t),r=et(Tt(t)),i=ot(t);let u,f;return i&&v(i)===S.element?(u={namespaceURI:Gt(i)},f=et(Tt(i))):(u={namespaceURI:lt},f="template"),te[e]?e===Pt?Jn(r,u,f):e===vt?Qn(r,u,f):e===U?to(r,u,f):!!(At==="application/xhtml+xml"&&te[e]):false},Y=function(t){bt(o.removed,{element:t});try{ot(t).removeChild(t)}catch{if(Ft(t),!ot(t))throw G("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},$e=function(t,e,r){try{Oe(t,e)}catch{try{t.removeAttribute(r)}catch{}}},re=function(t){ae(t);const e=ht(t);e&&W(So(e),i=>{try{Ft(i)}catch{}});const r=v(t)===S.element?Wt(t):null;if(r)for(let i=r.length-1;i>=0;--i){const u=r[i],f=u&&u.name;typeof f=="string"&&$e(t,u,f)}},ut=function(t,e,r){if(!r)try{r=e.getAttributeNode(t)}catch{r=null}bt(o.removed,{attribute:r||null,from:e});try{r?Oe(e,r):e.removeAttribute(t)}catch{try{e.removeAttribute(t)}catch{}}if(t==="is")if(at||Ct)try{Y(e)}catch{}else try{e.setAttribute(t,"")}catch{}},Xe=function(t){const e=Wt(t);if(e)for(let r=e.length-1;r>=0;--r){const i=e[r],u=i&&i.name;typeof u!="string"||_[A(u)]||$e(t,i,u)}},ie=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:false;const i=[t];for(;i.length>0;){const u=i.pop();if(e(u)===false)continue;if(r&&v(u)===S.element){const p=Ht(u);V(p)&&i.push(p)}const f=ht(u);if(f)for(let p=f.length-1;p>=0;--p)i.push(f[p])}},ae=function(t){ie(t,e=>{v(e)===S.element&&Xe(e)})},se=function(t){const e=[];return ie(t,r=>{e.push(r)},true),e},no=function(t,e){const r=me();W(se(t),i=>{v(i)===S.element&&de(r,i)}),W(e,i=>{v(i)===S.element&&!yt(r,i)&&Xe(i)})},qe=function(t,e){let r=false;return W(o.removed,i=>{i.element&&(r=r||i.element===t,ae(i.element))}),no(t,e),r},oo=8,ro=function(t,e){const r=J;let i=null;const u=()=>(i||(i=me(),W(e,f=>{de(i,f)})),i);for(let f=0;;f++){const p=se(t),b=[t];let z=false;if(W(p,D=>{v(D)===S.documentFragment?bt(b,D):!z&&!yt(r,D)&&(z=yt(u(),D))}),!z)return;if(f>=oo)throw G("the tree kept changing during in-place sanitization; refusing to return it");W(b,(D,w)=>{io(D,w>0,t,u())})}},io=function(t,e,r,i){const u=le(t);let f;for(;f=u.nextNode();)!yt(i,f)||yt(J,f)||(e&&x(h.uponSanitizeShadowNode,f,null),ue(f,r),fe(f,r),V(f.content)&&St(f.content))},ao=function(t){J&&de(J,t)},Ke=function(t,e){return K?t==="patchsrc"?true:t==="for"&&e!=="label"&&e!=="output":false},so=function(t){K&&ie(t,e=>{const r=v(e);if(r===S.processingInstruction||r===S.comment&&O(_n,e.data)){try{Ft(e)}catch{}return false}if(r===S.element){const i=e,u=A(Tt(e));try{i.hasAttribute&&i.hasAttribute("patchsrc")&&i.removeAttribute("patchsrc"),i.hasAttribute&&i.hasAttribute("for")&&Ke("for",u)&&i.removeAttribute("for")}catch{}}return true})},Ze=function(t){let e=null,r=null;if(Kt)t="<remove></remove>"+t;else{const f=ln(t,/^[\r\n\t ]+/);r=f&&f[0]}At==="application/xhtml+xml"&&lt===U&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const i=L?it(t):t;if(lt===U)try{e=new Dt().parseFromString(i,At)}catch{}if(!e||!e.documentElement){e=Yt.createDocument(lt,"template",null);try{e.documentElement.innerHTML=Qt?q:i}catch{}}const u=e.body||e.documentElement;return t&&r&&u.insertBefore(s.createTextNode(r),u.childNodes[0]||null),lt===U?zn.call(e,Z?"html":"body")[0]:Z?e.documentElement:u},le=function(t){const e=Lt?Lt(t):t.ownerDocument;return we.call(e||t,t,C.SHOW_ELEMENT|C.SHOW_COMMENT|C.SHOW_TEXT|C.SHOW_PROCESSING_INSTRUCTION|C.SHOW_CDATA_SECTION,null)},xt=function(t){return t=Ot(t,Hn," "),t=Ot(t,Wn," "),t=Ot(t,Gn," "),t},ce=function(t){var e;Je(t);const r=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");r&&W(r,i=>{V(i.content)&&ce(i.content)})},Je=function(t){t.normalize();const e=Lt?Lt(t):t.ownerDocument,r=we.call(e||t,t,C.SHOW_TEXT|C.SHOW_COMMENT|C.SHOW_CDATA_SECTION|C.SHOW_PROCESSING_INSTRUCTION,null);let i=r.nextNode();for(;i;)i.data=xt(i.data),i=r.nextNode()},kt=function(t){const e=rt?rt(t):null;return typeof e!="string"||A(e)!=="form"?false:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==Wt(t)||typeof t.removeAttribute!="function"||typeof t.removeAttributeNode!="function"||typeof t.getAttributeNode!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==X(t)||t.childNodes!==ht(t)},V=function(t){if(!X||typeof t!="object"||t===null)return false;try{return X(t)===S.documentFragment}catch{return false}},Et=function(t){if(!X||typeof t!="object"||t===null)return false;try{return typeof X(t)=="number"}catch{return false}};function x(a,t,e){a.length!==0&&W(a,r=>{r.call(o,t,e,ct)})}const lo=function(t,e){return!!(K&&t.hasChildNodes()&&!Et(t.firstElementChild)&&O(Ee,t.textContent)&&O(Ee,t.innerHTML)||K&&Go[e]&&v(t)===S.element&&Gt(t)===U&&(Et(t.firstElementChild)||typeof t.textContent=="string"&&O(Ee,t.textContent))||t.nodeType===S.processingInstruction||K&&t.nodeType===S.comment&&O(_n,t.data))},Ut=function(t,e){if(t instanceof RegExp)return O(t,e);if(t instanceof Function){for(var r=arguments.length,i=new Array(r>2?r-2:0),u=2;u<r;u++)i[u-2]=arguments[u];return!!t(e,...i)}return false},co=function(t,e,r){if(!gt[e]&&en(e)&&Ut(k.tagNameCheck,e))return false;if(Zt&&!Q[e]&&!Q[et(e)]){const i=ot(t),u=ht(t);if(u&&i){const f=u.length;for(let p=f-1;p>=0;--p){const b=t===r?vn(u[p],true):u[p];i.insertBefore(b,Pn(t))}}}return Y(t),true},Qe=function(t,e,r,i){return t.length===0?e:e===r||e===i?M(e):e},ft=function(t,e){return t===e||ot(t)!==null?false:(Jt&&ae(t),true)},ue=function(t,e){if(ao(t),x(h.beforeSanitizeElements,t,null),ft(t,e))return true;if(kt(t))return Y(t),true;const r=A(Tt(t));if(T=Qe(h.uponSanitizeElement,T,Vt,It),x(h.uponSanitizeElement,t,{tagName:r,allowedTags:T}),ft(t,e))return true;if(lo(t,r))return Y(t),true;if(gt[r]||!(B.tagCheck instanceof Function&&B.tagCheck(r))&&!T[r]){const i=co(t,r,e);return i===false&&(x(h.afterSanitizeElements,t,null),ft(t,e))?true:i}if(v(t)===S.element&&!eo(t)||(r==="noscript"||r==="noembed"||r==="noframes")&&O(Wo,t.innerHTML))return Y(t),true;if(H&&t.nodeType===S.text){const i=xt(t.textContent);t.textContent!==i&&(bt(o.removed,{element:t.cloneNode()}),t.textContent=i)}return x(h.afterSanitizeElements,t,null),ft(t,e)},tn=function(t,e,r){if(Ce[e]||Ke(e,t)||Pe&&(e==="id"||e==="name")&&(r in s||r in Zn))return false;const i=_[e]||B.attributeCheck instanceof Function&&B.attributeCheck(e,t);return $t&&O(Bn,e)||Me&&O(Yn,e)?true:i?He[e]||O(Ne,Ot(r,Ie,""))||(e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&cn(r,"data:")===0&&ze[t]||ve&&!O(Vn,Ot(r,Ie,""))?true:!r:en(t)&&Ut(k.tagNameCheck,t)&&Ut(k.attributeNameCheck,e,t)||e==="is"&&k.allowCustomizedBuiltInElements&&Ut(k.tagNameCheck,r)},uo=d({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),en=function(t){return!uo[et(t)]&&O(jn,t)},fo=function(t,e,r,i){if(L&&typeof nt=="object"&&typeof nt.getAttributeType=="function"&&!r)switch(nt.getAttributeType(t,e)){case"TrustedHTML":return it(i);case"TrustedScriptURL":return xn(i)}return i},po=function(t,e,r,i){try{return r?t.setAttributeNS(r,e,i):t.setAttribute(e,i),kt(t)?(Y(t),false):true}catch{return ut(e,t),false}},nn=function(t,e){return K&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e)?true:et(t)==="attributename"&&ln(e,"href")!==null},fe=function(t,e){if(x(h.beforeSanitizeAttributes,t,null),ft(t,e))return;const r=t.attributes;if(!r||kt(t))return;_=Qe(h.uponSanitizeAttribute,_,jt,Nt);const i={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:_,forceKeepAttr:void 0};let u=r.length;const f=A(t.nodeName);for(;u--;){const p=r[u],b=p.name,z=p.namespaceURI,D=p.value,w=A(b),pt=D;let I=b==="value"?pt:yo(pt),on=false;if(i.attrName=w,i.attrValue=I,i.keepAttr=true,i.forceKeepAttr=void 0,x(h.uponSanitizeAttribute,t,i),I=i.attrValue,xe&&(w==="id"||w==="name")&&cn(I,ke)!==0&&(ut(b,t,p),I=ke+I,on=true),nn(b,I)){ut(b,t,p);continue}if(!i.forceKeepAttr){if(!i.keepAttr){ut(b,t,p);continue}if(!Xt&&O(gn,I)){ut(b,t,p);continue}if(H&&(I=xt(I)),!tn(f,w,I)){ut(b,t,p);continue}I=fo(f,w,z,I),I!==pt&&po(t,b,z,I)&&on&&sn(o.removed)}}x(h.afterSanitizeAttributes,t,null),ft(t,e)},St=function(t){let e=null;const r=le(t);for(x(h.beforeSanitizeShadowDOM,t,null);e=r.nextNode();)if(x(h.uponSanitizeShadowNode,e,null),ue(e,t),fe(e,t),V(e.content)&&St(e.content),v(e)===S.element){const i=Ht(e);V(i)&&(pe(i),St(i))}H&&Je(t),x(h.afterSanitizeShadowDOM,t,null)},pe=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const r=e.pop();if(r.shadow){St(r.shadow);continue}const i=r.node,u=v(i)===S.element,f=ht(i);if(f)for(let p=f.length-1;p>=0;--p)e.push({node:f[p],shadow:null});if(u){const p=rt?rt(i):null;if(typeof p=="string"&&A(p)==="template"){const b=i.content;V(b)&&e.push({node:b,shadow:null})}}if(u){const p=Ht(i);V(p)&&e.push({node:null,shadow:p},{node:p,shadow:null})}}};return o.sanitize=function(a){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,r=null,i=null,u=null;if(Qt=!a,Qt&&(a="<!-->"),typeof a!="string"&&!Et(a)&&(a=Lo(a),typeof a!="string"))throw G("dirty is not a string, aborting");if(!o.isSupported)return a;qt?(T=It,_=Nt):oe(t),(h.uponSanitizeElement.length>0||h.uponSanitizeAttribute.length>0)&&(T=M(T)),h.uponSanitizeAttribute.length>0&&(_=M(_)),o.removed=[];const f=Jt&&typeof a!="string"&&Et(a);let p=[];const b=J;if(f){so(a);const w=Tt(a);if(typeof w=="string"){const pt=A(w);if(!T[pt]||gt[pt])throw re(a),G("root node is forbidden and cannot be sanitized in-place")}if(kt(a))throw re(a),G("root node is clobbered and cannot be sanitized in-place");p=se(a),J=me()}else if(Et(a))e=Ze("<!---->"),r=e.ownerDocument.importNode(a,true),r.nodeType===S.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?e=r:e.appendChild(r),pe(e);else{if(!at&&!H&&!Z&&a.indexOf("<")===-1)return L&&Mt?it(a):a;if(e=Ze(a),!e)return at?null:Mt?q:""}e&&Kt&&Y(e.firstChild);const z=f?a:e;try{f&&pe(a);const w=le(z);for(;i=w.nextNode();)ue(i,z),fe(i,z),V(i.content)&&St(i.content);f&&ro(a,p)}catch(w){throw f&&(re(a),qe(a,p)),w}finally{J=b}if(f){if(qe(a,p))throw G("a node selected for removal could not be safely returned; refusing to sanitize in place");return H&&ce(a),a}if(at){if(H&&ce(e),Ct)for(u=Un.call(e.ownerDocument);e.firstChild;)u.appendChild(e.firstChild);else u=e;return(_.shadowroot||_.shadowrootmode)&&(u=Fn.call(l,u,true)),u}let D=Z?e.outerHTML:e.innerHTML;return Z&&T["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&O(Fo,e.ownerDocument.doctype.name)&&(D="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
3
+ `+D),H&&(D=xt(D)),L&&Mt?it(D):D},o.setConfig=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};oe(a),qt=true,It=T,Nt=_},o.clearConfig=function(){ct=null,qt=false,It=null,Nt=null,L=Bt,q=""},o.isValidAttribute=function(a,t,e){ct||oe({});const r=A(a),i=A(t);return typeof e=="string"&&(nn(t,e)||!Xt&&O(gn,e))?false:tn(r,i,e)},o.addHook=function(a,t){typeof t=="function"&&N(h,a)&&bt(h[a],t)},o.removeHook=function(a,t){if(N(h,a)){if(t!==void 0){const e=Eo(h[a],t);return e===-1?void 0:bo(h[a],e,1)[0]}return sn(h[a])}},o.removeHooks=function(a){N(h,a)&&(h[a]=[])},o.removeAllHooks=function(){h=An()},o}var Vo=Dn();const Ln=["a","b","br","i","img","p","small","span","sub","sup"],wn=["href","alt","src","height","width","lang","dir"],In=["height","width","lang","dir"],Nn=/^(?:https?|mailto):/i,Cn={ALLOWED_TAGS:Ln,ALLOWED_ATTR:wn,ADD_URI_SAFE_ATTR:In,ALLOWED_URI_REGEXP:Nn,ALLOW_ARIA_ATTR:false,ALLOW_DATA_ATTR:false},jo={...Cn,ALLOWED_TAGS:[...Ln,"ul","ol","li","div"],ALLOWED_ATTR:[...wn,"role","aria-level","start","id","aria-labelledby"],ADD_URI_SAFE_ATTR:[...In,"aria-level","start","id","aria-labelledby"]},En=/^clover-md-\d+$/,$o={role:[["P",/^heading$/],["DIV",/^group$/]],"aria-level":[["P",/^[1-6]$/]],start:[["OL",/^\d+$/]],id:[["P",En]],"aria-labelledby":[["DIV",En]]},Xo=new Set(["address","article","aside","blockquote","dd","details","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","li","main","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"]);function qo(n){var l;if(!n)return n;const o=document.createElement("template");o.innerHTML=n;for(const c of o.content.querySelectorAll("img:not([src])"))c.remove();for(const c of o.content.querySelectorAll("p"))!((l=c.textContent)!=null&&l.trim())&&!c.querySelector("img, br")&&c.remove();const s=document.createTreeWalker(o.content,NodeFilter.SHOW_TEXT);for(let c=s.nextNode();c;c=s.nextNode())c.nodeValue=c.nodeValue.replace(/[ \t\n\r\f]{2,}/g," ");return o.innerHTML.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g,"")}let tt=null;const Mn=new WeakMap;function Ko(n){var c;const o=n.closest("a");if(!(o!=null&&o.getAttribute("href"))||((c=o.textContent)==null?void 0:c.trim())||[...o.querySelectorAll("img")].some(m=>m.getAttribute("alt")))return;const l=Mn.get(o);if(l)return l;try{const m=new URL(o.getAttribute("href"));return(m.protocol==="mailto:"?m.pathname:m.host)||void 0}catch{return}}function Zo(){return tt||(tt=Vo(window),tt.addHook("uponSanitizeAttribute",(n,o)=>{n.nodeName==="A"&&o.attrName==="title"&&o.attrValue.trim()&&Mn.set(n,o.attrValue.trim())}),tt.addHook("uponSanitizeElement",(n,o)=>{o.allowedTags[o.tagName]||!Xo.has(o.tagName)||n.nodeType===1&&(n.prepend(" "),n.append(" "))}),tt.addHook("afterSanitizeAttributes",n=>{var o,s;n.nodeName==="IMG"&&!n.hasAttribute("alt")&&n.setAttribute("alt",Ko(n)??"");for(const l of["src","href"]){const c=(o=n.getAttribute)==null?void 0:o.call(n,l);c&&!Nn.test(c.trim())&&n.removeAttribute(l)}for(const[l,c]of Object.entries($o)){const m=(s=n.getAttribute)==null?void 0:s.call(n,l);m!=null&&!c.some(([E,$])=>n.nodeName===E&&$.test(m))&&n.removeAttribute(l)}}),tt)}function Jo(n,{markdown:o=false}={}){return typeof window>"u"?n:qo(Zo().sanitize(n,o?jo:Cn))}export{Jo as sanitizeHTML};
@@ -0,0 +1 @@
1
+ import{a0 as a}from"./shared-MTsMddHx.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
@@ -0,0 +1 @@
1
+ import{au as w,O as f,a5 as x,S}from"./shared-MTsMddHx.mjs";const A=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,b as search,R as searchInto};
@@ -0,0 +1 @@
1
+ function L(r,s,g){const u=HTMLMediaElement.prototype,i=Object.getOwnPropertyDescriptor(u,"currentTime"),T=Object.getOwnPropertyDescriptor(u,"buffered");let c=0,a=null;const E=()=>i.get.call(r),d=t=>i.set.call(r,t),o=()=>s[c].start,h=t=>{let e=0;return s.forEach((n,O)=>{n.start<=t&&(e=O)}),e},m=new WeakMap,f=()=>{for(const t of Array.from(r.textTracks??[]))for(const e of Array.from(t.cues??[])){let n=m.get(e);n||(n={start:e.startTime,end:e.endTime},m.set(e,n)),e.startTime=n.start-o(),e.endTime=n.end-o()}},p=(t,e,n)=>{a={time:e,play:n},t!==c&&(c=t,f(),r.src=s[t].src)},l=()=>{var n;if(!a)return;const{time:t,play:e}=a;a=null,d(Math.max(0,t-o())),e&&((n=r.play())==null||n.catch(()=>{}))},y=t=>{c>=s.length-1||(t.stopImmediatePropagation(),p(c+1,s[c+1].start,true))};Object.defineProperty(r,"currentTime",{configurable:true,get:()=>a?a.time:o()+E(),set:t=>{const e=h(t);if(e===c&&!a){d(Math.max(0,t-o()));return}p(e,t,(a==null?void 0:a.play)??!r.paused),e===c&&r.readyState>=1&&l()}}),Object.defineProperty(r,"duration",{configurable:true,get:()=>g??Number.NaN}),Object.defineProperty(r,"buffered",{configurable:true,get:()=>{const t=T.get.call(r),e=o();return{length:t.length,start:n=>e+t.start(n),end:n=>e+t.end(n)}}}),r.addEventListener("ended",y),r.addEventListener("loadedmetadata",l);const b=Array.from(r.querySelectorAll("track"));return b.forEach(t=>t.addEventListener("load",f)),()=>{r.removeEventListener("ended",y),r.removeEventListener("loadedmetadata",l),b.forEach(t=>t.removeEventListener("load",f));for(const t of["currentTime","duration","buffered"])delete r[t]}}export{L as playInSequence};