@nulib/clover 4.5.4 → 4.5.5

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 (240) hide show
  1. package/dist/core/content-state-reader.mjs +1 -1
  2. package/dist/core/follow-content.mjs +170 -0
  3. package/dist/core/load.mjs +14 -38
  4. package/dist/index.d.mts +5 -3
  5. package/dist/map/index.d.mts +5 -3
  6. package/dist/templates/index.d.mts +5 -3
  7. package/dist/web-components/{About-DCeIMPXs.mjs → About-Cpf_iDP6.mjs} +1 -1
  8. package/dist/web-components/{AnnotationItems-vokjqFpJ.mjs → AnnotationItems-C1e8vrQO.mjs} +1 -1
  9. package/dist/web-components/{AnnotationMenu-n8wZulkI.mjs → AnnotationMenu-BE10k1MN.mjs} +1 -1
  10. package/dist/web-components/{AnnotationState-DJSkyiw0.mjs → AnnotationState-Du0q2Lkv.mjs} +1 -1
  11. package/dist/web-components/{Annotations-CgPEcwft.mjs → Annotations-BQ5w1-ZP.mjs} +1 -1
  12. package/dist/web-components/{Annotations-D2Iy6k3X.mjs → Annotations-DrqkNr7d.mjs} +1 -1
  13. package/dist/web-components/{Body-h5ykt3jO.mjs → Body-DhQxrVvR.mjs} +1 -1
  14. package/dist/web-components/{BodyAlert-COFJjxVV.mjs → BodyAlert-BQET-pQO.mjs} +1 -1
  15. package/dist/web-components/{Button-CgTdpmNf.mjs → Button-BirIS0UB.mjs} +1 -1
  16. package/dist/web-components/{Camera-i2fafLIh.mjs → Camera-U-go7jsP.mjs} +1 -1
  17. package/dist/web-components/{Canvas2DBackend-C2AYDVCI.mjs → Canvas2DBackend-aLTLJt5G.mjs} +1 -1
  18. package/dist/web-components/{CanvasView-uvJ5kDYN.mjs → CanvasView-w6t-JMBB.mjs} +2 -2
  19. package/dist/web-components/{CaptionDetails-m7amd8MS.mjs → CaptionDetails-DXZRgiVF.mjs} +1 -1
  20. package/dist/web-components/{ChaptersMenu-6dDzuI0m.mjs → ChaptersMenu-BYyi47lT.mjs} +1 -1
  21. package/dist/web-components/{Chevron-DVax9RTn.mjs → Chevron-HuG2pLVe.mjs} +1 -1
  22. package/dist/web-components/{ChoiceMenu-DH4n5jdL.mjs → ChoiceMenu-DhUQ0nC7.mjs} +1 -1
  23. package/dist/web-components/{Collection-CCjFTuVG.mjs → Collection-CJo6fTNU.mjs} +1 -1
  24. package/dist/web-components/{CollectionSelect-0wNC970P.mjs → CollectionSelect-BPiJm2qX.mjs} +1 -1
  25. package/dist/web-components/{Connected-CssvezHA.mjs → Connected-BXc1y6St.mjs} +1 -1
  26. package/dist/web-components/{Connected-CGF0cSzv.mjs → Connected-BbzI2zK6.mjs} +1 -1
  27. package/dist/web-components/{Connected-Cr4h-tHh.mjs → Connected-Dy05dLlD.mjs} +1 -1
  28. package/dist/web-components/{Contents-Cs7_X8jD.mjs → Contents-DyEvnvBZ.mjs} +1 -1
  29. package/dist/web-components/{ControlMenu-J-gMDza-.mjs → ControlMenu-DILqYp7x.mjs} +1 -1
  30. package/dist/web-components/ControlsFade-_qZMmd34.mjs +1 -0
  31. package/dist/web-components/{CountMenu--Z7rGivu.mjs → CountMenu-30RDtctj.mjs} +1 -1
  32. package/dist/web-components/Cue-I_zHaG-m.mjs +1 -0
  33. package/dist/web-components/{Document-D5r6QJ9F.mjs → Document-CWn0VzSO.mjs} +1 -1
  34. package/dist/web-components/{DomLayers-6wCUT5ap.mjs → DomLayers-BOeW3v4e.mjs} +1 -1
  35. package/dist/web-components/{Download-Cff-mZmi.mjs → Download-B1pH_Wet.mjs} +1 -1
  36. package/dist/web-components/{EntryBodies-D2OorCCX.mjs → EntryBodies-CCt_bYce.mjs} +1 -1
  37. package/dist/web-components/{EntryThumbnail-iY1cnsAP.mjs → EntryThumbnail-DApiQdWi.mjs} +1 -1
  38. package/dist/web-components/{FieldPill-Swznzuhd.mjs → FieldPill-EHefq8lM.mjs} +1 -1
  39. package/dist/web-components/{FrameAnimation-CjHUil6t.mjs → FrameAnimation-BNmzR70z.mjs} +1 -1
  40. package/dist/web-components/{Gallery-CCKnJzQY.mjs → Gallery-DpF-Cdw0.mjs} +1 -1
  41. package/dist/web-components/{GlobeGlyph-D_ZaGUO8.mjs → GlobeGlyph-DBYxhqnr.mjs} +1 -1
  42. package/dist/web-components/{HideToggle-D_n5lwkp.mjs → HideToggle-YnPk4svB.mjs} +1 -1
  43. package/dist/web-components/{ImageControls-Dk8F5lUA.mjs → ImageControls-CThSHB8z.mjs} +1 -1
  44. package/dist/web-components/{Items-CbO0GqAH.mjs → Items-DdbOaRXQ.mjs} +1 -1
  45. package/dist/web-components/{Label-jKQGRD5d.mjs → Label-Bk_O5G3C.mjs} +1 -1
  46. package/dist/web-components/{LanguageChoice-e7MGPRCd.mjs → LanguageChoice-DoyxbEct.mjs} +1 -1
  47. package/dist/web-components/{LanguageMenu-BsWzKg__.mjs → LanguageMenu-BeGB_jhm.mjs} +1 -1
  48. package/dist/web-components/{LightboxView-BjJ20ylQ.mjs → LightboxView-b6uDS_BD.mjs} +1 -1
  49. package/dist/web-components/{ListEnd-BXjH6six.mjs → ListEnd-BYM99ASf.mjs} +1 -1
  50. package/dist/web-components/{Loaded-CL-mpRHG.mjs → Loaded-BHfiAJdt.mjs} +1 -1
  51. package/dist/web-components/{LoadedCanvas-juLvz5vu.mjs → LoadedCanvas-DEf79L39.mjs} +1 -1
  52. package/dist/web-components/LoadedMap-Drwww6ZP.mjs +1 -0
  53. package/dist/web-components/{Loading-DGPqbYw2.mjs → Loading-DrMN5RS9.mjs} +1 -1
  54. package/dist/web-components/{Map-0ImX0W-q.mjs → Map-BS8OC5D2.mjs} +1 -1
  55. package/dist/web-components/{MapView-B-etTZqp.mjs → MapView-D4IDbUGn.mjs} +2 -2
  56. package/dist/web-components/{Markup-D5v_pfK-.mjs → Markup-D_gTftnI.mjs} +1 -1
  57. package/dist/web-components/{MediaBody-CU6BHhYo.mjs → MediaBody-DhaTtx4R.mjs} +1 -1
  58. package/dist/web-components/{MediaBody-BBu6nfi8.mjs → MediaBody-E-rYLYaC.mjs} +1 -1
  59. package/dist/web-components/{NavDate-CJkis3CR.mjs → NavDate-BCUGnx3P.mjs} +1 -1
  60. package/dist/web-components/{Navigator-CHoyJlHU.mjs → Navigator-DzySqVUa.mjs} +1 -1
  61. package/dist/web-components/{Pager-CObS0xYo.mjs → Pager-By7ZH6O7.mjs} +1 -1
  62. package/dist/web-components/{PagerLayout-DEwXb6TF.mjs → PagerLayout-BtEwyK5X.mjs} +1 -1
  63. package/dist/web-components/{Panel-CyP3eeQ5.mjs → Panel-Dvrq3M-Q.mjs} +1 -1
  64. package/dist/web-components/PanelPart-hk33tq-m.mjs +1 -0
  65. package/dist/web-components/{PanelToggle-CxkqIgxi.mjs → PanelToggle-C-sqVIs1.mjs} +1 -1
  66. package/dist/web-components/{PartOfManifest-Cn_HgJ7I.mjs → PartOfManifest-CbMlCcX3.mjs} +1 -1
  67. package/dist/web-components/{Pending-DI4VIePO.mjs → Pending-DQJcdc5H.mjs} +1 -1
  68. package/dist/web-components/{PlaceBox-CHl0X25c.mjs → PlaceBox-DokzoF67.mjs} +1 -1
  69. package/dist/web-components/{Placeholder-Cg3ByN0S.mjs → Placeholder-CuzCilBT.mjs} +1 -1
  70. package/dist/web-components/{Position-DMsgzBqP.mjs → Position-fepKcPfZ.mjs} +1 -1
  71. package/dist/web-components/{Primitives-7dLlwNwr.mjs → Primitives-AJjxmiOF.mjs} +1 -1
  72. package/dist/web-components/{Provider-YGHeWGVP.mjs → Provider-rBUKn839.mjs} +1 -1
  73. package/dist/web-components/{ReadMore-D80et8BG.mjs → ReadMore-BuFCtdGh.mjs} +1 -1
  74. package/dist/web-components/{Root-CUaKZDXj.mjs → Root-BSE4OmuO.mjs} +1 -1
  75. package/dist/web-components/Scene-DkWFm9Ym.mjs +1 -0
  76. package/dist/web-components/{SceneView-CunAaAoN.mjs → SceneView-BjNoL0uV.mjs} +1 -1
  77. package/dist/web-components/{Search-C3LFmKil.mjs → Search-BcrZLdEQ.mjs} +1 -1
  78. package/dist/web-components/{Sections-BT3WtluQ.mjs → Sections-01Q3gAlf.mjs} +1 -1
  79. package/dist/web-components/{SeekMarks-DazilTox.mjs → SeekMarks-DVs5pj-u.mjs} +1 -1
  80. package/dist/web-components/{StandaloneItems-8zvqQ2eQ.mjs → StandaloneItems-CMDIvH00.mjs} +1 -1
  81. package/dist/web-components/{Status-CvunwdwM.mjs → Status-h__hPYUf.mjs} +1 -1
  82. package/dist/web-components/{Steps-Cw27EFcs.mjs → Steps-B0-nEjZX.mjs} +1 -1
  83. package/dist/web-components/{TargetItems-_jmvEEEp.mjs → TargetItems-vqRcAP52.mjs} +1 -1
  84. package/dist/web-components/Timeline-BBUkJGOZ.mjs +1 -0
  85. package/dist/web-components/{Tip-DxvfQm-l.mjs → Tip-CDk5jVbe.mjs} +1 -1
  86. package/dist/web-components/{Transcript-C7pTS92q.mjs → Transcript-CCFPC1Q6.mjs} +1 -1
  87. package/dist/web-components/{Transport-K0u9YhmA.mjs → Transport-DzxbhG8Z.mjs} +1 -1
  88. package/dist/web-components/{Transport-hORVpyCc.mjs → Transport-KakYzWlH.mjs} +1 -1
  89. package/dist/web-components/{annotation-collection-y13MLLGX.mjs → annotation-collection-DFeI_mDz.mjs} +1 -1
  90. package/dist/web-components/{annotation-name-U_Yiz_CP.mjs → annotation-name-FBisev7H.mjs} +1 -1
  91. package/dist/web-components/{annotations-content-B6PtnG5P.mjs → annotations-content-BOOCdTm4.mjs} +1 -1
  92. package/dist/web-components/{body-Eiq36Gou.mjs → body-CXwg03cI.mjs} +1 -1
  93. package/dist/web-components/{canvas-CDjBaQ75.mjs → canvas-DoyxoYGC.mjs} +1 -1
  94. package/dist/web-components/{cloverEngine-65MawacL.mjs → cloverEngine-GBxKE0AS.mjs} +1 -1
  95. package/dist/web-components/content-state-reader-_LdLjiP1.mjs +1 -0
  96. package/dist/web-components/{controlGlyphs-BI3qUN6D.mjs → controlGlyphs-DJPsdVYe.mjs} +1 -1
  97. package/dist/web-components/{controls-Cc5LuT8p.mjs → controls-C_p3vZR8.mjs} +1 -1
  98. package/dist/web-components/{downloads-Pq5Aedpe.mjs → downloads-BbtPYZBf.mjs} +1 -1
  99. package/dist/web-components/{dragToClose-DBlTMmyC.mjs → dragToClose-DIwndGui.mjs} +1 -1
  100. package/dist/web-components/{engine-BHQWLVxn.mjs → engine-BjIE4NRo.mjs} +1 -1
  101. package/dist/web-components/{engines-BnPu5Ggs.mjs → engines-CrU7hjmx.mjs} +1 -1
  102. package/dist/web-components/{fetchManifest-BKGaZzDw.mjs → fetchManifest-CnNL49H6.mjs} +1 -1
  103. package/dist/web-components/follow-content-DucWQI_6.mjs +1 -0
  104. package/dist/web-components/{fromManifest-qxJrEfn6.mjs → fromManifest-DP9m_bqJ.mjs} +1 -1
  105. package/dist/web-components/{glyphs-PlEEwLrB.mjs → glyphs-F7ExZRQ9.mjs} +1 -1
  106. package/dist/web-components/{hooks--n9dMuHb.mjs → hooks-BiGLi7Q8.mjs} +1 -1
  107. package/dist/web-components/{image-layers-BLqN0BKU.mjs → image-layers-COBMItDq.mjs} +1 -1
  108. package/dist/web-components/{image-service-content-DHDgPYBV.mjs → image-service-content-Dy89TOVT.mjs} +1 -1
  109. package/dist/web-components/{imageService-DfXP25SW.mjs → imageService-Dg5zJI3p.mjs} +1 -1
  110. package/dist/web-components/{index-BjpZQ9J-.mjs → index-e37SYBar.mjs} +1 -1
  111. package/dist/web-components/index.mjs +1 -1
  112. package/dist/web-components/items-Bu0NTcJ9.mjs +1 -0
  113. package/dist/web-components/{items-BwKkJEOS.mjs → items-CbXnr9UA.mjs} +1 -1
  114. package/dist/web-components/label-DXfO2yzp.mjs +1 -0
  115. package/dist/web-components/{layout-DbMbjpx4.mjs → layout-DdBH1AmH.mjs} +1 -1
  116. package/dist/web-components/{link-BIc77IY3.mjs → link-CVd4-rY6.mjs} +1 -1
  117. package/dist/web-components/logo-1fBtW3pZ.mjs +1 -0
  118. package/dist/web-components/{models-BXBEOLKe.mjs → models-2j6yvmPN.mjs} +1 -1
  119. package/dist/web-components/{nodes-BWN5jzoG.mjs → nodes-kA2jmFay.mjs} +1 -1
  120. package/dist/web-components/{overlayImage-jvgcflf8.mjs → overlayImage-D9cRfY3j.mjs} +1 -1
  121. package/dist/web-components/{panel-BW39vvfB.mjs → panel-V_TPnipr.mjs} +1 -1
  122. package/dist/web-components/part-DyDa2O7K.mjs +1 -0
  123. package/dist/web-components/{playerSurface-PBbBGoj5.mjs → playerSurface-BTKHmxO1.mjs} +1 -1
  124. package/dist/web-components/{pointer-DsqyiOIC.mjs → pointer-DoAsoxqF.mjs} +1 -1
  125. package/dist/web-components/{provider-Dg6Gi5Ft.mjs → provider-fkcSwXBE.mjs} +1 -1
  126. package/dist/web-components/{range-regions-BmSXWBAS.mjs → range-regions-CT95uHM0.mjs} +1 -1
  127. package/dist/web-components/{read-more-BstyFDUC.mjs → read-more-D_b7dY43.mjs} +1 -1
  128. package/dist/web-components/{readingLanguages-BY2NUfQE.mjs → readingLanguages-CJajD7v0.mjs} +1 -1
  129. package/dist/web-components/{rendererSurface-AGFetq7k.mjs → rendererSurface-CEHeWJwy.mjs} +2 -2
  130. package/dist/web-components/{renderers-BjtPgVnV.mjs → renderers-CJ5nm0SY.mjs} +1 -1
  131. package/dist/web-components/{resource-i359_a15.mjs → resource-Dz_XBsCi.mjs} +1 -1
  132. package/dist/web-components/{save-file-nlQm0Sup.mjs → save-file-DKe_h_U9.mjs} +1 -1
  133. package/dist/web-components/{search-BPTt1eUz.mjs → search-BMpq8b3X.mjs} +1 -1
  134. package/dist/web-components/shared-GHegGgtP.mjs +1 -0
  135. package/dist/web-components/{show-link-DwefC5LJ.mjs → show-link-Ch_hofEX.mjs} +1 -1
  136. package/dist/web-components/{sizedImage-BBoqi5ZU.mjs → sizedImage-BG2tDbvS.mjs} +1 -1
  137. package/dist/web-components/{split-DqzkMVr3.mjs → split-m0F4ovjo.mjs} +1 -1
  138. package/dist/web-components/{status-BSpwZ8rO.mjs → status-jWbjVYSN.mjs} +1 -1
  139. package/dist/web-components/{styles-C9QeBpjd.mjs → styles-BCj9RoYW.mjs} +1 -1
  140. package/dist/web-components/three.mjs +1 -1
  141. package/dist/web-components/{thumbnail-Ckf6EotT.mjs → thumbnail-CF6-tqyq.mjs} +1 -1
  142. package/dist/web-components/{tip-DTTyG5KI.mjs → tip-uTbAyNGJ.mjs} +1 -1
  143. package/dist/web-components/{toggle-DAC1XODI.mjs → toggle-CVnC0vUV.mjs} +1 -1
  144. package/dist/web-components/{useContainerName-D_XCWIWP.mjs → useContainerName-7-Q4e3xe.mjs} +1 -1
  145. package/dist/web-components/{useControlsVisibility-CIjHTnaa.mjs → useControlsVisibility-BmZEKLoQ.mjs} +1 -1
  146. package/dist/web-components/{useNearViewport-B5E-oZb_.mjs → useNearViewport-Cm5F5962.mjs} +1 -1
  147. package/dist/web-components/{useScrollTrack-C2xSfGF6.mjs → useScrollTrack-CsQQUZVJ.mjs} +1 -1
  148. package/dist/web-components/viewer/{AnnotationItems-B16qAKiN.mjs → AnnotationItems-OHw3CidZ.mjs} +1 -1
  149. package/dist/web-components/viewer/{AnnotationMenu-DgJSq4fy.mjs → AnnotationMenu-0qO_As1t.mjs} +1 -1
  150. package/dist/web-components/viewer/AnnotationState-NPVw45tA.mjs +1 -0
  151. package/dist/web-components/viewer/{Annotations-DYkHWOeR.mjs → Annotations-C0uuxF0R.mjs} +2 -2
  152. package/dist/web-components/viewer/{Annotations-Cq5fXZrj.mjs → Annotations-CwoomsDV.mjs} +1 -1
  153. package/dist/web-components/viewer/{Canvas2DBackend-DvKFoHuh.mjs → Canvas2DBackend-CMRWLAd4.mjs} +1 -1
  154. package/dist/web-components/viewer/{CaptionDetails-DxTKPbOM.mjs → CaptionDetails-CJisf1i_.mjs} +1 -1
  155. package/dist/web-components/viewer/{ChaptersMenu-BC3qFrhN.mjs → ChaptersMenu-5Oh-jx8r.mjs} +1 -1
  156. package/dist/web-components/viewer/{ChoiceMenu-DXBx-fGv.mjs → ChoiceMenu-BUzPTObN.mjs} +1 -1
  157. package/dist/web-components/viewer/{Collection-CeCEHMv-.mjs → Collection-BccJjqj8.mjs} +1 -1
  158. package/dist/web-components/viewer/{Connected-DakTdEny.mjs → Connected-CtmQ-wSs.mjs} +1 -1
  159. package/dist/web-components/viewer/{Connected-CEraiqd1.mjs → Connected-D4hTMjqQ.mjs} +1 -1
  160. package/dist/web-components/viewer/{Contents-DOuB3pTB.mjs → Contents-drpA8FtX.mjs} +1 -1
  161. package/dist/web-components/viewer/{ControlMenu-CBb7ZoP6.mjs → ControlMenu-jv4lvjpj.mjs} +1 -1
  162. package/dist/web-components/viewer/ControlsFade-cDNVSrmI.mjs +1 -0
  163. package/dist/web-components/viewer/{CountMenu-WadMuI5T.mjs → CountMenu-D1b27rQp.mjs} +1 -1
  164. package/dist/web-components/viewer/{Cue-BF5ZjVa8.mjs → Cue-kaHJidpH.mjs} +1 -1
  165. package/dist/web-components/viewer/{Document-DfRQ7S0l.mjs → Document-7CrcC3Cu.mjs} +1 -1
  166. package/dist/web-components/viewer/{DomLayers-uwjfbBsp.mjs → DomLayers-GyEF7J55.mjs} +1 -1
  167. package/dist/web-components/viewer/{Download-C1nPhWlq.mjs → Download-D-aGRZnK.mjs} +1 -1
  168. package/dist/web-components/viewer/{EntryBodies-EWZ8rnB_.mjs → EntryBodies-CEzcz1SY.mjs} +1 -1
  169. package/dist/web-components/viewer/{EntryThumbnail-BGpml8t4.mjs → EntryThumbnail-Cz2jEZTC.mjs} +1 -1
  170. package/dist/web-components/viewer/{FieldPill-KWuDZTXX.mjs → FieldPill-CcYYMw3C.mjs} +1 -1
  171. package/dist/web-components/viewer/{FrameAnimation-ChvHbIgp.mjs → FrameAnimation-CXyt9tLj.mjs} +1 -1
  172. package/dist/web-components/viewer/{Gallery-DAal6sgL.mjs → Gallery-Dmmh85gM.mjs} +1 -1
  173. package/dist/web-components/viewer/{GlobeGlyph-ByDERN9z.mjs → GlobeGlyph-BkeoT59U.mjs} +1 -1
  174. package/dist/web-components/viewer/{HideToggle-C-gM8Mk8.mjs → HideToggle-BtfoToGM.mjs} +1 -1
  175. package/dist/web-components/viewer/{ImageControls-B2aR8D82.mjs → ImageControls-DdV9OCC9.mjs} +1 -1
  176. package/dist/web-components/viewer/{LanguageChoice-CbcBytbo.mjs → LanguageChoice-BC4raDCD.mjs} +1 -1
  177. package/dist/web-components/viewer/{LanguageMenu-D_tV0uO9.mjs → LanguageMenu-B7qmgfps.mjs} +1 -1
  178. package/dist/web-components/viewer/{LightboxView-C_Ofd0zk.mjs → LightboxView-Dr3R75lS.mjs} +1 -1
  179. package/dist/web-components/viewer/{ListEnd-DN2oUjyx.mjs → ListEnd-oPxO8hQE.mjs} +1 -1
  180. package/dist/web-components/viewer/{MapView-C0qrLqaP.mjs → MapView-Z1P-A5bs.mjs} +2 -2
  181. package/dist/web-components/viewer/{MediaBody-CfnBYVg-.mjs → MediaBody-C2hFgOY8.mjs} +1 -1
  182. package/dist/web-components/viewer/{NavDate-NJcjaWOv.mjs → NavDate-B32M8WGG.mjs} +1 -1
  183. package/dist/web-components/viewer/{Navigator-DRRodGLA.mjs → Navigator-DwbQ5u2i.mjs} +1 -1
  184. package/dist/web-components/viewer/{PagerLayout-Dgbs71Hu.mjs → PagerLayout-BgvyIDpY.mjs} +1 -1
  185. package/dist/web-components/viewer/PanelPart-7C8kqYXz.mjs +1 -0
  186. package/dist/web-components/viewer/{PartOfManifest-f8ZMHngG.mjs → PartOfManifest-B9RWDleM.mjs} +1 -1
  187. package/dist/web-components/viewer/{PlaceBox-CamClgeV.mjs → PlaceBox-DdCjBb2D.mjs} +1 -1
  188. package/dist/web-components/viewer/{Placeholder-D7t4rsFp.mjs → Placeholder-CS9JVhwU.mjs} +1 -1
  189. package/dist/web-components/viewer/{Search-CednujgR.mjs → Search-DQ6z5C9S.mjs} +1 -1
  190. package/dist/web-components/viewer/{SeekMarks-gvJ2UZoh.mjs → SeekMarks--tMu7IYO.mjs} +1 -1
  191. package/dist/web-components/viewer/{StandaloneItems-DkquLq5p.mjs → StandaloneItems-DYrbonjJ.mjs} +1 -1
  192. package/dist/web-components/viewer/{Steps-CFmYNpo3.mjs → Steps-WYWqChoR.mjs} +1 -1
  193. package/dist/web-components/viewer/{TargetItems-CfLAMuj8.mjs → TargetItems-l-tLGkfE.mjs} +1 -1
  194. package/dist/web-components/viewer/{Transcript-_eA-Dm0M.mjs → Transcript-CuHNI7e_.mjs} +1 -1
  195. package/dist/web-components/viewer/{Transport-5jVVRct0.mjs → Transport-BJRUqslB.mjs} +1 -1
  196. package/dist/web-components/viewer/{Transport-B4K4XAF-.mjs → Transport-Bu79eBtv.mjs} +1 -1
  197. package/dist/web-components/viewer/{annotation-collection-DBuApZiI.mjs → annotation-collection-C2MWEnuY.mjs} +1 -1
  198. package/dist/web-components/viewer/{annotation-name-C-CMfd6g.mjs → annotation-name-CKGOe06W.mjs} +1 -1
  199. package/dist/web-components/viewer/{annotations-content-D8UWdcFt.mjs → annotations-content-ConN9zDA.mjs} +1 -1
  200. package/dist/web-components/viewer/{cloverEngine-CKfaQ-Wc.mjs → cloverEngine-BCS7nTmf.mjs} +2 -2
  201. package/dist/web-components/viewer/content-state-reader-BTtuWgX0.mjs +1 -0
  202. package/dist/web-components/viewer/{dragToClose-DDJ3XwRu.mjs → dragToClose-aTN7qXF5.mjs} +1 -1
  203. package/dist/web-components/viewer/{fetchManifest-pVcLruTs.mjs → fetchManifest-CCrNctKu.mjs} +1 -1
  204. package/dist/web-components/viewer/follow-content-C6F0s_fJ.mjs +1 -0
  205. package/dist/web-components/viewer/{host-BbYrtAtM.mjs → host-BQ8w6end.mjs} +1 -1
  206. package/dist/web-components/viewer/{image-layers-D0QWXFeZ.mjs → image-layers-D7_YIZD2.mjs} +1 -1
  207. package/dist/web-components/viewer/{image-service-content-ClTuuZ5p.mjs → image-service-content-D_HLWst7.mjs} +1 -1
  208. package/dist/web-components/viewer/index.mjs +1 -1
  209. package/dist/web-components/viewer/{link-CE5biAiK.mjs → link-CX0131kM.mjs} +1 -1
  210. package/dist/web-components/viewer/{overlayImage-ykHbPvnH.mjs → overlayImage-LSQOVinl.mjs} +1 -1
  211. package/dist/web-components/viewer/{range-regions-DD-NwcwE.mjs → range-regions-C_AleS_r.mjs} +1 -1
  212. package/dist/web-components/viewer/{renderers-N8qGiR4Q.mjs → renderers-CKX3o8vY.mjs} +1 -1
  213. package/dist/web-components/viewer/sanitize-DETRcc_c.mjs +3 -0
  214. package/dist/web-components/viewer/{save-file-Bczd1gGN.mjs → save-file-BMJIsv-z.mjs} +1 -1
  215. package/dist/web-components/viewer/{search--UfJW1mN.mjs → search-DwsVuur9.mjs} +1 -1
  216. package/dist/web-components/viewer/svg-shape-CTjogIds.mjs +1 -0
  217. package/dist/web-components/viewer/trusted-Dj6-eE4L.mjs +1 -0
  218. package/dist/web-components/viewer/{useControlsVisibility-B1Ag1zm_.mjs → useControlsVisibility-DIvgbH07.mjs} +1 -1
  219. package/dist/web-components/viewer/viewer-8GpsPBqv.mjs +29 -0
  220. package/dist/web-components/viewer/{vtt-U7j7H25c.mjs → vtt-Bnz0c60d.mjs} +1 -1
  221. package/dist/web-components/{viewer-CkXVnqu5.mjs → viewer-Tuo0l3iL.mjs} +1 -1
  222. package/dist/web-components/{vtt-Di31JcWg.mjs → vtt-BUo1kBkL.mjs} +1 -1
  223. package/package.json +1 -1
  224. package/dist/web-components/ControlsFade-BDjMo25i.mjs +0 -1
  225. package/dist/web-components/Cue-BzhK_KTz.mjs +0 -1
  226. package/dist/web-components/LoadedMap-CowAds3f.mjs +0 -1
  227. package/dist/web-components/PanelPart-DzeT8Atv.mjs +0 -1
  228. package/dist/web-components/Scene-B9X0CUW5.mjs +0 -1
  229. package/dist/web-components/Timeline-CKGsgOW4.mjs +0 -1
  230. package/dist/web-components/content-state-reader-CY-uQUXA.mjs +0 -1
  231. package/dist/web-components/items-Hk3_LJmo.mjs +0 -1
  232. package/dist/web-components/label-CGhzU3ki.mjs +0 -1
  233. package/dist/web-components/logo-BV7vGA6L.mjs +0 -1
  234. package/dist/web-components/part-C9K_lQE1.mjs +0 -1
  235. package/dist/web-components/shared-Cqxks7jF.mjs +0 -1
  236. package/dist/web-components/viewer/AnnotationState-YuVCBM29.mjs +0 -1
  237. package/dist/web-components/viewer/ControlsFade-WJ98Wqju.mjs +0 -1
  238. package/dist/web-components/viewer/PanelPart-BibD4mAY.mjs +0 -1
  239. package/dist/web-components/viewer/content-state-reader-BvfAdXET.mjs +0 -1
  240. package/dist/web-components/viewer/viewer-DL8dyfj_.mjs +0 -29
