react-iiif-vault 1.5.5 → 1.5.6
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/bundle.d.ts +1 -1
- package/dist/bundle.global.js +18 -18
- package/dist/canvas-panel.cjs +5 -5
- package/dist/canvas-panel.d.cts +1 -1
- package/dist/canvas-panel.d.ts +1 -1
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-H3DSFUR2.js +48 -0
- package/dist/{index-CMSk5Jbz.d.cts → index-BJveLrlu.d.cts} +1 -1
- package/dist/{index-CWeYvmxZ.d.ts → index-CrfymD6m.d.ts} +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-XMMNKWGN.js +0 -48
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as Oo,$a as ye,A as ho,Aa as hr,B as yo,Ba as yr,C as vo,Ca as vr,D as xo,Da as xr,E as So,Ea as Sr,F as bo,Fa as br,G as Co,Ga as Cr,H as Io,Ha as Ir,I as ko,Ia as kr,J as Po,Ja as Pr,K as wo,Ka as wr,L as Ro,La as Rr,M as To,Ma as Tr,N as Eo,Na as Er,O as No,Oa as Nr,P as Bo,Pa as Br,Q as Mo,Qa as Mr,R as Lo,Ra as Lr,S as Ho,Sa as M,T as Ao,Ta as ge,U as se,Ua as Hr,V as zo,Va as Ar,W as qo,Wa as zr,X as le,Xa as qr,Y as Wo,Ya as Wr,Z as Do,Za as Dr,_ as Fo,_a as he,a as Zt,aa as $o,ab as Fr,b as q,ba as Vo,bb as Or,c as L,ca as Ko,cb as $r,d as jt,da as Uo,db as Vr,e as eo,ea as Xo,eb as Kr,f as to,fa as Yo,fb as Ur,g as re,ga as ce,gb as Xr,h as oo,ha as F,hb as Yr,i as ro,ia as _o,ib as _r,j as ne,ja as Q,jb as Qr,k as P,ka as w,kb as Gr,l as W,la as me,lb as Jr,m as no,ma as Qo,mb as Zr,n as ie,na as Go,nb as ve,o as D,oa as Jo,p as io,pa as Zo,q as ao,qa as ir,r as so,ra as ue,s as lo,sa as ar,t as co,ta as de,u as mo,ua as fe,v as uo,va as pe,w as ae,wa as O,x as fo,xa as sr,y as po,ya as pr,z as go,za as gr}from"./chunk-XMMNKWGN.js";import{a as jo,b as er,c as tr,d as or,e as rr,f as nr,g as lr,h as cr,i as mr,j as ur,k as dr,l as fr}from"./chunk-XNDN34SQ.js";import{useCanvas as Ye}from"@atlas-viewer/atlas";import{forwardRef as _e,useImperativeHandle as Qe}from"react";import{Fragment as Ge,jsx as xe}from"react/jsx-runtime";var nn=_e(function({canvasId:t},o){let r=Ye(),n=ue(t||r?.id),a=P();return Qe(o,()=>n,[t,r]),!r||n.enabledPageIds.length===0?null:xe(Ge,{children:n.enabledPageIds.map(s=>xe(ve.RenderAnnotationPage,{page:a.get(s)},s))})});import{useMemo as je}from"react";import{useMemo as Je}from"react";import{Fragment as Ze,jsx as I,jsxs as $}from"react/jsx-runtime";function V({metadata:e=[],config:t,labelWidth:o=16,showEmptyMessage:r=!0,allowHtml:n,emptyFallback:a,classes:s={},emptyMessage:l="No metadata available",emptyValueFallback:u="No value",emptyLabelFallback:d="",separator:c,tableFooter:p,tableHeader:S}){let b=Je(()=>{let h=(t||[]).reduce((f,g)=>[...f,...g.keys],[]),m={};for(let f of e){let g=f&&f.label?Object.values(f.label):[];for(let i of g)if(i&&i.length&&(h.indexOf(`metadata.${i[0]}`)!==-1||h.length===0)&&f){let y=`metadata.${i[0]}`;m[y]=m[y]?m[y]:[],m[y].push(f);break}}return m},[t,e]);return Object.keys(b).length===0&&r?I(Ze,{children:a})||I("div",{className:s.empty,children:l}):t&&t.length?$("table",{className:s.container,children:[S,I("tbody",{children:t.map((h,m)=>{let f=[];for(let g of h.keys)for(let i of b[g]||[])f.push(I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:i.value},m+"__"+g));return f.length===0?null:$("tr",{className:s.row,children:[I("td",{className:s.label,style:o?{minWidth:o}:{},children:I(M,{enableDangerouslySetInnerHTML:n,separator:c,defaultText:d,children:h.label})}),I("td",{className:s.value,children:f})]},m)})}),p]}):$("table",{className:s.container,children:[S,I("tbody",{children:e&&e.length?e.map((h,m)=>h?$("tr",{className:s.row,children:[I("td",{className:s.label,style:o?{minWidth:o}:{},children:I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:h.label})}),I("td",{className:s.value,children:I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:h.value})})]},m):null):null}),p]})}import{jsx as et}from"react/jsx-runtime";function vn(e){let t=D(),o=w(),r=ae(),n=je(()=>{let a=t?.metadata||[],s=o?.metadata||[],l=r?.metadata||[];return[...a,...s,...l]},[t,o,r]);return et(V,{metadata:n,...e})}import{useEffect as nt,useState as it}from"react";import{createImageServiceRequest as tt,imageServiceRequestToString as ot}from"@iiif/parser/image-3";import{useMemo as rt}from"react";function G(e,t={},o=[]){return rt(()=>{if(!e)return null;let r=t.quality;e&&e.extraQualities&&t.quality&&(e.extraQualities.includes(t.quality)||(r="default"));let n=tt(e);return ot({identifier:n.identifier,server:n.server,scheme:n.scheme,type:"image",size:{max:!t.size?.width&&!t.size?.height,confined:!1,upscaled:!1,...t.size||{}},format:t.format||"jpg",region:t.region||{full:!0},rotation:t?.rotation?Number.isInteger(t.rotation)?{angle:t.rotation}:t.rotation:{angle:0},quality:r||"default",prefix:n.prefix,originalPath:n.originalPath})},[...o])}import{jsx as K}from"react/jsx-runtime";function at(e){let t=typeof e.src=="string"?e.src:e.src.id,o=he(),[r,n]=it(!1),a;if(t){let l=o.loadServiceSync({id:t});l&&(a=l)}!a&&!r&&o.loadService({id:t}).then(()=>{n(!0)});let s=G(a,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[r,e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return nt(()=>()=>{n(!1)},[t]),s?K("img",{src:s,alt:e.alt,className:e.className,style:e.style}):K(st,{...e,fetchImageService:!1})}function st(e){if(e.fetchImageService)return K(at,{...e});let t=typeof e.src=="string"?{id:e.src,profile:"level0"}:e.src,o=G(t,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return o?K("img",{src:o,alt:e.alt,className:e.className,style:e.style}):null}import{jsx as lt}from"react/jsx-runtime";function Hn(e){let t=D();return lt(V,{metadata:t?.metadata||[],...e})}import{useLayoutEffect as ft,useRef as pt}from"react";import*as J from"react-lazy-load-image-component";import{getValue as ct}from"@iiif/helpers/i18n";import{Fragment as Se,jsx as R,jsxs as dt}from"react/jsx-runtime";var{LazyLoadComponent:mt}=J||J.default;function be(e){let{size:t,visible:o,classes:r,canvasId:n,figure:a}=e,s=t?.width||128,l=t?.height||t?.width||128,u=R(ut,{...e}),d=R(mt,{threshold:300,style:{height:l,width:s},visibleByDefault:o,children:n?R(ne,{canvas:n,children:u}):u});return a?R("figure",{className:r?.figure,children:d}):d}function ut({fallback:e,size:t,classes:o,showLabel:r,alt:n,dereference:a=!1}){let s=w(),l=t?.width||128,u=t?.height||t?.width||128,d=n||ct(s?.label)||"",c=ye({width:l,height:u,allowUnsafe:!0},a);return!c||c.type!=="fixed"?R(Se,{children:e}):dt(Se,{children:[R("div",{className:o?.imageWrapper,children:R("img",{className:o?.img,src:c.id,alt:d})}),r?R(M,{as:"figcaption",className:o?.label,children:s?.label}):null]})}import{jsx as H}from"react/jsx-runtime";function Yn({scrollBehaviour:e,dereference:t,flat:o,size:r,classes:n={},showLabel:a,figure:s,fallback:l}){let u=pt(null),{items:d,sequence:c,currentSequenceIndex:p,setSequenceIndex:S}=se(),b={row:n.selected?.row||n.row,item:n.selected?.item||n.item,figure:n.selected?.figure||n.figure,img:n.selected?.img||n.img,label:n.selected?.label||n.label,imageWrapper:n.selected?.imageWrapper||n.imageWrapper};ft(()=>{if(!u.current)return;let h=u.current.querySelector("[data-selected=true]");h&&h.scrollIntoView({behavior:e||"instant",block:"nearest",inline:"center"})},[p]);let C=[];for(let h of c){let m=[],f=c[p]===h;for(let g of h){let i=d[g];m.push(H("div",{className:f?b.item:n.item,children:H(be,{classes:f?b:n,canvasId:i.id,size:r,dereference:t,showLabel:a,figure:s,placeholder:H("div",{style:{height:128,width:128}}),fallback:l})},g))}if(o){C.push(m);continue}C.push(H("div",{onClick:g=>{S(c.indexOf(h))},"data-selected":f,className:f?b.row:n.row,children:m},h.join("-")))}return H("div",{ref:u,className:n.container,children:C})}import{Fragment as Ce,jsx as T,jsxs as Ie}from"react/jsx-runtime";var gt={draw:!0,polygon:!0,line:!0,lineBox:!0,square:!0,triangle:!0,hexagon:!0,circle:!0,delete:!0};function Gn({helper:e,showShapes:t,state:o,enabled:r=gt,classNames:n={},icons:a={}}){return Ie(Ce,{children:[t?Ie(Ce,{children:[r.draw&&T("button",{className:n.button,onClick:()=>{e.stamps.clear(),e.draw.enable()},"data-active":!o.lineMode&&!o.selectedStamp&&t&&o.drawMode,children:a.DrawIcon||"Draw"}),r.polygon&&T("button",{className:n.button,"data-active":!o.lineMode&&!o.selectedStamp&&t&&!o.drawMode,onClick:()=>{e.stamps.clear(),e.draw.disable(),e.modes.disableLineBoxMode(),e.modes.disableLineMode()},children:a.PolygonIcon||"Polygon"}),r.line&&T("button",{className:n.button,"data-active":o.lineMode&&!o.lineBoxMode,onClick:()=>{e.modes.enableLineMode()},children:a.LineIcon||"Line"}),r.lineBox&&T("button",{className:n.button,"data-active":o.lineBoxMode,onClick:()=>{e.modes.enableLineBoxMode()},children:a.LineBoxIcon||"LineBox"}),r.square&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="square",onClick:()=>{e.stamps.square()},children:a.SquareIcon||"Square"}),r.triangle&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="triangle",onClick:()=>{e.stamps.triangle()},children:a.TriangleIcon||"Triangle"}),r.hexagon&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="hexagon",onClick:()=>{e.stamps.hexagon()},children:a.HexagonIcon||"Hexagon"})]}):null,o.showBoundingBox&&r.delete&&T("button",{className:n.button,onClick:()=>e.key.down("Backspace"),children:a.DeleteForeverIcon||"Delete"})]})}import{createContext as ht,useCallback as ke,useContext as we,useEffect as Pe,useMemo as Z,useState as yt}from"react";import Re from"mitt";import{jsx as vt}from"react/jsx-runtime";var U=ht(Re());U.displayName="SelectorHelper";function ni({children:e}){return vt(U.Provider,{value:Z(()=>Re(),[]),children:e})}function ii(){return we(U)}function Te(e){let t=Ee(),[o,r]=yt(!1);Pe(()=>t.withSelector(e).on("highlight",()=>{r(!0)}),[t,e]),Pe(()=>t.withSelector(e).on("clear-highlight",()=>{r(!1)}),[t,e]);let n=ke(s=>{t.emit("click",{selectorId:e,event:s})},[e,t]),a=ke(s=>{t.emit("hover",{selectorId:e,event:s})},[e,t]);return{controller:t,onClick:n,onHover:a,isHighlighted:o}}function Ee(){let e=we(U);return Z(()=>({withSelector(t){return{on(o,r){let n=a=>{a&&a.selectorId===t&&r(a)};return e.on(o,n),()=>{e.off(o,n)}},emit(o,r){e.emit(o,{...r,selectorId:t})}}},on(t,o){return e.on(t,o),()=>{e.off(t,o)}},emit(t,o){e.emit(t,o)}}),[e])}function ai(){let e=Ee();return Z(()=>({withSelector(t){return{highlight(){e.emit("highlight",{selectorId:t})},clearHighlight(){e.emit("clear-highlight",{selectorId:t})},zoomTo(){e.emit("zoom-to",{selectorId:t})},addEventListener(o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(o,r){return e.withSelector(t).on(o,r)}}},highlight(t){e.emit("highlight",{selectorId:t})},clearHighlight(t){e.emit("clear-highlight",{selectorId:t})},zoomTo(t){e.emit("zoom-to",{selectorId:t})},addEventListener(t,o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(t){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(t,o){return e.on(t,o)}}),[e])}import{createContext as xt,useContext as St,useMemo as bt}from"react";import{jsx as Ct}from"react/jsx-runtime";function Ne(){return{default:{backgroundColor:"rgba(0,0,0,0)",borderWidth:"2px",borderColor:"rgba(252,0,98, .5)"},highlighted:{backgroundColor:"rgba(75, 103, 225, 0.4)",borderWidth:"1px",borderColor:"rgba(75,103,225,0.99)"},hidden:{borderWidth:"0px",borderColor:"rgba(0,0,0,0)",backgroundColor:"rgba(0,0,0,0)",hidden:!0}}}var j=xt(Ne());j.displayName="AnnotationStyle";function Be(){return St(j)}function mi({theme:e,children:t}){let o=bt(()=>e||Ne(),[e]);return Ct(j.Provider,{value:o,children:t})}import{HTMLPortal as Tt,useAtlas as Et}from"@atlas-viewer/atlas";import{useEffect as Le,useRef as E,useState as He}from"react";import{useEffect as It,useMemo as kt,useState as Pt}from"react";import{createHelper as wt}from"polygon-editor";function Me(e,t,o){let[r,n]=Pt({}),a=kt(()=>wt(e,o),[]);return It(()=>(a.clock.start(t,n),()=>{a.clock.stop()}),[]),{state:r,helper:a}}import{createSvgHelpers as Rt}from"polygon-editor";import{Fragment as Ae,jsx as x,jsxs as ze}from"react/jsx-runtime";var N=Rt();function qe(e,t){let{image:o,currentShape:r,onChange:n,hideShapeLines:a}=e,s=E(),l=E(),u=E(),d=E(),c=E(),p=E(),S=E(),b=E(),[C,h]=He(null),[m,f]=He(!1),{helper:g,state:i}=Me(r,(v,k)=>{N.updateTransitionBoundingBox(l.current,v,k),N.updateBoundingBoxPolygon(s.current,v,k),N.updateTransitionShape(p.current,v,k),N.updateClosestLinePointTransform(d.current,v,k),N.updateSelectBox(u.current,v,k),N.updatePointLine(S.current,v,k),N.updateDrawPreview(c.current,v,k,3),N.updateLineBox(b.current,v),h(v.transitionDirection),f(v.transitionRotate)},n);Le(()=>{g.setShape(r||null)},t),Le(()=>{let v=()=>{g.modifiers.reset()};return document.addEventListener("mouseleave",v),()=>{document.removeEventListener("mouseleave",v)}},[]);let y=ze(Ae,{children:[x("marker",{id:"dot",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("circle",{cx:"5",cy:"5",r:"4",className:"marker"})}),x("marker",{id:"selected",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("circle",{cx:"5",cy:"5",r:"4",fill:"#FAFF00"})}),x("marker",{id:"resizer",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("rect",{width:"10",height:"10",stroke:"#FF0DCB",fill:"#fff",strokeWidth:2})})]}),B=r?r.open?"polyline":"polygon":null,oe=!i.showBoundingBox&&i.closestPoint!==null&&i.actionIntentType==="select-point",Ke=i.actionIntentType==="add-open-point",Ue=i.transitionIntentType==="split-line",_=i.transitioning&&i.selectedStamp&&i.transitionIntentType==="stamp-shape",Xe=r&&B?ze(Ae,{children:[x(B,{fill:!i.transitioning&&i.showBoundingBox?"rgba(255, 0, 0, .5)":"none",strokeWidth:_?0:2,stroke:a?"transparent":"#000",points:r.points.map(v=>v.join(",")).join(" "),vectorEffect:"non-scaling-stroke",markerStart:i.showBoundingBox?void 0:"url(#dot)",markerMid:i.showBoundingBox?void 0:"url(#dot)",markerEnd:i.showBoundingBox?void 0:"url(#dot)",style:{pointerEvents:"none"}}),i.lineBoxMode&&i.actionIntentType==="close-line-box"?x("polygon",{fill:"rgba(255, 0, 0, .4)",ref:b,stroke:"#000",strokeWidth:2,vectorEffect:"non-scaling-stroke"}):null,i.transitionIntentType==="draw-shape"&&i.transitioning?x("polyline",{ref:c,fill:"none",stroke:"rgba(255, 0, 0, .5)",strokeWidth:2,vectorEffect:"non-scaling-stroke"}):null,!i.showBoundingBox&&i.selectedPoints&&i.selectedPoints.length?x("polyline",{strokeWidth:2,vectorEffect:"non-scaling-stroke",stroke:"transparent",markerStart:"url(#selected)",markerMid:"url(#selected)",markerEnd:"url(#selected)",fill:"transparent",points:r.points.filter((v,k)=>i.selectedPoints?.includes(k)).map(v=>v.join(",")).join(" ")}):null,oe&&i.closestPoint!==null&&r.points[i.closestPoint]?x("polyline",{strokeWidth:2,vectorEffect:"non-scaling-stroke",stroke:"transparent",markerStart:"url(#selected)",markerMid:"url(#selected)",markerEnd:"url(#selected)",fill:"transparent",points:`${r.points[i.closestPoint][0]},${r.points[i.closestPoint][1]}`}):null,!i.transitioning&&(i.actionIntentType==="add-open-point"||i.actionIntentType==="close-shape"||i.actionIntentType==="close-shape-line")?x("polyline",{stroke:"#000",ref:S,strokeWidth:i.actionIntentType==="close-shape"?2:1,vectorEffect:"non-scaling-stroke"}):null,i.hasClosestLine&&(!i.transitionIntentType||i.transitionIntentType==="split-line")?x("g",{ref:d,children:x("polyline",{style:{opacity:.5},markerStart:"url(#dot)",points:"0,0 10,10",vectorEffect:"non-scaling-stroke",fill:"transparent",strokeWidth:2})}):null,i.transitioning?x(B,{ref:p,fill:r.open?"none":"rgba(255, 0, 0, .5)",stroke:"rgba(255, 0, 0, .5)",strokeWidth:r.open?2:0}):null,i.transitioning&&i.transitionIntentType==="select-multiple-points"?x("rect",{ref:u,fill:"rgba(255, 255, 255, .3)",strokeWidth:1,stroke:"rgba(0,0,0,.2)",vectorEffect:"non-scaling-stroke"}):null,i.showBoundingBox?null:x("g",{name:"controls",children:!1}),i.showBoundingBox&&!_?x("polygon",{ref:s,strokeWidth:2,stroke:"#FF0DCB",fill:"none",markerStart:"url(#resizer)",markerMid:"url(#resizer)",markerEnd:"url(#resizer)",vectorEffect:"non-scaling-stroke"}):null]}):null;return{helper:g,state:i,isAddingPoint:Ke,isSplitting:Ue,isStamping:_,isHoveringPoint:oe,transitionDirection:C,transitionRotate:m,defs:y,editor:Xe}}import{useEffect as ee}from"react";import{createPortal as Nt}from"react-dom";import{Fragment as We,jsx as A,jsxs as X}from"react/jsx-runtime";var Bt=[{name:"Default",outer:{borderWidth:4,borderColor:"rgba(255, 255, 255, .4)"},inner:{borderWidth:2,borderColor:"#000"}},{name:"High contrast",outer:{borderWidth:3,borderColor:"#fff"},inner:{borderWidth:1,borderColor:"#000"}},{name:"Lightsaber",outer:{borderWidth:"4",borderColor:"rgba(56,68,255,0.64)"},inner:{borderWidth:"2",borderColor:"#fff"}},{name:"Bright",outer:{borderWidth:"6",borderColor:"#25d527"},inner:{borderWidth:"3",borderColor:"#a916ff"}},{name:"pink",outer:{borderWidth:"4",borderColor:"#ff00ff"},inner:{borderWidth:"2",borderColor:"#ffffff"}},{name:"fine (dark)",outer:{borderWidth:"1",borderColor:"#000000"},inner:{}},{name:"fine (light)",outer:{borderWidth:"1",borderColor:"#FFF"},inner:{}}];function De(e){let t=e.theme||Bt[0],o=Et(),{image:r}=e,{helper:n,defs:a,editor:s,state:l,transitionDirection:u,isSplitting:d,transitionRotate:c,isHoveringPoint:p,isAddingPoint:S,isStamping:b}=qe({currentShape:e.shape||null,onChange:e.updateShape,image:e.image,hideShapeLines:!0},[]),C=i=>{n.pointer([[~~i.atlas.x,~~i.atlas.y]])};ee(()=>{let i=y=>{n.key.up(y.key)};return document.addEventListener("keyup",i),()=>{document.removeEventListener("keyup",i)}},[]),ee(()=>{let i=y=>{n.key.down(y.key)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[]),ee(()=>{let i=[];return u&&i.push(`atlas-cursor-${u}`),l.actionIntentType==="cut-line"&&l.modifiers?.Shift&&i.push("atlas-cursor-cut"),(p||l.transitionIntentType==="move-shape"||l.transitionIntentType==="move-point")&&i.push("atlas-cursor-move"),S&&i.push("atlas-cursor-crosshair"),d&&i.push("atlas-cursor-copy"),c&&i.push("atlas-cursor-rotate"),l.transitionIntentType==="draw-shape"&&i.push("atlas-cursor-draw"),o?.canvas&&o.canvas.classList.add(...i),()=>{o?.canvas&&o.canvas.classList.remove(...i)}},[o?.canvas,S,p,d,l.modifiers?.Shift,l.actionIntentType,l.transitionIntentType,u,c]);let h=e.shape&&e.shape?.points.length===0,m=e.renderControls?e.renderControls(n,l,h):null,f=document.getElementById(e.controlsHtmlId||"atlas-controls"),g="shape";return A(We,{children:X("world-object",{height:r.height,width:r.width,onMouseMove:C,onMouseDown:n.pointerDown,onMouseUp:n.pointerUp,onMouseLeave:n.blur,children:[e.shape?X(We,{children:[A(g,{open:e.shape.open,points:e.shape.points,relativeStyle:!0,style:b?{}:t.outer}),A(g,{open:e.shape.open,points:e.shape.points,relativeStyle:!0,style:b?{}:t.inner})]}):null,X(Tt,{relative:!0,interactive:!1,children:[A("div",{style:{position:"absolute",top:0,right:0,left:0,bottom:0},children:X("svg",{width:"100%",height:"100%",viewBox:`0 0 ${r.width} ${r.height}`,tabIndex:-1,children:[A("defs",{children:a}),s]})}),f?Nt(m,f,"controls"):null]})]})})}import{jsx as Fe}from"react/jsx-runtime";function Di(e){let t=w(),o=e.annotationBucket,r=e.readOnly,n=e.id,{onClick:a,isHighlighted:s}=Te(e.id),l=Be(),u=s?l.highlighted:l[o||"hidden"]||l.hidden;if(!t)return null;if(r){let d="shape",c=e.polygon,p=c.open;return c?Fe(d,{id:`shape-${n}`,points:c.points,open:p,onClick:a,relativeStyle:!0,target:{x:0,y:0,width:t.width,height:t.height},style:u}):null}return Fe(De,{image:t,shape:e.polygon||{id:e.id,open:!0,points:[]},updateShape:e.updatePolygon,theme:e.theme,controlsHtmlId:e.controlsHtmlId,renderControls:e.renderControls})}import{useMemo as Mt,useState as Lt}from"react";import{ErrorBoundary as Ht}from"react-error-boundary";import{jsx as z,jsxs as zt}from"react/jsx-runtime";function Gi({src:e,errorFallback:t,interactive:o,skipSizes:r,children:n,renderViewerControls:a,viewControlsDeps:s,fluid:l,x:u,y:d,...c}){let[p,S]=Lt(),b=t||ce,[C,h]=pe(),m=Mt(()=>{let g=h[e]?.status,i=C({id:e},{});return i?.height&&i.width&&g!=="loading"?{id:e,width:i.width,height:i.height,service:i,type:"Image",selector:{type:"BoxSelector",spatial:{x:0,y:0,width:i.width,height:i.height}},target:{type:"BoxSelector",spatial:{x:0,y:0,width:i.width,height:i.height}}}:null},[C,e,h]);if(Q(p&&a?"overlay":"none",`canvas-portal-controls-${e}`,F.Provider,a&&m?{value:p||null,children:a({image:m,images:[m],type:"images"})}:{},[e,m,p,...s||[]]),!m||!m.height||!m.width)return null;let f=l?void 0:c.homePosition?c.homePosition.width/c.homePosition.height:m.width/m.height;return z(Ht,{resetKeys:[],fallbackRender:g=>z(b,{...c,...g}),children:z(me,{...c,aspectRatio:f,containerProps:{style:{position:"relative"},...c.containerProps||{}},onCreated:g=>{S(g),c.onCreated&&c.onCreated(g)},children:zt(F.Provider,{value:p,children:[z(ge,{image:m,id:m.id,isStatic:!o,x:u,y:d},m.id),z(At,{viewerPreset:p,renderViewerControls:a,image:m,src:e,viewControlsDeps:s}),n]})})})}function At({viewerPreset:e,renderViewerControls:t,image:o,src:r,viewControlsDeps:n}){return Q(e&&t?"overlay":"none",`canvas-portal-controls-${r}`,F.Provider,t&&o?{value:e||null,children:t({image:o,images:[o],type:"images"})}:{},[r,e,...n||[]]),null}import{jsx as qt}from"react/jsx-runtime";function ea({annotation:e,children:t}){return qt(L,{value:{annotation:e},children:t})}import{jsx as Wt}from"react/jsx-runtime";function na({annotationPage:e,children:t}){return Wt(L,{value:{annotationPage:e},children:t})}import{jsx as Dt}from"react/jsx-runtime";function la({collection:e,children:t}){return Dt(L,{value:{collection:e},children:t})}function da(e,t={}){return O(t)}import{useCanvas as Ft}from"@atlas-viewer/atlas";import{useEffect as Ot,useMemo as te,useState as $t}from"react";function va({canvasId:e}={}){let t=Ft(),o=ie(),r=te(()=>e?[e]:t?[t.id]:o.map(d=>d.id),[e,t,o]),[n,a]=$t({}),s=le();Ot(()=>{let d=c=>{let p=c.partOf.canvasId;p&&a(S=>({...S,[p]:c.choice}))};return s.on("choice-change",d),()=>{s.off("choice-change",d)}},[]);let l=te(()=>{let d=[];for(let c of r){let p=n[c];p&&d.push({canvasId:c,choice:p})}return d},[r,n]),u=te(()=>({makeChoice:(d,c)=>{s.emit("make-choice",{choiceId:d,...c})}}),[s]);return{choices:l,actions:u}}function Sa(e,t=!1){}function ka(e){let o=q().manifest,r=e?e.map(n=>typeof n=="string"?n:n?.id):[];return W(n=>{let a=o?n.iiif.entities.Manifest[o]:void 0,s=a?.items||[];if(typeof e>"u")return s;let l=[];for(let u of a?.items||[])r.indexOf(u.id)!==-1&&l.push(u);return l},[r.join("/")])}import{useMemo as Vt}from"react";function Ea(e,t=[]){let{id:o,selector:r}=e,n=q(),a=o||n.collection,s=W(l=>a?l.iiif.entities.Collection[a]:void 0,[a]);return Vt(()=>{if(s)return r?r(s):s},[s,r,...t])}import{useEffect as Kt,useMemo as Ut}from"react";import{createEventsHelper as Xt}from"@iiif/helpers/events";function Ha(e,t,o,r,n=[]){let a=P(),s=Ut(()=>Xt(a),[a]);Kt(()=>{let l=e;return l?(s.addEventListener(l,t,o,r),()=>{s.removeEventListener(l,t,o)}):()=>{}},[s,e,t,...n])}function Wa(e,t){let{id:o,isLoaded:r,error:n,resource:a,requestId:s,cached:l}=re(e,t);return{id:o,isLoaded:r,error:n,manifest:a,requestId:s,cached:l}}import{getImageServices as Oe}from"@iiif/parser/image-3";import{useEffect as Yt,useMemo as $e,useState as Y}from"react";function Ve({cacheKey:e}={}){let t=w(),o=O(),r=P(),n=de(),a=fe(),[s,l]=Y(void 0),[u,d]=Y(!1),[c,p]=Y("idle"),[S,b]=Y(void 0),C=t?t.id:"undefined",h=$e(()=>{try{if(t&&o.length){let f=o[0],g=r.get(f.body[0]),y=Oe(g)[0];return y&&n(y,{width:y.width||t.width,height:y.height||t.height},!0)||void 0}}catch(f){console.error(f)}},[C,e,t]),m=c==="success"&&s?s:h;return Yt(()=>{(async()=>{try{if(t&&o.length){let f=o[0],g=r.get(f.body[0]),y=Oe(g)[0];if(!y)return;d(!0),p("loading");try{let B=await a(y,{width:y.width||t.width,height:y.height||t.height})||void 0;l(B),p("success"),d(!1)}catch(B){p("error"),b(B)}}}catch(f){p("error"),b(f)}})()},[C,e]),$e(()=>({data:m,isFetching:u,status:c,error:S}),[m,u,c,S])}function _a(){let e=Ve();return{isLoading:e.isFetching,tile:e.data?{id:e.data.id||e.data["@id"],width:e.data.width,height:e.data.height,imageService:e.data,thumbnail:void 0}:null}}import{createStylesHelper as _t}from"@iiif/helpers/styles";import{useMemo as Qt}from"react";function ja(){let e=P();return Qt(()=>_t(e),[e])}export*from"@iiif/helpers/annotation-targets";export{ea as AnnotationContext,na as AnnotationPageContext,mi as AnnotationStyleProvider,Bo as Auth,Io as AuthProvider,So as AuthRContext,bo as AuthReactContext,Co as AuthReactContextActions,nn as CanvasAnnotations,ne as CanvasContext,ve as CanvasPanel,xr as CanvasStrategyProvider,Sr as CanvasWorldObject,la as CollectionContext,vn as CombinedMetadata,Hr as ComplexTimelineProvider,Vo as ContextBridge,yr as ControlsReactContext,De as CreateCustomShape,Fo as CustomContextBridge,Oo as CustomContextBridgeProvider,Wo as EventsProvider,st as Image,Gi as ImageService,Dr as ImageServiceLoaderContext,Ho as InnerViewerProvider,Pr as LanguageProvider,Nr as LanguageString,M as LocaleString,ro as ManifestContext,Hn as ManifestMetadata,Xr as MediaPlayerProvider,V as Metadata,Di as PolygonSelector,io as RangeContext,qo as ReactEventContext,jt as ReactVaultContext,Or as Render3DModelStrategy,Gr as RenderAccompanyingCanvas,$r as RenderAnnotationStrategy,Qr as RenderAudioStrategy,zr as RenderComplexTimelineStrategy,br as RenderEmptyStrategy,Fr as RenderImageStrategy,Gn as RenderSvgEditorControls,qr as RenderTextualContentStrategy,Jr as RenderVideoStrategy,Zr as RenderYouTubeStrategy,L as ResourceProvider,Zt as ResourceReactContext,ni as SelectorControllerProvider,Yn as SequenceThumbnails,Ao as SimpleViewerProvider,Lo as SimpleViewerReactContext,be as SingleCanvasThumbnail,gr as StrategyReactContext,_r as ThumbnailFallbackImage,kr as TranslationProvider,wr as TransliterationProvider,eo as VaultProvider,F as ViewerPresetContext,Yo as VirtualAnnotationProvider,no as VisibleCanvasReactContext,yo as authDetailsForResource,go as createAuthStateStore,ho as createProbe,zo as defaultEmitter,tr as emptyActions,nr as emptyStrategy,so as findAllCanvasesInRange,ao as findFirstCanvasFromRange,lo as findManifestSelectedRange,co as findSelectedRange,ir as flattenAnnotationPageIds,Cr as formatTime,lr as get3dStrategy,dr as getComplexTimelineStrategy,Ne as getDefaultAnnotationStyles,cr as getImageStrategy,uo as getManifestSequence,er as getParsedTargetSelector,fr as getRenderingStrategy,mr as getTextualContentStrategy,ur as getVideoStrategy,mo as getVisibleCanvasesFromCanvasId,po as hasAuth,xo as makeAccessServiceRequest,vo as makeAccessTokenRequest,jo as parseSpecificResource,Bt as svgThemes,or as unknownResponse,rr as unsupportedStrategy,Jo as useAnnotation,Zo as useAnnotationPage,ue as useAnnotationPageManager,Be as useAnnotationStyles,da as useAnnotationsAtTime,wo as useAuthActions,To as useAuthService,Po as useAuthStore,No as useAuthToken,Eo as useAuthTokens,w as useCanvas,va as useCanvasChoices,Sa as useCanvasClock,fo as useCanvasSequence,Yr as useCanvasStartTime,ka as useCanvasSubset,Br as useClosestLanguage,Ea as useCollection,Ar as useComplexTimeline,$o as useContextBridge,Lr as useCreateLocaleString,Ro as useCurrentAuth,Do as useCustomContextBridge,Ko as useDispatch,le as useEventEmitter,Ha as useEventListener,to as useExistingVault,Wa as useExternalCollection,oo as useExternalManifest,re as useExternalResource,Tr as useIIIFLanguage,G as useImage,Ve as useImageService,he as useImageServiceLoader,_a as useImageTile,ko as useIsAuthEnabled,pe as useLoadImageService,Mr as useLocaleString,D as useManifest,Kr as useMediaActions,Ur as useMediaElements,Vr as useMediaState,sr as usePaintables,O as usePaintingAnnotations,Me as usePolygonHelper,ae as useRange,vr as useRenderControls,pr as useRenderingStrategy,q as useResourceContext,Qo as useResourceEvents,ar as useResources,Mo as useSearchService,Ee as useSelectorController,ii as useSelectorEmitter,Te as useSelectorEvents,ai as useSelectorHelper,Ir as useSimpleMediaPlayer,se as useSimpleViewer,hr as useStrategy,ja as useStyleHelper,Go as useStyles,qe as useSvgEditor,ye as useThumbnail,Er as useTranslations,Rr as useTransliteration,P as useVault,Wr as useVaultEffect,W as useVaultSelector,_o as useViewerPreset,Uo as useVirtualAnnotationPage,Xo as useVirtualAnnotationPageContext,ie as useVisibleCanvases};
|
|
1
|
+
import{$ as Oo,$a as ye,A as ho,Aa as hr,B as yo,Ba as yr,C as vo,Ca as vr,D as xo,Da as xr,E as So,Ea as Sr,F as bo,Fa as br,G as Co,Ga as Cr,H as Io,Ha as Ir,I as ko,Ia as kr,J as Po,Ja as Pr,K as wo,Ka as wr,L as Ro,La as Rr,M as To,Ma as Tr,N as Eo,Na as Er,O as No,Oa as Nr,P as Bo,Pa as Br,Q as Mo,Qa as Mr,R as Lo,Ra as Lr,S as Ho,Sa as M,T as Ao,Ta as ge,U as se,Ua as Hr,V as zo,Va as Ar,W as qo,Wa as zr,X as le,Xa as qr,Y as Wo,Ya as Wr,Z as Do,Za as Dr,_ as Fo,_a as he,a as Zt,aa as $o,ab as Fr,b as q,ba as Vo,bb as Or,c as L,ca as Ko,cb as $r,d as jt,da as Uo,db as Vr,e as eo,ea as Xo,eb as Kr,f as to,fa as Yo,fb as Ur,g as re,ga as ce,gb as Xr,h as oo,ha as F,hb as Yr,i as ro,ia as _o,ib as _r,j as ne,ja as Q,jb as Qr,k as P,ka as w,kb as Gr,l as W,la as me,lb as Jr,m as no,ma as Qo,mb as Zr,n as ie,na as Go,nb as ve,o as D,oa as Jo,p as io,pa as Zo,q as ao,qa as ir,r as so,ra as ue,s as lo,sa as ar,t as co,ta as de,u as mo,ua as fe,v as uo,va as pe,w as ae,wa as O,x as fo,xa as sr,y as po,ya as pr,z as go,za as gr}from"./chunk-H3DSFUR2.js";import{a as jo,b as er,c as tr,d as or,e as rr,f as nr,g as lr,h as cr,i as mr,j as ur,k as dr,l as fr}from"./chunk-XNDN34SQ.js";import{useCanvas as Ye}from"@atlas-viewer/atlas";import{forwardRef as _e,useImperativeHandle as Qe}from"react";import{Fragment as Ge,jsx as xe}from"react/jsx-runtime";var nn=_e(function({canvasId:t},o){let r=Ye(),n=ue(t||r?.id),a=P();return Qe(o,()=>n,[t,r]),!r||n.enabledPageIds.length===0?null:xe(Ge,{children:n.enabledPageIds.map(s=>xe(ve.RenderAnnotationPage,{page:a.get(s)},s))})});import{useMemo as je}from"react";import{useMemo as Je}from"react";import{Fragment as Ze,jsx as I,jsxs as $}from"react/jsx-runtime";function V({metadata:e=[],config:t,labelWidth:o=16,showEmptyMessage:r=!0,allowHtml:n,emptyFallback:a,classes:s={},emptyMessage:l="No metadata available",emptyValueFallback:u="No value",emptyLabelFallback:d="",separator:c,tableFooter:p,tableHeader:S}){let b=Je(()=>{let h=(t||[]).reduce((f,g)=>[...f,...g.keys],[]),m={};for(let f of e){let g=f&&f.label?Object.values(f.label):[];for(let i of g)if(i&&i.length&&(h.indexOf(`metadata.${i[0]}`)!==-1||h.length===0)&&f){let y=`metadata.${i[0]}`;m[y]=m[y]?m[y]:[],m[y].push(f);break}}return m},[t,e]);return Object.keys(b).length===0&&r?I(Ze,{children:a})||I("div",{className:s.empty,children:l}):t&&t.length?$("table",{className:s.container,children:[S,I("tbody",{children:t.map((h,m)=>{let f=[];for(let g of h.keys)for(let i of b[g]||[])f.push(I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:i.value},m+"__"+g));return f.length===0?null:$("tr",{className:s.row,children:[I("td",{className:s.label,style:o?{minWidth:o}:{},children:I(M,{enableDangerouslySetInnerHTML:n,separator:c,defaultText:d,children:h.label})}),I("td",{className:s.value,children:f})]},m)})}),p]}):$("table",{className:s.container,children:[S,I("tbody",{children:e&&e.length?e.map((h,m)=>h?$("tr",{className:s.row,children:[I("td",{className:s.label,style:o?{minWidth:o}:{},children:I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:h.label})}),I("td",{className:s.value,children:I(M,{enableDangerouslySetInnerHTML:n,defaultText:u,separator:c,children:h.value})})]},m):null):null}),p]})}import{jsx as et}from"react/jsx-runtime";function vn(e){let t=D(),o=w(),r=ae(),n=je(()=>{let a=t?.metadata||[],s=o?.metadata||[],l=r?.metadata||[];return[...a,...s,...l]},[t,o,r]);return et(V,{metadata:n,...e})}import{useEffect as nt,useState as it}from"react";import{createImageServiceRequest as tt,imageServiceRequestToString as ot}from"@iiif/parser/image-3";import{useMemo as rt}from"react";function G(e,t={},o=[]){return rt(()=>{if(!e)return null;let r=t.quality;e&&e.extraQualities&&t.quality&&(e.extraQualities.includes(t.quality)||(r="default"));let n=tt(e);return ot({identifier:n.identifier,server:n.server,scheme:n.scheme,type:"image",size:{max:!t.size?.width&&!t.size?.height,confined:!1,upscaled:!1,...t.size||{}},format:t.format||"jpg",region:t.region||{full:!0},rotation:t?.rotation?Number.isInteger(t.rotation)?{angle:t.rotation}:t.rotation:{angle:0},quality:r||"default",prefix:n.prefix,originalPath:n.originalPath})},[...o])}import{jsx as K}from"react/jsx-runtime";function at(e){let t=typeof e.src=="string"?e.src:e.src.id,o=he(),[r,n]=it(!1),a;if(t){let l=o.loadServiceSync({id:t});l&&(a=l)}!a&&!r&&o.loadService({id:t}).then(()=>{n(!0)});let s=G(a,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[r,e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return nt(()=>()=>{n(!1)},[t]),s?K("img",{src:s,alt:e.alt,className:e.className,style:e.style}):K(st,{...e,fetchImageService:!1})}function st(e){if(e.fetchImageService)return K(at,{...e});let t=typeof e.src=="string"?{id:e.src,profile:"level0"}:e.src,o=G(t,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return o?K("img",{src:o,alt:e.alt,className:e.className,style:e.style}):null}import{jsx as lt}from"react/jsx-runtime";function Hn(e){let t=D();return lt(V,{metadata:t?.metadata||[],...e})}import{useLayoutEffect as ft,useRef as pt}from"react";import*as J from"react-lazy-load-image-component";import{getValue as ct}from"@iiif/helpers/i18n";import{Fragment as Se,jsx as R,jsxs as dt}from"react/jsx-runtime";var{LazyLoadComponent:mt}=J||J.default;function be(e){let{size:t,visible:o,classes:r,canvasId:n,figure:a}=e,s=t?.width||128,l=t?.height||t?.width||128,u=R(ut,{...e}),d=R(mt,{threshold:300,style:{height:l,width:s},visibleByDefault:o,children:n?R(ne,{canvas:n,children:u}):u});return a?R("figure",{className:r?.figure,children:d}):d}function ut({fallback:e,size:t,classes:o,showLabel:r,alt:n,dereference:a=!1}){let s=w(),l=t?.width||128,u=t?.height||t?.width||128,d=n||ct(s?.label)||"",c=ye({width:l,height:u,allowUnsafe:!0},a);return!c||c.type!=="fixed"?R(Se,{children:e}):dt(Se,{children:[R("div",{className:o?.imageWrapper,children:R("img",{className:o?.img,src:c.id,alt:d})}),r?R(M,{as:"figcaption",className:o?.label,children:s?.label}):null]})}import{jsx as H}from"react/jsx-runtime";function Yn({scrollBehaviour:e,dereference:t,flat:o,size:r,classes:n={},showLabel:a,figure:s,fallback:l}){let u=pt(null),{items:d,sequence:c,currentSequenceIndex:p,setSequenceIndex:S}=se(),b={row:n.selected?.row||n.row,item:n.selected?.item||n.item,figure:n.selected?.figure||n.figure,img:n.selected?.img||n.img,label:n.selected?.label||n.label,imageWrapper:n.selected?.imageWrapper||n.imageWrapper};ft(()=>{if(!u.current)return;let h=u.current.querySelector("[data-selected=true]");h&&h.scrollIntoView({behavior:e||"instant",block:"nearest",inline:"center"})},[p]);let C=[];for(let h of c){let m=[],f=c[p]===h;for(let g of h){let i=d[g];m.push(H("div",{className:f?b.item:n.item,children:H(be,{classes:f?b:n,canvasId:i.id,size:r,dereference:t,showLabel:a,figure:s,placeholder:H("div",{style:{height:128,width:128}}),fallback:l})},g))}if(o){C.push(m);continue}C.push(H("div",{onClick:g=>{S(c.indexOf(h))},"data-selected":f,className:f?b.row:n.row,children:m},h.join("-")))}return H("div",{ref:u,className:n.container,children:C})}import{Fragment as Ce,jsx as T,jsxs as Ie}from"react/jsx-runtime";var gt={draw:!0,polygon:!0,line:!0,lineBox:!0,square:!0,triangle:!0,hexagon:!0,circle:!0,delete:!0};function Gn({helper:e,showShapes:t,state:o,enabled:r=gt,classNames:n={},icons:a={}}){return Ie(Ce,{children:[t?Ie(Ce,{children:[r.draw&&T("button",{className:n.button,onClick:()=>{e.stamps.clear(),e.draw.enable()},"data-active":!o.lineMode&&!o.selectedStamp&&t&&o.drawMode,children:a.DrawIcon||"Draw"}),r.polygon&&T("button",{className:n.button,"data-active":!o.lineMode&&!o.selectedStamp&&t&&!o.drawMode,onClick:()=>{e.stamps.clear(),e.draw.disable(),e.modes.disableLineBoxMode(),e.modes.disableLineMode()},children:a.PolygonIcon||"Polygon"}),r.line&&T("button",{className:n.button,"data-active":o.lineMode&&!o.lineBoxMode,onClick:()=>{e.modes.enableLineMode()},children:a.LineIcon||"Line"}),r.lineBox&&T("button",{className:n.button,"data-active":o.lineBoxMode,onClick:()=>{e.modes.enableLineBoxMode()},children:a.LineBoxIcon||"LineBox"}),r.square&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="square",onClick:()=>{e.stamps.square()},children:a.SquareIcon||"Square"}),r.triangle&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="triangle",onClick:()=>{e.stamps.triangle()},children:a.TriangleIcon||"Triangle"}),r.hexagon&&T("button",{className:n.button,"data-active":o.selectedStamp?.id==="hexagon",onClick:()=>{e.stamps.hexagon()},children:a.HexagonIcon||"Hexagon"})]}):null,o.showBoundingBox&&r.delete&&T("button",{className:n.button,onClick:()=>e.key.down("Backspace"),children:a.DeleteForeverIcon||"Delete"})]})}import{createContext as ht,useCallback as ke,useContext as we,useEffect as Pe,useMemo as Z,useState as yt}from"react";import Re from"mitt";import{jsx as vt}from"react/jsx-runtime";var U=ht(Re());U.displayName="SelectorHelper";function ni({children:e}){return vt(U.Provider,{value:Z(()=>Re(),[]),children:e})}function ii(){return we(U)}function Te(e){let t=Ee(),[o,r]=yt(!1);Pe(()=>t.withSelector(e).on("highlight",()=>{r(!0)}),[t,e]),Pe(()=>t.withSelector(e).on("clear-highlight",()=>{r(!1)}),[t,e]);let n=ke(s=>{t.emit("click",{selectorId:e,event:s})},[e,t]),a=ke(s=>{t.emit("hover",{selectorId:e,event:s})},[e,t]);return{controller:t,onClick:n,onHover:a,isHighlighted:o}}function Ee(){let e=we(U);return Z(()=>({withSelector(t){return{on(o,r){let n=a=>{a&&a.selectorId===t&&r(a)};return e.on(o,n),()=>{e.off(o,n)}},emit(o,r){e.emit(o,{...r,selectorId:t})}}},on(t,o){return e.on(t,o),()=>{e.off(t,o)}},emit(t,o){e.emit(t,o)}}),[e])}function ai(){let e=Ee();return Z(()=>({withSelector(t){return{highlight(){e.emit("highlight",{selectorId:t})},clearHighlight(){e.emit("clear-highlight",{selectorId:t})},zoomTo(){e.emit("zoom-to",{selectorId:t})},addEventListener(o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(o,r){return e.withSelector(t).on(o,r)}}},highlight(t){e.emit("highlight",{selectorId:t})},clearHighlight(t){e.emit("clear-highlight",{selectorId:t})},zoomTo(t){e.emit("zoom-to",{selectorId:t})},addEventListener(t,o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(t){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(t,o){return e.on(t,o)}}),[e])}import{createContext as xt,useContext as St,useMemo as bt}from"react";import{jsx as Ct}from"react/jsx-runtime";function Ne(){return{default:{backgroundColor:"rgba(0,0,0,0)",borderWidth:"2px",borderColor:"rgba(252,0,98, .5)"},highlighted:{backgroundColor:"rgba(75, 103, 225, 0.4)",borderWidth:"1px",borderColor:"rgba(75,103,225,0.99)"},hidden:{borderWidth:"0px",borderColor:"rgba(0,0,0,0)",backgroundColor:"rgba(0,0,0,0)",hidden:!0}}}var j=xt(Ne());j.displayName="AnnotationStyle";function Be(){return St(j)}function mi({theme:e,children:t}){let o=bt(()=>e||Ne(),[e]);return Ct(j.Provider,{value:o,children:t})}import{HTMLPortal as Tt,useAtlas as Et}from"@atlas-viewer/atlas";import{useEffect as Le,useRef as E,useState as He}from"react";import{useEffect as It,useMemo as kt,useState as Pt}from"react";import{createHelper as wt}from"polygon-editor";function Me(e,t,o){let[r,n]=Pt({}),a=kt(()=>wt(e,o),[]);return It(()=>(a.clock.start(t,n),()=>{a.clock.stop()}),[]),{state:r,helper:a}}import{createSvgHelpers as Rt}from"polygon-editor";import{Fragment as Ae,jsx as x,jsxs as ze}from"react/jsx-runtime";var N=Rt();function qe(e,t){let{image:o,currentShape:r,onChange:n,hideShapeLines:a}=e,s=E(),l=E(),u=E(),d=E(),c=E(),p=E(),S=E(),b=E(),[C,h]=He(null),[m,f]=He(!1),{helper:g,state:i}=Me(r,(v,k)=>{N.updateTransitionBoundingBox(l.current,v,k),N.updateBoundingBoxPolygon(s.current,v,k),N.updateTransitionShape(p.current,v,k),N.updateClosestLinePointTransform(d.current,v,k),N.updateSelectBox(u.current,v,k),N.updatePointLine(S.current,v,k),N.updateDrawPreview(c.current,v,k,3),N.updateLineBox(b.current,v),h(v.transitionDirection),f(v.transitionRotate)},n);Le(()=>{g.setShape(r||null)},t),Le(()=>{let v=()=>{g.modifiers.reset()};return document.addEventListener("mouseleave",v),()=>{document.removeEventListener("mouseleave",v)}},[]);let y=ze(Ae,{children:[x("marker",{id:"dot",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("circle",{cx:"5",cy:"5",r:"4",className:"marker"})}),x("marker",{id:"selected",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("circle",{cx:"5",cy:"5",r:"4",fill:"#FAFF00"})}),x("marker",{id:"resizer",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"5",markerHeight:"5",children:x("rect",{width:"10",height:"10",stroke:"#FF0DCB",fill:"#fff",strokeWidth:2})})]}),B=r?r.open?"polyline":"polygon":null,oe=!i.showBoundingBox&&i.closestPoint!==null&&i.actionIntentType==="select-point",Ke=i.actionIntentType==="add-open-point",Ue=i.transitionIntentType==="split-line",_=i.transitioning&&i.selectedStamp&&i.transitionIntentType==="stamp-shape",Xe=r&&B?ze(Ae,{children:[x(B,{fill:!i.transitioning&&i.showBoundingBox?"rgba(255, 0, 0, .5)":"none",strokeWidth:_?0:2,stroke:a?"transparent":"#000",points:r.points.map(v=>v.join(",")).join(" "),vectorEffect:"non-scaling-stroke",markerStart:i.showBoundingBox?void 0:"url(#dot)",markerMid:i.showBoundingBox?void 0:"url(#dot)",markerEnd:i.showBoundingBox?void 0:"url(#dot)",style:{pointerEvents:"none"}}),i.lineBoxMode&&i.actionIntentType==="close-line-box"?x("polygon",{fill:"rgba(255, 0, 0, .4)",ref:b,stroke:"#000",strokeWidth:2,vectorEffect:"non-scaling-stroke"}):null,i.transitionIntentType==="draw-shape"&&i.transitioning?x("polyline",{ref:c,fill:"none",stroke:"rgba(255, 0, 0, .5)",strokeWidth:2,vectorEffect:"non-scaling-stroke"}):null,!i.showBoundingBox&&i.selectedPoints&&i.selectedPoints.length?x("polyline",{strokeWidth:2,vectorEffect:"non-scaling-stroke",stroke:"transparent",markerStart:"url(#selected)",markerMid:"url(#selected)",markerEnd:"url(#selected)",fill:"transparent",points:r.points.filter((v,k)=>i.selectedPoints?.includes(k)).map(v=>v.join(",")).join(" ")}):null,oe&&i.closestPoint!==null&&r.points[i.closestPoint]?x("polyline",{strokeWidth:2,vectorEffect:"non-scaling-stroke",stroke:"transparent",markerStart:"url(#selected)",markerMid:"url(#selected)",markerEnd:"url(#selected)",fill:"transparent",points:`${r.points[i.closestPoint][0]},${r.points[i.closestPoint][1]}`}):null,!i.transitioning&&(i.actionIntentType==="add-open-point"||i.actionIntentType==="close-shape"||i.actionIntentType==="close-shape-line")?x("polyline",{stroke:"#000",ref:S,strokeWidth:i.actionIntentType==="close-shape"?2:1,vectorEffect:"non-scaling-stroke"}):null,i.hasClosestLine&&(!i.transitionIntentType||i.transitionIntentType==="split-line")?x("g",{ref:d,children:x("polyline",{style:{opacity:.5},markerStart:"url(#dot)",points:"0,0 10,10",vectorEffect:"non-scaling-stroke",fill:"transparent",strokeWidth:2})}):null,i.transitioning?x(B,{ref:p,fill:r.open?"none":"rgba(255, 0, 0, .5)",stroke:"rgba(255, 0, 0, .5)",strokeWidth:r.open?2:0}):null,i.transitioning&&i.transitionIntentType==="select-multiple-points"?x("rect",{ref:u,fill:"rgba(255, 255, 255, .3)",strokeWidth:1,stroke:"rgba(0,0,0,.2)",vectorEffect:"non-scaling-stroke"}):null,i.showBoundingBox?null:x("g",{name:"controls",children:!1}),i.showBoundingBox&&!_?x("polygon",{ref:s,strokeWidth:2,stroke:"#FF0DCB",fill:"none",markerStart:"url(#resizer)",markerMid:"url(#resizer)",markerEnd:"url(#resizer)",vectorEffect:"non-scaling-stroke"}):null]}):null;return{helper:g,state:i,isAddingPoint:Ke,isSplitting:Ue,isStamping:_,isHoveringPoint:oe,transitionDirection:C,transitionRotate:m,defs:y,editor:Xe}}import{useEffect as ee}from"react";import{createPortal as Nt}from"react-dom";import{Fragment as We,jsx as A,jsxs as X}from"react/jsx-runtime";var Bt=[{name:"Default",outer:{borderWidth:4,borderColor:"rgba(255, 255, 255, .4)"},inner:{borderWidth:2,borderColor:"#000"}},{name:"High contrast",outer:{borderWidth:3,borderColor:"#fff"},inner:{borderWidth:1,borderColor:"#000"}},{name:"Lightsaber",outer:{borderWidth:"4",borderColor:"rgba(56,68,255,0.64)"},inner:{borderWidth:"2",borderColor:"#fff"}},{name:"Bright",outer:{borderWidth:"6",borderColor:"#25d527"},inner:{borderWidth:"3",borderColor:"#a916ff"}},{name:"pink",outer:{borderWidth:"4",borderColor:"#ff00ff"},inner:{borderWidth:"2",borderColor:"#ffffff"}},{name:"fine (dark)",outer:{borderWidth:"1",borderColor:"#000000"},inner:{}},{name:"fine (light)",outer:{borderWidth:"1",borderColor:"#FFF"},inner:{}}];function De(e){let t=e.theme||Bt[0],o=Et(),{image:r}=e,{helper:n,defs:a,editor:s,state:l,transitionDirection:u,isSplitting:d,transitionRotate:c,isHoveringPoint:p,isAddingPoint:S,isStamping:b}=qe({currentShape:e.shape||null,onChange:e.updateShape,image:e.image,hideShapeLines:!0},[]),C=i=>{n.pointer([[~~i.atlas.x,~~i.atlas.y]])};ee(()=>{let i=y=>{n.key.up(y.key)};return document.addEventListener("keyup",i),()=>{document.removeEventListener("keyup",i)}},[]),ee(()=>{let i=y=>{n.key.down(y.key)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[]),ee(()=>{let i=[];return u&&i.push(`atlas-cursor-${u}`),l.actionIntentType==="cut-line"&&l.modifiers?.Shift&&i.push("atlas-cursor-cut"),(p||l.transitionIntentType==="move-shape"||l.transitionIntentType==="move-point")&&i.push("atlas-cursor-move"),S&&i.push("atlas-cursor-crosshair"),d&&i.push("atlas-cursor-copy"),c&&i.push("atlas-cursor-rotate"),l.transitionIntentType==="draw-shape"&&i.push("atlas-cursor-draw"),o?.canvas&&o.canvas.classList.add(...i),()=>{o?.canvas&&o.canvas.classList.remove(...i)}},[o?.canvas,S,p,d,l.modifiers?.Shift,l.actionIntentType,l.transitionIntentType,u,c]);let h=e.shape&&e.shape?.points.length===0,m=e.renderControls?e.renderControls(n,l,h):null,f=document.getElementById(e.controlsHtmlId||"atlas-controls"),g="shape";return A(We,{children:X("world-object",{height:r.height,width:r.width,onMouseMove:C,onMouseDown:n.pointerDown,onMouseUp:n.pointerUp,onMouseLeave:n.blur,children:[e.shape?X(We,{children:[A(g,{open:e.shape.open,points:e.shape.points,relativeStyle:!0,style:b?{}:t.outer}),A(g,{open:e.shape.open,points:e.shape.points,relativeStyle:!0,style:b?{}:t.inner})]}):null,X(Tt,{relative:!0,interactive:!1,children:[A("div",{style:{position:"absolute",top:0,right:0,left:0,bottom:0},children:X("svg",{width:"100%",height:"100%",viewBox:`0 0 ${r.width} ${r.height}`,tabIndex:-1,children:[A("defs",{children:a}),s]})}),f?Nt(m,f,"controls"):null]})]})})}import{jsx as Fe}from"react/jsx-runtime";function Di(e){let t=w(),o=e.annotationBucket,r=e.readOnly,n=e.id,{onClick:a,isHighlighted:s}=Te(e.id),l=Be(),u=s?l.highlighted:l[o||"hidden"]||l.hidden;if(!t)return null;if(r){let d="shape",c=e.polygon,p=c.open;return c?Fe(d,{id:`shape-${n}`,points:c.points,open:p,onClick:a,relativeStyle:!0,target:{x:0,y:0,width:t.width,height:t.height},style:u}):null}return Fe(De,{image:t,shape:e.polygon||{id:e.id,open:!0,points:[]},updateShape:e.updatePolygon,theme:e.theme,controlsHtmlId:e.controlsHtmlId,renderControls:e.renderControls})}import{useMemo as Mt,useState as Lt}from"react";import{ErrorBoundary as Ht}from"react-error-boundary";import{jsx as z,jsxs as zt}from"react/jsx-runtime";function Gi({src:e,errorFallback:t,interactive:o,skipSizes:r,children:n,renderViewerControls:a,viewControlsDeps:s,fluid:l,x:u,y:d,...c}){let[p,S]=Lt(),b=t||ce,[C,h]=pe(),m=Mt(()=>{let g=h[e]?.status,i=C({id:e},{});return i?.height&&i.width&&g!=="loading"?{id:e,width:i.width,height:i.height,service:i,type:"Image",selector:{type:"BoxSelector",spatial:{x:0,y:0,width:i.width,height:i.height}},target:{type:"BoxSelector",spatial:{x:0,y:0,width:i.width,height:i.height}}}:null},[C,e,h]);if(Q(p&&a?"overlay":"none",`canvas-portal-controls-${e}`,F.Provider,a&&m?{value:p||null,children:a({image:m,images:[m],type:"images"})}:{},[e,m,p,...s||[]]),!m||!m.height||!m.width)return null;let f=l?void 0:c.homePosition?c.homePosition.width/c.homePosition.height:m.width/m.height;return z(Ht,{resetKeys:[],fallbackRender:g=>z(b,{...c,...g}),children:z(me,{...c,aspectRatio:f,containerProps:{style:{position:"relative"},...c.containerProps||{}},onCreated:g=>{S(g),c.onCreated&&c.onCreated(g)},children:zt(F.Provider,{value:p,children:[z(ge,{image:m,id:m.id,isStatic:!o,x:u,y:d},m.id),z(At,{viewerPreset:p,renderViewerControls:a,image:m,src:e,viewControlsDeps:s}),n]})})})}function At({viewerPreset:e,renderViewerControls:t,image:o,src:r,viewControlsDeps:n}){return Q(e&&t?"overlay":"none",`canvas-portal-controls-${r}`,F.Provider,t&&o?{value:e||null,children:t({image:o,images:[o],type:"images"})}:{},[r,e,...n||[]]),null}import{jsx as qt}from"react/jsx-runtime";function ea({annotation:e,children:t}){return qt(L,{value:{annotation:e},children:t})}import{jsx as Wt}from"react/jsx-runtime";function na({annotationPage:e,children:t}){return Wt(L,{value:{annotationPage:e},children:t})}import{jsx as Dt}from"react/jsx-runtime";function la({collection:e,children:t}){return Dt(L,{value:{collection:e},children:t})}function da(e,t={}){return O(t)}import{useCanvas as Ft}from"@atlas-viewer/atlas";import{useEffect as Ot,useMemo as te,useState as $t}from"react";function va({canvasId:e}={}){let t=Ft(),o=ie(),r=te(()=>e?[e]:t?[t.id]:o.map(d=>d.id),[e,t,o]),[n,a]=$t({}),s=le();Ot(()=>{let d=c=>{let p=c.partOf.canvasId;p&&a(S=>({...S,[p]:c.choice}))};return s.on("choice-change",d),()=>{s.off("choice-change",d)}},[]);let l=te(()=>{let d=[];for(let c of r){let p=n[c];p&&d.push({canvasId:c,choice:p})}return d},[r,n]),u=te(()=>({makeChoice:(d,c)=>{s.emit("make-choice",{choiceId:d,...c})}}),[s]);return{choices:l,actions:u}}function Sa(e,t=!1){}function ka(e){let o=q().manifest,r=e?e.map(n=>typeof n=="string"?n:n?.id):[];return W(n=>{let a=o?n.iiif.entities.Manifest[o]:void 0,s=a?.items||[];if(typeof e>"u")return s;let l=[];for(let u of a?.items||[])r.indexOf(u.id)!==-1&&l.push(u);return l},[r.join("/")])}import{useMemo as Vt}from"react";function Ea(e,t=[]){let{id:o,selector:r}=e,n=q(),a=o||n.collection,s=W(l=>a?l.iiif.entities.Collection[a]:void 0,[a]);return Vt(()=>{if(s)return r?r(s):s},[s,r,...t])}import{useEffect as Kt,useMemo as Ut}from"react";import{createEventsHelper as Xt}from"@iiif/helpers/events";function Ha(e,t,o,r,n=[]){let a=P(),s=Ut(()=>Xt(a),[a]);Kt(()=>{let l=e;return l?(s.addEventListener(l,t,o,r),()=>{s.removeEventListener(l,t,o)}):()=>{}},[s,e,t,...n])}function Wa(e,t){let{id:o,isLoaded:r,error:n,resource:a,requestId:s,cached:l}=re(e,t);return{id:o,isLoaded:r,error:n,manifest:a,requestId:s,cached:l}}import{getImageServices as Oe}from"@iiif/parser/image-3";import{useEffect as Yt,useMemo as $e,useState as Y}from"react";function Ve({cacheKey:e}={}){let t=w(),o=O(),r=P(),n=de(),a=fe(),[s,l]=Y(void 0),[u,d]=Y(!1),[c,p]=Y("idle"),[S,b]=Y(void 0),C=t?t.id:"undefined",h=$e(()=>{try{if(t&&o.length){let f=o[0],g=r.get(f.body[0]),y=Oe(g)[0];return y&&n(y,{width:y.width||t.width,height:y.height||t.height},!0)||void 0}}catch(f){console.error(f)}},[C,e,t]),m=c==="success"&&s?s:h;return Yt(()=>{(async()=>{try{if(t&&o.length){let f=o[0],g=r.get(f.body[0]),y=Oe(g)[0];if(!y)return;d(!0),p("loading");try{let B=await a(y,{width:y.width||t.width,height:y.height||t.height})||void 0;l(B),p("success"),d(!1)}catch(B){p("error"),b(B)}}}catch(f){p("error"),b(f)}})()},[C,e]),$e(()=>({data:m,isFetching:u,status:c,error:S}),[m,u,c,S])}function _a(){let e=Ve();return{isLoading:e.isFetching,tile:e.data?{id:e.data.id||e.data["@id"],width:e.data.width,height:e.data.height,imageService:e.data,thumbnail:void 0}:null}}import{createStylesHelper as _t}from"@iiif/helpers/styles";import{useMemo as Qt}from"react";function ja(){let e=P();return Qt(()=>_t(e),[e])}export*from"@iiif/helpers/annotation-targets";export{ea as AnnotationContext,na as AnnotationPageContext,mi as AnnotationStyleProvider,Bo as Auth,Io as AuthProvider,So as AuthRContext,bo as AuthReactContext,Co as AuthReactContextActions,nn as CanvasAnnotations,ne as CanvasContext,ve as CanvasPanel,xr as CanvasStrategyProvider,Sr as CanvasWorldObject,la as CollectionContext,vn as CombinedMetadata,Hr as ComplexTimelineProvider,Vo as ContextBridge,yr as ControlsReactContext,De as CreateCustomShape,Fo as CustomContextBridge,Oo as CustomContextBridgeProvider,Wo as EventsProvider,st as Image,Gi as ImageService,Dr as ImageServiceLoaderContext,Ho as InnerViewerProvider,Pr as LanguageProvider,Nr as LanguageString,M as LocaleString,ro as ManifestContext,Hn as ManifestMetadata,Xr as MediaPlayerProvider,V as Metadata,Di as PolygonSelector,io as RangeContext,qo as ReactEventContext,jt as ReactVaultContext,Or as Render3DModelStrategy,Gr as RenderAccompanyingCanvas,$r as RenderAnnotationStrategy,Qr as RenderAudioStrategy,zr as RenderComplexTimelineStrategy,br as RenderEmptyStrategy,Fr as RenderImageStrategy,Gn as RenderSvgEditorControls,qr as RenderTextualContentStrategy,Jr as RenderVideoStrategy,Zr as RenderYouTubeStrategy,L as ResourceProvider,Zt as ResourceReactContext,ni as SelectorControllerProvider,Yn as SequenceThumbnails,Ao as SimpleViewerProvider,Lo as SimpleViewerReactContext,be as SingleCanvasThumbnail,gr as StrategyReactContext,_r as ThumbnailFallbackImage,kr as TranslationProvider,wr as TransliterationProvider,eo as VaultProvider,F as ViewerPresetContext,Yo as VirtualAnnotationProvider,no as VisibleCanvasReactContext,yo as authDetailsForResource,go as createAuthStateStore,ho as createProbe,zo as defaultEmitter,tr as emptyActions,nr as emptyStrategy,so as findAllCanvasesInRange,ao as findFirstCanvasFromRange,lo as findManifestSelectedRange,co as findSelectedRange,ir as flattenAnnotationPageIds,Cr as formatTime,lr as get3dStrategy,dr as getComplexTimelineStrategy,Ne as getDefaultAnnotationStyles,cr as getImageStrategy,uo as getManifestSequence,er as getParsedTargetSelector,fr as getRenderingStrategy,mr as getTextualContentStrategy,ur as getVideoStrategy,mo as getVisibleCanvasesFromCanvasId,po as hasAuth,xo as makeAccessServiceRequest,vo as makeAccessTokenRequest,jo as parseSpecificResource,Bt as svgThemes,or as unknownResponse,rr as unsupportedStrategy,Jo as useAnnotation,Zo as useAnnotationPage,ue as useAnnotationPageManager,Be as useAnnotationStyles,da as useAnnotationsAtTime,wo as useAuthActions,To as useAuthService,Po as useAuthStore,No as useAuthToken,Eo as useAuthTokens,w as useCanvas,va as useCanvasChoices,Sa as useCanvasClock,fo as useCanvasSequence,Yr as useCanvasStartTime,ka as useCanvasSubset,Br as useClosestLanguage,Ea as useCollection,Ar as useComplexTimeline,$o as useContextBridge,Lr as useCreateLocaleString,Ro as useCurrentAuth,Do as useCustomContextBridge,Ko as useDispatch,le as useEventEmitter,Ha as useEventListener,to as useExistingVault,Wa as useExternalCollection,oo as useExternalManifest,re as useExternalResource,Tr as useIIIFLanguage,G as useImage,Ve as useImageService,he as useImageServiceLoader,_a as useImageTile,ko as useIsAuthEnabled,pe as useLoadImageService,Mr as useLocaleString,D as useManifest,Kr as useMediaActions,Ur as useMediaElements,Vr as useMediaState,sr as usePaintables,O as usePaintingAnnotations,Me as usePolygonHelper,ae as useRange,vr as useRenderControls,pr as useRenderingStrategy,q as useResourceContext,Qo as useResourceEvents,ar as useResources,Mo as useSearchService,Ee as useSelectorController,ii as useSelectorEmitter,Te as useSelectorEvents,ai as useSelectorHelper,Ir as useSimpleMediaPlayer,se as useSimpleViewer,hr as useStrategy,ja as useStyleHelper,Go as useStyles,qe as useSvgEditor,ye as useThumbnail,Er as useTranslations,Rr as useTransliteration,P as useVault,Wr as useVaultEffect,W as useVaultSelector,_o as useViewerPreset,Uo as useVirtualAnnotationPage,Xo as useVirtualAnnotationPageContext,ie as useVisibleCanvases};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-iiif-vault",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@atlas-viewer/atlas": "^2.2.9",
|
|
62
62
|
"@iiif/helpers": "^1.3.1",
|
|
63
|
-
"@iiif/parser": "^2.1.
|
|
63
|
+
"@iiif/parser": "^2.1.8",
|
|
64
64
|
"@iiif/presentation-2": "^1.0.4",
|
|
65
65
|
"@iiif/presentation-3": "^2.2.3",
|
|
66
66
|
"@iiif/presentation-3-normalized": "^0.9.7",
|
package/dist/chunk-XMMNKWGN.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import{c as Ct,l as xt}from"./chunk-XNDN34SQ.js";import{forwardRef as Ar,useImperativeHandle as La}from"react";import dn,{useCallback as rt,useMemo as mn,useState as be}from"react";import{AtlasAuto as qo,ModeContext as _o}from"@atlas-viewer/atlas";import{ErrorBoundary as Ko}from"react-error-boundary";import{useContext as D,useMemo as Ao}from"react";import Tr,{useContext as Ir,useMemo as Mr}from"react";import{jsx as Er}from"react/jsx-runtime";var wr={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},Ce=Tr.createContext(wr),O=()=>Ir(Ce);function Y({value:e,children:n}){let t=O(),r=Mr(()=>({...t,...e}),[e,t]);return Er(Ce.Provider,{value:r,children:n})}import Vr,{useState as kr}from"react";import{Vault as Rt,globalVault as Nr}from"@iiif/helpers/vault";import{jsx as At}from"react/jsx-runtime";var j=Vr.createContext({vault:null,setVaultInstance:e=>{}});function J({vault:e,vaultOptions:n,useGlobal:t,resources:r,children:o}){let[s,i]=kr(()=>e||(t?Nr(n):n?new Rt(n):new Rt));return At(j.Provider,{value:{vault:s,setVaultInstance:i},children:At(Y,{value:r||{},children:o})})}import{useContext as fo}from"react";import{createContext as po,useMemo as go}from"react";import{globalVault as Lr}from"@iiif/helpers/vault";import{useContext as zr}from"react";function X(e){let n=zr(j);return e||(n&&n.vault?n.vault:Lr())}import{useEffect as Or,useMemo as Hr,useState as _e}from"react";function Pt(e,{noCache:n=!1}={}){let t=typeof e=="string"?e:e.id,r=X(),[o,s]=_e(t),[i,a]=_e(void 0),u=Hr(()=>r.get(t,{skipSelfReturn:!0})||void 0,[t,r]),[c,l]=_e(u);return Or(()=>{(async()=>{try{let d=u&&!n?u:await r.load(t),h=d?d.id||d["@id"]:null;d&&o!==h&&s(h),l(d)}catch(d){a(d)}})()},[t,n]),{isLoaded:!!c,id:o,requestId:t,error:i,resource:c,cached:!!(c&&c===u)}}function bt(e,n){let{id:t,isLoaded:r,error:o,resource:s,requestId:i,cached:a}=Pt(e,n);return{id:t,isLoaded:r,error:o,manifest:s,requestId:i,cached:a}}import{jsx as Fr}from"react/jsx-runtime";function Tt({manifest:e,children:n}){return Fr(Y,{value:{manifest:e},children:n})}import{jsx as Dr}from"react/jsx-runtime";function _({canvas:e,children:n}){return Dr(Y,{value:{canvas:e},children:n})}import{useContext as qr}from"react";import _r from"react";import{useContext as $r}from"react";var P=()=>{let{vault:e}=$r(j);if(e===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return e};import{useEffect as Ur,useState as Br}from"react";function b(e,n=[]){let t=P(),[r,o]=Br(()=>e(t.getState(),t));return Ur(()=>t.subscribe(s=>e(s,t),s=>{o(s)},!1),n),r}var ee=_r.createContext([]);function xe(){let e=qr(ee);return b(n=>e.map(t=>n.iiif.entities.Canvas[t]).filter(Boolean),[e])}import{useMemo as Kr}from"react";function w(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=P(),i=t||o.manifest,a=b(u=>i?u.iiif.entities.Manifest[i]:void 0,[i]);return Kr(()=>{if(a)return r?r(a):a},[a,r,...n])}import{jsx as Wr}from"react/jsx-runtime";function It({range:e,children:n}){return Wr(Y,{value:{range:e},children:n})}function Yr(e,n){for(let t of n.items){if(t.type==="Canvas")return t;if(t.type==="SpecificResource")return t.source;if(t.type==="Range"){let r=Yr(e,e.get(t));if(r)return r}}return null}function Ke(e,n){let t=[];for(let r of n.items)if(r.type==="SpecificResource"&&r.source?.type==="Canvas"&&(r.source.id.indexOf("#")!==-1?t.push({id:r.source.id.split("#")[0],type:"Canvas"}):t.push(r.source)),r.type==="Range"&&t.push(...Ke(e,e.get(r))),r.type==="SpecificResource"){let o=typeof r.source=="string"?r.source:r.source.id;t.push({id:o,type:"Canvas"})}return t}function Ns(e,n,t){for(let r of n.structures){let o=Mt(e,e.get(r),t);if(o)return o}return null}function Mt(e,n,t){for(let r of n.items){let o=r?.source?.id?.split("#")[0];if(r.type==="SpecificResource"&&r.source===t||r.type==="SpecificResource"&&r.source?.type==="Canvas"&&t===o)return n;if(r.type==="Range"){let s=Mt(e,e.get(r),t);if(s)return s}}return null}function Os(e,n,t,r=!1){let o=n.behavior,s=t?e.get(t):null;if(!s)return[];let i=s.behavior,a=r?!1:o.includes("paged"),u=a?!1:o.includes("continuous"),c=a||u?!1:o.includes("individuals"),l=i.includes("facing-pages"),d=i.includes("non-paged");if(l||d||c||r)return[{id:s.id,type:"Canvas"}];let[h,g]=We(e,n);if(u)return h;let v=h.findIndex(m=>m.id===t);if(v===-1)return[];for(let m of g)if(m.includes(v))return m.map(C=>h[C]);return[{id:s.id,type:"Canvas"}]}function We(e,n,{disablePaging:t,skipNonPaged:r}={}){let o=n.behavior,s=o.includes("paged"),i=s?!1:o.includes("continuous"),a=s||i?!1:o.includes("individuals"),u=n.type==="Manifest"?n.items:Ke(e,n);if(i)return[u,[u.map((v,m)=>m)]];if(a||!s||t)return[u,u.map((v,m)=>[m])];let c=[],l=[],d=()=>{l.length&&(c.push([...l]),l=[])},h=0,g=!1;for(let v=0;v<u.length;v++){let m=e.get(u[v]);if(m.behavior.includes("non-paged")){v===h&&h++,r||(d(),c.push([v]),d());continue}if(v===h||m.behavior.includes("facing-pages")){l.length&&(g=!0),d(),c.push([v]),d();continue}if(l.push(v),g){d(),g=!1;continue}l.length>1&&d()}return l.length&&d(),[u,c]}import{useCallback as Re,useMemo as Qr,useRef as Gr,useState as Zr}from"react";import{useMemo as jr}from"react";function wt(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.range,i=b(a=>s?a.iiif.entities.Range[s]:void 0,[s]);return jr(()=>{if(i)return r?r(i):i},[i,r,...n])}function Et({startCanvas:e,disablePaging:n}){let t=P(),r=w(),o=wt(),[s,i]=Zr(void 0),a=o||r;if(!a)throw new Error("Nothing selected");let[u,c]=Qr(()=>We(t,a,{disablePaging:n}),[t,a,n]),l=Gr(c);if(l.current!==c){let C=l.current[s][0],p=c.findIndex(S=>S.includes(C));l.current=c,i(p)}let d=Re(m=>{let C=c.findIndex(p=>p.includes(m));i(C===-1?0:C)},[u,c]),h=Re(m=>{let C=u.findIndex(p=>p.id===m);C!==-1?d(C):i(0)},[u,c]),g=Re(()=>{i(m=>m>=c.length-1?m:m+1)},[c]),v=Re(()=>{i(m=>m<=0?0:m-1)},[c]);return typeof s>"u"&&(e?h(e):i(0)),{visibleItems:c[s]?.map(m=>u[m].id)||[],cursor:s,items:u,sequence:c,hasPrevious:s>0,hasNext:s<c.length-1,setSequenceIndex:i,setCanvasIndex:d,setCanvasId:h,next:g,previous:v}}import{createContext as Qe,useContext as Ut,useEffect as Xr,useMemo as eo}from"react";import{useStore as le}from"zustand";import{createStore as kt}from"zustand/vanilla";function Qs(e){let n=e.service||e.services||[];for(let t of n)if(t.type==="AuthProbeService2")return!0;return!1}function H(e,n,t){let r=n.findIndex(i=>i.service.id===e);if(r===-1)return n;let o=[...n],s=t(o[r]);return s===o[r]?n:(o[r]=s,o)}var Nt=()=>kt((e,n)=>({currentAuth:-1,authItems:[],login:()=>{let t=n().authItems[n().currentAuth];if(!t||t.isPending||t.isLoggedIn)return;if(t.type!=="active")throw new Error("Cannot login to non-active service");let r=t.service.service.find(o=>o.type==="AuthAccessTokenService2");if(!r)throw new Error("Token service not found");e(()=>({authItems:H(t.id,n().authItems,o=>({...o,isPending:!0}))})),Vt(t.service).then(()=>{Ye(r).then(o=>{let s=o.expiresIn,i=Date.now()+s*1e3;e(()=>({authItems:H(t.id,n().authItems,a=>({...a,isLoggedIn:!0,isPending:!1,session:{token:o.accessToken,expires:i}}))}))}).catch(o=>{e(()=>({authItems:H(t.id,n().authItems,s=>({...s,isLoggedIn:!1,isPending:!1,error:o.message}))}))})})},logout:()=>{let t=n().authItems[n().currentAuth];if(!t||t.isPending||!t.isLoggedIn)return;if(t.type!=="active")throw new Error("Cannot logout of non-active service");let r=t.service.service.find(i=>i.type==="AuthLogoutService2");if(!r)return;let o=`${r.id}?origin=${Ot()}`,s=window.open(o);e(()=>({authItems:H(t.id,n().authItems,i=>({...i,isLoggedIn:!1,session:null,isPending:!1}))}))},nextAuth:()=>{let t=n().authItems.length,r=n().currentAuth+1;r>=t||e(()=>({currentAuth:r}))},previousAuth:()=>{let t=n().currentAuth-1;t<0||e(()=>({currentAuth:t}))},setAuth:t=>{t!==-1&&(t<0||t>=n().authItems.length)||e(()=>({currentAuth:t}))},addService:(t,r)=>{if(!t.service)return;let o=t.service.find(a=>a.type==="AuthAccessTokenService2"),s=t;if(n().authItems.find(a=>a.service.id===t.id)){e(()=>({authItems:H(t.id,n().authItems,a=>({...a,instances:a.instances+1}))}));return}if(e(()=>({currentAuth:s.profile==="active"?0:n().currentAuth,authItems:[{id:t.id,type:t.profile,service:t,probeId:r,canAuthenticate:!0,instances:1,isPending:!1,isLoggedIn:!1,session:null},...n().authItems]})),t.profile==="external"){if(!o)throw new Error("Token service not found");Ye(o).then(a=>{e(()=>({authItems:H(t.id,n().authItems,u=>({...u,isLoggedIn:!0,isPending:!1,session:{token:a.accessToken,expires:a.expiresIn}}))}))}).catch(a=>{e(()=>({authItems:H(t.id,n().authItems,u=>({...u,isLoggedIn:!1,isPending:!1,canAuthenticate:!1,error:a.message}))}))})}if(t.profile==="kiosk"){if(!o)throw new Error("Token service not found");e(()=>({authItems:H(t.id,n().authItems,a=>({...a,isPending:!0}))})),Vt(s).then(()=>{Ye(o).then(a=>{e(()=>({authItems:H(t.id,n().authItems,u=>({...u,isLoggedIn:!0,isPending:!1,session:{token:a.accessToken,expires:a.expiresIn}}))}))}).catch(a=>{e(()=>({authItems:H(t.id,n().authItems,u=>({...u,isLoggedIn:!1,isPending:!1,error:a.message}))}))})})}t.profile},removeService:(t,r)=>{let o=n().currentAuth===n().authItems.findIndex(i=>i.service.id===t.id),s=n().currentAuth;if(o){let i=n().authItems.find(u=>u.service.id===t.id);i&&i.instances>1||(s=n().authItems.findIndex(c=>c.service.id!==t.id&&c.instances>0))}e(()=>({authItems:H(t.id,n().authItems,i=>({...i,instances:i.instances-1})),currentAuth:s}))}})),Lt=(e,n)=>kt((t,r)=>({service:e,status:e?"unknown":"success",shouldRedirect:!1,redirectResource:null,shouldSubstitute:!1,substituteResource:null,error:null,errorHeading:null,errorNote:null,shouldDisplayResource:!1,token:n||null,async probe(){if(!r().service)return;let o=r().service?.id;if(!o){t({status:"error",error:"Service ID not found",errorHeading:{en:["Service ID not found"]}});return}t({status:"probing"});let s=r().token;try{let i=await fetch(o,{headers:s?{Authorization:`Bearer ${r().token}`,Accept:"application/json"}:{Accept:"application/json"}}).then(a=>a.json());if(i.status===200)t({status:"success",shouldDisplayResource:!0,error:null,errorHeading:null,errorNote:null,shouldSubstitute:!1,shouldRedirect:!1});else if(i.status<400&&i.status>=300){if(!i.location)throw new Error("Redirect location not found");t({status:"error",shouldDisplayResource:!1,shouldRedirect:!0,redirectResource:i.location||null})}else if(i.status===401)t({status:"error",shouldDisplayResource:!1,shouldRedirect:!1,shouldSubstitute:!!i.substitute,substituteResource:i.substitute||null,error:"Unauthorized",errorHeading:i.heading||{en:["Unauthorized"]},errorNote:i.note||null});else throw new Error("Unknown error")}catch(i){t({status:"error",error:i.message,errorHeading:{en:["Unknown error"]}})}},setToken(o){t({token:o})}}));function zt(e){let n=e.service||e.services||[],t={hasAuth:!1,services:{}};for(let r of n)if(r.type==="AuthProbeService2"){t.services.probe=r,t.hasAuth=!0;let o=r.service.filter(s=>s.type==="AuthAccessService2");o[0]&&(t.services.access=o[0])}return t}async function Ye(e,{strict:n=!0}={}){return new Promise((t,r)=>{let o=Math.random().toString(36).substring(7),s=`${e.id}?messageId=${o}&origin=${window.location.origin}`,i=c=>{let l=c.data;if(l.messageId===o){if(n&&l.type!=="AuthAccessToken2"){a(),r("Invalid response, expected type=AuthAccessToken2");return}if(!l.accessToken){a(),r("Invalid response, expected accessToken");return}a(),t(l)}},a=()=>window.removeEventListener("message",i),u=document.createElement("iframe");u.src=s,u.style.display="none",document.body.appendChild(u),window.addEventListener("message",i)})}function Ot(e){let n=window.location;if(e){let t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname+(t.port?":"+t.port:"")}return n.protocol+"//"+n.hostname+(n.port?":"+n.port:"")}async function Vt(e){let n=`${e.id}?origin=${Ot()}`,t=window.open(n);if(!t)throw new Error("Failed to open window");return new Promise((r,o)=>{let s=setInterval(()=>{t.closed&&(clearInterval(s),r())},500)})}import{useEffect as Ht,useMemo as Ft}from"react";import{useStore as Jr}from"zustand";function Dt(e){let n=Ft(()=>zt(e),[e]),t=$t(n.services.access?.id),r=Ft(()=>Lt(n.services.probe,t),[n.services.probe]),o=Jr(r);return Ht(()=>{o.status==="unknown"&&!t&&o.probe()},[n.services.probe,o.status]),Ht(()=>{t&&(o.setToken(t),o.probe())},[t]),[e,o,n.hasAuth]}import{jsx as Ae}from"react/jsx-runtime";var te=Qe(null),to=Qe(null);to.displayName="CurrentAuth";var no=Qe(null);no.displayName="AuthActions";function Bt({children:e}){let n=eo(()=>Nt(),[]);return Ae(te.Provider,{value:n,children:e})}function qt(){return!!Ut(te)}function de(){let e=Ut(te);if(!e)throw new Error("useAuthActions must be used within a AuthProvider");return e}function ro(){let e=de();return le(e,t=>({login:t.login,logout:t.logout,nextAuth:t.nextAuth,previousAuth:t.previousAuth,setAuth:t.setAuth,addService:t.addService,removeService:t.removeService}))}function fu(){let e=de();return le(e,n=>n)}function oo(e){let n=de();return le(n,r=>r.authItems.find(o=>o.service.id===e))}function $t(e){let n=de();return le(n,r=>r.authItems.find(o=>o.id===e)?.session?.token)}function pu(e){let n=de();return le(n,r=>{let o=r.authItems.find(s=>s.service.id===e);return!o||!o.isLoggedIn||!o.session?null:o.session?.token||null})}function io(e){let n=ro(),t=oo(e.service.id);return Xr(()=>(n?.addService(e.service,e.probeId),()=>{n?.removeService(e.service,e.probeId)}),[e.service]),t?(t.error||!t.isLoggedIn,e.children):null}function je(){return null}function _t(e){let[n,t,r]=Dt(e.resource),o=e.fallbackComponent||je,s=e.loadingComponent||je,i=e.errorComponent||je,a=t.service,u=null;if(!r||!a)return e.children(n);let c=a.service.filter(l=>l.type==="AuthAccessService2");t.status==="error"&&(u=Ae(i,{resource:e.resource,error:t.error||"",heading:t.errorHeading,note:t.errorNote,extra:e.extra})),(t.status==="unknown"||t.status==="probing")&&(u=Ae(s,{})),t.status==="success"&&(u=e.children(n));for(let l of c)u=Ae(io,{service:l,probeId:a.id,children:u},l.id);return u}import{createContext as co,useContext as Au,useMemo as lo}from"react";import{createStore as ao}from"zustand/vanilla";var so=e=>e.id||e["@id"];function uo(e){return(Array.isArray(e.service)?e.service:[e.service]).find(t=>t.profile==="http://iiif.io/api/search/0/autocomplete"||t.profile==="http://iiif.io/api/search/1/autocomplete"||t.profile==="AutoCompleteService1")}var Kt=e=>{let n;typeof e=="string"?n={"@context":"http://iiif.io/api/search/1/context.json",profile:"http://iiif.io/api/search/1/search","@id":e,id:e,service:[]}:n=e;let t=n?so(n):void 0,r=null;return ao((o,s)=>({service:n,resources:[],lastQuery:{},loading:!1,error:!1,highlight:null,hasSearch:!!n,hasAutocomplete:n?!!uo(n):!1,errorMessage:"",search(i,a={}){if(!t)throw new Error("No search service found.");r&&!r.signal.aborted&&r.abort(),r=new AbortController;let u=new URLSearchParams;i.q&&u.set("q",i.q),i.motivation&&u.set("motivation",i.motivation),i.date&&u.set("date",i.date),i.user&&u.set("user",i.user),o({loading:!0}),fetch(`${t}?${u.toString()}`,{signal:r.signal,headers:{"Content-Type":"application/json",Accept:"application/json",...a.headers||{}}}).then(async c=>{if(!r?.signal.aborted)if(c.ok){let l=await c.json();o({resources:l.resources,error:!1,errorMessage:""})}else o({resources:[],error:!0,errorMessage:c.statusText})})},clearSearch(){o({resources:[],error:!1,errorMessage:""})},highlightResult(i){let a=s().resources.find(u=>u["@id"]===i);o({highlight:a})},nextResult(){let i=s().resources,a=s().highlight;if(!a){o({highlight:i[0]||null});return}let u=i.findIndex(c=>c["@id"]===a["@id"]);if(u===-1){o({highlight:i[0]||null});return}o({highlight:i[u+1]||i[0]||null})},previousResult(){let i=s().resources,a=s().highlight;if(!a){o({highlight:i[i.length-1]||null});return}let u=i.findIndex(c=>c["@id"]===a["@id"]);if(u===-1){o({highlight:i[i.length-1]||null});return}if(u===0){o({highlight:i[i.length-1]||null});return}o({highlight:i[u-1]||i[i.length-1]||null})}}))};import{useStore as Mu}from"zustand";function Wt(){let e=w();return e?e.service.find(n=>n.profile==="SearchService1"||n.profile==="http://iiif.io/api/search/1/search"):void 0}import{jsx as Ge}from"react/jsx-runtime";var ne=co(null);ne.displayName="Search";function Yt(e){let n=Wt();return e.store?Ge(ne.Provider,{value:e.store,children:e.children}):Ge(mo,{service:n,children:e.children})}function mo({service:e,children:n}){let t=lo(()=>Kt(e),[e]);return Ge(ne.Provider,{value:t,children:n})}import{jsx as z}from"react/jsx-runtime";var me=()=>{},fe=po({setCurrentCanvasId:me,setCurrentCanvasIndex:me,nextCanvas:me,previousCanvas:me,items:[],sequence:[],setSequenceIndex:me,currentSequenceIndex:0,hasNext:!1,hasPrevious:!1});function vo(e){let n=w(),{cursor:t,visibleItems:r,next:o,sequence:s,items:i,setCanvasIndex:a,setCanvasId:u,previous:c,setSequenceIndex:l,hasNext:d,hasPrevious:h}=Et({startCanvas:e.startCanvas,disablePaging:e.pagingEnabled===!1}),g=go(()=>({sequence:s,items:i,setCurrentCanvasId:u,nextCanvas:o,previousCanvas:c,totalCanvases:i.length,setCurrentCanvasIndex:a,setSequenceIndex:l,currentSequenceIndex:t,hasNext:d,hasPrevious:h}),[s,i,u,o,c,i,a,l,t]);return n?r.length===0?null:z(fe.Provider,{value:g,children:z(ee.Provider,{value:r,children:z(_,{canvas:r[0],children:e.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),z("div",{children:"Sorry, something went wrong."}))}function jt(e){let n=X(e.vault),t=bt(e.manifest);if(!t)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),z("div",{children:"Sorry, something went wrong."});if(t.error)return z("div",{children:t.error.toString()});if(!t.isLoaded)return z("div",{children:"Loading..."});let r=z(vo,{...e,children:e.children});return z(J,{vault:n,children:z(Tt,{manifest:t.id,children:z(Bt,{children:z(Yt,{children:e.rangeId?z(It,{range:e.rangeId,children:r}):r})})})})}function Qt(){return fo(fe)}import ho from"react";import{createContext as yo,useMemo as So}from"react";import Co from"mitt";import{jsx as Ro}from"react/jsx-runtime";var xo=Co(),re=yo({emitter:xo});re.displayName="Events";function Gt(){return ho.useContext(re).emitter}function ic({emitter:e,children:n}){return Ro(re.Provider,{value:So(()=>({emitter:e}),[e]),children:n})}import Po from"react";import{jsx as K}from"react/jsx-runtime";var Ze=Po.createContext({});function Zt(){let e=D(Ze),n=Object.keys(e),t={};for(let r of n)e[r].Provider&&(t[r]={value:D(e[r]),Provider:e[r].Provider});return t}function bo(e){let n=Object.keys(e),t=e.children;for(let r of n){if(r==="children")continue;let{value:o,Provider:s}=e[r];t=K(s,{value:o,children:t})}return t}function Sc(e){let n=D(Ze),t=Ao(()=>({...n,...e.providers}),[e.providers]);return K(Ze.Provider,{value:t,children:e.children})}function Jt(){return{VaultContext:D(j),ResourceContext:D(Ce),SimpleViewerReactContext:D(fe),VisibleCanvasReactContext:D(ee),AuthRContext:D(te),SearchReactContext:D(ne),ReactEventContext:D(re)}}function Xt(e){return K(J,{vault:e.bridge.VaultContext.vault||void 0,resources:e.bridge.ResourceContext,children:K(ee.Provider,{value:e.bridge.VisibleCanvasReactContext,children:K(fe.Provider,{value:e.bridge.SimpleViewerReactContext,children:K(re.Provider,{value:e.bridge.ReactEventContext,children:K(te.Provider,{value:e.bridge.AuthRContext,children:K(ne.Provider,{value:e.bridge.SearchReactContext,children:e.custom?K(bo,{...e.custom,children:e.children}):e.children})})})})})})}import{createContext as Eo,useContext as Vo,useMemo as ko}from"react";import{useCallback as tn,useLayoutEffect as Io,useMemo as Mo,useRef as wo}from"react";import{entityActions as Je}from"@iiif/helpers/vault/actions";import{useMemo as To}from"react";function en(){let n=P().getStore();return To(()=>t=>n.dispatch(t),[n])}function nn(e){return typeof e!="string"&&e&&e.bindToVault}function rn(){let e=P(),n=wo([]),t=en(),r=Mo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);Io(()=>{let a={id:r,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};t(Je.importEntities({entities:{AnnotationPage:{[a.id]:a}}}))},[r]);let o=b(a=>r&&a.iiif.entities.AnnotationPage[r]||null,[r]),s=tn((a,u)=>{if(r){if(nn(a)){let d=a;d.__vault||d.bindToVault(e),a=typeof d.source=="string"?d.source:d.source.id,n.current[a]=d}else typeof a!="string"&&(a=a.id);let c=e.get({id:r,type:"AnnotationPage"}),l=e.get({id:a,type:"Annotation"});c&&l&&(c.items.find(d=>d.id===l.id)||t(Je.addReference({id:r,type:"AnnotationPage",key:"items",reference:{id:a,type:"Annotation"},index:u})))}},[r]),i=tn(a=>{r&&(nn(a)?a=typeof a.source=="string"?a.source:a.source.id:typeof a!="string"&&(a=a.id),n.current[a]&&n.current[a].beforeRemove(),e.get({id:r,type:"AnnotationPage"})&&t(Je.removeReference({id:r,type:"AnnotationPage",key:"items",reference:{id:a,type:"Annotation"}})))},[r]);return[o,{addAnnotation:s,removeAnnotation:i}]}import{jsx as No}from"react/jsx-runtime";var on=Eo(null);function an(){let e=Vo(on);return[e.fullPage,{addAnnotation:e.addAnnotation,removeAnnotation:e.removeAnnotation}]}function sn({children:e}){let[n,{addAnnotation:t,removeAnnotation:r}]=rn();return No(on.Provider,{value:ko(()=>({fullPage:n,addAnnotation:t,removeAnnotation:r}),[n]),children:e})}import{jsx as Xe,jsxs as Lo}from"react/jsx-runtime";function un({width:e,style:n,height:t,error:r,resetErrorBoundary:o}){return Lo("div",{style:{width:e,height:t,minHeight:500,...n||{},background:"#f9f9f9"},children:[Xe("h3",{children:"Error occurred"}),Xe("p",{children:r.message}),Xe("button",{type:"button",onClick:o,children:"Reset"})]})}import{createContext as zo,useContext as Oo}from"react";var Q=zo(null);function Pe(){return Oo(Q)}import{createContext as cn,useContext as Ho,useEffect as Fo}from"react";var et=cn(()=>{}),tt=cn(()=>{});function E(e,n,t,r,o=[]){let s=Ho(e==="portal"?tt:et);Fo(()=>(e!=="none"&&s(n,t,r),()=>{s(n,null)}),[n,e,s,...o])}import{createContext as $o,useContext as Uo,useEffect as Bo}from"react";import{useMemo as Do}from"react";function A(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.canvas,i=b(a=>s?a.iiif.entities.Canvas[s]:void 0,[s]);return Do(()=>{if(i)return r?r(i):i},[i,r,...n])}var nt=$o(()=>{});function ln(e){let n=A(),t=Uo(nt);Bo(()=>n&&n.id?(t(n.id,e),()=>t(n.id,-1)):()=>{},[n,e])}import{Fragment as Wo,jsx as V,jsxs as Yo}from"react/jsx-runtime";function fn({children:e,errorFallback:n,outerContainerProps:t={},worldScale:r,...o}){let[s,i]=be(),a=Zt(),u=Jt(),c=n||un,[l,d]=be({}),h=Object.entries(l),[g,v]=be({}),m=Object.entries(g),[C,p]=be({}),S=mn(()=>r||Math.max(...Object.values(C)),[C]),f=mn(()=>({maxOverZoom:S||1,...o.runtimeOptions||{}}),[S,o.runtimeOptions]),y=rt((R,x)=>{p(N=>{if(x===-1){let{[R]:he,...F}=N;return F}return{...N,[R]:x}})},[]),T=rt((R,x,N)=>{d(({[R]:he,...F})=>x?{...F,[R]:{element:x,props:N}}:F)},[]),I=rt((R,x,N)=>{v(({[R]:he,...F})=>x?{...F,[R]:{element:x,props:N}}:F)},[]);return Yo(Ko,{resetKeys:[],fallbackRender:R=>V(c,{...o,...R}),children:[V(qo,{...o,containerProps:{style:{position:"relative"},...o.containerProps||{}},htmlChildren:V(Wo,{children:h.map(([R,{element:x,props:N}])=>V(dn.Fragment,{children:V(x,{...N||{}})},R))}),onCreated:R=>{i(R),o.onCreated&&o.onCreated(R)},runtimeOptions:f,children:V(Q.Provider,{value:s,children:V(nt.Provider,{value:y,children:V(et.Provider,{value:T,children:V(tt.Provider,{value:I,children:V(Xt,{bridge:u,custom:a,children:V(_o.Provider,{value:o.mode||"explore",children:V(sn,{children:e})})})})})})})}),V("div",{children:m.map(([R,{element:x,props:N}])=>V(dn.Fragment,{children:V(x,{...N||{}})},R))})]})}import{mergeStyles as Xo,RegionHighlight as ei}from"@atlas-viewer/atlas";import{useMemo as pn}from"react";import{createEventsHelper as jo}from"@iiif/helpers/events";function Te(e,n){let t=P(),r=pn(()=>jo(t),[t]),o=b(()=>e&&e.id?t.getResourceMeta(e.id,"eventManager"):null,[e]);return pn(()=>e?r.getListenersAsProps(e,n):{},[o,e,t,n])}import{useMemo as Qo}from"react";import{createStylesHelper as Go}from"@iiif/helpers/styles";function oe(e,n){let t=P(),r=Qo(()=>Go(t),[t]);return b(()=>{if(!e)return null;let o=r.getAppliedStyles(e.id);return o?n?o[n]:o:void 0},[e,n])}import{useMemo as ti}from"react";import{useMemo as Zo}from"react";import{expandTarget as Jo}from"@iiif/helpers/annotation-targets";function Ie(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=P(),i=t||o.annotation,a=b(c=>i?c.iiif.entities.Annotation[i]:void 0,[i]),u=b(c=>a&&a.body?a.body.map(l=>l?l.type==="SpecificResource"?{...l,source:s.get(l)}:l?c.iiif.entities[l.type][l.id]:null:null).filter(Boolean):[],[a]);return Zo(()=>{if(!a)return;let c={...a,body:u,target:Jo(a.target,{typeMap:s.getState().iiif.mapping})};return r?r(c):c},[a,r,u,...n])}import{jsx as ni}from"react/jsx-runtime";var Me=({id:e,style:n,className:t,interactive:r})=>{let o=Ie({id:e}),s=oe(o,"atlas"),i=oe(o,"html"),a=Te(o,["atlas"]),u=A(),c=ti(()=>Xo(n,s),[n,s]);return u&&o&&o.target&&o.target.selector&&o.target.selector.type==="BoxSelector"&&o.target.source&&(o.target.source.id===u.id||o.target.source===u.id)?ni(ei,{id:o.id,isEditing:!0,region:o.target.selector.spatial,style:c,className:i?.className||t,interactive:!!(i?.href||r),href:i?.href||null,title:i?.title||null,hrefTarget:i?.target||null,onClick:()=>{},...a}):null};import{Fragment as oi}from"react";import{useMemo as ri}from"react";function gn(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.annotationPage,i=b(a=>s?a.iiif.entities.AnnotationPage[s]:void 0,[s]);return ri(()=>{if(i)return r?r(i):i},[i,...n])}import{jsx as vn}from"react/jsx-runtime";var pe=({className:e,page:n})=>{let t=gn({id:n.id})||n,r=oe(t,"atlas"),o=oe(t,"html");return b(s=>t.id?s.iiif.entities.AnnotationPage[t.id]:null,[]),vn(oi,{children:t.items?.map(s=>vn(Me,{id:s.id,style:r,className:o?.className||e},s.id))})};import{useEffect as ot,useMemo as it}from"react";import{useEffect as wn,useMemo as En}from"react";import{useCallback as Sn,useMemo as ai}from"react";function ii(e,n){let t=e?.iiif?.meta[n];return t?t.annotationPageManager:null}function hn(e,n){return b(t=>{let r=[];if(!e)return r;let o=Object.keys(t.iiif.entities.AnnotationPage);for(let s of o)if(!n||n.indexOf(s)!==-1){let i=ii(t,s);i&&i.views&&i.views[e]&&r.push(s)}return r},[e,n])}function yn({canvas:e,manifest:n,all:t,canvases:r}){let o=[];if(n)for(let s of n.annotations)o.indexOf(s.id)===-1&&o.push(s.id);if(t){if(r&&r.length)for(let s of r)for(let i of s.annotations)o.indexOf(i.id)===-1&&o.push(i.id)}else if(e)for(let s of e.annotations)o.indexOf(s.id)===-1&&o.push(s.id);return o}function si(e,n){let t=e?.iiif?.meta[n];return t?t.annotationPageManager:null}function Cn(e,n={}){let t=P(),r=w(),o=A(),s=xe(),i=ai(()=>yn({all:n.all,manifest:r,canvas:o,canvases:s}),[n.all,o,s,r]),a=hn(e,n.all?void 0:i),u=Sn(l=>{e&&t.setMetaValue([l,"annotationPageManager","views"],d=>d&&!d[e]?d:{...d||{},[e]:!1})},[e,t]),c=Sn((l,d={})=>{if(!e)return;let h=t.getState(),g=[];if(d?.deselectOthers){let v=Object.keys(h.iiif.entities.AnnotationPage);for(let m of v){let C=si(h,m);C&&C.views&&C.views[e]&&g.push(m)}}for(let v of g)u(v);t.setMetaValue([l,"annotationPageManager","views"],v=>v&&v[e]?v:{...v||{},[e]:!0})},[e,u,t]);return{availablePageIds:i,enabledPageIds:a,setPageEnabled:c,setPageDisabled:u}}function xn(e,n){return b((t,r)=>r.get(e.map(o=>({id:o,type:n}))),[e,n])}import di from"mitt";import{useCallback as mi}from"react";import{createStore as fi}from"zustand";import ui,{useContext as ci}from"react";import{imageServices as li}from"@iiif/helpers/image-service";import{useStore as we}from"zustand";var Rn=ui.createContext(li.store);Rn.displayName="ImageServicesHelper";function Ee(){return ci(Rn)}function An(e){let n=Ee();return we(n,({loaded:t})=>t[e])}function Ve(){let e=Ee();return we(e,({loadServiceSync:n})=>n)}function Pn(){let e=Ee();return we(e,({loaded:n})=>n)}function pd(){let e=Ee();return we(e,({loadService:n})=>n)}var pi=fi((e,n)=>({loaded:{},setLoaded:(t,r="done")=>{e(o=>({loaded:{...o.loaded,[t]:r}}))}})),gi=di();gi.on("loaded",e=>{pi.getState().setLoaded(e.imageServiceId)});function bn(){let e=Ve(),n=Pn();return[mi((r,{height:o,width:s})=>r&&e(r,{height:o,width:s},!0),[e]),n]}import{useCallback as vi,useMemo as In,useState as hi}from"react";function Tn(e={}){let n=Ie(),t=A(e.canvasId?{id:e.canvasId}:void 0);return b((r,o)=>{if(!t)return[];if(n&&e.enableSingleAnnotation)return[n];let s=o.get(t.items),i=[];for(let a of s)i.push(...o.get(a.items));return i},[t])}import{createPaintingAnnotationsHelper as yi}from"@iiif/helpers/painting-annotations";function Mn(e,n=[]){let t=P(),r=In(()=>yi(t),[]),o=Tn({enableSingleAnnotation:e?.enableSingleAnnotation}),[s,i]=hi(e?.defaultChoices||[]),a=In(()=>r.getPaintables(o,s),[t,o,s,...n]),c={makeChoice:vi((l,{deselectOthers:d=!0,deselect:h=!1}={})=>{a.choice&&i(g=>{if(h){let m=g.filter(C=>C!==l);if(m.length===0){let C=a.items[0].resource.id;return C?[C]:[]}return m}if(d)return[l];let v=[...g];if(v.length===0&&a.items.length){let m=a.items[0].resource.id;m&&v.push(m)}return g.indexOf(l)!==-1?g:[...g,l]})},[a.choice])};return[a,c]}function Vn(e){let n=w(),t=A(),r=P(),o=Gt(),s=e?.emitter||o,[i,a]=bn(),{enabledPageIds:u}=Cn(e?.annotationPageManagerId||n?.id||t?.id,{all:!1}),c=xn(u,"AnnotationPage"),l=e?.strategies||["empty","images","media","textual-content","complex-timeline"],[d,h]=Mn(e,[a]);wn(()=>{let v=m=>{h.makeChoice(m.choiceId,{deselectOthers:m.deselectOthers,deselect:m.deselect})};return s.on("make-choice",v),()=>{s.off("make-choice",v)}},[]);let g=En(()=>xt({canvas:t,paintables:d,supports:l,loadImageService:i,vault:r}),[t,d,r,h.makeChoice]);return wn(()=>{let v=d.allChoices,m={canvasId:t?.id,manifestId:n?.id};v&&s.emit("choice-change",{choice:v,partOf:m})},[t?.id,d.allChoices]),En(()=>g.type==="unknown"?[g,Ct]:[{...g,annotations:{pages:c}},h],[g,c])}import{createContext as Si,useContext as Ci}from"react";var ke=Si(null);ke.displayName="Strategy";function M(){let e=Ci(ke);if(!e)throw new Error("useStrategy must be used within a StrategyProvider");return e}import{createStylesHelper as Ai}from"@iiif/helpers";import{createContext as xi,useContext as Ri}from"react";var Ne=xi(null);Ne.displayName="Controls";function L(){let e=Ri(Ne);if(!e)throw new Error("useStrategy must be used within a StrategyProvider");return e}import{jsx as kn}from"react/jsx-runtime";function Nn({strategies:e,registerActions:n,defaultChoices:t,onChoiceChange:r,mediaControlsDeps:o,renderMediaControls:s,renderViewerControls:i,viewControlsDeps:a,renderComplexTimelineControls:u,complexTimelineControlsDeps:c,throwOnUnknown:l,children:d}){let h=A(),g=P(),v=it(()=>Ai(g),[g]),[m,C]=Vn({strategies:e||["images"],defaultChoices:t?.map(({id:y})=>y)}),p="choice"in m?m.choice:void 0;if(ot(()=>{n&&n(C)},[m.annotations]),ot(()=>{r&&r(p)},[p]),ot(()=>{if(t)for(let y of t)typeof y.opacity<"u"&&v.applyStyles({id:y.id},"atlas",{opacity:y.opacity})},[t]),m.type==="unknown"&&l)throw new Error(m.reason||"Unknown strategy");let S=it(()=>({renderMediaControls:s,mediaControlsDeps:o||[],renderViewerControls:i,viewControlsDeps:a||[],renderComplexTimelineControls:u,complexTimelineControlsDeps:c||[]}),[o,s,i,a,u,c]),f=it(()=>({strategy:m,actions:C,choices:"choice"in m?m.choice:[]}),[m,h]);return kn(Ne.Provider,{value:S,children:kn(ke.Provider,{value:f,children:d})})}import{useMemo as Pi}from"react";import{jsx as bi}from"react/jsx-runtime";function Ln({x:e=0,y:n=0,keepCanvasScale:t,children:r}){let{strategy:o}=M(),s=A(),i=Te(s,["deep-zoom"]),a=Pi(()=>t?1:Math.max(1,...o.type==="images"?o.images.map(c=>(c.width||0)/c.target?.spatial.width):[]),[t,o]);ln(a);let u=o.type==="images"?o.images.length:0;return s?bi("world-object",{height:s.height,width:s.width,x:e,y:n,...i,children:r},`${s.id}/${o.type}/${u}`):null}import{jsx as Ti}from"react/jsx-runtime";function Le({style:e}){let n=A();return!n||!n.height||!n.width?null:Ti("box",{interactive:!1,target:{x:0,y:0,width:Number(n.width),height:Number(n.height)},style:e})}import{jsx as Ii}from"react/jsx-runtime";function zn({backgroundStyle:e,alwaysShowBackground:n}){let{strategy:t}=M();return t.type!=="empty"&&!n?null:Ii(Le,{style:e})}import{useLayoutEffect as Ki,useMemo as Wi}from"react";import Ei from"mitt";import{useCallback as $,useEffect as at,useReducer as Mi,useRef as ze}from"react";function On(e){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:e}}function wi(e,n){switch(n.type){case"RESET":return n.state;case"FINISHED":return{...e,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...e,isFinished:!1,isPlaying:!e.isPlaying};case"PLAY_REQUESTED":return{...e,isFinished:!1,playRequested:!0};case"PAUSE":return{...e,isPlaying:!1};case"PLAY":return{...e,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...e,isMuted:!0};case"SET_VOLUME":return{...e,volume:n.volume,isMuted:n.volume===0};case"TOGGLE_MUTE":return{...e,isMuted:!e.isMuted};case"UNMUTE":return{...e,isMuted:!1}}return e}function st(e){let n=Math.round(e);return`${Math.floor(n/60)}:${`${n%60}`.padStart(2,"0")}`}function ie(e){let[n,t]=Mi(wi,On(e.duration));at(()=>{t({type:"RESET",state:On(e.duration)})},[e.duration]);let r=ze(null),o=ze(null),s=ze(null),i=ze(!1),a=$(()=>{o.current&&r.current&&(o.current.innerHTML=st(r.current.currentTime),s.current&&(s.current.style.width=`${r.current.currentTime/e.duration*100}%`),i.current!==r.current.muted&&(i.current=r.current.muted,t(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[e.duration]),u=$(()=>{r.current&&(t({type:"PLAY_REQUESTED"}),r.current.play().then(()=>{t({type:"PLAY"})}),a())},[a]),c=$(()=>{r.current&&(r.current.duration>0&&r.current.paused?u():l())},[a]),l=$(()=>{r.current&&(r.current.pause(),t({type:"PAUSE"}),a())},[a]),d=$(()=>{r.current&&(r.current.muted=!r.current.muted,t(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),h=$(()=>{r.current&&(r.current.muted=!0,t({type:"MUTE"}))},[]),g=$(()=>{r.current&&(r.current.muted=!1,t({type:"UNMUTE"}))},[]),v=$(p=>{r.current&&(r.current.muted=!1,r.current.volume=p/100,t({type:"SET_VOLUME",volume:p}))},[]),m=$(p=>{r.current&&(r.current.currentTime=Math.max(0,Math.min(p*e.duration,e.duration)),a())},[]),C=$(p=>{if(r.current){let S=typeof p=="function"?p(r.current.currentTime):p;r.current.currentTime=Math.max(0,Math.min(S,e.duration)),a()}},[]);return at(()=>{let p=setInterval(()=>{a()},350);return()=>clearInterval(p)},[a,e.duration]),at(()=>{let p=()=>{t({type:"FINISHED"})},S=r.current;return S?.addEventListener("ended",p),()=>S?.removeEventListener("ended",p)},[]),[{element:r,currentTime:o,progress:s},n,{play:u,pause:l,playPause:c,mute:h,unmute:g,toggleMute:d,setVolume:v,setDurationPercent:m,setTime:C}]}import{createStore as Vi}from"zustand/vanilla";function Hn({currentKeyFrameIndex:e,keyframes:n,targetTime:t,currentTime:r}){if(r<=t){let o=n.findIndex(a=>a.time>t);if(o===-1)return[e,[]];let s={},i=n.slice(e,o);for(let a of i)a.type==="enter"&&(s[a.id]=a),a.type==="exit"&&(s[a.id]?delete s[a.id]:s[a.id]=a);return[o,Object.values(s)]}return[e,[]]}function Fn({complexTimeline:e,startTime:n=0}){let t=Ei(),r={},o={progress:null,currentTime:null},s=0,i=null,a=0,u=null;function c(){let S=C.getState().visibleElements,f=r,y=[],T=Object.keys(f);for(let I of T){let R=f[I],x=S[I];R&&x&&y.push(R)}return y}function l(){return Object.keys(r).map(S=>r[S])}function d(p){o.currentTime&&(o.currentTime.innerHTML=st(p),o.progress&&(o.progress.style.width=`${p/e.duration*100}%`))}let h=()=>{let p=C.getState(),S=p.currentPrime;if(!S)return;let f=r,y=p.visibleElements,T=Object.keys(f);for(let I of T){let R=f[I],x=y[I];if(R&&I!==S.id&&x){let N=a-x.time*1e3;Math.abs(a-x.time*1e3-R.currentTime*1e3)>300&&(R.currentTime=N/1e3)}}},g=(p=0)=>{let S=p-s,f=C.getState();if(f.isPlaying){let y=f.currentPrime;if(y){let x=r[y.id];x&&(x.paused?a+=S:a=(y.time+x.currentTime)*1e3)}else a+=S;let T=a/1e3;if(T>f.duration){C.getState().setTime(0),C.setState({isPlaying:!1}),v(),d(0);return}d(T);let[I,R]=Hn({currentTime:T,currentKeyFrameIndex:f.nextKeyframeIndex,keyframes:f.complexTimeline.keyframes,targetTime:T});R.length&&f.applyKeyframes(I,R)}s=p,i=requestAnimationFrame(g)},v=()=>{i&&cancelAnimationFrame(i)},m=(p,S)=>{},C=Vi((p,S)=>({complexTimeline:e,elements:{},visibleElements:{},isBuffering:!1,bufferMap:{},isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,isReady:!1,volume:100,duration:e.duration,clockStartRequests:0,clockStartTime:0,primeTime:0,currentPrime:null,clockRunning:!1,nextKeyframeIndex:0,startClock:()=>{S().clockRunning||(g(),u=setInterval(h,500)),p({clockRunning:!0,clockStartRequests:S().clockStartRequests+1})},applyKeyframes(f,y){let T=S(),I={...T.visibleElements},R=T.currentPrime;for(let x of y)x.type==="enter"&&(I[x.id]=x,t.emit("complex-timeline.enter",{id:x.id})),x.type==="exit"&&(I[x.id]=null,t.emit("complex-timeline.exit",{id:x.id})),x.isPrime&&(R=x);p({nextKeyframeIndex:f,visibleElements:I,currentPrime:R})},stopClock:()=>{let f=S().clockStartRequests;if(f!==0){if(f===1){v(),u&&clearInterval(u),p({clockRunning:!1,clockStartRequests:0});return}p({clockStartRequests:f-1})}},setElement:(f,y)=>{r[f]=y;let T=Object.keys(r),I=S().complexTimeline;m(y,f),I.items.filter(x=>x.type!=="Image"&&x.type!=="Text").every(x=>T.includes(x.annotationId))&&!S().isReady&&(t.emit("complex-timeline.ready",{complexTimeline:I}),p({isReady:!0}))},removeElement:f=>{delete r[f]},mute(){for(let f of l())f.muted=!0;p({isMuted:!0})},unmute(){for(let f of l())f.muted=!1;p({isMuted:!1})},play(){if(!S().isPlaying){for(let y of c())y.play();p({isPlaying:!0})}},pause(){if(S().isPlaying){for(let y of c())y.pause();p({isPlaying:!1})}},playPause(){let f=S();f.isPlaying?f.pause():f.play()},setDurationPercent(f){let T=S().duration*f;S().setTime(T)},setTime(f){let y=S(),T=a/1e3,I=typeof f=="function"?f(T):f,R=y.nextKeyframeIndex;if(T>I){p({visibleElements:{},currentPrime:null});let ye=Object.keys(y.visibleElements);for(let Se of ye)t.emit("complex-timeline.exit",{id:Se});T=0,R=0}let[x,N]=Hn({currentTime:T,currentKeyFrameIndex:R,keyframes:y.complexTimeline.keyframes,targetTime:I});y.applyKeyframes(x,N),a=I*1e3;let F=C.getState().visibleElements,Pr=r,br=Object.keys(F);for(let ye of br){let Se=F[ye];if(Se){let St=Pr[ye];St&&(St.currentTime=(a-Se.time*1e3)/1e3)}}d(I)},setVolume(f){for(let y of l())y.volume=Math.min(1,Math.max(0,f/100));p({volume:f})},toggleMute(){let f=S();f.isMuted?(f.unmute(),p({isMuted:!1})):(f.mute(),p({isMuted:!0}))},clearProgressElement(){o.progress=null},setProgressElement(f){o.progress=f},setCurrentTimeElement(f){o.currentTime=f},clearCurrentTimeElement(){o.currentTime=null}}));return t.on("complex-timeline.enter",p=>{let S=C.getState(),f=p.id,y=r[f];y&&S.isPlaying&&y.play()}),t.on("complex-timeline.exit",p=>{let S=C.getState(),f=p.id,y=r[f];y&&(y.currentTime=0,y.pause())}),C.getState().setTime(n),{store:C,emitter:t}}import{HTMLPortal as Yi}from"@atlas-viewer/atlas";import{Fragment as jn,useMemo as Di}from"react";import{HTMLPortal as zi,TileSet as Wn}from"@atlas-viewer/atlas";import ae,{useMemo as ut}from"react";import{jsx as U}from"react/jsx-runtime";var $n=ae.createContext("en"),Un=ae.createContext({}),Bn=ae.createContext(null);function Nm(e){return U(Un.Provider,{value:e.translations,children:e.children})}function Lm(e){return U($n.Provider,{value:e.language,children:e.children})}function zm(e){return U(Bn.Provider,{value:e.convert,children:e.children})}function qn(){return ae.useContext(Bn)}function ct(){return ae.useContext($n)}function _n(){return ae.useContext(Un)}function Dn(e){return e.indexOf("-")!==-1?e.slice(0,e.indexOf("-")):e}function ki({as:e,language:n,children:t,viewingDirection:r,...o}){let s=ct();return ut(()=>Dn(s)===Dn(n),[s,n])?e?U(e,{...o,children:t}):U("span",{...o,children:t}):e?U(e,{...o,lang:n,dir:r,children:t}):U("span",{...o,lang:n,dir:r,children:t})}function Kn(e,n,t){if(n.length===0)return;if(n.length===1)return n[0];if(n.indexOf(e)!==-1)return e;let r=e.indexOf("-")!==-1?e.slice(0,e.indexOf("-")):null;if(r&&n.indexOf(r)!==-1)return r;for(let o of t)if(n.indexOf(o)!==-1)return o;return n.indexOf("none")!==-1?"none":n.indexOf("@none")!==-1?"@none":n[0]}var Ni=(e,n=[])=>{let t=ct();return ut(()=>{let r=e();return Kn(t,r,[])},[t,...n])};function G(e,n,t,r){return n?t?t(e[n]||n,r||"none"):e[n]||n:""}function Li(e,n,t=`
|
|
2
|
-
`,r={}){let o=qn(),s=Ni(()=>Object.keys(e||{}),[e]);return[ut(()=>{if(!e)return G(r,n,o)||"";if(typeof e=="string")return G(r,e,o);let i=s?e[s]:void 0;return i?typeof i=="string"?i:i.map(a=>G(r,a,o,s)).join(t):""},[s,n,e]),s]}function Om(){let e=ct(),n=_n(),t=qn();return function(o,s="",i=`
|
|
3
|
-
`,a=n){let u=Object.keys(o||{}),c=Kn(e,u,[]);if(!o)return G(a,s,t)||"";if(typeof o=="string")return G(a,o,t);let l=c?o[c]:void 0;return l?typeof l=="string"?G(a,l,t,c):l.map(d=>G(a,d,t,c)).join(typeof i<"u"?i:`
|
|
4
|
-
`):""}}function ge({as:e,defaultText:n,enableDangerouslySetInnerHTML:t,children:r,separator:o,...s}){let i=_n(),[a,u]=Li(r,n,o,i);return u?U(ki,{...s,as:e,language:u,title:t?void 0:a,dangerouslySetInnerHTML:t?{__html:a}:void 0,children:t?void 0:a}):e?U(e,{...s,children:a}):U("span",{...s,title:t?void 0:a,dangerouslySetInnerHTML:t?{__html:a}:void 0,children:t?void 0:a})}import{getId as Oi}from"@iiif/parser/image-3";import{jsx as W,jsxs as Fi}from"react/jsx-runtime";function Hi({resource:e,heading:n,note:t,extra:r}){return r?W(zi,{target:{x:0,y:0,width:r.target?.spatial.width,height:r.target?.spatial.height},backgroundColor:"#333",relative:!0,children:W("div",{style:{display:"flex",alignContent:"center",justifyContent:"center",alignItems:"center",height:"100%",width:"100%",background:"#444",color:"#BBB"},children:Fi("div",{children:[W(ge,{children:n||"Not authorised"}),t&&W("p",{children:W(ge,{children:t})}),W("p",{children:e.id||e["@id"]||"unknown"})]})})}):null}function Yn({image:e,thumbnail:n,crop:t,enableSizes:r,enableThumbnail:o,renderOptions:s}){let i=qt(),a=Oi(e.service),u=An(a),c=Ve(),l=u?.service;c(e.service,e);let d=l&&u?.status==="done",h=n&&n.type==="fixed"&&n.id&&!n.id.includes("/full/full/")&&!n.id.includes("/max/")?n:void 0;if(d===!1)return null;if(!i){let g=e.service,v=g.width||e.width||0,m=g.height||e.height||0;return W(Wn,{enableThumbnail:o,renderOptions:s,tiles:{id:g.id||g["@id"]||"unknown",height:m,width:v,imageService:g,thumbnail:h},enableSizes:r,x:0,y:0,width:e.target?.spatial.width,height:e.target?.spatial.height,crop:t})}return W(_t,{resource:e.service,errorComponent:Hi,extra:e,children:g=>{let v=g.width||e.width||0,m=g.height||e.height||0;return W(Wn,{enableThumbnail:o,renderOptions:s,tiles:{id:g.id||g["@id"]||"unknown",height:m,width:v,imageService:g,thumbnail:h},enableSizes:r,x:0,y:0,width:e.target?.spatial.width,height:e.target?.spatial.height,crop:t})}},e.id)}import{jsx as lt,jsxs as Qn}from"react/jsx-runtime";function se({id:e,image:n,thumbnail:t,isStatic:r,x:o=0,y:s=0,children:i,selector:a,onClick:u,enableSizes:c}){let l=Di(()=>{if(!(!a||a.spatial.x===0&&a.spatial.y===0))return a.spatial},[a]);return lt("world-object",{x:o+n.target.spatial.x,y:s+n.target.spatial.y,width:n.target.spatial.width,height:n.target.spatial.height,onClick:u,children:n.service?Qn(jn,{children:[lt(Yn,{image:n,thumbnail:t,crop:l,enableSizes:c}),i]},"service"):Qn(jn,{children:[lt("world-image",{onClick:u,uri:n.id,target:{x:0,y:0,width:n.target.spatial.width,height:n.target.spatial.height},display:n.width&&n.height?{width:n.width,height:n.height}:void 0,crop:l}),i]},"no-service")},e+(n.service?"server":"no-service"))}import{useStore as Jn}from"zustand";import{createContext as $i,useContext as Ui}from"react";import{useStore as Bi}from"zustand";import{jsx as qi}from"react/jsx-runtime";var dt=$i(null);dt.displayName="ComplexTimeline";function Gn({children:e,store:n}){return qi(dt.Provider,{value:n,children:e})}function rf(e){let n=Ui(dt);if(!n)throw new Error("useComplexTimeline must be used within a ComplexTimelineProvider");return Bi(n,e)}import{HTMLPortal as _i}from"@atlas-viewer/atlas";import{Fragment as Zn,jsx as ve}from"react/jsx-runtime";function Oe({strategy:e,onClickPaintingAnnotation:n}){return ve(Zn,{children:e.items.map((t,r)=>ve(Zn,{children:ve(_i,{onClick:n?o=>{o.stopPropagation(),n(t.annotationId,t,o)}:void 0,target:t.target?.spatial||void 0,children:ve("div",{"data-textual-content":!0,children:ve(ge,{enableDangerouslySetInnerHTML:!0,children:t.text})})},r)}))})}import{Fragment as ji,jsx as He,jsxs as Qi}from"react/jsx-runtime";function Xn({strategy:e,children:n}){let{store:t}=Wi(()=>Fn({complexTimeline:e}),[e]),r=Jn(t,i=>i.isReady),o=Jn(t,i=>i.visibleElements);function s(i){return a=>{a&&t.getState().setElement(i,a)}}return Ki(()=>{if(r){let{startClock:i,stopClock:a}=t.getState();return i(),()=>{a()}}},[e,r]),E("portal","custom-controls",Gn,{store:t,children:n},[r]),Qi(ji,{children:[e.items.map(i=>i.type!=="Image"||!o[i.annotationId]?null:He(se,{image:i,id:i.annotationId},i.id)),e.items.map((i,a)=>i.type!=="Text"||!o[i.annotationId]?null:He(Oe,{strategy:{type:"textual-content",items:[i]}},a)),e.items.map((i,a)=>i.type!=="Video"||!i.target.spatial?null:He(Yi,{target:i.target.spatial,children:He("video",{ref:s(i.annotationId),src:i.url,style:{height:"100%",width:"100%",opacity:o[i.annotationId]?1:0}})},a))]})}import{jsx as Gi}from"react/jsx-runtime";function er(){let{strategy:e}=M(),{renderComplexTimelineControls:n}=L();return e.type!=="complex-timeline"?null:Gi(Xn,{strategy:e,children:n?n(e):null})}import{Fragment as Ji,jsx as Zi,jsxs as Xi}from"react/jsx-runtime";function tr({onClickPaintingAnnotation:e,children:n}){let{strategy:t}=M(),{renderViewerControls:r,viewControlsDeps:o}=L(),s=Pe(),i=A();return E(s&&t.type==="textual-content"&&r?"overlay":"none",`canvas-portal-controls-${i?.id}`,Q.Provider,r?{value:s||null,children:r(t)}:{},[i,s,t,...o||[]]),t.type!=="textual-content"?null:Xi(Ji,{children:[Zi(Oe,{strategy:t,onClickPaintingAnnotation:e}),n]})}import{useEffect as ia,useMemo as aa,useRef as sa,useState as ua}from"react";import{useEffect as ea}from"react";var nr=(e,n=[])=>{let t=P();ea(()=>{e(t)},[t,...n])};import ta,{useContext as na}from"react";import{ImageServiceLoader as ra}from"@iiif/helpers/image-service";var oa=ta.createContext(new ra);function rr(){return na(oa)}import{createThumbnailHelper as ca}from"@iiif/helpers/thumbnail";function ue(e,n,{canvasId:t,manifestId:r}={}){let o=P(),s=rr(),i=aa(()=>ca(o,{imageServiceLoader:s}),[o,s]),[a,u]=ua(),c=w(r?{id:r}:void 0),l=A(t?{id:t}:void 0),d=l||c,h=sa(!1);if(ia(()=>(h.current=!1,()=>{h.current=!0}),[]),!d)throw new Error("Must be called under a manifest or canvas context.");return nr(g=>{i.getBestThumbnailAtSize(d,e,n).then(v=>{v.best&&!h.current&&u(v.best)})},[d]),a}import{Fragment as da,jsx as la,jsxs as ma}from"react/jsx-runtime";function or({isStatic:e=!1,enableSizes:n=!1,onClickPaintingAnnotation:t,children:r}){let{strategy:o}=M(),{renderViewerControls:s,viewControlsDeps:i}=L(),a=A(),u=Pe(),c=ue({maxWidth:256,maxHeight:256});return E(u&&o.type==="images"&&s?"overlay":"none",`canvas-portal-controls-${a?.id}`,Q.Provider,s?{value:u||null,children:s(o)}:{},[a,u,o,...i||[]]),o.type!=="images"?null:ma(da,{children:[o.images.map((l,d)=>la(se,{isStatic:e,image:l,id:l.id,thumbnail:d===0?c:void 0,selector:l.selector,enableSizes:n,onClick:t?h=>{t(l.annotationId,l,h)}:void 0},l.id+d)),r]})}import{Fragment as fa,jsx as mt,jsxs as pa}from"react/jsx-runtime";function ft({model:e}){return pa(fa,{children:[mt("style",{children:`
|
|
5
|
-
.model-container {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
right: 0;
|
|
11
|
-
background: #000;
|
|
12
|
-
z-index: 13;
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
pointer-events: visible;
|
|
16
|
-
}
|
|
17
|
-
`}),mt("div",{className:"model-container",children:mt("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:e.id})})]})}function Fe({model:e,name:n}){return E("overlay",`model-${n}`,ft,{model:e},[e]),null}import{jsx as ga}from"react/jsx-runtime";function ir(){let{strategy:e}=M();return e.type!=="3d-model"?null:ga(Fe,{model:e.model})}import{Fragment as va,jsx as ar,jsxs as ha}from"react/jsx-runtime";function sr({children:e}){let{strategy:n}=M(),[t]=an();return n.type!=="images"?null:ha(va,{children:[t?ar(pe,{page:t}):null,n.annotations&&n.annotations.pages?n.annotations.pages.map(r=>ar(pe,{page:r},r.id)):null,e]})}import{createContext as gt,useContext as vt}from"react";import{jsx as pt}from"react/jsx-runtime";var ur=gt(null),cr=gt(null),lr=gt(null);function vp(){let e=vt(ur);if(!e)throw new Error("Ctx not found");return e}function hp(){let e=vt(cr);if(!e)throw new Error("Ctx not found");return e}function yp(){let e=vt(lr);if(!e)throw new Error("Ctx not found");return e}function De({actions:e,state:n,children:t,currentTime:r,progress:o,element:s}){return pt(lr.Provider,{value:{currentTime:r,progress:o,element:s},children:pt(cr.Provider,{value:e,children:pt(ur.Provider,{value:n,children:t})})})}import{useMemo as ya}from"react";import{expandTarget as Sa}from"@iiif/helpers";function $e(){let e=w(),n=A();return ya(()=>{if(!e||!n||!e.start)return null;let t=Sa(e.start);return!t||t.source.id!==n.id||!t||!t.selector||t.selector.type!=="TemporalSelector"?null:t.selector.temporal},[e,n])}import{jsx as Ca,jsxs as xa}from"react/jsx-runtime";function ht({media:e,startTime:n,children:t}){let[{element:r,currentTime:o,progress:s},i,a]=ie({duration:e.duration}),u=n?`${e.url}#t=${n}`:e.url;return xa(De,{state:i,actions:a,currentTime:o,progress:s,element:r,children:[Ca("audio",{ref:r,src:u}),t]},e.url)}function Ue({media:e,mediaControlsDeps:n,audioCopmonent:t=ht,children:r}){let o=$e();return E("portal","audio",t,{media:e,startTime:o?o.startTime:null,children:r},[e,o,...n||[]]),null}import{jsx as dr}from"react/jsx-runtime";function ce({x:e=0,y:n=0}){let t=A(),r=ue({maxWidth:256,maxHeight:256});return!t||!r||r.type!=="fixed"?null:dr("world-object",{height:t.height,width:t.width,x:e,y:n,children:dr("world-image",{uri:r.id,target:{x:0,y:0,width:t.width,height:t.height},display:r.width&&r.height?{width:r.width,height:r.height}:void 0,crop:void 0})})}import{Fragment as Aa,jsx as mr,jsxs as Ra}from"react/jsx-runtime";function fr({as:e}){let{strategy:n}=M(),{renderMediaControls:t,mediaControlsDeps:r}=L();return n.type!=="media"||n.media.type!=="Sound"?null:mr(Aa,{children:Ra(Ue,{media:n.media,mediaControlsDeps:r,audioCopmonent:e,children:[mr(ce,{}),t?t(n):null]},n.media.url)})}import{Fragment as Pa,jsx as Be,jsxs as ba}from"react/jsx-runtime";function pr(){let{strategy:e}=M(),{renderViewerControls:n,viewControlsDeps:t}=L(),r=A(),o=r?.accompanyingCanvas,s=r?.placeholderCanvas;return ba(Pa,{children:[e.type==="media"&&e.media.type==="Sound"&&o?Be(_,{canvas:o.id,children:Be(Z,{renderViewerControls:n,viewControlsDeps:t})}):null,e.type==="media"&&e.media.type==="Sound"&&s&&!o?Be(_,{canvas:s.id,children:Be(Z,{renderViewerControls:n,viewControlsDeps:t})}):null]})}import{jsx as gr,jsxs as Ta}from"react/jsx-runtime";function yt({element:e,media:n,startTime:t,playPause:r,poster:o}){let s="div",i=t?`${n.url}#t=${t}`:n.url;return Ta(s,{className:"video-container",part:"video-container",onClick:r,children:[gr("style",{children:`
|
|
18
|
-
.video-container {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 0;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
right: 0;
|
|
24
|
-
background: #000;
|
|
25
|
-
z-index: 13;
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
pointer-events: visible;
|
|
29
|
-
}
|
|
30
|
-
`}),gr("video",{poster:o,ref:e,src:i,style:{width:"100%",objectFit:"contain"}})]})}function qe({media:e,mediaControlsDeps:n,children:t,videoComponent:r=yt,captions:o}){let s=A(),i=$e(),a=s&&s.placeholderCanvas&&s.placeholderCanvas.id||void 0,u=ue({},!1,{canvasId:a}),[{element:c,currentTime:l,progress:d},h,g]=ie({duration:e.duration});return E("overlay","video-element",r,{element:c,media:e,playPause:g.playPause,poster:u?.id,canvas:s,startTime:i?i.startTime:null,captions:o},[u]),E("portal","custom-controls",De,{state:h,actions:g,currentTime:l,progress:d,element:c,children:t},[l,h,e,...n||[]]),null}import{jsx as Ia,jsxs as Ma}from"react/jsx-runtime";function vr({as:e}){let{strategy:n}=M(),{renderMediaControls:t,mediaControlsDeps:r}=L();return n.type!=="media"||n.media.type!=="Video"?null:Ma(qe,{captions:n.captions,media:n.media,mediaControlsDeps:r,videoComponent:e,children:[Ia(ce,{}),t?t(n):null]},n.media.url)}import{useRef as wa}from"react";import{jsx as hr,jsxs as Va}from"react/jsx-runtime";function Ea({element:e,media:n,playPause:t}){let r=wa(null);return n.youTubeId?Va("div",{className:"video-container",part:"video-container",onClick:t,children:[hr("style",{children:`
|
|
31
|
-
.video-container {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 0;
|
|
34
|
-
bottom: 0;
|
|
35
|
-
left: 0;
|
|
36
|
-
right: 0;
|
|
37
|
-
background: #000;
|
|
38
|
-
z-index: 13;
|
|
39
|
-
display: flex;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
pointer-events: visible;
|
|
42
|
-
}
|
|
43
|
-
.video-yt {
|
|
44
|
-
border: none;
|
|
45
|
-
width: 100%;
|
|
46
|
-
object-fit: contain;
|
|
47
|
-
}
|
|
48
|
-
`}),hr("iframe",{className:"video-yt",ref:r,src:`https://www.youtube.com/embed/${n.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function yr({media:e,mediaControlsDeps:n,children:t}){let[{element:r,currentTime:o,progress:s},i,a]=ie({duration:e.duration});return E("overlay","video-element",Ea,{element:r,media:e,playPause:a.playPause}),null}import{jsx as ka,jsxs as Na}from"react/jsx-runtime";function Sr(){let{strategy:e}=M(),{renderMediaControls:n,mediaControlsDeps:t}=L();return e.type!=="media"||e.media.type!=="VideoYouTube"?null:Na(yr,{media:e.media,mediaControlsDeps:t,children:[ka(ce,{}),n?n(e):null]})}import{jsx as B,jsxs as Cr}from"react/jsx-runtime";function Z({x:e,y:n,onChoiceChange:t,registerActions:r,defaultChoices:o,isStatic:s,renderViewerControls:i,renderMediaControls:a,renderComplexTimelineControls:u,complexTimelineControlsDeps:c,viewControlsDeps:l,mediaControlsDeps:d,strategies:h,throwOnUnknown:g,backgroundStyle:v,alwaysShowBackground:m,keepCanvasScale:C=!1,enableSizes:p=!1,enableYouTube:S=!0,onClickPaintingAnnotation:f,components:y={},children:T}){return Cr(Nn,{throwOnUnknown:g,onChoiceChange:t,registerActions:r,strategies:h,defaultChoices:o,mediaControlsDeps:d,renderMediaControls:a,renderViewerControls:i,renderComplexTimelineControls:u,complexTimelineControlsDeps:c,viewControlsDeps:l,children:[Cr(Ln,{keepCanvasScale:C,x:e,y:n,children:[B(zn,{alwaysShowBackground:m,backgroundStyle:v}),B(er,{}),B(tr,{}),B(or,{isStatic:s,enableSizes:p,onClickPaintingAnnotation:f}),B(sr,{}),B(ir,{}),B(fr,{as:y.Audio}),B(vr,{as:y.Video}),S?B(Sr,{}):null,T]}),B(pr,{})]})}import{jsx as xr}from"react/jsx-runtime";function Rr(e){let n=A();return!n||!n.placeholderCanvas?null:xr(_,{canvas:n.placeholderCanvas.id,children:xr(Z,{renderViewerControls:e.renderViewerControls})})}import{Fragment as Oa,jsx as q,jsxs as Ha}from"react/jsx-runtime";var za=Ar(function(n,t){let r=w(),o=xe(),s=Qt(),{ViewerControls:i,MediaControls:a,ComplexTimelineControls:u}=n.components||{};if(La(t,()=>s,[s]),!r)return q("div",{});let c=0;return Ha(Oa,{children:[n.header,q(k.Viewer,{height:n.height,mode:n.mode,renderPreset:n.renderPreset,runtimeOptions:n.runtimeOptions,children:o.map((l,d)=>{let h=c;return c+=l.width+(n.spacing||0),q(_,{canvas:l.id,children:q(k.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content","complex-timeline"],renderViewerControls:d===0&&i?()=>q(i,{}):void 0,renderMediaControls:d===0&&a?()=>q(a,{}):void 0,renderComplexTimelineControls:d===0&&u?()=>q(u,{}):void 0,x:h,...n.canvasProps||{},children:n.annotations},l.id)},l.id)})},n.reuseAtlas?"":s.currentSequenceIndex),n.children]})}),k=Ar(function({children:n,height:t,annotations:r,canvasProps:o,spacing:s,header:i,components:a,mode:u,reuseAtlas:c,renderPreset:l,runtimeOptions:d,...h},g){let v=X();return q(J,{vault:v,children:q(jt,{...h,children:q(za,{ref:g,height:t,components:a,spacing:s,canvasProps:o,annotations:r,header:i,mode:u,reuseAtlas:c,renderPreset:l,runtimeOptions:d,children:n})})})});k.RenderImage=se;k.RenderCanvas=Z;k.RenderAnnotationPage=pe;k.RenderAnnotation=Me;k.Viewer=fn;k.CanvasBackground=Le;k.Audio=Ue;k.Video=qe;k.Model=Fe;k.AudioHTML=ht;k.VideoHTML=yt;k.ModelHTML=ft;k.PlaceholderCanvas=Rr;export{Ce as a,O as b,Y as c,j as d,J as e,X as f,Pt as g,bt as h,Tt as i,_ as j,P as k,b as l,ee as m,xe as n,w as o,It as p,Yr as q,Ke as r,Ns as s,Mt as t,Os as u,We as v,wt as w,Et as x,Qs as y,Nt as z,Lt as A,zt as B,Ye as C,Vt as D,te as E,to as F,no as G,Bt as H,qt as I,de as J,ro as K,fu as L,oo as M,$t as N,pu as O,_t as P,Wt as Q,fe as R,vo as S,jt as T,Qt as U,xo as V,re as W,Gt as X,ic as Y,Zt as Z,bo as _,Sc as $,Jt as aa,Xt as ba,en as ca,rn as da,an as ea,sn as fa,un as ga,Q as ha,Pe as ia,E as ja,A as ka,fn as la,Te as ma,oe as na,Ie as oa,gn as pa,yn as qa,Cn as ra,xn as sa,Ve as ta,pd as ua,bn as va,Tn as wa,Mn as xa,Vn as ya,ke as za,M as Aa,Ne as Ba,L as Ca,Nn as Da,Ln as Ea,zn as Fa,st as Ga,ie as Ha,Nm as Ia,Lm as Ja,zm as Ka,qn as La,ct as Ma,_n as Na,ki as Oa,Ni as Pa,Li as Qa,Om as Ra,ge as Sa,se as Ta,Gn as Ua,rf as Va,er as Wa,tr as Xa,nr as Ya,oa as Za,rr as _a,ue as $a,or as ab,ir as bb,sr as cb,vp as db,hp as eb,yp as fb,De as gb,$e as hb,ce as ib,fr as jb,pr as kb,vr as lb,Sr as mb,k as nb};
|