@nulib/clover 4.5.9 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Canvas/CanvasView.mjs +19 -0
- package/dist/components/Canvas/Connected.mjs +5 -1
- package/dist/components/Canvas/FrameAnimation.mjs +4 -48
- package/dist/components/Items/Items.mjs +31 -2
- package/dist/components/Items/vertical/ItemsVertical.mjs +8 -0
- package/dist/core/request.mjs +7 -0
- package/dist/core/save-file.mjs +5 -2
- package/dist/core/selectors.mjs +9 -1
- package/dist/core/vtt.mjs +6 -4
- package/dist/i18n/locales/en.json.mjs +1 -1
- package/dist/i18n/locales/es.json.mjs +1 -1
- package/dist/i18n/locales/fi.json.mjs +1 -1
- package/dist/i18n/locales/fr.json.mjs +1 -1
- package/dist/i18n/locales/it.json.mjs +1 -1
- package/dist/i18n/locales/ja.json.mjs +1 -1
- package/dist/i18n/locales/nb.json.mjs +1 -1
- package/dist/i18n/locales/nn.json.mjs +1 -1
- package/dist/i18n/locales/no.json.mjs +1 -1
- package/dist/i18n/locales/pt.json.mjs +1 -1
- package/dist/i18n/locales/zh-Hans.json.mjs +1 -1
- package/dist/i18n/locales/zh-Hant.json.mjs +1 -1
- package/dist/lib/gltf/load.mjs +5 -2
- package/dist/lib/renderer/CanvasRenderer.mjs +179 -42
- package/dist/lib/renderer/backends/webgl2/shaders.mjs +2 -1
- package/dist/lib/renderer/io/TileCache.mjs +1 -1
- package/dist/lib/renderer/io/decode.mjs +2 -1
- package/dist/lib/renderer/scene/planFrame.mjs +17 -0
- package/dist/lib/renderer/scene/sceneItem.mjs +9 -4
- package/dist/lib/renderer/sources/imageService.mjs +2 -1
- package/dist/lib/renderer/sources/tilePyramid.mjs +14 -3
- package/dist/styles/core.css +1 -1
- package/dist/styles/items-vertical.css +1 -0
- package/dist/styles/items.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/ui/Loading.mjs +9 -0
- package/dist/ui/loadingPass.mjs +52 -0
- package/dist/ui/sheets/items-vertical.mjs +5 -0
- package/dist/web-components/{About-CGMm1-_m.mjs → About-Brbhm22a.mjs} +1 -1
- package/dist/web-components/AnnotationItems-Dy4BNabL.mjs +1 -0
- package/dist/web-components/{AnnotationMenu-CkTdOVgU.mjs → AnnotationMenu-4PN2LNP-.mjs} +1 -1
- package/dist/web-components/{AnnotationState-DMgUWawu.mjs → AnnotationState-3KHHmQhl.mjs} +1 -1
- package/dist/web-components/{Annotations-DZX4QhcQ.mjs → Annotations-BwKS6fG8.mjs} +1 -1
- package/dist/web-components/{Annotations-CEshACVg.mjs → Annotations-CPUvoKJe.mjs} +1 -1
- package/dist/web-components/{Body-CLEco7_N.mjs → Body-CTzmxY8R.mjs} +1 -1
- package/dist/web-components/{BodyAlert-BP4r3Cd6.mjs → BodyAlert-CXOxbNBE.mjs} +1 -1
- package/dist/web-components/{Button-JqNjqiWi.mjs → Button-a59NBnOp.mjs} +1 -1
- package/dist/web-components/{Camera-Ccshr6VH.mjs → Camera-BlbXBgYZ.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-B6073uEb.mjs → Canvas2DBackend-DXCfms6g.mjs} +1 -1
- package/dist/web-components/CanvasView-CiP25Iqc.mjs +2 -0
- package/dist/web-components/{CaptionDetails-Cg-Qs1Vo.mjs → CaptionDetails-CCCTWTQP.mjs} +1 -1
- package/dist/web-components/{ChaptersMenu-BlH2m--N.mjs → ChaptersMenu-Bne6N9cf.mjs} +1 -1
- package/dist/web-components/{Chevron-h5qzcEcw.mjs → Chevron-CH8yyEDi.mjs} +1 -1
- package/dist/web-components/{ChoiceMenu-DJzv0hit.mjs → ChoiceMenu-BQVTRzXj.mjs} +1 -1
- package/dist/web-components/{Collection-DdgyAL7y.mjs → Collection-CbEMQWrO.mjs} +1 -1
- package/dist/web-components/{CollectionSelect-CI-gJrdr.mjs → CollectionSelect-BpvtCwSl.mjs} +1 -1
- package/dist/web-components/Connected-BWomgzfE.mjs +1 -0
- package/dist/web-components/{Connected-XzGCGV5F.mjs → Connected-C31vzWei.mjs} +1 -1
- package/dist/web-components/{Connected-Bfk00vQd.mjs → Connected-Dq0xux9o.mjs} +1 -1
- package/dist/web-components/{Contents-RRatJCsY.mjs → Contents-CGc6_Z5c.mjs} +1 -1
- package/dist/web-components/{ControlMenu-CbGB6ddJ.mjs → ControlMenu-ej-Kpb31.mjs} +1 -1
- package/dist/web-components/ControlsFade-CStkqANR.mjs +1 -0
- package/dist/web-components/{CountMenu-sy7-np4i.mjs → CountMenu-D4M1roIh.mjs} +1 -1
- package/dist/web-components/Cue-BhXRUDe9.mjs +1 -0
- package/dist/web-components/{Document-CeqDB3XD.mjs → Document-CPQELxSI.mjs} +1 -1
- package/dist/web-components/{DomLayers-taxnJRum.mjs → DomLayers-DwhkzPRS.mjs} +1 -1
- package/dist/web-components/{Download-Car7CU2u.mjs → Download-Dsei4KG3.mjs} +1 -1
- package/dist/web-components/{EntryBodies-BtpwwwYE.mjs → EntryBodies-BI7V3B5i.mjs} +1 -1
- package/dist/web-components/{EntryThumbnail-BsvULLOE.mjs → EntryThumbnail-BnMLzy5M.mjs} +1 -1
- package/dist/web-components/{FieldPill-cf9eBuE6.mjs → FieldPill-BOeOasUT.mjs} +1 -1
- package/dist/web-components/FrameAnimation-BcEfAQrI.mjs +1 -0
- package/dist/web-components/{Gallery-QK3ww9Sn.mjs → Gallery-BDGDzt0R.mjs} +1 -1
- package/dist/web-components/{GlobeGlyph-D3XRo_IQ.mjs → GlobeGlyph-9zKXX7B6.mjs} +1 -1
- package/dist/web-components/{HideToggle-BdulLE7z.mjs → HideToggle-CmwFnHcZ.mjs} +1 -1
- package/dist/web-components/{ImageControls-CiL_D1jJ.mjs → ImageControls-CSHxdUD1.mjs} +1 -1
- package/dist/web-components/Items-DCRr750U.mjs +1 -0
- package/dist/web-components/ItemsVertical-BeIiJ37B.mjs +1 -0
- package/dist/web-components/{Label-Bo3CK-L6.mjs → Label-CVfL9bMO.mjs} +1 -1
- package/dist/web-components/{LanguageChoice-CPvKeMS_.mjs → LanguageChoice-D_vEiQp9.mjs} +1 -1
- package/dist/web-components/{LanguageMenu-DEoDIxlR.mjs → LanguageMenu-ycNvnbOB.mjs} +1 -1
- package/dist/web-components/{LightboxView-D42ogB9b.mjs → LightboxView-CsOAsZ3f.mjs} +1 -1
- package/dist/web-components/{ListEnd-1VWK96re.mjs → ListEnd-B6tyeK1B.mjs} +1 -1
- package/dist/web-components/{Loaded-1HMGKert.mjs → Loaded-CSYg8oIR.mjs} +1 -1
- package/dist/web-components/LoadedCanvas-W9sCFkdf.mjs +1 -0
- package/dist/web-components/LoadedMap-jx7uEeDg.mjs +1 -0
- package/dist/web-components/Loading-CAkF1fBT.mjs +1 -0
- package/dist/web-components/{Map-1SoA6_NY.mjs → Map-BDsBYSp5.mjs} +1 -1
- package/dist/web-components/{MapView-Bh4hjBql.mjs → MapView-DO23FSrT.mjs} +2 -2
- package/dist/web-components/{Markup-CGp-sAk0.mjs → Markup-COA2t_y1.mjs} +1 -1
- package/dist/web-components/{MediaBody-nPvqRq1E.mjs → MediaBody-CNk9fFfN.mjs} +1 -1
- package/dist/web-components/{MediaBody-BCwNSKUW.mjs → MediaBody-XsEObuYV.mjs} +1 -1
- package/dist/web-components/{NavDate-BQjEV2AU.mjs → NavDate-1LLiZ8Vq.mjs} +1 -1
- package/dist/web-components/{Navigator-BVKUD0-V.mjs → Navigator-t1y35uj8.mjs} +1 -1
- package/dist/web-components/{Pager-Ccdj43ZQ.mjs → Pager-35N8_3lH.mjs} +1 -1
- package/dist/web-components/PagerLayout-SNT5cl4D.mjs +1 -0
- package/dist/web-components/{Panel-xCi9RT4Z.mjs → Panel-D16u98YB.mjs} +1 -1
- package/dist/web-components/PanelPart-DfjlK_hB.mjs +1 -0
- package/dist/web-components/{PanelToggle-CSRKyPCu.mjs → PanelToggle-BcUVIbQw.mjs} +1 -1
- package/dist/web-components/{PartOfManifest-VSzd2d_m.mjs → PartOfManifest-BYyflVQI.mjs} +1 -1
- package/dist/web-components/{Pending-Dagi9Hhc.mjs → Pending-bIYd0PwB.mjs} +1 -1
- package/dist/web-components/PlaceBox-D-pLIX5w.mjs +1 -0
- package/dist/web-components/{Placeholder-BLHxv7em.mjs → Placeholder-Mq1Iaasr.mjs} +1 -1
- package/dist/web-components/{Position-SN6EMJW-.mjs → Position-Bh1Iq4d6.mjs} +1 -1
- package/dist/web-components/{Primitives-C2f-ZV1J.mjs → Primitives-DP2uwwcU.mjs} +1 -1
- package/dist/web-components/{Provider-DQ5Gz-Bh.mjs → Provider-BUDzNTyJ.mjs} +1 -1
- package/dist/web-components/{ReadMore-D4zZ4ZJ5.mjs → ReadMore-B6qft77s.mjs} +1 -1
- package/dist/web-components/Root-J9v7nQ6o.mjs +1 -0
- package/dist/web-components/Scene-CdqC1O-B.mjs +1 -0
- package/dist/web-components/{SceneView-BgjiTjRe.mjs → SceneView-DykQJepG.mjs} +1 -1
- package/dist/web-components/{Search-DGAEkL-h.mjs → Search-DEoFdx2g.mjs} +1 -1
- package/dist/web-components/{Sections-CPCPWIFr.mjs → Sections-B6j9eFao.mjs} +1 -1
- package/dist/web-components/{SeekMarks-DemiDpFP.mjs → SeekMarks-C3ZDOMbt.mjs} +1 -1
- package/dist/web-components/StandaloneItems-CtxMB090.mjs +1 -0
- package/dist/web-components/{Status-BYnM-ITS.mjs → Status-C49DxNaY.mjs} +1 -1
- package/dist/web-components/{Steps-DByLc8pX.mjs → Steps-BTAJ3lc6.mjs} +1 -1
- package/dist/web-components/{TargetItems-BDt6OXh8.mjs → TargetItems-BZFSWVs6.mjs} +1 -1
- package/dist/web-components/Timeline-D5oL1UyW.mjs +1 -0
- package/dist/web-components/{Tip-h4Abk6aH.mjs → Tip-Dv-gYN8n.mjs} +1 -1
- package/dist/web-components/{Transcript-CfOhWPdJ.mjs → Transcript-FmC6HR0-.mjs} +1 -1
- package/dist/web-components/{Transport-Xwq6Cpn3.mjs → Transport-BKFLjI45.mjs} +1 -1
- package/dist/web-components/{Transport-B58M-XIa.mjs → Transport-pRWbs9M3.mjs} +1 -1
- package/dist/web-components/{annotation-collection-BH66kiGL.mjs → annotation-collection-Dc-peX7w.mjs} +1 -1
- package/dist/web-components/{annotation-name-Biu7-abB.mjs → annotation-name-BhbhOgES.mjs} +1 -1
- package/dist/web-components/{annotations-content-tLJ5sUiC.mjs → annotations-content-BJSUCNd1.mjs} +1 -1
- package/dist/web-components/{body-BIieugrZ.mjs → body-BEZ3sYcR.mjs} +1 -1
- package/dist/web-components/{canvas-Cni09Q09.mjs → canvas-CfnKZqTU.mjs} +1 -1
- package/dist/web-components/{viewer/cloverEngine-Cd4MoqAY.mjs → cloverEngine-BstElW9l.mjs} +3 -3
- package/dist/web-components/{content-state-reader-DtRv0vnr.mjs → content-state-reader-DGOg8oAH.mjs} +1 -1
- package/dist/web-components/{controlGlyphs-QLLc8cpa.mjs → controlGlyphs-Lxfq7zz4.mjs} +1 -1
- package/dist/web-components/{controls-DuLb0zYy.mjs → controls-BibZpBh1.mjs} +1 -1
- package/dist/web-components/{downloads-DUWW30ai.mjs → downloads-cYib41PV.mjs} +1 -1
- package/dist/web-components/{dragToClose-DAS5OWSl.mjs → dragToClose-BpzjNnPx.mjs} +1 -1
- package/dist/web-components/{engine-DaDzKDum.mjs → engine-Cl755NaO.mjs} +1 -1
- package/dist/web-components/{engines-DGQYmjhi.mjs → engines-fZzYf1dz.mjs} +1 -1
- package/dist/web-components/{es-Bn4XnLxy.mjs → es-Bx-zZBfZ.mjs} +1 -1
- package/dist/web-components/{fetchManifest-CDLkWDgP.mjs → fetchManifest-D31pEPrb.mjs} +1 -1
- package/dist/web-components/{fi-CjAXeLqH.mjs → fi-DsP1FhBy.mjs} +1 -1
- package/dist/web-components/{follow-content-Rav98zXa.mjs → follow-content-Byosc3Ev.mjs} +1 -1
- package/dist/web-components/{fr-CeFhkxoi.mjs → fr-BuL_F9Jq.mjs} +1 -1
- package/dist/web-components/{fromManifest-B8AlKP6a.mjs → fromManifest-DqCyZd2Q.mjs} +1 -1
- package/dist/web-components/{glyphs-BzZKC9_8.mjs → glyphs-8fjIPAtZ.mjs} +1 -1
- package/dist/web-components/{hooks-BGorrvz7.mjs → hooks-Bo5GjPGX.mjs} +1 -1
- package/dist/web-components/{image-layers-DPZluciF.mjs → image-layers-CFarmTfZ.mjs} +1 -1
- package/dist/web-components/{image-service-content-BGBge-Nu.mjs → image-service-content-bUFBZCr1.mjs} +1 -1
- package/dist/web-components/imageService-CCKieCxo.mjs +1 -0
- package/dist/web-components/{index-GH8QRDv1.mjs → index-DhlRi3H9.mjs} +1 -1
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/{it-DxtfVek2.mjs → it-DH3EtrgI.mjs} +1 -1
- package/dist/web-components/items-BXd02UN6.mjs +1 -0
- package/dist/web-components/{items-CtOmANs8.mjs → items-CKMFXz0W.mjs} +1 -1
- package/dist/web-components/{ja-rsicBgWR.mjs → ja-BEHbDotv.mjs} +1 -1
- package/dist/web-components/label-DcF-YCIN.mjs +1 -0
- package/dist/web-components/{layout-BmDYodJC.mjs → layout-DQtgCOJJ.mjs} +1 -1
- package/dist/web-components/{link-CQUMZL8-.mjs → link-q4quIuuD.mjs} +1 -1
- package/dist/web-components/logo-DWI0N9FL.mjs +1 -0
- package/dist/web-components/{models-BbiJP5tM.mjs → models-Dw-cADIz.mjs} +1 -1
- package/dist/web-components/{no-BkyI1fhp.mjs → nb-Bdfn_mZs.mjs} +1 -1
- package/dist/web-components/{nn-n_xM6AGl.mjs → nn-BCWbSuK0.mjs} +1 -1
- package/dist/web-components/{nb-BkyI1fhp.mjs → no-Bdfn_mZs.mjs} +1 -1
- package/dist/web-components/{nodes-DARyEM2G.mjs → nodes-nZmQ93ib.mjs} +1 -1
- package/dist/web-components/{overlayImage-F-EX6YpI.mjs → overlayImage-B-ybt0wn.mjs} +1 -1
- package/dist/web-components/{panel-COE-wxFK.mjs → panel-C27fOmhT.mjs} +1 -1
- package/dist/web-components/part-B9t8Qe9D.mjs +1 -0
- package/dist/web-components/{playerSurface-BAK0g9ik.mjs → playerSurface-BLzwC0Ux.mjs} +1 -1
- package/dist/web-components/{pointer-DnJMax9Y.mjs → pointer-BYZjBehK.mjs} +1 -1
- package/dist/web-components/{provider-B9I7nScH.mjs → provider-Cs6sFr4G.mjs} +1 -1
- package/dist/web-components/{pt-COchUT7D.mjs → pt-Da5El49z.mjs} +1 -1
- package/dist/web-components/{range-regions-DEnDbiy7.mjs → range-regions-DssQTTra.mjs} +1 -1
- package/dist/web-components/{read-more-DkDjZsOx.mjs → read-more-Cp9CLzyd.mjs} +1 -1
- package/dist/web-components/{readingLanguages-DZxj1se7.mjs → readingLanguages-D97yt-4s.mjs} +1 -1
- package/dist/web-components/rendererSurface-BuBm8Th_.mjs +22 -0
- package/dist/web-components/{renderers-17347cy8.mjs → renderers-BL-b8snn.mjs} +1 -1
- package/dist/web-components/{resource-CtPBxzcn.mjs → resource-DwKOZbOZ.mjs} +1 -1
- package/dist/web-components/save-file-CcfAgDXf.mjs +1 -0
- package/dist/web-components/{search-CE2oKdT4.mjs → search-C45Jd7QH.mjs} +1 -1
- package/dist/web-components/shared-D2pvbPvF.mjs +1 -0
- package/dist/web-components/{show-link-DuRktUta.mjs → show-link-D9bByIzf.mjs} +1 -1
- package/dist/web-components/{sizedImage-DAaoYkRy.mjs → sizedImage-BFAry04f.mjs} +1 -1
- package/dist/web-components/{split-BP3eTM8x.mjs → split-CDZiE4rz.mjs} +1 -1
- package/dist/web-components/{status-CpVNchw2.mjs → status-BtCciELI.mjs} +1 -1
- package/dist/web-components/styles-Bf3qmdsh.mjs +1 -0
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/thumbnail-By5wfGlE.mjs +1 -0
- package/dist/web-components/{tip-BRNRex1D.mjs → tip-_XUeFMj4.mjs} +1 -1
- package/dist/web-components/{toggle-hREejXk6.mjs → toggle-DkPNS5eL.mjs} +1 -1
- package/dist/web-components/{useContainerName-DeDFbnAs.mjs → useContainerName-BfU0IozO.mjs} +1 -1
- package/dist/web-components/{useControlsVisibility-BYHbIHGH.mjs → useControlsVisibility-pU1JVIpK.mjs} +1 -1
- package/dist/web-components/{useNearViewport-BgvHaTUu.mjs → useNearViewport-D1kQt-tS.mjs} +1 -1
- package/dist/web-components/{useScrollTrack-B7zWqV5x.mjs → useScrollTrack-cQfG_zk_.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationItems-CDMYXEJY.mjs → AnnotationItems-UHFS1uDO.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationMenu-R-IJnoJr.mjs → AnnotationMenu-0Ru0csCz.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationState-CvRSbJoR.mjs → AnnotationState-hEds2Tpa.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-CX2kTFir.mjs → Annotations-Oprg7015.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-D-vxlAH-.mjs → Annotations-vzP6-fS4.mjs} +1 -1
- package/dist/web-components/viewer/{Canvas2DBackend-CRyXTdaF.mjs → Canvas2DBackend-3b5xEKac.mjs} +1 -1
- package/dist/web-components/viewer/CaptionDetails-DDIjm-rC.mjs +1 -0
- package/dist/web-components/viewer/ChaptersMenu-DmJy-cfd.mjs +1 -0
- package/dist/web-components/viewer/{ChoiceMenu-CDG8LFjh.mjs → ChoiceMenu-COUDRKGM.mjs} +1 -1
- package/dist/web-components/viewer/{Collection-BE7-wcaT.mjs → Collection-kWUradiW.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-BgYoWJ9x.mjs → Connected-B2TrgX9-.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-CDglyxHQ.mjs → Connected-FiJKHEv9.mjs} +1 -1
- package/dist/web-components/viewer/{Contents-YlFDgYna.mjs → Contents-DHyzbjco.mjs} +1 -1
- package/dist/web-components/viewer/{ControlMenu-CwOThPXI.mjs → ControlMenu-DWi6tgKb.mjs} +1 -1
- package/dist/web-components/viewer/ControlsFade-CuooJOpa.mjs +1 -0
- package/dist/web-components/viewer/{CountMenu-Bio1pBA5.mjs → CountMenu-BYU6T0Ou.mjs} +1 -1
- package/dist/web-components/viewer/Cue-Ct2isFl7.mjs +1 -0
- package/dist/web-components/viewer/{Document-D3QFxaMG.mjs → Document-BtN3vmsO.mjs} +1 -1
- package/dist/web-components/viewer/{DomLayers-DqluSP_z.mjs → DomLayers-CEzVM7HQ.mjs} +1 -1
- package/dist/web-components/viewer/{Download-COC-nK6_.mjs → Download-5BsnDZLL.mjs} +1 -1
- package/dist/web-components/viewer/{EntryBodies-UbloKBFE.mjs → EntryBodies-D9R-wouw.mjs} +1 -1
- package/dist/web-components/viewer/{EntryThumbnail-DftAANer.mjs → EntryThumbnail-P6CmjmO9.mjs} +1 -1
- package/dist/web-components/viewer/{FieldPill-D9c-u2aG.mjs → FieldPill-CsyRt9Xh.mjs} +1 -1
- package/dist/web-components/viewer/FrameAnimation-f4RKtdpP.mjs +1 -0
- package/dist/web-components/viewer/{Gallery-ByCLq8nD.mjs → Gallery-DC4QY9lG.mjs} +1 -1
- package/dist/web-components/viewer/{GlobeGlyph-KKxBlsfc.mjs → GlobeGlyph-BwZm2Ffj.mjs} +1 -1
- package/dist/web-components/viewer/{HideToggle-BNnJlKG3.mjs → HideToggle-BD6zlrz3.mjs} +1 -1
- package/dist/web-components/viewer/{ImageControls-BCz88aeX.mjs → ImageControls-Bw9a17cS.mjs} +1 -1
- package/dist/web-components/viewer/ItemsVertical-BftsRVJP.mjs +1 -0
- package/dist/web-components/viewer/{LanguageChoice-DSERkWEF.mjs → LanguageChoice-CcDmpHnE.mjs} +1 -1
- package/dist/web-components/viewer/{LanguageMenu-Cv7bWG0F.mjs → LanguageMenu-CRtM-mLy.mjs} +1 -1
- package/dist/web-components/viewer/{LightboxView-ClQSmYRQ.mjs → LightboxView-DJoH23fL.mjs} +1 -1
- package/dist/web-components/viewer/{ListEnd-B6VtWReK.mjs → ListEnd-CSp0KGGZ.mjs} +1 -1
- package/dist/web-components/viewer/{MapView-4SX7XTs-.mjs → MapView-BO2ppZpW.mjs} +2 -2
- package/dist/web-components/viewer/{MediaBody-Cshfh_3F.mjs → MediaBody-CMddJWMF.mjs} +1 -1
- package/dist/web-components/viewer/{MediaBody-CvXptO7l.mjs → MediaBody-D-1SNnW2.mjs} +1 -1
- package/dist/web-components/viewer/{NavDate-l4WnJ7Ph.mjs → NavDate-BJ_MF_t1.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-DilJ4hOg.mjs → Navigator-Gt56cM6f.mjs} +1 -1
- package/dist/web-components/viewer/{PagerLayout-ZMGl6Hso.mjs → PagerLayout-BMrlMLfO.mjs} +1 -1
- package/dist/web-components/viewer/PanelPart-CaxBca8z.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-Ci8XArjU.mjs → PartOfManifest-BdZWbAQI.mjs} +1 -1
- package/dist/web-components/viewer/{PlaceBox-DIKp5Qgf.mjs → PlaceBox-C27N2KG8.mjs} +1 -1
- package/dist/web-components/viewer/{Placeholder-BFtTc4a5.mjs → Placeholder-BX2y25Fo.mjs} +1 -1
- package/dist/web-components/viewer/{Search-CffzBngs.mjs → Search-auUpOyeS.mjs} +1 -1
- package/dist/web-components/viewer/{SeekMarks-BEujwiot.mjs → SeekMarks-Bg0PLdp0.mjs} +1 -1
- package/dist/web-components/viewer/{StandaloneItems-t0PWVVTU.mjs → StandaloneItems-CBRWUCNf.mjs} +1 -1
- package/dist/web-components/viewer/{Steps-MQSxvD8B.mjs → Steps-ABKs2V_m.mjs} +1 -1
- package/dist/web-components/viewer/{TargetItems-BdAvyfvp.mjs → TargetItems-BQVUKMAs.mjs} +1 -1
- package/dist/web-components/viewer/{Transcript-DR4SbDcf.mjs → Transcript-DaShc1z-.mjs} +1 -1
- package/dist/web-components/viewer/{Transport-CWkJ1XOL.mjs → Transport-6wRUIGiD.mjs} +1 -1
- package/dist/web-components/viewer/{Transport-e9YUnvid.mjs → Transport-ClkPaaOB.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-collection-BmIgw-9-.mjs → annotation-collection-eyRpE2h4.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-name-BcZahQW_.mjs → annotation-name-DdchUvJI.mjs} +1 -1
- package/dist/web-components/viewer/{annotations-content-BsCUZUiG.mjs → annotations-content-BZXlT3bR.mjs} +1 -1
- package/dist/web-components/{cloverEngine-qypryrZ2.mjs → viewer/cloverEngine-CZWHXlyY.mjs} +3 -3
- package/dist/web-components/viewer/{content-state-reader-CZzZVuIS.mjs → content-state-reader-CDV0Igdx.mjs} +1 -1
- package/dist/web-components/viewer/{dragToClose-DwFUE5k_.mjs → dragToClose-CD-MJb-V.mjs} +1 -1
- package/dist/web-components/viewer/{fetchManifest--iK6wT8O.mjs → fetchManifest-C1IEIf45.mjs} +1 -1
- package/dist/web-components/viewer/{follow-content-CEoIPewi.mjs → follow-content-IQqCbvbJ.mjs} +1 -1
- package/dist/web-components/viewer/{host-B9_p4Vyw.mjs → host-BxQrzQnu.mjs} +1 -1
- package/dist/web-components/viewer/{image-layers-TE9lUAo8.mjs → image-layers-DurrQgfL.mjs} +1 -1
- package/dist/web-components/viewer/{image-service-content-BghMNjSP.mjs → image-service-content-ClAm_g0Y.mjs} +1 -1
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-BDYoIIG6.mjs → link-Drdj-HcB.mjs} +1 -1
- package/dist/web-components/viewer/overlayImage-CDT5ohRo.mjs +1 -0
- package/dist/web-components/viewer/{range-regions-BD5RPgtX.mjs → range-regions-a5eVBfJy.mjs} +1 -1
- package/dist/web-components/viewer/{renderers-BGTNG2ao.mjs → renderers-CdXzZ9As.mjs} +1 -1
- package/dist/web-components/viewer/save-file-B2UBQRXz.mjs +1 -0
- package/dist/web-components/viewer/{search-BFTaFcIE.mjs → search-BBZKUiMB.mjs} +1 -1
- package/dist/web-components/viewer/styles-XRfyRUPf.mjs +1 -0
- package/dist/web-components/viewer/{useControlsVisibility-CdHbUJ_5.mjs → useControlsVisibility-BfTACzo_.mjs} +1 -1
- package/dist/web-components/viewer/viewer-BrkFZVo_.mjs +29 -0
- package/dist/web-components/viewer/vtt-CCkTp_f2.mjs +5 -0
- package/dist/web-components/{viewer-PeMy2VzH.mjs → viewer-D-AQ7mGw.mjs} +1 -1
- package/dist/web-components/vtt-BjXkNfI_.mjs +5 -0
- package/dist/web-components/{zh-Hans-Bfn3LUnq.mjs → zh-Hans-BhTHTZXT.mjs} +1 -1
- package/dist/web-components/{zh-Hant-DzmK541A.mjs → zh-Hant-_CJAOTzC.mjs} +1 -1
- package/package.json +1 -1
- package/dist/web-components/AnnotationItems-D5YRBYo7.mjs +0 -1
- package/dist/web-components/CanvasView-BCyHQxwA.mjs +0 -2
- package/dist/web-components/Connected-Dz38Bzpd.mjs +0 -1
- package/dist/web-components/ControlsFade-BPl7QLD-.mjs +0 -1
- package/dist/web-components/Cue-BtLDY60I.mjs +0 -1
- package/dist/web-components/FrameAnimation-HthNp8Wy.mjs +0 -1
- package/dist/web-components/Items-Ch80infd.mjs +0 -1
- package/dist/web-components/LoadedCanvas-CDXDAq7C.mjs +0 -1
- package/dist/web-components/LoadedMap-CKE1VBTk.mjs +0 -1
- package/dist/web-components/Loading-DJ1DTuTP.mjs +0 -1
- package/dist/web-components/PagerLayout-DwHzuFi9.mjs +0 -1
- package/dist/web-components/PanelPart-BZDTLVZL.mjs +0 -1
- package/dist/web-components/PlaceBox-C4_JBM6I.mjs +0 -1
- package/dist/web-components/Root-ijCOCdMK.mjs +0 -1
- package/dist/web-components/Scene-BnuKH1Ht.mjs +0 -1
- package/dist/web-components/StandaloneItems-DSTZPmPt.mjs +0 -1
- package/dist/web-components/Timeline-DtE58r-z.mjs +0 -1
- package/dist/web-components/imageService-DygjhKL0.mjs +0 -1
- package/dist/web-components/items-BSsoG42S.mjs +0 -1
- package/dist/web-components/label-WSQUfpL6.mjs +0 -1
- package/dist/web-components/logo-QdGDNl77.mjs +0 -1
- package/dist/web-components/part-CLteOpEJ.mjs +0 -1
- package/dist/web-components/rendererSurface-DKU6SaHP.mjs +0 -22
- package/dist/web-components/save-file-BF9IHyiG.mjs +0 -1
- package/dist/web-components/shared-BzLnvFn3.mjs +0 -1
- package/dist/web-components/styles-DbqlZvMR.mjs +0 -1
- package/dist/web-components/thumbnail-BcediRH4.mjs +0 -1
- package/dist/web-components/viewer/CaptionDetails-CpfNg-6d.mjs +0 -1
- package/dist/web-components/viewer/ChaptersMenu-B84VO_Mr.mjs +0 -1
- package/dist/web-components/viewer/ControlsFade-JiHTC1PR.mjs +0 -1
- package/dist/web-components/viewer/Cue-Dtgk1XOR.mjs +0 -1
- package/dist/web-components/viewer/FrameAnimation-DljklLUX.mjs +0 -1
- package/dist/web-components/viewer/PanelPart-BiYn_NxJ.mjs +0 -1
- package/dist/web-components/viewer/overlayImage-B43PyGj2.mjs +0 -1
- package/dist/web-components/viewer/save-file-B9oonwkE.mjs +0 -1
- package/dist/web-components/viewer/styles-nU97HodU.mjs +0 -1
- package/dist/web-components/viewer/viewer-xpsvi-tg.mjs +0 -29
- package/dist/web-components/viewer/vtt-CDmiwLtu.mjs +0 -5
- package/dist/web-components/vtt-DRrShcvI.mjs +0 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const SHOW_AFTER = 250;
|
|
3
|
+
const HANDOVER = 100;
|
|
4
|
+
const FINISH = 330;
|
|
5
|
+
const passes = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
let lastEnded;
|
|
7
|
+
const elapse = (mark, ms) => mark.style.setProperty("--clover-loading-elapsed", `${Math.round(ms)}ms`);
|
|
8
|
+
function enterPass(mark) {
|
|
9
|
+
var _a;
|
|
10
|
+
const host = mark.closest(".clover-body") ?? mark.parentElement;
|
|
11
|
+
const parent = mark.parentElement;
|
|
12
|
+
if (!host || !parent) return () => void 0;
|
|
13
|
+
const now = performance.now();
|
|
14
|
+
let pass = passes.get(host);
|
|
15
|
+
if (!pass) {
|
|
16
|
+
const last = lastEnded;
|
|
17
|
+
const handed = last && now >= last.at && now - last.at < HANDOVER && !last.host.isConnected;
|
|
18
|
+
pass = { start: handed ? last.start : now, marks: 0 };
|
|
19
|
+
if (handed) lastEnded = void 0;
|
|
20
|
+
passes.set(host, pass);
|
|
21
|
+
}
|
|
22
|
+
clearTimeout(pass.timer);
|
|
23
|
+
(_a = pass.ghost) == null ? void 0 : _a.remove();
|
|
24
|
+
pass.ghost = void 0;
|
|
25
|
+
pass.marks++;
|
|
26
|
+
elapse(mark, now - pass.start);
|
|
27
|
+
const joined = pass;
|
|
28
|
+
return () => {
|
|
29
|
+
if (--joined.marks) return;
|
|
30
|
+
const at = performance.now();
|
|
31
|
+
const elapsed = at - joined.start;
|
|
32
|
+
lastEnded = { start: joined.start, at, host };
|
|
33
|
+
const line = mark.firstElementChild;
|
|
34
|
+
const ghost = elapsed >= SHOW_AFTER && parent.isConnected && line && getComputedStyle(line).animationName.startsWith("clover-loading") ? mark.cloneNode(true) : void 0;
|
|
35
|
+
if (ghost) {
|
|
36
|
+
elapse(ghost, elapsed);
|
|
37
|
+
parent.appendChild(ghost);
|
|
38
|
+
}
|
|
39
|
+
joined.ghost = ghost;
|
|
40
|
+
joined.timer = setTimeout(() => {
|
|
41
|
+
passes.delete(host);
|
|
42
|
+
if (!ghost) return;
|
|
43
|
+
const line2 = ghost.firstElementChild;
|
|
44
|
+
if (line2) line2.style.transform = getComputedStyle(line2).transform;
|
|
45
|
+
ghost.dataset.done = "";
|
|
46
|
+
setTimeout(() => ghost.remove(), FINISH);
|
|
47
|
+
}, HANDOVER);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
enterPass
|
|
52
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const __clover_sheet_items_vertical = "@layer clover{.clover-items[data-layout=slider][data-orientation=vertical]{display:flex;flex-direction:column;height:100%}.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-frame{--clover-items-ends: calc(var(--clover-control) + var(--clover-space-m));flex:1;min-height:0;padding-block:var(--clover-items-ends)}.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-viewport{box-sizing:border-box;height:calc(100% + 2 * var(--clover-items-ring-room));padding:calc(var(--clover-items-ring-room) + var(--clover-items-inset, 0px)) var(--clover-items-ring-room);scroll-padding:calc(var(--clover-items-ring-room) + var(--clover-items-inset, 0px)) 0}.clover-items[data-orientation=vertical] .clover-items-figure{grid-template-columns:repeat(var(--parts, 1),1fr)}.clover-items[data-orientation=vertical] .clover-items-picture img,.clover-items[data-orientation=vertical] .clover-items-picture[data-empty]{width:100%;height:auto}.clover-items[data-orientation=vertical] .clover-items-picture[data-empty]{aspect-ratio:4 / 3}@supports (timeline-scope: --clover-items-track){.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-viewport{scroll-timeline:--clover-items-track block}.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-frame:before,.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-frame:after{left:0;right:0;width:auto;height:var(--clover-space-s);-webkit-mask-image:linear-gradient(to right,transparent,#000 var(--clover-space-s),#000 calc(100% - var(--clover-space-s)),transparent);mask-image:linear-gradient(to right,transparent,#000 var(--clover-space-s),#000 calc(100% - var(--clover-space-s)),transparent)}.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-frame:before{--clover-items-shade: to bottom;top:calc(var(--clover-items-ends) - var(--clover-items-ring-room))}.clover-items[data-layout=slider][data-orientation=vertical] .clover-items-frame:after{--clover-items-shade: to top;top:auto;bottom:calc(var(--clover-items-ends) - var(--clover-items-ring-room))}}.clover-items[data-orientation=vertical] :is(button.clover-items-scroll-prev,button.clover-items-scroll-next){inset-inline:auto;left:50%;translate:-50% 0}.clover-items[data-orientation=vertical] button.clover-items-scroll-prev,.clover-items[data-orientation=vertical][data-upward] button.clover-items-scroll-next{top:0;bottom:auto}.clover-items[data-orientation=vertical] button.clover-items-scroll-next,.clover-items[data-orientation=vertical][data-upward] button.clover-items-scroll-prev{top:auto;bottom:0}}";
|
|
3
|
+
export {
|
|
4
|
+
__clover_sheet_items_vertical as default
|
|
5
|
+
};
|
|
@@ -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-
|
|
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-D2pvbPvF.mjs";import{j as Q}from"./classnames-DukgfdpI.mjs";import{u as U}from"./readingLanguages-D97yt-4s.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-DP2uwwcU.mjs";import{u as ee}from"./downloads-cYib41PV.mjs";import{P as te}from"./Provider-BUDzNTyJ.mjs";import{a as oe,t as ae}from"./heading-Cjt0f-Eu.mjs";import{L as ne}from"./Label-CVfL9bMO.mjs";import{r as re}from"./dates-DR3gfcON.mjs";import"./styles-Bf3qmdsh.mjs";const se=C(()=>import("./LanguageChoice-D_vEiQp9.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-Dsei4KG3.mjs").then(({DownloadGroups:e})=>({default:e}))),he=C(()=>import("./NavDate-1LLiZ8Vq.mjs").then(e=>e.a).then(({NavDate:e})=>({default:e}))),be=C(()=>import("./PartOfManifest-BYyflVQI.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as P,c as v,al as _,T as E,H as O,A as R,y as T,u as f,k,d as q,a2 as F}from"./shared-D2pvbPvF.mjs";import{P as L,a as y}from"./Items-DCRr750U.mjs";import{C as B}from"./CountMenu-D4M1roIh.mjs";import{a as D}from"./annotation-name-BhbhOgES.mjs";import{f as G,r as H}from"./fetchManifest-D31pEPrb.mjs";import{u as K,L as V}from"./ListEnd-B6tyeK1B.mjs";function j({onSelect:o,forwardedRef:r,...l}){const{clover:c,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(l.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=R(null);if(T(()=>{const t=I.current;t===null||!i[t]||(I.current=null,c.selectAnnotation(i[t].id))},[c,i]),!i.length)return null;const h=i.findIndex(t=>t.id===u),w=(t,a)=>{o==null||o(t,a),c.selectAnnotation(t.id)};return l.layout==="pager"?f(L,{...l,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(k,{children:[f(y,{...l,forwardedRef:r,items:i,selected:h,navigation:"id",language:e,request:c.request,showSummary:true,onActivate:w}),N&&f(V,{onReached:S})]})}const z=[],J=[],Q=[];function U(o){const{clover:r}=P("Items"),[l,c]=q(W);return T(()=>{if(!o.length)return;let e=true;for(const n of o)G(r,n).then(s=>{e&&s&&c(u=>u.has(n)?u:new Map(u).set(n,s))});return()=>{e=false}},[r,o]),l}const W=new Map;function X(o,r,l,c){const e=F(r,o.canvasId),n=D(o.bodies,l),s=n.text?{[n.lang??"none"]:[n.text]}:e==null?void 0:e.label,u=c?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-
|
|
1
|
+
import{A as I,u as a,l as y}from"./shared-D2pvbPvF.mjs";import{s as H}from"./Annotations-CPUvoKJe.mjs";import T from"./ControlMenu-ej-Kpb31.mjs";import{C as $}from"./Cue-BhXRUDe9.mjs";import{H as z}from"./HideToggle-CmwFnHcZ.mjs";import{u as B}from"./useContainerName-BfU0IozO.mjs";import"./styles-Bf3qmdsh.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,
|
|
1
|
+
import{T as d,ae as qt,f as bt,d as C,aL as Gt,q as k,A as l,E as jt,y as z,_ as It,u as zt}from"./shared-D2pvbPvF.mjs";import{w as Dt,p as Ot,g as xt,t as Jt,A as Ut}from"./Annotations-CPUvoKJe.mjs";import{h as Xt}from"./layout-DQtgCOJJ.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:D,openImages:tt,openMedia:et,host:nt,onModel:H,refind:L=0}){const{canvases:g,language:v,hiddenPages:rt,unlistedPages:yt,onPageVisibilityChange:ct,onAnnotationActive:ut,selectedAnnotation:st,animateAnnotations:ot=false,highlightedAnnotation:Ct,onAnnotationSelect:lt,onAnnotationLink:J}=w,[_,Ft]=C([]),[it,Ht]=C([]),B=rt!==void 0,dt=d(()=>{var n;if(B)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},[B,c,g]),Lt=d(()=>{const t=dt.filter(e=>!it.includes(e)&&!_.includes(e));return t.length?[..._,...t]:_},[_,it,dt]),a=rt??Lt,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),!B&&(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}))},[B]),ft=d(()=>Dt(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]),[_t,Bt]=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;Bt(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(J);G.current=J;const St=!!J,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(L);z(()=>{if(!u){A.current=null;return}if(vt.current!==L&&(vt.current=L,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,L]);const y=d(()=>I?Jt(c,v):[],[I,c,v]),j=d(()=>T(y),[y,T]),Tt=d(()=>N(y.length?[...X,...y]:X),[X,y,N]);z(()=>{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);z(()=>{K.current=u??null},[u]),z(()=>{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(D),Rt(D)}},[u,c,F,I,D,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?zt(Ut,{renderer:s,placed:x,sceneVersion:p,active:_t??Ct??u,selected:u,onActivate:Y,onSelect:V,onFollow:Qt,media:I?f:void 0}):null}export{Et as AnnotationState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as s,D as lt,a as Z,e as z,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,t as V,w as Mt,B as dt,E as Et,b as ut,F as ht,T,d as tt,A as Tt,y as X,G as _,l as O,H as Ot,I as Bt,v as qt,k as it,f as yt}from"./shared-
|
|
1
|
+
import{u as s,D as lt,a as Z,e as z,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,t as V,w as Mt,B as dt,E as Et,b as ut,F as ht,T,d as tt,A as Tt,y as X,G as _,l as O,H as Ot,I as Bt,v as qt,k as it,f as yt}from"./shared-D2pvbPvF.mjs";import{E as Pt}from"./EntryBodies-BI7V3B5i.mjs";import{u as Rt,L as Vt}from"./ListEnd-B6tyeK1B.mjs";import{a as Ft}from"./annotation-name-BhbhOgES.mjs";import{r as Ht,a as jt}from"./link-q4quIuuD.mjs";import{s as Gt}from"./show-link-D9bByIzf.mjs";import{f as Kt,r as Wt}from"./fetchManifest-D31pEPrb.mjs";import{j as mt}from"./classnames-DukgfdpI.mjs";import{b as ct,s as _t}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as zt}from"./Cue-BhXRUDe9.mjs";import{E as Dt}from"./EntryThumbnail-BnMLzy5M.mjs";import{H as ft}from"./HideToggle-CmwFnHcZ.mjs";import{u as gt,c as vt}from"./readingLanguages-D97yt-4s.mjs";import{L as pt}from"./LanguageChoice-D_vEiQp9.mjs";import"./styles-Bf3qmdsh.mjs";function Ut(){return s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"48",strokeLinecap:"round",strokeLinejoin:"round",children:s("path",{d:"M224 96h-96a48 48 0 0 0-48 48v240a48 48 0 0 0 48 48h240a48 48 0 0 0 48-48v-96M304 80h128v128M432 80 240 272"})})}function bt(n){const o=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(o)]}function xt(n){const o=n.map(bt),e=[...new Set(o.flat())];return e.length<2?[]:o.some(a=>a.length&&e.some(c=>!a.includes(c)))?e:[]}function St(n,o){if(!o)return true;const e=bt(n);return!e.length||e.includes(o)}const Jt=[],kn=lt(function({scope:o="all",renderEntry:e,headingLevel:u=3,as:a="div",className:c,...h},l){const{t:r,langOf:m}=Z(),{clover:d,language:S}=z("Annotations"),L=q(t=>Ct(t.manifest,t.addedSets)),N=q(t=>Nt(t.manifest,t.canvasId)),M=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=Mt(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)},I=q(t=>o==="all"?At(t.manifest):Jt),w=Rt(I),k=t=>t.entries.filter(v=>N.some(x=>x.id===v.canvasId)),A=L.map(t=>({set:t,entries:k(t)})).filter(({entries:t})=>t.length),C=Y(u),y={text:r("annotationsShow"),lang:m("annotationsShow")};return o==="all"?s(tn,{ref:l,as:a,className:c,rest:h,sets:L,shown:N.map(t=>t.id),headingLevel:u,language:S,showLabel:y,hiddenSets:M,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&&s(Vt,{onReached:w.reachNext})}):A.length?s(a,{ref:l,className:mt("clover-annotations",c),...h,children:A.map(({set:t,entries:v})=>s(Qt,{set:t,entries:v,canvases:N,Heading:C,headingLevel:u,language:S,title:V(t.label,S),showLabel:y,hidden:M.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 Qt({set:n,entries:o,canvases:e,Heading:u,headingLevel:a,title:c,language:h,showLabel:l,hidden:r,selected:m,highlighted:d,renderEntry:S,onSelect:L,onHighlight:N,onVisible:M}){const b=ut(),$=c.text?a+1:a,f=T(()=>xt(o),[o]),[I,w]=tt(),k=gt(),A=vt(k,f),C=A?_(f,k.chosen):_(f,(k==null?void 0:k.chosen)??h,I),y=o.filter(t=>St(t,C));return s("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${b}-title`:void 0,"data-set":n.id,children:[s("div",{className:"clover-annotations-set-header",children:[c.text&&s(u,{className:"clover-annotations-title",id:`${b}-title`,...O(c.lang),children:c.text}),C&&!A&&s(pt,{languages:f,chosen:C,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),s(ft,{hidden:r,onChange:t=>M(!t),of:c.text?`${b}-title`:void 0})]}),s("ol",{className:"clover-annotations-list",children:y.map((t,v)=>s(wt,{entry:t,canvas:e.find(x=>x.id===t.canvasId),index:v,headingLevel:$,language:h,showLabel:l,selected:t.id===m,highlighted:t.id===d,renderEntry:S,onSelect:L,onHighlight:N},t.id))})]})}function Xt(n,o,e){const u=new Map(o.map((c,h)=>[c.id,h])),a=new Map;for(const c of n){const h=V(c.label,e),l=h.text;let r=a.get(l);r||(r={title:h,setIds:[],byCanvas:new Map},a.set(l,r)),r.setIds.push(c.id);for(const m of c.entries){const d=r.byCanvas.get(m.canvasId)??[];d.push(m),r.byCanvas.set(m.canvasId,d)}}return[...a.entries()].map(([c,h])=>({key:c,title:h.title,setIds:h.setIds,canvases:Yt([...h.byCanvas.entries()],u).map(([l,r])=>{var m;return{canvasId:l,label:V((m=o.find(d=>d.id===l))==null?void 0:m.label,e),entries:r}})}))}function Yt(n,o){return n.every(([e])=>o.has(e))?n.sort(([e],[u])=>o.get(e)-o.get(u)):n}function Zt(n,o){const{clover:e,language:u}=z("Annotations"),a=T(()=>{const l=new Set;for(const r of n)for(const m of r.canvases){if(o.has(m.canvasId))continue;const d=Ot(m.entries[0].annotation);d&&l.add(d)}return[...l]},[n,o]),[c,h]=tt([]);return X(()=>{let l=true;return Promise.all(a.map(r=>Kt(e,r))).then(r=>l&&h(r.filter(m=>!!m))),()=>{l=false}},[e,a]),T(()=>{const l=new Map;for(const r of c){const{canvases:m}=ht(r),d=V(r.label,u);for(const S of m){const L=V(S.label,u);l.set(S.id,{canvas:S,label:m.length>1&&L.text?[d,L]:[d]})}}return{named:a.length>0,of:l}},[c,a,u])}const tn=lt(function({as:o,className:e,rest:u,sets:a,shown:c,headingLevel:h,language:l,showLabel:r,hiddenSets:m,selected:d,highlighted:S,renderEntry:L,onSelect:N,onHighlight:M,onVisible:b,end:$},f){const I=ut(),w=q(i=>ht(i.manifest).canvases),k=T(()=>Xt(a,w,l),[a,w,l]),A=T(()=>new Map(w.map(i=>[i.id,i])),[w]),C=Zt(k,A),[y,t]=tt({}),v=gt(),x=q(i=>{var g;return(g=i.manifest)==null?void 0:g.label}),P=T(()=>V(x,l),[x,l]),F=w.length>1||C.named,G=Tt(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const g=_t(i)??i;return g.matches(":hover")||g.contains(document.activeElement)},kt=c.join(`
|
|
2
2
|
`);return X(()=>{const i=G.current;if(!i||!F||nt())return;const g=c.map(D=>i.querySelector(`[data-canvas="${CSS.escape(D)}"]`)).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")},[kt]),X(()=>{const i=G.current;if(!i||!d||nt())return;const g=i.querySelector(`[data-entry="${CSS.escape(d)}"]`);g&&ct(g,"nearest")},[d]),k.length?s(o,{ref:i=>{G.current=i,typeof f=="function"?f(i):f&&(f.current=i)},className:mt("clover-annotations",e),"data-scope":"all",...u,children:[k.map((i,g)=>{const B=Y(h),H=i.title.text?h+1:h,D=Y(H),Lt=i.setIds.every(p=>m.includes(p)),K=xt(i.canvases.flatMap(p=>p.entries)),et=vt(v,K),U=et?_(K,v.chosen):_(K,(v==null?void 0:v.chosen)??l,y[i.key]);return s("section",{className:"clover-annotations-set","aria-labelledby":i.title.text?`${I}-${g}`:void 0,children:[s("div",{className:"clover-annotations-set-header",children:[i.title.text&&s(B,{className:"clover-annotations-title",id:`${I}-${g}`,...O(i.title.lang),children:i.title.text}),U&&!et&&s(pt,{languages:K,chosen:U,onChange:p=>t(J=>({...J,[i.key]:p})),nameKey:"annotationsLanguage",part:"clover-annotations"}),s(ft,{hidden:Lt,onChange:p=>b(i.setIds,!p),of:i.title.text?`${I}-${g}`:void 0})]}),i.canvases.map((p,J)=>{var at;const st=p.entries.filter(E=>St(E,U));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),It=F&&c.includes(p.canvasId),ot=`${I}-${g}-${J}`;return s("section",{className:"clover-annotations-canvas","data-canvas":p.canvasId,"aria-labelledby":Q?ot:void 0,"aria-current":It?"true":void 0,children:[Q&&s(D,{className:"clover-annotations-canvas-label",id:ot,...O(R.length===1?R[0].lang:void 0),children:R.length===1?R[0].text:R.map((E,W)=>s(rt.Fragment,{children:[W>0&&", ",s("span",{...O(E.lang),children:E.text})]},W))}),s("ol",{className:"clover-annotations-list",children:st.map((E,W)=>s(wt,{entry:E,canvas:A.get(p.canvasId)??(j==null?void 0:j.canvas),index:W,headingLevel:Q?H+1:H,language:l,showLabel:r,selected:E.id===d,highlighted:E.id===S,renderEntry:L,onSelect:N,onHighlight:M},E.id))})]},p.canvasId)})]},i.key)}),$]}):null});function nn(n,o){const e=n.target.rect?void 0:n.target.svg,u=yt(en,!!e);return T(()=>{var h,l;const a=e?(h=u==null?void 0:u.readSvgShape(e))==null?void 0:h.box:void 0,c=n.target.rect??(a?{x:a.x,y:a.y,w:a.width,h:a.height}:void 0);return!c||!o||n.bodies.some(r=>r.image)?null:Wt(o,c,(l=n.layer)==null?void 0:l.image)},[n,o,e,u])}const en=()=>import("./svg-shape-D1K-WNrY.mjs");function wt({entry:n,canvas:o,index:e,headingLevel:u,language:a,showLabel:c,selected:h,highlighted:l,renderEntry:r,onSelect:m,onHighlight:d}){const{hostLanguage:S,t:L,langOf:N}=Z(),M=on(n,a),b=M.text?M:{text:String(e+1)},$=dt(n.target.t),f=$?{text:L("annotationsShowTime"),lang:N("annotationsShowTime")}:c,I=!f.lang&&!Bt(b.lang,S),w=b.text?`${f.text}: ${b.text}`:f.text,{clover:k}=z("Annotations"),A=nn(n,o);return s("li",{className:"clover-annotations-entry","data-entry":n.id,"data-selected":h,"data-highlighted":l,onMouseEnter:()=>d(n.id),onMouseLeave:()=>d(null),onFocus:()=>d(n.id),onBlur:()=>d(null),onClick:C=>{C.target.closest("a, button")||m(n.id)},children:[$&&s(zt,{start:$.start,className:"clover-annotations-time"}),s(Dt,{className:"clover-annotations-thumbnail",source:A,request:k.request}),s("div",{className:"clover-annotations-body clover-cue-text",children:[r?r(n):s(Pt,{bodies:n.bodies,language:a,headingLevel:u}),s(sn,{annotation:n.annotation})]}),s("button",{type:"button",className:"clover-annotations-show","aria-pressed":h,"aria-label":I?w:void 0,style:qt,onClick:()=>m(n.id),children:!I&&s(it,{children:[s("span",{...O(f.lang),children:[f.text,b.text&&":"]}),b.text&&s(it,{children:[" ",s("span",{...O(b.lang),children:b.text})]})]})})]})}function sn({annotation:n}){const{clover:o}=z("Annotations"),{t:e,langOf:u}=Z(),a=T(()=>Ht(n)??jt(n),[n]);if(!a)return null;const c=e("annotationsOpenLink"),h=u("annotationsOpenLink");return!a.canvasId&&!a.manifestId?s("a",{className:"clover-annotations-link",href:a.id,target:"_blank",rel:"noopener noreferrer",...O(h),children:[c,s(Ut,{})]}):s("button",{type:"button",className:"clover-annotations-link",...O(h),onClick:l=>{var m;const r=l.currentTarget.closest(".clover-root");Gt(o,a)&&((m=r==null?void 0:r.querySelector(".clover-canvas-viewport"))==null||m.focus({preventScroll:true}))},children:c})}function on(n,o){const{text:e="",lang:u}=Ft(n.bodies,o);return{text:e.slice(0,120),...u?{lang:u}:{}}}export{kn as Annotations};
|
|
@@ -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-BzLnvFn3.mjs";import{a as ht}from"./annotation-name-Biu7-abB.mjs";import{r as ut}from"./link-CQUMZL8-.mjs";import{T as dt}from"./Tip-h4Abk6aH.mjs";import{c as pt}from"./Camera-Ccshr6VH.mjs";import"./styles-DbqlZvMR.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{ae as q,aM as ot,af as D,B as W,T as et,A as L,y as j,q as S,_ as nt,$ as st,u as C,k as it,aN as rt,t as at,d as Z,l as ct,R as lt}from"./shared-D2pvbPvF.mjs";import{a as ht}from"./annotation-name-BhbhOgES.mjs";import{r as ut}from"./link-q4quIuuD.mjs";import{T as dt}from"./Tip-Dv-gYN8n.mjs";import{c as pt}from"./Camera-BlbXBgYZ.mjs";import"./styles-Bf3qmdsh.mjs";const K=t=>Array.isArray(t)?t.flatMap(K):ot.includes(t==null?void 0:t.type)?K(t.items??[]):t==null?[]:[t],ft=t=>K(t).map(o=>q(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,Nt=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 St(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=q([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 N=40;function qt(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=q(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-N/2,y:u-N/2,width:N,height:N},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 Kt=({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 $=S(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=S((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=S((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=S(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=q([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{Kt as A,$t as g,qt as p,Nt as s,St as t,Ut as w};
|
|
@@ -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-
|
|
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-D2pvbPvF.mjs";import L from"./Connected-BWomgzfE.mjs";import{r as R}from"./rendererSurface-BuBm8Th_.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{b as x}from"./hooks-Bo5GjPGX.mjs";import{L as c}from"./Loading-CAkF1fBT.mjs";const z=v(()=>import("./Connected-Dq0xux9o.mjs")),N=v(()=>import("./Connected-C31vzWei.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-
|
|
1
|
+
import{a as o,u as r,l}from"./shared-D2pvbPvF.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-
|
|
1
|
+
import{u as t,l as v}from"./shared-D2pvbPvF.mjs";import{j as b}from"./classnames-DukgfdpI.mjs";import{T as m}from"./Tip-Dv-gYN8n.mjs";import"./styles-Bf3qmdsh.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-
|
|
1
|
+
import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-CiP25Iqc.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-
|
|
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-BuBm8Th_.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as x,_ as Gt,a as Tn,d as y,q as Me,y as T,t as tt,f as nt,u as r,R as Jt,k as ro,a6 as co,a7 as uo,b as fo,T as L,a8 as ho,a9 as go,aa as mo,ab as po,P as Be,z as Ke,v as yo,l as Mn,ac as vo}from"./shared-D2pvbPvF.mjs";import{u as bo,d as $n,r as Co,C as wo,t as xo,E as Io,e as Mo,f as ko,h as Oo,g as So,j as Bo,B as Po,k as Eo,l as Ro}from"./pointer-BYZjBehK.mjs";import{P as Fo,a as Lo,I as To,b as $o}from"./glyphs-8fjIPAtZ.mjs";import{B as Ot}from"./Button-a59NBnOp.mjs";import{Z as zo,a as Ao,b as No,c as Vo,R as kn,d as Do,C as Ho}from"./controlGlyphs-Lxfq7zz4.mjs";import{S as U,f as Ko}from"./Tip-Dv-gYN8n.mjs";import{f as qo,s as jo,b as On,d as Sn,p as _o,e as Bn,g as Pn,h as Wo,i as Zo}from"./layout-DQtgCOJJ.mjs";import{u as Uo}from"./useNearViewport-D1kQt-tS.mjs";import{L as Yo}from"./Loading-CAkF1fBT.mjs";import{j as Go}from"./classnames-DukgfdpI.mjs";import{u as Jo}from"./useContainerName-BfU0IozO.mjs";import{b as Xo,f as Qo}from"./imageService-CCKieCxo.mjs";import"./styles-Bf3qmdsh.mjs";function ea(e,n,s){return e.reduce((o,u)=>o+u+s,-s)<=n}function ta(e,n,s){const o=e.ownerDocument,u=h=>h instanceof HTMLElement&&e.contains(h)&&!h.closest("[hidden]"),a=[o.getElementById(n),o.getElementById(s),...Array.from(e.querySelectorAll("button"))].find(u);a==null||a.focus()}function na({cluster:e,ids:n,more:s,fits:o,settled:u,onFits:a}){const h=x(o);h.current=o;const m=x(a);m.current=a;const q=x(new Map),j=x(n);j.current=n;const b=x(null),V=n.join(" ");return Gt(()=>{const D=e.ownerDocument,P=()=>{var me;const H=j.current,Q=getComputedStyle(e),Pe=parseFloat(Q.columnGap)||0;let C=e.clientWidth-(parseFloat(Q.paddingLeft)||0)-(parseFloat(Q.paddingRight)||0),$=0;for(const O of H){const Ee=(me=D.getElementById(O))==null?void 0:me.offsetWidth;Ee&&q.current.set(O,Ee),$=Math.max($,q.current.get(O)??0)}for(const O of Array.from(e.children))!(O instanceof HTMLElement)||H.includes(O.id)||O.id===s||O.classList.contains("clover-canvas-more")||!O.offsetWidth||getComputedStyle(O).position==="absolute"||(C-=O.offsetWidth+Pe);const ae=ea(H.map(O=>q.current.get(O)??$),C,Pe);if(ae===h.current)return;const ke=D.activeElement;b.current=ke instanceof HTMLElement&&e.contains(ke)?ke.id:null,h.current=ae,m.current(ae)};P();const d=new ResizeObserver(()=>P());d.observe(e);const X=new MutationObserver(()=>P());return X.observe(e,{childList:true}),()=>{d.disconnect(),X.disconnect()}},[e,V,s]),Gt(()=>{if(!u)return;const D=b.current;if(b.current=null,D===null)return;const P=e.ownerDocument.activeElement;(!P||!e.contains(P)||P.closest("[hidden]"))&&ta(e,D,s)},[o,u,e,s]),null}const oa=()=>import("./AnnotationMenu-4PN2LNP-.mjs"),aa=()=>import("./ChaptersMenu-Bne6N9cf.mjs"),sa=()=>import("./ChoiceMenu-BQVTRzXj.mjs"),la=()=>import("./ImageControls-CSHxdUD1.mjs"),En=2,ia=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),zn={atMax:false,atMin:false,atHome:false},ra=({renderer:e,instance:n,config:s,controlButtons:o,limits:u=zn,placeholder:a,placeholderIsMore:h=false,choices:m=[],selections:q={},onSelect:j,annotations:b=[],chapters:V=[],mediaElement:D=null,onChapter:P,overStill:d,request:X,hiddenPages:H,onPageVisibilityChange:Q,selectedAnnotation:Pe=null,onAnnotationSelect:C,onAnnotationActivate:$,captionId:ae,captionOpen:ke=false,onCaptionToggle:me,placeId:O,placeOpen:Ee=false,onPlaceToggle:qe,language:Y,fit:je=true,more:Bt="auto",children:Re})=>{var ht,gt,mt,Se;const{t:I,langOf:E}=Tn(),[Fe,ee]=y(false),[se,ot]=y(false),pe=`annotations-${n}`,_e=`${pe}-menu`,We=I("informationPanelTabsAnnotations"),le=E("informationPanelTabsAnnotations"),Pt=Me(i=>{var g;ot(false),$==null||$(null),i&&((g=document.getElementById(pe))==null||g.focus())},[pe,$]),ie=s.annotations&&b.length>0&&C,[Et,at]=y(false),te=`chapters-${n}`,st=`${te}-menu`,ne=V.length>0&&!!P,Ze=x(false),R=x(null);T(()=>{const i=()=>{var g;Ze.current=((g=document.activeElement)==null?void 0:g.id)===te};return document.addEventListener("focusin",i),()=>document.removeEventListener("focusin",i)},[te]);const oe=Me(()=>{var g,fe;if(!Ze.current)return;Ze.current=false;const i=document.activeElement;i&&i!==document.body||(fe=(g=R.current)==null?void 0:g.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||fe.focus()},[]);T(()=>{ne||oe()},[ne,oe]),T(()=>()=>oe(),[oe]);const S=Me(i=>{var g;at(false),i&&((g=document.getElementById(te))==null||g.focus())},[te]),lt=s.information&&ae&&me,re=s.map&&O&&qe,ce=`choice-${n}`,ue=m.length===1?tt(m[0].label,Y):null,k=(ue==null?void 0:ue.text)||I("canvasChoice"),ye=ue!=null&&ue.text?ue.lang:E("canvasChoice"),ve=`${ce}-menu`,Ue=(ht=nt(oa,!!ie))==null?void 0:ht.default,it=(gt=nt(aa,ne))==null?void 0:gt.default,Ye=(mt=nt(sa,m.length>0&&!!j))==null?void 0:mt.default,rt=Me(i=>{var g;ee(false),i&&((g=document.getElementById(ce))==null||g.focus())},[ce]),Rt=bo(),[de,Le]=y(null);T(()=>{R.current=(de==null?void 0:de.closest(".clover-canvas"))??null},[de]);const be=$n(de),[ct,_]=y(false),Te=i=>r(Ot,{className:i,id:pe,label:We,lang:le,onClick:()=>ot(g=>!g),expanded:se,controls:_e,children:r($o,{})},"annotations"),Ge=(()=>{const i=[],g=e;return s.zoom&&g&&i.push({key:"zoomIn",id:`zoomIn-${n}`,shortcut:U.zoomIn,label:I("imageZoomIn"),lang:E("imageZoomIn"),glyph:r(zo,{}),unavailable:u.atMax,onClick:()=>g.zoomBy(En)},{key:"zoomOut",id:`zoomOut-${n}`,shortcut:U.zoomOut,label:I("imageZoomOut"),lang:E("imageZoomOut"),glyph:r(Ao,{}),unavailable:u.atMin,onClick:()=>g.zoomBy(1/En)}),s.fullPage&&Rt&&i.push({key:"fullPage",id:`fullPage-${n}`,label:I(be?"imageExitFullScreen":"imageFullScreen"),lang:E(be?"imageExitFullScreen":"imageFullScreen"),glyph:be?r(No,{}):r(Vo,{}),onClick:fe=>void xo(fe.currentTarget)}),s.rotation&&g&&i.push({key:"rotateRight",id:`rotateRight-${n}`,shortcut:U.rotateRight,label:I("imageRotateRight"),lang:E("imageRotateRight"),glyph:r(kn,{}),onClick:()=>g.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${n}`,shortcut:U.rotateLeft,label:I("imageRotateLeft"),lang:E("imageRotateLeft"),glyph:r(kn,{}),onClick:()=>g.rotateBy(-90)}),s.reset&&g&&i.push({key:"reset",id:`reset-${n}`,shortcut:U.reset,label:I("imageResetZoom"),lang:E("imageResetZoom"),glyph:r(Do,{}),unavailable:u.atHome,onClick:()=>g.home()}),m.length&&i.push({key:"choice",id:ce,label:k,lang:ye,glyph:r(Ho,{}),onClick:()=>ee(fe=>!fe),expanded:Fe,controls:ve}),i})(),ut=[...Ge.filter(i=>i.key!=="fullPage"),...Ge.filter(i=>i.key==="fullPage")].map(i=>({id:i.id,view:ia.has(i.key),node:Co(i,o)})),K=[re&&{id:`place-${n}`,view:false,node:r(Ot,{id:`place-${n}`,label:I("mapLabel"),lang:E("mapLabel"),onClick:qe,expanded:Ee,controls:O,children:r(Fo,{})},"place")},ne&&{id:te,view:false,node:r(Ot,{id:te,label:I("playerChapters"),lang:E("playerChapters"),onClick:()=>at(i=>!i),expanded:Et,controls:st,children:r(Lo,{})},"chapters")},ie&&{id:pe,view:false,node:Te()},lt&&{id:`information-${n}`,view:false,node:r(Ot,{id:`information-${n}`,label:I("informationPanelTabsAbout"),lang:E("informationPanelTabsAbout"),onClick:me,expanded:ke,controls:ae,children:r(To,{})},"information")},!!a&&{id:`placeholder-${n}`,view:false,node:r(Jt.Fragment,{children:a},"placeholder")}].filter(i=>!!i),Je=K.filter(i=>i.id===`placeholder-${n}`),dt=[...ut.filter(i=>i.view),...Je],z=[...ut.filter(i=>!i.view),...K.filter(i=>!Je.includes(i))],Oe=[...dt,...z],[G,ft]=y(true),Xe=Bt==="always"||h,$e=(Se=nt(la,je&&(h||(Xe||!G)&&Oe.some(i=>i.view))))==null?void 0:Se.ImageControls,v=G&&!Xe||!$e?[]:Oe.filter(i=>i.view),J=h&&!!a&&!!$e;T(()=>{v.length||_(false)},[v.length]);const ze=i=>i.filter(g=>!v.includes(g)&&!(J&&g.id===`placeholder-${n}`)).map(({node:g})=>g);return r(ro,{children:[r(wo,{fit:je,clusterRef:Le,children:[ze(dt),$e&&(v.length>0||J)&&r($e,{instance:n,open:J?v.length>0:ct,onOpenChange:_,toggle:J?a:void 0,children:v.map(({node:i})=>i)}),ze(z),Re]}),je&&!Xe&&de&&r(na,{cluster:de,ids:Oe.map(({id:i})=>i),more:`more-${n}`,fits:G,settled:G||v.length>0||!Oe.some(i=>i.view),onFits:ft}),it&&Et&&ne&&r(it,{id:st,triggerId:te,label:I("playerChapters"),labelLang:E("playerChapters"),chapters:V,element:D,onChapter:P,overStill:d,request:X,onClose:S}),Ue&&se&&ie&&r(Ue,{id:_e,triggerId:pe,label:We,labelLang:le,annotations:b,hiddenPages:H,onPageVisibilityChange:Q,selected:Pe,onSelect:C,onActivate:i=>$==null?void 0:$(i),onClose:Pt}),Ye&&Fe&&m.length>0&&j&&r(Ye,{id:ve,triggerId:ce,label:k,labelLang:ye,language:Y,choices:m,selections:q,onSelect:j,onClose:rt})]})},ca=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function qa(e,n){return{a:1,b:0,c:0,d:1,e,f:n}}function ja(e,n=e){return{a:e,b:0,c:0,d:n,e:0,f:0}}function _a(e){const n=Math.cos(e),s=Math.sin(e);return{a:n,b:s,c:-s,d:n,e:0,f:0}}function ua(e,n){return{a:e.a*n.a+e.c*n.b,b:e.b*n.a+e.d*n.b,c:e.a*n.c+e.c*n.d,d:e.b*n.c+e.d*n.d,e:e.a*n.e+e.c*n.f+e.e,f:e.b*n.e+e.d*n.f+e.f}}function Wa(...e){return e.reduce((n,s)=>ua(n,s),ca)}function Za(e){const n=e.a*e.d-e.b*e.c;if(!n||!Number.isFinite(n))return null;const s=1/n;return{a:e.d*s,b:-e.b*s,c:-e.c*s,d:e.a*s,e:(e.c*e.f-e.d*e.e)*s,f:(e.b*e.e-e.a*e.f)*s}}function St(e,n){return{x:e.a*n.x+e.c*n.y+e.e,y:e.b*n.x+e.d*n.y+e.f}}function Ua(e){return`matrix(${[e.a,e.b,e.c,e.d,e.e,e.f].map(da).join(",")})`}function Ya(e,n,s,o=new Float32Array(9)){const u=2/n,a=-2/s;return o[0]=e.a*u,o[1]=e.b*a,o[2]=0,o[3]=e.c*u,o[4]=e.d*a,o[5]=0,o[6]=e.e*u-1,o[7]=e.f*a+1,o[8]=1,o}function da(e){const n=Math.round(e*1e6)/1e6;return Object.is(n,-0)?"0":String(n)}function Ga(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Rn(e){if(!e.length)return null;let n=1/0,s=1/0,o=-1/0,u=-1/0;for(const a of e)n=Math.min(n,a.x),s=Math.min(s,a.y),o=Math.max(o,a.x+a.width),u=Math.max(u,a.y+a.height);return{x:n,y:s,width:o-n,height:u-s}}function Ja(e,n){return e.x<n.x+n.width&&n.x<e.x+e.width&&e.y<n.y+n.height&&n.y<e.y+e.height}function Xa(e,n){const s=[St(e,{x:n.x,y:n.y}),St(e,{x:n.x+n.width,y:n.y}),St(e,{x:n.x,y:n.y+n.height}),St(e,{x:n.x+n.width,y:n.y+n.height})],o=s.map(m=>m.x),u=s.map(m=>m.y),a=Math.min(...o),h=Math.min(...u);return{x:a,y:h,width:Math.max(...o)-a,height:Math.max(...u)-h}}function Qa(e,n,s){return Math.min(Math.max(e,n),s)}const Yt=e=>!!(e&&"overlays"in e);let Xt;const fa=()=>import("./shared-D2pvbPvF.mjs").then(e=>e.aR).then(e=>{Xt=e.buildContentState}),ha=Ke(()=>import("./MediaBody-XsEObuYV.mjs")),ga=()=>import("./AnnotationState-3KHHmQhl.mjs"),ma=new Map,pa={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:ma,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},ya=Ke(()=>import("./FrameAnimation-BcEfAQrI.mjs")),Fn=Ke(()=>import("./PlaceBox-D-pLIX5w.mjs")),va=Ke(()=>import("./Placeholder-Mq1Iaasr.mjs")),ba=Ke(()=>import("./ControlsFade-CStkqANR.mjs")),Ca=()=>true,wa=Ke(()=>import("./Placeholder-Mq1Iaasr.mjs").then(({PlaceholderToggle:e})=>({default:e}))),Ln={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},xa={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},Ia={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",U.zoomIn.keys,U.zoomOut.keys,U.reset.keys,U.rotateRight.keys,U.rotateLeft.keys].join(" ")},Ma={description:"canvasKeysMedia",keys:[U.play.keys,"J L",U.mute.keys].join(" ")},ka={description:"canvasKeysAnnotations",keys:"Escape"},es=e=>{var s;return!!((s=e.canvases)!=null&&s.length)||An(e.body,e.src).length>0?r(Io,{children:r(Oa,{...e})}):null},Oa=e=>{var mn,pn,yn,vn,bn,Cn;const{surface:n,manifestId:s,canvases:o,viewingDirection:u,body:a,src:h,isTiledImage:m=false,label:q,partOf:j,language:b,highContrast:V,instanceId:D,className:P,options:d,navigator:X=false,controls:H=true,collapseControls:Q="auto",controlButtons:Pe,annotations:C,onReady:$,onViewportChange:ae,onContentStateChange:ke,onMediaElement:me,onCaptionChange:O,caption:Ee,onEnded:qe,chapters:Y,highlightedChapter:je,onChapterHighlight:Bt,placeholder:Re=true,ahead:I,children:E}=e,{t:Fe}=Tn(),ee=x(null),[se,ot]=y(null),pe=Mo(se),_e=$n(se),We=ko(se),le=co(ot),Pt=uo(V),ie=!!n.controlsVisibility,at=(n.controlsVisibility??Ca)(ie?se:null,d==null?void 0:d.hideDelay,ee),[te,st]=y(false),ne=Uo(se),Ze=fo(),[R]=y(()=>D??`clover-canvas-${Ze}`),oe=x(null),[S,lt]=y(null),re=Yt(S)?S:null,[ce,ue]=y(null),k=H===false?null:H===true?Ln:{...Ln,...H},[ye,ve]=y("loading"),[Ue,it]=y(false),[Ye,rt]=y(0),[Rt,de]=y(zn),Le=x($),be=x(ae),ct=x(d);Le.current=$,be.current=ae,ct.current=d;const _=ho(u),Te=L(()=>qo(o??[]),[o]),Ft=L(()=>jo(Te,b),[Te,b]),[Ge,ut]=y({}),K=L(()=>({...Ft,...Ge}),[Ft,Ge]),Je=(t,l)=>ut(f=>({...f,[t]:l})),dt=L(()=>C==null?void 0:C.filter(t=>!t.layer||(K[t.layer.key]??0)===t.layer.item),[C,K]),z=(mn=C==null?void 0:C.find(t=>t.layer&&t.annotation.id===e.selectedAnnotation))==null?void 0:mn.layer;T(()=>{z&&(K[z.key]??0)!==z.item&&Je(z.key,z.item)},[z==null?void 0:z.key,z==null?void 0:z.item,e.selectedAnnotation]);const Oe=!!(k!=null&&k.information),G=!!(C!=null&&C.length),ft=nt(ga,G),[Xe,$e]=y(null),v=G&&Xe||pa,J=L(()=>{var f,M;const t=(f=C==null?void 0:C.find(A=>A.annotation.id===v.selected))==null?void 0:f.annotation,l=(Array.isArray(t==null?void 0:t.body)?t==null?void 0:t.body:[t==null?void 0:t.body]).find(A=>(A==null?void 0:A.type)==="Feature");return t&&l?{id:String(t.id),feature:l,name:((M=l.properties)==null?void 0:M.label)??t.label}:null},[C,v.selected]),ze=J?`${J.id}:${e.refind??0}`:null,[ht,gt]=y(null),mt=ze!==null&&ht!==ze,Se=L(()=>{var A,He;const t=(o??[]).map(Z=>Z.navPlace).filter(Boolean),l=t.length?t:e.navPlace?[e.navPlace]:[];if(!l.length)return null;const f=l.flatMap(Z=>(Z==null?void 0:Z.type)==="FeatureCollection"?Z.features??[]:(Z==null?void 0:Z.type)==="Feature"?[Z]:[]);if(!f.length)return null;const M=f.length===1?(He=(A=f[0])==null?void 0:A.properties)==null?void 0:He.label:void 0;return{feature:{type:"FeatureCollection",features:f},name:M??e.label}},[o,e.navPlace,e.label]),i=`place-box-${R}`,[g,fe]=y(false),[Vn,Dn]=y(false),pt=x(v);pt.current=v;const yt=Me(()=>pt.current.release(),[]),{comments:Lt,listedCount:Qt}=v,Ae=L(()=>Oe?(o??[]).filter(t=>Oo(t)||Lt.has(t.id)):[],[o,Oe,Lt]),Tt=`caption-${R}`,[Hn,en]=y(false),$t=Hn&&Ae.length>0,tn=Me(t=>{var l;en(false),t&&((l=document.getElementById(`information-${R}`))==null||l.focus())},[R]),W=L(()=>(o??[]).find(t=>On(t).length)??null,[o]),Kn=W?On(W):Ba,F=L(()=>o!=null&&o.length?Sn(o,_,K,{standIns:o.length>1}):null,[o,_,K]),qn=L(()=>An(a,h,m),[a,h,m]),c=(F==null?void 0:F.media[0])??null,nn=!ie&&(c==null?void 0:c.kind)==="video",jn=ie||nn,_n=ie?at:te,Wn=L(()=>{if(o!=null&&o.length)return _o(o,K);const t=(Array.isArray(a)?a:a?[a]:[])[0];return typeof(t==null?void 0:t.type)=="string"?t.type.toLowerCase():h?"image":void 0},[o,K,a,h]),[B,Zn]=y(null),vt=x(me);vt.current=me;const Un=Me(t=>{var l;Zn(t),(l=vt.current)==null||l.call(vt,t)},[]),Ce=F?F.images:qn,we=!!c&&(o==null?void 0:o.length)===1,xe=we&&(c==null?void 0:c.kind)==="audio",Yn=we&&(c==null?void 0:c.kind)==="video",Ne=(o==null?void 0:o.length)===1&&!c&&!W&&Ce.length===0,bt=!we&&!Ne&&((pn=d==null?void 0:d.gestures)==null?void 0:pn.navigable)!==false,he=o?`${s??""}
|
|
2
|
+
${o.map(t=>t.id).join("|")}`:null,Ie=L(()=>{if(!o||!Re)return[];const t=o.flatMap(l=>{const f=Bn(l),M=tt(l.label,b);return f?[{...f,alt:M.text,lang:M.lang}]:[]});return _==="right-to-left"||_==="bottom-to-top"?t.reverse():t},[o,_,Re,b]),[zt,on]=y(false),[Gn,an]=y(null),p=!xe&&Ie.length>0&&(c?Gn!==he:!zt),sn=d==null?void 0:d.request;T(()=>{if(p){import("./thumbnail-By5wfGlE.mjs");for(const{source:t}of Ie)t.service&&Qo(t.service,{request:sn}).catch(()=>{})}},[p,Ie,sn]);const Ct=L(()=>{if(!(I!=null&&I.length)||Re&&!zt&&I.some(f=>Bn(f)))return null;const t=Sn(I,_,K,{standIns:false});if(t.media.length)return null;const l=t.images.filter(f=>f.service&&!f.hidden);return l.length?{images:l,world:Rn(t.placements)??void 0}:null},[I,_,K,Re,zt]);T(()=>{var t;ye!=="ready"||p||!Ct||(t=S==null?void 0:S.prefetch)==null||t.call(S,Ct.images,{world:Ct.world})},[S,ye,p,Ct]);const ln=(t,{annotations:l=false,fullPage:f=false}={})=>({...t,zoom:false,rotation:false,reset:false,fullPage:f&&t.fullPage,annotations:l&&t.annotations}),Qe=Ne&&_e,rn=Jt.Children.count(E)>0,At=Ie.length>0&&!xe&&!c,et=k?p?Ae.length||rn||Qt||c&&(Y!=null&&Y.length)?ln(k,{annotations:true}):null:we||Ne?Te.length||Ae.length||rn||Qt||c&&(Y!=null&&Y.length)||Qe&&k.fullPage?ln(k,{annotations:true,fullPage:Qe}):null:k:null,Nt=X&&!p&&(c?c.kind==="audio"&&!we&&Ce.length>0:true),[Vt,Jn]=y(null),Ve=c?Vt??c.placement:null,[wt,Xn]=y(Pa),Dt=L(()=>{const t=(c==null?void 0:c.kind)==="video"&&B&&Ve?[...Ce,{id:c.id,placement:Ve,width:Ve.width,height:Ve.height,media:{element:B}}]:Ce;return wt.length?[...t,...wt]:t},[Ce,c,B,Ve,wt]),cn=we&&(c==null?void 0:c.kind)==="video"&&Vt?Vt:F?Rn(F.placements):null,Qn=JSON.stringify([Ce,cn,Dt.length!==Ce.length&&[c==null?void 0:c.id,Ve],wt.map(t=>t.id)]),xt=x(null),Ht=x(false),Kt=()=>{c?an(p?he:null):on(p),p||yt()},It=x(null),eo=t=>{if(B&&!p){B.currentTime=t;return}It.current=t,p&&Kt()};T(()=>{!B||It.current===null||(B.currentTime=It.current,It.current=null)},[B]);const qt=Array.isArray(a)?a[0]:a,w=[q,(yn=o==null?void 0:o[0])==null?void 0:yn.label,qt==null?void 0:qt.label].map(t=>tt(t,b)).find(t=>t.text),to=L(()=>{const t=tt(j,b);return t.text&&t.text!==(w==null?void 0:w.text)?t:void 0},[j,b,w==null?void 0:w.text]),un=Jo((w==null?void 0:w.text)||Fe("canvasImage"),w?w.lang:le.langOf("canvasImage"),false,le.hostLanguage),Mt=p?[]:[...bt?[Ia]:[],...c?[Ma]:[],...G?[ka]:[]],dn=`keys-${R}`,no=bt&&!p&&!le.langOf("canvasRoleDescription")?Fe("canvasRoleDescription"):void 0,jt=!!et&&Ae.length>0,oo=jt&&Ae.map((t,l)=>tt(t.label,b).text?So(Tt,l):null).filter(Boolean).join(" ")||void 0,fn=x({canvases:o,scene:F,canvasKey:he});fn.current={canvases:o,scene:F,canvasKey:he};const kt=x(null),_t=Me(()=>{const{canvases:t,scene:l,canvasKey:f}=fn.current;kt.current=t&&l&&xt.current===f?{key:f,canvases:t,placements:l.placements}:null},[]),ao=!o||((vn=kt.current)==null?void 0:vn.key)===he,De=go(()=>{const t=kt.current,l=oe.current;if(!t||s==="loading")return null;const f=B&&B.currentTime>0?B.currentTime:null,M=!f&&l&&Yt(l)?Nn(l.getBounds(),t.canvases,t.placements):null,A=t.canvases.find(He=>He.id===(M==null?void 0:M.canvasId))??t.canvases[0];return A?Xt?Xt({manifestId:s,canvasId:A.id,type:A.type,region:M&&{x:M.rect.x,y:M.rect.y,w:M.rect.width,h:M.rect.height},time:f}):(fa().then(()=>De()),null):null},ke);T(()=>mo(B,De),[B,De]),T(()=>{const t=ee.current;if(!t)return;const l=n(t,ct.current),f=Yt(l)?l:null;oe.current=l,lt(l),l.setDismiss(yt);const M=()=>{if(!f)return;const N=f.viewLimits();de(ge=>ge.atMax===N.atMax&&ge.atMin===N.atMin&&ge.atHome===N.atHome?ge:N)},A=l.on("open",()=>{var N;M(),Zt(false),_t(),De(),ve("ready"),rt(ge=>ge+1),f&&((N=Le.current)==null||N.call(Le,Sa(f,()=>kt.current,ge=>{var xn,In;const wn=pt.current.placed.find(Ut=>Ut.id===ge);return wn?(pt.current.select(wn),(In=Array.from(((xn=f.overlays)==null?void 0:xn.container.querySelectorAll("[id]"))??[]).find(Ut=>Ut.id===ge))==null||In.focus({preventScroll:true}),true):false})))}),He=l.on("change",()=>{M(),Zt(false),_t(),De(),ve("ready"),rt(N=>N+1)}),Z=l.on("error",()=>{l.isOpen||ve("error")}),lo=l.on("unloadable",N=>it(!!N)),io=l.on("viewport",()=>{var N;M(),f&&((N=be.current)==null||N.call(be,f.getBounds())),De()});return()=>{A(),He(),Z(),lo(),io(),l.dispose(),oe.current=null,lt(null)}},[D,n,yt,_t]),T(()=>{if(!(!re||!ce))return re.attachNavigator(ce)},[re,ce]),T(()=>{if(!(!S||!Ne))return S.setGestures({navigable:false}),()=>S.setGestures({})},[S,Ne]);const Wt=x(false);T(()=>{var l;if(Qe)return;const t=!document.activeElement||document.activeElement===document.body;Wt.current&&t&&((l=ee.current)==null||l.focus()),Wt.current=false},[Qe]),T(()=>{const t=oe.current;if(p&&(Ht.current=true),!t||!ne||p)return;const l=xt.current!==null&&xt.current!==he;(!t.isOpen||l)&&ve("loading");const f=we||Ht.current&&t.isOpen||l;xt.current=he,Ht.current=false,t.setImages(Dt,{world:cn??void 0,fit:f})},[Qn,D,B,ne,p]);const hn=x(s),[so,Zt]=y(false);Gt(()=>{var t;s!==hn.current&&(hn.current=s,(t=oe.current)==null||t.clear(),Zt(true),ve("loading"))},[s]);const gn=ye==="loading"&&Dt.length>0&&ne&&!p;return r(vo.Provider,{value:le.hostLanguage,children:r("figure",{"aria-labelledby":oo,className:Go("clover-canvas",P),"data-testid":"clover-canvas","data-status":ye,...po(Pt),"data-unloadable":Ue||void 0,"data-has-navigator":Nt,"data-fullscreen":pe,"data-exit":We||void 0,"data-controls":jn?_n?"visible":"hidden":void 0,"data-media":Wn,"data-recording":c?"":void 0,"data-player":xe?"":void 0,"data-animated":W?"":void 0,"data-navigable":bt,"data-placeholder":Ie.length&&!xe?p:void 0,ref:le.ref,onFocus:t=>{Wt.current=Qe&&t.target.id===`fullPage-${R}`},onKeyDown:t=>{if(t.key==="Escape"&&$t&&!t.defaultPrevented){t.preventDefault(),tn(false);return}if(t.key==="Escape"&&!t.defaultPrevented&&!t.currentTarget.querySelector(".clover-canvas-menu")&&yt()){t.preventDefault();return}Ko(t,ee.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(et||Nt)&&c&&r("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),nn&&r(Be,{fallback:null,children:r(ba,{element:se,hideDelay:d==null?void 0:d.hideDelay,picture:ee,onChange:st})}),r(Bo,{hidden:!We}),S&&(et||At)&&r(ra,{renderer:re,instance:R,config:et??xa,controlButtons:Pe,limits:Rt,placeholderIsMore:At&&!c,chapters:c?Y:void 0,mediaElement:B,onChapter:eo,overStill:!!c&&p,request:d==null?void 0:d.request,placeholder:At&&r(Be,{fallback:null,children:r(wa,{instance:R,media:!!c,active:p,onToggle:Kt,more:!!k&&(k.zoom||k.rotation||k.reset||k.fullPage)})}),fit:!ie,more:Q,choices:p?[]:Te,selections:K,onSelect:Je,annotations:v.menu,hiddenPages:v.hiddenPages,onPageVisibilityChange:v.setPagesVisible,selectedAnnotation:v.selected,onAnnotationSelect:v.select,onAnnotationActivate:v.activate,captionId:jt?Tt:void 0,captionOpen:$t,onCaptionToggle:()=>en(t=>!t),placeId:Se?i:void 0,placeOpen:g,onPlaceToggle:()=>{Dn(true),fe(t=>!t)},language:b,children:et&&E}),Nt&&r("div",{ref:ue,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),r("div",{ref:ee,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:G?"group":"img","aria-roledescription":no,...un.props,"aria-describedby":Mt.length?dn:void 0,"aria-keyshortcuts":Mt.map(({keys:t})=>t).join(" ")||void 0,"aria-busy":gn,tabIndex:0}),un.node,Mt.length>0&&r("span",{id:dn,style:yo,children:Mt.map(({description:t},l)=>r(Jt.Fragment,{children:[l>0&&" ",r("span",{...Mn(le.langOf(t)),children:Fe(t)})]},t))}),r(Po,{kind:"image",shown:Ue&&!p}),Ne&&!p&&(w==null?void 0:w.text)&&r(Eo,{text:w.text,lang:w.lang||void 0}),(c==null?void 0:c.kind)==="audio"&&!xe&&Ce.length===0&&!p&&(w==null?void 0:w.text)&&r("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...Mn(w.lang||void 0),children:w.text}),Ie.length>0&&!xe&&r(Be,{fallback:null,children:r(va,{instance:R,stills:Ie,vertical:_==="top-to-bottom"||_==="bottom-to-top",media:!!c,active:p,lingering:ye==="loading"&&!so,onToggle:Kt,request:d==null?void 0:d.request})}),S&&c&&ne&&!p&&r(Be,{fallback:null,children:r(ha,{media:c,request:d==null?void 0:d.request,fillable:Yn,surface:S,instance:R,onElement:Un,onFit:Jn,onCaptionChange:O,caption:Ee,navigable:bt,fullscreen:we&&!!(k!=null&&k.fullPage),isFullscreen:_e,onEnded:qe,chapters:Y,highlightedChapter:je,onChapterHighlight:Bt,autoPlay:!xe&&Ie.length>0&&v.quietlyOpened!==he,language:b,notes:v.timed,marked:v.placed,selectedAnnotation:v.selected,onAnnotationSelect:G?v.select:void 0,onAnnotationActivate:v.activate,player:xe&&o?{canvas:o[0],title:w,partOf:to}:void 0})}),re&&W&&(F==null?void 0:F.frames[Pn(W)])&&!p&&r(Be,{fallback:null,children:r(ya,{renderer:re,frames:Kn,byFrame:F.frames[Pn(W)],animationKey:W.id,sceneVersion:Ye,autoplay:(bn=d==null?void 0:d.animation)==null?void 0:bn.autoplay,loop:(Cn=d==null?void 0:d.animation)==null?void 0:Cn.loop,onEnded:qe,language:b,duration:Number(W.duration),canvas:W,place:F.placements[o.indexOf(W)],onItems:Xn},W.id)}),ft&&G&&C&&r(ft.AnnotationState,{given:e,annotations:dt??C,scene:F,renderer:re,sceneVersion:Ye,drawn:ao,media:c,mediaElement:B,showPlaceholder:p,canvasKey:he,openImages:on,openMedia:an,host:ee,onModel:$e,refind:e.refind??0}),gn&&r(Yo,{overlay:true}),J&&r(Be,{fallback:null,children:r(Fn,{id:`place-of-${R}`,open:mt,onClose:t=>{var l;gt(ze),t&&((l=document.getElementById(J.id))==null||l.focus())},feature:J.feature,name:J.name,language:b})}),Se&&Vn&&r(Be,{fallback:null,children:r(Fn,{id:i,open:g,onClose:t=>{var l;fe(false),t&&((l=document.getElementById(`place-${R}`))==null||l.focus())},feature:Se.feature,name:Se.name,language:b})}),jt&&r(Ro,{id:Tt,canvases:Ae,comments:Lt,open:$t,onClose:tn,language:b})]})})};function Sa(e,n,s){return{fitCanvasRect(o,u,a){const h=n(),m=(h==null?void 0:h.canvases.findIndex(q=>q.id===o))??-1;return!h||m===-1?false:(e.fitBounds(Wo(h.canvases[m],h.placements[m],u),a),true)},getCanvasRegion(){const o=n();return o?Nn(e.getBounds(),o.canvases,o.placements):null},get backendKind(){return e.backendKind},get atHome(){return e.isAtHome},fitBounds:(o,u)=>e.fitBounds(o,u),fitItemRect:(o,u,a)=>e.fitItemRect(o,u,a),itemRectToWorld:(o,u)=>e.itemRectToWorld(o,u),getBounds:()=>e.getBounds(),getHomeBounds:()=>e.getHomeBounds(),getCamera:()=>e.getCamera(),home:o=>e.home(o),zoomBy:(o,u,a)=>e.zoomBy(o,u,a),panBy:(o,u,a)=>e.panBy(o,u,a),setRotation:(o,u)=>e.setRotation(o,u),getRotation:()=>e.getRotation(),rotateBy:o=>e.rotateBy(o),worldToScreenPoint:o=>e.worldToScreenPoint(o),screenToWorldPoint:o=>e.screenToWorldPoint(o),on:(o,u)=>e.on(o,u),zoomToAnnotation:s}}const Ba=[],Pa=[];function An(e,n,s=false){const o=Array.isArray(e)?e:e?[e]:[];return o.length?o.map((a,h)=>{const m=Xo(a.service);return!m&&!a.id?null:{id:`${h}:${a.id??m}|${a.region??""}`,service:m,url:a.id,width:a.width,height:a.height,region:a.region}}).filter(a=>a!==null):(Array.isArray(n)?n:n?[n]:[]).filter(Boolean).map((a,h)=>({id:`${h}:${a}`,...s?{service:a}:{url:a}}))}function Nn(e,n,s){let o=null;if(s.forEach((V,D)=>{const P=Math.max(e.x,V.x),d=Math.max(e.y,V.y),X=Math.min(e.x+e.width,V.x+V.width)-P,H=Math.min(e.y+e.height,V.y+V.height)-d;if(X<=0||H<=0)return;const Q=X*H;(!o||Q>o.area)&&(o={index:D,area:Q,clip:{x:P,y:d,width:X,height:H}})}),!o)return null;const{index:u,clip:a}=o,h=n[u],m=s[u],q=Zo(h),j=q.width/m.width,b=q.height/m.height;return{canvasId:h.id,rect:{x:Math.round((a.x-m.x)*j),y:Math.round((a.y-m.y)*b),width:Math.round(a.width*j),height:Math.round(a.height*b)}}}export{es as C,Ya as a,St as b,Wa as c,Xa as d,Ja as e,Qa as f,_a as g,Yt as h,Za as i,Ua as j,Ga as r,ja as s,qa as t,Rn as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,u as a,t as d,l as p,
|
|
1
|
+
import{a as c,u as a,t as d,l as p,aN as v,k as m}from"./shared-D2pvbPvF.mjs";import{M as f,a as h}from"./Markup-COA2t_y1.mjs";import{R as u}from"./ReadMore-B6qft77s.mjs";import{E as N}from"./EntryBodies-BI7V3B5i.mjs";const T=({summary:s,metadata:n,comments:o,language:r})=>{const{t,langOf:l}=c();return a(m,{children:[d(s,r).text&&a(u,{children:a(f,{as:"p",markup:s,language:r,className:"clover-summary clover-canvas-caption-summary"})}),a(h,{metadata:n,language:r,className:"clover-metadata clover-canvas-caption-metadata"}),o!=null&&o.length?a("div",{className:"clover-canvas-caption-annotations",children:[a("p",{className:"clover-canvas-caption-annotations-label",...p(l("informationPanelTabsAnnotations")),children:t("informationPanelTabsAnnotations")}),a("ul",{children:o.map((i,e)=>a("li",{children:a(N,{bodies:v(i),language:r})},i.id??e))})]}):null]})};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as y,y as N,A as T,u as t,
|
|
1
|
+
import{d as y,y as N,A as T,u as t,an as L,l as b}from"./shared-D2pvbPvF.mjs";import C from"./ControlMenu-ej-Kpb31.mjs";import{c as D,a as P}from"./Transport-BKFLjI45.mjs";import{u as w}from"./useContainerName-BfU0IozO.mjs";import{E as A}from"./EntryThumbnail-BnMLzy5M.mjs";const B=({id:u,triggerId:p,label:v,labelLang:f,chapters:s,element:e,onChapter:g,overStill:E=false,request:h,onClose:o})=>{const i=w(v,f),[k,c]=y(()=>(e==null?void 0:e.currentTime)??0);N(()=>{if(!e)return;const r=()=>c(e.currentTime);return r(),e.addEventListener("timeupdate",r),e.addEventListener("seeked",r),()=>{e.removeEventListener("timeupdate",r),e.removeEventListener("seeked",r)}},[e]);const m=D(s,k),n=T(false),l=r=>{g(s[r].start),c(s[r].start)};return t(C,{"data-testid":"clover-canvas-chapters",id:u,onClose:o,triggerId:p,children:[t("fieldset",{className:"clover-canvas-menu-group",...i.props,children:s.map((r,a)=>t("label",{className:"clover-canvas-menu-item clover-canvas-chapters-item",onPointerDown:()=>{n.current=true},children:[t("input",{type:"radio",name:u,checked:a===m,onChange:()=>{E&&!n.current?c(s[a].start):l(a)},onClick:()=>{n.current&&o(true)},onKeyDown:d=>{n.current=false,d.key==="Enter"&&(d.preventDefault(),l(a),o(true))}}),t("span",{className:"clover-cue-time",children:L(r.start)})," ",t("span",{className:"clover-cue-text",...b(r.lang||void 0),children:r.label}),a===m&&t(A,{source:P(r),request:h,large:true})]},r.id??a))}),i.node]})};export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./shared-
|
|
1
|
+
import{u as o}from"./shared-D2pvbPvF.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-Bf3qmdsh.mjs";function s({open:e=false,className:r}){return o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:i("clover-chevron",r),"data-open":e||void 0,children:o("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export{s as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as r,u as a,l as v}from"./shared-
|
|
1
|
+
import{t as r,u as a,l as v}from"./shared-D2pvbPvF.mjs";import x from"./ControlMenu-ej-Kpb31.mjs";import{m as C}from"./layout-DQtgCOJJ.mjs";import{u as z}from"./useContainerName-BfU0IozO.mjs";import"./styles-Bf3qmdsh.mjs";const P=({id:m,triggerId:u,label:b,labelLang:g,choices:i,selections:h,onSelect:y,onClose:f,language:s})=>{const d=z(b,g),N=i.some(e=>!r(e.label,s).text);return a(x,{"data-testid":"clover-canvas-choice",id:m,onClose:f,triggerId:u,children:[N&&d.node,i.map((e,k)=>{const t=r(e.label,s);return a("fieldset",{...t.text?{}:d.props,className:"clover-canvas-menu-group",children:[t.text&&a("legend",{className:"clover-canvas-menu-legend",...v(t.lang),children:t.text}),e.items.map((l,n)=>{const o=r(l.label,s),c=o.text||(l.image?"":String(n+1)),p=!C(l);return a("label",{className:"clover-canvas-menu-item","data-disabled":p||void 0,children:[a("input",{type:"radio",name:`${m}-${k}`,"aria-label":c?void 0:String(n+1),checked:(h[e.key]??0)===n,disabled:p,onChange:()=>y(e.key,n)}),l.image&&a("img",{alt:"",className:"clover-canvas-menu-image",decoding:"async",loading:"lazy",src:l.image}),c&&a("span",{...v(o.text?o.lang:void 0),children:c})]},n)})]},e.key)})]})};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as I,e as $,a as j,b as A,c as u,J as H,y as S,u as o,l as T}from"./shared-
|
|
1
|
+
import{D as I,e as $,a as j,b as A,c as u,J as H,y as S,u as o,l as T}from"./shared-D2pvbPvF.mjs";import{I as q}from"./Items-DCRr750U.mjs";import{L as w}from"./Label-CVfL9bMO.mjs";import{Summary as x,Id as D,Homepage as J}from"./Primitives-DP2uwwcU.mjs";import{j as L}from"./classnames-DukgfdpI.mjs";import{t as p}from"./heading-Cjt0f-Eu.mjs";import"./styles-Bf3qmdsh.mjs";const G=I(function({headingLevel:r=3,className:v,...b},d){const{clover:n}=$("Collection"),{t:f,langOf:g}=j(),i=A(),a=u(e=>e.collection),l=u(e=>H(e.manifest));S(()=>{!a&&(l!=null&&l.id)&&n.openCollection(l.id)},[n,a,l]);const t=a??l;if(!t)return null;const s=t.homepage,c=p(r,`${i}-label`),m=(e,C)=>{const{as:h,title:y,group:N}=p(r,`${i}-${e}`);return o("section",{className:"clover-about-section",...N,children:[o(h,{className:"clover-about-heading",...T(g(e)),...y,children:f(e)}),C]})};return o("div",{ref:d,className:L("clover-about clover-collection",v),...t.label?c.group:null,...b,children:[o(w,{as:c.as,label:t.label,className:"clover-collection-title clover-title",...c.title}),o(x,{value:t.summary,className:"clover-about-summary"}),o(q,{of:"members",layout:"list"}),Array.isArray(s)&&s.length>0&&m("aboutHomepage",o(J,{value:s})),m("aboutCollection",o(D,{value:t.id}))]})});export{G as Collection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,t as h,u as r,l as S}from"./shared-
|
|
1
|
+
import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,t as h,u as r,l as S}from"./shared-D2pvbPvF.mjs";import{i as N}from"./items-CKMFXz0W.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-Bf3qmdsh.mjs";const j=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),B=100,z=C(function({onChange:s,className:y,...A},E){const{t:P,langOf:D}=k(),{clover:T,language:u}=I("CollectionSelect"),t=v(e=>e.collection),n=v(e=>{var l;return((l=e.manifest)==null?void 0:l.id)??""}),f=K(),[c,i]=L(null);w(()=>i(null),[n,t]);const d=b(-1/0),o=b(null);w(()=>{o.current=null},[n,t]);const p=e=>{!e||e===n||e===o.current||(o.current=e,s==null||s(e),T.goToManifest(e).finally(()=>{o.current===e&&(o.current=null)}))},m=()=>c===null||c===n||c===o.current?false:(i(null),true),g=N(t);if(g.length<2)return null;const a=h(t==null?void 0:t.label,u);return r("div",{ref:E,className:U("clover-collection-select",y),...A,children:[r("label",{htmlFor:`${f}-select`,className:"clover-collection-select-label",...S(a.text?a.lang:D("collectionLabel")),children:a.text||P("collectionLabel")}),r("select",{id:`${f}-select`,className:"clover-collection-select-control",value:c??n,onKeyDown:e=>{const{key:l}=e;l==="Enter"?p(c):l==="Escape"?m()&&e.preventDefault():(j.has(l)||l.length===1&&!e.ctrlKey&&!e.metaKey)&&(d.current=performance.now())},onBlur:m,onChange:e=>{const l=e.target.value;i(l),performance.now()-d.current>B&&p(l)},children:g.map(e=>{const l=h(e.label,u);return r("option",{value:e.id,...S(l.text?l.lang:void 0),children:l.text||e.id},e.id)})})]})});export{z as CollectionSelect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as me,C as P,c as l,A as d,d as be,y as q,T as R,O as Se,q as f,ar as u,u as we,as as Ie,at as Ae,au as Ce,N as xe,o as Le,av as ke}from"./shared-D2pvbPvF.mjs";import{C as ye}from"./CanvasView-CiP25Iqc.mjs";import{u as Oe,a as Pe}from"./fromManifest-DqCyZd2Q.mjs";import{j as z,k as qe}from"./layout-DQtgCOJJ.mjs";import{s as Re}from"./show-link-D9bByIzf.mjs";import{b as Te,a as Be,e as je,f as De}from"./hooks-Bo5GjPGX.mjs";const ze=({options:i,onReady:T,onViewportChange:p,onMediaElement:m,onCaptionChange:I,caption:B,onEnded:b,placeholder:F=true,label:G,partOf:J,language:Q,annotations:A,chapters:W,...v})=>{const C=me("Canvas"),{clover:a}=C,X=P(a.captions.subscribe,a.captions.get,a.captions.get),Y=B??X,j=Q??C.language,c=Te(),Z=l(e=>ke(e.manifest,e.canvasId)),{direction:_}=Be(),n=je(),o=De(),E=l(e=>{var t;return e.status==="loading"?"loading":((t=e.manifest)==null?void 0:t.id)??""}),S=l(e=>e.target),D=l(e=>Ie(e.manifest,e.addedSets,e.search.set,e.regions)),ee=l(e=>Ce(e.manifest,e.addedSets,e.hiddenSets,e.shownSets,!!xe(e.manifest))),ae=l(e=>Le(e.manifest,e.addedSets,e.hiddenSets,e.shownSets)),x=l(e=>e.annotationId),H=d(x);H.current=x;const[te,ne]=be(0);q(()=>a.found.subscribe(e=>{e&&e===H.current&&ne(t=>t+1)}),[a]);const se=P(a.highlight.subscribe,a.highlight.get,a.highlight.get),ce=P(a.chapter.subscribe,a.chapter.get,a.chapter.get),h=c.map(e=>e.id).join("|"),ie=R(()=>{if(A)return A;const e=c.map(t=>t.id);return D.flatMap(t=>t.entries.filter(s=>e.includes(s.canvasId)).map(s=>({annotation:s.annotation,targetIndex:e.indexOf(s.canvasId),pageId:t.id,...t.label?{pageLabel:t.label}:{},...s.place?{place:s.place}:{},...s.layer?{layer:{key:s.layer.key,item:s.layer.item}}:{}})))},[A,D,c]),oe=S?(e=>!!e&&c.some(t=>t.id===e))(S.canvasId):false,M=d(null);oe&&(M.current=h);const re=F&&M.current!==h,L=d(null),k=d(null),y=R(()=>c.some(e=>z(e).length>0),[c]),g=y?c.find(e=>z(e).length>0):void 0,le=Oe(n,g,j,Ae),N=d(y);N.current=y;const O=B===void 0?C.language:void 0,de=g==null?void 0:g.id;q(()=>{if(!O||!g)return;const e=qe(g).find(t=>t.language&&Se(t.language,O));e&&a.captions.get()!==e.id&&a.captions.emit(e.id)},[O,de,a]);const r=f(()=>{const e=a.store.get().target;!e||!a.store.get().canvasId||Pe(e,L.current,k.current,N.current)&&a.consumeTarget()},[a]),K=d(h);q(()=>{K.current!==h&&(K.current=h,k.current=null),S&&r()},[S,h,r]);const w=d(T);w.current=T;const ue=f(e=>{var t;L.current=e,e.on("change",r),r(),(t=w.current)==null||t.call(w,e)},[r]),he=f(e=>{var s;const t=(s=L.current)==null?void 0:s.getCanvasRegion();a.viewport.emit(t?{canvasId:t.canvasId,region:{x:t.rect.x,y:t.rect.y,w:t.rect.width,h:t.rect.height}}:null),p==null||p(e)},[a,p]),ge=f(e=>{k.current=e,a.media.emit(e),e&&r(),m==null||m(e)},[a,r,m]),fe=f(()=>{b==null||b(),(u(n,"auto-advance")||u(o,"auto-advance"))&&a.next({autoplay:true,wrap:u(n,"repeat")})},[a,n,o,b]),ve=f(e=>void Re(a,e),[a]),U=(i==null?void 0:i.request)??a.request,V=u(o,"auto-advance")||u(n,"auto-advance"),$=u(o,"repeat")||u(n,"repeat"),pe=R(()=>({...i,request:U,animation:(i==null?void 0:i.animation)??{autoplay:V,loop:$}}),[i,U,V,$]);return c.length?we(ye,{...v,manifestId:E,navPlace:n==null?void 0:n.navPlace,canvases:c,ahead:Z,viewingDirection:_,language:j,label:G??(o==null?void 0:o.label)??(n==null?void 0:n.label),partOf:J??(n==null?void 0:n.label),options:pe,placeholder:re,onReady:ue,onViewportChange:he,onMediaElement:ge,caption:Y,onCaptionChange:e=>{a.captions.emit((e==null?void 0:e.id)??null),I==null||I(e)},onEnded:fe,annotations:ie,hiddenPages:ae,unlistedPages:ee,onPageVisibilityChange:(e,t)=>e.forEach(s=>a.setSetVisible(s,t)),chapters:W??le,highlightedChapter:ce,onChapterHighlight:e=>a.chapter.emit(e),selectedAnnotation:x,refind:te,highlightedAnnotation:se,onAnnotationSelect:e=>a.selectAnnotation(e),onAnnotationLink:v.onAnnotationLink??ve,onAnnotationActive:e=>{var t;a.highlight.emit(e),(t=v.onAnnotationActive)==null||t.call(v,e)}}):null};export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as v,c as u,y as S,T as b,u as C}from"./shared-
|
|
1
|
+
import{e as v,c as u,y as S,T as b,u as C}from"./shared-D2pvbPvF.mjs";import{S as q}from"./SceneView-DykQJepG.mjs";import{b as w,e as x}from"./hooks-Bo5GjPGX.mjs";function M({label:i,language:d,options:t,...f}){const r=v("Scene"),{clover:s}=r,e=w().find(n=>n.type==="Scene"),a=x(),g=u(n=>{var o;return n.status==="loading"?"loading":((o=n.manifest)==null?void 0:o.id)??""}),c=u(n=>n.target);S(()=>{c&&e&&c.canvasId===e.id&&s.consumeTarget()},[c,e,s]);const l=(t==null?void 0:t.request)??s.request,m=b(()=>({...t,request:l}),[t,l]);return e?C(q,{...f,scene:e,manifestId:g,label:i??e.label??(a==null?void 0:a.label),language:d??r.language,options:m}):null}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./shared-
|
|
1
|
+
import{u as o}from"./shared-D2pvbPvF.mjs";import{p as a}from"./playerSurface-BLzwC0Ux.mjs";import n from"./Connected-BWomgzfE.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{b as m}from"./hooks-Bo5GjPGX.mjs";function v({className:e,...r}){return m().some(i=>i.type==="Timeline")?o(n,{...r,className:t("clover-timeline",e),navigator:false,surface:a}):null}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as W,a as X,e as Y,c as $,K as Z,C as O,d as N,b as _,T as tt,A as et,y as B,u as o,t as rt,l as k,k as st,v as nt,L as j,E as at,M as A}from"./shared-
|
|
1
|
+
import{D as W,a as X,e as Y,c as $,K as Z,C as O,d as N,b as _,T as tt,A as et,y as B,u as o,t as rt,l as k,k as st,v as nt,L as j,E as at,M as A}from"./shared-D2pvbPvF.mjs";import{imageSource as it}from"./thumbnail-By5wfGlE.mjs";import{j as ot}from"./classnames-DukgfdpI.mjs";import{C as ct}from"./Chevron-CH8yyEDi.mjs";import{E as lt}from"./EntryThumbnail-BnMLzy5M.mjs";import{S as ut}from"./Steps-BTAJ3lc6.mjs";import{C as dt}from"./Cue-BhXRUDe9.mjs";import{u as mt}from"./useContainerName-BfU0IozO.mjs";import"./styles-Bf3qmdsh.mjs";const Nt=W(function({as:d="nav",className:n,...u},h){const{t:p,langOf:c}=X(),{clover:s,language:F}=Y("Contents"),x=mt(p("informationPanelTabsContents"),c("informationPanelTabsContents"),u["aria-label"]!==void 0||u["aria-labelledby"]!==void 0),f=$(e=>Z(e.manifest)),T=$(e=>e.canvasId),z=$(e=>e.annotationId),S=O(s.media.subscribe,s.media.get,s.media.get),[D,w]=N(null),v=gt(f,T,S,D),H=O(s.chapter.subscribe,s.chapter.get,s.chapter.get),K=_(),C=tt(()=>pt(f,v),[f,v]),[U,L]=N(()=>new Map),M=et(new Set);B(()=>{const e=[...C].filter(r=>!M.current.has(r));M.current=C,L(r=>{if(!e.some(t=>r.has(t)))return r;const i=new Map(r);return e.forEach(t=>i.delete(t)),i})},[C]);const[b,G]=N();if(!f.length)return null;const J=e=>U.get(e.id)??C.has(e.id),P=(e,r)=>{var m,l;const i=(m=e.parts)==null?void 0:m[r];if(!i)return;G({node:e.id,index:r}),w(e.id);const t=A(e.id,r);i.region&&((l=s.store.get().regions)!=null&&l.entries.some(a=>a.id===t))?s.selectAnnotation(t):s.goTo(i.canvasId,i.region?{region:i.region}:{})},Q=e=>{if(e.canvasId){if(w(e.id),e.parts){P(e,0);return}if(e.canvasId===T&&e.time&&S){at(S,e.time.start);return}s.goTo(e.canvasId,{...e.time?{time:e.time.start,autoplay:true}:{},...e.region?{region:e.region}:{}})}},R=(e,r)=>{var l;const i=r.findIndex((a,y)=>!!a.region&&A(e.id,y)===z),t=(b==null?void 0:b.node)===e.id&&((l=r[b.index])==null?void 0:l.canvasId)===T?b.index:-1,m=i>=0?i:t>=0?t:r.findIndex(a=>a.canvasId===T);return{position:m,total:r.length,step:a=>P(e,m+a)}},q=(e,r,i=false)=>o("ol",{className:"clover-contents-list",id:r,hidden:i,children:e.map((t,m)=>{const l=rt(t.label,F),a=r?`${r}-${m}`:`${K}-${m}`,y=t.children.length>0,I=y&&J(t),E=t.id===v?it(t.thumbnail):null;return o("li",{className:"clover-contents-item",children:[o("div",{className:"clover-contents-row","data-current":t.id===v?"true":void 0,children:[o("button",{type:"button",id:`${a}-entry`,className:"clover-contents-button","data-trail":C.has(t.id)?"true":void 0,"aria-current":t.id===v?"true":void 0,"data-highlighted":t.id===H?"true":void 0,disabled:!t.canvasId,onMouseEnter:()=>s.chapter.emit(t.id),onMouseLeave:()=>s.chapter.emit(null),onFocus:()=>s.chapter.emit(t.id),onBlur:()=>s.chapter.emit(null),"data-timed":t.time?"true":void 0,"data-pictured":E?"true":void 0,...k(l.text&&!t.time&&!E?l.lang:void 0),onClick:()=>Q(t),children:t.time||E?o(st,{children:[t.time&&o(dt,{start:t.time.start,className:"clover-contents-time"}),o("span",{className:"clover-cue-text",...k(l.text?l.lang:void 0),children:l.text||t.id}),o(lt,{source:E,request:s.request,large:true})]}):l.text||t.id}),t.id===v&&t.parts&&t.parts.length>1&&o(ut,{className:"clover-contents-steps",steps:R(t,t.parts)}),y&&o("button",{type:"button",className:"clover-contents-toggle","aria-expanded":I,"aria-controls":`${a}-list`,"aria-labelledby":`${a}-toggle ${a}-entry`,onClick:()=>L(V=>new Map(V).set(t.id,!I)),children:[o("span",{id:`${a}-toggle`,style:nt,...k(c("contentsSectionsIn")),children:p("contentsSectionsIn")}),o(ct,{open:I,className:"clover-contents-chevron"})]})]}),y&&q(t.children,`${a}-list`,!I)]},t.id)})});return o(d,{ref:h,...x.props,className:ot("clover-contents",n),...u,children:[x.node,q(f)]})});function pt(g,d){const n=new Set;if(!d)return n;const u=(h,p)=>h.some(c=>c.id===d?(p.forEach(s=>n.add(s)),true):u(c.children,[...p,c.id]));return u(g,[]),n}function gt(g,d,n,u){const[h,p]=N(()=>j(g,d,void 0,u));return B(()=>{const c=()=>p(j(g,d,n==null?void 0:n.currentTime,u));if(c(),!!n)return n.addEventListener("timeupdate",c),n.addEventListener("seeked",c),()=>{n.removeEventListener("timeupdate",c),n.removeEventListener("seeked",c)}},[g,d,n,u]),h}export{Nt as Contents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as k,
|
|
1
|
+
import{A as k,ah as L,_ as T,y as x,u as S}from"./shared-D2pvbPvF.mjs";import{j as B}from"./classnames-DukgfdpI.mjs";import"./styles-Bf3qmdsh.mjs";const j=({id:l,triggerId:c,onClose:o,"data-testid":u,className:m,holds:r,inside:f=false,children:h})=>{const i=k(null);return L(true,()=>o(false)),T(()=>{const t=i.current;t&&f&&M(t)},[f]),x(()=>{const t=i.current,s=(t==null?void 0:t.querySelector('input[type="radio"]:checked'))??(t==null?void 0:t.querySelector('input[type="radio"]:not(:disabled)'))??(t==null?void 0:t.querySelector("input"))??(t==null?void 0:t.querySelector('[role="option"][tabindex="0"]')),d=s==null?void 0:s.closest('label, [role="option"]');if(t&&d){const n=d.offsetTop+d.offsetHeight;n>t.scrollTop+t.clientHeight&&(t.scrollTop=n-t.clientHeight),d.offsetTop<t.scrollTop&&(t.scrollTop=d.offsetTop)}s==null||s.focus({preventScroll:true});const y=n=>{var a,v,p;const e=n.target;(a=i.current)!=null&&a.contains(e)||(v=document.getElementById(c))!=null&&v.contains(e)||e&&((p=r==null?void 0:r())!=null&&p.contains(e))||o(false)},E=n=>{var p,w;if(n.key!=="Escape")return;const e=document.activeElement;if(!!((p=i.current)!=null&&p.contains(e)||(w=document.getElementById(c))!=null&&w.contains(e))){n.preventDefault(),o(true);return}const v=b=>{b===n&&!n.defaultPrevented&&o(false)};document.addEventListener("keydown",v,{once:true})},g=n=>{var a;const e=n.target;e!=null&&e.closest(".clover-canvas-viewport")&&((a=i.current)!=null&&a.contains(e)||o(false))};return document.addEventListener("pointerdown",y),document.addEventListener("keydown",E,true),document.addEventListener("focusin",g),()=>{document.removeEventListener("pointerdown",y),document.removeEventListener("keydown",E,true),document.removeEventListener("focusin",g)}},[c,o,r]),S("div",{className:B("clover-canvas-menu",m),"data-testid":u,id:l,ref:i,children:h})};function M(l){const c=l.getBoundingClientRect();let o=0,u=document.documentElement.clientWidth;for(let r=l.parentElement;r;r=r.parentElement){if(getComputedStyle(r).overflowX==="visible")continue;const f=r.getBoundingClientRect();o=Math.max(o,f.left),u=Math.min(u,f.right);break}const m=Math.max(o-c.left,Math.min(0,u-c.right));m&&(l.style.translate=`${m}px 0`)}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as l}from"./shared-D2pvbPvF.mjs";import{u}from"./useControlsVisibility-pU1JVIpK.mjs";function f({element:i,hideDelay:r,picture:s,onChange:o}){const t=u(i,r,s);return l(()=>o(t),[t,o]),null}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as f,d as C,A as b,q as u,u as e,l as k,v as N,P as x,z as y}from"./shared-
|
|
1
|
+
import{a as m,b as f,d as C,A as b,q as u,u as e,l as k,v as N,P as x,z as y}from"./shared-D2pvbPvF.mjs";import"./styles-Bf3qmdsh.mjs";const I=y(()=>import("./ControlMenu-ej-Kpb31.mjs"));function q({position:n,total:o,list:p}){const{t:h,langOf:v}=m(),r=`${f().replace(/:/g,"")}-count`,s=`${r}-menu`,[a,c]=C(false),i=b(null),g=u(()=>{var l;return(l=i.current)==null?void 0:l.closest(".clover-pager")},[]),t=u(l=>{var d;c(false),l&&((d=document.getElementById(r))==null||d.focus())},[r]);return e("span",{className:"clover-pager-count",ref:i,children:[e("button",{type:"button",id:r,className:"clover-pager-count-button","aria-controls":a?s:void 0,"aria-expanded":a,onClick:()=>c(!a),children:[e("span",{className:"clover-pager-position","aria-live":"polite",children:[e("span",{"aria-hidden":n>=0||void 0,children:[n>=0?n+1:"\u2013"," / ",o]}),n>=0&&e("span",{style:N,...k(v("canvasPosition")),children:h("canvasPosition",{index:n+1,total:o})}),e("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[o," / ",o]})]}),e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",children:e("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a&&e(x,{fallback:null,children:e(I,{id:s,triggerId:r,onClose:t,holds:g,inside:true,className:"clover-pager-menu",children:e("div",{className:"clover-collection clover-pager-list",children:p(()=>t(true))})})})]})}export{q as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as m,an as o}from"./shared-D2pvbPvF.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-Bf3qmdsh.mjs";function s({start:r,className:e}){return m("span",{className:i("clover-cue-time",e),children:o(r)})}export{s as C};
|