@@ -82,7 +82,7 @@ function resolveTarget(target, json) {
82
82
  if (parsed.rect) canvasTarget.region = parsed.rect;
83
83
  const time = (pointTime == null ? void 0 : pointTime.t) ?? startTime(parsed.t);
84
84
  if (time !== void 0) canvasTarget.time = Number(time);
85
- const partOf = asArray(resource.partOf).find(
85
+ const partOf = [resource, target].flatMap((each) => asArray(each == null ? void 0 : each.partOf)).find(
86
86
  (part) => (part == null ? void 0 : part.id) && (!part.type || part.type === "Manifest")
87
87
  );
88
88
  const collection = collectionOf(partOf);
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ import { parseAnnotationTarget } from "./annotations.mjs";
3
+ import { resolveContentState } from "./content-state-reader.mjs";
4
+ import { CloverContentError } from "./load.mjs";
5
+ import { readSvgShape } from "./svg-shape.mjs";
6
+ import { asArray } from "../lib/asArray.mjs";
7
+ const PRESENTATION_2 = "http://iiif.io/api/presentation/2/context.json";
8
+ const isPresentation2Annotation = (json) => (json == null ? void 0 : json["@type"]) === "oa:Annotation" || (json == null ? void 0 : json["@id"]) !== void 0 && asArray(json == null ? void 0 : json["@context"]).includes(PRESENTATION_2);
9
+ const idOf = (value) => typeof value === "string" ? value : (value == null ? void 0 : value["@id"]) ?? (value == null ? void 0 : value.id);
10
+ async function readAnnotation(json) {
11
+ if (!isPresentation2Annotation(json)) return json;
12
+ const { convertPresentation2 } = await import("@iiif/parser/presentation-2");
13
+ const read = convertPresentation2({
14
+ "@context": PRESENTATION_2,
15
+ ...JSON.parse(JSON.stringify(json))
16
+ });
17
+ const within = asArray(json.on).map(
18
+ (on) => idOf(asArray(on == null ? void 0 : on.within)[0])
19
+ );
20
+ const target = asArray(read.target).map((each, index) => {
21
+ const manifest = within[index];
22
+ if (!manifest) return each;
23
+ const partOf = [{ id: manifest, type: "Manifest" }];
24
+ const source = (each == null ? void 0 : each.type) === "SpecificResource";
25
+ const canvas = idOf(source ? each.source : each);
26
+ if (!canvas) return each;
27
+ return source ? { ...each, source: { id: canvas, type: "Canvas", partOf } } : { id: canvas, type: "Canvas", partOf };
28
+ });
29
+ const body = asArray(read.body).map(
30
+ (each) => typeof (each == null ? void 0 : each.chars) === "string" ? {
31
+ type: "TextualBody",
32
+ value: each.chars,
33
+ ...each.format ? { format: each.format } : {},
34
+ ...each.language ? { language: each.language } : {}
35
+ } : each
36
+ );
37
+ return {
38
+ ...read,
39
+ "@context": void 0,
40
+ type: "Annotation",
41
+ target: target.length === 1 ? target[0] : target,
42
+ ...body.length ? { body: body.length === 1 ? body[0] : body } : {}
43
+ };
44
+ }
45
+ async function follow(state, options, load) {
46
+ const resolved = await resolve(state);
47
+ if (!resolved) throw new CloverContentError("Unreadable content state");
48
+ const loaded = await load(resolved.id, {
49
+ ...options,
50
+ // The host's choice of member first, then the content state's.
51
+ manifestId: options.manifestId ?? resolved.manifestId,
52
+ follows: (options.follows ?? 0) + 1
53
+ });
54
+ const { target } = resolved;
55
+ return placeTarget({
56
+ ...loaded,
57
+ target: target && (!loaded.target || loaded.target.canvasId === target.canvasId) ? { ...loaded.target, ...target } : loaded.target ?? target,
58
+ annotation: loaded.annotation ?? resolved.annotation,
59
+ targets: loaded.targets ?? resolved.targets
60
+ });
61
+ }
62
+ async function resolve(state) {
63
+ const json = await readAnnotation(state);
64
+ const resolved = resolveContentState(json);
65
+ if (!resolved) return null;
66
+ const first = json.type === "Annotation" ? asArray(json.target)[0] : json;
67
+ const region = svgRegion(parseAnnotationTarget(first).svg);
68
+ const note = resolved.annotation;
69
+ return {
70
+ ...resolved,
71
+ ...resolved.target && !resolved.target.region && region ? { target: { ...resolved.target, region } } : {},
72
+ ...note ? {
73
+ annotation: {
74
+ ...note,
75
+ motivation: asArray(note.motivation).filter(
76
+ (motivation) => motivation !== "painting"
77
+ ),
78
+ ...json.label ? { label: json.label } : {}
79
+ }
80
+ } : {}
81
+ };
82
+ }
83
+ function startTime(t) {
84
+ const seconds = t ? Number(t.split(",")[0]) : NaN;
85
+ return Number.isFinite(seconds) ? seconds : void 0;
86
+ }
87
+ function svgRegion(svg) {
88
+ var _a;
89
+ const box = svg ? (_a = readSvgShape(svg)) == null ? void 0 : _a.box : void 0;
90
+ return box && box.width > 0 && box.height > 0 ? { x: box.x, y: box.y, w: box.width, h: box.height } : void 0;
91
+ }
92
+ function rangeStart(manifest, rangeId) {
93
+ const seen = /* @__PURE__ */ new Set();
94
+ const find = (ranges) => {
95
+ for (const range2 of ranges) {
96
+ if (!range2 || seen.has(range2)) continue;
97
+ seen.add(range2);
98
+ if (range2.type === "Range" && range2.id === rangeId) return range2;
99
+ const inner = find(asArray(range2.items));
100
+ if (inner) return inner;
101
+ }
102
+ return void 0;
103
+ };
104
+ const first = (range2, depth = 0) => {
105
+ for (const item of asArray(range2.items)) {
106
+ if ((item == null ? void 0 : item.type) === "Range") {
107
+ const found = depth < 16 ? first(item, depth + 1) : null;
108
+ if (found) return found;
109
+ continue;
110
+ }
111
+ const raw = typeof item === "string" ? item : item == null ? void 0 : item.id;
112
+ const parsed = parseAnnotationTarget(
113
+ (item == null ? void 0 : item.type) === "SpecificResource" ? item : String(raw ?? "").replace(/\/((?:t|xywh)=[^/#]*)$/, "#$1")
114
+ );
115
+ if (!parsed.id) continue;
116
+ const time = startTime(parsed.t);
117
+ return {
118
+ canvasId: parsed.id,
119
+ ...parsed.rect ? { region: parsed.rect } : {},
120
+ ...time !== void 0 ? { time } : {}
121
+ };
122
+ }
123
+ return null;
124
+ };
125
+ const range = find(asArray(manifest.structures));
126
+ return range ? first(range) : null;
127
+ }
128
+ function retarget(target, canvasId) {
129
+ if (typeof target === "string") {
130
+ const hash = target.indexOf("#");
131
+ return hash < 0 ? canvasId : canvasId + target.slice(hash);
132
+ }
133
+ const json = target;
134
+ if ((json == null ? void 0 : json.type) === "SpecificResource")
135
+ return {
136
+ ...json,
137
+ source: typeof json.source === "object" ? { ...json.source, id: canvasId, type: "Canvas" } : { id: canvasId, type: "Canvas" }
138
+ };
139
+ return retarget(String((json == null ? void 0 : json.id) ?? ""), canvasId);
140
+ }
141
+ function placeTarget(loaded) {
142
+ var _a;
143
+ const { manifest, target } = loaded;
144
+ if (!target) return loaded;
145
+ const canvases = asArray(manifest.items);
146
+ if (canvases.some((canvas) => (canvas == null ? void 0 : canvas.id) === target.canvasId)) return loaded;
147
+ const service = canvases.length === 1 && ((_a = canvases[0]) == null ? void 0 : _a.id) === `${manifest.id}/canvas` ? { canvasId: canvases[0].id } : null;
148
+ const place = service ?? rangeStart(manifest, target.canvasId);
149
+ if (!place) return loaded;
150
+ const annotation = loaded.annotation && {
151
+ ...loaded.annotation,
152
+ target: retarget(loaded.annotation.target, place.canvasId)
153
+ };
154
+ return {
155
+ ...loaded,
156
+ target: {
157
+ ...target,
158
+ canvasId: place.canvasId,
159
+ ...target.region ? {} : place.region ? { region: place.region } : {},
160
+ ...target.time !== void 0 ? {} : place.time !== void 0 ? { time: place.time } : {}
161
+ },
162
+ ...annotation ? { annotation } : {}
163
+ };
164
+ }
165
+ export {
166
+ follow,
167
+ placeTarget,
168
+ readAnnotation,
169
+ resolve
170
+ };
@@ -2,17 +2,13 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- import { asArray } from "../lib/asArray.mjs";
6
5
  import { preloadUpgrader, toPresentation4 } from "./presentation.mjs";
7
6
  import { fetchJson } from "./request.mjs";
8
7
  const readContentState = () => import("./content-state-reader.mjs");
9
8
  function isContentState(json) {
10
9
  const value = json;
11
10
  if (!value || typeof value !== "object") return false;
12
- if (value.type === "Annotation") {
13
- return asArray(value.motivation).includes("contentState");
14
- }
15
- return value.type === "SpecificResource";
11
+ return value.type === "Annotation" || value["@type"] === "oa:Annotation" || value.type === "SpecificResource";
16
12
  }
17
13
  const isImageService = (json) => Boolean(json) && typeof json === "object" && /ImageService[123]|iiif\.io\/api\/image/.test(
18
14
  JSON.stringify(
@@ -143,35 +139,14 @@ async function loadContent(input, options = {}) {
143
139
  var _a;
144
140
  const { request, signal } = options;
145
141
  void preloadUpgrader();
146
- let target;
147
- let member;
148
- let annotation;
149
- let targets;
150
- let json;
151
- const followContentState = async (state) => {
152
- const { resolveContentState } = await readContentState();
153
- const resolved = resolveContentState(state);
154
- if (!resolved) throw new CloverContentError("Unreadable content state");
155
- target = resolved.target ?? target;
156
- member = resolved.manifestId ?? member;
157
- annotation = resolved.annotation ?? annotation;
158
- targets = resolved.targets ?? targets;
159
- return fetchJson(request, resolved.id, signal);
160
- };
142
+ let json = input;
161
143
  if (typeof input === "string") {
162
- if (isUrl(input.trim())) {
163
- json = await fetchContent(request, input.trim(), signal);
164
- } else {
165
- const { decodeContentState } = await readContentState();
166
- const state = decodeContentState(input);
167
- if (!state) throw new CloverContentError("Unreadable iiifContent");
168
- json = isContentState(state) ? await followContentState(state) : state;
169
- }
170
- } else {
171
- json = input;
144
+ json = isUrl(input.trim()) ? await fetchContent(request, input.trim(), signal) : (await readContentState()).decodeContentState(input);
145
+ if (!json) throw new CloverContentError("Unreadable iiifContent");
172
146
  }
173
- if (isContentState(json)) {
174
- json = await followContentState(json);
147
+ if (isContentState(json) && (options.follows ?? 0) < 2) {
148
+ const { follow } = await import("./follow-content.mjs");
149
+ return follow(json, options, loadContent);
175
150
  }
176
151
  if (ANNOTATIONS.test(String((json == null ? void 0 : json.type) ?? ""))) {
177
152
  const { annotationsContent } = await import("./annotations-content.mjs");
@@ -188,13 +163,13 @@ async function loadContent(input, options = {}) {
188
163
  (_a = signal == null ? void 0 : signal.throwIfAborted) == null ? void 0 : _a.call(signal);
189
164
  switch (resource.type) {
190
165
  case "Manifest":
191
- return { manifest: resource, target, annotation, targets };
166
+ return { manifest: resource };
192
167
  case "Collection": {
193
168
  const collection = await withMembers(
194
169
  resource,
195
170
  options
196
171
  );
197
- const pick = options.manifestId ?? member;
172
+ const pick = options.manifestId;
198
173
  const chosen = pick ? (collection.items ?? []).find(
199
174
  (item) => item.id === pick && item.type === "Manifest"
200
175
  ) : void 0;
@@ -202,14 +177,15 @@ async function loadContent(input, options = {}) {
202
177
  if (!manifest) {
203
178
  throw new CloverContentError("The Collection holds no Manifest");
204
179
  }
205
- return { manifest, collection, target, annotation, targets };
180
+ return { manifest, collection };
206
181
  }
207
182
  case "Canvas":
208
183
  case "Timeline":
209
184
  case "Scene": {
210
- const container = resource;
211
- target ?? (target = { canvasId: container.id });
212
- return { manifest: loneCanvas(container), target, annotation };
185
+ return {
186
+ manifest: loneCanvas(resource),
187
+ target: { canvasId: resource.id }
188
+ };
213
189
  }
214
190
  default:
215
191
  throw new CloverContentError(
package/dist/index.d.mts CHANGED
@@ -307,9 +307,11 @@ export declare function buildContentState({ manifestId, canvasId, type, region,
307
307
  * state (JSON or base64url). The resource may be a Manifest, a Collection (its first
308
308
  * Manifest is shown), a lone Canvas (its `partOf` Manifest, or a Manifest made around
309
309
  * it), or annotations, an AnnotationPage or AnnotationCollection (the Manifest their first
310
- * annotation's Canvas is `partOf`, at that Canvas). It may also be a IIIF Image service,
311
- * its `info.json` or its base URI, shown as the one image it is (`imageServiceContent`).
312
- * Everything is fetched once, with the request settings, and upgraded to Presentation 4.
310
+ * annotation's Canvas is `partOf`, at that Canvas). A single Annotation, of any motivation,
311
+ * is read as a content state is: what it targets is opened, at its region and time, its
312
+ * body shown there as a note. It may also be a IIIF Image service, its `info.json` or its
313
+ * base URI, shown as the one image it is (`imageServiceContent`). Everything is fetched
314
+ * once, with the request settings, and upgraded to Presentation 4.
313
315
  */
314
316
  export type IIIFContent = string | Record<string, unknown>;
315
317
  /**
@@ -161,9 +161,11 @@ export interface CloverRequest {
161
161
  * state (JSON or base64url). The resource may be a Manifest, a Collection (its first
162
162
  * Manifest is shown), a lone Canvas (its `partOf` Manifest, or a Manifest made around
163
163
  * it), or annotations, an AnnotationPage or AnnotationCollection (the Manifest their first
164
- * annotation's Canvas is `partOf`, at that Canvas). It may also be a IIIF Image service,
165
- * its `info.json` or its base URI, shown as the one image it is (`imageServiceContent`).
166
- * Everything is fetched once, with the request settings, and upgraded to Presentation 4.
164
+ * annotation's Canvas is `partOf`, at that Canvas). A single Annotation, of any motivation,
165
+ * is read as a content state is: what it targets is opened, at its region and time, its
166
+ * body shown there as a note. It may also be a IIIF Image service, its `info.json` or its
167
+ * base URI, shown as the one image it is (`imageServiceContent`). Everything is fetched
168
+ * once, with the request settings, and upgraded to Presentation 4.
167
169
  */
168
170
  export type IIIFContent = string | Record<string, unknown>;
169
171
  export interface MapProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
@@ -183,9 +183,11 @@ export interface ContentStateOutput {
183
183
  * state (JSON or base64url). The resource may be a Manifest, a Collection (its first
184
184
  * Manifest is shown), a lone Canvas (its `partOf` Manifest, or a Manifest made around
185
185
  * it), or annotations, an AnnotationPage or AnnotationCollection (the Manifest their first
186
- * annotation's Canvas is `partOf`, at that Canvas). It may also be a IIIF Image service,
187
- * its `info.json` or its base URI, shown as the one image it is (`imageServiceContent`).
188
- * Everything is fetched once, with the request settings, and upgraded to Presentation 4.
186
+ * annotation's Canvas is `partOf`, at that Canvas). A single Annotation, of any motivation,
187
+ * is read as a content state is: what it targets is opened, at its region and time, its
188
+ * body shown there as a note. It may also be a IIIF Image service, its `info.json` or its
189
+ * base URI, shown as the one image it is (`imageServiceContent`). Everything is fetched
190
+ * once, with the request settings, and upgraded to Presentation 4.
189
191
  */
190
192
  export type IIIFContent = string | Record<string, unknown>;
191
193
  /**
@@ -1 +1 @@
1
- import{e as M,y as j,u as t,z as C,P as N,Y as w,a as x,Q as $,x as H,c as _,A as V,b as G,Z as T,V as k,l as B}from"./shared-Cqxks7jF.mjs";import{j as Q}from"./classnames-DukgfdpI.mjs";import{u as U}from"./readingLanguages-BY2NUfQE.mjs";import{Thumbnail as W,Summary as R,Metadata as Y,RequiredStatement as Z,Rights as E,Homepage as J,SeeAlso as X,Id as K}from"./Primitives-7dLlwNwr.mjs";import{u as ee}from"./downloads-Pq5Aedpe.mjs";import{P as te}from"./Provider-YGHeWGVP.mjs";import{a as oe,t as ae}from"./heading-Cjt0f-Eu.mjs";import{L as ne}from"./Label-jKQGRD5d.mjs";import{r as re}from"./dates-DR3gfcON.mjs";import"./styles-C9QeBpjd.mjs";const se=C(()=>import("./LanguageChoice-e7MGPRCd.mjs").then(e=>e.b).then(e=>({default:e.LanguageChoice}))),le=e=>{var r;const s=e.closest(".clover-sections-actions"),a=(r=s==null?void 0:s.closest(".clover-sections-item"))==null?void 0:r.querySelector(".clover-sections-heading .clover-sections-label");return s&&a?{box:s,label:a}:null},ce=e=>void w.chooseInterfaceLanguage(e);function ue(){x();const{languages:e,chosen:s}=w.interfaceLanguages();return e.length>1?{languages:e,chosen:s}:null}function ie({values:e=true,interfaceLanguages:s=true}={}){const a=U(),r=ue(),l=e?(a==null?void 0:a.languages)??[]:[],c=o=>l.some(b=>b===o||w.stringsFor(b)===o),g=[...l,...(s?(r==null?void 0:r.languages)??[]:[]).filter(o=>!c(o))];if(g.length<2)return null;const P=w.chosenLanguage,h=P&&w.stringsFor(P),L=h&&g.includes(h)&&!c(h)?h:e&&a?a.chosen:(r==null?void 0:r.chosen)??g[0];return{languages:g,chosen:L,onChange:o=>l.includes(o)&&a?a.onChange(o):ce(o)}}function me({values:e,interfaceLanguages:s}){const a=ie({values:e,interfaceLanguages:s}),{drawsToggle:r}=M("About"),l=!!a;return j(()=>l?r==null?void 0:r():void 0,[l,r]),a?t(N,{fallback:null,children:t(se,{...a,nameKey:"readingLanguage",part:"clover-about",fit:le})}):null}const de=$(false),ge=C(()=>import("./Download-Cff-mZmi.mjs").then(({DownloadGroups:e})=>({default:e}))),he=C(()=>import("./NavDate-CJkis3CR.mjs").then(e=>e.a).then(({NavDate:e})=>({default:e}))),be=C(()=>import("./PartOfManifest-Cn_HgJ7I.mjs"));function fe({languages:e=true,interfaceLanguages:s=true,...a}){const r=H(de);return t(ve,{...a,download:!r&&a.download!==false,choice:r?null:t(me,{values:e,interfaceLanguages:s})})}function ve({choice:e,canvasSummary:s=false,headingLevel:a=3,download:r=true,thumbnail:l=true,label:c=true,className:g,...P}){const{t:h,langOf:L}=x(),v=ee(),o=_(n=>n.manifest,Object.is,"About"),b=V(null);j(()=>{const n=b.current,i=n==null?void 0:n.querySelector(".clover-about-head");if(!n||!i||typeof ResizeObserver>"u")return;const m=new Set,d=()=>{const D=i.querySelector(".clover-about-thumbnail"),A=i.querySelector(".clover-about-label");for(const S of[D,A])S&&!m.has(S)&&(m.add(S),y.observe(S));const f=n.style;if(!D){f.removeProperty("--clover-about-label-height"),f.removeProperty("--clover-about-thumbnail-width");return}const O=`${(A==null?void 0:A.offsetHeight)??0}px`,q=`${D.offsetWidth}px`;f.getPropertyValue("--clover-about-label-height")!==O&&f.setProperty("--clover-about-label-height",O),f.getPropertyValue("--clover-about-thumbnail-width")!==q&&f.setProperty("--clover-about-thumbnail-width",q)};let p=0;const y=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(d)});return y.observe(i),d(),()=>{cancelAnimationFrame(p),y.disconnect(),n.style.removeProperty("--clover-about-label-height"),n.style.removeProperty("--clover-about-thumbnail-width")}},[c,l,o]);const z=G(),F=()=>{var m,d;const n=b.current;(d=((m=n==null?void 0:n.closest(".clover-sections-item"))==null?void 0:m.querySelector(".clover-sections-button"))??n)==null||d.focus({preventScroll:true})};if(!o)return null;const u=(n,i,m)=>{if(!i)return null;const{as:d,title:p,group:y}=ae(a,`${z}-${n}`);return t("section",{className:"clover-about-section",...y,children:[t(d,{className:"clover-about-heading",...B(L(n)),...p,children:h(n)}),m]})},I=n=>Array.isArray(o[n])?o[n].length>0:!!o[n];return t("div",{ref:b,className:Q("clover-about",g),tabIndex:-1,...P,children:[e,(l||c)&&t("div",{className:"clover-about-head",children:[l&&t(W,{className:"clover-about-thumbnail",size:256,alt:c?"":void 0}),c&&t(ne,{as:oe(a),className:"clover-about-label clover-title"})]}),s&&t(R,{of:"canvas",className:"clover-about-summary"}),T(o)&&o.partOf&&t(N,{fallback:null,children:t(be,{manifest:o,headingLevel:a,onOpened:F})}),t(R,{className:"clover-about-summary"}),t(Y,{className:"clover-about-metadata"}),t(Z,{className:"clover-about-metadata"}),u("aboutDate",re(o.navDate),t(N,{fallback:null,children:t(he,{value:o.navDate,className:"clover-about-date"})})),u("aboutProvider",I("provider"),t(te,{})),u("aboutRights",o.rights,t(E,{})),u("aboutHomepage",I("homepage"),t(J,{})),u("aboutSeeAlso",I("seeAlso"),t(X,{})),u("download",r&&v.page.length+v.all.length>0,t(N,{fallback:null,children:t(ge,{page:v.page,all:v.all,headingLevel:a+1})})),u(T(o)?"aboutCanvas":"aboutManifest",!k(o)&&o.id,t(K,{}))]})}const De=Object.freeze(Object.defineProperty({__proto__:null,About:fe},Symbol.toStringTag,{value:"Module"}));export{fe as A,de as I,me as L,De as a,ie as u};
1
+ import{e as M,y as j,u as t,z as C,P as N,Y as w,a as x,Q as $,x as H,c as _,A as V,b as G,Z as T,V as k,l as B}from"./shared-GHegGgtP.mjs";import{j as Q}from"./classnames-DukgfdpI.mjs";import{u as U}from"./readingLanguages-CJajD7v0.mjs";import{Thumbnail as W,Summary as R,Metadata as Y,RequiredStatement as Z,Rights as E,Homepage as J,SeeAlso as X,Id as K}from"./Primitives-AJjxmiOF.mjs";import{u as ee}from"./downloads-BbtPYZBf.mjs";import{P as te}from"./Provider-rBUKn839.mjs";import{a as oe,t as ae}from"./heading-Cjt0f-Eu.mjs";import{L as ne}from"./Label-Bk_O5G3C.mjs";import{r as re}from"./dates-DR3gfcON.mjs";import"./styles-BCj9RoYW.mjs";const se=C(()=>import("./LanguageChoice-DoyxbEct.mjs").then(e=>e.b).then(e=>({default:e.LanguageChoice}))),le=e=>{var r;const s=e.closest(".clover-sections-actions"),a=(r=s==null?void 0:s.closest(".clover-sections-item"))==null?void 0:r.querySelector(".clover-sections-heading .clover-sections-label");return s&&a?{box:s,label:a}:null},ce=e=>void w.chooseInterfaceLanguage(e);function ue(){x();const{languages:e,chosen:s}=w.interfaceLanguages();return e.length>1?{languages:e,chosen:s}:null}function ie({values:e=true,interfaceLanguages:s=true}={}){const a=U(),r=ue(),l=e?(a==null?void 0:a.languages)??[]:[],c=o=>l.some(b=>b===o||w.stringsFor(b)===o),g=[...l,...(s?(r==null?void 0:r.languages)??[]:[]).filter(o=>!c(o))];if(g.length<2)return null;const P=w.chosenLanguage,h=P&&w.stringsFor(P),L=h&&g.includes(h)&&!c(h)?h:e&&a?a.chosen:(r==null?void 0:r.chosen)??g[0];return{languages:g,chosen:L,onChange:o=>l.includes(o)&&a?a.onChange(o):ce(o)}}function me({values:e,interfaceLanguages:s}){const a=ie({values:e,interfaceLanguages:s}),{drawsToggle:r}=M("About"),l=!!a;return j(()=>l?r==null?void 0:r():void 0,[l,r]),a?t(N,{fallback:null,children:t(se,{...a,nameKey:"readingLanguage",part:"clover-about",fit:le})}):null}const de=$(false),ge=C(()=>import("./Download-B1pH_Wet.mjs").then(({DownloadGroups:e})=>({default:e}))),he=C(()=>import("./NavDate-BCUGnx3P.mjs").then(e=>e.a).then(({NavDate:e})=>({default:e}))),be=C(()=>import("./PartOfManifest-CbMlCcX3.mjs"));function fe({languages:e=true,interfaceLanguages:s=true,...a}){const r=H(de);return t(ve,{...a,download:!r&&a.download!==false,choice:r?null:t(me,{values:e,interfaceLanguages:s})})}function ve({choice:e,canvasSummary:s=false,headingLevel:a=3,download:r=true,thumbnail:l=true,label:c=true,className:g,...P}){const{t:h,langOf:L}=x(),v=ee(),o=_(n=>n.manifest,Object.is,"About"),b=V(null);j(()=>{const n=b.current,i=n==null?void 0:n.querySelector(".clover-about-head");if(!n||!i||typeof ResizeObserver>"u")return;const m=new Set,d=()=>{const D=i.querySelector(".clover-about-thumbnail"),A=i.querySelector(".clover-about-label");for(const S of[D,A])S&&!m.has(S)&&(m.add(S),y.observe(S));const f=n.style;if(!D){f.removeProperty("--clover-about-label-height"),f.removeProperty("--clover-about-thumbnail-width");return}const O=`${(A==null?void 0:A.offsetHeight)??0}px`,q=`${D.offsetWidth}px`;f.getPropertyValue("--clover-about-label-height")!==O&&f.setProperty("--clover-about-label-height",O),f.getPropertyValue("--clover-about-thumbnail-width")!==q&&f.setProperty("--clover-about-thumbnail-width",q)};let p=0;const y=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(d)});return y.observe(i),d(),()=>{cancelAnimationFrame(p),y.disconnect(),n.style.removeProperty("--clover-about-label-height"),n.style.removeProperty("--clover-about-thumbnail-width")}},[c,l,o]);const z=G(),F=()=>{var m,d;const n=b.current;(d=((m=n==null?void 0:n.closest(".clover-sections-item"))==null?void 0:m.querySelector(".clover-sections-button"))??n)==null||d.focus({preventScroll:true})};if(!o)return null;const u=(n,i,m)=>{if(!i)return null;const{as:d,title:p,group:y}=ae(a,`${z}-${n}`);return t("section",{className:"clover-about-section",...y,children:[t(d,{className:"clover-about-heading",...B(L(n)),...p,children:h(n)}),m]})},I=n=>Array.isArray(o[n])?o[n].length>0:!!o[n];return t("div",{ref:b,className:Q("clover-about",g),tabIndex:-1,...P,children:[e,(l||c)&&t("div",{className:"clover-about-head",children:[l&&t(W,{className:"clover-about-thumbnail",size:256,alt:c?"":void 0}),c&&t(ne,{as:oe(a),className:"clover-about-label clover-title"})]}),s&&t(R,{of:"canvas",className:"clover-about-summary"}),T(o)&&o.partOf&&t(N,{fallback:null,children:t(be,{manifest:o,headingLevel:a,onOpened:F})}),t(R,{className:"clover-about-summary"}),t(Y,{className:"clover-about-metadata"}),t(Z,{className:"clover-about-metadata"}),u("aboutDate",re(o.navDate),t(N,{fallback:null,children:t(he,{value:o.navDate,className:"clover-about-date"})})),u("aboutProvider",I("provider"),t(te,{})),u("aboutRights",o.rights,t(E,{})),u("aboutHomepage",I("homepage"),t(J,{})),u("aboutSeeAlso",I("seeAlso"),t(X,{})),u("download",r&&v.page.length+v.all.length>0,t(N,{fallback:null,children:t(ge,{page:v.page,all:v.all,headingLevel:a+1})})),u(T(o)?"aboutCanvas":"aboutManifest",!k(o)&&o.id,t(K,{}))]})}const De=Object.freeze(Object.defineProperty({__proto__:null,About:fe},Symbol.toStringTag,{value:"Module"}));export{fe as A,de as I,me as L,De as a,ie as u};
@@ -1 +1 @@
1
- import{e as P,c as v,ak as _,T as E,H as O,A as k,y as T,u as f,k as R,d as q,a2 as F}from"./shared-Cqxks7jF.mjs";import{P as L,a as y}from"./Items-CbO0GqAH.mjs";import{C as B}from"./CountMenu--Z7rGivu.mjs";import{a as D}from"./annotation-name-U_Yiz_CP.mjs";import{f as G,r as H}from"./fetchManifest-BKGaZzDw.mjs";import{u as K,L as V}from"./ListEnd-BXjH6six.mjs";function j({onSelect:o,forwardedRef:r,...c}){const{clover:l,language:e}=P("Items"),n=v(t=>t.manifest),s=v(t=>_(t.manifest,t.addedSets)),u=v(t=>t.annotationId),d=(s==null?void 0:s.pages)??z,m=(s==null?void 0:s.entries)??J,{loaded:A,more:N,reachNext:S}=K(d),x=E(()=>[...new Set(m.map(t=>O(t.annotation)).filter(t=>!!t&&t!==(n==null?void 0:n.id)))],[m,n==null?void 0:n.id]),C=U(c.layout==="pager"?Q:x),M=x.length>0,i=E(()=>{const t=d.length?new Set(d.slice(0,A).map(a=>a.id)):null;return m.filter(a=>!t||t.has(a.setId)).map(a=>{const g=O(a.annotation),p=g&&g!==(n==null?void 0:n.id)?C.get(g)??null:n;return X(a,p,e,M)})},[d,A,m,n,C,M,e]),b=Math.max((s==null?void 0:s.total)??0,i.length),I=k(null);if(T(()=>{const t=I.current;t===null||!i[t]||(I.current=null,l.selectAnnotation(i[t].id))},[l,i]),!i.length)return null;const h=i.findIndex(t=>t.id===u),w=(t,a)=>{o==null||o(t,a),l.selectAnnotation(t.id)};return c.layout==="pager"?f(L,{...c,forwardedRef:r,steps:{position:h,total:b,direction:"left-to-right",step:(a,g)=>{const p=h+a;if(!(p<0)){if(i[p])return w(i[p],g);N&&(I.current=p,S())}}},nameKey:"informationPanelTabsAnnotations",position:f(B,{position:h,total:b,list:a=>f(j,{layout:"list",forwardedRef:null,onSelect:a})})}):f(R,{children:[f(y,{...c,forwardedRef:r,items:i,selected:h,navigation:"id",language:e,request:l.request,showSummary:true,onActivate:w}),N&&f(V,{onReached:S})]})}const z=[],J=[],Q=[];function U(o){const{clover:r}=P("Items"),[c,l]=q(W);return T(()=>{if(!o.length)return;let e=true;for(const n of o)G(r,n).then(s=>{e&&s&&l(u=>u.has(n)?u:new Map(u).set(n,s))});return()=>{e=false}},[r,o]),c}const W=new Map;function X(o,r,c,l){const e=F(r,o.canvasId),n=D(o.bodies,c),s=n.text?{[n.lang??"none"]:[n.text]}:e==null?void 0:e.label,u=l?r==null?void 0:r.label:e==null?void 0:e.label,d=e&&o.target.rect?H(e,o.target.rect):void 0;return{id:o.id,label:s,summary:n.text?u:void 0,parts:[{id:o.id,type:"Canvas",label:s,resource:e??{id:o.canvasId},...d?{source:d}:{}}]}}export{j as default};
1
+ import{e as P,c as v,ak as _,T as E,H as O,A as k,y as T,u as f,k as R,d as q,a2 as F}from"./shared-GHegGgtP.mjs";import{P as L,a as y}from"./Items-DdbOaRXQ.mjs";import{C as B}from"./CountMenu-30RDtctj.mjs";import{a as D}from"./annotation-name-FBisev7H.mjs";import{f as G,r as H}from"./fetchManifest-CnNL49H6.mjs";import{u as K,L as V}from"./ListEnd-BYM99ASf.mjs";function j({onSelect:o,forwardedRef:r,...c}){const{clover:l,language:e}=P("Items"),n=v(t=>t.manifest),s=v(t=>_(t.manifest,t.addedSets)),u=v(t=>t.annotationId),d=(s==null?void 0:s.pages)??z,m=(s==null?void 0:s.entries)??J,{loaded:A,more:N,reachNext:S}=K(d),x=E(()=>[...new Set(m.map(t=>O(t.annotation)).filter(t=>!!t&&t!==(n==null?void 0:n.id)))],[m,n==null?void 0:n.id]),C=U(c.layout==="pager"?Q:x),M=x.length>0,i=E(()=>{const t=d.length?new Set(d.slice(0,A).map(a=>a.id)):null;return m.filter(a=>!t||t.has(a.setId)).map(a=>{const g=O(a.annotation),p=g&&g!==(n==null?void 0:n.id)?C.get(g)??null:n;return X(a,p,e,M)})},[d,A,m,n,C,M,e]),b=Math.max((s==null?void 0:s.total)??0,i.length),I=k(null);if(T(()=>{const t=I.current;t===null||!i[t]||(I.current=null,l.selectAnnotation(i[t].id))},[l,i]),!i.length)return null;const h=i.findIndex(t=>t.id===u),w=(t,a)=>{o==null||o(t,a),l.selectAnnotation(t.id)};return c.layout==="pager"?f(L,{...c,forwardedRef:r,steps:{position:h,total:b,direction:"left-to-right",step:(a,g)=>{const p=h+a;if(!(p<0)){if(i[p])return w(i[p],g);N&&(I.current=p,S())}}},nameKey:"informationPanelTabsAnnotations",position:f(B,{position:h,total:b,list:a=>f(j,{layout:"list",forwardedRef:null,onSelect:a})})}):f(R,{children:[f(y,{...c,forwardedRef:r,items:i,selected:h,navigation:"id",language:e,request:l.request,showSummary:true,onActivate:w}),N&&f(V,{onReached:S})]})}const z=[],J=[],Q=[];function U(o){const{clover:r}=P("Items"),[c,l]=q(W);return T(()=>{if(!o.length)return;let e=true;for(const n of o)G(r,n).then(s=>{e&&s&&l(u=>u.has(n)?u:new Map(u).set(n,s))});return()=>{e=false}},[r,o]),c}const W=new Map;function X(o,r,c,l){const e=F(r,o.canvasId),n=D(o.bodies,c),s=n.text?{[n.lang??"none"]:[n.text]}:e==null?void 0:e.label,u=l?r==null?void 0:r.label:e==null?void 0:e.label,d=e&&o.target.rect?H(e,o.target.rect):void 0;return{id:o.id,label:s,summary:n.text?u:void 0,parts:[{id:o.id,type:"Canvas",label:s,resource:e??{id:o.canvasId},...d?{source:d}:{}}]}}export{j as default};
@@ -1 +1 @@
1
- import{A as I,u as a,l as y}from"./shared-Cqxks7jF.mjs";import{s as H}from"./Annotations-CgPEcwft.mjs";import T from"./ControlMenu-J-gMDza-.mjs";import{C as $}from"./Cue-BzhK_KTz.mjs";import{H as z}from"./HideToggle-D_n5lwkp.mjs";import{u as B}from"./useContainerName-D_XCWIWP.mjs";import"./styles-C9QeBpjd.mjs";const G=({id:d,triggerId:C,label:M,labelLang:k,annotations:p,hiddenPages:x=[],onPageVisibilityChange:v,selected:w,onSelect:u,onActivate:i,onClose:D})=>{const h=B(M,k),m=I(false),r=[];p.forEach((n,c)=>{var s,l;const o=r[r.length-1];o&&((s=o.page)==null?void 0:s.text)===((l=n.page)==null?void 0:l.text)?o.items.push(c):r.push({page:n.page,items:[c]})});const E=r.some(n=>!n.page);return a(T,{className:"clover-canvas-annotation-menu","data-testid":"clover-canvas-annotation-menu",id:d,onClose:D,triggerId:C,children:[E&&h.node,r.map((n,c)=>{const o=[...new Set(n.items.flatMap(t=>p[t].pageId??[]))],s=`${d}-page-${c}`,l=v&&o.length>0&&a(z,{hidden:o.every(t=>x.includes(t)),onChange:t=>v(o,!t),of:n.page?s:void 0});return a("fieldset",{...n.page?{"aria-labelledby":s}:h.props,className:"clover-canvas-menu-group clover-annotations-set",children:[n.page?a("legend",{className:"clover-canvas-menu-legend clover-annotations-set-header",children:[a("span",{className:"clover-annotations-title",id:s,...y(n.page.lang),children:n.page.text}),l]}):l&&a("div",{className:"clover-annotations-set-header",children:l}),a("div",{className:"clover-annotations-list",children:n.items.map(t=>{const e=p[t],f=H(e),g=w===e.id,N="image"in e?e.image:void 0;return a("label",{className:"clover-canvas-menu-item clover-annotations-entry","data-selected":g,onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onPointerDown:()=>{m.current=true},children:[a("input",{type:"radio",name:d,checked:g,onChange:()=>u(e,m.current),onClick:()=>{(g||!m.current)&&u(e)},onKeyDown:b=>{m.current=false,b.key==="Enter"&&(b.preventDefault(),u(e))},onFocus:()=>i(e.id),onBlur:()=>i(null)}),f!==void 0&&a($,{start:f,className:"clover-annotations-time"}),a("span",{className:"clover-annotations-body clover-cue-text",children:[N&&a("img",{className:"clover-annotations-image",src:N,alt:"",loading:"lazy"}),a("span",{className:"clover-annotations-text",...y(e.label?e.lang:void 0),children:e.label??String(t+1)})]})]},e.id)})})]},c)})]})};export{G as default};
1
+ import{A as I,u as a,l as y}from"./shared-GHegGgtP.mjs";import{s as H}from"./Annotations-BQ5w1-ZP.mjs";import T from"./ControlMenu-DILqYp7x.mjs";import{C as $}from"./Cue-I_zHaG-m.mjs";import{H as z}from"./HideToggle-YnPk4svB.mjs";import{u as B}from"./useContainerName-7-Q4e3xe.mjs";import"./styles-BCj9RoYW.mjs";const G=({id:d,triggerId:C,label:M,labelLang:k,annotations:p,hiddenPages:x=[],onPageVisibilityChange:v,selected:w,onSelect:u,onActivate:i,onClose:D})=>{const h=B(M,k),m=I(false),r=[];p.forEach((n,c)=>{var s,l;const o=r[r.length-1];o&&((s=o.page)==null?void 0:s.text)===((l=n.page)==null?void 0:l.text)?o.items.push(c):r.push({page:n.page,items:[c]})});const E=r.some(n=>!n.page);return a(T,{className:"clover-canvas-annotation-menu","data-testid":"clover-canvas-annotation-menu",id:d,onClose:D,triggerId:C,children:[E&&h.node,r.map((n,c)=>{const o=[...new Set(n.items.flatMap(t=>p[t].pageId??[]))],s=`${d}-page-${c}`,l=v&&o.length>0&&a(z,{hidden:o.every(t=>x.includes(t)),onChange:t=>v(o,!t),of:n.page?s:void 0});return a("fieldset",{...n.page?{"aria-labelledby":s}:h.props,className:"clover-canvas-menu-group clover-annotations-set",children:[n.page?a("legend",{className:"clover-canvas-menu-legend clover-annotations-set-header",children:[a("span",{className:"clover-annotations-title",id:s,...y(n.page.lang),children:n.page.text}),l]}):l&&a("div",{className:"clover-annotations-set-header",children:l}),a("div",{className:"clover-annotations-list",children:n.items.map(t=>{const e=p[t],f=H(e),g=w===e.id,N="image"in e?e.image:void 0;return a("label",{className:"clover-canvas-menu-item clover-annotations-entry","data-selected":g,onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onPointerDown:()=>{m.current=true},children:[a("input",{type:"radio",name:d,checked:g,onChange:()=>u(e,m.current),onClick:()=>{(g||!m.current)&&u(e)},onKeyDown:b=>{m.current=false,b.key==="Enter"&&(b.preventDefault(),u(e))},onFocus:()=>i(e.id),onBlur:()=>i(null)}),f!==void 0&&a($,{start:f,className:"clover-annotations-time"}),a("span",{className:"clover-annotations-body clover-cue-text",children:[N&&a("img",{className:"clover-annotations-image",src:N,alt:"",loading:"lazy"}),a("span",{className:"clover-annotations-text",...y(e.label?e.lang:void 0),children:e.label??String(t+1)})]})]},e.id)})})]},c)})]})};export{G as default};
@@ -1 +1 @@
1
- import{T as d,ad as qt,f as bt,d as C,aJ as Gt,q as k,A as l,E as Jt,y as j,_ as It,u as jt}from"./shared-Cqxks7jF.mjs";import{w as zt,p as Ot,g as xt,t as Dt,A as Ut}from"./Annotations-CgPEcwft.mjs";import{h as Xt}from"./layout-DbMbjpx4.mjs";const Yt=()=>import("./svg-shape-D1K-WNrY.mjs");function Zt(w){var S;const c=d(()=>!!(w!=null&&w.some(({annotation:s})=>{var p;return(p=qt(s==null?void 0:s.target))==null?void 0:p.svg})),[w]);return((S=bt(Yt,c))==null?void 0:S.readSvgShape)??null}const M=[];function Et({given:w,annotations:c,scene:S,renderer:s,sceneVersion:p,drawn:E,media:I,mediaElement:f,showPlaceholder:F,canvasKey:z,openImages:tt,openMedia:et,host:nt,onModel:H,refind:_=0}){const{canvases:g,language:v,hiddenPages:rt,unlistedPages:yt,onPageVisibilityChange:ct,onAnnotationActive:ut,selectedAnnotation:st,animateAnnotations:ot=false,highlightedAnnotation:Ct,onAnnotationSelect:lt,onAnnotationLink:D}=w,[B,Ft]=C([]),[it,Ht]=C([]),L=rt!==void 0,dt=d(()=>{var n;if(L)return M;const t=new Map;for(const r of c){if(!r.pageId)continue;const o=!(Number((n=g==null?void 0:g[r.targetIndex])==null?void 0:n.duration)>0)&&Gt(r.annotation.motivation,qt(Array.isArray(r.annotation.target)?r.annotation.target[0]:r.annotation.target));t.set(r.pageId,(t.get(r.pageId)??true)&&o)}const e=[...t].filter(([,r])=>r).map(([r])=>r);return e.length?e:M},[L,c,g]),_t=d(()=>{const t=dt.filter(e=>!it.includes(e)&&!B.includes(e));return t.length?[...B,...t]:B},[B,it,dt]),a=rt??_t,U=yt??M,N=k(t=>U.length?t.filter(e=>!e.pageId||!U.includes(e.pageId)):t,[U]),gt=d(()=>N(c).length,[c,N]),T=k(t=>a.length?t.filter(e=>!e.pageId||!a.includes(e.pageId)):t,[a]),Q=l(ct);Q.current=ct;const R=k((t,e)=>{var n;(n=Q.current)==null||n.call(Q,t,e),!L&&(Ft(r=>{const i=r.filter(o=>!t.includes(o));return e?i:[...i,...t]}),Ht(r=>{const i=r.filter(o=>!t.includes(o));return e?[...i,...t]:i}))},[L]),ft=d(()=>zt(T(c),g),[c,T,g]),O=d(()=>{if(!(!S||!g))return(t,e,n)=>{const r=g.findIndex(Wt=>Wt.id===e),i=r===-1?n:r,o=S.placements[i];return o?Xt(g[i],o,t):null}},[S,g]),W=Zt(c),P=d(()=>s&&p>0&&E?Ot(c,O??((t,e,n)=>s.itemRectToWorld(n,t)),W,v):[],[s,c,p,E,O,W,v]),x=d(()=>T(P),[P,T]),X=d(()=>P.length||!O?P:Ot(c,O,W,v),[P,O,c,W,v]),[Bt,Lt]=C(null),[Nt,pt]=C(null),u=st!==void 0?st:Nt,A=l(null),h=l(ut);h.current=ut;const m=l(lt);m.current=lt;const Y=k(t=>{var e;Lt(t),(e=h.current)==null||e.call(h,t)},[]),Z=l(ot);Z.current=ot;const at=l(false);at.current=F;const $=l(f);$.current=f;const Pt=l(s);Pt.current=s;const q=l(null),ht=l(a);ht.current=a;const mt=l(R);mt.current=R;const V=k((t,e=true)=>{var n,r,i;if(t.pageId&&ht.current.includes(t.pageId)&&mt.current([t.pageId],true),pt(t.id),(n=h.current)==null||n.call(h,t.id),(r=m.current)==null||r.call(m,t.id),!at.current){if("start"in t){const o=$.current;if(!o)return;q.current=t.id,e?Jt(o,t.start):o.currentTime=t.start;return}if(A.current=t.id,t.track){const o=$.current;o&&xt(t,o)&&(q.current=t.id);return}(i=Pt.current)==null||i.fitAnnotation(t.world,!Z.current)}},[]),wt=l(u);wt.current=u;const b=k(()=>{var t;return wt.current?(pt(null),A.current=null,(t=m.current)==null||t.call(m,null),true):false},[]),G=l(D);G.current=D;const St=!!D,Qt=d(()=>St?t=>{var e,n;(e=nt.current)==null||e.focus({preventScroll:true}),b(),t.link&&((n=G.current)==null||n.call(G,t.link))}:void 0,[St,b,nt]),vt=l(_);j(()=>{if(!u){A.current=null;return}if(vt.current!==_&&(vt.current=_,A.current=null),A.current===u)return;const t=r=>r.find(i=>i.id===u),e=t(x),n=e??t(P);if(n){if(A.current=n.id,n.track){!e&&f&&xt(n,f);return}s==null||s.fitAnnotation(n.world,!Z.current)}},[u,x,P,f,s,_]);const y=d(()=>I?Dt(c,v):[],[I,c,v]),J=d(()=>T(y),[y,T]),Tt=d(()=>N(y.length?[...X,...y]:X),[X,y,N]);j(()=>{if(!u){q.current=null;return}if(q.current===u||!f)return;const t=J.find(e=>e.id===u);t&&(q.current=t.id,f.currentTime=t.start)},[u,J,f]);const K=l(null),[At,Rt]=C(null);j(()=>{K.current=u??null},[u]),j(()=>{const t=K.current;if(!(!t||!c.some(e=>{var n;return((n=e.annotation)==null?void 0:n.id)===t}))&&(K.current=null,!!F)){if(!I){tt(true);return}et(z),Rt(z)}},[u,c,F,I,z,tt,et]);const kt=d(()=>({menu:Tt,placed:x,timed:J,hiddenPages:a,setPagesVisible:R,listedCount:gt,comments:ft,selected:u??null,select:V,activate:Y,release:b,quietlyOpened:At}),[Tt,x,J,a,R,gt,ft,u,V,Y,b,At]);return It(()=>H(kt),[kt,H]),It(()=>()=>H(null),[H]),s&&p>0&&!F?jt(Ut,{renderer:s,placed:x,sceneVersion:p,active:Bt??Ct??u,selected:u,onActivate:Y,onSelect:V,onFollow:Qt,media:I?f:void 0}):null}export{Et as AnnotationState};
1
+ import{T as d,ad as qt,f as bt,d as C,aJ as Gt,q as k,A as l,E as Jt,y as j,_ as It,u as jt}from"./shared-GHegGgtP.mjs";import{w as zt,p as Ot,g as xt,t as Dt,A as Ut}from"./Annotations-BQ5w1-ZP.mjs";import{h as Xt}from"./layout-DdBH1AmH.mjs";const Yt=()=>import("./svg-shape-D1K-WNrY.mjs");function Zt(w){var S;const c=d(()=>!!(w!=null&&w.some(({annotation:s})=>{var p;return(p=qt(s==null?void 0:s.target))==null?void 0:p.svg})),[w]);return((S=bt(Yt,c))==null?void 0:S.readSvgShape)??null}const M=[];function Et({given:w,annotations:c,scene:S,renderer:s,sceneVersion:p,drawn:E,media:I,mediaElement:f,showPlaceholder:F,canvasKey:z,openImages:tt,openMedia:et,host:nt,onModel:H,refind:_=0}){const{canvases:g,language:v,hiddenPages:rt,unlistedPages:yt,onPageVisibilityChange:ct,onAnnotationActive:ut,selectedAnnotation:st,animateAnnotations:ot=false,highlightedAnnotation:Ct,onAnnotationSelect:lt,onAnnotationLink:D}=w,[B,Ft]=C([]),[it,Ht]=C([]),L=rt!==void 0,dt=d(()=>{var n;if(L)return M;const t=new Map;for(const r of c){if(!r.pageId)continue;const o=!(Number((n=g==null?void 0:g[r.targetIndex])==null?void 0:n.duration)>0)&&Gt(r.annotation.motivation,qt(Array.isArray(r.annotation.target)?r.annotation.target[0]:r.annotation.target));t.set(r.pageId,(t.get(r.pageId)??true)&&o)}const e=[...t].filter(([,r])=>r).map(([r])=>r);return e.length?e:M},[L,c,g]),_t=d(()=>{const t=dt.filter(e=>!it.includes(e)&&!B.includes(e));return t.length?[...B,...t]:B},[B,it,dt]),a=rt??_t,U=yt??M,N=k(t=>U.length?t.filter(e=>!e.pageId||!U.includes(e.pageId)):t,[U]),gt=d(()=>N(c).length,[c,N]),T=k(t=>a.length?t.filter(e=>!e.pageId||!a.includes(e.pageId)):t,[a]),Q=l(ct);Q.current=ct;const R=k((t,e)=>{var n;(n=Q.current)==null||n.call(Q,t,e),!L&&(Ft(r=>{const i=r.filter(o=>!t.includes(o));return e?i:[...i,...t]}),Ht(r=>{const i=r.filter(o=>!t.includes(o));return e?[...i,...t]:i}))},[L]),ft=d(()=>zt(T(c),g),[c,T,g]),O=d(()=>{if(!(!S||!g))return(t,e,n)=>{const r=g.findIndex(Wt=>Wt.id===e),i=r===-1?n:r,o=S.placements[i];return o?Xt(g[i],o,t):null}},[S,g]),W=Zt(c),P=d(()=>s&&p>0&&E?Ot(c,O??((t,e,n)=>s.itemRectToWorld(n,t)),W,v):[],[s,c,p,E,O,W,v]),x=d(()=>T(P),[P,T]),X=d(()=>P.length||!O?P:Ot(c,O,W,v),[P,O,c,W,v]),[Bt,Lt]=C(null),[Nt,pt]=C(null),u=st!==void 0?st:Nt,A=l(null),h=l(ut);h.current=ut;const m=l(lt);m.current=lt;const Y=k(t=>{var e;Lt(t),(e=h.current)==null||e.call(h,t)},[]),Z=l(ot);Z.current=ot;const at=l(false);at.current=F;const $=l(f);$.current=f;const Pt=l(s);Pt.current=s;const q=l(null),ht=l(a);ht.current=a;const mt=l(R);mt.current=R;const V=k((t,e=true)=>{var n,r,i;if(t.pageId&&ht.current.includes(t.pageId)&&mt.current([t.pageId],true),pt(t.id),(n=h.current)==null||n.call(h,t.id),(r=m.current)==null||r.call(m,t.id),!at.current){if("start"in t){const o=$.current;if(!o)return;q.current=t.id,e?Jt(o,t.start):o.currentTime=t.start;return}if(A.current=t.id,t.track){const o=$.current;o&&xt(t,o)&&(q.current=t.id);return}(i=Pt.current)==null||i.fitAnnotation(t.world,!Z.current)}},[]),wt=l(u);wt.current=u;const b=k(()=>{var t;return wt.current?(pt(null),A.current=null,(t=m.current)==null||t.call(m,null),true):false},[]),G=l(D);G.current=D;const St=!!D,Qt=d(()=>St?t=>{var e,n;(e=nt.current)==null||e.focus({preventScroll:true}),b(),t.link&&((n=G.current)==null||n.call(G,t.link))}:void 0,[St,b,nt]),vt=l(_);j(()=>{if(!u){A.current=null;return}if(vt.current!==_&&(vt.current=_,A.current=null),A.current===u)return;const t=r=>r.find(i=>i.id===u),e=t(x),n=e??t(P);if(n){if(A.current=n.id,n.track){!e&&f&&xt(n,f);return}s==null||s.fitAnnotation(n.world,!Z.current)}},[u,x,P,f,s,_]);const y=d(()=>I?Dt(c,v):[],[I,c,v]),J=d(()=>T(y),[y,T]),Tt=d(()=>N(y.length?[...X,...y]:X),[X,y,N]);j(()=>{if(!u){q.current=null;return}if(q.current===u||!f)return;const t=J.find(e=>e.id===u);t&&(q.current=t.id,f.currentTime=t.start)},[u,J,f]);const K=l(null),[At,Rt]=C(null);j(()=>{K.current=u??null},[u]),j(()=>{const t=K.current;if(!(!t||!c.some(e=>{var n;return((n=e.annotation)==null?void 0:n.id)===t}))&&(K.current=null,!!F)){if(!I){tt(true);return}et(z),Rt(z)}},[u,c,F,I,z,tt,et]);const kt=d(()=>({menu:Tt,placed:x,timed:J,hiddenPages:a,setPagesVisible:R,listedCount:gt,comments:ft,selected:u??null,select:V,activate:Y,release:b,quietlyOpened:At}),[Tt,x,J,a,R,gt,ft,u,V,Y,b,At]);return It(()=>H(kt),[kt,H]),It(()=>()=>H(null),[H]),s&&p>0&&!F?jt(Ut,{renderer:s,placed:x,sceneVersion:p,active:Bt??Ct??u,selected:u,onActivate:Y,onSelect:V,onFollow:Qt,media:I?f:void 0}):null}export{Et as AnnotationState};
@@ -1 +1 @@
1
- var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{ad as N,aK as ot,ae as D,B as W,T as et,A as L,y as j,q as K,_ as nt,$ as st,u as C,k as it,aL as rt,t as at,d as Z,l as ct,R as lt}from"./shared-Cqxks7jF.mjs";import{a as ht}from"./annotation-name-U_Yiz_CP.mjs";import{r as ut}from"./link-BIc77IY3.mjs";import{T as dt}from"./Tip-DxvfQm-l.mjs";import{c as pt}from"./Camera-i2fafLIh.mjs";import"./styles-C9QeBpjd.mjs";const q=t=>Array.isArray(t)?t.flatMap(q):ot.includes(t==null?void 0:t.type)?q(t.items??[]):t==null?[]:[t],ft=t=>q(t).map(o=>N(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const G=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=W((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function X(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Kt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=N([i==null?void 0:i.target].flat()[0]),h=W((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=Y(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...X(r,o),...c?{pageId:c}:{}})}return e}const S=40;function Nt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=N(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=Y(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...X(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const qt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=K(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const F=O(M),I=x&&M!==x&&F!==null&&R(M)<u.length?bt({...M,world:F??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(I??"")&&(w.current.set(A,I??""),I?A.style.setProperty("--clover-annotation-mask",I):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=K((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=K((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(C(it,{children:o.map((s,u)=>C(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),G(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-Cn2ZXsZi.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,F,I;const[p,v]=Z(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=K(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=G(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return C(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:J})=>{document.activeElement===z&&J(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((F=t.shape)==null?void 0:F.kind)==="point"&&C("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((I=t.shape)==null?void 0:I.kind)==="svg"&&C(Ot,{svg:t.shape.svg}),C(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=Z(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,F,I;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(I=(F=e.overlays)==null?void 0:F.container.parentElement)==null||I.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return C("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[C("g",{children:r}),C("g",{children:r}),C("g",{children:r})]})};function Y(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=N([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{qt as A,$t as g,Nt as p,St as s,Kt as t,Ut as w};
1
+ var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{ad as N,aK as ot,ae as D,B as W,T as et,A as L,y as j,q as K,_ as nt,$ as st,u as C,k as it,aL as rt,t as at,d as Z,l as ct,R as lt}from"./shared-GHegGgtP.mjs";import{a as ht}from"./annotation-name-FBisev7H.mjs";import{r as ut}from"./link-CVd4-rY6.mjs";import{T as dt}from"./Tip-CDk5jVbe.mjs";import{c as pt}from"./Camera-U-go7jsP.mjs";import"./styles-BCj9RoYW.mjs";const q=t=>Array.isArray(t)?t.flatMap(q):ot.includes(t==null?void 0:t.type)?q(t.items??[]):t==null?[]:[t],ft=t=>q(t).map(o=>N(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const G=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=W((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function X(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Kt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=N([i==null?void 0:i.target].flat()[0]),h=W((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=Y(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...X(r,o),...c?{pageId:c}:{}})}return e}const S=40;function Nt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=N(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=Y(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...X(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const qt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=K(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const F=O(M),I=x&&M!==x&&F!==null&&R(M)<u.length?bt({...M,world:F??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(I??"")&&(w.current.set(A,I??""),I?A.style.setProperty("--clover-annotation-mask",I):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=K((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=K((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(C(it,{children:o.map((s,u)=>C(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),G(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-Cn2ZXsZi.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,F,I;const[p,v]=Z(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=K(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=G(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return C(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:J})=>{document.activeElement===z&&J(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((F=t.shape)==null?void 0:F.kind)==="point"&&C("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((I=t.shape)==null?void 0:I.kind)==="svg"&&C(Ot,{svg:t.shape.svg}),C(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=Z(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,F,I;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(I=(F=e.overlays)==null?void 0:F.container.parentElement)==null||I.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return C("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[C("g",{children:r}),C("g",{children:r}),C("g",{children:r})]})};function Y(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=N([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{qt as A,$t as g,Nt as p,St as s,Kt as t,Ut as w};
@@ -1,2 +1,2 @@
1
- import{D as lt,a as Z,e as D,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,u as o,t as V,w as Tt,B as dt,E as Et,b as ut,F as mt,T as O,d as tt,A as Ot,y as X,G as z,l as M,H as Mt,I as Bt,v as qt,k as it,f as yt}from"./shared-Cqxks7jF.mjs";import{E as Pt}from"./EntryBodies-D2OorCCX.mjs";import{u as Rt,L as Vt}from"./ListEnd-BXjH6six.mjs";import{a as Ft}from"./annotation-name-U_Yiz_CP.mjs";import{r as Ht,a as jt}from"./link-BIc77IY3.mjs";import{s as Gt}from"./show-link-DwefC5LJ.mjs";import{f as Kt,r as _t}from"./fetchManifest-BKGaZzDw.mjs";import{j as ht}from"./classnames-DukgfdpI.mjs";import{b as ct,s as zt}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as Dt}from"./Cue-BzhK_KTz.mjs";import{E as Ut}from"./EntryThumbnail-iY1cnsAP.mjs";import{H as ft}from"./HideToggle-D_n5lwkp.mjs";import{u as gt,c as vt}from"./readingLanguages-BY2NUfQE.mjs";import{L as pt}from"./LanguageChoice-e7MGPRCd.mjs";import"./styles-C9QeBpjd.mjs";function bt(n){const s=n.bodies.filter(e=>{var u;return!e.image&&((u=e.value)==null?void 0:u.trim())}).map(e=>e.language).filter(e=>!!e&&e!=="none");return[...new Set(s)]}function xt(n){const s=n.map(bt),e=[...new Set(s.flat())];return e.length<2?[]:s.some(a=>a.length&&e.some(c=>!a.includes(c)))?e:[]}function St(n,s){if(!s)return true;const e=bt(n);return!e.length||e.includes(s)}const Wt=[],wn=lt(function({scope:s="all",renderEntry:e,headingLevel:u=3,as:a="div",className:c,...m},l){const{t:r,langOf:h}=Z(),{clover:d,language:S}=D("Annotations"),L=q(t=>Ct(t.manifest,t.addedSets)),N=q(t=>Nt(t.manifest,t.canvasId)),T=q(t=>$t(t.manifest,t.addedSets,t.hiddenSets,t.shownSets)),b=q(t=>t.annotationId),$=rt.useSyncExternalStore(d.highlight.subscribe,d.highlight.get,d.highlight.get),f=t=>{const v=Tt(L,t),x=v&&dt(v.target.t),P=d.media.get();x&&P&&N.some(F=>F.id===v.canvasId)&&Et(P,x.start),d.selectAnnotation(t)},k=q(t=>s==="all"?At(t.manifest):Wt),w=Rt(k),I=t=>t.entries.filter(v=>N.some(x=>x.id===v.canvasId)),A=L.map(t=>({set:t,entries:I(t)})).filter(({entries:t})=>t.length),C=Y(u),y={text:r("annotationsShow"),lang:h("annotationsShow")};return s==="all"?o(Zt,{ref:l,as:a,className:c,rest:m,sets:L,shown:N.map(t=>t.id),headingLevel:u,language:S,showLabel:y,hiddenSets:T,selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:t=>d.highlight.emit(t),onVisible:(t,v)=>t.forEach(x=>d.setSetVisible(x,v)),end:w.more&&o(Vt,{onReached:w.reachNext})}):A.length?o(a,{ref:l,className:ht("clover-annotations",c),...m,children:A.map(({set:t,entries:v})=>o(Jt,{set:t,entries:v,canvases:N,Heading:C,headingLevel:u,language:S,title:V(t.label,S),showLabel:y,hidden:T.includes(t.id),selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:x=>d.highlight.emit(x),onVisible:x=>d.setSetVisible(t.id,x)},t.id))}):null});function Jt({set:n,entries:s,canvases:e,Heading:u,headingLevel:a,title:c,language:m,showLabel:l,hidden:r,selected:h,highlighted:d,renderEntry:S,onSelect:L,onHighlight:N,onVisible:T}){const b=ut(),$=c.text?a+1:a,f=O(()=>xt(s),[s]),[k,w]=tt(),I=gt(),A=vt(I,f),C=A?z(f,I.chosen):z(f,(I==null?void 0:I.chosen)??m,k),y=s.filter(t=>St(t,C));return o("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${b}-title`:void 0,"data-set":n.id,children:[o("div",{className:"clover-annotations-set-header",children:[c.text&&o(u,{className:"clover-annotations-title",id:`${b}-title`,...M(c.lang),children:c.text}),C&&!A&&o(pt,{languages:f,chosen:C,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:r,onChange:t=>T(!t),of:c.text?`${b}-title`:void 0})]}),o("ol",{className:"clover-annotations-list",children:y.map((t,v)=>o(wt,{entry:t,canvas:e.find(x=>x.id===t.canvasId),index:v,headingLevel:$,language:m,showLabel:l,selected:t.id===h,highlighted:t.id===d,renderEntry:S,onSelect:L,onHighlight:N},t.id))})]})}function Qt(n,s,e){const u=new Map(s.map((c,m)=>[c.id,m])),a=new Map;for(const c of n){const m=V(c.label,e),l=m.text;let r=a.get(l);r||(r={title:m,setIds:[],byCanvas:new Map},a.set(l,r)),r.setIds.push(c.id);for(const h of c.entries){const d=r.byCanvas.get(h.canvasId)??[];d.push(h),r.byCanvas.set(h.canvasId,d)}}return[...a.entries()].map(([c,m])=>({key:c,title:m.title,setIds:m.setIds,canvases:Xt([...m.byCanvas.entries()],u).map(([l,r])=>{var h;return{canvasId:l,label:V((h=s.find(d=>d.id===l))==null?void 0:h.label,e),entries:r}})}))}function Xt(n,s){return n.every(([e])=>s.has(e))?n.sort(([e],[u])=>s.get(e)-s.get(u)):n}function Yt(n,s){const{clover:e,language:u}=D("Annotations"),a=O(()=>{const l=new Set;for(const r of n)for(const h of r.canvases){if(s.has(h.canvasId))continue;const d=Mt(h.entries[0].annotation);d&&l.add(d)}return[...l]},[n,s]),[c,m]=tt([]);return X(()=>{let l=true;return Promise.all(a.map(r=>Kt(e,r))).then(r=>l&&m(r.filter(h=>!!h))),()=>{l=false}},[e,a]),O(()=>{const l=new Map;for(const r of c){const{canvases:h}=mt(r),d=V(r.label,u);for(const S of h){const L=V(S.label,u);l.set(S.id,{canvas:S,label:h.length>1&&L.text?[d,L]:[d]})}}return{named:a.length>0,of:l}},[c,a,u])}const Zt=lt(function({as:s,className:e,rest:u,sets:a,shown:c,headingLevel:m,language:l,showLabel:r,hiddenSets:h,selected:d,highlighted:S,renderEntry:L,onSelect:N,onHighlight:T,onVisible:b,end:$},f){const k=ut(),w=q(i=>mt(i.manifest).canvases),I=O(()=>Qt(a,w,l),[a,w,l]),A=O(()=>new Map(w.map(i=>[i.id,i])),[w]),C=Yt(I,A),[y,t]=tt({}),v=gt(),x=q(i=>{var g;return(g=i.manifest)==null?void 0:g.label}),P=O(()=>V(x,l),[x,l]),F=w.length>1||C.named,G=Ot(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const g=zt(i)??i;return g.matches(":hover")||g.contains(document.activeElement)},It=c.join(`
1
+ import{D as lt,a as Z,e as D,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,u as o,t as V,w as Tt,B as dt,E as Et,b as ut,F as mt,T as O,d as tt,A as Ot,y as X,G as z,l as M,H as Mt,I as Bt,v as qt,k as it,f as yt}from"./shared-GHegGgtP.mjs";import{E as Pt}from"./EntryBodies-CCt_bYce.mjs";import{u as Rt,L as Vt}from"./ListEnd-BYM99ASf.mjs";import{a as Ft}from"./annotation-name-FBisev7H.mjs";import{r as Ht,a as jt}from"./link-CVd4-rY6.mjs";import{s as Gt}from"./show-link-Ch_hofEX.mjs";import{f as Kt,r as _t}from"./fetchManifest-CnNL49H6.mjs";import{j as ht}from"./classnames-DukgfdpI.mjs";import{b as ct,s as zt}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as Dt}from"./Cue-I_zHaG-m.mjs";import{E as Ut}from"./EntryThumbnail-DApiQdWi.mjs";import{H as ft}from"./HideToggle-YnPk4svB.mjs";import{u as gt,c as vt}from"./readingLanguages-CJajD7v0.mjs";import{L as pt}from"./LanguageChoice-DoyxbEct.mjs";import"./styles-BCj9RoYW.mjs";function bt(n){const s=n.bodies.filter(e=>{var u;return!e.image&&((u=e.value)==null?void 0:u.trim())}).map(e=>e.language).filter(e=>!!e&&e!=="none");return[...new Set(s)]}function xt(n){const s=n.map(bt),e=[...new Set(s.flat())];return e.length<2?[]:s.some(a=>a.length&&e.some(c=>!a.includes(c)))?e:[]}function St(n,s){if(!s)return true;const e=bt(n);return!e.length||e.includes(s)}const Wt=[],wn=lt(function({scope:s="all",renderEntry:e,headingLevel:u=3,as:a="div",className:c,...m},l){const{t:r,langOf:h}=Z(),{clover:d,language:S}=D("Annotations"),L=q(t=>Ct(t.manifest,t.addedSets)),N=q(t=>Nt(t.manifest,t.canvasId)),T=q(t=>$t(t.manifest,t.addedSets,t.hiddenSets,t.shownSets)),b=q(t=>t.annotationId),$=rt.useSyncExternalStore(d.highlight.subscribe,d.highlight.get,d.highlight.get),f=t=>{const v=Tt(L,t),x=v&&dt(v.target.t),P=d.media.get();x&&P&&N.some(F=>F.id===v.canvasId)&&Et(P,x.start),d.selectAnnotation(t)},k=q(t=>s==="all"?At(t.manifest):Wt),w=Rt(k),I=t=>t.entries.filter(v=>N.some(x=>x.id===v.canvasId)),A=L.map(t=>({set:t,entries:I(t)})).filter(({entries:t})=>t.length),C=Y(u),y={text:r("annotationsShow"),lang:h("annotationsShow")};return s==="all"?o(Zt,{ref:l,as:a,className:c,rest:m,sets:L,shown:N.map(t=>t.id),headingLevel:u,language:S,showLabel:y,hiddenSets:T,selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:t=>d.highlight.emit(t),onVisible:(t,v)=>t.forEach(x=>d.setSetVisible(x,v)),end:w.more&&o(Vt,{onReached:w.reachNext})}):A.length?o(a,{ref:l,className:ht("clover-annotations",c),...m,children:A.map(({set:t,entries:v})=>o(Jt,{set:t,entries:v,canvases:N,Heading:C,headingLevel:u,language:S,title:V(t.label,S),showLabel:y,hidden:T.includes(t.id),selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:x=>d.highlight.emit(x),onVisible:x=>d.setSetVisible(t.id,x)},t.id))}):null});function Jt({set:n,entries:s,canvases:e,Heading:u,headingLevel:a,title:c,language:m,showLabel:l,hidden:r,selected:h,highlighted:d,renderEntry:S,onSelect:L,onHighlight:N,onVisible:T}){const b=ut(),$=c.text?a+1:a,f=O(()=>xt(s),[s]),[k,w]=tt(),I=gt(),A=vt(I,f),C=A?z(f,I.chosen):z(f,(I==null?void 0:I.chosen)??m,k),y=s.filter(t=>St(t,C));return o("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${b}-title`:void 0,"data-set":n.id,children:[o("div",{className:"clover-annotations-set-header",children:[c.text&&o(u,{className:"clover-annotations-title",id:`${b}-title`,...M(c.lang),children:c.text}),C&&!A&&o(pt,{languages:f,chosen:C,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:r,onChange:t=>T(!t),of:c.text?`${b}-title`:void 0})]}),o("ol",{className:"clover-annotations-list",children:y.map((t,v)=>o(wt,{entry:t,canvas:e.find(x=>x.id===t.canvasId),index:v,headingLevel:$,language:m,showLabel:l,selected:t.id===h,highlighted:t.id===d,renderEntry:S,onSelect:L,onHighlight:N},t.id))})]})}function Qt(n,s,e){const u=new Map(s.map((c,m)=>[c.id,m])),a=new Map;for(const c of n){const m=V(c.label,e),l=m.text;let r=a.get(l);r||(r={title:m,setIds:[],byCanvas:new Map},a.set(l,r)),r.setIds.push(c.id);for(const h of c.entries){const d=r.byCanvas.get(h.canvasId)??[];d.push(h),r.byCanvas.set(h.canvasId,d)}}return[...a.entries()].map(([c,m])=>({key:c,title:m.title,setIds:m.setIds,canvases:Xt([...m.byCanvas.entries()],u).map(([l,r])=>{var h;return{canvasId:l,label:V((h=s.find(d=>d.id===l))==null?void 0:h.label,e),entries:r}})}))}function Xt(n,s){return n.every(([e])=>s.has(e))?n.sort(([e],[u])=>s.get(e)-s.get(u)):n}function Yt(n,s){const{clover:e,language:u}=D("Annotations"),a=O(()=>{const l=new Set;for(const r of n)for(const h of r.canvases){if(s.has(h.canvasId))continue;const d=Mt(h.entries[0].annotation);d&&l.add(d)}return[...l]},[n,s]),[c,m]=tt([]);return X(()=>{let l=true;return Promise.all(a.map(r=>Kt(e,r))).then(r=>l&&m(r.filter(h=>!!h))),()=>{l=false}},[e,a]),O(()=>{const l=new Map;for(const r of c){const{canvases:h}=mt(r),d=V(r.label,u);for(const S of h){const L=V(S.label,u);l.set(S.id,{canvas:S,label:h.length>1&&L.text?[d,L]:[d]})}}return{named:a.length>0,of:l}},[c,a,u])}const Zt=lt(function({as:s,className:e,rest:u,sets:a,shown:c,headingLevel:m,language:l,showLabel:r,hiddenSets:h,selected:d,highlighted:S,renderEntry:L,onSelect:N,onHighlight:T,onVisible:b,end:$},f){const k=ut(),w=q(i=>mt(i.manifest).canvases),I=O(()=>Qt(a,w,l),[a,w,l]),A=O(()=>new Map(w.map(i=>[i.id,i])),[w]),C=Yt(I,A),[y,t]=tt({}),v=gt(),x=q(i=>{var g;return(g=i.manifest)==null?void 0:g.label}),P=O(()=>V(x,l),[x,l]),F=w.length>1||C.named,G=Ot(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const g=zt(i)??i;return g.matches(":hover")||g.contains(document.activeElement)},It=c.join(`
2
2
  `);return X(()=>{const i=G.current;if(!i||!F||nt())return;const g=c.map(U=>i.querySelector(`[data-canvas="${CSS.escape(U)}"]`)).find(Boolean);if(!g)return;const B=g.closest(".clover-annotations-set"),H=(B==null?void 0:B.querySelector("[data-canvas]"))===g;ct(H&&B?B:g,"start")},[It]),X(()=>{const i=G.current;if(!i||!d||nt())return;const g=i.querySelector(`[data-entry="${CSS.escape(d)}"]`);g&&ct(g,"nearest")},[d]),I.length?o(s,{ref:i=>{G.current=i,typeof f=="function"?f(i):f&&(f.current=i)},className:ht("clover-annotations",e),"data-scope":"all",...u,children:[I.map((i,g)=>{const B=Y(m),H=i.title.text?m+1:m,U=Y(H),Lt=i.setIds.every(p=>h.includes(p)),K=xt(i.canvases.flatMap(p=>p.entries)),et=vt(v,K),W=et?z(K,v.chosen):z(K,(v==null?void 0:v.chosen)??l,y[i.key]);return o("section",{className:"clover-annotations-set","aria-labelledby":i.title.text?`${k}-${g}`:void 0,children:[o("div",{className:"clover-annotations-set-header",children:[i.title.text&&o(B,{className:"clover-annotations-title",id:`${k}-${g}`,...M(i.title.lang),children:i.title.text}),W&&!et&&o(pt,{languages:K,chosen:W,onChange:p=>t(J=>({...J,[i.key]:p})),nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:Lt,onChange:p=>b(i.setIds,!p),of:i.title.text?`${k}-${g}`:void 0})]}),i.canvases.map((p,J)=>{var at;const st=p.entries.filter(E=>St(E,W));if(!st.length)return null;const j=C.of.get(p.canvasId),R=j?j.label:C.named&&P.text?w.length>1&&p.label.text?[P,p.label]:[P]:[p.label],Q=F&&!!((at=R[0])!=null&&at.text),kt=F&&c.includes(p.canvasId),ot=`${k}-${g}-${J}`;return o("section",{className:"clover-annotations-canvas","data-canvas":p.canvasId,"aria-labelledby":Q?ot:void 0,"aria-current":kt?"true":void 0,children:[Q&&o(U,{className:"clover-annotations-canvas-label",id:ot,...M(R.length===1?R[0].lang:void 0),children:R.length===1?R[0].text:R.map((E,_)=>o(rt.Fragment,{children:[_>0&&", ",o("span",{...M(E.lang),children:E.text})]},_))}),o("ol",{className:"clover-annotations-list",children:st.map((E,_)=>o(wt,{entry:E,canvas:A.get(p.canvasId)??(j==null?void 0:j.canvas),index:_,headingLevel:Q?H+1:H,language:l,showLabel:r,selected:E.id===d,highlighted:E.id===S,renderEntry:L,onSelect:N,onHighlight:T},E.id))})]},p.canvasId)})]},i.key)}),$]}):null});function tn(n,s){const e=n.target.rect?void 0:n.target.svg,u=yt(nn,!!e);return O(()=>{var m,l;const a=e?(m=u==null?void 0:u.readSvgShape(e))==null?void 0:m.box:void 0,c=n.target.rect??(a?{x:a.x,y:a.y,w:a.width,h:a.height}:void 0);return!c||!s||n.bodies.some(r=>r.image)?null:_t(s,c,(l=n.layer)==null?void 0:l.image)},[n,s,e,u])}const nn=()=>import("./svg-shape-D1K-WNrY.mjs");function wt({entry:n,canvas:s,index:e,headingLevel:u,language:a,showLabel:c,selected:m,highlighted:l,renderEntry:r,onSelect:h,onHighlight:d}){const{hostLanguage:S,t:L,langOf:N}=Z(),T=sn(n,a),b=T.text?T:{text:String(e+1)},$=dt(n.target.t),f=$?{text:L("annotationsShowTime"),lang:N("annotationsShowTime")}:c,k=!f.lang&&!Bt(b.lang,S),w=b.text?`${f.text}: ${b.text}`:f.text,{clover:I}=D("Annotations"),A=tn(n,s);return o("li",{className:"clover-annotations-entry","data-entry":n.id,"data-selected":m,"data-highlighted":l,onMouseEnter:()=>d(n.id),onMouseLeave:()=>d(null),onFocus:()=>d(n.id),onBlur:()=>d(null),onClick:C=>{C.target.closest("a, button")||h(n.id)},children:[$&&o(Dt,{start:$.start,className:"clover-annotations-time"}),o(Ut,{className:"clover-annotations-thumbnail",source:A,request:I.request}),o("div",{className:"clover-annotations-body clover-cue-text",children:[r?r(n):o(Pt,{bodies:n.bodies,language:a,headingLevel:u}),o(en,{annotation:n.annotation})]}),o("button",{type:"button",className:"clover-annotations-show","aria-pressed":m,"aria-label":k?w:void 0,style:qt,onClick:()=>h(n.id),children:!k&&o(it,{children:[o("span",{...M(f.lang),children:[f.text,b.text&&":"]}),b.text&&o(it,{children:[" ",o("span",{...M(b.lang),children:b.text})]})]})})]})}function en({annotation:n}){const{clover:s}=D("Annotations"),{t:e,langOf:u}=Z(),a=O(()=>Ht(n)??jt(n),[n]);if(!a)return null;const c=e("annotationsOpenLink"),m=u("annotationsOpenLink");return!a.canvasId&&!a.manifestId?o("a",{className:"clover-annotations-link",href:a.id,target:"_blank",rel:"noopener noreferrer",...M(m),children:c}):o("button",{type:"button",className:"clover-annotations-link",...M(m),onClick:l=>{var h;const r=l.currentTarget.closest(".clover-root");Gt(s,a)&&((h=r==null?void 0:r.querySelector(".clover-canvas-viewport"))==null||h.focus({preventScroll:true}))},children:c})}function sn(n,s){const{text:e="",lang:u}=Ft(n.bodies,s);return{text:e.slice(0,120),...u?{lang:u}:{}}}export{wn as Annotations};
@@ -1 +1 @@
1
- import{e as g,j as h,T as k,p as B,m as T,c as j,u as e,P as p,z as v}from"./shared-Cqxks7jF.mjs";import L from"./Connected-CGF0cSzv.mjs";import{r as R}from"./rendererSurface-AGFetq7k.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks--n9dMuHb.mjs";import{L as c}from"./Loading-DGPqbYw2.mjs";const z=v(()=>import("./Connected-Cr4h-tHh.mjs")),N=v(()=>import("./Connected-CssvezHA.mjs"));function F({className:f,style:y,renderers:C,collapseControls:b,onContentStateChange:S,children:r,...n}){var u;const l=g("Body");h(l.clover,S);const o=x(),m=k(()=>B(o),[o]),s=T(C??l.renderers,{canvases:o,bodies:m}),a=s==null?void 0:s.component,i=((u=o.find(({type:t})=>t==="Scene"||t==="Timeline"))==null?void 0:u.type)??"Canvas",d=j(t=>t.status==="loading");return e("div",{"aria-busy":d,className:w("clover-body",f),"data-renderer":a?"custom":i.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...y},children:[a?e(a,{canvases:o,bodies:m,children:r}):i==="Scene"?e(p,{fallback:e(c,{overlay:true}),children:e(N,{...n,children:r})}):i==="Timeline"?e(p,{fallback:e(c,{overlay:true}),children:e(z,{...n,children:r})}):e(L,{...n,collapseControls:b,surface:R,children:r}),d&&e(c,{overlay:true})]})}export{F as B};
1
+ import{e as g,j as h,T as k,p as B,m as T,c as j,u as e,P as p,z as v}from"./shared-GHegGgtP.mjs";import L from"./Connected-BbzI2zK6.mjs";import{r as R}from"./rendererSurface-CEHeWJwy.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks-BiGLi7Q8.mjs";import{L as c}from"./Loading-DrMN5RS9.mjs";const z=v(()=>import("./Connected-Dy05dLlD.mjs")),N=v(()=>import("./Connected-BXc1y6St.mjs"));function F({className:f,style:y,renderers:C,collapseControls:b,onContentStateChange:S,children:r,...n}){var u;const l=g("Body");h(l.clover,S);const o=x(),m=k(()=>B(o),[o]),s=T(C??l.renderers,{canvases:o,bodies:m}),a=s==null?void 0:s.component,i=((u=o.find(({type:t})=>t==="Scene"||t==="Timeline"))==null?void 0:u.type)??"Canvas",d=j(t=>t.status==="loading");return e("div",{"aria-busy":d,className:w("clover-body",f),"data-renderer":a?"custom":i.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...y},children:[a?e(a,{canvases:o,bodies:m,children:r}):i==="Scene"?e(p,{fallback:e(c,{overlay:true}),children:e(N,{...n,children:r})}):i==="Timeline"?e(p,{fallback:e(c,{overlay:true}),children:e(z,{...n,children:r})}):e(L,{...n,collapseControls:b,surface:R,children:r}),d&&e(c,{overlay:true})]})}export{F as B};
@@ -1 +1 @@
1
- import{a as o,u as r,l}from"./shared-Cqxks7jF.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";function c({error:a,className:s}){const{t,langOf:e}=o();return r("div",{className:n("clover-status",s),"data-status":"error",role:"alert",children:[r("p",{...l(e("statusError")),children:t("statusError")}),r("p",{className:"clover-status-detail",lang:"en",children:a.message})]})}export{c as B};
1
+ import{a as o,u as r,l}from"./shared-GHegGgtP.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";function c({error:a,className:s}){const{t,langOf:e}=o();return r("div",{className:n("clover-status",s),"data-status":"error",role:"alert",children:[r("p",{...l(e("statusError")),children:t("statusError")}),r("p",{className:"clover-status-detail",lang:"en",children:a.message})]})}export{c as B};
@@ -1 +1 @@
1
- import{u as t,l as v}from"./shared-Cqxks7jF.mjs";import{j as b}from"./classnames-DukgfdpI.mjs";import{T as m}from"./Tip-DxvfQm-l.mjs";import"./styles-C9QeBpjd.mjs";const B=({className:n,id:e,label:o,children:s,onClick:r,expanded:i,controls:d,shortcut:a,lang:l,unavailable:p,side:c})=>{const u=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return t("button",{id:e,className:b("clover-canvas-button",n),"data-testid":"clover-canvas-button","data-button":u,"data-side":c,onClick:r,"aria-disabled":p||void 0,"aria-expanded":i,"aria-controls":d,"aria-label":o,"aria-keyshortcuts":a==null?void 0:a.keys,...v(l),type:"button",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:s}),t(m,{label:o,shortcut:a})]})};export{B};
1
+ import{u as t,l as v}from"./shared-GHegGgtP.mjs";import{j as b}from"./classnames-DukgfdpI.mjs";import{T as m}from"./Tip-CDk5jVbe.mjs";import"./styles-BCj9RoYW.mjs";const B=({className:n,id:e,label:o,children:s,onClick:r,expanded:i,controls:d,shortcut:a,lang:l,unavailable:p,side:c})=>{const u=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return t("button",{id:e,className:b("clover-canvas-button",n),"data-testid":"clover-canvas-button","data-button":u,"data-side":c,onClick:r,"aria-disabled":p||void 0,"aria-expanded":i,"aria-controls":d,"aria-label":o,"aria-keyshortcuts":a==null?void 0:a.keys,...v(l),type:"button",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:s}),t(m,{label:o,shortcut:a})]})};export{B};
@@ -1 +1 @@
1
- import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-uvJ5kDYN.mjs";function g(t,o){return c(h(o.width/2,o.height/2),a(t.rotation),u(t.zoom),h(-t.x,-t.y))}function m(t,o){return c(h(t.x,t.y),u(1/t.zoom),a(-t.rotation),h(-o.width/2,-o.height/2))}function M(t,o,n){return i(m(t,o),n)}function w(t,o,n){return i(g(t,o),n)}function C(t,o){return f(m(t,o),{x:0,y:0,width:o.width,height:o.height})}function N(t,o,n=0,r=0){const e=f(a(n),t),s=Math.max(1,o.width*(1-r*2)),y=Math.max(1,o.height*(1-r*2)),d=Math.min(s/Math.max(e.width,Number.EPSILON),y/Math.max(e.height,Number.EPSILON)),x=l(t);return{x:x.x,y:x.y,zoom:d,rotation:n}}function P(t,o,n,r,e){const s=i(c(u(1/n),a(-r)),{x:o.x-e.width/2,y:o.y-e.height/2});return{x:t.x-s.x,y:t.y-s.y}}function S(t,o){return t.x===o.x&&t.y===o.y&&t.zoom===o.zoom&&t.rotation===o.rotation}export{P as a,S as b,w as c,N as f,M as s,C as v,g as w};
1
+ import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-w6t-JMBB.mjs";function g(t,o){return c(h(o.width/2,o.height/2),a(t.rotation),u(t.zoom),h(-t.x,-t.y))}function m(t,o){return c(h(t.x,t.y),u(1/t.zoom),a(-t.rotation),h(-o.width/2,-o.height/2))}function M(t,o,n){return i(m(t,o),n)}function w(t,o,n){return i(g(t,o),n)}function C(t,o){return f(m(t,o),{x:0,y:0,width:o.width,height:o.height})}function N(t,o,n=0,r=0){const e=f(a(n),t),s=Math.max(1,o.width*(1-r*2)),y=Math.max(1,o.height*(1-r*2)),d=Math.min(s/Math.max(e.width,Number.EPSILON),y/Math.max(e.height,Number.EPSILON)),x=l(t);return{x:x.x,y:x.y,zoom:d,rotation:n}}function P(t,o,n,r,e){const s=i(c(u(1/n),a(-r)),{x:o.x-e.width/2,y:o.y-e.height/2});return{x:t.x-s.x,y:t.y-s.y}}function S(t,o){return t.x===o.x&&t.y===o.y&&t.zoom===o.zoom&&t.rotation===o.rotation}export{P as a,S as b,w as c,N as f,M as s,C as v,g as w};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-AGFetq7k.mjs";class c{constructor(t,s){i(this,"kind","canvas2d");i(this,"canvas");i(this,"ctx");i(this,"pixelRatio",1);i(this,"drawn",new Set);this.canvas=t,this.ctx=s}static create(t){let s=null;try{s=t.getContext("2d",{alpha:true})}catch{s=null}return!s||typeof s.drawImage!="function"?null:new c(t,s)}resize(t,s,a){this.pixelRatio=a;const e=Math.max(1,Math.round(t*a)),h=Math.max(1,Math.round(s*a));this.canvas.width!==e&&(this.canvas.width=e),this.canvas.height!==h&&(this.canvas.height=h)}begin(){const t=this.ctx;t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.clearRect(0,0,this.canvas.width,this.canvas.height),t.imageSmoothingEnabled=true,t.imageSmoothingQuality="high"}draw(t){if(!d(t.source))return"skipped";const s=this.ctx,a=t.transform,e=this.pixelRatio,h=t.crop??{x:0,y:0,width:t.width,height:t.height},n=g(t,e);return s.setTransform(e*a.a,e*a.b,e*a.c,e*a.d,e*a.e,e*a.f),s.globalAlpha=t.opacity,s.drawImage(t.source,h.x,h.y,h.width,h.height,h.x,h.y,h.width+n.x,h.height+n.y),this.drawn.add(t.key),"drawn"}end(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha=1}has(t){return this.drawn.has(t)}release(t){this.drawn.delete(t)}dispose(){this.drawn.clear(),this.canvas.width=0,this.canvas.height=0}}export{c as Canvas2DBackend};
1
+ var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-CEHeWJwy.mjs";class c{constructor(t,s){i(this,"kind","canvas2d");i(this,"canvas");i(this,"ctx");i(this,"pixelRatio",1);i(this,"drawn",new Set);this.canvas=t,this.ctx=s}static create(t){let s=null;try{s=t.getContext("2d",{alpha:true})}catch{s=null}return!s||typeof s.drawImage!="function"?null:new c(t,s)}resize(t,s,a){this.pixelRatio=a;const e=Math.max(1,Math.round(t*a)),h=Math.max(1,Math.round(s*a));this.canvas.width!==e&&(this.canvas.width=e),this.canvas.height!==h&&(this.canvas.height=h)}begin(){const t=this.ctx;t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.clearRect(0,0,this.canvas.width,this.canvas.height),t.imageSmoothingEnabled=true,t.imageSmoothingQuality="high"}draw(t){if(!d(t.source))return"skipped";const s=this.ctx,a=t.transform,e=this.pixelRatio,h=t.crop??{x:0,y:0,width:t.width,height:t.height},n=g(t,e);return s.setTransform(e*a.a,e*a.b,e*a.c,e*a.d,e*a.e,e*a.f),s.globalAlpha=t.opacity,s.drawImage(t.source,h.x,h.y,h.width,h.height,h.x,h.y,h.width+n.x,h.height+n.y),this.drawn.add(t.key),"drawn"}end(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha=1}has(t){return this.drawn.has(t)}release(t){this.drawn.delete(t)}dispose(){this.drawn.clear(),this.canvas.width=0,this.canvas.height=0}}export{c as Canvas2DBackend};