react-iiif-vault 0.9.19 → 0.9.20
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/cjs/index.js +5 -5
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +8 -4
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/index.umd.js +17 -17
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +5 -5
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +8 -4
- package/dist/react17/esm/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -9,26 +9,26 @@ object-assign
|
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/(function(r){var e,i,o,l;if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();r.unstable_now=function(){return d.now()-h}}if(typeof window=="undefined"||typeof MessageChannel!="function"){var g=null,p=null,m=function(){if(g!==null)try{var A=r.unstable_now();g(!0,A),g=null}catch(K){throw setTimeout(m,0),K}};e=function(A){g!==null?setTimeout(e,0,A):(g=A,setTimeout(m,0))},i=function(A,K){p=setTimeout(A,K)},o=function(){clearTimeout(p)},r.unstable_shouldYield=function(){return!1},l=r.unstable_forceFrameRate=function(){}}else{var
|
|
12
|
+
*/(function(r){var e,i,o,l;if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();r.unstable_now=function(){return d.now()-h}}if(typeof window=="undefined"||typeof MessageChannel!="function"){var g=null,p=null,m=function(){if(g!==null)try{var A=r.unstable_now();g(!0,A),g=null}catch(K){throw setTimeout(m,0),K}};e=function(A){g!==null?setTimeout(e,0,A):(g=A,setTimeout(m,0))},i=function(A,K){p=setTimeout(A,K)},o=function(){clearTimeout(p)},r.unstable_shouldYield=function(){return!1},l=r.unstable_forceFrameRate=function(){}}else{var S=window.setTimeout,x=window.clearTimeout;if(typeof console!="undefined"){var O=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof O!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var R=!1,N=null,I=-1,k=5,P=0;r.unstable_shouldYield=function(){return r.unstable_now()>=P},l=function(){},r.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<A?Math.floor(1e3/A):5};var j=new MessageChannel,V=j.port2;j.port1.onmessage=function(){if(N!==null){var A=r.unstable_now();P=A+k;try{N(!0,A)?V.postMessage(null):(R=!1,N=null)}catch(K){throw V.postMessage(null),K}}else R=!1},e=function(A){N=A,R||(R=!0,V.postMessage(null))},i=function(A,K){I=S(function(){A(r.unstable_now())},K)},o=function(){x(I),I=-1}}function W(A,K){var ne=A.length;A.push(K);e:for(;;){var ce=ne-1>>>1,we=A[ce];if(we!==void 0&&0<q(we,K))A[ce]=K,A[ne]=we,ne=ce;else break e}}function Q(A){return A=A[0],A===void 0?null:A}function J(A){var K=A[0];if(K!==void 0){var ne=A.pop();if(ne!==K){A[0]=ne;e:for(var ce=0,we=A.length;ce<we;){var lt=2*(ce+1)-1,at=A[lt],ut=lt+1,Ze=A[ut];if(at!==void 0&&0>q(at,ne))Ze!==void 0&&0>q(Ze,at)?(A[ce]=Ze,A[ut]=ne,ce=ut):(A[ce]=at,A[lt]=ne,ce=lt);else if(Ze!==void 0&&0>q(Ze,ne))A[ce]=Ze,A[ut]=ne,ce=ut;else break e}}return K}return null}function q(A,K){var ne=A.sortIndex-K.sortIndex;return ne!==0?ne:A.id-K.id}var b=[],le=[],fe=1,Ee=null,re=3,Tt=!1,Ve=!1,gt=!1;function on(A){for(var K=Q(le);K!==null;){if(K.callback===null)J(le);else if(K.startTime<=A)J(le),K.sortIndex=K.expirationTime,W(b,K);else break;K=Q(le)}}function F(A){if(gt=!1,on(A),!Ve)if(Q(b)!==null)Ve=!0,e(ue);else{var K=Q(le);K!==null&&i(F,K.startTime-A)}}function ue(A,K){Ve=!1,gt&&(gt=!1,o()),Tt=!0;var ne=re;try{for(on(K),Ee=Q(b);Ee!==null&&(!(Ee.expirationTime>K)||A&&!r.unstable_shouldYield());){var ce=Ee.callback;if(typeof ce=="function"){Ee.callback=null,re=Ee.priorityLevel;var we=ce(Ee.expirationTime<=K);K=r.unstable_now(),typeof we=="function"?Ee.callback=we:Ee===Q(b)&&J(b),on(K)}else J(b);Ee=Q(b)}if(Ee!==null)var lt=!0;else{var at=Q(le);at!==null&&i(F,at.startTime-K),lt=!1}return lt}finally{Ee=null,re=ne,Tt=!1}}var bt=l;r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(A){A.callback=null},r.unstable_continueExecution=function(){Ve||Tt||(Ve=!0,e(ue))},r.unstable_getCurrentPriorityLevel=function(){return re},r.unstable_getFirstCallbackNode=function(){return Q(b)},r.unstable_next=function(A){switch(re){case 1:case 2:case 3:var K=3;break;default:K=re}var ne=re;re=K;try{return A()}finally{re=ne}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=bt,r.unstable_runWithPriority=function(A,K){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var ne=re;re=A;try{return K()}finally{re=ne}},r.unstable_scheduleCallback=function(A,K,ne){var ce=r.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ce+ne:ce):ne=ce,A){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ne+we,A={id:fe++,callback:K,priorityLevel:A,startTime:ne,expirationTime:we,sortIndex:-1},ne>ce?(A.sortIndex=ne,W(le,A),Q(b)===null&&A===Q(le)&&(gt?o():gt=!0,i(F,ne-ce))):(A.sortIndex=we,W(b,A),Ve||Tt||(Ve=!0,e(ue))),A},r.unstable_wrapCallback=function(A){var K=re;return function(){var ne=re;re=K;try{return A.apply(this,arguments)}finally{re=ne}}}})(Fo),Ao.exports=Fo;/** @license React v0.26.2
|
|
13
13
|
* react-reconciler.production.min.js
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/(function(r){r.exports=function(i){var o={},l=Cc,u=De.default,d=Ao.exports;function h(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,p=60103,m=60106,
|
|
19
|
+
*/(function(r){r.exports=function(i){var o={},l=Cc,u=De.default,d=Ao.exports;function h(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,p=60103,m=60106,S=60107,x=60108,O=60114,R=60109,N=60110,I=60112,k=60113,P=60120,j=60115,V=60116,W=60121,Q=60129,J=60130,q=60131;if(typeof Symbol=="function"&&Symbol.for){var b=Symbol.for;p=b("react.element"),m=b("react.portal"),S=b("react.fragment"),x=b("react.strict_mode"),O=b("react.profiler"),R=b("react.provider"),N=b("react.context"),I=b("react.forward_ref"),k=b("react.suspense"),P=b("react.suspense_list"),j=b("react.memo"),V=b("react.lazy"),W=b("react.block"),b("react.scope"),Q=b("react.debug_trace_mode"),J=b("react.offscreen"),q=b("react.legacy_hidden")}var le=typeof Symbol=="function"&&Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}function Ee(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case m:return"Portal";case O:return"Profiler";case x:return"StrictMode";case k:return"Suspense";case P:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case N:return(t.displayName||"Context")+".Consumer";case R:return(t._context.displayName||"Context")+".Provider";case I:var n=t.render;return n=n.displayName||n.name||"",t.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case j:return Ee(t.type);case W:return Ee(t._render);case V:n=t._payload,t=t._init;try{return Ee(t(n))}catch{}}return null}function re(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&1026)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function Tt(t){if(re(t)!==t)throw Error(h(188))}function Ve(t){var n=t.alternate;if(!n){if(n=re(t),n===null)throw Error(h(188));return n!==t?null:t}for(var s=t,a=n;;){var c=s.return;if(c===null)break;var f=c.alternate;if(f===null){if(a=c.return,a!==null){s=a;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===s)return Tt(c),t;if(f===a)return Tt(c),n;f=f.sibling}throw Error(h(188))}if(s.return!==a.return)s=c,a=f;else{for(var v=!1,w=c.child;w;){if(w===s){v=!0,s=c,a=f;break}if(w===a){v=!0,a=c,s=f;break}w=w.sibling}if(!v){for(w=f.child;w;){if(w===s){v=!0,s=f,a=c;break}if(w===a){v=!0,a=f,s=c;break}w=w.sibling}if(!v)throw Error(h(189))}}if(s.alternate!==a)throw Error(h(190))}if(s.tag!==3)throw Error(h(188));return s.stateNode.current===s?t:n}function gt(t){if(t=Ve(t),!t)return null;for(var n=t;;){if(n.tag===5||n.tag===6)return n;if(n.child)n.child.return=n,n=n.child;else{if(n===t)break;for(;!n.sibling;){if(!n.return||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null}function on(t){if(t=Ve(t),!t)return null;for(var n=t;;){if(n.tag===5||n.tag===6)return n;if(n.child&&n.tag!==4)n.child.return=n,n=n.child;else{if(n===t)break;for(;!n.sibling;){if(!n.return||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null}function F(t,n){for(var s=t.alternate;n!==null;){if(n===t||n===s)return!0;n=n.return}return!1}var ue=i.getPublicInstance,bt=i.getRootHostContext,A=i.getChildHostContext,K=i.prepareForCommit,ne=i.resetAfterCommit,ce=i.createInstance,we=i.appendInitialChild,lt=i.finalizeInitialChildren,at=i.prepareUpdate,ut=i.shouldSetTextContent,Ze=i.createTextInstance,Xn=i.scheduleTimeout,ge=i.cancelTimeout,Se=i.noTimeout,me=i.isPrimaryRenderer,Pe=i.supportsMutation,ct=i.supportsPersistence,dt=i.supportsHydration,Lf=i.getInstanceFromNode,Of=i.makeOpaqueHydratingObject,Ps=i.makeClientId,Fa=i.beforeActiveInstanceBlur,Nf=i.afterActiveInstanceBlur,Rf=i.preparePortalMount,Yn=i.supportsTestSelectors,zf=i.findFiberRoot,Af=i.getBoundingRect,Ff=i.getTextContent,qn=i.isHiddenSubtree,Df=i.matchAccessibilityRole,Uf=i.setFocusIfFocusable,bf=i.setupIntersectionObserver,Bf=i.appendChild,jf=i.appendChildToContainer,Hf=i.commitTextUpdate,Vf=i.commitMount,Wf=i.commitUpdate,Qf=i.insertBefore,Xf=i.insertInContainerBefore,Yf=i.removeChild,qf=i.removeChildFromContainer,Da=i.resetTextContent,Zf=i.hideInstance,Gf=i.hideTextInstance,Kf=i.unhideInstance,Jf=i.unhideTextInstance,Cs=i.clearContainer,$f=i.cloneInstance,Ua=i.createContainerChildSet,ba=i.appendChildToContainerChildSet,eg=i.finalizeContainerChildren,Ba=i.replaceContainerChildren,ja=i.cloneHiddenInstance,Ha=i.cloneHiddenTextInstance,tg=i.canHydrateInstance,ng=i.canHydrateTextInstance,ig=i.isSuspenseInstancePending,rg=i.isSuspenseInstanceFallback,Ts=i.getNextHydratableSibling,Va=i.getFirstHydratableChild,sg=i.hydrateInstance,og=i.hydrateTextInstance,lg=i.getNextHydratableInstanceAfterSuspenseInstance,Wa=i.commitHydratedContainer,ag=i.commitHydratedSuspenseInstance,Is;function Zn(t){if(Is===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Is=n&&n[1]||""}return`
|
|
20
20
|
`+Is+t}var ks=!1;function Gi(t,n){if(!t||ks)return"";ks=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(C){var a=C}Reflect.construct(t,[],n)}else{try{n.call()}catch(C){a=C}t.call(n.prototype)}else{try{throw Error()}catch(C){a=C}t()}}catch(C){if(C&&a&&typeof C.stack=="string"){for(var c=C.stack.split(`
|
|
21
21
|
`),f=a.stack.split(`
|
|
22
|
-
`),v=c.length-1,
|
|
23
|
-
`+c[v].replace(" at new "," at ");while(1<=v&&0<=S);break}}}finally{ks=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?Zn(t):""}var Ms=[],yn=-1;function Bt(t){return{current:t}}function pe(t){0>yn||(t.current=Ms[yn],Ms[yn]=null,yn--)}function xe(t,n){yn++,Ms[yn]=t.current,t.current=n}var jt={},Ue=Bt(jt),We=Bt(!1),ln=jt;function wn(t,n){var s=t.type.contextTypes;if(!s)return jt;var a=t.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in s)c[f]=n[f];return a&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=c),c}function Qe(t){return t=t.childContextTypes,t!=null}function Ki(){pe(We),pe(Ue)}function Qa(t,n,s){if(Ue.current!==jt)throw Error(h(168));xe(Ue,n),xe(We,s)}function Xa(t,n,s){var a=t.stateNode;if(t=n.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var c in a)if(!(c in t))throw Error(h(108,Ee(n)||"Unknown",c));return l({},s,a)}function Ji(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||jt,ln=Ue.current,xe(Ue,t),xe(We,We.current),!0}function Ya(t,n,s){var a=t.stateNode;if(!a)throw Error(h(169));s?(t=Xa(t,n,ln),a.__reactInternalMemoizedMergedChildContext=t,pe(We),pe(Ue),xe(Ue,t)):pe(We),xe(We,s)}var Ls=null,an=null,ug=d.unstable_now;ug();var $i=0,de=8;function un(t){if((1&t)!==0)return de=15,1;if((2&t)!==0)return de=14,2;if((4&t)!==0)return de=13,4;var n=24&t;return n!==0?(de=12,n):(t&32)!==0?(de=11,32):(n=192&t,n!==0?(de=10,n):(t&256)!==0?(de=9,256):(n=3584&t,n!==0?(de=8,n):(t&4096)!==0?(de=7,4096):(n=4186112&t,n!==0?(de=6,n):(n=62914560&t,n!==0?(de=5,n):t&67108864?(de=4,67108864):(t&134217728)!==0?(de=3,134217728):(n=805306368&t,n!==0?(de=2,n):(1073741824&t)!==0?(de=1,1073741824):(de=8,t))))))}function cg(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function dg(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(h(358,t))}}function Gn(t,n){var s=t.pendingLanes;if(s===0)return de=0;var a=0,c=0,f=t.expiredLanes,v=t.suspendedLanes,S=t.pingedLanes;if(f!==0)a=f,c=de=15;else if(f=s&134217727,f!==0){var C=f&~v;C!==0?(a=un(C),c=de):(S&=f,S!==0&&(a=un(S),c=de))}else f=s&~v,f!==0?(a=un(f),c=de):S!==0&&(a=un(S),c=de);if(a===0)return 0;if(a=31-Ht(a),a=s&((0>a?0:1<<a)<<1)-1,n!==0&&n!==a&&(n&v)===0){if(un(n),c<=de)return n;de=c}if(n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=a;0<n;)s=31-Ht(n),c=1<<s,a|=t[s],n&=~c;return a}function qa(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function er(t,n){switch(t){case 15:return 1;case 14:return 2;case 12:return t=Sn(24&~n),t===0?er(10,n):t;case 10:return t=Sn(192&~n),t===0?er(8,n):t;case 8:return t=Sn(3584&~n),t===0&&(t=Sn(4186112&~n),t===0&&(t=512)),t;case 2:return n=Sn(805306368&~n),n===0&&(n=268435456),n}throw Error(h(358,t))}function Sn(t){return t&-t}function Os(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function tr(t,n,s){t.pendingLanes|=n;var a=n-1;t.suspendedLanes&=a,t.pingedLanes&=a,t=t.eventTimes,n=31-Ht(n),t[n]=s}var Ht=Math.clz32?Math.clz32:gg,hg=Math.log,fg=Math.LN2;function gg(t){return t===0?32:31-(hg(t)/fg|0)|0}var pg=d.unstable_runWithPriority,Ns=d.unstable_scheduleCallback,Rs=d.unstable_cancelCallback,mg=d.unstable_shouldYield,Za=d.unstable_requestPaint,zs=d.unstable_now,vg=d.unstable_getCurrentPriorityLevel,nr=d.unstable_ImmediatePriority,Ga=d.unstable_UserBlockingPriority,Ka=d.unstable_NormalPriority,Ja=d.unstable_LowPriority,$a=d.unstable_IdlePriority,As={},yg=Za!==void 0?Za:function(){},It=null,ir=null,Fs=!1,eu=zs(),ze=1e4>eu?zs:function(){return zs()-eu};function En(){switch(vg()){case nr:return 99;case Ga:return 98;case Ka:return 97;case Ja:return 96;case $a:return 95;default:throw Error(h(332))}}function tu(t){switch(t){case 99:return nr;case 98:return Ga;case 97:return Ka;case 96:return Ja;case 95:return $a;default:throw Error(h(332))}}function kt(t,n){return t=tu(t),pg(t,n)}function Kn(t,n,s){return t=tu(t),Ns(t,n,s)}function Je(){if(ir!==null){var t=ir;ir=null,Rs(t)}nu()}function nu(){if(!Fs&&It!==null){Fs=!0;var t=0;try{var n=It;kt(99,function(){for(;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}}),It=null}catch(s){throw It!==null&&(It=It.slice(t+1)),Ns(nr,Je),s}finally{Fs=!1}}}var wg=g.ReactCurrentBatchConfig;function Sg(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var $e=typeof Object.is=="function"?Object.is:Sg,Eg=Object.prototype.hasOwnProperty;function rr(t,n){if($e(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++)if(!Eg.call(n,s[a])||!$e(t[s[a]],n[s[a]]))return!1;return!0}function xg(t){switch(t.tag){case 5:return Zn(t.type);case 16:return Zn("Lazy");case 13:return Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 2:case 15:return t=Gi(t.type,!1),t;case 11:return t=Gi(t.type.render,!1),t;case 22:return t=Gi(t.type._render,!1),t;case 1:return t=Gi(t.type,!0),t;default:return""}}function ht(t,n){if(t&&t.defaultProps){n=l({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}var sr=Bt(null),or=null,xn=null,lr=null;function Ds(){lr=xn=or=null}function iu(t,n){t=t.type._context,me?(xe(sr,t._currentValue),t._currentValue=n):(xe(sr,t._currentValue2),t._currentValue2=n)}function Us(t){var n=sr.current;pe(sr),t=t.type._context,me?t._currentValue=n:t._currentValue2=n}function ru(t,n){for(;t!==null;){var s=t.alternate;if((t.childLanes&n)===n){if(s===null||(s.childLanes&n)===n)break;s.childLanes|=n}else t.childLanes|=n,s!==null&&(s.childLanes|=n);t=t.return}}function _n(t,n){or=t,lr=xn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(ft=!0),t.firstContext=null)}function et(t,n){if(lr!==t&&n!==!1&&n!==0)if((typeof n!="number"||n===1073741823)&&(lr=t,n=1073741823),n={context:t,observedBits:n,next:null},xn===null){if(or===null)throw Error(h(308));xn=n,or.dependencies={lanes:0,firstContext:n,responders:null}}else xn=xn.next=n;return me?t._currentValue:t._currentValue2}var Vt=!1;function bs(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function su(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Wt(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function Qt(t,n){if(t=t.updateQueue,t!==null){t=t.shared;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}}function ou(t,n){var s=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var c=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var v={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};f===null?c=f=v:f=f.next=v,s=s.next}while(s!==null);f===null?c=f=n:f=f.next=n}else c=f=n;s={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:a.shared,effects:a.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function Jn(t,n,s,a){var c=t.updateQueue;Vt=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var C=S,z=C.next;C.next=null,v===null?f=z:v.next=z,v=C;var X=t.alternate;if(X!==null){X=X.updateQueue;var $=X.lastBaseUpdate;$!==v&&($===null?X.firstBaseUpdate=z:$.next=z,X.lastBaseUpdate=C)}}if(f!==null){$=c.baseState,v=0,X=z=C=null;do{S=f.lane;var U=f.eventTime;if((a&S)===S){X!==null&&(X=X.next={eventTime:U,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ae=t,ve=f;switch(S=n,U=s,ve.tag){case 1:if(ae=ve.payload,typeof ae=="function"){$=ae.call(U,$,S);break e}$=ae;break e;case 3:ae.flags=ae.flags&-4097|64;case 0:if(ae=ve.payload,S=typeof ae=="function"?ae.call(U,$,S):ae,S==null)break e;$=l({},$,S);break e;case 2:Vt=!0}}f.callback!==null&&(t.flags|=32,S=c.effects,S===null?c.effects=[f]:S.push(f))}else U={eventTime:U,lane:S,tag:f.tag,payload:f.payload,callback:f.callback,next:null},X===null?(z=X=U,C=$):X=X.next=U,v|=S;if(f=f.next,f===null){if(S=c.shared.pending,S===null)break;f=S.next,S.next=null,c.lastBaseUpdate=S,c.shared.pending=null}}while(1);X===null&&(C=$),c.baseState=C,c.firstBaseUpdate=z,c.lastBaseUpdate=X,hi|=v,t.lanes=v,t.memoizedState=$}}function lu(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var a=t[n],c=a.callback;if(c!==null){if(a.callback=null,a=s,typeof c!="function")throw Error(h(191,c));c.call(a)}}}var au=new u.Component().refs;function ar(t,n,s,a){n=t.memoizedState,s=s(a,n),s=s==null?n:l({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var ur={isMounted:function(t){return(t=t._reactInternals)?re(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var a=qe(),c=qt(t),f=Wt(a,c);f.payload=n,s!=null&&(f.callback=s),Qt(t,f),Rt(t,c,a)},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var a=qe(),c=qt(t),f=Wt(a,c);f.tag=1,f.payload=n,s!=null&&(f.callback=s),Qt(t,f),Rt(t,c,a)},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=qe(),a=qt(t),c=Wt(s,a);c.tag=2,n!=null&&(c.callback=n),Qt(t,c),Rt(t,a,s)}};function uu(t,n,s,a,c,f,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,f,v):n.prototype&&n.prototype.isPureReactComponent?!rr(s,a)||!rr(c,f):!0}function cu(t,n,s){var a=!1,c=jt,f=n.contextType;return typeof f=="object"&&f!==null?f=et(f):(c=Qe(n)?ln:Ue.current,a=n.contextTypes,f=(a=a!=null)?wn(t,c):jt),n=new n(s,f),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ur,t.stateNode=n,n._reactInternals=t,a&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=c,t.__reactInternalMemoizedMaskedChildContext=f),n}function du(t,n,s,a){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,a),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,a),n.state!==t&&ur.enqueueReplaceState(n,n.state,null)}function Bs(t,n,s,a){var c=t.stateNode;c.props=s,c.state=t.memoizedState,c.refs=au,bs(t);var f=n.contextType;typeof f=="object"&&f!==null?c.context=et(f):(f=Qe(n)?ln:Ue.current,c.context=wn(t,f)),Jn(t,s,c,a),c.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(ar(t,n,f,s),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(n=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),n!==c.state&&ur.enqueueReplaceState(c,c.state,null),Jn(t,s,c,a),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4)}var cr=Array.isArray;function $n(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(h(309));var a=s.stateNode}if(!a)throw Error(h(147,t));var c=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===c?n.ref:(n=function(f){var v=a.refs;v===au&&(v=a.refs={}),f===null?delete v[c]:v[c]=f},n._stringRef=c,n)}if(typeof t!="string")throw Error(h(284));if(!s._owner)throw Error(h(290,t))}return t}function dr(t,n){if(t.type!=="textarea")throw Error(h(31,Object.prototype.toString.call(n)==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":n))}function hu(t){function n(x,E){if(t){var T=x.lastEffect;T!==null?(T.nextEffect=E,x.lastEffect=E):x.firstEffect=x.lastEffect=E,E.nextEffect=null,E.flags=8}}function s(x,E){if(!t)return null;for(;E!==null;)n(x,E),E=E.sibling;return null}function a(x,E){for(x=new Map;E!==null;)E.key!==null?x.set(E.key,E):x.set(E.index,E),E=E.sibling;return x}function c(x,E){return x=Gt(x,E),x.index=0,x.sibling=null,x}function f(x,E,T){return x.index=T,t?(T=x.alternate,T!==null?(T=T.index,T<E?(x.flags=2,E):T):(x.flags=2,E)):E}function v(x){return t&&x.alternate===null&&(x.flags=2),x}function S(x,E,T,D){return E===null||E.tag!==6?(E=Mo(T,x.mode,D),E.return=x,E):(E=c(E,T),E.return=x,E)}function C(x,E,T,D){return E!==null&&E.elementType===T.type?(D=c(E,T.props),D.ref=$n(x,E,T),D.return=x,D):(D=br(T.type,T.key,T.props,null,x.mode,D),D.ref=$n(x,E,T),D.return=x,D)}function z(x,E,T,D){return E===null||E.tag!==4||E.stateNode.containerInfo!==T.containerInfo||E.stateNode.implementation!==T.implementation?(E=Lo(T,x.mode,D),E.return=x,E):(E=c(E,T.children||[]),E.return=x,E)}function X(x,E,T,D,Y){return E===null||E.tag!==7?(E=On(T,x.mode,D,Y),E.return=x,E):(E=c(E,T),E.return=x,E)}function $(x,E,T){if(typeof E=="string"||typeof E=="number")return E=Mo(""+E,x.mode,T),E.return=x,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case p:return T=br(E.type,E.key,E.props,null,x.mode,T),T.ref=$n(x,null,E),T.return=x,T;case m:return E=Lo(E,x.mode,T),E.return=x,E}if(cr(E)||fe(E))return E=On(E,x.mode,T,null),E.return=x,E;dr(x,E)}return null}function U(x,E,T,D){var Y=E!==null?E.key:null;if(typeof T=="string"||typeof T=="number")return Y!==null?null:S(x,E,""+T,D);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case p:return T.key===Y?T.type===w?X(x,E,T.props.children,D,Y):C(x,E,T,D):null;case m:return T.key===Y?z(x,E,T,D):null}if(cr(T)||fe(T))return Y!==null?null:X(x,E,T,D,null);dr(x,T)}return null}function ae(x,E,T,D,Y){if(typeof D=="string"||typeof D=="number")return x=x.get(T)||null,S(E,x,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case p:return x=x.get(D.key===null?T:D.key)||null,D.type===w?X(E,x,D.props.children,Y,D.key):C(E,x,D,Y);case m:return x=x.get(D.key===null?T:D.key)||null,z(E,x,D,Y)}if(cr(D)||fe(D))return x=x.get(T)||null,X(E,x,D,Y,null);dr(E,D)}return null}function ve(x,E,T,D){for(var Y=null,he=null,ee=E,oe=E=0,Ie=null;ee!==null&&oe<T.length;oe++){ee.index>oe?(Ie=ee,ee=null):Ie=ee.sibling;var ie=U(x,ee,T[oe],D);if(ie===null){ee===null&&(ee=Ie);break}t&&ee&&ie.alternate===null&&n(x,ee),E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie,ee=Ie}if(oe===T.length)return s(x,ee),Y;if(ee===null){for(;oe<T.length;oe++)ee=$(x,T[oe],D),ee!==null&&(E=f(ee,E,oe),he===null?Y=ee:he.sibling=ee,he=ee);return Y}for(ee=a(x,ee);oe<T.length;oe++)Ie=ae(ee,x,oe,T[oe],D),Ie!==null&&(t&&Ie.alternate!==null&&ee.delete(Ie.key===null?oe:Ie.key),E=f(Ie,E,oe),he===null?Y=Ie:he.sibling=Ie,he=Ie);return t&&ee.forEach(function(Kt){return n(x,Kt)}),Y}function rt(x,E,T,D){var Y=fe(T);if(typeof Y!="function")throw Error(h(150));if(T=Y.call(T),T==null)throw Error(h(151));for(var he=Y=null,ee=E,oe=E=0,Ie=null,ie=T.next();ee!==null&&!ie.done;oe++,ie=T.next()){ee.index>oe?(Ie=ee,ee=null):Ie=ee.sibling;var Kt=U(x,ee,ie.value,D);if(Kt===null){ee===null&&(ee=Ie);break}t&&ee&&Kt.alternate===null&&n(x,ee),E=f(Kt,E,oe),he===null?Y=Kt:he.sibling=Kt,he=Kt,ee=Ie}if(ie.done)return s(x,ee),Y;if(ee===null){for(;!ie.done;oe++,ie=T.next())ie=$(x,ie.value,D),ie!==null&&(E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie);return Y}for(ee=a(x,ee);!ie.done;oe++,ie=T.next())ie=ae(ee,x,oe,ie.value,D),ie!==null&&(t&&ie.alternate!==null&&ee.delete(ie.key===null?oe:ie.key),E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie);return t&&ee.forEach(function(Kg){return n(x,Kg)}),Y}return function(x,E,T,D){var Y=typeof T=="object"&&T!==null&&T.type===w&&T.key===null;Y&&(T=T.props.children);var he=typeof T=="object"&&T!==null;if(he)switch(T.$$typeof){case p:e:{for(he=T.key,Y=E;Y!==null;){if(Y.key===he){switch(Y.tag){case 7:if(T.type===w){s(x,Y.sibling),E=c(Y,T.props.children),E.return=x,x=E;break e}break;default:if(Y.elementType===T.type){s(x,Y.sibling),E=c(Y,T.props),E.ref=$n(x,Y,T),E.return=x,x=E;break e}}s(x,Y);break}else n(x,Y);Y=Y.sibling}T.type===w?(E=On(T.props.children,x.mode,D,T.key),E.return=x,x=E):(D=br(T.type,T.key,T.props,null,x.mode,D),D.ref=$n(x,E,T),D.return=x,x=D)}return v(x);case m:e:{for(Y=T.key;E!==null;){if(E.key===Y)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){s(x,E.sibling),E=c(E,T.children||[]),E.return=x,x=E;break e}else{s(x,E);break}else n(x,E);E=E.sibling}E=Lo(T,x.mode,D),E.return=x,x=E}return v(x)}if(typeof T=="string"||typeof T=="number")return T=""+T,E!==null&&E.tag===6?(s(x,E.sibling),E=c(E,T),E.return=x,x=E):(s(x,E),E=Mo(T,x.mode,D),E.return=x,x=E),v(x);if(cr(T))return ve(x,E,T,D);if(fe(T))return rt(x,E,T,D);if(he&&dr(x,T),typeof T=="undefined"&&!Y)switch(x.tag){case 1:case 22:case 0:case 11:case 15:throw Error(h(152,Ee(x.type)||"Component"))}return s(x,E)}}var hr=hu(!0),fu=hu(!1),ei={},tt=Bt(ei),ti=Bt(ei),Pn=Bt(ei);function pt(t){if(t===ei)throw Error(h(174));return t}function js(t,n){xe(Pn,n),xe(ti,t),xe(tt,ei),t=bt(n),pe(tt),xe(tt,t)}function Cn(){pe(tt),pe(ti),pe(Pn)}function gu(t){var n=pt(Pn.current),s=pt(tt.current);n=A(s,t.type,n),s!==n&&(xe(ti,t),xe(tt,n))}function Hs(t){ti.current===t&&(pe(tt),pe(ti))}var _e=Bt(0);function fr(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ig(s)||rg(s)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&64)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Mt=null,cn=null,mt=!1;function pu(t,n){var s=it(5,null,null,0);s.elementType="DELETED",s.type="DELETED",s.stateNode=n,s.return=t,s.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=s,t.lastEffect=s):t.firstEffect=t.lastEffect=s}function mu(t,n){switch(t.tag){case 5:return n=tg(n,t.type,t.pendingProps),n!==null?(t.stateNode=n,!0):!1;case 6:return n=ng(n,t.pendingProps),n!==null?(t.stateNode=n,!0):!1;case 13:return!1;default:return!1}}function Vs(t){if(mt){var n=cn;if(n){var s=n;if(!mu(t,n)){if(n=Ts(s),!n||!mu(t,n)){t.flags=t.flags&-1025|2,mt=!1,Mt=t;return}pu(Mt,s)}Mt=t,cn=Va(n)}else t.flags=t.flags&-1025|2,mt=!1,Mt=t}}function vu(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Mt=t}function gr(t){if(!dt||t!==Mt)return!1;if(!mt)return vu(t),mt=!0,!1;var n=t.type;if(t.tag!==5||n!=="head"&&n!=="body"&&!ut(n,t.memoizedProps))for(n=cn;n;)pu(t,n),n=Ts(n);if(vu(t),t.tag===13){if(!dt)throw Error(h(316));if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(h(317));cn=lg(t)}else cn=Mt?Ts(t.stateNode):null;return!0}function Ws(){dt&&(cn=Mt=null,mt=!1)}var Tn=[];function Qs(){for(var t=0;t<Tn.length;t++){var n=Tn[t];me?n._workInProgressVersionPrimary=null:n._workInProgressVersionSecondary=null}Tn.length=0}var ni=g.ReactCurrentDispatcher,nt=g.ReactCurrentBatchConfig,ii=0,Ce=null,be=null,Ae=null,pr=!1,ri=!1;function Xe(){throw Error(h(321))}function Xs(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!$e(t[s],n[s]))return!1;return!0}function Ys(t,n,s,a,c,f){if(ii=f,Ce=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ni.current=t===null||t.memoizedState===null?Pg:Cg,t=s(a,c),ri){f=0;do{if(ri=!1,!(25>f))throw Error(h(301));f+=1,Ae=be=null,n.updateQueue=null,ni.current=Tg,t=s(a,c)}while(ri)}if(ni.current=wr,n=be!==null&&be.next!==null,ii=0,Ae=be=Ce=null,pr=!1,n)throw Error(h(300));return t}function dn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?Ce.memoizedState=Ae=t:Ae=Ae.next=t,Ae}function hn(){if(be===null){var t=Ce.alternate;t=t!==null?t.memoizedState:null}else t=be.next;var n=Ae===null?Ce.memoizedState:Ae.next;if(n!==null)Ae=n,be=t;else{if(t===null)throw Error(h(310));be=t,t={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},Ae===null?Ce.memoizedState=Ae=t:Ae=Ae.next=t}return Ae}function vt(t,n){return typeof n=="function"?n(t):n}function si(t){var n=hn(),s=n.queue;if(s===null)throw Error(h(311));s.lastRenderedReducer=t;var a=be,c=a.baseQueue,f=s.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}a.baseQueue=c=f,s.pending=null}if(c!==null){c=c.next,a=a.baseState;var S=v=f=null,C=c;do{var z=C.lane;if((ii&z)===z)S!==null&&(S=S.next={lane:0,action:C.action,eagerReducer:C.eagerReducer,eagerState:C.eagerState,next:null}),a=C.eagerReducer===t?C.eagerState:t(a,C.action);else{var X={lane:z,action:C.action,eagerReducer:C.eagerReducer,eagerState:C.eagerState,next:null};S===null?(v=S=X,f=a):S=S.next=X,Ce.lanes|=z,hi|=z}C=C.next}while(C!==null&&C!==c);S===null?f=a:S.next=v,$e(a,n.memoizedState)||(ft=!0),n.memoizedState=a,n.baseState=f,n.baseQueue=S,s.lastRenderedState=a}return[n.memoizedState,s.dispatch]}function oi(t){var n=hn(),s=n.queue;if(s===null)throw Error(h(311));s.lastRenderedReducer=t;var a=s.dispatch,c=s.pending,f=n.memoizedState;if(c!==null){s.pending=null;var v=c=c.next;do f=t(f,v.action),v=v.next;while(v!==c);$e(f,n.memoizedState)||(ft=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,a]}function yu(t,n,s){var a=n._getVersion;a=a(n._source);var c=me?n._workInProgressVersionPrimary:n._workInProgressVersionSecondary;if(c!==null?t=c===a:(t=t.mutableReadLanes,(t=(ii&t)===t)&&(me?n._workInProgressVersionPrimary=a:n._workInProgressVersionSecondary=a,Tn.push(n))),t)return s(n._source);throw Tn.push(n),Error(h(350))}function wu(t,n,s,a){var c=je;if(c===null)throw Error(h(349));var f=n._getVersion,v=f(n._source),S=ni.current,C=S.useState(function(){return yu(c,n,s)}),z=C[1],X=C[0];C=Ae;var $=t.memoizedState,U=$.refs,ae=U.getSnapshot,ve=$.source;$=$.subscribe;var rt=Ce;return t.memoizedState={refs:U,source:n,subscribe:a},S.useEffect(function(){U.getSnapshot=s,U.setSnapshot=z;var x=f(n._source);if(!$e(v,x)){x=s(n._source),$e(X,x)||(z(x),x=qt(rt),c.mutableReadLanes|=x&c.pendingLanes),x=c.mutableReadLanes,c.entangledLanes|=x;for(var E=c.entanglements,T=x;0<T;){var D=31-Ht(T),Y=1<<D;E[D]|=x,T&=~Y}}},[s,n,a]),S.useEffect(function(){return a(n._source,function(){var x=U.getSnapshot,E=U.setSnapshot;try{E(x(n._source));var T=qt(rt);c.mutableReadLanes|=T&c.pendingLanes}catch(D){E(function(){throw D})}})},[n,a]),$e(ae,s)&&$e(ve,n)&&$e($,a)||(t={pending:null,dispatch:null,lastRenderedReducer:vt,lastRenderedState:X},t.dispatch=z=Ks.bind(null,Ce,t),C.queue=t,C.baseQueue=null,X=yu(c,n,s),C.memoizedState=C.baseState=X),X}function Su(t,n,s){var a=hn();return wu(a,t,n,s)}function li(t){var n=dn();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t=n.queue={pending:null,dispatch:null,lastRenderedReducer:vt,lastRenderedState:t},t=t.dispatch=Ks.bind(null,Ce,t),[n.memoizedState,t]}function mr(t,n,s,a){return t={tag:t,create:n,destroy:s,deps:a,next:null},n=Ce.updateQueue,n===null?(n={lastEffect:null},Ce.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(a=s.next,s.next=t,t.next=a,n.lastEffect=t)),t}function Eu(t){var n=dn();return t={current:t},n.memoizedState=t}function vr(){return hn().memoizedState}function qs(t,n,s,a){var c=dn();Ce.flags|=t,c.memoizedState=mr(1|n,s,void 0,a===void 0?null:a)}function Zs(t,n,s,a){var c=hn();a=a===void 0?null:a;var f=void 0;if(be!==null){var v=be.memoizedState;if(f=v.destroy,a!==null&&Xs(a,v.deps)){mr(n,s,f,a);return}}Ce.flags|=t,c.memoizedState=mr(1|n,s,f,a)}function xu(t,n){return qs(516,4,t,n)}function yr(t,n){return Zs(516,4,t,n)}function _u(t,n){return Zs(4,2,t,n)}function Pu(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Cu(t,n,s){return s=s!=null?s.concat([t]):null,Zs(4,2,Pu.bind(null,n,t),s)}function Gs(){}function Tu(t,n){var s=hn();n=n===void 0?null:n;var a=s.memoizedState;return a!==null&&n!==null&&Xs(n,a[1])?a[0]:(s.memoizedState=[t,n],t)}function Iu(t,n){var s=hn();n=n===void 0?null:n;var a=s.memoizedState;return a!==null&&n!==null&&Xs(n,a[1])?a[0]:(t=t(),s.memoizedState=[t,n],t)}function _g(t,n){var s=En();kt(98>s?98:s,function(){t(!0)}),kt(97<s?97:s,function(){var a=nt.transition;nt.transition=1;try{t(!1),n()}finally{nt.transition=a}})}function Ks(t,n,s){var a=qe(),c=qt(t),f={lane:c,action:s,eagerReducer:null,eagerState:null,next:null},v=n.pending;if(v===null?f.next=f:(f.next=v.next,v.next=f),n.pending=f,v=t.alternate,t===Ce||v!==null&&v===Ce)ri=pr=!0;else{if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var S=n.lastRenderedState,C=v(S,s);if(f.eagerReducer=v,f.eagerState=C,$e(C,S))return}catch{}finally{}Rt(t,c,a)}}var wr={readContext:et,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useOpaqueIdentifier:Xe,unstable_isNewReconciler:!1},Pg={readContext:et,useCallback:function(t,n){return dn().memoizedState=[t,n===void 0?null:n],t},useContext:et,useEffect:xu,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,qs(4,2,Pu.bind(null,n,t),s)},useLayoutEffect:function(t,n){return qs(4,2,t,n)},useMemo:function(t,n){var s=dn();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var a=dn();return n=s!==void 0?s(n):n,a.memoizedState=a.baseState=n,t=a.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},t=t.dispatch=Ks.bind(null,Ce,t),[a.memoizedState,t]},useRef:Eu,useState:li,useDebugValue:Gs,useDeferredValue:function(t){var n=li(t),s=n[0],a=n[1];return xu(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=li(!1),n=t[0];return t=_g.bind(null,t[1]),Eu(t),[t,n]},useMutableSource:function(t,n,s){var a=dn();return a.memoizedState={refs:{getSnapshot:n,setSnapshot:null},source:t,subscribe:s},wu(a,t,n,s)},useOpaqueIdentifier:function(){if(mt){var t=!1,n=Of(function(){throw t||(t=!0,s(Ps())),Error(h(355))}),s=li(n)[1];return(Ce.mode&2)===0&&(Ce.flags|=516,mr(5,function(){s(Ps())},void 0,null)),n}return n=Ps(),li(n),n},unstable_isNewReconciler:!1},Cg={readContext:et,useCallback:Tu,useContext:et,useEffect:yr,useImperativeHandle:Cu,useLayoutEffect:_u,useMemo:Iu,useReducer:si,useRef:vr,useState:function(){return si(vt)},useDebugValue:Gs,useDeferredValue:function(t){var n=si(vt),s=n[0],a=n[1];return yr(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=si(vt)[0];return[vr().current,t]},useMutableSource:Su,useOpaqueIdentifier:function(){return si(vt)[0]},unstable_isNewReconciler:!1},Tg={readContext:et,useCallback:Tu,useContext:et,useEffect:yr,useImperativeHandle:Cu,useLayoutEffect:_u,useMemo:Iu,useReducer:oi,useRef:vr,useState:function(){return oi(vt)},useDebugValue:Gs,useDeferredValue:function(t){var n=oi(vt),s=n[0],a=n[1];return yr(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=oi(vt)[0];return[vr().current,t]},useMutableSource:Su,useOpaqueIdentifier:function(){return oi(vt)[0]},unstable_isNewReconciler:!1},Ig=g.ReactCurrentOwner,ft=!1;function Ye(t,n,s,a){n.child=t===null?fu(n,null,s,a):hr(n,t.child,s,a)}function ku(t,n,s,a,c){s=s.render;var f=n.ref;return _n(n,c),a=Ys(t,n,s,a,f,c),t!==null&&!ft?(n.updateQueue=t.updateQueue,n.flags&=-517,t.lanes&=~c,Lt(t,n,c)):(n.flags|=1,Ye(t,n,a,c),n.child)}function Mu(t,n,s,a,c,f){if(t===null){var v=s.type;return typeof v=="function"&&!Io(v)&&v.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=v,Lu(t,n,v,a,c,f)):(t=br(s.type,null,a,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}return v=t.child,(c&f)===0&&(c=v.memoizedProps,s=s.compare,s=s!==null?s:rr,s(c,a)&&t.ref===n.ref)?Lt(t,n,f):(n.flags|=1,t=Gt(v,a),t.ref=n.ref,t.return=n,n.child=t)}function Lu(t,n,s,a,c,f){if(t!==null&&rr(t.memoizedProps,a)&&t.ref===n.ref)if(ft=!1,(f&c)!==0)(t.flags&16384)!==0&&(ft=!0);else return n.lanes=t.lanes,Lt(t,n,f);return $s(t,n,s,a,f)}function Js(t,n,s){var a=n.pendingProps,c=a.children,f=t!==null?t.memoizedState:null;if(a.mode==="hidden"||a.mode==="unstable-defer-without-hiding")if((n.mode&4)===0)n.memoizedState={baseLanes:0},Fr(n,s);else if((s&1073741824)!==0)n.memoizedState={baseLanes:0},Fr(n,f!==null?f.baseLanes:s);else return t=f!==null?f.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t},Fr(n,t),null;else f!==null?(a=f.baseLanes|s,n.memoizedState=null):a=s,Fr(n,a);return Ye(t,n,c,s),n.child}function Ou(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=128)}function $s(t,n,s,a,c){var f=Qe(s)?ln:Ue.current;return f=wn(n,f),_n(n,c),s=Ys(t,n,s,a,f,c),t!==null&&!ft?(n.updateQueue=t.updateQueue,n.flags&=-517,t.lanes&=~c,Lt(t,n,c)):(n.flags|=1,Ye(t,n,s,c),n.child)}function Nu(t,n,s,a,c){if(Qe(s)){var f=!0;Ji(n)}else f=!1;if(_n(n,c),n.stateNode===null)t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),cu(n,s,a),Bs(n,s,a,c),a=!0;else if(t===null){var v=n.stateNode,S=n.memoizedProps;v.props=S;var C=v.context,z=s.contextType;typeof z=="object"&&z!==null?z=et(z):(z=Qe(s)?ln:Ue.current,z=wn(n,z));var X=s.getDerivedStateFromProps,$=typeof X=="function"||typeof v.getSnapshotBeforeUpdate=="function";$||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==a||C!==z)&&du(n,v,a,z),Vt=!1;var U=n.memoizedState;v.state=U,Jn(n,a,v,c),C=n.memoizedState,S!==a||U!==C||We.current||Vt?(typeof X=="function"&&(ar(n,s,X,a),C=n.memoizedState),(S=Vt||uu(n,s,S,a,U,C,z))?($||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(n.flags|=4)):(typeof v.componentDidMount=="function"&&(n.flags|=4),n.memoizedProps=a,n.memoizedState=C),v.props=a,v.state=C,v.context=z,a=S):(typeof v.componentDidMount=="function"&&(n.flags|=4),a=!1)}else{v=n.stateNode,su(t,n),S=n.memoizedProps,z=n.type===n.elementType?S:ht(n.type,S),v.props=z,$=n.pendingProps,U=v.context,C=s.contextType,typeof C=="object"&&C!==null?C=et(C):(C=Qe(s)?ln:Ue.current,C=wn(n,C));var ae=s.getDerivedStateFromProps;(X=typeof ae=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==$||U!==C)&&du(n,v,a,C),Vt=!1,U=n.memoizedState,v.state=U,Jn(n,a,v,c);var ve=n.memoizedState;S!==$||U!==ve||We.current||Vt?(typeof ae=="function"&&(ar(n,s,ae,a),ve=n.memoizedState),(z=Vt||uu(n,s,z,a,U,ve,C))?(X||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(a,ve,C),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(a,ve,C)),typeof v.componentDidUpdate=="function"&&(n.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(n.flags|=256)):(typeof v.componentDidUpdate!="function"||S===t.memoizedProps&&U===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&U===t.memoizedState||(n.flags|=256),n.memoizedProps=a,n.memoizedState=ve),v.props=a,v.state=ve,v.context=C,a=z):(typeof v.componentDidUpdate!="function"||S===t.memoizedProps&&U===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&U===t.memoizedState||(n.flags|=256),a=!1)}return eo(t,n,s,a,f,c)}function eo(t,n,s,a,c,f){Ou(t,n);var v=(n.flags&64)!==0;if(!a&&!v)return c&&Ya(n,s,!1),Lt(t,n,f);a=n.stateNode,Ig.current=n;var S=v&&typeof s.getDerivedStateFromError!="function"?null:a.render();return n.flags|=1,t!==null&&v?(n.child=hr(n,t.child,null,f),n.child=hr(n,null,S,f)):Ye(t,n,S,f),n.memoizedState=a.state,c&&Ya(n,s,!0),n.child}function Ru(t){var n=t.stateNode;n.pendingContext?Qa(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Qa(t,n.context,!1),js(t,n.containerInfo)}var Sr={dehydrated:null,retryLane:0};function zu(t,n,s){var a=n.pendingProps,c=_e.current,f=!1,v;return(v=(n.flags&64)!==0)||(v=t!==null&&t.memoizedState===null?!1:(c&2)!==0),v?(f=!0,n.flags&=-65):t!==null&&t.memoizedState===null||a.fallback===void 0||a.unstable_avoidThisFallback===!0||(c|=1),xe(_e,c&1),t===null?(a.fallback!==void 0&&Vs(n),t=a.children,c=a.fallback,f?(t=Au(n,t,c,s),n.child.memoizedState={baseLanes:s},n.memoizedState=Sr,t):typeof a.unstable_expectedLoadTime=="number"?(t=Au(n,t,c,s),n.child.memoizedState={baseLanes:s},n.memoizedState=Sr,n.lanes=33554432,t):(s=ko({mode:"visible",children:t},n.mode,s,null),s.return=n,n.child=s)):t.memoizedState!==null?f?(a=Du(t,n,a.children,a.fallback,s),f=n.child,c=t.child.memoizedState,f.memoizedState=c===null?{baseLanes:s}:{baseLanes:c.baseLanes|s},f.childLanes=t.childLanes&~s,n.memoizedState=Sr,a):(s=Fu(t,n,a.children,s),n.memoizedState=null,s):f?(a=Du(t,n,a.children,a.fallback,s),f=n.child,c=t.child.memoizedState,f.memoizedState=c===null?{baseLanes:s}:{baseLanes:c.baseLanes|s},f.childLanes=t.childLanes&~s,n.memoizedState=Sr,a):(s=Fu(t,n,a.children,s),n.memoizedState=null,s)}function Au(t,n,s,a){var c=t.mode,f=t.child;return n={mode:"hidden",children:n},(c&2)===0&&f!==null?(f.childLanes=0,f.pendingProps=n):f=ko(n,c,0,null),s=On(s,c,a,null),f.return=t,s.return=t,f.sibling=s,t.child=f,s}function Fu(t,n,s,a){var c=t.child;return t=c.sibling,s=Gt(c,{mode:"visible",children:s}),(n.mode&2)===0&&(s.lanes=a),s.return=n,s.sibling=null,t!==null&&(t.nextEffect=null,t.flags=8,n.firstEffect=n.lastEffect=t),n.child=s}function Du(t,n,s,a,c){var f=n.mode,v=t.child;t=v.sibling;var S={mode:"hidden",children:s};return(f&2)===0&&n.child!==v?(s=n.child,s.childLanes=0,s.pendingProps=S,v=s.lastEffect,v!==null?(n.firstEffect=s.firstEffect,n.lastEffect=v,v.nextEffect=null):n.firstEffect=n.lastEffect=null):s=Gt(v,S),t!==null?a=Gt(t,a):(a=On(a,f,c,null),a.flags|=2),a.return=n,s.return=n,s.sibling=a,n.child=s,a}function Uu(t,n){t.lanes|=n;var s=t.alternate;s!==null&&(s.lanes|=n),ru(t.return,n)}function to(t,n,s,a,c,f){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:c,lastEffect:f}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=a,v.tail=s,v.tailMode=c,v.lastEffect=f)}function bu(t,n,s){var a=n.pendingProps,c=a.revealOrder,f=a.tail;if(Ye(t,n,a.children,s),a=_e.current,(a&2)!==0)a=a&1|2,n.flags|=64;else{if(t!==null&&(t.flags&64)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Uu(t,s);else if(t.tag===19)Uu(t,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}if(xe(_e,a),(n.mode&2)===0)n.memoizedState=null;else switch(c){case"forwards":for(s=n.child,c=null;s!==null;)t=s.alternate,t!==null&&fr(t)===null&&(c=s),s=s.sibling;s=c,s===null?(c=n.child,n.child=null):(c=s.sibling,s.sibling=null),to(n,!1,c,s,f,n.lastEffect);break;case"backwards":for(s=null,c=n.child,n.child=null;c!==null;){if(t=c.alternate,t!==null&&fr(t)===null){n.child=c;break}t=c.sibling,c.sibling=s,s=c,c=t}to(n,!0,s,null,f,n.lastEffect);break;case"together":to(n,!1,null,null,void 0,n.lastEffect);break;default:n.memoizedState=null}return n.child}function Lt(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),hi|=n.lanes,(s&n.childLanes)!==0){if(t!==null&&n.child!==t.child)throw Error(h(153));if(n.child!==null){for(t=n.child,s=Gt(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Gt(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}return null}function yt(t){t.flags|=4}var ai,ui,Er,xr;if(Pe)ai=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)we(t,s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},ui=function(){},Er=function(t,n,s,a,c){if(t=t.memoizedProps,t!==a){var f=n.stateNode,v=pt(tt.current);s=at(f,s,t,a,c,v),(n.updateQueue=s)&&yt(n)}},xr=function(t,n,s,a){s!==a&&yt(n)};else if(ct){ai=function(t,n,s,a){for(var c=n.child;c!==null;){if(c.tag===5){var f=c.stateNode;s&&a&&(f=ja(f,c.type,c.memoizedProps,c)),we(t,f)}else if(c.tag===6)f=c.stateNode,s&&a&&(f=Ha(f,c.memoizedProps,c)),we(t,f);else if(c.tag!==4){if(c.tag===13&&(c.flags&4)!==0&&(f=c.memoizedState!==null)){var v=c.child;if(v!==null&&(v.child!==null&&(v.child.return=v,ai(t,v,!0,f)),f=v.sibling,f!==null)){f.return=c,c=f;continue}}if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}};var Bu=function(t,n,s,a){for(var c=n.child;c!==null;){if(c.tag===5){var f=c.stateNode;s&&a&&(f=ja(f,c.type,c.memoizedProps,c)),ba(t,f)}else if(c.tag===6)f=c.stateNode,s&&a&&(f=Ha(f,c.memoizedProps,c)),ba(t,f);else if(c.tag!==4){if(c.tag===13&&(c.flags&4)!==0&&(f=c.memoizedState!==null)){var v=c.child;if(v!==null&&(v.child!==null&&(v.child.return=v,Bu(t,v,!0,f)),f=v.sibling,f!==null)){f.return=c,c=f;continue}}if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}};ui=function(t){var n=t.stateNode;if(t.firstEffect!==null){var s=n.containerInfo,a=Ua(s);Bu(a,t,!1,!1),n.pendingChildren=a,yt(t),eg(s,a)}},Er=function(t,n,s,a,c){var f=t.stateNode,v=t.memoizedProps;if((t=n.firstEffect===null)&&v===a)n.stateNode=f;else{var S=n.stateNode,C=pt(tt.current),z=null;v!==a&&(z=at(S,s,v,a,c,C)),t&&z===null?n.stateNode=f:(f=$f(f,z,s,v,a,n,t,S),lt(f,s,a,c,C)&&yt(n),n.stateNode=f,t?yt(n):ai(f,n,!1,!1))}},xr=function(t,n,s,a){s!==a?(t=pt(Pn.current),s=pt(tt.current),n.stateNode=Ze(a,t,s,n),yt(n)):n.stateNode=t.stateNode}}else ui=function(){},Er=function(){},xr=function(){};function ci(t,n){if(!mt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function kg(t,n,s){var a=n.pendingProps;switch(n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Qe(n.type)&&Ki(),null;case 3:return Cn(),pe(We),pe(Ue),Qs(),a=n.stateNode,a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(gr(n)?yt(n):a.hydrate||(n.flags|=256)),ui(n),null;case 5:Hs(n);var c=pt(Pn.current);if(s=n.type,t!==null&&n.stateNode!=null)Er(t,n,s,a,c),t.ref!==n.ref&&(n.flags|=128);else{if(!a){if(n.stateNode===null)throw Error(h(166));return null}if(t=pt(tt.current),gr(n)){if(!dt)throw Error(h(175));t=sg(n.stateNode,n.type,n.memoizedProps,c,t,n),n.updateQueue=t,t!==null&&yt(n)}else{var f=ce(s,a,c,t,n);ai(f,n,!1,!1),n.stateNode=f,lt(f,s,a,c,t)&&yt(n)}n.ref!==null&&(n.flags|=128)}return null;case 6:if(t&&n.stateNode!=null)xr(t,n,t.memoizedProps,a);else{if(typeof a!="string"&&n.stateNode===null)throw Error(h(166));if(t=pt(Pn.current),c=pt(tt.current),gr(n)){if(!dt)throw Error(h(176));og(n.stateNode,n.memoizedProps,n)&&yt(n)}else n.stateNode=Ze(a,t,c,n)}return null;case 13:return pe(_e),a=n.memoizedState,(n.flags&64)!==0?(n.lanes=s,n):(a=a!==null,c=!1,t===null?n.memoizedProps.fallback!==void 0&&gr(n):c=t.memoizedState!==null,a&&!c&&(n.mode&2)!==0&&(t===null&&n.memoizedProps.unstable_avoidThisFallback!==!0||(_e.current&1)!==0?Fe===0&&(Fe=3):((Fe===0||Fe===3)&&(Fe=4),je===null||(hi&134217727)===0&&(kn&134217727)===0||Mn(je,Be))),ct&&a&&(n.flags|=4),Pe&&(a||c)&&(n.flags|=4),null);case 4:return Cn(),ui(n),t===null&&Rf(n.stateNode.containerInfo),null;case 10:return Us(n),null;case 17:return Qe(n.type)&&Ki(),null;case 19:if(pe(_e),a=n.memoizedState,a===null)return null;if(c=(n.flags&64)!==0,f=a.rendering,f===null)if(c)ci(a,!1);else{if(Fe!==0||t!==null&&(t.flags&64)!==0)for(t=n.child;t!==null;){if(f=fr(t),f!==null){for(n.flags|=64,ci(a,!1),t=f.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),a.lastEffect===null&&(n.firstEffect=null),n.lastEffect=a.lastEffect,t=s,a=n.child;a!==null;)c=a,s=t,c.flags&=2,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,f=c.alternate,f===null?(c.childLanes=0,c.lanes=s,c.child=null,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=f.childLanes,c.lanes=f.lanes,c.child=f.child,c.memoizedProps=f.memoizedProps,c.memoizedState=f.memoizedState,c.updateQueue=f.updateQueue,c.type=f.type,s=f.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a=a.sibling;return xe(_e,_e.current&1|2),n.child}t=t.sibling}a.tail!==null&&ze()>yo&&(n.flags|=64,c=!0,ci(a,!1),n.lanes=33554432)}else{if(!c)if(t=fr(f),t!==null){if(n.flags|=64,c=!0,t=t.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),ci(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!mt)return n=n.lastEffect=a.lastEffect,n!==null&&(n.nextEffect=null),null}else 2*ze()-a.renderingStartTime>yo&&s!==1073741824&&(n.flags|=64,c=!0,ci(a,!1),n.lanes=33554432);a.isBackwards?(f.sibling=n.child,n.child=f):(t=a.last,t!==null?t.sibling=f:n.child=f,a.last=f)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.lastEffect=n.lastEffect,a.renderingStartTime=ze(),t.sibling=null,n=_e.current,xe(_e,c?n&1|2:n&1),t):null;case 23:case 24:return Po(),t!==null&&t.memoizedState!==null!=(n.memoizedState!==null)&&a.mode!=="unstable-defer-without-hiding"&&(n.flags|=4),null}throw Error(h(156,n.tag))}function Mg(t){switch(t.tag){case 1:Qe(t.type)&&Ki();var n=t.flags;return n&4096?(t.flags=n&-4097|64,t):null;case 3:if(Cn(),pe(We),pe(Ue),Qs(),n=t.flags,(n&64)!==0)throw Error(h(285));return t.flags=n&-4097|64,t;case 5:return Hs(t),null;case 13:return pe(_e),n=t.flags,n&4096?(t.flags=n&-4097|64,t):null;case 19:return pe(_e),null;case 4:return Cn(),null;case 10:return Us(t),null;case 23:case 24:return Po(),null;default:return null}}function no(t,n){try{var s="",a=n;do s+=xg(a),a=a.return;while(a);var c=s}catch(f){c=`
|
|
22
|
+
`),v=c.length-1,w=f.length-1;1<=v&&0<=w&&c[v]!==f[w];)w--;for(;1<=v&&0<=w;v--,w--)if(c[v]!==f[w]){if(v!==1||w!==1)do if(v--,w--,0>w||c[v]!==f[w])return`
|
|
23
|
+
`+c[v].replace(" at new "," at ");while(1<=v&&0<=w);break}}}finally{ks=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?Zn(t):""}var Ms=[],yn=-1;function Bt(t){return{current:t}}function pe(t){0>yn||(t.current=Ms[yn],Ms[yn]=null,yn--)}function xe(t,n){yn++,Ms[yn]=t.current,t.current=n}var jt={},Ue=Bt(jt),We=Bt(!1),ln=jt;function wn(t,n){var s=t.type.contextTypes;if(!s)return jt;var a=t.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var c={},f;for(f in s)c[f]=n[f];return a&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=c),c}function Qe(t){return t=t.childContextTypes,t!=null}function Ki(){pe(We),pe(Ue)}function Qa(t,n,s){if(Ue.current!==jt)throw Error(h(168));xe(Ue,n),xe(We,s)}function Xa(t,n,s){var a=t.stateNode;if(t=n.childContextTypes,typeof a.getChildContext!="function")return s;a=a.getChildContext();for(var c in a)if(!(c in t))throw Error(h(108,Ee(n)||"Unknown",c));return l({},s,a)}function Ji(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||jt,ln=Ue.current,xe(Ue,t),xe(We,We.current),!0}function Ya(t,n,s){var a=t.stateNode;if(!a)throw Error(h(169));s?(t=Xa(t,n,ln),a.__reactInternalMemoizedMergedChildContext=t,pe(We),pe(Ue),xe(Ue,t)):pe(We),xe(We,s)}var Ls=null,an=null,ug=d.unstable_now;ug();var $i=0,de=8;function un(t){if((1&t)!==0)return de=15,1;if((2&t)!==0)return de=14,2;if((4&t)!==0)return de=13,4;var n=24&t;return n!==0?(de=12,n):(t&32)!==0?(de=11,32):(n=192&t,n!==0?(de=10,n):(t&256)!==0?(de=9,256):(n=3584&t,n!==0?(de=8,n):(t&4096)!==0?(de=7,4096):(n=4186112&t,n!==0?(de=6,n):(n=62914560&t,n!==0?(de=5,n):t&67108864?(de=4,67108864):(t&134217728)!==0?(de=3,134217728):(n=805306368&t,n!==0?(de=2,n):(1073741824&t)!==0?(de=1,1073741824):(de=8,t))))))}function cg(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function dg(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(h(358,t))}}function Gn(t,n){var s=t.pendingLanes;if(s===0)return de=0;var a=0,c=0,f=t.expiredLanes,v=t.suspendedLanes,w=t.pingedLanes;if(f!==0)a=f,c=de=15;else if(f=s&134217727,f!==0){var C=f&~v;C!==0?(a=un(C),c=de):(w&=f,w!==0&&(a=un(w),c=de))}else f=s&~v,f!==0?(a=un(f),c=de):w!==0&&(a=un(w),c=de);if(a===0)return 0;if(a=31-Ht(a),a=s&((0>a?0:1<<a)<<1)-1,n!==0&&n!==a&&(n&v)===0){if(un(n),c<=de)return n;de=c}if(n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=a;0<n;)s=31-Ht(n),c=1<<s,a|=t[s],n&=~c;return a}function qa(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function er(t,n){switch(t){case 15:return 1;case 14:return 2;case 12:return t=Sn(24&~n),t===0?er(10,n):t;case 10:return t=Sn(192&~n),t===0?er(8,n):t;case 8:return t=Sn(3584&~n),t===0&&(t=Sn(4186112&~n),t===0&&(t=512)),t;case 2:return n=Sn(805306368&~n),n===0&&(n=268435456),n}throw Error(h(358,t))}function Sn(t){return t&-t}function Os(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function tr(t,n,s){t.pendingLanes|=n;var a=n-1;t.suspendedLanes&=a,t.pingedLanes&=a,t=t.eventTimes,n=31-Ht(n),t[n]=s}var Ht=Math.clz32?Math.clz32:gg,hg=Math.log,fg=Math.LN2;function gg(t){return t===0?32:31-(hg(t)/fg|0)|0}var pg=d.unstable_runWithPriority,Ns=d.unstable_scheduleCallback,Rs=d.unstable_cancelCallback,mg=d.unstable_shouldYield,Za=d.unstable_requestPaint,zs=d.unstable_now,vg=d.unstable_getCurrentPriorityLevel,nr=d.unstable_ImmediatePriority,Ga=d.unstable_UserBlockingPriority,Ka=d.unstable_NormalPriority,Ja=d.unstable_LowPriority,$a=d.unstable_IdlePriority,As={},yg=Za!==void 0?Za:function(){},It=null,ir=null,Fs=!1,eu=zs(),ze=1e4>eu?zs:function(){return zs()-eu};function En(){switch(vg()){case nr:return 99;case Ga:return 98;case Ka:return 97;case Ja:return 96;case $a:return 95;default:throw Error(h(332))}}function tu(t){switch(t){case 99:return nr;case 98:return Ga;case 97:return Ka;case 96:return Ja;case 95:return $a;default:throw Error(h(332))}}function kt(t,n){return t=tu(t),pg(t,n)}function Kn(t,n,s){return t=tu(t),Ns(t,n,s)}function Je(){if(ir!==null){var t=ir;ir=null,Rs(t)}nu()}function nu(){if(!Fs&&It!==null){Fs=!0;var t=0;try{var n=It;kt(99,function(){for(;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}}),It=null}catch(s){throw It!==null&&(It=It.slice(t+1)),Ns(nr,Je),s}finally{Fs=!1}}}var wg=g.ReactCurrentBatchConfig;function Sg(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var $e=typeof Object.is=="function"?Object.is:Sg,Eg=Object.prototype.hasOwnProperty;function rr(t,n){if($e(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),a=Object.keys(n);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++)if(!Eg.call(n,s[a])||!$e(t[s[a]],n[s[a]]))return!1;return!0}function xg(t){switch(t.tag){case 5:return Zn(t.type);case 16:return Zn("Lazy");case 13:return Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 2:case 15:return t=Gi(t.type,!1),t;case 11:return t=Gi(t.type.render,!1),t;case 22:return t=Gi(t.type._render,!1),t;case 1:return t=Gi(t.type,!0),t;default:return""}}function ht(t,n){if(t&&t.defaultProps){n=l({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}var sr=Bt(null),or=null,xn=null,lr=null;function Ds(){lr=xn=or=null}function iu(t,n){t=t.type._context,me?(xe(sr,t._currentValue),t._currentValue=n):(xe(sr,t._currentValue2),t._currentValue2=n)}function Us(t){var n=sr.current;pe(sr),t=t.type._context,me?t._currentValue=n:t._currentValue2=n}function ru(t,n){for(;t!==null;){var s=t.alternate;if((t.childLanes&n)===n){if(s===null||(s.childLanes&n)===n)break;s.childLanes|=n}else t.childLanes|=n,s!==null&&(s.childLanes|=n);t=t.return}}function _n(t,n){or=t,lr=xn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(ft=!0),t.firstContext=null)}function et(t,n){if(lr!==t&&n!==!1&&n!==0)if((typeof n!="number"||n===1073741823)&&(lr=t,n=1073741823),n={context:t,observedBits:n,next:null},xn===null){if(or===null)throw Error(h(308));xn=n,or.dependencies={lanes:0,firstContext:n,responders:null}}else xn=xn.next=n;return me?t._currentValue:t._currentValue2}var Vt=!1;function bs(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function su(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Wt(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function Qt(t,n){if(t=t.updateQueue,t!==null){t=t.shared;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}}function ou(t,n){var s=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var c=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var v={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};f===null?c=f=v:f=f.next=v,s=s.next}while(s!==null);f===null?c=f=n:f=f.next=n}else c=f=n;s={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:a.shared,effects:a.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function Jn(t,n,s,a){var c=t.updateQueue;Vt=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var C=w,z=C.next;C.next=null,v===null?f=z:v.next=z,v=C;var X=t.alternate;if(X!==null){X=X.updateQueue;var $=X.lastBaseUpdate;$!==v&&($===null?X.firstBaseUpdate=z:$.next=z,X.lastBaseUpdate=C)}}if(f!==null){$=c.baseState,v=0,X=z=C=null;do{w=f.lane;var U=f.eventTime;if((a&w)===w){X!==null&&(X=X.next={eventTime:U,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ae=t,ve=f;switch(w=n,U=s,ve.tag){case 1:if(ae=ve.payload,typeof ae=="function"){$=ae.call(U,$,w);break e}$=ae;break e;case 3:ae.flags=ae.flags&-4097|64;case 0:if(ae=ve.payload,w=typeof ae=="function"?ae.call(U,$,w):ae,w==null)break e;$=l({},$,w);break e;case 2:Vt=!0}}f.callback!==null&&(t.flags|=32,w=c.effects,w===null?c.effects=[f]:w.push(f))}else U={eventTime:U,lane:w,tag:f.tag,payload:f.payload,callback:f.callback,next:null},X===null?(z=X=U,C=$):X=X.next=U,v|=w;if(f=f.next,f===null){if(w=c.shared.pending,w===null)break;f=w.next,w.next=null,c.lastBaseUpdate=w,c.shared.pending=null}}while(1);X===null&&(C=$),c.baseState=C,c.firstBaseUpdate=z,c.lastBaseUpdate=X,hi|=v,t.lanes=v,t.memoizedState=$}}function lu(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var a=t[n],c=a.callback;if(c!==null){if(a.callback=null,a=s,typeof c!="function")throw Error(h(191,c));c.call(a)}}}var au=new u.Component().refs;function ar(t,n,s,a){n=t.memoizedState,s=s(a,n),s=s==null?n:l({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var ur={isMounted:function(t){return(t=t._reactInternals)?re(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var a=qe(),c=qt(t),f=Wt(a,c);f.payload=n,s!=null&&(f.callback=s),Qt(t,f),Rt(t,c,a)},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var a=qe(),c=qt(t),f=Wt(a,c);f.tag=1,f.payload=n,s!=null&&(f.callback=s),Qt(t,f),Rt(t,c,a)},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=qe(),a=qt(t),c=Wt(s,a);c.tag=2,n!=null&&(c.callback=n),Qt(t,c),Rt(t,a,s)}};function uu(t,n,s,a,c,f,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,f,v):n.prototype&&n.prototype.isPureReactComponent?!rr(s,a)||!rr(c,f):!0}function cu(t,n,s){var a=!1,c=jt,f=n.contextType;return typeof f=="object"&&f!==null?f=et(f):(c=Qe(n)?ln:Ue.current,a=n.contextTypes,f=(a=a!=null)?wn(t,c):jt),n=new n(s,f),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ur,t.stateNode=n,n._reactInternals=t,a&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=c,t.__reactInternalMemoizedMaskedChildContext=f),n}function du(t,n,s,a){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,a),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,a),n.state!==t&&ur.enqueueReplaceState(n,n.state,null)}function Bs(t,n,s,a){var c=t.stateNode;c.props=s,c.state=t.memoizedState,c.refs=au,bs(t);var f=n.contextType;typeof f=="object"&&f!==null?c.context=et(f):(f=Qe(n)?ln:Ue.current,c.context=wn(t,f)),Jn(t,s,c,a),c.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(ar(t,n,f,s),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(n=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),n!==c.state&&ur.enqueueReplaceState(c,c.state,null),Jn(t,s,c,a),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4)}var cr=Array.isArray;function $n(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(h(309));var a=s.stateNode}if(!a)throw Error(h(147,t));var c=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===c?n.ref:(n=function(f){var v=a.refs;v===au&&(v=a.refs={}),f===null?delete v[c]:v[c]=f},n._stringRef=c,n)}if(typeof t!="string")throw Error(h(284));if(!s._owner)throw Error(h(290,t))}return t}function dr(t,n){if(t.type!=="textarea")throw Error(h(31,Object.prototype.toString.call(n)==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":n))}function hu(t){function n(_,E){if(t){var T=_.lastEffect;T!==null?(T.nextEffect=E,_.lastEffect=E):_.firstEffect=_.lastEffect=E,E.nextEffect=null,E.flags=8}}function s(_,E){if(!t)return null;for(;E!==null;)n(_,E),E=E.sibling;return null}function a(_,E){for(_=new Map;E!==null;)E.key!==null?_.set(E.key,E):_.set(E.index,E),E=E.sibling;return _}function c(_,E){return _=Gt(_,E),_.index=0,_.sibling=null,_}function f(_,E,T){return _.index=T,t?(T=_.alternate,T!==null?(T=T.index,T<E?(_.flags=2,E):T):(_.flags=2,E)):E}function v(_){return t&&_.alternate===null&&(_.flags=2),_}function w(_,E,T,D){return E===null||E.tag!==6?(E=Mo(T,_.mode,D),E.return=_,E):(E=c(E,T),E.return=_,E)}function C(_,E,T,D){return E!==null&&E.elementType===T.type?(D=c(E,T.props),D.ref=$n(_,E,T),D.return=_,D):(D=br(T.type,T.key,T.props,null,_.mode,D),D.ref=$n(_,E,T),D.return=_,D)}function z(_,E,T,D){return E===null||E.tag!==4||E.stateNode.containerInfo!==T.containerInfo||E.stateNode.implementation!==T.implementation?(E=Lo(T,_.mode,D),E.return=_,E):(E=c(E,T.children||[]),E.return=_,E)}function X(_,E,T,D,Y){return E===null||E.tag!==7?(E=On(T,_.mode,D,Y),E.return=_,E):(E=c(E,T),E.return=_,E)}function $(_,E,T){if(typeof E=="string"||typeof E=="number")return E=Mo(""+E,_.mode,T),E.return=_,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case p:return T=br(E.type,E.key,E.props,null,_.mode,T),T.ref=$n(_,null,E),T.return=_,T;case m:return E=Lo(E,_.mode,T),E.return=_,E}if(cr(E)||fe(E))return E=On(E,_.mode,T,null),E.return=_,E;dr(_,E)}return null}function U(_,E,T,D){var Y=E!==null?E.key:null;if(typeof T=="string"||typeof T=="number")return Y!==null?null:w(_,E,""+T,D);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case p:return T.key===Y?T.type===S?X(_,E,T.props.children,D,Y):C(_,E,T,D):null;case m:return T.key===Y?z(_,E,T,D):null}if(cr(T)||fe(T))return Y!==null?null:X(_,E,T,D,null);dr(_,T)}return null}function ae(_,E,T,D,Y){if(typeof D=="string"||typeof D=="number")return _=_.get(T)||null,w(E,_,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case p:return _=_.get(D.key===null?T:D.key)||null,D.type===S?X(E,_,D.props.children,Y,D.key):C(E,_,D,Y);case m:return _=_.get(D.key===null?T:D.key)||null,z(E,_,D,Y)}if(cr(D)||fe(D))return _=_.get(T)||null,X(E,_,D,Y,null);dr(E,D)}return null}function ve(_,E,T,D){for(var Y=null,he=null,ee=E,oe=E=0,Ie=null;ee!==null&&oe<T.length;oe++){ee.index>oe?(Ie=ee,ee=null):Ie=ee.sibling;var ie=U(_,ee,T[oe],D);if(ie===null){ee===null&&(ee=Ie);break}t&&ee&&ie.alternate===null&&n(_,ee),E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie,ee=Ie}if(oe===T.length)return s(_,ee),Y;if(ee===null){for(;oe<T.length;oe++)ee=$(_,T[oe],D),ee!==null&&(E=f(ee,E,oe),he===null?Y=ee:he.sibling=ee,he=ee);return Y}for(ee=a(_,ee);oe<T.length;oe++)Ie=ae(ee,_,oe,T[oe],D),Ie!==null&&(t&&Ie.alternate!==null&&ee.delete(Ie.key===null?oe:Ie.key),E=f(Ie,E,oe),he===null?Y=Ie:he.sibling=Ie,he=Ie);return t&&ee.forEach(function(Kt){return n(_,Kt)}),Y}function rt(_,E,T,D){var Y=fe(T);if(typeof Y!="function")throw Error(h(150));if(T=Y.call(T),T==null)throw Error(h(151));for(var he=Y=null,ee=E,oe=E=0,Ie=null,ie=T.next();ee!==null&&!ie.done;oe++,ie=T.next()){ee.index>oe?(Ie=ee,ee=null):Ie=ee.sibling;var Kt=U(_,ee,ie.value,D);if(Kt===null){ee===null&&(ee=Ie);break}t&&ee&&Kt.alternate===null&&n(_,ee),E=f(Kt,E,oe),he===null?Y=Kt:he.sibling=Kt,he=Kt,ee=Ie}if(ie.done)return s(_,ee),Y;if(ee===null){for(;!ie.done;oe++,ie=T.next())ie=$(_,ie.value,D),ie!==null&&(E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie);return Y}for(ee=a(_,ee);!ie.done;oe++,ie=T.next())ie=ae(ee,_,oe,ie.value,D),ie!==null&&(t&&ie.alternate!==null&&ee.delete(ie.key===null?oe:ie.key),E=f(ie,E,oe),he===null?Y=ie:he.sibling=ie,he=ie);return t&&ee.forEach(function(Kg){return n(_,Kg)}),Y}return function(_,E,T,D){var Y=typeof T=="object"&&T!==null&&T.type===S&&T.key===null;Y&&(T=T.props.children);var he=typeof T=="object"&&T!==null;if(he)switch(T.$$typeof){case p:e:{for(he=T.key,Y=E;Y!==null;){if(Y.key===he){switch(Y.tag){case 7:if(T.type===S){s(_,Y.sibling),E=c(Y,T.props.children),E.return=_,_=E;break e}break;default:if(Y.elementType===T.type){s(_,Y.sibling),E=c(Y,T.props),E.ref=$n(_,Y,T),E.return=_,_=E;break e}}s(_,Y);break}else n(_,Y);Y=Y.sibling}T.type===S?(E=On(T.props.children,_.mode,D,T.key),E.return=_,_=E):(D=br(T.type,T.key,T.props,null,_.mode,D),D.ref=$n(_,E,T),D.return=_,_=D)}return v(_);case m:e:{for(Y=T.key;E!==null;){if(E.key===Y)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){s(_,E.sibling),E=c(E,T.children||[]),E.return=_,_=E;break e}else{s(_,E);break}else n(_,E);E=E.sibling}E=Lo(T,_.mode,D),E.return=_,_=E}return v(_)}if(typeof T=="string"||typeof T=="number")return T=""+T,E!==null&&E.tag===6?(s(_,E.sibling),E=c(E,T),E.return=_,_=E):(s(_,E),E=Mo(T,_.mode,D),E.return=_,_=E),v(_);if(cr(T))return ve(_,E,T,D);if(fe(T))return rt(_,E,T,D);if(he&&dr(_,T),typeof T=="undefined"&&!Y)switch(_.tag){case 1:case 22:case 0:case 11:case 15:throw Error(h(152,Ee(_.type)||"Component"))}return s(_,E)}}var hr=hu(!0),fu=hu(!1),ei={},tt=Bt(ei),ti=Bt(ei),Pn=Bt(ei);function pt(t){if(t===ei)throw Error(h(174));return t}function js(t,n){xe(Pn,n),xe(ti,t),xe(tt,ei),t=bt(n),pe(tt),xe(tt,t)}function Cn(){pe(tt),pe(ti),pe(Pn)}function gu(t){var n=pt(Pn.current),s=pt(tt.current);n=A(s,t.type,n),s!==n&&(xe(ti,t),xe(tt,n))}function Hs(t){ti.current===t&&(pe(tt),pe(ti))}var _e=Bt(0);function fr(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ig(s)||rg(s)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&64)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Mt=null,cn=null,mt=!1;function pu(t,n){var s=it(5,null,null,0);s.elementType="DELETED",s.type="DELETED",s.stateNode=n,s.return=t,s.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=s,t.lastEffect=s):t.firstEffect=t.lastEffect=s}function mu(t,n){switch(t.tag){case 5:return n=tg(n,t.type,t.pendingProps),n!==null?(t.stateNode=n,!0):!1;case 6:return n=ng(n,t.pendingProps),n!==null?(t.stateNode=n,!0):!1;case 13:return!1;default:return!1}}function Vs(t){if(mt){var n=cn;if(n){var s=n;if(!mu(t,n)){if(n=Ts(s),!n||!mu(t,n)){t.flags=t.flags&-1025|2,mt=!1,Mt=t;return}pu(Mt,s)}Mt=t,cn=Va(n)}else t.flags=t.flags&-1025|2,mt=!1,Mt=t}}function vu(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Mt=t}function gr(t){if(!dt||t!==Mt)return!1;if(!mt)return vu(t),mt=!0,!1;var n=t.type;if(t.tag!==5||n!=="head"&&n!=="body"&&!ut(n,t.memoizedProps))for(n=cn;n;)pu(t,n),n=Ts(n);if(vu(t),t.tag===13){if(!dt)throw Error(h(316));if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(h(317));cn=lg(t)}else cn=Mt?Ts(t.stateNode):null;return!0}function Ws(){dt&&(cn=Mt=null,mt=!1)}var Tn=[];function Qs(){for(var t=0;t<Tn.length;t++){var n=Tn[t];me?n._workInProgressVersionPrimary=null:n._workInProgressVersionSecondary=null}Tn.length=0}var ni=g.ReactCurrentDispatcher,nt=g.ReactCurrentBatchConfig,ii=0,Ce=null,be=null,Ae=null,pr=!1,ri=!1;function Xe(){throw Error(h(321))}function Xs(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!$e(t[s],n[s]))return!1;return!0}function Ys(t,n,s,a,c,f){if(ii=f,Ce=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ni.current=t===null||t.memoizedState===null?Pg:Cg,t=s(a,c),ri){f=0;do{if(ri=!1,!(25>f))throw Error(h(301));f+=1,Ae=be=null,n.updateQueue=null,ni.current=Tg,t=s(a,c)}while(ri)}if(ni.current=wr,n=be!==null&&be.next!==null,ii=0,Ae=be=Ce=null,pr=!1,n)throw Error(h(300));return t}function dn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?Ce.memoizedState=Ae=t:Ae=Ae.next=t,Ae}function hn(){if(be===null){var t=Ce.alternate;t=t!==null?t.memoizedState:null}else t=be.next;var n=Ae===null?Ce.memoizedState:Ae.next;if(n!==null)Ae=n,be=t;else{if(t===null)throw Error(h(310));be=t,t={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},Ae===null?Ce.memoizedState=Ae=t:Ae=Ae.next=t}return Ae}function vt(t,n){return typeof n=="function"?n(t):n}function si(t){var n=hn(),s=n.queue;if(s===null)throw Error(h(311));s.lastRenderedReducer=t;var a=be,c=a.baseQueue,f=s.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}a.baseQueue=c=f,s.pending=null}if(c!==null){c=c.next,a=a.baseState;var w=v=f=null,C=c;do{var z=C.lane;if((ii&z)===z)w!==null&&(w=w.next={lane:0,action:C.action,eagerReducer:C.eagerReducer,eagerState:C.eagerState,next:null}),a=C.eagerReducer===t?C.eagerState:t(a,C.action);else{var X={lane:z,action:C.action,eagerReducer:C.eagerReducer,eagerState:C.eagerState,next:null};w===null?(v=w=X,f=a):w=w.next=X,Ce.lanes|=z,hi|=z}C=C.next}while(C!==null&&C!==c);w===null?f=a:w.next=v,$e(a,n.memoizedState)||(ft=!0),n.memoizedState=a,n.baseState=f,n.baseQueue=w,s.lastRenderedState=a}return[n.memoizedState,s.dispatch]}function oi(t){var n=hn(),s=n.queue;if(s===null)throw Error(h(311));s.lastRenderedReducer=t;var a=s.dispatch,c=s.pending,f=n.memoizedState;if(c!==null){s.pending=null;var v=c=c.next;do f=t(f,v.action),v=v.next;while(v!==c);$e(f,n.memoizedState)||(ft=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,a]}function yu(t,n,s){var a=n._getVersion;a=a(n._source);var c=me?n._workInProgressVersionPrimary:n._workInProgressVersionSecondary;if(c!==null?t=c===a:(t=t.mutableReadLanes,(t=(ii&t)===t)&&(me?n._workInProgressVersionPrimary=a:n._workInProgressVersionSecondary=a,Tn.push(n))),t)return s(n._source);throw Tn.push(n),Error(h(350))}function wu(t,n,s,a){var c=je;if(c===null)throw Error(h(349));var f=n._getVersion,v=f(n._source),w=ni.current,C=w.useState(function(){return yu(c,n,s)}),z=C[1],X=C[0];C=Ae;var $=t.memoizedState,U=$.refs,ae=U.getSnapshot,ve=$.source;$=$.subscribe;var rt=Ce;return t.memoizedState={refs:U,source:n,subscribe:a},w.useEffect(function(){U.getSnapshot=s,U.setSnapshot=z;var _=f(n._source);if(!$e(v,_)){_=s(n._source),$e(X,_)||(z(_),_=qt(rt),c.mutableReadLanes|=_&c.pendingLanes),_=c.mutableReadLanes,c.entangledLanes|=_;for(var E=c.entanglements,T=_;0<T;){var D=31-Ht(T),Y=1<<D;E[D]|=_,T&=~Y}}},[s,n,a]),w.useEffect(function(){return a(n._source,function(){var _=U.getSnapshot,E=U.setSnapshot;try{E(_(n._source));var T=qt(rt);c.mutableReadLanes|=T&c.pendingLanes}catch(D){E(function(){throw D})}})},[n,a]),$e(ae,s)&&$e(ve,n)&&$e($,a)||(t={pending:null,dispatch:null,lastRenderedReducer:vt,lastRenderedState:X},t.dispatch=z=Ks.bind(null,Ce,t),C.queue=t,C.baseQueue=null,X=yu(c,n,s),C.memoizedState=C.baseState=X),X}function Su(t,n,s){var a=hn();return wu(a,t,n,s)}function li(t){var n=dn();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t=n.queue={pending:null,dispatch:null,lastRenderedReducer:vt,lastRenderedState:t},t=t.dispatch=Ks.bind(null,Ce,t),[n.memoizedState,t]}function mr(t,n,s,a){return t={tag:t,create:n,destroy:s,deps:a,next:null},n=Ce.updateQueue,n===null?(n={lastEffect:null},Ce.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(a=s.next,s.next=t,t.next=a,n.lastEffect=t)),t}function Eu(t){var n=dn();return t={current:t},n.memoizedState=t}function vr(){return hn().memoizedState}function qs(t,n,s,a){var c=dn();Ce.flags|=t,c.memoizedState=mr(1|n,s,void 0,a===void 0?null:a)}function Zs(t,n,s,a){var c=hn();a=a===void 0?null:a;var f=void 0;if(be!==null){var v=be.memoizedState;if(f=v.destroy,a!==null&&Xs(a,v.deps)){mr(n,s,f,a);return}}Ce.flags|=t,c.memoizedState=mr(1|n,s,f,a)}function xu(t,n){return qs(516,4,t,n)}function yr(t,n){return Zs(516,4,t,n)}function _u(t,n){return Zs(4,2,t,n)}function Pu(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Cu(t,n,s){return s=s!=null?s.concat([t]):null,Zs(4,2,Pu.bind(null,n,t),s)}function Gs(){}function Tu(t,n){var s=hn();n=n===void 0?null:n;var a=s.memoizedState;return a!==null&&n!==null&&Xs(n,a[1])?a[0]:(s.memoizedState=[t,n],t)}function Iu(t,n){var s=hn();n=n===void 0?null:n;var a=s.memoizedState;return a!==null&&n!==null&&Xs(n,a[1])?a[0]:(t=t(),s.memoizedState=[t,n],t)}function _g(t,n){var s=En();kt(98>s?98:s,function(){t(!0)}),kt(97<s?97:s,function(){var a=nt.transition;nt.transition=1;try{t(!1),n()}finally{nt.transition=a}})}function Ks(t,n,s){var a=qe(),c=qt(t),f={lane:c,action:s,eagerReducer:null,eagerState:null,next:null},v=n.pending;if(v===null?f.next=f:(f.next=v.next,v.next=f),n.pending=f,v=t.alternate,t===Ce||v!==null&&v===Ce)ri=pr=!0;else{if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var w=n.lastRenderedState,C=v(w,s);if(f.eagerReducer=v,f.eagerState=C,$e(C,w))return}catch{}finally{}Rt(t,c,a)}}var wr={readContext:et,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useOpaqueIdentifier:Xe,unstable_isNewReconciler:!1},Pg={readContext:et,useCallback:function(t,n){return dn().memoizedState=[t,n===void 0?null:n],t},useContext:et,useEffect:xu,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,qs(4,2,Pu.bind(null,n,t),s)},useLayoutEffect:function(t,n){return qs(4,2,t,n)},useMemo:function(t,n){var s=dn();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var a=dn();return n=s!==void 0?s(n):n,a.memoizedState=a.baseState=n,t=a.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},t=t.dispatch=Ks.bind(null,Ce,t),[a.memoizedState,t]},useRef:Eu,useState:li,useDebugValue:Gs,useDeferredValue:function(t){var n=li(t),s=n[0],a=n[1];return xu(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=li(!1),n=t[0];return t=_g.bind(null,t[1]),Eu(t),[t,n]},useMutableSource:function(t,n,s){var a=dn();return a.memoizedState={refs:{getSnapshot:n,setSnapshot:null},source:t,subscribe:s},wu(a,t,n,s)},useOpaqueIdentifier:function(){if(mt){var t=!1,n=Of(function(){throw t||(t=!0,s(Ps())),Error(h(355))}),s=li(n)[1];return(Ce.mode&2)===0&&(Ce.flags|=516,mr(5,function(){s(Ps())},void 0,null)),n}return n=Ps(),li(n),n},unstable_isNewReconciler:!1},Cg={readContext:et,useCallback:Tu,useContext:et,useEffect:yr,useImperativeHandle:Cu,useLayoutEffect:_u,useMemo:Iu,useReducer:si,useRef:vr,useState:function(){return si(vt)},useDebugValue:Gs,useDeferredValue:function(t){var n=si(vt),s=n[0],a=n[1];return yr(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=si(vt)[0];return[vr().current,t]},useMutableSource:Su,useOpaqueIdentifier:function(){return si(vt)[0]},unstable_isNewReconciler:!1},Tg={readContext:et,useCallback:Tu,useContext:et,useEffect:yr,useImperativeHandle:Cu,useLayoutEffect:_u,useMemo:Iu,useReducer:oi,useRef:vr,useState:function(){return oi(vt)},useDebugValue:Gs,useDeferredValue:function(t){var n=oi(vt),s=n[0],a=n[1];return yr(function(){var c=nt.transition;nt.transition=1;try{a(t)}finally{nt.transition=c}},[t]),s},useTransition:function(){var t=oi(vt)[0];return[vr().current,t]},useMutableSource:Su,useOpaqueIdentifier:function(){return oi(vt)[0]},unstable_isNewReconciler:!1},Ig=g.ReactCurrentOwner,ft=!1;function Ye(t,n,s,a){n.child=t===null?fu(n,null,s,a):hr(n,t.child,s,a)}function ku(t,n,s,a,c){s=s.render;var f=n.ref;return _n(n,c),a=Ys(t,n,s,a,f,c),t!==null&&!ft?(n.updateQueue=t.updateQueue,n.flags&=-517,t.lanes&=~c,Lt(t,n,c)):(n.flags|=1,Ye(t,n,a,c),n.child)}function Mu(t,n,s,a,c,f){if(t===null){var v=s.type;return typeof v=="function"&&!Io(v)&&v.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=v,Lu(t,n,v,a,c,f)):(t=br(s.type,null,a,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}return v=t.child,(c&f)===0&&(c=v.memoizedProps,s=s.compare,s=s!==null?s:rr,s(c,a)&&t.ref===n.ref)?Lt(t,n,f):(n.flags|=1,t=Gt(v,a),t.ref=n.ref,t.return=n,n.child=t)}function Lu(t,n,s,a,c,f){if(t!==null&&rr(t.memoizedProps,a)&&t.ref===n.ref)if(ft=!1,(f&c)!==0)(t.flags&16384)!==0&&(ft=!0);else return n.lanes=t.lanes,Lt(t,n,f);return $s(t,n,s,a,f)}function Js(t,n,s){var a=n.pendingProps,c=a.children,f=t!==null?t.memoizedState:null;if(a.mode==="hidden"||a.mode==="unstable-defer-without-hiding")if((n.mode&4)===0)n.memoizedState={baseLanes:0},Fr(n,s);else if((s&1073741824)!==0)n.memoizedState={baseLanes:0},Fr(n,f!==null?f.baseLanes:s);else return t=f!==null?f.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t},Fr(n,t),null;else f!==null?(a=f.baseLanes|s,n.memoizedState=null):a=s,Fr(n,a);return Ye(t,n,c,s),n.child}function Ou(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=128)}function $s(t,n,s,a,c){var f=Qe(s)?ln:Ue.current;return f=wn(n,f),_n(n,c),s=Ys(t,n,s,a,f,c),t!==null&&!ft?(n.updateQueue=t.updateQueue,n.flags&=-517,t.lanes&=~c,Lt(t,n,c)):(n.flags|=1,Ye(t,n,s,c),n.child)}function Nu(t,n,s,a,c){if(Qe(s)){var f=!0;Ji(n)}else f=!1;if(_n(n,c),n.stateNode===null)t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),cu(n,s,a),Bs(n,s,a,c),a=!0;else if(t===null){var v=n.stateNode,w=n.memoizedProps;v.props=w;var C=v.context,z=s.contextType;typeof z=="object"&&z!==null?z=et(z):(z=Qe(s)?ln:Ue.current,z=wn(n,z));var X=s.getDerivedStateFromProps,$=typeof X=="function"||typeof v.getSnapshotBeforeUpdate=="function";$||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==a||C!==z)&&du(n,v,a,z),Vt=!1;var U=n.memoizedState;v.state=U,Jn(n,a,v,c),C=n.memoizedState,w!==a||U!==C||We.current||Vt?(typeof X=="function"&&(ar(n,s,X,a),C=n.memoizedState),(w=Vt||uu(n,s,w,a,U,C,z))?($||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(n.flags|=4)):(typeof v.componentDidMount=="function"&&(n.flags|=4),n.memoizedProps=a,n.memoizedState=C),v.props=a,v.state=C,v.context=z,a=w):(typeof v.componentDidMount=="function"&&(n.flags|=4),a=!1)}else{v=n.stateNode,su(t,n),w=n.memoizedProps,z=n.type===n.elementType?w:ht(n.type,w),v.props=z,$=n.pendingProps,U=v.context,C=s.contextType,typeof C=="object"&&C!==null?C=et(C):(C=Qe(s)?ln:Ue.current,C=wn(n,C));var ae=s.getDerivedStateFromProps;(X=typeof ae=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==$||U!==C)&&du(n,v,a,C),Vt=!1,U=n.memoizedState,v.state=U,Jn(n,a,v,c);var ve=n.memoizedState;w!==$||U!==ve||We.current||Vt?(typeof ae=="function"&&(ar(n,s,ae,a),ve=n.memoizedState),(z=Vt||uu(n,s,z,a,U,ve,C))?(X||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(a,ve,C),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(a,ve,C)),typeof v.componentDidUpdate=="function"&&(n.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(n.flags|=256)):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&U===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&U===t.memoizedState||(n.flags|=256),n.memoizedProps=a,n.memoizedState=ve),v.props=a,v.state=ve,v.context=C,a=z):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&U===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&U===t.memoizedState||(n.flags|=256),a=!1)}return eo(t,n,s,a,f,c)}function eo(t,n,s,a,c,f){Ou(t,n);var v=(n.flags&64)!==0;if(!a&&!v)return c&&Ya(n,s,!1),Lt(t,n,f);a=n.stateNode,Ig.current=n;var w=v&&typeof s.getDerivedStateFromError!="function"?null:a.render();return n.flags|=1,t!==null&&v?(n.child=hr(n,t.child,null,f),n.child=hr(n,null,w,f)):Ye(t,n,w,f),n.memoizedState=a.state,c&&Ya(n,s,!0),n.child}function Ru(t){var n=t.stateNode;n.pendingContext?Qa(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Qa(t,n.context,!1),js(t,n.containerInfo)}var Sr={dehydrated:null,retryLane:0};function zu(t,n,s){var a=n.pendingProps,c=_e.current,f=!1,v;return(v=(n.flags&64)!==0)||(v=t!==null&&t.memoizedState===null?!1:(c&2)!==0),v?(f=!0,n.flags&=-65):t!==null&&t.memoizedState===null||a.fallback===void 0||a.unstable_avoidThisFallback===!0||(c|=1),xe(_e,c&1),t===null?(a.fallback!==void 0&&Vs(n),t=a.children,c=a.fallback,f?(t=Au(n,t,c,s),n.child.memoizedState={baseLanes:s},n.memoizedState=Sr,t):typeof a.unstable_expectedLoadTime=="number"?(t=Au(n,t,c,s),n.child.memoizedState={baseLanes:s},n.memoizedState=Sr,n.lanes=33554432,t):(s=ko({mode:"visible",children:t},n.mode,s,null),s.return=n,n.child=s)):t.memoizedState!==null?f?(a=Du(t,n,a.children,a.fallback,s),f=n.child,c=t.child.memoizedState,f.memoizedState=c===null?{baseLanes:s}:{baseLanes:c.baseLanes|s},f.childLanes=t.childLanes&~s,n.memoizedState=Sr,a):(s=Fu(t,n,a.children,s),n.memoizedState=null,s):f?(a=Du(t,n,a.children,a.fallback,s),f=n.child,c=t.child.memoizedState,f.memoizedState=c===null?{baseLanes:s}:{baseLanes:c.baseLanes|s},f.childLanes=t.childLanes&~s,n.memoizedState=Sr,a):(s=Fu(t,n,a.children,s),n.memoizedState=null,s)}function Au(t,n,s,a){var c=t.mode,f=t.child;return n={mode:"hidden",children:n},(c&2)===0&&f!==null?(f.childLanes=0,f.pendingProps=n):f=ko(n,c,0,null),s=On(s,c,a,null),f.return=t,s.return=t,f.sibling=s,t.child=f,s}function Fu(t,n,s,a){var c=t.child;return t=c.sibling,s=Gt(c,{mode:"visible",children:s}),(n.mode&2)===0&&(s.lanes=a),s.return=n,s.sibling=null,t!==null&&(t.nextEffect=null,t.flags=8,n.firstEffect=n.lastEffect=t),n.child=s}function Du(t,n,s,a,c){var f=n.mode,v=t.child;t=v.sibling;var w={mode:"hidden",children:s};return(f&2)===0&&n.child!==v?(s=n.child,s.childLanes=0,s.pendingProps=w,v=s.lastEffect,v!==null?(n.firstEffect=s.firstEffect,n.lastEffect=v,v.nextEffect=null):n.firstEffect=n.lastEffect=null):s=Gt(v,w),t!==null?a=Gt(t,a):(a=On(a,f,c,null),a.flags|=2),a.return=n,s.return=n,s.sibling=a,n.child=s,a}function Uu(t,n){t.lanes|=n;var s=t.alternate;s!==null&&(s.lanes|=n),ru(t.return,n)}function to(t,n,s,a,c,f){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:c,lastEffect:f}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=a,v.tail=s,v.tailMode=c,v.lastEffect=f)}function bu(t,n,s){var a=n.pendingProps,c=a.revealOrder,f=a.tail;if(Ye(t,n,a.children,s),a=_e.current,(a&2)!==0)a=a&1|2,n.flags|=64;else{if(t!==null&&(t.flags&64)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Uu(t,s);else if(t.tag===19)Uu(t,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}if(xe(_e,a),(n.mode&2)===0)n.memoizedState=null;else switch(c){case"forwards":for(s=n.child,c=null;s!==null;)t=s.alternate,t!==null&&fr(t)===null&&(c=s),s=s.sibling;s=c,s===null?(c=n.child,n.child=null):(c=s.sibling,s.sibling=null),to(n,!1,c,s,f,n.lastEffect);break;case"backwards":for(s=null,c=n.child,n.child=null;c!==null;){if(t=c.alternate,t!==null&&fr(t)===null){n.child=c;break}t=c.sibling,c.sibling=s,s=c,c=t}to(n,!0,s,null,f,n.lastEffect);break;case"together":to(n,!1,null,null,void 0,n.lastEffect);break;default:n.memoizedState=null}return n.child}function Lt(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),hi|=n.lanes,(s&n.childLanes)!==0){if(t!==null&&n.child!==t.child)throw Error(h(153));if(n.child!==null){for(t=n.child,s=Gt(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Gt(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}return null}function yt(t){t.flags|=4}var ai,ui,Er,xr;if(Pe)ai=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)we(t,s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},ui=function(){},Er=function(t,n,s,a,c){if(t=t.memoizedProps,t!==a){var f=n.stateNode,v=pt(tt.current);s=at(f,s,t,a,c,v),(n.updateQueue=s)&&yt(n)}},xr=function(t,n,s,a){s!==a&&yt(n)};else if(ct){ai=function(t,n,s,a){for(var c=n.child;c!==null;){if(c.tag===5){var f=c.stateNode;s&&a&&(f=ja(f,c.type,c.memoizedProps,c)),we(t,f)}else if(c.tag===6)f=c.stateNode,s&&a&&(f=Ha(f,c.memoizedProps,c)),we(t,f);else if(c.tag!==4){if(c.tag===13&&(c.flags&4)!==0&&(f=c.memoizedState!==null)){var v=c.child;if(v!==null&&(v.child!==null&&(v.child.return=v,ai(t,v,!0,f)),f=v.sibling,f!==null)){f.return=c,c=f;continue}}if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}};var Bu=function(t,n,s,a){for(var c=n.child;c!==null;){if(c.tag===5){var f=c.stateNode;s&&a&&(f=ja(f,c.type,c.memoizedProps,c)),ba(t,f)}else if(c.tag===6)f=c.stateNode,s&&a&&(f=Ha(f,c.memoizedProps,c)),ba(t,f);else if(c.tag!==4){if(c.tag===13&&(c.flags&4)!==0&&(f=c.memoizedState!==null)){var v=c.child;if(v!==null&&(v.child!==null&&(v.child.return=v,Bu(t,v,!0,f)),f=v.sibling,f!==null)){f.return=c,c=f;continue}}if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}};ui=function(t){var n=t.stateNode;if(t.firstEffect!==null){var s=n.containerInfo,a=Ua(s);Bu(a,t,!1,!1),n.pendingChildren=a,yt(t),eg(s,a)}},Er=function(t,n,s,a,c){var f=t.stateNode,v=t.memoizedProps;if((t=n.firstEffect===null)&&v===a)n.stateNode=f;else{var w=n.stateNode,C=pt(tt.current),z=null;v!==a&&(z=at(w,s,v,a,c,C)),t&&z===null?n.stateNode=f:(f=$f(f,z,s,v,a,n,t,w),lt(f,s,a,c,C)&&yt(n),n.stateNode=f,t?yt(n):ai(f,n,!1,!1))}},xr=function(t,n,s,a){s!==a?(t=pt(Pn.current),s=pt(tt.current),n.stateNode=Ze(a,t,s,n),yt(n)):n.stateNode=t.stateNode}}else ui=function(){},Er=function(){},xr=function(){};function ci(t,n){if(!mt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function kg(t,n,s){var a=n.pendingProps;switch(n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Qe(n.type)&&Ki(),null;case 3:return Cn(),pe(We),pe(Ue),Qs(),a=n.stateNode,a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(gr(n)?yt(n):a.hydrate||(n.flags|=256)),ui(n),null;case 5:Hs(n);var c=pt(Pn.current);if(s=n.type,t!==null&&n.stateNode!=null)Er(t,n,s,a,c),t.ref!==n.ref&&(n.flags|=128);else{if(!a){if(n.stateNode===null)throw Error(h(166));return null}if(t=pt(tt.current),gr(n)){if(!dt)throw Error(h(175));t=sg(n.stateNode,n.type,n.memoizedProps,c,t,n),n.updateQueue=t,t!==null&&yt(n)}else{var f=ce(s,a,c,t,n);ai(f,n,!1,!1),n.stateNode=f,lt(f,s,a,c,t)&&yt(n)}n.ref!==null&&(n.flags|=128)}return null;case 6:if(t&&n.stateNode!=null)xr(t,n,t.memoizedProps,a);else{if(typeof a!="string"&&n.stateNode===null)throw Error(h(166));if(t=pt(Pn.current),c=pt(tt.current),gr(n)){if(!dt)throw Error(h(176));og(n.stateNode,n.memoizedProps,n)&&yt(n)}else n.stateNode=Ze(a,t,c,n)}return null;case 13:return pe(_e),a=n.memoizedState,(n.flags&64)!==0?(n.lanes=s,n):(a=a!==null,c=!1,t===null?n.memoizedProps.fallback!==void 0&&gr(n):c=t.memoizedState!==null,a&&!c&&(n.mode&2)!==0&&(t===null&&n.memoizedProps.unstable_avoidThisFallback!==!0||(_e.current&1)!==0?Fe===0&&(Fe=3):((Fe===0||Fe===3)&&(Fe=4),je===null||(hi&134217727)===0&&(kn&134217727)===0||Mn(je,Be))),ct&&a&&(n.flags|=4),Pe&&(a||c)&&(n.flags|=4),null);case 4:return Cn(),ui(n),t===null&&Rf(n.stateNode.containerInfo),null;case 10:return Us(n),null;case 17:return Qe(n.type)&&Ki(),null;case 19:if(pe(_e),a=n.memoizedState,a===null)return null;if(c=(n.flags&64)!==0,f=a.rendering,f===null)if(c)ci(a,!1);else{if(Fe!==0||t!==null&&(t.flags&64)!==0)for(t=n.child;t!==null;){if(f=fr(t),f!==null){for(n.flags|=64,ci(a,!1),t=f.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),a.lastEffect===null&&(n.firstEffect=null),n.lastEffect=a.lastEffect,t=s,a=n.child;a!==null;)c=a,s=t,c.flags&=2,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,f=c.alternate,f===null?(c.childLanes=0,c.lanes=s,c.child=null,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=f.childLanes,c.lanes=f.lanes,c.child=f.child,c.memoizedProps=f.memoizedProps,c.memoizedState=f.memoizedState,c.updateQueue=f.updateQueue,c.type=f.type,s=f.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a=a.sibling;return xe(_e,_e.current&1|2),n.child}t=t.sibling}a.tail!==null&&ze()>yo&&(n.flags|=64,c=!0,ci(a,!1),n.lanes=33554432)}else{if(!c)if(t=fr(f),t!==null){if(n.flags|=64,c=!0,t=t.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),ci(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!mt)return n=n.lastEffect=a.lastEffect,n!==null&&(n.nextEffect=null),null}else 2*ze()-a.renderingStartTime>yo&&s!==1073741824&&(n.flags|=64,c=!0,ci(a,!1),n.lanes=33554432);a.isBackwards?(f.sibling=n.child,n.child=f):(t=a.last,t!==null?t.sibling=f:n.child=f,a.last=f)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.lastEffect=n.lastEffect,a.renderingStartTime=ze(),t.sibling=null,n=_e.current,xe(_e,c?n&1|2:n&1),t):null;case 23:case 24:return Po(),t!==null&&t.memoizedState!==null!=(n.memoizedState!==null)&&a.mode!=="unstable-defer-without-hiding"&&(n.flags|=4),null}throw Error(h(156,n.tag))}function Mg(t){switch(t.tag){case 1:Qe(t.type)&&Ki();var n=t.flags;return n&4096?(t.flags=n&-4097|64,t):null;case 3:if(Cn(),pe(We),pe(Ue),Qs(),n=t.flags,(n&64)!==0)throw Error(h(285));return t.flags=n&-4097|64,t;case 5:return Hs(t),null;case 13:return pe(_e),n=t.flags,n&4096?(t.flags=n&-4097|64,t):null;case 19:return pe(_e),null;case 4:return Cn(),null;case 10:return Us(t),null;case 23:case 24:return Po(),null;default:return null}}function no(t,n){try{var s="",a=n;do s+=xg(a),a=a.return;while(a);var c=s}catch(f){c=`
|
|
24
24
|
Error generating stack: `+f.message+`
|
|
25
|
-
`+f.stack}return{value:t,source:n,stack:c}}function io(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Lg=typeof WeakMap=="function"?WeakMap:Map;function ju(t,n,s){s=Wt(-1,s),s.tag=3,s.payload={element:null};var a=n.value;return s.callback=function(){Nr||(Nr=!0,wo=a),io(t,n)},s}function Hu(t,n,s){s=Wt(-1,s),s.tag=3;var a=t.type.getDerivedStateFromError;if(typeof a=="function"){var c=n.value;s.payload=function(){return io(t,n),a(c)}}var f=t.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(s.callback=function(){typeof a!="function"&&(wt===null?wt=new Set([this]):wt.add(this),io(t,n));var v=n.stack;this.componentDidCatch(n.value,{componentStack:v!==null?v:""})}),s}var Og=typeof WeakSet=="function"?WeakSet:Set;function Vu(t){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Zt(t,s)}else n.current=null}function Ng(t,n){switch(n.tag){case 0:case 11:case 15:case 22:return;case 1:if(n.flags&256&&t!==null){var s=t.memoizedProps,a=t.memoizedState;t=n.stateNode,n=t.getSnapshotBeforeUpdate(n.elementType===n.type?s:ht(n.type,s),a),t.__reactInternalSnapshotBeforeUpdate=n}return;case 3:Pe&&n.flags&256&&Cs(n.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(h(163))}function Wu(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var a=s.destroy;s.destroy=void 0,a!==void 0&&a()}s=s.next}while(s!==n)}}function Rg(t,n,s){switch(s.tag){case 0:case 11:case 15:case 22:if(n=s.updateQueue,n=n!==null?n.lastEffect:null,n!==null){t=n=n.next;do{if((t.tag&3)===3){var a=t.create;t.destroy=a()}t=t.next}while(t!==n)}if(n=s.updateQueue,n=n!==null?n.lastEffect:null,n!==null){t=n=n.next;do{var c=t;a=c.next,c=c.tag,(c&4)!==0&&(c&1)!==0&&(lc(s,t),Hg(s,t)),t=a}while(t!==n)}return;case 1:t=s.stateNode,s.flags&4&&(n===null?t.componentDidMount():(a=s.elementType===s.type?n.memoizedProps:ht(s.type,n.memoizedProps),t.componentDidUpdate(a,n.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),n=s.updateQueue,n!==null&&lu(s,n,t);return;case 3:if(n=s.updateQueue,n!==null){if(t=null,s.child!==null)switch(s.child.tag){case 5:t=ue(s.child.stateNode);break;case 1:t=s.child.stateNode}lu(s,n,t)}return;case 5:t=s.stateNode,n===null&&s.flags&4&&Vf(t,s.type,s.memoizedProps,s);return;case 6:return;case 4:return;case 12:return;case 13:dt&&s.memoizedState===null&&(s=s.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&ag(s))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(h(163))}function Qu(t,n){if(Pe)for(var s=t;;){if(s.tag===5){var a=s.stateNode;n?Zf(a):Kf(s.stateNode,s.memoizedProps)}else if(s.tag===6)a=s.stateNode,n?Gf(a):Jf(a,s.memoizedProps);else if((s.tag!==23&&s.tag!==24||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}}function Xu(t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Ls,n)}catch{}switch(n.tag){case 0:case 11:case 14:case 15:case 22:if(t=n.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var s=t=t.next;do{var a=s,c=a.destroy;if(a=a.tag,c!==void 0)if((a&4)!==0)lc(n,s);else{a=n;try{c()}catch(f){Zt(a,f)}}s=s.next}while(s!==t)}break;case 1:if(Vu(n),t=n.stateNode,typeof t.componentWillUnmount=="function")try{t.props=n.memoizedProps,t.state=n.memoizedState,t.componentWillUnmount()}catch(f){Zt(n,f)}break;case 5:Vu(n);break;case 4:Pe?Ku(t,n):ct&&ct&&(n=n.stateNode.containerInfo,t=Ua(n),Ba(n,t))}}function Yu(t,n){for(var s=n;;)if(Xu(t,s),s.child===null||Pe&&s.tag===4){if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}else s.child.return=s,s=s.child}function qu(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function Zu(t){return t.tag===5||t.tag===3||t.tag===4}function Gu(t){if(Pe){e:{for(var n=t.return;n!==null;){if(Zu(n))break e;n=n.return}throw Error(h(160))}var s=n;switch(n=s.stateNode,s.tag){case 5:var a=!1;break;case 3:n=n.containerInfo,a=!0;break;case 4:n=n.containerInfo,a=!0;break;default:throw Error(h(161))}s.flags&16&&(Da(n),s.flags&=-17);e:t:for(s=t;;){for(;s.sibling===null;){if(s.return===null||Zu(s.return)){s=null;break e}s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue t;s.child.return=s,s=s.child}if(!(s.flags&2)){s=s.stateNode;break e}}a?ro(t,s,n):so(t,s,n)}}function ro(t,n,s){var a=t.tag,c=a===5||a===6;if(c)t=c?t.stateNode:t.stateNode.instance,n?Xf(s,t,n):jf(s,t);else if(a!==4&&(t=t.child,t!==null))for(ro(t,n,s),t=t.sibling;t!==null;)ro(t,n,s),t=t.sibling}function so(t,n,s){var a=t.tag,c=a===5||a===6;if(c)t=c?t.stateNode:t.stateNode.instance,n?Qf(s,t,n):Bf(s,t);else if(a!==4&&(t=t.child,t!==null))for(so(t,n,s),t=t.sibling;t!==null;)so(t,n,s),t=t.sibling}function Ku(t,n){for(var s=n,a=!1,c,f;;){if(!a){a=s.return;e:for(;;){if(a===null)throw Error(h(160));switch(c=a.stateNode,a.tag){case 5:f=!1;break e;case 3:c=c.containerInfo,f=!0;break e;case 4:c=c.containerInfo,f=!0;break e}a=a.return}a=!0}if(s.tag===5||s.tag===6)Yu(t,s),f?qf(c,s.stateNode):Yf(c,s.stateNode);else if(s.tag===4){if(s.child!==null){c=s.stateNode.containerInfo,f=!0,s.child.return=s,s=s.child;continue}}else if(Xu(t,s),s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return,s.tag===4&&(a=!1)}s.sibling.return=s.return,s=s.sibling}}function oo(t,n){if(Pe){switch(n.tag){case 0:case 11:case 14:case 15:case 22:Wu(3,n);return;case 1:return;case 5:var s=n.stateNode;if(s!=null){var a=n.memoizedProps;t=t!==null?t.memoizedProps:a;var c=n.type,f=n.updateQueue;n.updateQueue=null,f!==null&&Wf(s,f,c,t,a,n)}return;case 6:if(n.stateNode===null)throw Error(h(162));s=n.memoizedProps,Hf(n.stateNode,t!==null?t.memoizedProps:s,s);return;case 3:dt&&(n=n.stateNode,n.hydrate&&(n.hydrate=!1,Wa(n.containerInfo)));return;case 12:return;case 13:Ju(n),_r(n);return;case 19:_r(n);return;case 17:return;case 23:case 24:Qu(n,n.memoizedState!==null);return}throw Error(h(163))}switch(n.tag){case 0:case 11:case 14:case 15:case 22:Wu(3,n);return;case 12:return;case 13:Ju(n),_r(n);return;case 19:_r(n);return;case 3:dt&&(s=n.stateNode,s.hydrate&&(s.hydrate=!1,Wa(s.containerInfo)));break;case 23:case 24:return}e:if(ct){switch(n.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:n=n.stateNode,Ba(n.containerInfo,n.pendingChildren);break e}throw Error(h(163))}}function Ju(t){t.memoizedState!==null&&(vo=ze(),Pe&&Qu(t.child,!0))}function _r(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new Og),n.forEach(function(a){var c=Qg.bind(null,t,a);s.has(a)||(s.add(a),a.then(c,c))})}}function zg(t,n){return t!==null&&(t=t.memoizedState,t===null||t.dehydrated!==null)?(n=n.memoizedState,n!==null&&n.dehydrated===null):!1}var Pr=0,Cr=1,Tr=2,Ir=3,kr=4;if(typeof Symbol=="function"&&Symbol.for){var di=Symbol.for;Pr=di("selector.component"),Cr=di("selector.has_pseudo_class"),Tr=di("selector.role"),Ir=di("selector.test_id"),kr=di("selector.text")}function lo(t){var n=Lf(t);if(n!=null){if(typeof n.memoizedProps["data-testname"]!="string")throw Error(h(364));return n}if(t=zf(t),t===null)throw Error(h(362));return t.stateNode.current}function ao(t,n){switch(n.$$typeof){case Pr:if(t.type===n.value)return!0;break;case Cr:e:{n=n.value,t=[t,0];for(var s=0;s<t.length;){var a=t[s++],c=t[s++],f=n[c];if(a.tag!==5||!qn(a)){for(;f!=null&&ao(a,f);)c++,f=n[c];if(c===n.length){n=!0;break e}else for(a=a.child;a!==null;)t.push(a,c),a=a.sibling}}n=!1}return n;case Tr:if(t.tag===5&&Df(t.stateNode,n.value))return!0;break;case kr:if((t.tag===5||t.tag===6)&&(t=Ff(t),t!==null&&0<=t.indexOf(n.value)))return!0;break;case Ir:if(t.tag===5&&(t=t.memoizedProps["data-testname"],typeof t=="string"&&t.toLowerCase()===n.value.toLowerCase()))return!0;break;default:throw Error(h(365,n))}return!1}function uo(t){switch(t.$$typeof){case Pr:return"<"+(Ee(t.value)||"Unknown")+">";case Cr:return":has("+(uo(t)||"")+")";case Tr:return'[role="'+t.value+'"]';case kr:return'"'+t.value+'"';case Ir:return'[data-testname="'+t.value+'"]';default:throw Error(h(365,t))}}function $u(t,n){var s=[];t=[t,0];for(var a=0;a<t.length;){var c=t[a++],f=t[a++],v=n[f];if(c.tag!==5||!qn(c)){for(;v!=null&&ao(c,v);)f++,v=n[f];if(f===n.length)s.push(c);else for(c=c.child;c!==null;)t.push(c,f),c=c.sibling}}return s}function co(t,n){if(!Yn)throw Error(h(363));t=lo(t),t=$u(t,n),n=[],t=Array.from(t);for(var s=0;s<t.length;){var a=t[s++];if(a.tag===5)qn(a)||n.push(a.stateNode);else for(a=a.child;a!==null;)t.push(a),a=a.sibling}return n}var Mr=null;function Ag(t){if(Mr===null)try{var n=("require"+Math.random()).slice(0,7);Mr=(r&&r[n]).call(r,"timers").setImmediate}catch{Mr=function(a){var c=new MessageChannel;c.port1.onmessage=a,c.port2.postMessage(void 0)}}return Mr(t)}var Fg=Math.ceil,Lr=g.ReactCurrentDispatcher,ho=g.ReactCurrentOwner,fo=g.IsSomeRendererActing,Z=0,je=null,Oe=null,Be=0,fn=0,go=Bt(0),Fe=0,Or=null,In=0,hi=0,kn=0,po=0,mo=null,vo=0,yo=1/0;function Xt(){yo=ze()+500}var H=null,Nr=!1,wo=null,wt=null,Yt=!1,fi=null,gi=90,So=[],Eo=[],Ot=null,pi=0,xo=null,Rr=-1,Nt=0,zr=0,mi=null,vi=!1;function qe(){return(Z&48)!==0?ze():Rr!==-1?Rr:Rr=ze()}function qt(t){if(t=t.mode,(t&2)===0)return 1;if((t&4)===0)return En()===99?1:2;if(Nt===0&&(Nt=In),wg.transition!==0){zr!==0&&(zr=mo!==null?mo.pendingLanes:0),t=Nt;var n=4186112&~zr;return n&=-n,n===0&&(t=4186112&~t,n=t&-t,n===0&&(n=8192)),n}return t=En(),(Z&4)!==0&&t===98?t=er(12,Nt):(t=cg(t),t=er(t,Nt)),t}function Rt(t,n,s){if(50<pi)throw pi=0,xo=null,Error(h(185));if(t=Ar(t,n),t===null)return null;tr(t,n,s),t===je&&(kn|=n,Fe===4&&Mn(t,Be));var a=En();n===1?(Z&8)!==0&&(Z&48)===0?_o(t):(Ge(t,s),Z===0&&(Xt(),Je())):((Z&4)===0||a!==98&&a!==99||(Ot===null?Ot=new Set([t]):Ot.add(t)),Ge(t,s)),mo=t}function Ar(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}function Ge(t,n){for(var s=t.callbackNode,a=t.suspendedLanes,c=t.pingedLanes,f=t.expirationTimes,v=t.pendingLanes;0<v;){var S=31-Ht(v),C=1<<S,z=f[S];if(z===-1){if((C&a)===0||(C&c)!==0){z=n,un(C);var X=de;f[S]=10<=X?z+250:6<=X?z+5e3:-1}}else z<=n&&(t.expiredLanes|=C);v&=~C}if(a=Gn(t,t===je?Be:0),n=de,a===0)s!==null&&(s!==As&&Rs(s),t.callbackNode=null,t.callbackPriority=0);else{if(s!==null){if(t.callbackPriority===n)return;s!==As&&Rs(s)}n===15?(s=_o.bind(null,t),It===null?(It=[s],ir=Ns(nr,nu)):It.push(s),s=As):n===14?s=Kn(99,_o.bind(null,t)):(s=dg(n),s=Kn(s,ec.bind(null,t))),t.callbackPriority=n,t.callbackNode=s}}function ec(t){if(Rr=-1,zr=Nt=0,(Z&48)!==0)throw Error(h(327));var n=t.callbackNode;if(zt()&&t.callbackNode!==n)return null;var s=Gn(t,t===je?Be:0);if(s===0)return null;var a=s,c=Z;Z|=16;var f=rc();(je!==t||Be!==a)&&(Xt(),Ln(t,a));do try{bg();break}catch(S){ic(t,S)}while(1);if(Ds(),Lr.current=f,Z=c,Oe!==null?a=0:(je=null,Be=0,a=Fe),(In&kn)!==0)Ln(t,0);else if(a!==0){if(a===2&&(Z|=64,t.hydrate&&(t.hydrate=!1,Cs(t.containerInfo)),s=qa(t),s!==0&&(a=yi(t,s))),a===1)throw n=Or,Ln(t,0),Mn(t,s),Ge(t,ze()),n;switch(t.finishedWork=t.current.alternate,t.finishedLanes=s,a){case 0:case 1:throw Error(h(345));case 2:gn(t);break;case 3:if(Mn(t,s),(s&62914560)===s&&(a=vo+500-ze(),10<a)){if(Gn(t,0)!==0)break;if(c=t.suspendedLanes,(c&s)!==s){qe(),t.pingedLanes|=t.suspendedLanes&c;break}t.timeoutHandle=Xn(gn.bind(null,t),a);break}gn(t);break;case 4:if(Mn(t,s),(s&4186112)===s)break;for(a=t.eventTimes,c=-1;0<s;){var v=31-Ht(s);f=1<<v,v=a[v],v>c&&(c=v),s&=~f}if(s=c,s=ze()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Fg(s/1960))-s,10<s){t.timeoutHandle=Xn(gn.bind(null,t),s);break}gn(t);break;case 5:gn(t);break;default:throw Error(h(329))}}return Ge(t,ze()),t.callbackNode===n?ec.bind(null,t):null}function Mn(t,n){for(n&=~po,n&=~kn,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Ht(n),a=1<<s;t[s]=-1,n&=~a}}function _o(t){if((Z&48)!==0)throw Error(h(327));if(zt(),t===je&&(t.expiredLanes&Be)!==0){var n=Be,s=yi(t,n);(In&kn)!==0&&(n=Gn(t,n),s=yi(t,n))}else n=Gn(t,0),s=yi(t,n);if(t.tag!==0&&s===2&&(Z|=64,t.hydrate&&(t.hydrate=!1,Cs(t.containerInfo)),n=qa(t),n!==0&&(s=yi(t,n))),s===1)throw s=Or,Ln(t,0),Mn(t,n),Ge(t,ze()),s;return t.finishedWork=t.current.alternate,t.finishedLanes=n,gn(t),Ge(t,ze()),null}function Dg(){if(Ot!==null){var t=Ot;Ot=null,t.forEach(function(n){n.expiredLanes|=24&n.pendingLanes,Ge(n,ze())})}Je()}function tc(t,n){var s=Z;Z|=1;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}}function nc(t,n){var s=Z;if((s&48)!==0)return t(n);Z|=1;try{if(t)return kt(99,t.bind(null,n))}finally{Z=s,Je()}}function Fr(t,n){xe(go,fn),fn|=n,In|=n}function Po(){fn=go.current,pe(go)}function Ln(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==Se&&(t.timeoutHandle=Se,ge(s)),Oe!==null)for(s=Oe.return;s!==null;){var a=s;switch(a.tag){case 1:a=a.type.childContextTypes,a!=null&&Ki();break;case 3:Cn(),pe(We),pe(Ue),Qs();break;case 5:Hs(a);break;case 4:Cn();break;case 13:pe(_e);break;case 19:pe(_e);break;case 10:Us(a);break;case 23:case 24:Po()}s=s.return}je=t,Oe=Gt(t.current,null),Be=fn=In=n,Fe=0,Or=null,po=kn=hi=0}function ic(t,n){do{var s=Oe;try{if(Ds(),ni.current=wr,pr){for(var a=Ce.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}pr=!1}if(ii=0,Ae=be=Ce=null,ri=!1,ho.current=null,s===null||s.return===null){Fe=1,Or=n,Oe=null;break}e:{var f=t,v=s.return,S=s,C=n;if(n=Be,S.flags|=2048,S.firstEffect=S.lastEffect=null,C!==null&&typeof C=="object"&&typeof C.then=="function"){var z=C;if((S.mode&2)===0){var X=S.alternate;X?(S.updateQueue=X.updateQueue,S.memoizedState=X.memoizedState,S.lanes=X.lanes):(S.updateQueue=null,S.memoizedState=null)}var $=(_e.current&1)!==0,U=v;do{var ae;if(ae=U.tag===13){var ve=U.memoizedState;if(ve!==null)ae=ve.dehydrated!==null;else{var rt=U.memoizedProps;ae=rt.fallback===void 0?!1:rt.unstable_avoidThisFallback!==!0?!0:!$}}if(ae){var x=U.updateQueue;if(x===null){var E=new Set;E.add(z),U.updateQueue=E}else x.add(z);if((U.mode&2)===0){if(U.flags|=64,S.flags|=16384,S.flags&=-2981,S.tag===1)if(S.alternate===null)S.tag=17;else{var T=Wt(-1,1);T.tag=2,Qt(S,T)}S.lanes|=1;break e}C=void 0,S=n;var D=f.pingCache;if(D===null?(D=f.pingCache=new Lg,C=new Set,D.set(z,C)):(C=D.get(z),C===void 0&&(C=new Set,D.set(z,C))),!C.has(S)){C.add(S);var Y=Wg.bind(null,f,z,S);z.then(Y,Y)}U.flags|=4096,U.lanes=n;break e}U=U.return}while(U!==null);C=Error((Ee(S.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
25
|
+
`+f.stack}return{value:t,source:n,stack:c}}function io(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Lg=typeof WeakMap=="function"?WeakMap:Map;function ju(t,n,s){s=Wt(-1,s),s.tag=3,s.payload={element:null};var a=n.value;return s.callback=function(){Nr||(Nr=!0,wo=a),io(t,n)},s}function Hu(t,n,s){s=Wt(-1,s),s.tag=3;var a=t.type.getDerivedStateFromError;if(typeof a=="function"){var c=n.value;s.payload=function(){return io(t,n),a(c)}}var f=t.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(s.callback=function(){typeof a!="function"&&(wt===null?wt=new Set([this]):wt.add(this),io(t,n));var v=n.stack;this.componentDidCatch(n.value,{componentStack:v!==null?v:""})}),s}var Og=typeof WeakSet=="function"?WeakSet:Set;function Vu(t){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Zt(t,s)}else n.current=null}function Ng(t,n){switch(n.tag){case 0:case 11:case 15:case 22:return;case 1:if(n.flags&256&&t!==null){var s=t.memoizedProps,a=t.memoizedState;t=n.stateNode,n=t.getSnapshotBeforeUpdate(n.elementType===n.type?s:ht(n.type,s),a),t.__reactInternalSnapshotBeforeUpdate=n}return;case 3:Pe&&n.flags&256&&Cs(n.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(h(163))}function Wu(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var a=s.destroy;s.destroy=void 0,a!==void 0&&a()}s=s.next}while(s!==n)}}function Rg(t,n,s){switch(s.tag){case 0:case 11:case 15:case 22:if(n=s.updateQueue,n=n!==null?n.lastEffect:null,n!==null){t=n=n.next;do{if((t.tag&3)===3){var a=t.create;t.destroy=a()}t=t.next}while(t!==n)}if(n=s.updateQueue,n=n!==null?n.lastEffect:null,n!==null){t=n=n.next;do{var c=t;a=c.next,c=c.tag,(c&4)!==0&&(c&1)!==0&&(lc(s,t),Hg(s,t)),t=a}while(t!==n)}return;case 1:t=s.stateNode,s.flags&4&&(n===null?t.componentDidMount():(a=s.elementType===s.type?n.memoizedProps:ht(s.type,n.memoizedProps),t.componentDidUpdate(a,n.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),n=s.updateQueue,n!==null&&lu(s,n,t);return;case 3:if(n=s.updateQueue,n!==null){if(t=null,s.child!==null)switch(s.child.tag){case 5:t=ue(s.child.stateNode);break;case 1:t=s.child.stateNode}lu(s,n,t)}return;case 5:t=s.stateNode,n===null&&s.flags&4&&Vf(t,s.type,s.memoizedProps,s);return;case 6:return;case 4:return;case 12:return;case 13:dt&&s.memoizedState===null&&(s=s.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&ag(s))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(h(163))}function Qu(t,n){if(Pe)for(var s=t;;){if(s.tag===5){var a=s.stateNode;n?Zf(a):Kf(s.stateNode,s.memoizedProps)}else if(s.tag===6)a=s.stateNode,n?Gf(a):Jf(a,s.memoizedProps);else if((s.tag!==23&&s.tag!==24||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}}function Xu(t,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Ls,n)}catch{}switch(n.tag){case 0:case 11:case 14:case 15:case 22:if(t=n.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var s=t=t.next;do{var a=s,c=a.destroy;if(a=a.tag,c!==void 0)if((a&4)!==0)lc(n,s);else{a=n;try{c()}catch(f){Zt(a,f)}}s=s.next}while(s!==t)}break;case 1:if(Vu(n),t=n.stateNode,typeof t.componentWillUnmount=="function")try{t.props=n.memoizedProps,t.state=n.memoizedState,t.componentWillUnmount()}catch(f){Zt(n,f)}break;case 5:Vu(n);break;case 4:Pe?Ku(t,n):ct&&ct&&(n=n.stateNode.containerInfo,t=Ua(n),Ba(n,t))}}function Yu(t,n){for(var s=n;;)if(Xu(t,s),s.child===null||Pe&&s.tag===4){if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}else s.child.return=s,s=s.child}function qu(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function Zu(t){return t.tag===5||t.tag===3||t.tag===4}function Gu(t){if(Pe){e:{for(var n=t.return;n!==null;){if(Zu(n))break e;n=n.return}throw Error(h(160))}var s=n;switch(n=s.stateNode,s.tag){case 5:var a=!1;break;case 3:n=n.containerInfo,a=!0;break;case 4:n=n.containerInfo,a=!0;break;default:throw Error(h(161))}s.flags&16&&(Da(n),s.flags&=-17);e:t:for(s=t;;){for(;s.sibling===null;){if(s.return===null||Zu(s.return)){s=null;break e}s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue t;s.child.return=s,s=s.child}if(!(s.flags&2)){s=s.stateNode;break e}}a?ro(t,s,n):so(t,s,n)}}function ro(t,n,s){var a=t.tag,c=a===5||a===6;if(c)t=c?t.stateNode:t.stateNode.instance,n?Xf(s,t,n):jf(s,t);else if(a!==4&&(t=t.child,t!==null))for(ro(t,n,s),t=t.sibling;t!==null;)ro(t,n,s),t=t.sibling}function so(t,n,s){var a=t.tag,c=a===5||a===6;if(c)t=c?t.stateNode:t.stateNode.instance,n?Qf(s,t,n):Bf(s,t);else if(a!==4&&(t=t.child,t!==null))for(so(t,n,s),t=t.sibling;t!==null;)so(t,n,s),t=t.sibling}function Ku(t,n){for(var s=n,a=!1,c,f;;){if(!a){a=s.return;e:for(;;){if(a===null)throw Error(h(160));switch(c=a.stateNode,a.tag){case 5:f=!1;break e;case 3:c=c.containerInfo,f=!0;break e;case 4:c=c.containerInfo,f=!0;break e}a=a.return}a=!0}if(s.tag===5||s.tag===6)Yu(t,s),f?qf(c,s.stateNode):Yf(c,s.stateNode);else if(s.tag===4){if(s.child!==null){c=s.stateNode.containerInfo,f=!0,s.child.return=s,s=s.child;continue}}else if(Xu(t,s),s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return,s.tag===4&&(a=!1)}s.sibling.return=s.return,s=s.sibling}}function oo(t,n){if(Pe){switch(n.tag){case 0:case 11:case 14:case 15:case 22:Wu(3,n);return;case 1:return;case 5:var s=n.stateNode;if(s!=null){var a=n.memoizedProps;t=t!==null?t.memoizedProps:a;var c=n.type,f=n.updateQueue;n.updateQueue=null,f!==null&&Wf(s,f,c,t,a,n)}return;case 6:if(n.stateNode===null)throw Error(h(162));s=n.memoizedProps,Hf(n.stateNode,t!==null?t.memoizedProps:s,s);return;case 3:dt&&(n=n.stateNode,n.hydrate&&(n.hydrate=!1,Wa(n.containerInfo)));return;case 12:return;case 13:Ju(n),_r(n);return;case 19:_r(n);return;case 17:return;case 23:case 24:Qu(n,n.memoizedState!==null);return}throw Error(h(163))}switch(n.tag){case 0:case 11:case 14:case 15:case 22:Wu(3,n);return;case 12:return;case 13:Ju(n),_r(n);return;case 19:_r(n);return;case 3:dt&&(s=n.stateNode,s.hydrate&&(s.hydrate=!1,Wa(s.containerInfo)));break;case 23:case 24:return}e:if(ct){switch(n.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:n=n.stateNode,Ba(n.containerInfo,n.pendingChildren);break e}throw Error(h(163))}}function Ju(t){t.memoizedState!==null&&(vo=ze(),Pe&&Qu(t.child,!0))}function _r(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new Og),n.forEach(function(a){var c=Qg.bind(null,t,a);s.has(a)||(s.add(a),a.then(c,c))})}}function zg(t,n){return t!==null&&(t=t.memoizedState,t===null||t.dehydrated!==null)?(n=n.memoizedState,n!==null&&n.dehydrated===null):!1}var Pr=0,Cr=1,Tr=2,Ir=3,kr=4;if(typeof Symbol=="function"&&Symbol.for){var di=Symbol.for;Pr=di("selector.component"),Cr=di("selector.has_pseudo_class"),Tr=di("selector.role"),Ir=di("selector.test_id"),kr=di("selector.text")}function lo(t){var n=Lf(t);if(n!=null){if(typeof n.memoizedProps["data-testname"]!="string")throw Error(h(364));return n}if(t=zf(t),t===null)throw Error(h(362));return t.stateNode.current}function ao(t,n){switch(n.$$typeof){case Pr:if(t.type===n.value)return!0;break;case Cr:e:{n=n.value,t=[t,0];for(var s=0;s<t.length;){var a=t[s++],c=t[s++],f=n[c];if(a.tag!==5||!qn(a)){for(;f!=null&&ao(a,f);)c++,f=n[c];if(c===n.length){n=!0;break e}else for(a=a.child;a!==null;)t.push(a,c),a=a.sibling}}n=!1}return n;case Tr:if(t.tag===5&&Df(t.stateNode,n.value))return!0;break;case kr:if((t.tag===5||t.tag===6)&&(t=Ff(t),t!==null&&0<=t.indexOf(n.value)))return!0;break;case Ir:if(t.tag===5&&(t=t.memoizedProps["data-testname"],typeof t=="string"&&t.toLowerCase()===n.value.toLowerCase()))return!0;break;default:throw Error(h(365,n))}return!1}function uo(t){switch(t.$$typeof){case Pr:return"<"+(Ee(t.value)||"Unknown")+">";case Cr:return":has("+(uo(t)||"")+")";case Tr:return'[role="'+t.value+'"]';case kr:return'"'+t.value+'"';case Ir:return'[data-testname="'+t.value+'"]';default:throw Error(h(365,t))}}function $u(t,n){var s=[];t=[t,0];for(var a=0;a<t.length;){var c=t[a++],f=t[a++],v=n[f];if(c.tag!==5||!qn(c)){for(;v!=null&&ao(c,v);)f++,v=n[f];if(f===n.length)s.push(c);else for(c=c.child;c!==null;)t.push(c,f),c=c.sibling}}return s}function co(t,n){if(!Yn)throw Error(h(363));t=lo(t),t=$u(t,n),n=[],t=Array.from(t);for(var s=0;s<t.length;){var a=t[s++];if(a.tag===5)qn(a)||n.push(a.stateNode);else for(a=a.child;a!==null;)t.push(a),a=a.sibling}return n}var Mr=null;function Ag(t){if(Mr===null)try{var n=("require"+Math.random()).slice(0,7);Mr=(r&&r[n]).call(r,"timers").setImmediate}catch{Mr=function(a){var c=new MessageChannel;c.port1.onmessage=a,c.port2.postMessage(void 0)}}return Mr(t)}var Fg=Math.ceil,Lr=g.ReactCurrentDispatcher,ho=g.ReactCurrentOwner,fo=g.IsSomeRendererActing,Z=0,je=null,Oe=null,Be=0,fn=0,go=Bt(0),Fe=0,Or=null,In=0,hi=0,kn=0,po=0,mo=null,vo=0,yo=1/0;function Xt(){yo=ze()+500}var H=null,Nr=!1,wo=null,wt=null,Yt=!1,fi=null,gi=90,So=[],Eo=[],Ot=null,pi=0,xo=null,Rr=-1,Nt=0,zr=0,mi=null,vi=!1;function qe(){return(Z&48)!==0?ze():Rr!==-1?Rr:Rr=ze()}function qt(t){if(t=t.mode,(t&2)===0)return 1;if((t&4)===0)return En()===99?1:2;if(Nt===0&&(Nt=In),wg.transition!==0){zr!==0&&(zr=mo!==null?mo.pendingLanes:0),t=Nt;var n=4186112&~zr;return n&=-n,n===0&&(t=4186112&~t,n=t&-t,n===0&&(n=8192)),n}return t=En(),(Z&4)!==0&&t===98?t=er(12,Nt):(t=cg(t),t=er(t,Nt)),t}function Rt(t,n,s){if(50<pi)throw pi=0,xo=null,Error(h(185));if(t=Ar(t,n),t===null)return null;tr(t,n,s),t===je&&(kn|=n,Fe===4&&Mn(t,Be));var a=En();n===1?(Z&8)!==0&&(Z&48)===0?_o(t):(Ge(t,s),Z===0&&(Xt(),Je())):((Z&4)===0||a!==98&&a!==99||(Ot===null?Ot=new Set([t]):Ot.add(t)),Ge(t,s)),mo=t}function Ar(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}function Ge(t,n){for(var s=t.callbackNode,a=t.suspendedLanes,c=t.pingedLanes,f=t.expirationTimes,v=t.pendingLanes;0<v;){var w=31-Ht(v),C=1<<w,z=f[w];if(z===-1){if((C&a)===0||(C&c)!==0){z=n,un(C);var X=de;f[w]=10<=X?z+250:6<=X?z+5e3:-1}}else z<=n&&(t.expiredLanes|=C);v&=~C}if(a=Gn(t,t===je?Be:0),n=de,a===0)s!==null&&(s!==As&&Rs(s),t.callbackNode=null,t.callbackPriority=0);else{if(s!==null){if(t.callbackPriority===n)return;s!==As&&Rs(s)}n===15?(s=_o.bind(null,t),It===null?(It=[s],ir=Ns(nr,nu)):It.push(s),s=As):n===14?s=Kn(99,_o.bind(null,t)):(s=dg(n),s=Kn(s,ec.bind(null,t))),t.callbackPriority=n,t.callbackNode=s}}function ec(t){if(Rr=-1,zr=Nt=0,(Z&48)!==0)throw Error(h(327));var n=t.callbackNode;if(zt()&&t.callbackNode!==n)return null;var s=Gn(t,t===je?Be:0);if(s===0)return null;var a=s,c=Z;Z|=16;var f=rc();(je!==t||Be!==a)&&(Xt(),Ln(t,a));do try{bg();break}catch(w){ic(t,w)}while(1);if(Ds(),Lr.current=f,Z=c,Oe!==null?a=0:(je=null,Be=0,a=Fe),(In&kn)!==0)Ln(t,0);else if(a!==0){if(a===2&&(Z|=64,t.hydrate&&(t.hydrate=!1,Cs(t.containerInfo)),s=qa(t),s!==0&&(a=yi(t,s))),a===1)throw n=Or,Ln(t,0),Mn(t,s),Ge(t,ze()),n;switch(t.finishedWork=t.current.alternate,t.finishedLanes=s,a){case 0:case 1:throw Error(h(345));case 2:gn(t);break;case 3:if(Mn(t,s),(s&62914560)===s&&(a=vo+500-ze(),10<a)){if(Gn(t,0)!==0)break;if(c=t.suspendedLanes,(c&s)!==s){qe(),t.pingedLanes|=t.suspendedLanes&c;break}t.timeoutHandle=Xn(gn.bind(null,t),a);break}gn(t);break;case 4:if(Mn(t,s),(s&4186112)===s)break;for(a=t.eventTimes,c=-1;0<s;){var v=31-Ht(s);f=1<<v,v=a[v],v>c&&(c=v),s&=~f}if(s=c,s=ze()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Fg(s/1960))-s,10<s){t.timeoutHandle=Xn(gn.bind(null,t),s);break}gn(t);break;case 5:gn(t);break;default:throw Error(h(329))}}return Ge(t,ze()),t.callbackNode===n?ec.bind(null,t):null}function Mn(t,n){for(n&=~po,n&=~kn,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Ht(n),a=1<<s;t[s]=-1,n&=~a}}function _o(t){if((Z&48)!==0)throw Error(h(327));if(zt(),t===je&&(t.expiredLanes&Be)!==0){var n=Be,s=yi(t,n);(In&kn)!==0&&(n=Gn(t,n),s=yi(t,n))}else n=Gn(t,0),s=yi(t,n);if(t.tag!==0&&s===2&&(Z|=64,t.hydrate&&(t.hydrate=!1,Cs(t.containerInfo)),n=qa(t),n!==0&&(s=yi(t,n))),s===1)throw s=Or,Ln(t,0),Mn(t,n),Ge(t,ze()),s;return t.finishedWork=t.current.alternate,t.finishedLanes=n,gn(t),Ge(t,ze()),null}function Dg(){if(Ot!==null){var t=Ot;Ot=null,t.forEach(function(n){n.expiredLanes|=24&n.pendingLanes,Ge(n,ze())})}Je()}function tc(t,n){var s=Z;Z|=1;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}}function nc(t,n){var s=Z;if((s&48)!==0)return t(n);Z|=1;try{if(t)return kt(99,t.bind(null,n))}finally{Z=s,Je()}}function Fr(t,n){xe(go,fn),fn|=n,In|=n}function Po(){fn=go.current,pe(go)}function Ln(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==Se&&(t.timeoutHandle=Se,ge(s)),Oe!==null)for(s=Oe.return;s!==null;){var a=s;switch(a.tag){case 1:a=a.type.childContextTypes,a!=null&&Ki();break;case 3:Cn(),pe(We),pe(Ue),Qs();break;case 5:Hs(a);break;case 4:Cn();break;case 13:pe(_e);break;case 19:pe(_e);break;case 10:Us(a);break;case 23:case 24:Po()}s=s.return}je=t,Oe=Gt(t.current,null),Be=fn=In=n,Fe=0,Or=null,po=kn=hi=0}function ic(t,n){do{var s=Oe;try{if(Ds(),ni.current=wr,pr){for(var a=Ce.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}pr=!1}if(ii=0,Ae=be=Ce=null,ri=!1,ho.current=null,s===null||s.return===null){Fe=1,Or=n,Oe=null;break}e:{var f=t,v=s.return,w=s,C=n;if(n=Be,w.flags|=2048,w.firstEffect=w.lastEffect=null,C!==null&&typeof C=="object"&&typeof C.then=="function"){var z=C;if((w.mode&2)===0){var X=w.alternate;X?(w.updateQueue=X.updateQueue,w.memoizedState=X.memoizedState,w.lanes=X.lanes):(w.updateQueue=null,w.memoizedState=null)}var $=(_e.current&1)!==0,U=v;do{var ae;if(ae=U.tag===13){var ve=U.memoizedState;if(ve!==null)ae=ve.dehydrated!==null;else{var rt=U.memoizedProps;ae=rt.fallback===void 0?!1:rt.unstable_avoidThisFallback!==!0?!0:!$}}if(ae){var _=U.updateQueue;if(_===null){var E=new Set;E.add(z),U.updateQueue=E}else _.add(z);if((U.mode&2)===0){if(U.flags|=64,w.flags|=16384,w.flags&=-2981,w.tag===1)if(w.alternate===null)w.tag=17;else{var T=Wt(-1,1);T.tag=2,Qt(w,T)}w.lanes|=1;break e}C=void 0,w=n;var D=f.pingCache;if(D===null?(D=f.pingCache=new Lg,C=new Set,D.set(z,C)):(C=D.get(z),C===void 0&&(C=new Set,D.set(z,C))),!C.has(w)){C.add(w);var Y=Wg.bind(null,f,z,w);z.then(Y,Y)}U.flags|=4096,U.lanes=n;break e}U=U.return}while(U!==null);C=Error((Ee(w.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
26
26
|
|
|
27
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Fe!==5&&(Fe=2),C=no(C,S),U=v;do{switch(U.tag){case 3:f=C,U.flags|=4096,n&=-n,U.lanes|=n;var he=ju(U,f,n);ou(U,he);break e;case 1:f=C;var ee=U.type,oe=U.stateNode;if((U.flags&64)===0&&(typeof ee.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(wt===null||!wt.has(oe)))){U.flags|=4096,n&=-n,U.lanes|=n;var Ie=Hu(U,f,n);ou(U,Ie);break e}}U=U.return}while(U!==null)}oc(s)}catch(ie){n=ie,Oe===s&&s!==null&&(Oe=s=s.return);continue}break}while(1)}function rc(){var t=Lr.current;return Lr.current=wr,t===null?wr:t}function yi(t,n){var s=Z;Z|=16;var a=rc();je===t&&Be===n||Ln(t,n);do try{Ug();break}catch(c){ic(t,c)}while(1);if(Ds(),Z=s,Lr.current=a,Oe!==null)throw Error(h(261));return je=null,Be=0,Fe}function Ug(){for(;Oe!==null;)sc(Oe)}function bg(){for(;Oe!==null&&!mg();)sc(Oe)}function sc(t){var n=uc(t.alternate,t,fn);t.memoizedProps=t.pendingProps,n===null?oc(t):Oe=n,ho.current=null}function oc(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&2048)===0){if(s=kg(s,n,fn),s!==null){Oe=s;return}if(s=n,s.tag!==24&&s.tag!==23||s.memoizedState===null||(fn&1073741824)!==0||(s.mode&4)===0){for(var a=0,c=s.child;c!==null;)a|=c.lanes|c.childLanes,c=c.sibling;s.childLanes=a}t!==null&&(t.flags&2048)===0&&(t.firstEffect===null&&(t.firstEffect=n.firstEffect),n.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=n.firstEffect),t.lastEffect=n.lastEffect),1<n.flags&&(t.lastEffect!==null?t.lastEffect.nextEffect=n:t.firstEffect=n,t.lastEffect=n))}else{if(s=Mg(n),s!==null){s.flags&=2047,Oe=s;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}if(n=n.sibling,n!==null){Oe=n;return}Oe=n=t}while(n!==null);Fe===0&&(Fe=5)}function gn(t){var n=En();return kt(99,Bg.bind(null,t,n)),null}function Bg(t,n){do zt();while(fi!==null);if((Z&48)!==0)throw Error(h(327));var s=t.finishedWork;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(h(177));t.callbackNode=null;var a=s.lanes|s.childLanes,c=a,f=t.pendingLanes&~c;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=c,t.mutableReadLanes&=c,t.entangledLanes&=c,c=t.entanglements;for(var v=t.eventTimes,S=t.expirationTimes;0<f;){var C=31-Ht(f),z=1<<C;c[C]=0,v[C]=-1,S[C]=-1,f&=~z}if(Ot!==null&&(a&24)===0&&Ot.has(t)&&Ot.delete(t),t===je&&(Oe=je=null,Be=0),1<s.flags?s.lastEffect!==null?(s.lastEffect.nextEffect=s,a=s.firstEffect):a=s:a=s.firstEffect,a!==null){c=Z,Z|=32,ho.current=null,mi=K(t.containerInfo),vi=!1,H=a;do try{jg()}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);mi=null,H=a;do try{for(v=t;H!==null;){var X=H.flags;if(X&16&&Pe&&Da(H.stateNode),X&128){var $=H.alternate;if($!==null){var U=$.ref;U!==null&&(typeof U=="function"?U(null):U.current=null)}}switch(X&1038){case 2:Gu(H),H.flags&=-3;break;case 6:Gu(H),H.flags&=-3,oo(H.alternate,H);break;case 1024:H.flags&=-1025;break;case 1028:H.flags&=-1025,oo(H.alternate,H);break;case 4:oo(H.alternate,H);break;case 8:S=v,f=H,Pe?Ku(S,f):Yu(S,f);var ae=f.alternate;qu(f),ae!==null&&qu(ae)}H=H.nextEffect}}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);vi&&Nf(),ne(t.containerInfo),t.current=s,H=a;do try{for(X=t;H!==null;){var ve=H.flags;if(ve&36&&Rg(X,H.alternate,H),ve&128){$=void 0;var rt=H.ref;if(rt!==null){var x=H.stateNode;switch(H.tag){case 5:$=ue(x);break;default:$=x}typeof rt=="function"?rt($):rt.current=$}}H=H.nextEffect}}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);H=null,yg(),Z=c}else t.current=s;if(Yt)Yt=!1,fi=t,gi=n;else for(H=a;H!==null;)n=H.nextEffect,H.nextEffect=null,H.flags&8&&(ve=H,ve.sibling=null,ve.stateNode=null),H=n;if(a=t.pendingLanes,a===0&&(wt=null),a===1?t===xo?pi++:(pi=0,xo=t):pi=0,s=s.stateNode,an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Ls,s,void 0,(s.current.flags&64)===64)}catch{}if(Ge(t,ze()),Nr)throw Nr=!1,t=wo,wo=null,t;return(Z&8)!==0||Je(),null}function jg(){for(;H!==null;){var t=H.alternate;vi||mi===null||((H.flags&8)!==0?F(H,mi)&&(vi=!0,Fa()):H.tag===13&&zg(t,H)&&F(H,mi)&&(vi=!0,Fa()));var n=H.flags;(n&256)!==0&&Ng(t,H),(n&512)===0||Yt||(Yt=!0,Kn(97,function(){return zt(),null})),H=H.nextEffect}}function zt(){if(gi!==90){var t=97<gi?97:gi;return gi=90,kt(t,Vg)}return!1}function Hg(t,n){So.push(n,t),Yt||(Yt=!0,Kn(97,function(){return zt(),null}))}function lc(t,n){Eo.push(n,t),Yt||(Yt=!0,Kn(97,function(){return zt(),null}))}function Vg(){if(fi===null)return!1;var t=fi;if(fi=null,(Z&48)!==0)throw Error(h(331));var n=Z;Z|=32;var s=Eo;Eo=[];for(var a=0;a<s.length;a+=2){var c=s[a],f=s[a+1],v=c.destroy;if(c.destroy=void 0,typeof v=="function")try{v()}catch(C){if(f===null)throw Error(h(330));Zt(f,C)}}for(s=So,So=[],a=0;a<s.length;a+=2){c=s[a],f=s[a+1];try{var S=c.create;c.destroy=S()}catch(C){if(f===null)throw Error(h(330));Zt(f,C)}}for(S=t.current.firstEffect;S!==null;)t=S.nextEffect,S.nextEffect=null,S.flags&8&&(S.sibling=null,S.stateNode=null),S=t;return Z=n,Je(),!0}function ac(t,n,s){n=no(s,n),n=ju(t,n,1),Qt(t,n),n=qe(),t=Ar(t,1),t!==null&&(tr(t,1,n),Ge(t,n))}function Zt(t,n){if(t.tag===3)ac(t,t,n);else for(var s=t.return;s!==null;){if(s.tag===3){ac(s,t,n);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(wt===null||!wt.has(a))){t=no(n,t);var c=Hu(s,t,1);if(Qt(s,c),c=qe(),s=Ar(s,1),s!==null)tr(s,1,c),Ge(s,c);else if(typeof a.componentDidCatch=="function"&&(wt===null||!wt.has(a)))try{a.componentDidCatch(n,t)}catch{}break}}s=s.return}}function Wg(t,n,s){var a=t.pingCache;a!==null&&a.delete(n),n=qe(),t.pingedLanes|=t.suspendedLanes&s,je===t&&(Be&s)===s&&(Fe===4||Fe===3&&(Be&62914560)===Be&&500>ze()-vo?Ln(t,0):po|=s),Ge(t,n)}function Qg(t,n){var s=t.stateNode;s!==null&&s.delete(n),n=0,n===0&&(n=t.mode,(n&2)===0?n=1:(n&4)===0?n=En()===99?1:2:(Nt===0&&(Nt=In),n=Sn(62914560&~Nt),n===0&&(n=4194304))),s=qe(),t=Ar(t,n),t!==null&&(tr(t,n,s),Ge(t,s))}var uc;uc=function(t,n,s){var a=n.lanes;if(t!==null)if(t.memoizedProps!==n.pendingProps||We.current)ft=!0;else if((s&a)!==0)ft=(t.flags&16384)!==0;else{switch(ft=!1,n.tag){case 3:Ru(n),Ws();break;case 5:gu(n);break;case 1:Qe(n.type)&&Ji(n);break;case 4:js(n,n.stateNode.containerInfo);break;case 10:iu(n,n.memoizedProps.value);break;case 13:if(n.memoizedState!==null)return(s&n.child.childLanes)!==0?zu(t,n,s):(xe(_e,_e.current&1),n=Lt(t,n,s),n!==null?n.sibling:null);xe(_e,_e.current&1);break;case 19:if(a=(s&n.childLanes)!==0,(t.flags&64)!==0){if(a)return bu(t,n,s);n.flags|=64}var c=n.memoizedState;if(c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),xe(_e,_e.current),a)break;return null;case 23:case 24:return n.lanes=0,Js(t,n,s)}return Lt(t,n,s)}else ft=!1;switch(n.lanes=0,n.tag){case 2:if(a=n.type,t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),t=n.pendingProps,c=wn(n,Ue.current),_n(n,s),c=Ys(null,n,a,t,c,s),n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,Qe(a)){var f=!0;Ji(n)}else f=!1;n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,bs(n);var v=a.getDerivedStateFromProps;typeof v=="function"&&ar(n,a,v,t),c.updater=ur,n.stateNode=c,c._reactInternals=n,Bs(n,a,t,s),n=eo(null,n,a,!0,f,s)}else n.tag=0,Ye(null,n,c,s),n=n.child;return n;case 16:c=n.elementType;e:{switch(t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),t=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=Yg(c),t=ht(c,t),f){case 0:n=$s(null,n,c,t,s);break e;case 1:n=Nu(null,n,c,t,s);break e;case 11:n=ku(null,n,c,t,s);break e;case 14:n=Mu(null,n,c,ht(c.type,t),a,s);break e}throw Error(h(306,c,""))}return n;case 0:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),$s(t,n,a,c,s);case 1:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),Nu(t,n,a,c,s);case 3:if(Ru(n),a=n.updateQueue,t===null||a===null)throw Error(h(282));if(a=n.pendingProps,c=n.memoizedState,c=c!==null?c.element:null,su(t,n),Jn(n,a,null,s),a=n.memoizedState.element,a===c)Ws(),n=Lt(t,n,s);else{if(c=n.stateNode,(f=c.hydrate)&&(dt?(cn=Va(n.stateNode.containerInfo),Mt=n,f=mt=!0):f=!1),f){if(dt&&(t=c.mutableSourceEagerHydrationData,t!=null))for(c=0;c<t.length;c+=2)f=t[c],v=t[c+1],me?f._workInProgressVersionPrimary=v:f._workInProgressVersionSecondary=v,Tn.push(f);for(s=fu(n,null,a,s),n.child=s;s;)s.flags=s.flags&-3|1024,s=s.sibling}else Ye(t,n,a,s),Ws();n=n.child}return n;case 5:return gu(n),t===null&&Vs(n),a=n.type,c=n.pendingProps,f=t!==null?t.memoizedProps:null,v=c.children,ut(a,c)?v=null:f!==null&&ut(a,f)&&(n.flags|=16),Ou(t,n),Ye(t,n,v,s),n.child;case 6:return t===null&&Vs(n),null;case 13:return zu(t,n,s);case 4:return js(n,n.stateNode.containerInfo),a=n.pendingProps,t===null?n.child=hr(n,null,a,s):Ye(t,n,a,s),n.child;case 11:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),ku(t,n,a,c,s);case 7:return Ye(t,n,n.pendingProps,s),n.child;case 8:return Ye(t,n,n.pendingProps.children,s),n.child;case 12:return Ye(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(a=n.type._context,c=n.pendingProps,v=n.memoizedProps,f=c.value,iu(n,f),v!==null){var S=v.value;if(f=$e(S,f)?0:(typeof a._calculateChangedBits=="function"?a._calculateChangedBits(S,f):1073741823)|0,f===0){if(v.children===c.children&&!We.current){n=Lt(t,n,s);break e}}else for(S=n.child,S!==null&&(S.return=n);S!==null;){var C=S.dependencies;if(C!==null){v=S.child;for(var z=C.firstContext;z!==null;){if(z.context===a&&(z.observedBits&f)!==0){S.tag===1&&(z=Wt(-1,s&-s),z.tag=2,Qt(S,z)),S.lanes|=s,z=S.alternate,z!==null&&(z.lanes|=s),ru(S.return,s),C.lanes|=s;break}z=z.next}}else v=S.tag===10&&S.type===n.type?null:S.child;if(v!==null)v.return=S;else for(v=S;v!==null;){if(v===n){v=null;break}if(S=v.sibling,S!==null){S.return=v.return,v=S;break}v=v.return}S=v}}Ye(t,n,c.children,s),n=n.child}return n;case 9:return c=n.type,f=n.pendingProps,a=f.children,_n(n,s),c=et(c,f.unstable_observedBits),a=a(c),n.flags|=1,Ye(t,n,a,s),n.child;case 14:return c=n.type,f=ht(c,n.pendingProps),f=ht(c.type,f),Mu(t,n,c,f,a,s);case 15:return Lu(t,n,n.type,n.pendingProps,a,s);case 17:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),n.tag=1,Qe(a)?(t=!0,Ji(n)):t=!1,_n(n,s),cu(n,a,c),Bs(n,a,c,s),eo(null,n,a,!0,t,s);case 19:return bu(t,n,s);case 23:return Js(t,n,s);case 24:return Js(t,n,s)}throw Error(h(156,n.tag))};var Dr={current:!1},Co=d.unstable_flushAllWithoutAsserting,cc=typeof Co=="function";function To(){if(Co!==void 0)return Co();for(var t=!1;zt();)t=!0;return t}function dc(t){try{To(),Ag(function(){To()?dc(t):t()})}catch(n){t(n)}}var Ur=0,hc=!1;function Xg(t,n,s,a){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function it(t,n,s,a){return new Xg(t,n,s,a)}function Io(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Yg(t){if(typeof t=="function")return Io(t)?1:0;if(t!=null){if(t=t.$$typeof,t===I)return 11;if(t===j)return 14}return 2}function Gt(t,n){var s=t.alternate;return s===null?(s=it(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null),s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function br(t,n,s,a,c,f){var v=2;if(a=t,typeof t=="function")Io(t)&&(v=1);else if(typeof t=="string")v=5;else e:switch(t){case w:return On(s.children,c,f,n);case Q:v=8,c|=16;break;case _:v=8,c|=1;break;case O:return t=it(12,s,n,c|8),t.elementType=O,t.type=O,t.lanes=f,t;case k:return t=it(13,s,n,c),t.type=k,t.elementType=k,t.lanes=f,t;case P:return t=it(19,s,n,c),t.elementType=P,t.lanes=f,t;case J:return ko(s,c,f,n);case q:return t=it(24,s,n,c),t.elementType=q,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:v=10;break e;case N:v=9;break e;case I:v=11;break e;case j:v=14;break e;case V:v=16,a=null;break e;case W:v=22;break e}throw Error(h(130,t==null?t:typeof t,""))}return n=it(v,s,n,c),n.elementType=t,n.type=a,n.lanes=f,n}function On(t,n,s,a){return t=it(7,t,a,n),t.lanes=s,t}function ko(t,n,s,a){return t=it(23,t,a,n),t.elementType=J,t.lanes=s,t}function Mo(t,n,s){return t=it(6,t,null,n),t.lanes=s,t}function Lo(t,n,s){return n=it(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function qg(t,n,s){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Se,this.pendingContext=this.context=null,this.hydrate=s,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Os(0),this.expirationTimes=Os(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Os(0),dt&&(this.mutableSourceEagerHydrationData=null)}function fc(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(h(188)):Error(h(268,Object.keys(t)));return t=gt(n),t===null?null:t.stateNode}function gc(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Br(t,n){gc(t,n),(t=t.alternate)&&gc(t,n)}function Zg(t){return t=gt(t),t===null?null:t.stateNode}function Gg(){return null}return o.IsThisRendererActing=Dr,o.act=function(t){function n(){Ur--,fo.current=s,Dr.current=a}hc===!1&&(hc=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),Ur++;var s=fo.current,a=Dr.current;fo.current=!0,Dr.current=!0;try{var c=tc(t)}catch(f){throw n(),f}if(c!==null&&typeof c=="object"&&typeof c.then=="function")return{then:function(f,v){c.then(function(){1<Ur||cc===!0&&s===!0?(n(),f()):dc(function(S){n(),S?v(S):f()})},function(S){n(),v(S)})}};try{Ur!==1||cc!==!1&&s!==!1||To(),n()}catch(f){throw n(),f}return{then:function(f){f()}}},o.attemptContinuousHydration=function(t){if(t.tag===13){var n=qe();Rt(t,67108864,n),Br(t,67108864)}},o.attemptHydrationAtCurrentPriority=function(t){if(t.tag===13){var n=qe(),s=qt(t);Rt(t,s,n),Br(t,s)}},o.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.hydrate){var s=un(n.pendingLanes);n.expiredLanes|=s&n.pendingLanes,Ge(n,ze()),(Z&48)===0&&(Xt(),Je())}break;case 13:var a=qe();nc(function(){return Rt(t,1,a)}),Br(t,4)}},o.attemptUserBlockingHydration=function(t){if(t.tag===13){var n=qe();Rt(t,4,n),Br(t,4)}},o.batchedEventUpdates=function(t,n){var s=Z;Z|=2;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}},o.batchedUpdates=tc,o.createComponentSelector=function(t){return{$$typeof:Pr,value:t}},o.createContainer=function(t,n,s){return t=new qg(t,n,s),n=it(3,null,null,n===2?7:n===1?3:0),t.current=n,n.stateNode=t,bs(n),t},o.createHasPsuedoClassSelector=function(t){return{$$typeof:Cr,value:t}},o.createPortal=function(t,n,s){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:a==null?null:""+a,children:t,containerInfo:n,implementation:s}},o.createRoleSelector=function(t){return{$$typeof:Tr,value:t}},o.createTestNameSelector=function(t){return{$$typeof:Ir,value:t}},o.createTextSelector=function(t){return{$$typeof:kr,value:t}},o.deferredUpdates=function(t){return kt(97,t)},o.discreteUpdates=function(t,n,s,a,c){var f=Z;Z|=4;try{return kt(98,t.bind(null,n,s,a,c))}finally{Z=f,Z===0&&(Xt(),Je())}},o.findAllNodes=co,o.findBoundingRects=function(t,n){if(!Yn)throw Error(h(363));n=co(t,n),t=[];for(var s=0;s<n.length;s++)t.push(Af(n[s]));for(n=t.length-1;0<n;n--){s=t[n];for(var a=s.x,c=a+s.width,f=s.y,v=f+s.height,S=n-1;0<=S;S--)if(n!==S){var C=t[S],z=C.x,X=z+C.width,$=C.y,U=$+C.height;if(a>=z&&f>=$&&c<=X&&v<=U){t.splice(n,1);break}else if(a!==z||s.width!==C.width||U<f||$>v){if(!(f!==$||s.height!==C.height||X<a||z>c)){z>a&&(C.width+=z-a,C.x=a),X<c&&(C.width=c-z),t.splice(n,1);break}}else{$>f&&(C.height+=$-f,C.y=f),U<v&&(C.height=v-$),t.splice(n,1);break}}}return t},o.findHostInstance=fc,o.findHostInstanceWithNoPortals=function(t){return t=on(t),t===null?null:t.tag===20?t.stateNode.instance:t.stateNode},o.findHostInstanceWithWarning=function(t){return fc(t)},o.flushControlled=function(t){var n=Z;Z|=1;try{kt(99,t)}finally{Z=n,Z===0&&(Xt(),Je())}},o.flushDiscreteUpdates=function(){(Z&49)===0&&(Dg(),zt())},o.flushPassiveEffects=zt,o.flushSync=nc,o.focusWithin=function(t,n){if(!Yn)throw Error(h(363));for(t=lo(t),n=$u(t,n),n=Array.from(n),t=0;t<n.length;){var s=n[t++];if(!qn(s)){if(s.tag===5&&Uf(s.stateNode))return!0;for(s=s.child;s!==null;)n.push(s),s=s.sibling}}return!1},o.getCurrentUpdateLanePriority=function(){return $i},o.getFindAllNodesFailureDescription=function(t,n){if(!Yn)throw Error(h(363));var s=0,a=[];t=[lo(t),0];for(var c=0;c<t.length;){var f=t[c++],v=t[c++],S=n[v];if((f.tag!==5||!qn(f))&&(ao(f,S)&&(a.push(uo(S)),v++,v>s&&(s=v)),v<n.length))for(f=f.child;f!==null;)t.push(f,v),f=f.sibling}if(s<n.length){for(t=[];s<n.length;s++)t.push(uo(n[s]));return`findAllNodes was able to match part of the selector:
|
|
27
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Fe!==5&&(Fe=2),C=no(C,w),U=v;do{switch(U.tag){case 3:f=C,U.flags|=4096,n&=-n,U.lanes|=n;var he=ju(U,f,n);ou(U,he);break e;case 1:f=C;var ee=U.type,oe=U.stateNode;if((U.flags&64)===0&&(typeof ee.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(wt===null||!wt.has(oe)))){U.flags|=4096,n&=-n,U.lanes|=n;var Ie=Hu(U,f,n);ou(U,Ie);break e}}U=U.return}while(U!==null)}oc(s)}catch(ie){n=ie,Oe===s&&s!==null&&(Oe=s=s.return);continue}break}while(1)}function rc(){var t=Lr.current;return Lr.current=wr,t===null?wr:t}function yi(t,n){var s=Z;Z|=16;var a=rc();je===t&&Be===n||Ln(t,n);do try{Ug();break}catch(c){ic(t,c)}while(1);if(Ds(),Z=s,Lr.current=a,Oe!==null)throw Error(h(261));return je=null,Be=0,Fe}function Ug(){for(;Oe!==null;)sc(Oe)}function bg(){for(;Oe!==null&&!mg();)sc(Oe)}function sc(t){var n=uc(t.alternate,t,fn);t.memoizedProps=t.pendingProps,n===null?oc(t):Oe=n,ho.current=null}function oc(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&2048)===0){if(s=kg(s,n,fn),s!==null){Oe=s;return}if(s=n,s.tag!==24&&s.tag!==23||s.memoizedState===null||(fn&1073741824)!==0||(s.mode&4)===0){for(var a=0,c=s.child;c!==null;)a|=c.lanes|c.childLanes,c=c.sibling;s.childLanes=a}t!==null&&(t.flags&2048)===0&&(t.firstEffect===null&&(t.firstEffect=n.firstEffect),n.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=n.firstEffect),t.lastEffect=n.lastEffect),1<n.flags&&(t.lastEffect!==null?t.lastEffect.nextEffect=n:t.firstEffect=n,t.lastEffect=n))}else{if(s=Mg(n),s!==null){s.flags&=2047,Oe=s;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}if(n=n.sibling,n!==null){Oe=n;return}Oe=n=t}while(n!==null);Fe===0&&(Fe=5)}function gn(t){var n=En();return kt(99,Bg.bind(null,t,n)),null}function Bg(t,n){do zt();while(fi!==null);if((Z&48)!==0)throw Error(h(327));var s=t.finishedWork;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(h(177));t.callbackNode=null;var a=s.lanes|s.childLanes,c=a,f=t.pendingLanes&~c;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=c,t.mutableReadLanes&=c,t.entangledLanes&=c,c=t.entanglements;for(var v=t.eventTimes,w=t.expirationTimes;0<f;){var C=31-Ht(f),z=1<<C;c[C]=0,v[C]=-1,w[C]=-1,f&=~z}if(Ot!==null&&(a&24)===0&&Ot.has(t)&&Ot.delete(t),t===je&&(Oe=je=null,Be=0),1<s.flags?s.lastEffect!==null?(s.lastEffect.nextEffect=s,a=s.firstEffect):a=s:a=s.firstEffect,a!==null){c=Z,Z|=32,ho.current=null,mi=K(t.containerInfo),vi=!1,H=a;do try{jg()}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);mi=null,H=a;do try{for(v=t;H!==null;){var X=H.flags;if(X&16&&Pe&&Da(H.stateNode),X&128){var $=H.alternate;if($!==null){var U=$.ref;U!==null&&(typeof U=="function"?U(null):U.current=null)}}switch(X&1038){case 2:Gu(H),H.flags&=-3;break;case 6:Gu(H),H.flags&=-3,oo(H.alternate,H);break;case 1024:H.flags&=-1025;break;case 1028:H.flags&=-1025,oo(H.alternate,H);break;case 4:oo(H.alternate,H);break;case 8:w=v,f=H,Pe?Ku(w,f):Yu(w,f);var ae=f.alternate;qu(f),ae!==null&&qu(ae)}H=H.nextEffect}}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);vi&&Nf(),ne(t.containerInfo),t.current=s,H=a;do try{for(X=t;H!==null;){var ve=H.flags;if(ve&36&&Rg(X,H.alternate,H),ve&128){$=void 0;var rt=H.ref;if(rt!==null){var _=H.stateNode;switch(H.tag){case 5:$=ue(_);break;default:$=_}typeof rt=="function"?rt($):rt.current=$}}H=H.nextEffect}}catch(E){if(H===null)throw Error(h(330));Zt(H,E),H=H.nextEffect}while(H!==null);H=null,yg(),Z=c}else t.current=s;if(Yt)Yt=!1,fi=t,gi=n;else for(H=a;H!==null;)n=H.nextEffect,H.nextEffect=null,H.flags&8&&(ve=H,ve.sibling=null,ve.stateNode=null),H=n;if(a=t.pendingLanes,a===0&&(wt=null),a===1?t===xo?pi++:(pi=0,xo=t):pi=0,s=s.stateNode,an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Ls,s,void 0,(s.current.flags&64)===64)}catch{}if(Ge(t,ze()),Nr)throw Nr=!1,t=wo,wo=null,t;return(Z&8)!==0||Je(),null}function jg(){for(;H!==null;){var t=H.alternate;vi||mi===null||((H.flags&8)!==0?F(H,mi)&&(vi=!0,Fa()):H.tag===13&&zg(t,H)&&F(H,mi)&&(vi=!0,Fa()));var n=H.flags;(n&256)!==0&&Ng(t,H),(n&512)===0||Yt||(Yt=!0,Kn(97,function(){return zt(),null})),H=H.nextEffect}}function zt(){if(gi!==90){var t=97<gi?97:gi;return gi=90,kt(t,Vg)}return!1}function Hg(t,n){So.push(n,t),Yt||(Yt=!0,Kn(97,function(){return zt(),null}))}function lc(t,n){Eo.push(n,t),Yt||(Yt=!0,Kn(97,function(){return zt(),null}))}function Vg(){if(fi===null)return!1;var t=fi;if(fi=null,(Z&48)!==0)throw Error(h(331));var n=Z;Z|=32;var s=Eo;Eo=[];for(var a=0;a<s.length;a+=2){var c=s[a],f=s[a+1],v=c.destroy;if(c.destroy=void 0,typeof v=="function")try{v()}catch(C){if(f===null)throw Error(h(330));Zt(f,C)}}for(s=So,So=[],a=0;a<s.length;a+=2){c=s[a],f=s[a+1];try{var w=c.create;c.destroy=w()}catch(C){if(f===null)throw Error(h(330));Zt(f,C)}}for(w=t.current.firstEffect;w!==null;)t=w.nextEffect,w.nextEffect=null,w.flags&8&&(w.sibling=null,w.stateNode=null),w=t;return Z=n,Je(),!0}function ac(t,n,s){n=no(s,n),n=ju(t,n,1),Qt(t,n),n=qe(),t=Ar(t,1),t!==null&&(tr(t,1,n),Ge(t,n))}function Zt(t,n){if(t.tag===3)ac(t,t,n);else for(var s=t.return;s!==null;){if(s.tag===3){ac(s,t,n);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(wt===null||!wt.has(a))){t=no(n,t);var c=Hu(s,t,1);if(Qt(s,c),c=qe(),s=Ar(s,1),s!==null)tr(s,1,c),Ge(s,c);else if(typeof a.componentDidCatch=="function"&&(wt===null||!wt.has(a)))try{a.componentDidCatch(n,t)}catch{}break}}s=s.return}}function Wg(t,n,s){var a=t.pingCache;a!==null&&a.delete(n),n=qe(),t.pingedLanes|=t.suspendedLanes&s,je===t&&(Be&s)===s&&(Fe===4||Fe===3&&(Be&62914560)===Be&&500>ze()-vo?Ln(t,0):po|=s),Ge(t,n)}function Qg(t,n){var s=t.stateNode;s!==null&&s.delete(n),n=0,n===0&&(n=t.mode,(n&2)===0?n=1:(n&4)===0?n=En()===99?1:2:(Nt===0&&(Nt=In),n=Sn(62914560&~Nt),n===0&&(n=4194304))),s=qe(),t=Ar(t,n),t!==null&&(tr(t,n,s),Ge(t,s))}var uc;uc=function(t,n,s){var a=n.lanes;if(t!==null)if(t.memoizedProps!==n.pendingProps||We.current)ft=!0;else if((s&a)!==0)ft=(t.flags&16384)!==0;else{switch(ft=!1,n.tag){case 3:Ru(n),Ws();break;case 5:gu(n);break;case 1:Qe(n.type)&&Ji(n);break;case 4:js(n,n.stateNode.containerInfo);break;case 10:iu(n,n.memoizedProps.value);break;case 13:if(n.memoizedState!==null)return(s&n.child.childLanes)!==0?zu(t,n,s):(xe(_e,_e.current&1),n=Lt(t,n,s),n!==null?n.sibling:null);xe(_e,_e.current&1);break;case 19:if(a=(s&n.childLanes)!==0,(t.flags&64)!==0){if(a)return bu(t,n,s);n.flags|=64}var c=n.memoizedState;if(c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),xe(_e,_e.current),a)break;return null;case 23:case 24:return n.lanes=0,Js(t,n,s)}return Lt(t,n,s)}else ft=!1;switch(n.lanes=0,n.tag){case 2:if(a=n.type,t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),t=n.pendingProps,c=wn(n,Ue.current),_n(n,s),c=Ys(null,n,a,t,c,s),n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,Qe(a)){var f=!0;Ji(n)}else f=!1;n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,bs(n);var v=a.getDerivedStateFromProps;typeof v=="function"&&ar(n,a,v,t),c.updater=ur,n.stateNode=c,c._reactInternals=n,Bs(n,a,t,s),n=eo(null,n,a,!0,f,s)}else n.tag=0,Ye(null,n,c,s),n=n.child;return n;case 16:c=n.elementType;e:{switch(t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),t=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=Yg(c),t=ht(c,t),f){case 0:n=$s(null,n,c,t,s);break e;case 1:n=Nu(null,n,c,t,s);break e;case 11:n=ku(null,n,c,t,s);break e;case 14:n=Mu(null,n,c,ht(c.type,t),a,s);break e}throw Error(h(306,c,""))}return n;case 0:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),$s(t,n,a,c,s);case 1:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),Nu(t,n,a,c,s);case 3:if(Ru(n),a=n.updateQueue,t===null||a===null)throw Error(h(282));if(a=n.pendingProps,c=n.memoizedState,c=c!==null?c.element:null,su(t,n),Jn(n,a,null,s),a=n.memoizedState.element,a===c)Ws(),n=Lt(t,n,s);else{if(c=n.stateNode,(f=c.hydrate)&&(dt?(cn=Va(n.stateNode.containerInfo),Mt=n,f=mt=!0):f=!1),f){if(dt&&(t=c.mutableSourceEagerHydrationData,t!=null))for(c=0;c<t.length;c+=2)f=t[c],v=t[c+1],me?f._workInProgressVersionPrimary=v:f._workInProgressVersionSecondary=v,Tn.push(f);for(s=fu(n,null,a,s),n.child=s;s;)s.flags=s.flags&-3|1024,s=s.sibling}else Ye(t,n,a,s),Ws();n=n.child}return n;case 5:return gu(n),t===null&&Vs(n),a=n.type,c=n.pendingProps,f=t!==null?t.memoizedProps:null,v=c.children,ut(a,c)?v=null:f!==null&&ut(a,f)&&(n.flags|=16),Ou(t,n),Ye(t,n,v,s),n.child;case 6:return t===null&&Vs(n),null;case 13:return zu(t,n,s);case 4:return js(n,n.stateNode.containerInfo),a=n.pendingProps,t===null?n.child=hr(n,null,a,s):Ye(t,n,a,s),n.child;case 11:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),ku(t,n,a,c,s);case 7:return Ye(t,n,n.pendingProps,s),n.child;case 8:return Ye(t,n,n.pendingProps.children,s),n.child;case 12:return Ye(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(a=n.type._context,c=n.pendingProps,v=n.memoizedProps,f=c.value,iu(n,f),v!==null){var w=v.value;if(f=$e(w,f)?0:(typeof a._calculateChangedBits=="function"?a._calculateChangedBits(w,f):1073741823)|0,f===0){if(v.children===c.children&&!We.current){n=Lt(t,n,s);break e}}else for(w=n.child,w!==null&&(w.return=n);w!==null;){var C=w.dependencies;if(C!==null){v=w.child;for(var z=C.firstContext;z!==null;){if(z.context===a&&(z.observedBits&f)!==0){w.tag===1&&(z=Wt(-1,s&-s),z.tag=2,Qt(w,z)),w.lanes|=s,z=w.alternate,z!==null&&(z.lanes|=s),ru(w.return,s),C.lanes|=s;break}z=z.next}}else v=w.tag===10&&w.type===n.type?null:w.child;if(v!==null)v.return=w;else for(v=w;v!==null;){if(v===n){v=null;break}if(w=v.sibling,w!==null){w.return=v.return,v=w;break}v=v.return}w=v}}Ye(t,n,c.children,s),n=n.child}return n;case 9:return c=n.type,f=n.pendingProps,a=f.children,_n(n,s),c=et(c,f.unstable_observedBits),a=a(c),n.flags|=1,Ye(t,n,a,s),n.child;case 14:return c=n.type,f=ht(c,n.pendingProps),f=ht(c.type,f),Mu(t,n,c,f,a,s);case 15:return Lu(t,n,n.type,n.pendingProps,a,s);case 17:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:ht(a,c),t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2),n.tag=1,Qe(a)?(t=!0,Ji(n)):t=!1,_n(n,s),cu(n,a,c),Bs(n,a,c,s),eo(null,n,a,!0,t,s);case 19:return bu(t,n,s);case 23:return Js(t,n,s);case 24:return Js(t,n,s)}throw Error(h(156,n.tag))};var Dr={current:!1},Co=d.unstable_flushAllWithoutAsserting,cc=typeof Co=="function";function To(){if(Co!==void 0)return Co();for(var t=!1;zt();)t=!0;return t}function dc(t){try{To(),Ag(function(){To()?dc(t):t()})}catch(n){t(n)}}var Ur=0,hc=!1;function Xg(t,n,s,a){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function it(t,n,s,a){return new Xg(t,n,s,a)}function Io(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Yg(t){if(typeof t=="function")return Io(t)?1:0;if(t!=null){if(t=t.$$typeof,t===I)return 11;if(t===j)return 14}return 2}function Gt(t,n){var s=t.alternate;return s===null?(s=it(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null),s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function br(t,n,s,a,c,f){var v=2;if(a=t,typeof t=="function")Io(t)&&(v=1);else if(typeof t=="string")v=5;else e:switch(t){case S:return On(s.children,c,f,n);case Q:v=8,c|=16;break;case x:v=8,c|=1;break;case O:return t=it(12,s,n,c|8),t.elementType=O,t.type=O,t.lanes=f,t;case k:return t=it(13,s,n,c),t.type=k,t.elementType=k,t.lanes=f,t;case P:return t=it(19,s,n,c),t.elementType=P,t.lanes=f,t;case J:return ko(s,c,f,n);case q:return t=it(24,s,n,c),t.elementType=q,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:v=10;break e;case N:v=9;break e;case I:v=11;break e;case j:v=14;break e;case V:v=16,a=null;break e;case W:v=22;break e}throw Error(h(130,t==null?t:typeof t,""))}return n=it(v,s,n,c),n.elementType=t,n.type=a,n.lanes=f,n}function On(t,n,s,a){return t=it(7,t,a,n),t.lanes=s,t}function ko(t,n,s,a){return t=it(23,t,a,n),t.elementType=J,t.lanes=s,t}function Mo(t,n,s){return t=it(6,t,null,n),t.lanes=s,t}function Lo(t,n,s){return n=it(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function qg(t,n,s){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Se,this.pendingContext=this.context=null,this.hydrate=s,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Os(0),this.expirationTimes=Os(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Os(0),dt&&(this.mutableSourceEagerHydrationData=null)}function fc(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(h(188)):Error(h(268,Object.keys(t)));return t=gt(n),t===null?null:t.stateNode}function gc(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Br(t,n){gc(t,n),(t=t.alternate)&&gc(t,n)}function Zg(t){return t=gt(t),t===null?null:t.stateNode}function Gg(){return null}return o.IsThisRendererActing=Dr,o.act=function(t){function n(){Ur--,fo.current=s,Dr.current=a}hc===!1&&(hc=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),Ur++;var s=fo.current,a=Dr.current;fo.current=!0,Dr.current=!0;try{var c=tc(t)}catch(f){throw n(),f}if(c!==null&&typeof c=="object"&&typeof c.then=="function")return{then:function(f,v){c.then(function(){1<Ur||cc===!0&&s===!0?(n(),f()):dc(function(w){n(),w?v(w):f()})},function(w){n(),v(w)})}};try{Ur!==1||cc!==!1&&s!==!1||To(),n()}catch(f){throw n(),f}return{then:function(f){f()}}},o.attemptContinuousHydration=function(t){if(t.tag===13){var n=qe();Rt(t,67108864,n),Br(t,67108864)}},o.attemptHydrationAtCurrentPriority=function(t){if(t.tag===13){var n=qe(),s=qt(t);Rt(t,s,n),Br(t,s)}},o.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.hydrate){var s=un(n.pendingLanes);n.expiredLanes|=s&n.pendingLanes,Ge(n,ze()),(Z&48)===0&&(Xt(),Je())}break;case 13:var a=qe();nc(function(){return Rt(t,1,a)}),Br(t,4)}},o.attemptUserBlockingHydration=function(t){if(t.tag===13){var n=qe();Rt(t,4,n),Br(t,4)}},o.batchedEventUpdates=function(t,n){var s=Z;Z|=2;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}},o.batchedUpdates=tc,o.createComponentSelector=function(t){return{$$typeof:Pr,value:t}},o.createContainer=function(t,n,s){return t=new qg(t,n,s),n=it(3,null,null,n===2?7:n===1?3:0),t.current=n,n.stateNode=t,bs(n),t},o.createHasPsuedoClassSelector=function(t){return{$$typeof:Cr,value:t}},o.createPortal=function(t,n,s){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:a==null?null:""+a,children:t,containerInfo:n,implementation:s}},o.createRoleSelector=function(t){return{$$typeof:Tr,value:t}},o.createTestNameSelector=function(t){return{$$typeof:Ir,value:t}},o.createTextSelector=function(t){return{$$typeof:kr,value:t}},o.deferredUpdates=function(t){return kt(97,t)},o.discreteUpdates=function(t,n,s,a,c){var f=Z;Z|=4;try{return kt(98,t.bind(null,n,s,a,c))}finally{Z=f,Z===0&&(Xt(),Je())}},o.findAllNodes=co,o.findBoundingRects=function(t,n){if(!Yn)throw Error(h(363));n=co(t,n),t=[];for(var s=0;s<n.length;s++)t.push(Af(n[s]));for(n=t.length-1;0<n;n--){s=t[n];for(var a=s.x,c=a+s.width,f=s.y,v=f+s.height,w=n-1;0<=w;w--)if(n!==w){var C=t[w],z=C.x,X=z+C.width,$=C.y,U=$+C.height;if(a>=z&&f>=$&&c<=X&&v<=U){t.splice(n,1);break}else if(a!==z||s.width!==C.width||U<f||$>v){if(!(f!==$||s.height!==C.height||X<a||z>c)){z>a&&(C.width+=z-a,C.x=a),X<c&&(C.width=c-z),t.splice(n,1);break}}else{$>f&&(C.height+=$-f,C.y=f),U<v&&(C.height=v-$),t.splice(n,1);break}}}return t},o.findHostInstance=fc,o.findHostInstanceWithNoPortals=function(t){return t=on(t),t===null?null:t.tag===20?t.stateNode.instance:t.stateNode},o.findHostInstanceWithWarning=function(t){return fc(t)},o.flushControlled=function(t){var n=Z;Z|=1;try{kt(99,t)}finally{Z=n,Z===0&&(Xt(),Je())}},o.flushDiscreteUpdates=function(){(Z&49)===0&&(Dg(),zt())},o.flushPassiveEffects=zt,o.flushSync=nc,o.focusWithin=function(t,n){if(!Yn)throw Error(h(363));for(t=lo(t),n=$u(t,n),n=Array.from(n),t=0;t<n.length;){var s=n[t++];if(!qn(s)){if(s.tag===5&&Uf(s.stateNode))return!0;for(s=s.child;s!==null;)n.push(s),s=s.sibling}}return!1},o.getCurrentUpdateLanePriority=function(){return $i},o.getFindAllNodesFailureDescription=function(t,n){if(!Yn)throw Error(h(363));var s=0,a=[];t=[lo(t),0];for(var c=0;c<t.length;){var f=t[c++],v=t[c++],w=n[v];if((f.tag!==5||!qn(f))&&(ao(f,w)&&(a.push(uo(w)),v++,v>s&&(s=v)),v<n.length))for(f=f.child;f!==null;)t.push(f,v),f=f.sibling}if(s<n.length){for(t=[];s<n.length;s++)t.push(uo(n[s]));return`findAllNodes was able to match part of the selector:
|
|
28
28
|
`+(a.join(" > ")+`
|
|
29
29
|
|
|
30
30
|
No matching component was found for:
|
|
31
|
-
`)+t.join(" > ")}return null},o.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return ue(t.child.stateNode);default:return t.child.stateNode}},o.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:Zg,findFiberByHostInstance:t.findFiberByHostInstance||Gg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")t=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.isDisabled&&n.supportsFiber)try{Ls=n.inject(t),an=n}catch{}t=!0}return t},o.observeVisibleRects=function(t,n,s,a){if(!Yn)throw Error(h(363));t=co(t,n);var c=bf(t,s,a).disconnect;return{disconnect:function(){c()}}},o.registerMutableSourceForHydration=function(t,n){var s=n._getVersion;s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s)},o.runWithPriority=function(t,n){var s=$i;try{return $i=t,n()}finally{$i=s}},o.shouldSuspend=function(){return!1},o.unbatchedUpdates=function(t,n){var s=Z;Z&=-2,Z|=8;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}},o.updateContainer=function(t,n,s,a){var c=n.current,f=qe(),v=qt(c);e:if(s){s=s._reactInternals;t:{if(re(s)!==s||s.tag!==1)throw Error(h(170));var
|
|
31
|
+
`)+t.join(" > ")}return null},o.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return ue(t.child.stateNode);default:return t.child.stateNode}},o.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:Zg,findFiberByHostInstance:t.findFiberByHostInstance||Gg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")t=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.isDisabled&&n.supportsFiber)try{Ls=n.inject(t),an=n}catch{}t=!0}return t},o.observeVisibleRects=function(t,n,s,a){if(!Yn)throw Error(h(363));t=co(t,n);var c=bf(t,s,a).disconnect;return{disconnect:function(){c()}}},o.registerMutableSourceForHydration=function(t,n){var s=n._getVersion;s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s)},o.runWithPriority=function(t,n){var s=$i;try{return $i=t,n()}finally{$i=s}},o.shouldSuspend=function(){return!1},o.unbatchedUpdates=function(t,n){var s=Z;Z&=-2,Z|=8;try{return t(n)}finally{Z=s,Z===0&&(Xt(),Je())}},o.updateContainer=function(t,n,s,a){var c=n.current,f=qe(),v=qt(c);e:if(s){s=s._reactInternals;t:{if(re(s)!==s||s.tag!==1)throw Error(h(170));var w=s;do{switch(w.tag){case 3:w=w.stateNode.context;break t;case 1:if(Qe(w.type)){w=w.stateNode.__reactInternalMemoizedMergedChildContext;break t}}w=w.return}while(w!==null);throw Error(h(171))}if(s.tag===1){var C=s.type;if(Qe(C)){s=Xa(s,C,w);break e}}s=w}else s=jt;return n.context===null?n.context=s:n.pendingContext=s,n=Wt(f,v),n.payload={element:t},a=a===void 0?null:a,a!==null&&(n.callback=a),Qt(c,n),Rt(c,v,f),v},o}})(Ro),No.exports=Ro.exports;var Tc=No.exports,wi={exports:{}},Si={};/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.production.min.js
|
|
34
34
|
*
|
|
@@ -36,7 +36,7 @@ No matching component was found for:
|
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the MIT license found in the
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/var Ic=De.default,kc=Symbol.for("react.element"),Mc=Symbol.for("react.fragment"),Lc=Object.prototype.hasOwnProperty,Oc=Ic.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nc={key:!0,ref:!0,__self:!0,__source:!0};function Do(r,e,i){var o,l={},u=null,d=null;i!==void 0&&(u=""+i),e.key!==void 0&&(u=""+e.key),e.ref!==void 0&&(d=e.ref);for(o in e)Lc.call(e,o)&&!Nc.hasOwnProperty(o)&&(l[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps,e)l[o]===void 0&&(l[o]=e[o]);return{$$typeof:kc,type:r,key:u,ref:d,props:l,_owner:Oc.current}}Si.Fragment=Mc,Si.jsx=Do,Si.jsxs=Do,wi.exports=Si;const M=wi.exports.jsx,Te=wi.exports.jsxs,Et=wi.exports.Fragment,Ei=["onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onClick","onDragStart","onDragEnd","onDragEnter","onDragExit","onDrag","onDragOver"];function Rc(){return Ei.reduce((r,e)=>(r[e]=[],r),{})}const pn=Ei.reduce((r,e)=>(r[e.slice(2).toLowerCase()]=e,r[e]=e,r),{}),Nn=(r,e,i)=>{const o=r.length,l=i||G(o);for(let u=0;u<o;u++)l[u]=u%5===0?r[u+1]<e[3]&&r[u+3]>e[1]&&r[u+2]<e[4]&&r[u+4]>e[2]?1:0:r[u];return l};function G(r,e,i){return new Float32Array(r,e,i)}const zc=(r,e,i)=>{const o=r[1]<=e[3]&&r[3]>=e[1]&&r[2]<=e[4]&&r[4]>=e[2],l=i||G(5);return o?(l[0]=1,l[1]=Math.max(r[1],e[1]),l[2]=Math.max(r[2],e[2]),l[3]=Math.min(r[3],e[3]),l[4]=Math.min(r[4],e[4]),l):(l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l)},Ac=r=>r.length/5,xt=(r,e,i)=>{const o=i||G(9);return o[0]=r[0]*e[0]+r[1]*e[3]+r[2]*e[6],o[1]=r[0]*e[1]+r[1]*e[4]+r[2]*e[7],o[2]=r[0]*e[2]+r[1]*e[5]+r[2]*e[8],o[3]=r[3]*e[0]+r[4]*e[3]+r[5]*e[6],o[4]=r[3]*e[1]+r[4]*e[4]+r[5]*e[7],o[5]=r[3]*e[2]+r[4]*e[5]+r[5]*e[8],o[6]=r[6]*e[0]+r[7]*e[3]+r[8]*e[6],o[7]=r[6]*e[1]+r[7]*e[4]+r[8]*e[7],o[8]=r[6]*e[2]+r[7]*e[5]+r[8]*e[8],o};class se{constructor(e){this.index=0,this.length=e,this.points=G(this.length)}static grid(e=1,i=1){return new se(5*e*i)}static point(e,i){const o=G(5);return o[0]=1,o[1]=e,o[2]=i,o[3]=e,o[4]=i,o}static positionPair(e){const i=G(5);return i[0]=1,i[1]=e.x1,i[2]=e.y1,i[3]=e.x2,i[4]=e.y2,i}static projection(e){return se.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,i,o=0,l=0){const u=G(5);return u[0]=1,u[1]=o,u[2]=l,u[3]=e+o,u[4]=i+l,u}row(e){return e(this)}addPoints(e,i,o,l){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=i,this.points[3+this.index]=o,this.points[4+this.index]=l,this.index+=5,this}addBox(e,i,o,l){return this.addPoints(e,i,e+o,i+l),this}build(){return this.points}}const At=(r,e)=>{const i=r.length;for(let o=0;o<i;o++)r[o]=o%5===0?e[6]*r[o+1]+e[7]*r[o+2]+e[8]*r[o]:o%5%2===1?e[0]*r[o]+e[1]*r[o+1]+e[2]:e[3]*r[o-1]+e[4]*r[o]+e[5];return r},Ft=r=>{const e=G(9);return e[0]=r,e[4]=r,e[8]=1,e},Ke=(r,e)=>{const i=G(9);return i[0]=1,i[2]=r,i[4]=1,i[5]=e,i[8]=1,i},Rn=(r,e,i)=>xt(Ke((1-r)*e,(1-r)*i),Ft(r)),$t=(r,e,i)=>{const o=r.length,l=i&&i.length>=o?i.slice(0,o):G(o);for(let u=0;u<o;u++)l[u]=u%5===0?e[6]*r[u+1]+e[7]*r[u+2]+e[8]*r[u]:u%5%2===1?e[0]*r[u]+e[1]*r[u+1]+e[2]:e[3]*r[u-1]+e[4]*r[u]+e[5];return l};let Uo=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,i)=>(i&=63,i<36?e+=i.toString(36):i<62?e+=(i-26).toString(36).toUpperCase():i>62?e+="-":e+="_",e),"");class _t{constructor(){this.__revision=0,this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,i,o)=>{const l=pn[e];if(!this.eventHandlers[l])throw new Error(`Unknown event ${l}`);this.eventHandlers[l].indexOf(i)===-1&&this.eventHandlers[l].push(i)},this.removeEventListener=(e,i)=>{const o=pn[e];if(!this.eventHandlers[o]){console.warn(`Unknown event ${o}`);return}this.eventHandlers[o].indexOf(i)!==-1&&(this.eventHandlers[o]=this.eventHandlers[o].filter(l=>l!==i))},this.id=this.__id=Uo(),this.eventHandlers=Rc()}getObjectsAt(e){return[]}getAllPointsAt(e,i,o){return[]}getScheduledUpdates(e,i){return[]}dispatchEvent(e,i){const o=this.eventHandlers[e],l=o?o.length:0;let u=!1;if(l)for(let d=0;d<l;d++)try{o[d](i),u=!0}catch(h){console.error(e,h)}return u}get x(){return this.points[1]}get y(){return this.points[2]}get width(){return this.points[3]-this.points[1]}get height(){return this.points[4]-this.points[2]}translate(e,i){At(this.points,Ke(e,i))}atScale(e){At(this.points,Rn(e,this.x,this.y)),this.scale*=e}transform(e){At(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,i){}hideInstance(){}}class ot extends _t{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={scale:1,width:0,height:0,points:G(5)},this.points=G(5);else{const i=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=se.singleBox(e.width,e.height,e.x,e.y),this.display={scale:i,width:e.width/i,height:e.height/i,points:i!==1?se.singleBox(e.width/i,e.height/i):this.points}}}applyProps(e){const i=e.display?e.display.width:e.target.width,o=e.target.width/i;this.id=e.id||e.uri,this.uri=e.uri,this.points.set(se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity!="undefined"&&(this.style.opacity=e.style.opacity),this.display.scale=o,this.display.width=e.target.width/o,this.display.height=e.target.height/o,this.display.points=o!==1?se.singleBox(e.target.width/o,e.target.height/o):this.points}getAllPointsAt(e,i,o){return[[this,this.crop||this.points,i]]}static fromSvg(e,i,o,l){return ot.fromImage("data:image/svg+xml;base64,"+btoa(e),i,o,l)}static fromImage(e,i,o,l){const u=new ot;return u.applyProps({uri:e,id:l,display:o,target:i}),u}getImageUrl(){return this.uri}}class Vr extends _t{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={scale:1,width:0,height:0,points:G(5)},this.points=G(5);else{const i=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=se.singleBox(e.width,e.height),this.display={scale:i,width:e.width/i,height:e.height/i,points:i!==1?se.singleBox(e.width/i,e.height/i):this.points}}}applyProps(e){const i=e.display?e.display.width:e.target.width,o=e.target.width/i;this.id=e.id,this.points.set(se.singleBox(e.target.width,e.target.height)),this.display.scale=o,this.display.width=e.target.width/o,this.display.height=e.target.height/o,this.getTexture=e.getTexture,this.display.points=o!==1?se.singleBox(e.target.width/o,e.target.height/o):this.points}getAllPointsAt(e,i,o){return[[this,this.points,i]]}}function Fc(r,e,i=1){const o=e.length;if(o===0)throw new Error("No resources passed in.");let l=0;for(let u=0;u<o&&!(!e[u]||!e[u].display);u++)l=Math.abs(e[u].display.scale-r)*i<Math.abs(e[l].display.scale-r)?u:l;return l}function bo(r,e){return Math.abs(r-e)}function xi(r,e){const i=bo(r.x,e.x),o=bo(r.y,e.y);return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}function Dc(r){const e=r.length;return r.indexOf("/info.json")===e-10?r.slice(0,-10):r}class en extends _t{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.id=Dc(e.url),this.points=e.displayPoints?e.displayPoints:$t(e.points,Ft(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor}}applyProps(e){e.style&&typeof e.style.opacity!="undefined"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service)}static fromTile(e,i,o,l,u){o.height=o.height?o.height:o.width;const d=Math.ceil(i.width/l),h=Math.ceil(i.height/l),g=Math.ceil(d/o.width),p=Math.ceil(h/o.height),m=se.grid(g,p),w=se.grid(g,p);for(let O=0;O<p;O++)for(let R=0;R<g;R++){const N=R*o.width,I=O*o.height;w.addPoints(N*l,I*l,R===g-1?i.width:(N+o.width)*l,O===p-1?i.height:(I+o.height)*l),m.addPoints(N,I,R===g-1?d:N+o.width,O===p-1?h:I+o.height)}const _=new en({url:e,scaleFactor:l,points:m.build(),displayPoints:w.build(),width:i.width,height:i.height,tileWidth:o.width});return _.applyProps({service:u}),_}getImageUrl(e){const i=this.points.slice(e*5,e*5+5),o=i[3]-i[1],l=i[4]-i[2],u=Math.ceil(o/this.display.scale);return`${this.id}/${i[1]},${i[2]},${o},${l}/${u>this.tileWidth?this.tileWidth:u},/0/default.jpg`}getAllPointsAt(e,i,o){const l=Nn(this.points,e);return[[this,l,i]]}transform(e){At(this.points,e)}getScheduledUpdates(e,i){return[]}}class Uc extends _t{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,i,o){return[[this,this.points,i]]}}class bc extends Uc{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=G(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((o,l)=>l.display.width-o.display.width),this.images=[];let i=.1;for(const o of this.allImages){if(o.display.width<this.renderOptions.minSize&&o.display.height<this.renderOptions.minSize&&!o.priority||o instanceof ot&&(o.display.width>this.renderOptions.maxImageSize||o.display.height>this.renderOptions.maxImageSize)&&!o.priority)continue;if(Math.abs(o.display.scale-i)<.25||o.priority){const u=this.images.pop();u&&(u instanceof ot||u.priority)?(o.priority&&this.images.push(o),this.images.push(u)):o&&this.images.push(o)}else o&&this.images.push(o);i=o.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(o=>o.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const i=await this.lazyLoader();this.addImages(i)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=se.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={points:se.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions=B({renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.1},e.renderOptions||{}),this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback!="undefined"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers!="undefined"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize!="undefined"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize!="undefined"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality!="undefined"&&e.quality!==this.renderOptions.quality&&(this.renderOptions.quality=e.quality)}appendChild(e){this.addImages([e])}removeChild(e){this.images.indexOf(e)!==-1&&(this.images=this.images.filter(i=>i!==e),this.sortByScales())}insertBefore(e,i){this.addImages([e])}hideInstance(){}addImages(e){for(const i of e)i.__parent=this;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,i){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:i>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,i,o){if(this.images.length===0)return[];const l=Fc(1/(o||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),u=this.images.length,d=i?xt(i,Ke(this.x,this.y)):Ke(this.x,this.y);if(l!==this.images.length-1&&this.images[l+1]){let h=[];for(let m=u-1;m>=l;m--)h.push(m);const g=h[0];this.renderOptions.renderLayers&&(h=h.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&h.indexOf(g)===-1&&h.unshift(g);const p=[];for(let m=0;m<h.length;m++)p.push(...this.images[h[m]].getAllPointsAt(e,d,o));return p}return this.images[l].getAllPointsAt(e,d,o)}}class zn extends _t{constructor(e,i){super(),this.type="world-object",this.intersectionBuffer=G(5),this.aggregateBuffer=G(9),this.invertedBuffer=G(9),this._updatedList=[];const{x:o=0,y:l=0}=i||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=G([1,o,l,e.width,e.height]),this.worldPoints=G([1,o,l,e.width,e.height]),this.filteredPointsBuffer=G(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=G(5),this.worldPoints=G(5),this.filteredPointsBuffer=G(5))}static createWithProps(e){const i=new zn;return i.applyProps(e),i}applyProps(e){const i=e.x||0,o=e.y||0;this.id=e.id;const l=typeof e.scale!="undefined"?e.scale:this.scale;this.points[0]=1,this.points[1]=i,this.points[2]=o,this.points[3]=i+e.width,this.points[4]=o+e.height,this.worldPoints[3]=this.worldPoints[1]+e.width*l,this.worldPoints[4]=this.worldPoints[2]+e.height*l,e.scale&&e.scale!==1&&this.atScale(l),this.scale=l}appendChild(e){e.points[0]===0&&e.points.set(this.points),this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(i=>i!==e),this.filteredPointsBuffer=G(this.layers.length*5)}insertBefore(e,i){const o=this.layers.indexOf(i);if(o===-1||this.layers.indexOf(e)!==-1)return;const l=this.layers.slice(0,o-1),u=this.layers.slice(o);this.layers=[...l,e,...u]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,i){if(Nn(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const l=this.layers.length,u=[];for(let d=0;d<l;d++){const h=this.layers[d];if(Nn($t(h.points,Ke(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&u.push(h),i){const p=h;u.push(...p.getObjectsAt(e,i))}}return u}getAllPointsAt(e,i,o){const l=xt(Ke(this.x,this.y),Ft(this.scale),this.aggregateBuffer),u=zc(e,this.points,this.intersectionBuffer),d=this.layers.length,h=[],g=$t(u,xt(Ft(1/this.scale),Ke(-this.x,-this.y),this.invertedBuffer)),p=i?xt(i,l,this.aggregateBuffer):l,m=o*this.scale;for(let w=0;w<d;w++)h.push(...this.layers[w].getAllPointsAt(g,p,m));return h}addLayers(e){const i=[];for(const o of e)this.layers.indexOf(o)===-1&&(i.push(o),o.points.length===5&&(o.points[1]<this.worldPoints[1]/this.scale||o.points[2]<this.worldPoints[2]/this.scale||o.points[3]>this.worldPoints[3]/this.scale||o.points[4]>this.worldPoints[4]/this.scale)&&(o.crop=G([1,Math.max(this.worldPoints[1]/this.scale,o.points[1]),Math.max(this.worldPoints[2]/this.scale,o.points[2]),Math.min(this.worldPoints[3]/this.scale,o.points[3]),Math.min(this.worldPoints[4]/this.scale,o.points[4])])));this.layers=this.layers.concat(i),this.filteredPointsBuffer=G(this.layers.length*5)}getScheduledUpdates(e,i){const o=this.layers.length;this._updatedList=[];const l=i*this.scale;for(let u=0;u<o;u++){const d=this.layers[u].getScheduledUpdates(e,l);d&&this._updatedList.push(...d)}return this._updatedList}}class mn extends _t{constructor(e=0,i=0,o=100,l="left-to-right"){super(),this.id="world",this.aggregateBuffer=G(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=G(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=i,this.aspectRatio=Number.isNaN(e/i)?1:e/i,this.viewingDirection=l,this.points=G(o*5),this.filteredPointsBuffer=G(o*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const i=new mn;return i.applyProps(e),i}applyProps(e){typeof e.width!="undefined"&&typeof e.height!="undefined"&&(e.width!==this._width||e.height!==this._height)&&this.resize(e.width,e.height),e.viewingDirection!==this.viewingDirection&&(this.viewingDirection=e.viewingDirection,this.triggerRepaint())}propagateTouchEvent(e,i,o){const l=[];for(const u of o)if(u.x&&u.y){const d=se.singleBox(1,1,u.x,u.y);l.push(this.getObjectsAt(d,!0).reverse())}return l.map(u=>this.propagateEvent(e,i,u,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,i,o,l,u={}){const d=se.singleBox(1,1,o,l),h=this.getObjectsAt(d,!0).reverse();return this.propagateEvent(e,i,h,u)}propagateEvent(e,i,o,{bubbles:l=!1,cancelable:u=!1}={}){i.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let d=!1;i.stopPropagation=()=>{d=!0};const h=o.length;for(let m=h-1;m>=0;m--){this._propagateEventTargets.unshift(o[m][0]);const w=o[m][1].length;if(w)for(let _=0;_<w;_++)this._propagateEventTargets.unshift(o[m][1][_])}const g=this._propagateEventTargets.length;let p=!1;for(let m=0;m<g&&(i.atlasTarget=this._propagateEventTargets[m],i.atlasWorld=this,p=this._propagateEventTargets[m].dispatchEvent(e,i)||p,!d);m++);return p&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const i=this.appendWorldObject(e);this.renderOrder.push(i/5)}removeChild(e){const i=this.objects.indexOf(e);if(i===-1){for(const o of this.objects)if(o&&o.id===e.id){this.removeChild(o);return}return}this.objects[i]=null,this.renderOrder=this.renderOrder.filter(o=>o!==i),this.points[i*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,i){const o=this.objects.indexOf(i);if(o===-1)return;const l=this.appendWorldObject(e);this.renderOrder.splice(o-1,0,l/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const i=this.zones.length;for(let o=0;o<i;o++)if(this.zones[o].id===e){this.selectedZone=o,this.trigger("zone-changed");return}}else this.zones[e]&&(this.selectedZone=e,this.trigger("zone-changed"))}deselectZone(){this.selectedZone=void 0}getActiveZone(){if(this.selectedZone)return this.zones[this.selectedZone]}hasActiveZone(){return typeof this.selectedZone!="undefined"}checkResizeInternalBuffer(){if(Ac(this.points)===this.objects.length){const e=this.points,i=G(this.points.length*2);i.set(e,0),this.points=i}}appendWorldObject(e){this.checkResizeInternalBuffer();const i=this.objects.length*5,o=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=o[1],e.points[2]=o[2],e.points[3]=o[3],e.points[4]=o[4],this.objects.push(e),this.filteredPointsBuffer=G(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),i}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const i=new Int32Array(this.objects.length),o=new Int32Array(this.objects.length),l=this.renderOrder.length;for(let h=0;h<l;h++){const g=this.renderOrder[h];this.objects[g]&&(i[h]=this.points[g*5+3],o[h]=this.points[g*5+4])}const u=Math.max(...i);u!==this._width&&(this._width=u,e=!0);const d=Math.max(...o);d!==this._height&&(this._height=d,e=!0),e&&this.trigger("recalculate-world-size",{width:u,height:d}),this.needsRecalculate=!1}return e}addObjectAt(e,i){i.width&&!i.height?i.height=i.width/e.width*e.height:i.height&&!i.width&&(i.width=i.height/e.height*e.width),(!i||!i.width||!i.height)&&(i.width=e.width,i.height=e.height);const{width:o,x:l,y:u}=i,d=o/e.width;this.checkResizeInternalBuffer(),this.points.set(se.singleBox(e.width,e.height,0,0),this.objects.length*5);const h=new zn(e);return h.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(h),this.scaleWorldObject(this.objects.length-1,d),this.translateWorldObject(this.objects.length-1,l,u),this.filteredPointsBuffer=G(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,h}scaleWorldObject(e,i){At(this.points.subarray(e*5,e*5+5),Rn(i,this.points[e*5+1],this.points[e*5+2]));const o=this.objects[e];o&&(o.atScale(i),this.triggerRepaint())}translateWorldObject(e,i,o){At(this.points.subarray(e*5,e*5+5),Ke(i,o));const l=this.objects[e];l&&(l.translate(i,o),this.triggerRepaint())}resize(e,i){return this._width=e,this._height=i,this.aspectRatio=e/i,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,i){const o=se.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(o,i,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,i){const o=Nn(this.points,e,this.filteredPointsBuffer),l=this.objects.length;this._updatedList=[];for(let u=0;u<l;u++)if(o[u*5]!==0){if(!this.objects[u])continue;this._updatedList.push(...this.objects[u].getScheduledUpdates(e,i))}return this._updatedList}getObjectsAt(e,i=!1){const o=this.getActiveZone(),l=Nn(this.points,e,this.filteredPointsBuffer),u=this.renderOrder.length,d=[];for(let h=0;h<u;h++){const g=this.renderOrder[h];if(l[g*5]!==0){const p=this.objects[g];if(!p||o&&o.objects.indexOf(p)===-1)continue;if(p.type!=="world-object"){d.push([p,[p]]);continue}i?d.push([p,p.getObjectsAt(e,i)]):d.push([p,this.emptyPaintables])}}return d}getPointsAt(e,i,o=1){const l=this.getObjectsAt(e),u=xt(Ft(o),Ke(-e[1],-e[2]),this.translationBuffer),d=i?xt(i,u,this.aggregateBuffer):u,h=l.length,g=[];for(let p=0;p<h;p++)l[p]&&g.push(...l[p][0].getAllPointsAt(e,d,o));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let i=0;i<e;i++){if(this._alreadyFlushed.indexOf(this.triggerQueue[i][0])!==-1)continue;typeof this.triggerQueue[i][1]=="undefined"&&this._alreadyFlushed.push(this.triggerQueue[i][0]);const o=this.subscriptions.length;for(let l=0;l<o;l++)this.subscriptions[l].apply(null,this.triggerQueue[i])}this.triggerQueue=[]}}trigger(e,i){this.triggerQueue.push([e,i])}triggerEventActivation(){this.trigger("event-activation")}triggerRepaint(){this.trigger("repaint")}gotoRegion(e){this.trigger("goto-region",e)}goHome(e=!1){this.trigger("go-home",{immediate:e})}zoomTo(e,i,o){this.trigger("zoom-to",{point:i,factor:e,stream:o})}zoomIn(e){this.trigger("zoom-to",{point:e,factor:.5})}zoomOut(e){this.trigger("zoom-to",{point:e,factor:2})}constraintBounds(e){this.trigger("constrain-bounds",{immediate:e})}}const _i=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,Pi={},Bc=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class An extends _t{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={scale:1,width:-1,height:-1,points:G(5)},this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=Uo(12),this.points=G(5)}getAllPointsAt(e,i){return[[this,this.points,i]]}applyProps(e={}){let i=!1;if(e.interactive!==this.props.interactive&&(i=!0,this.props.interactive=e.interactive),e.style){const o=e.border||e.style.border;if(o!==this._parsed.border.id)if(!o)this._parsed.border.id=null,this._parsed.border.match=[];else{const l=Pi[o]||_i.exec(o)||_i.exec(o);l&&(this._parsed.border.id=o,this._parsed.border.match=Pi[o]=l)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const l=Pi[e.style.outline]||_i.exec(e.style.outline)||_i.exec(e.style.outline);l&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=Pi[e.style.outline]=l)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,i=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,i=!0);for(const l of Bc)if(this.props.style[l]!==e.style[l]){i=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),i=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),i=!0)}e.href!==this.props.href&&(this.props.href=e.href,i=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,i=!0),e.title!==this.props.title&&(this.props.title=e.title,i=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),i=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,i=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,i=!0),e.html!==this.props.html&&(this.props.html=e.html,i=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(i=!0,this.points=se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),i&&this.__revision++}}class Ci extends _t{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={scale:1,width:100,height:100,points:G(5)},this.interactive=!1,this.props={font:"18px Arial, sans-serif",lineHeight:1,textAlign:"left",verticalAlign:"top",paddingX:0,paddingY:0,fitParent:!1,lineBreak:"auto",strokeText:!1,sizeToFill:!1,maxFontSizeToFill:void 0,allowNewLine:!0,justifyLines:!1,renderHDPI:!1,textDecoration:"none",interactive:!1,relativeSize:!1},this.id="",this.points=G(5)}getAllPointsAt(e,i){return[[this,this.points,i]]}applyProps(m){var w=m,{id:e,target:i,text:o,color:l,backgroundColor:u,fontSize:d=18,interactive:h,fontFamily:g="Arial, sans-serif"}=w,p=St(w,["id","target","text","color","backgroundColor","fontSize","interactive","fontFamily"]);p.font=`${d}px ${g}`,this.interactive=h||!1,typeof o!="undefined"&&(this.text=o||""),l&&(this.color=l),u&&(this.backgroundColor=u),e&&(this.id=e),i&&(this.points=se.singleBox(i.width,i.height,i.x,i.y),this.display.points=this.points,this.display.width=i.width,this.display.height=i.height),this.props=B(B({},this.props),p),this.__revision++}}const ye=Math.pow,Ti=Math.sqrt,Fn=Math.sin,Bo=Math.cos,Dn=Math.PI,Ii=1.70158,ki=Ii*1.525,jo=Ii+1,Ho=2*Dn/3,Vo=2*Dn/4.5,Mi=function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},Dt={linear:r=>r,easeInQuad:function(r){return r*r},easeOutQuad:function(r){return 1-(1-r)*(1-r)},easeInOutQuad:function(r){return r<.5?2*r*r:1-ye(-2*r+2,2)/2},easeInCubic:function(r){return r*r*r},easeOutCubic:function(r){return 1-ye(1-r,3)},easeInOutCubic:function(r){return r<.5?4*r*r*r:1-ye(-2*r+2,3)/2},easeInQuart:function(r){return r*r*r*r},easeOutQuart:function(r){return 1-ye(1-r,4)},easeInOutQuart:function(r){return r<.5?8*r*r*r*r:1-ye(-2*r+2,4)/2},easeInQuint:function(r){return r*r*r*r*r},easeOutQuint:function(r){return 1-ye(1-r,5)},easeInOutQuint:function(r){return r<.5?16*r*r*r*r*r:1-ye(-2*r+2,5)/2},easeInSine:function(r){return 1-Bo(r*Dn/2)},easeOutSine:function(r){return Fn(r*Dn/2)},easeInOutSine:function(r){return-(Bo(Dn*r)-1)/2},easeInExpo:function(r){return r===0?0:ye(2,10*r-10)},easeOutExpo:function(r){return r===1?1:1-ye(2,-10*r)},easeInOutExpo:function(r){return r===0?0:r===1?1:r<.5?ye(2,20*r-10)/2:(2-ye(2,-20*r+10))/2},easeInCirc:function(r){return 1-Ti(1-ye(r,2))},easeOutCirc:function(r){return Ti(1-ye(r-1,2))},easeInOutCirc:function(r){return r<.5?(1-Ti(1-ye(2*r,2)))/2:(Ti(1-ye(-2*r+2,2))+1)/2},easeInBack:function(r){return jo*r*r*r-Ii*r*r},easeOutBack:function(r){return 1+jo*ye(r-1,3)+Ii*ye(r-1,2)},easeInOutBack:function(r){return r<.5?ye(2*r,2)*((ki+1)*2*r-ki)/2:(ye(2*r-2,2)*((ki+1)*(r*2-2)+ki)+2)/2},easeInElastic:function(r){return r===0?0:r===1?1:-ye(2,10*r-10)*Fn((r*10-10.75)*Ho)},easeOutElastic:function(r){return r===0?0:r===1?1:ye(2,-10*r)*Fn((r*10-.75)*Ho)+1},easeInOutElastic:function(r){return r===0?0:r===1?1:r<.5?-(ye(2,20*r-10)*Fn((20*r-11.125)*Vo))/2:ye(2,-20*r+10)*Fn((20*r-11.125)*Vo)/2+1},easeInBounce:function(r){return 1-Mi(1-r)},easeOutBounce:Mi,easeInOutBounce:function(r){return r<.5?(1-Mi(1-2*r))/2:(1+Mi(2*r-1))/2}};class jc{constructor(e){this.runtime=e,this.pendingTransition={from:G(5),to:G(5),elapsed_time:0,done:!0,total_time:0,timingFunction:Dt.easeInOutQuad,constrain:!1}}hasPending(){return!this.pendingTransition.done}getPendingTransition(){return this.pendingTransition}getPendingFrom(){return this.pendingTransition.from}customTransition(e){e(this.pendingTransition)}stopTransition(){this.pendingTransition.from=G(this.runtime.target),this.pendingTransition.to=G(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,i){if(!this.pendingTransition.done){const o=this.pendingTransition,l=o.total_time===0?0:(o.elapsed_time+i)/o.total_time,u=o.total_time===0?1:l===0?0:o.timingFunction(l);e[1]=o.from[1]+(o.to[1]-o.from[1])*u,e[2]=o.from[2]+(o.to[2]-o.from[2])*u,e[3]=o.from[3]+(o.to[3]-o.from[3])*u,e[4]=o.from[4]+(o.to[4]-o.from[4])*u,this.pendingTransition.elapsed_time+=i,this.pendingTransition.elapsed_time>=this.pendingTransition.total_time&&(this.pendingTransition.done=!0,this.pendingTransition.constrain&&this.constrainBounds({transition:{duration:this.pendingTransition.total_time===0?0:500,easing:Dt.easeOutExpo}}))}}zoomTo(e,{origin:i,stream:o=!1,transition:l}={}){const u=this.runtime.getZoomedPosition(e,{origin:i}),d=Math.abs(1-e);this.applyTransition(u,l,{duration:2e3*d,easing:Dt.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:i=0}={}){const[o,l]=this.runtime.constrainBounds(this.runtime.target,{panPadding:i});o&&(this.applyTransition(l,e,{duration:500,easing:Dt.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,i,o,{stream:l}={}){this.pendingTransition.from=G(this.runtime.target),this.pendingTransition.to=e,l||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(i==null?void 0:i.duration)!="undefined"?i.duration:typeof(o==null?void 0:o.duration)!="undefined"?o.duration:1e3,this.pendingTransition.constrain=typeof(i==null?void 0:i.constrain)!="undefined"?i.constrain:typeof(o==null?void 0:o.constrain)!="undefined"?o.constrain:!1,this.pendingTransition.timingFunction=(i==null?void 0:i.easing)||(o==null?void 0:o.easing)||Dt.easeInOutSine}goToRegion(e,{transition:i}={}){const o=this.runtime.clampRegion(e);this.applyTransition(se.singleBox(o.width,o.height,o.x,o.y),i,{duration:1e3,easing:Dt.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class Li{constructor(e,i,o,l=[],u){this.ready=!1,this.transformBuffer=G(500),this.lastTarget=G(5),this.zoomBuffer=G(5),this.logNextRender=!1,this.pendingUpdate=!0,this.firstRender=!0,this.mode="explore",this.controllers=[],this.controllersRunning=!1,this.controllerStopFunctions=[],this.maxScaleFactor=1,this._viewerToWorld={x:0,y:0},this._lastGoodScale=1,this.hooks={useFrame:[],useBeforeFrame:[],useAfterPaint:[],useAfterFrame:[]},this._viewport={x:0,y:0,width:0,height:0},this.setViewport=d=>{const h=typeof d.x=="undefined"?this.target[1]:d.x,g=typeof d.y=="undefined"?this.target[2]:d.y;d.width?this.target[3]=h+d.width:this.target[3]=this.target[3]-this.target[1]+h,d.height?this.target[4]=g+d.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-h)>.01&&(this.target[1]=h),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=d=>{const h=d-this.lastTime;if(this.fpsLimit&&h<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=d,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",h);const g=this.pendingUpdate,p=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,h),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!p&&this.target[0]===this.lastTarget[0]&&this.target[1]===this.lastTarget[1]&&this.target[2]===this.lastTarget[2]&&this.target[3]===this.lastTarget[3]&&this.target[4]===this.lastTarget[4])return;this.hook("useBeforeFrame",h),this.renderer.beforeFrame(this.world,h,this.target);const m=this.getScaleFactor(),w=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),_=w.length;for(let N=0;N<_;N++){const I=w[N][0],k=w[N][1],P=w[N][2];this.renderer.prepareLayer(I);const j=P?$t(k,P,this.transformBuffer):k,V=j.length/5;for(let W=0;W<V;W++){const Q=W*5;j[Q]!==0&&(this.renderer.paint(I,W,j[Q+1],j[Q+2],j[Q+3]-j[Q+1],j[Q+4]-j[Q+2]),this.hook("useAfterPaint",I))}}this.renderer.afterFrame(this.world,h,this.target),this.hook("useAfterFrame",h),this.lastTarget[0]=this.target[0],this.lastTarget[1]=this.target[1],this.lastTarget[2]=this.target[2],this.lastTarget[3]=this.target[3],this.lastTarget[4]=this.target[4],this.firstRender=!1,this.pendingUpdate=!1,this.logNextRender=!1,this.renderer.isReady()&&(this.ready=!0,this.world.trigger("ready")),this.world.flushSubscriptions();const O=this.world.getScheduledUpdates(this.target,m),R=O.length;if(R>0)for(let N=0;N<R;N++){const I=O[R-N-1]();I?I.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=i,this.options=B({maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5},u||{}),this.target=se.projection(o),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=se.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new jc(this),this.aggregate=Ft(1),this.world.addLayoutSubscriber(d=>{d==="repaint"&&(this.pendingUpdate=!0),d==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=l,this.render(this.lastTime),this.startControllers()}get x(){return this.target[1]}set x(e){this.target[1]=e}get y(){return this.target[2]}set y(e){this.target[2]=e}get x2(){return this.target[3]}set x2(e){this.target[3]=e}get y2(){return this.target[4]}set y2(e){this.target[4]=e}get width(){return this.target[3]-this.target[1]}set width(e){this.target[3]=this.target[1]+e}get height(){return this.target[4]-this.target[2]}set height(e){this.target[4]=this.target[2]=e}setHomePosition(e){this.homePosition.set(se.projection(e||this.world)),this.pendingUpdate=!0}startControllers(){if(!this.controllersRunning){for(const e of this.controllers)this.controllerStopFunctions.push(e.start(this));this.controllersRunning=!0}}stopControllers(){if(!!this.controllersRunning){for(const e of this.controllerStopFunctions)e();this.controllersRunning=!1,this.controllerStopFunctions=[]}}updateControllerPosition(){for(const e of this.controllers)e.updatePosition(this.x,this.y,this.width,this.height)}triggerResize(){this.renderer.triggerResize&&this.renderer.triggerResize(),this.pendingUpdate=!0}addController(e){this.controllers.push(e),this.controllersRunning&&e.start(this),this.pendingUpdate=!0}cover(){return this.goHome({cover:!0})}getRendererScreenPosition(){return this.renderer.getRendererScreenPosition()}updateRendererScreenPosition(){this.pendingUpdate=!0,this.renderer.resize()}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const i=this.getScaleFactor(),o=e.position?{x:e.position[1],y:e.position[2],width:e.position[3]-e.position[1],height:e.position[4]-e.position[2]}:{x:this.homePosition[1],y:this.homePosition[2],width:this.homePosition[3]-this.homePosition[1],height:this.homePosition[4]-this.homePosition[2]},l=this.width*i,u=this.height*i,d=o.width/l,h=o.height/u,g=l/u;if(e.cover?d>h:d<h){const p=g*o.height,m=(p-o.width)/2;this.target[1]=-m+o.x,this.target[2]=o.y,this.target[3]=p-m+o.x,this.target[4]=o.height+o.y}else{const p=o.width/g,m=(p-o.height)/2;this.target[1]=o.x,this.target[2]=o.y-m,this.target[3]=o.x+o.width,this.target[4]=o.y+p-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,i,o,l){this.updateFocalPosition(e-i,o-l);const u=i/e,d=l/o;this.target[3]=this.target[1]+(this.target[3]-this.target[1])*u,this.target[4]=this.target[2]+(this.target[4]-this.target[2])*d,this.goHome({position:this.focalPosition}),this.renderer.resize(i,l),this.pendingUpdate=!0}updateFocalPosition(e,i){if(!this.manualFocalPosition){const o=this.width,l=this.height,u=Math.min(o,l),d=0,h=0,g=this.x+d,p=this.y+h;if(o<l){const m=this.height-this.width;this.focalPosition=se.projection({x:g,y:p+m/2,width:u-d*2,height:u-h*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=se.projection({x:g+m/2,y:p,width:u-d*2,height:u-h*2}),this.pendingUpdate=!0}}}getViewport(){return this._viewport.x=this.target[1],this._viewport.y=this.target[2],this._viewport.width=this.target[3]-this.target[1],this._viewport.height=this.target[4]-this.target[2],this._viewport}constrainBounds(e,{panPadding:i=0,ref:o=!1}={}){const{minX:l,maxX:u,minY:d,maxY:h}=this.getBounds({target:e,padding:i});let g=!1;const p=o?e:G(e),m=e[3]-e[1],w=e[4]-e[2];return l>e[1]&&(g=!0,p[1]=l,p[3]=l+m),d>e[2]&&(g=!0,p[2]=d,p[4]=d+w),u<e[1]&&(g=!0,p[1]=u,p[3]=u+m),h<e[2]&&(g=!0,p[2]=h,p[4]=h+w),[g,p]}getBounds(e){const i=e.target||this.target,o=e.padding,l=this.options.visibilityRatio,u=Math.abs(1-l);if(this.world.hasActiveZone()){const P=this.world.getActiveZone();if(P){const j=i[3]-i[1]<P.points[3]-P.points[1],V=i[4]-i[2]<P.points[4]-P.points[2];return{minX:j?P.points[1]-o:P.points[1]+(P.points[3]-P.points[1])/2-(i[3]-i[1])/2,maxX:V?P.points[2]-o:P.points[2]+(P.points[4]-P.points[2])/2-(i[4]-i[2])/2,minY:j?P.points[3]+o:P.points[1]+(P.points[3]-P.points[1])/2-(i[3]-i[1])/2,maxY:V?P.points[4]+o:P.points[2]+(P.points[4]-P.points[2])/2-(i[4]-i[2])/2}}}const d=i[3]-i[1],h=this.world.width,g=-d*u,p=h-d-g,m=i[4]-i[2],w=this.world.height,_=-m*u,O=w-m-_,R=Math.max(g,p),N=Math.min(g,p),I=Math.max(_,O),k=Math.min(_,O);return{minX:N,maxX:R,minY:k,maxY:I}}getScaleFactor(e=!1){const i=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return i===0?this._lastGoodScale:(this._lastGoodScale=i,i)}getZoomedPosition(e,{origin:i,fromPos:o}){var l;const u=o?{width:o[3]-o[1],height:o[4]-o[2]}:void 0,d=u?this.renderer.getScale(u.width,u.height):this.getScaleFactor(),h=u?u.width:this.width,g=u?u.height:this.height,p=(l=this.getRendererScreenPosition())==null?void 0:l.width,m=this.world.width,w=p?p/m:1,_=this.options.maxUnderZoom,O=Math.max(w||1,this.options.maxOverZoom),R=1/e,N=d*R;if(R<1){const P=h*d,j=g*d,V=this.world.width/P,W=this.world.height/j;if(V>W){const Q=this.world.width*N,q=~~(h*d)*_;Q<q&&(e=this.world.width*d/(h*d*_))}else{const Q=this.world.height*N,q=~~(g*d)*_;Q<q&&(e=this.world.height*d/(g*d*_))}}else N>1&&(e=d/O);const k=$t(this.target,Rn(e,i?i.x:this.target[1]+(this.target[3]-this.target[1])/2,i?i.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(k,{ref:!0,panPadding:100}),k}clampRegion({x:e,y:i,width:o,height:l,padding:u=0}){const d=this.width,h=this.height,g=o/d<l/h,p=e-u,m=i-u,w=o+u*2,_=l+u*2;if(g){const R=_/h*d;return{x:p-(R-w)/2,y:m,width:R,height:_}}const O=w/d*h;return{x:p,y:m-(O-_)/2,width:w,height:O}}viewerToWorld(e,i){const o=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/o,this._viewerToWorld.y=this.target[2]+i/o,this._viewerToWorld}worldToViewer(e,i,o,l){const u=se.singleBox(o,l,e,i);return At(u,xt(Ft(this.getScaleFactor()),Ke(-this.target[1],-this.target[2]))),{x:u[1],y:u[2],width:u[3]-u[1],height:u[4]-u[2],strand:u}}setScale(e,i){At(this.target,Rn(e,i?i.x:this.target[1]+(this.target[3]-this.target[1])/2,i?i.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const i=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=i}}stop(){return typeof this.stopId!="undefined"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,i){const o=this.hooks[e].length;if(o!==0)for(let l=0;l<o;l++)this.hooks[e][l](i)}registerHook(e,i){return this.hooks[e].push(i),()=>{this.hooks[e]=this.hooks[e].filter(o=>o!==i)}}updateNextFrame(){this.pendingUpdate=!0}}const Wo=/(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)?(-?[0-9]+(px|em)\s+|0\s+)?(.*)/g,Qo={},Oi={},Hc={};class Vc{constructor(e,i){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=3,this.loadingQueueOrdered=!0,this.loadingQueue=[],this.currentTask=Promise.resolve(),this.tasksRunning=0,this.averageJobTime=1e3,this.lastKnownScale=1,this.visible=[],this.previousVisible=[],this.drawCalls=[],this._worker=()=>{if(this.loadingQueue.length&&this.tasksRunning<this.parallelTasks&&this.frameTasks<this.parallelTasks){const o=this.loadingQueue.pop();o&&(this.tasksRunning++,this.frameTasks++,this.currentTask=o.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{(this.frameIsRendering||this.loadingQueue.length===0&&this.tasksRunning===0&&this._scheduled)&&(clearInterval(this._scheduled),this._scheduled=0),this._worker()},this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.ctx=e.getContext("2d",{alpha:!1}),this.ctx.imageSmoothingEnabled=!0,this.options=i||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(i==null?void 0:i.dpi)||1}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}resize(){this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return this.firstMeaningfulPaint}afterFrame(e){if(this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((i,o)=>i.scale===o.scale?o.distance-i.distance:i.scale<o.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall){const i=this.drawCalls.shift();i&&i()}this.doOffscreenWork(),this.options.debug&&this.stats&&this.stats.end()}doOffscreenWork(){this.frameTasks=0,this.loadingQueue.length&&(this._worker(),this.loadingQueue.length&&this.tasksRunning<this.parallelTasks&&(this._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,i,o){if(Number.isNaN(e)||Number.isNaN(i))return this.lastKnownScale;const l=this.getCanvasDims(),u=l.width/e,d=l.height/i,h=(u<d?d:u)*(o&&this.dpi||1);return Number.isNaN(h)||(this.lastKnownScale=h),this.lastKnownScale}beforeFrame(e,i,o){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(i);const l=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,l.width,l.height)}paint(e,i,o,l,u,d){const h=this.ctx.globalAlpha;if(e instanceof ot||e instanceof en){if(this.visible.push(e),typeof e.style&&e.style.opacity!=="undefined"){if(!e.style.opacity)return;this.ctx.globalAlpha=e.style.opacity}try{const g=e.__host.canvas,p=this.getCanvasDims();if(g.indices.indexOf(i)===-1&&this.schedulePaintToCanvas(g,e,i,xi({x:o+u/2,y:l+u/2},{x:p.width/2,y:p.height/2})),!this.firstMeaningfulPaint)return;const m=g.canvases[i];m&&(e.crop?e.crop[0]&&this.ctx.drawImage(m,e.display.points[i*5+1]-e.crop[i*5+1],e.display.points[i*5+2]-e.crop[i*5+2],e.crop[i*5+3]-e.crop[i*5+1]-1,e.crop[i*5+4]-e.crop[i*5+2]-1,o,l,u+Number.MIN_VALUE,d+Number.MIN_VALUE):this.ctx.drawImage(m,0,0,e.display.points[i*5+3]-e.display.points[i*5+1]-1,e.display.points[i*5+4]-e.display.points[i*5+2]-1,o,l,u+Number.MIN_VALUE,d+Number.MIN_VALUE))}catch{}}if(this.options.box&&e instanceof An&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const g=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),p=e.props.relativeStyle?1:u/e.width;typeof g.opacity!="undefined"&&(this.ctx.globalAlpha=g.opacity);let m=0;typeof g.borderWidth!="undefined"&&(m=parseInt(g.borderWidth,10)*p);let w=0;typeof g.outlineWidth!="undefined"&&(w=parseInt(g.outlineWidth,10)*p);let _=0;if(typeof g.outlineOffset!="undefined"&&(_=parseInt(g.outlineOffset,10)*p),g.borderColor&&(this.ctx.strokeStyle=g.borderColor),g.boxShadow){const O=g.boxShadow.split(/,(?![^(]*\))/);for(const R of O){const N=Qo[R]||Wo.exec(R)||Wo.exec(R);Qo[R]=N,N&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(N[1])*this.dpi*p,this.ctx.shadowOffsetY=parseInt(N[3])*this.dpi*p,this.ctx.shadowBlur=parseInt(N[5])*this.dpi*p,this.ctx.shadowColor=N[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(o+m,l+m,u,d),this.ctx.restore())}}this.ctx.fillStyle=g.backgroundColor||"transparent",this.ctx.lineWidth=m,m&&this.ctx.strokeRect(o+m/2,l+m/2,u+m,d+m),this.ctx.fillRect(o+m,l+m,u,d),w&&(g.outlineColor&&(this.ctx.strokeStyle=g.outlineColor),this.ctx.lineWidth=w,this.ctx.strokeRect(o-w/2-_,l-w/2-_,u+m*2+w+_*2,d+m*2+w+_*2))}this.ctx.globalAlpha=h}}loadImage(e,i,o){if(Oi[e]&&Oi[e].naturalWidth>0){i(Oi[e]);return}try{const l=document.createElement("img");l.decoding="auto",l.onload=function(){i(l),Oi[e]=l,l.onload=null},this.options.crossOrigin&&(l.crossOrigin="anonymous"),l.src=e}catch(l){o(l)}}schedulePaintToCanvas(e,i,o,l){this.imagesPending++,e.indices.push(o),e.canvases[o]=document.createElement("canvas"),i.__host.canvas.loading=!0;const u=`${i.id}--${i.display.scale}`;this.loadingQueueOrdered=!1,this.loadingQueue.push({id:u,scale:i.display.scale,distance:l,task:()=>new Promise(d=>{if(this.visible.indexOf(i)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(o),1),d();return}const h=i.getImageUrl(o);this.loadImage(h,g=>{this.loadingQueue.push({id:u,scale:i.display.scale,distance:l,task:()=>new Promise(p=>{this.imagesLoaded++,e.loaded.push(o),e.loaded.length===e.indices.length&&(e.loading=!1);const m=i.display.points.slice(o*5,o*5+5),w=e.canvases[o],_=w.getContext("2d");w.width=m[3]-m[1],w.height=m[4]-m[2],this.drawCalls.push(()=>{_.drawImage(g,0,0,m[3]-m[1],m[4]-m[2]),p()})})}),d()},g=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(o),1),console.log("Error loading image",g),d()})})})}afterPaintLayer(e,i){}prepareLayer(e){(!e.__host||!e.__host.canvas)&&(e instanceof ot||e instanceof en)&&this.createImageHost(e)}createImageHost(e){var i;const o=document.createElement("canvas");o.width=e.display.width,o.height=e.display.height,(i=o.getContext("2d"))==null||i.clearRect(0,0,e.display.width,e.display.height),e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:o,canvases:[],indices:[],loaded:[],loading:!1},Hc[e.id]=e.__host}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getViewportBounds(e,i,o){const l=e.getActiveZone();if(l){const u=i[3]-i[1]<l.points[3]-l.points[1],d=i[4]-i[2]<l.points[4]-l.points[2];return{x1:u?l.points[1]-o:l.points[1]+(l.points[3]-l.points[1])/2-(i[3]-i[1])/2,y1:d?l.points[2]-o:l.points[2]+(l.points[4]-l.points[2])/2-(i[4]-i[2])/2,x2:u?l.points[3]+o:l.points[1]+(l.points[3]-l.points[1])/2-(i[3]-i[1])/2,y2:d?l.points[4]+o:l.points[2]+(l.points[4]-l.points[2])/2-(i[4]-i[2])/2}}return null}pendingUpdate(){const e=!this.pendingDrawCall&&this.drawCalls.length===0&&this.imagesPending===0&&this.loadingQueue.length===0&&this.tasksRunning===0;return!this.firstMeaningfulPaint&&e?(this.canvas.style.opacity="1",this.firstMeaningfulPaint=e,!0):this.options.debug?!0:!e}getRendererScreenPosition(){return this.rendererPosition}}class Xo{constructor(e){this.renderers=[];for(const i of e)i&&this.renderers.push(i);this.length=this.renderers.length}afterFrame(e,i,o){for(let l=0;l<this.length;l++)this.renderers[l].afterFrame(e,i,o)}afterPaintLayer(e,i){for(let o=0;o<this.length;o++)this.renderers[o].afterPaintLayer(e,i)}beforeFrame(e,i,o){for(let l=0;l<this.length;l++)this.renderers[l].beforeFrame(e,i,o)}triggerResize(){for(let e=0;e<this.length;e++){const i=this.renderers[e];i.triggerResize&&i.triggerResize()}}getPointsAt(e,i,o,l){return this.renderers[0].getPointsAt(e,i,o,l)}getScale(e,i){return this.renderers[0].getScale(e,i)}getViewportBounds(e,i,o){return this.renderers[0].getViewportBounds(e,i,o)}getRendererScreenPosition(){return this.renderers[0].getRendererScreenPosition()}isReady(){for(let e=0;e<this.length;e++)if(!this.renderers[e].isReady())return!1;return!0}paint(e,i,o,l,u,d){for(let h=0;h<this.length;h++)this.renderers[h].paint(e,i,o,l,u,d)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e){for(let i=0;i<this.length;i++)this.renderers[i].prepareLayer(e)}resize(e,i){for(let o=0;o<this.length;o++)this.renderers[o].resize(e,i)}}class Wc{constructor(e){this.heightRatio=1,this.widthRatio=1,this.target=new Float32Array(5),this.delta=0,this.renderNextFrame=!0,this.canvas=e,this.initialWidth=e.width,this.initialHeight=e.height,this.context=e.getContext("2d"),this.context.globalAlpha=.5,this.aggregate=Ft(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,i,o){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const l=this.initialWidth/e.width,u=this.initialHeight/e.height,d=this.widthRatio>this.heightRatio?l:u;if(this.target=o,this.bounds){const h=e.getPointsAt(this.bounds,this.aggregate,d);for(const[g,p]of h)if(g instanceof ot&&g.__host.canvas){const m=p.length/5;for(let w=0;w<m;w++){const _=g.__host.canvas.canvases[w];if(_){const O={x1:p[w+1]*d,y1:p[w+2]*d,width:(p[w+3]-p[w+1])*d,height:(p[w+4]-p[w+2])*d};this.context.drawImage(_,O.x1,O.y1,O.width,O.height)}}}}e.getPoints().forEach((h,g,p)=>{if(g%5===0&&h){const m={x1:p[g+1]*d,y1:p[g+2]*d,x2:p[g+3]*d,y2:p[g+4]*d,width:(p[g+3]-p[g+1])*d,height:(p[g+4]-p[g+2])*d};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),o&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(o[1]*d,o[2]*d,(o[3]-o[1])*d,(o[4]-o[2])*d))}}getActiveZone(e){return null}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){return 1}beforeFrame(e,i){this.bounds=se.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,i){}paint(e,i,o,l,u,d){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,i,o){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}}var Yo=!1,tn,Wr,Qr,Ni,Ri,qo,zi,Xr,Yr,qr,Zo,Zr,Gr,Go,Ko;function He(){if(!Yo){Yo=!0;var r=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(r),i=/(Mac OS X)|(Windows)|(Linux)/.exec(r);if(Zr=/\b(iPhone|iP[ao]d)/.exec(r),Gr=/\b(iP[ao]d)/.exec(r),qr=/Android/i.exec(r),Go=/FBAN\/\w+;/i.exec(r),Ko=/Mobile/i.exec(r),Zo=!!/Win64/.exec(r),e){tn=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,tn&&document&&document.documentMode&&(tn=document.documentMode);var o=/(?:Trident\/(\d+.\d+))/.exec(r);qo=o?parseFloat(o[1])+4:tn,Wr=e[2]?parseFloat(e[2]):NaN,Qr=e[3]?parseFloat(e[3]):NaN,Ni=e[4]?parseFloat(e[4]):NaN,Ni?(e=/(?:Chrome\/(\d+\.\d+))/.exec(r),Ri=e&&e[1]?parseFloat(e[1]):NaN):Ri=NaN}else tn=Wr=Qr=Ri=Ni=NaN;if(i){if(i[1]){var l=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(r);zi=l?parseFloat(l[1].replace("_",".")):!0}else zi=!1;Xr=!!i[2],Yr=!!i[3]}else zi=Xr=Yr=!1}}var Kr={ie:function(){return He()||tn},ieCompatibilityMode:function(){return He()||qo>tn},ie64:function(){return Kr.ie()&&Zo},firefox:function(){return He()||Wr},opera:function(){return He()||Qr},webkit:function(){return He()||Ni},safari:function(){return Kr.webkit()},chrome:function(){return He()||Ri},windows:function(){return He()||Xr},osx:function(){return He()||zi},linux:function(){return He()||Yr},iphone:function(){return He()||Zr},mobile:function(){return He()||Zr||Gr||qr||Ko},nativeApp:function(){return He()||Go},android:function(){return He()||qr},ipad:function(){return He()||Gr}},Qc=Kr,Ai=!!(typeof window!="undefined"&&window.document&&window.document.createElement),Xc={canUseDOM:Ai,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:Ai&&!!(window.addEventListener||window.attachEvent),canUseViewport:Ai&&!!window.screen,isInWorker:!Ai},Yc=Xc,Jo=Yc,$o;Jo.canUseDOM&&($o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
39
|
+
*/var Ic=De.default,kc=Symbol.for("react.element"),Mc=Symbol.for("react.fragment"),Lc=Object.prototype.hasOwnProperty,Oc=Ic.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nc={key:!0,ref:!0,__self:!0,__source:!0};function Do(r,e,i){var o,l={},u=null,d=null;i!==void 0&&(u=""+i),e.key!==void 0&&(u=""+e.key),e.ref!==void 0&&(d=e.ref);for(o in e)Lc.call(e,o)&&!Nc.hasOwnProperty(o)&&(l[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps,e)l[o]===void 0&&(l[o]=e[o]);return{$$typeof:kc,type:r,key:u,ref:d,props:l,_owner:Oc.current}}Si.Fragment=Mc,Si.jsx=Do,Si.jsxs=Do,wi.exports=Si;const M=wi.exports.jsx,Te=wi.exports.jsxs,Et=wi.exports.Fragment,Ei=["onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onScroll","onWheel","onClick","onDragStart","onDragEnd","onDragEnter","onDragExit","onDrag","onDragOver"];function Rc(){return Ei.reduce((r,e)=>(r[e]=[],r),{})}const pn=Ei.reduce((r,e)=>(r[e.slice(2).toLowerCase()]=e,r[e]=e,r),{}),Nn=(r,e,i)=>{const o=r.length,l=i||G(o);for(let u=0;u<o;u++)l[u]=u%5===0?r[u+1]<e[3]&&r[u+3]>e[1]&&r[u+2]<e[4]&&r[u+4]>e[2]?1:0:r[u];return l};function G(r,e,i){return new Float32Array(r,e,i)}const zc=(r,e,i)=>{const o=r[1]<=e[3]&&r[3]>=e[1]&&r[2]<=e[4]&&r[4]>=e[2],l=i||G(5);return o?(l[0]=1,l[1]=Math.max(r[1],e[1]),l[2]=Math.max(r[2],e[2]),l[3]=Math.min(r[3],e[3]),l[4]=Math.min(r[4],e[4]),l):(l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l)},Ac=r=>r.length/5,xt=(r,e,i)=>{const o=i||G(9);return o[0]=r[0]*e[0]+r[1]*e[3]+r[2]*e[6],o[1]=r[0]*e[1]+r[1]*e[4]+r[2]*e[7],o[2]=r[0]*e[2]+r[1]*e[5]+r[2]*e[8],o[3]=r[3]*e[0]+r[4]*e[3]+r[5]*e[6],o[4]=r[3]*e[1]+r[4]*e[4]+r[5]*e[7],o[5]=r[3]*e[2]+r[4]*e[5]+r[5]*e[8],o[6]=r[6]*e[0]+r[7]*e[3]+r[8]*e[6],o[7]=r[6]*e[1]+r[7]*e[4]+r[8]*e[7],o[8]=r[6]*e[2]+r[7]*e[5]+r[8]*e[8],o};class se{constructor(e){this.index=0,this.length=e,this.points=G(this.length)}static grid(e=1,i=1){return new se(5*e*i)}static point(e,i){const o=G(5);return o[0]=1,o[1]=e,o[2]=i,o[3]=e,o[4]=i,o}static positionPair(e){const i=G(5);return i[0]=1,i[1]=e.x1,i[2]=e.y1,i[3]=e.x2,i[4]=e.y2,i}static projection(e){return se.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,i,o=0,l=0){const u=G(5);return u[0]=1,u[1]=o,u[2]=l,u[3]=e+o,u[4]=i+l,u}row(e){return e(this)}addPoints(e,i,o,l){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=i,this.points[3+this.index]=o,this.points[4+this.index]=l,this.index+=5,this}addBox(e,i,o,l){return this.addPoints(e,i,e+o,i+l),this}build(){return this.points}}const At=(r,e)=>{const i=r.length;for(let o=0;o<i;o++)r[o]=o%5===0?e[6]*r[o+1]+e[7]*r[o+2]+e[8]*r[o]:o%5%2===1?e[0]*r[o]+e[1]*r[o+1]+e[2]:e[3]*r[o-1]+e[4]*r[o]+e[5];return r},Ft=r=>{const e=G(9);return e[0]=r,e[4]=r,e[8]=1,e},Ke=(r,e)=>{const i=G(9);return i[0]=1,i[2]=r,i[4]=1,i[5]=e,i[8]=1,i},Rn=(r,e,i)=>xt(Ke((1-r)*e,(1-r)*i),Ft(r)),$t=(r,e,i)=>{const o=r.length,l=i&&i.length>=o?i.slice(0,o):G(o);for(let u=0;u<o;u++)l[u]=u%5===0?e[6]*r[u+1]+e[7]*r[u+2]+e[8]*r[u]:u%5%2===1?e[0]*r[u]+e[1]*r[u+1]+e[2]:e[3]*r[u-1]+e[4]*r[u]+e[5];return l};let Uo=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,i)=>(i&=63,i<36?e+=i.toString(36):i<62?e+=(i-26).toString(36).toUpperCase():i>62?e+="-":e+="_",e),"");class _t{constructor(){this.__revision=0,this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,i,o)=>{const l=pn[e];if(!this.eventHandlers[l])throw new Error(`Unknown event ${l}`);this.eventHandlers[l].indexOf(i)===-1&&this.eventHandlers[l].push(i)},this.removeEventListener=(e,i)=>{const o=pn[e];if(!this.eventHandlers[o]){console.warn(`Unknown event ${o}`);return}this.eventHandlers[o].indexOf(i)!==-1&&(this.eventHandlers[o]=this.eventHandlers[o].filter(l=>l!==i))},this.id=this.__id=Uo(),this.eventHandlers=Rc()}getObjectsAt(e){return[]}getAllPointsAt(e,i,o){return[]}getScheduledUpdates(e,i){return[]}dispatchEvent(e,i){const o=this.eventHandlers[e],l=o?o.length:0;let u=!1;if(l)for(let d=0;d<l;d++)try{o[d](i),u=!0}catch(h){console.error(e,h)}return u}get x(){return this.points[1]}get y(){return this.points[2]}get width(){return this.points[3]-this.points[1]}get height(){return this.points[4]-this.points[2]}translate(e,i){At(this.points,Ke(e,i))}atScale(e){At(this.points,Rn(e,this.x,this.y)),this.scale*=e}transform(e){At(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,i){}hideInstance(){}}class ot extends _t{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={scale:1,width:0,height:0,points:G(5)},this.points=G(5);else{const i=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=se.singleBox(e.width,e.height,e.x,e.y),this.display={scale:i,width:e.width/i,height:e.height/i,points:i!==1?se.singleBox(e.width/i,e.height/i):this.points}}}applyProps(e){const i=e.display?e.display.width:e.target.width,o=e.target.width/i;this.id=e.id||e.uri,this.uri=e.uri,this.points.set(se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity!="undefined"&&(this.style.opacity=e.style.opacity),this.display.scale=o,this.display.width=e.target.width/o,this.display.height=e.target.height/o,this.display.points=o!==1?se.singleBox(e.target.width/o,e.target.height/o):this.points}getAllPointsAt(e,i,o){return[[this,this.crop||this.points,i]]}static fromSvg(e,i,o,l){return ot.fromImage("data:image/svg+xml;base64,"+btoa(e),i,o,l)}static fromImage(e,i,o,l){const u=new ot;return u.applyProps({uri:e,id:l,display:o,target:i}),u}getImageUrl(){return this.uri}}class Vr extends _t{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={scale:1,width:0,height:0,points:G(5)},this.points=G(5);else{const i=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=se.singleBox(e.width,e.height),this.display={scale:i,width:e.width/i,height:e.height/i,points:i!==1?se.singleBox(e.width/i,e.height/i):this.points}}}applyProps(e){const i=e.display?e.display.width:e.target.width,o=e.target.width/i;this.id=e.id,this.points.set(se.singleBox(e.target.width,e.target.height)),this.display.scale=o,this.display.width=e.target.width/o,this.display.height=e.target.height/o,this.getTexture=e.getTexture,this.display.points=o!==1?se.singleBox(e.target.width/o,e.target.height/o):this.points}getAllPointsAt(e,i,o){return[[this,this.points,i]]}}function Fc(r,e,i=1){const o=e.length;if(o===0)throw new Error("No resources passed in.");let l=0;for(let u=0;u<o&&!(!e[u]||!e[u].display);u++)l=Math.abs(e[u].display.scale-r)*i<Math.abs(e[l].display.scale-r)?u:l;return l}function bo(r,e){return Math.abs(r-e)}function xi(r,e){const i=bo(r.x,e.x),o=bo(r.y,e.y);return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}function Dc(r){const e=r.length;return r.indexOf("/info.json")===e-10?r.slice(0,-10):r}class en extends _t{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.id=Dc(e.url),this.points=e.displayPoints?e.displayPoints:$t(e.points,Ft(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor}}applyProps(e){e.style&&typeof e.style.opacity!="undefined"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service)}static fromTile(e,i,o,l,u){o.height=o.height?o.height:o.width;const d=Math.ceil(i.width/l),h=Math.ceil(i.height/l),g=Math.ceil(d/o.width),p=Math.ceil(h/o.height),m=se.grid(g,p),S=se.grid(g,p);for(let O=0;O<p;O++)for(let R=0;R<g;R++){const N=R*o.width,I=O*o.height;S.addPoints(N*l,I*l,R===g-1?i.width:(N+o.width)*l,O===p-1?i.height:(I+o.height)*l),m.addPoints(N,I,R===g-1?d:N+o.width,O===p-1?h:I+o.height)}const x=new en({url:e,scaleFactor:l,points:m.build(),displayPoints:S.build(),width:i.width,height:i.height,tileWidth:o.width});return x.applyProps({service:u}),x}getImageUrl(e){const i=this.points.slice(e*5,e*5+5),o=i[3]-i[1],l=i[4]-i[2],u=Math.ceil(o/this.display.scale);return`${this.id}/${i[1]},${i[2]},${o},${l}/${u>this.tileWidth?this.tileWidth:u},/0/default.jpg`}getAllPointsAt(e,i,o){const l=Nn(this.points,e);return[[this,l,i]]}transform(e){At(this.points,e)}getScheduledUpdates(e,i){return[]}}class Uc extends _t{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,i,o){return[[this,this.points,i]]}}class bc extends Uc{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=G(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((o,l)=>l.display.width-o.display.width),this.images=[];let i=.1;for(const o of this.allImages){if(o.display.width<this.renderOptions.minSize&&o.display.height<this.renderOptions.minSize&&!o.priority||o instanceof ot&&(o.display.width>this.renderOptions.maxImageSize||o.display.height>this.renderOptions.maxImageSize)&&!o.priority)continue;if(Math.abs(o.display.scale-i)<.25||o.priority){const u=this.images.pop();u&&(u instanceof ot||u.priority)?(o.priority&&this.images.push(o),this.images.push(u)):o&&this.images.push(o)}else o&&this.images.push(o);i=o.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(o=>o.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const i=await this.lazyLoader();this.addImages(i)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=se.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={points:se.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions=B({renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.1},e.renderOptions||{}),this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback!="undefined"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers!="undefined"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize!="undefined"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize!="undefined"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality!="undefined"&&e.quality!==this.renderOptions.quality&&(this.renderOptions.quality=e.quality)}appendChild(e){this.addImages([e])}removeChild(e){this.images.indexOf(e)!==-1&&(this.images=this.images.filter(i=>i!==e),this.sortByScales())}insertBefore(e,i){this.addImages([e])}hideInstance(){}addImages(e){for(const i of e)i.__parent=this;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,i){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:i>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,i,o){if(this.images.length===0)return[];const l=Fc(1/(o||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),u=this.images.length,d=i?xt(i,Ke(this.x,this.y)):Ke(this.x,this.y);if(l!==this.images.length-1&&this.images[l+1]){let h=[];for(let m=u-1;m>=l;m--)h.push(m);const g=h[0];this.renderOptions.renderLayers&&(h=h.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&h.indexOf(g)===-1&&h.unshift(g);const p=[];for(let m=0;m<h.length;m++)p.push(...this.images[h[m]].getAllPointsAt(e,d,o));return p}return this.images[l].getAllPointsAt(e,d,o)}}class zn extends _t{constructor(e,i){super(),this.type="world-object",this.intersectionBuffer=G(5),this.aggregateBuffer=G(9),this.invertedBuffer=G(9),this._updatedList=[];const{x:o=0,y:l=0}=i||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=G([1,o,l,e.width,e.height]),this.worldPoints=G([1,o,l,e.width,e.height]),this.filteredPointsBuffer=G(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=G(5),this.worldPoints=G(5),this.filteredPointsBuffer=G(5))}static createWithProps(e){const i=new zn;return i.applyProps(e),i}applyProps(e){const i=e.x||0,o=e.y||0;this.id=e.id;const l=typeof e.scale!="undefined"?e.scale:this.scale;this.points[0]=1,this.points[1]=i,this.points[2]=o,this.points[3]=i+e.width,this.points[4]=o+e.height,this.worldPoints[3]=this.worldPoints[1]+e.width*l,this.worldPoints[4]=this.worldPoints[2]+e.height*l,e.scale&&e.scale!==1&&this.atScale(l),this.scale=l}appendChild(e){e.points[0]===0&&e.points.set(this.points),this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(i=>i!==e),this.filteredPointsBuffer=G(this.layers.length*5)}insertBefore(e,i){const o=this.layers.indexOf(i);if(o===-1||this.layers.indexOf(e)!==-1)return;const l=this.layers.slice(0,o-1),u=this.layers.slice(o);this.layers=[...l,e,...u]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,i){if(Nn(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const l=this.layers.length,u=[];for(let d=0;d<l;d++){const h=this.layers[d];if(Nn($t(h.points,Ke(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&u.push(h),i){const p=h;u.push(...p.getObjectsAt(e,i))}}return u}getAllPointsAt(e,i,o){const l=xt(Ke(this.x,this.y),Ft(this.scale),this.aggregateBuffer),u=zc(e,this.points,this.intersectionBuffer),d=this.layers.length,h=[],g=$t(u,xt(Ft(1/this.scale),Ke(-this.x,-this.y),this.invertedBuffer)),p=i?xt(i,l,this.aggregateBuffer):l,m=o*this.scale;for(let S=0;S<d;S++)h.push(...this.layers[S].getAllPointsAt(g,p,m));return h}addLayers(e){const i=[];for(const o of e)this.layers.indexOf(o)===-1&&(i.push(o),o.points.length===5&&(o.points[1]<this.worldPoints[1]/this.scale||o.points[2]<this.worldPoints[2]/this.scale||o.points[3]>this.worldPoints[3]/this.scale||o.points[4]>this.worldPoints[4]/this.scale)&&(o.crop=G([1,Math.max(this.worldPoints[1]/this.scale,o.points[1]),Math.max(this.worldPoints[2]/this.scale,o.points[2]),Math.min(this.worldPoints[3]/this.scale,o.points[3]),Math.min(this.worldPoints[4]/this.scale,o.points[4])])));this.layers=this.layers.concat(i),this.filteredPointsBuffer=G(this.layers.length*5)}getScheduledUpdates(e,i){const o=this.layers.length;this._updatedList=[];const l=i*this.scale;for(let u=0;u<o;u++){const d=this.layers[u].getScheduledUpdates(e,l);d&&this._updatedList.push(...d)}return this._updatedList}}class mn extends _t{constructor(e=0,i=0,o=100,l="left-to-right"){super(),this.id="world",this.aggregateBuffer=G(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=G(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=i,this.aspectRatio=Number.isNaN(e/i)?1:e/i,this.viewingDirection=l,this.points=G(o*5),this.filteredPointsBuffer=G(o*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const i=new mn;return i.applyProps(e),i}applyProps(e){typeof e.width!="undefined"&&typeof e.height!="undefined"&&(e.width!==this._width||e.height!==this._height)&&this.resize(e.width,e.height),e.viewingDirection!==this.viewingDirection&&(this.viewingDirection=e.viewingDirection,this.triggerRepaint())}propagateTouchEvent(e,i,o){const l=[];for(const u of o)if(u.x&&u.y){const d=se.singleBox(1,1,u.x,u.y);l.push(this.getObjectsAt(d,!0).reverse())}return l.map(u=>this.propagateEvent(e,i,u,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,i,o,l,u={}){const d=se.singleBox(1,1,o,l),h=this.getObjectsAt(d,!0).reverse();return this.propagateEvent(e,i,h,u)}propagateEvent(e,i,o,{bubbles:l=!1,cancelable:u=!1}={}){i.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let d=!1;i.stopPropagation=()=>{d=!0};const h=o.length;for(let m=h-1;m>=0;m--){this._propagateEventTargets.unshift(o[m][0]);const S=o[m][1].length;if(S)for(let x=0;x<S;x++)this._propagateEventTargets.unshift(o[m][1][x])}const g=this._propagateEventTargets.length;let p=!1;for(let m=0;m<g&&(i.atlasTarget=this._propagateEventTargets[m],i.atlasWorld=this,p=this._propagateEventTargets[m].dispatchEvent(e,i)||p,!d);m++);return p&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const i=this.appendWorldObject(e);this.renderOrder.push(i/5)}removeChild(e){const i=this.objects.indexOf(e);if(i===-1){for(const o of this.objects)if(o&&o.id===e.id){this.removeChild(o);return}return}this.objects[i]=null,this.renderOrder=this.renderOrder.filter(o=>o!==i),this.points[i*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,i){const o=this.objects.indexOf(i);if(o===-1)return;const l=this.appendWorldObject(e);this.renderOrder.splice(o-1,0,l/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const i=this.zones.length;for(let o=0;o<i;o++)if(this.zones[o].id===e){this.selectedZone=o,this.trigger("zone-changed");return}}else this.zones[e]&&(this.selectedZone=e,this.trigger("zone-changed"))}deselectZone(){this.selectedZone=void 0}getActiveZone(){if(this.selectedZone)return this.zones[this.selectedZone]}hasActiveZone(){return typeof this.selectedZone!="undefined"}checkResizeInternalBuffer(){if(Ac(this.points)===this.objects.length){const e=this.points,i=G(this.points.length*2);i.set(e,0),this.points=i}}appendWorldObject(e){this.checkResizeInternalBuffer();const i=this.objects.length*5,o=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=o[1],e.points[2]=o[2],e.points[3]=o[3],e.points[4]=o[4],this.objects.push(e),this.filteredPointsBuffer=G(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),i}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const i=new Int32Array(this.objects.length),o=new Int32Array(this.objects.length),l=this.renderOrder.length;for(let h=0;h<l;h++){const g=this.renderOrder[h];this.objects[g]&&(i[h]=this.points[g*5+3],o[h]=this.points[g*5+4])}const u=Math.max(...i);u!==this._width&&(this._width=u,e=!0);const d=Math.max(...o);d!==this._height&&(this._height=d,e=!0),e&&this.trigger("recalculate-world-size",{width:u,height:d}),this.needsRecalculate=!1}return e}addObjectAt(e,i){i.width&&!i.height?i.height=i.width/e.width*e.height:i.height&&!i.width&&(i.width=i.height/e.height*e.width),(!i||!i.width||!i.height)&&(i.width=e.width,i.height=e.height);const{width:o,x:l,y:u}=i,d=o/e.width;this.checkResizeInternalBuffer(),this.points.set(se.singleBox(e.width,e.height,0,0),this.objects.length*5);const h=new zn(e);return h.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(h),this.scaleWorldObject(this.objects.length-1,d),this.translateWorldObject(this.objects.length-1,l,u),this.filteredPointsBuffer=G(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,h}scaleWorldObject(e,i){At(this.points.subarray(e*5,e*5+5),Rn(i,this.points[e*5+1],this.points[e*5+2]));const o=this.objects[e];o&&(o.atScale(i),this.triggerRepaint())}translateWorldObject(e,i,o){At(this.points.subarray(e*5,e*5+5),Ke(i,o));const l=this.objects[e];l&&(l.translate(i,o),this.triggerRepaint())}resize(e,i){return this._width=e,this._height=i,this.aspectRatio=e/i,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,i){const o=se.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(o,i,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,i){const o=Nn(this.points,e,this.filteredPointsBuffer),l=this.objects.length;this._updatedList=[];for(let u=0;u<l;u++)if(o[u*5]!==0){if(!this.objects[u])continue;this._updatedList.push(...this.objects[u].getScheduledUpdates(e,i))}return this._updatedList}getObjectsAt(e,i=!1){const o=this.getActiveZone(),l=Nn(this.points,e,this.filteredPointsBuffer),u=this.renderOrder.length,d=[];for(let h=0;h<u;h++){const g=this.renderOrder[h];if(l[g*5]!==0){const p=this.objects[g];if(!p||o&&o.objects.indexOf(p)===-1)continue;if(p.type!=="world-object"){d.push([p,[p]]);continue}i?d.push([p,p.getObjectsAt(e,i)]):d.push([p,this.emptyPaintables])}}return d}getPointsAt(e,i,o=1){const l=this.getObjectsAt(e),u=xt(Ft(o),Ke(-e[1],-e[2]),this.translationBuffer),d=i?xt(i,u,this.aggregateBuffer):u,h=l.length,g=[];for(let p=0;p<h;p++)l[p]&&g.push(...l[p][0].getAllPointsAt(e,d,o));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let i=0;i<e;i++){if(this._alreadyFlushed.indexOf(this.triggerQueue[i][0])!==-1)continue;typeof this.triggerQueue[i][1]=="undefined"&&this._alreadyFlushed.push(this.triggerQueue[i][0]);const o=this.subscriptions.length;for(let l=0;l<o;l++)this.subscriptions[l].apply(null,this.triggerQueue[i])}this.triggerQueue=[]}}trigger(e,i){this.triggerQueue.push([e,i])}triggerEventActivation(){this.trigger("event-activation")}triggerRepaint(){this.trigger("repaint")}gotoRegion(e){this.trigger("goto-region",e)}goHome(e=!1){this.trigger("go-home",{immediate:e})}zoomTo(e,i,o){this.trigger("zoom-to",{point:i,factor:e,stream:o})}zoomIn(e){this.trigger("zoom-to",{point:e,factor:.5})}zoomOut(e){this.trigger("zoom-to",{point:e,factor:2})}constraintBounds(e){this.trigger("constrain-bounds",{immediate:e})}}const _i=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,Pi={},Bc=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class An extends _t{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={scale:1,width:-1,height:-1,points:G(5)},this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.addHover=()=>{this.hovering=!0,this.__revision++},this.removeHover=()=>{this.hovering=!1,this.pressing=!1,this.__revision++},this.addPress=()=>{this.pressing=!0,this.__revision++},this.removePress=()=>{this.pressing=!1,this.__revision++},this.id=Uo(12),this.points=G(5)}getAllPointsAt(e,i){return[[this,this.points,i]]}applyProps(e={}){let i=!1;if(e.interactive!==this.props.interactive&&(i=!0,this.props.interactive=e.interactive),e.style){const o=e.border||e.style.border;if(o!==this._parsed.border.id)if(!o)this._parsed.border.id=null,this._parsed.border.match=[];else{const l=Pi[o]||_i.exec(o)||_i.exec(o);l&&(this._parsed.border.id=o,this._parsed.border.match=Pi[o]=l)}if(this._parsed.border.id&&(e.style.borderWidth=this._parsed.border.match[1],e.style.borderStyle="solid",e.style.borderColor=this._parsed.border.match[4]),e.style.outline!==this._parsed.outline.id)if(!e.style.outline)this._parsed.outline.id=null,this._parsed.outline.match=[];else{const l=Pi[e.style.outline]||_i.exec(e.style.outline)||_i.exec(e.style.outline);l&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=Pi[e.style.outline]=l)}this._parsed.outline.id&&(e.style.outlineWidth=this._parsed.outline.match[1],e.style.outlineStyle="solid",e.style.outlineColor=this._parsed.outline.match[4]),this.props.style=e.style,e.backgroundColor&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.backgroundColor,i=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,i=!0);for(const l of Bc)if(this.props.style[l]!==e.style[l]){i=!0;break}e.style[":hover"]!==this.props.hoverStyles&&(this.props.hoverStyles=e.style[":hover"],this.hoverEvents||(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),i=!0),e.style[":active"]!==this.props.pressStyles&&(this.props.pressStyles=e.style[":active"],this.activeEvents||(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),i=!0)}e.href!==this.props.href&&(this.props.href=e.href,i=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,i=!0),e.title!==this.props.title&&(this.props.title=e.title,i=!0),e.className!==this.props.className&&(this.props.className=e.className,e.className&&!this.hoverEvents&&(this.hoverEvents=!0,this.addEventListener("pointerenter",this.addHover),this.addEventListener("pointerleave",this.removeHover)),e.className&&!this.activeEvents&&(this.activeEvents=!0,this.addEventListener("mousedown",this.addPress),this.addEventListener("mouseup",this.removePress)),i=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,i=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,i=!0),e.html!==this.props.html&&(this.props.html=e.html,i=!0),e.target&&(e.target.width!==this.display.width||e.target.height!==this.display.height||e.target.x!==this.points[1]||e.target.y!==this.points[2])&&(i=!0,this.points=se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=se.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.width=e.target.width,this.display.height=e.target.height),i&&this.__revision++}}class Ci extends _t{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={scale:1,width:100,height:100,points:G(5)},this.interactive=!1,this.props={font:"18px Arial, sans-serif",lineHeight:1,textAlign:"left",verticalAlign:"top",paddingX:0,paddingY:0,fitParent:!1,lineBreak:"auto",strokeText:!1,sizeToFill:!1,maxFontSizeToFill:void 0,allowNewLine:!0,justifyLines:!1,renderHDPI:!1,textDecoration:"none",interactive:!1,relativeSize:!1},this.id="",this.points=G(5)}getAllPointsAt(e,i){return[[this,this.points,i]]}applyProps(m){var S=m,{id:e,target:i,text:o,color:l,backgroundColor:u,fontSize:d=18,interactive:h,fontFamily:g="Arial, sans-serif"}=S,p=St(S,["id","target","text","color","backgroundColor","fontSize","interactive","fontFamily"]);p.font=`${d}px ${g}`,this.interactive=h||!1,typeof o!="undefined"&&(this.text=o||""),l&&(this.color=l),u&&(this.backgroundColor=u),e&&(this.id=e),i&&(this.points=se.singleBox(i.width,i.height,i.x,i.y),this.display.points=this.points,this.display.width=i.width,this.display.height=i.height),this.props=B(B({},this.props),p),this.__revision++}}const ye=Math.pow,Ti=Math.sqrt,Fn=Math.sin,Bo=Math.cos,Dn=Math.PI,Ii=1.70158,ki=Ii*1.525,jo=Ii+1,Ho=2*Dn/3,Vo=2*Dn/4.5,Mi=function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},Dt={linear:r=>r,easeInQuad:function(r){return r*r},easeOutQuad:function(r){return 1-(1-r)*(1-r)},easeInOutQuad:function(r){return r<.5?2*r*r:1-ye(-2*r+2,2)/2},easeInCubic:function(r){return r*r*r},easeOutCubic:function(r){return 1-ye(1-r,3)},easeInOutCubic:function(r){return r<.5?4*r*r*r:1-ye(-2*r+2,3)/2},easeInQuart:function(r){return r*r*r*r},easeOutQuart:function(r){return 1-ye(1-r,4)},easeInOutQuart:function(r){return r<.5?8*r*r*r*r:1-ye(-2*r+2,4)/2},easeInQuint:function(r){return r*r*r*r*r},easeOutQuint:function(r){return 1-ye(1-r,5)},easeInOutQuint:function(r){return r<.5?16*r*r*r*r*r:1-ye(-2*r+2,5)/2},easeInSine:function(r){return 1-Bo(r*Dn/2)},easeOutSine:function(r){return Fn(r*Dn/2)},easeInOutSine:function(r){return-(Bo(Dn*r)-1)/2},easeInExpo:function(r){return r===0?0:ye(2,10*r-10)},easeOutExpo:function(r){return r===1?1:1-ye(2,-10*r)},easeInOutExpo:function(r){return r===0?0:r===1?1:r<.5?ye(2,20*r-10)/2:(2-ye(2,-20*r+10))/2},easeInCirc:function(r){return 1-Ti(1-ye(r,2))},easeOutCirc:function(r){return Ti(1-ye(r-1,2))},easeInOutCirc:function(r){return r<.5?(1-Ti(1-ye(2*r,2)))/2:(Ti(1-ye(-2*r+2,2))+1)/2},easeInBack:function(r){return jo*r*r*r-Ii*r*r},easeOutBack:function(r){return 1+jo*ye(r-1,3)+Ii*ye(r-1,2)},easeInOutBack:function(r){return r<.5?ye(2*r,2)*((ki+1)*2*r-ki)/2:(ye(2*r-2,2)*((ki+1)*(r*2-2)+ki)+2)/2},easeInElastic:function(r){return r===0?0:r===1?1:-ye(2,10*r-10)*Fn((r*10-10.75)*Ho)},easeOutElastic:function(r){return r===0?0:r===1?1:ye(2,-10*r)*Fn((r*10-.75)*Ho)+1},easeInOutElastic:function(r){return r===0?0:r===1?1:r<.5?-(ye(2,20*r-10)*Fn((20*r-11.125)*Vo))/2:ye(2,-20*r+10)*Fn((20*r-11.125)*Vo)/2+1},easeInBounce:function(r){return 1-Mi(1-r)},easeOutBounce:Mi,easeInOutBounce:function(r){return r<.5?(1-Mi(1-2*r))/2:(1+Mi(2*r-1))/2}};class jc{constructor(e){this.runtime=e,this.pendingTransition={from:G(5),to:G(5),elapsed_time:0,done:!0,total_time:0,timingFunction:Dt.easeInOutQuad,constrain:!1}}hasPending(){return!this.pendingTransition.done}getPendingTransition(){return this.pendingTransition}getPendingFrom(){return this.pendingTransition.from}customTransition(e){e(this.pendingTransition)}stopTransition(){this.pendingTransition.from=G(this.runtime.target),this.pendingTransition.to=G(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,i){if(!this.pendingTransition.done){const o=this.pendingTransition,l=o.total_time===0?0:(o.elapsed_time+i)/o.total_time,u=o.total_time===0?1:l===0?0:o.timingFunction(l);e[1]=o.from[1]+(o.to[1]-o.from[1])*u,e[2]=o.from[2]+(o.to[2]-o.from[2])*u,e[3]=o.from[3]+(o.to[3]-o.from[3])*u,e[4]=o.from[4]+(o.to[4]-o.from[4])*u,this.pendingTransition.elapsed_time+=i,this.pendingTransition.elapsed_time>=this.pendingTransition.total_time&&(this.pendingTransition.done=!0,this.pendingTransition.constrain&&this.constrainBounds({transition:{duration:this.pendingTransition.total_time===0?0:500,easing:Dt.easeOutExpo}}))}}zoomTo(e,{origin:i,stream:o=!1,transition:l}={}){const u=this.runtime.getZoomedPosition(e,{origin:i}),d=Math.abs(1-e);this.applyTransition(u,l,{duration:2e3*d,easing:Dt.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:i=0}={}){const[o,l]=this.runtime.constrainBounds(this.runtime.target,{panPadding:i});o&&(this.applyTransition(l,e,{duration:500,easing:Dt.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,i,o,{stream:l}={}){this.pendingTransition.from=G(this.runtime.target),this.pendingTransition.to=e,l||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(i==null?void 0:i.duration)!="undefined"?i.duration:typeof(o==null?void 0:o.duration)!="undefined"?o.duration:1e3,this.pendingTransition.constrain=typeof(i==null?void 0:i.constrain)!="undefined"?i.constrain:typeof(o==null?void 0:o.constrain)!="undefined"?o.constrain:!1,this.pendingTransition.timingFunction=(i==null?void 0:i.easing)||(o==null?void 0:o.easing)||Dt.easeInOutSine}goToRegion(e,{transition:i}={}){const o=this.runtime.clampRegion(e);this.applyTransition(se.singleBox(o.width,o.height,o.x,o.y),i,{duration:1e3,easing:Dt.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class Li{constructor(e,i,o,l=[],u){this.ready=!1,this.transformBuffer=G(500),this.lastTarget=G(5),this.zoomBuffer=G(5),this.logNextRender=!1,this.pendingUpdate=!0,this.firstRender=!0,this.mode="explore",this.controllers=[],this.controllersRunning=!1,this.controllerStopFunctions=[],this.maxScaleFactor=1,this._viewerToWorld={x:0,y:0},this._lastGoodScale=1,this.hooks={useFrame:[],useBeforeFrame:[],useAfterPaint:[],useAfterFrame:[]},this._viewport={x:0,y:0,width:0,height:0},this.setViewport=d=>{const h=typeof d.x=="undefined"?this.target[1]:d.x,g=typeof d.y=="undefined"?this.target[2]:d.y;d.width?this.target[3]=h+d.width:this.target[3]=this.target[3]-this.target[1]+h,d.height?this.target[4]=g+d.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-h)>.01&&(this.target[1]=h),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=d=>{const h=d-this.lastTime;if(this.fpsLimit&&h<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=d,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",h);const g=this.pendingUpdate,p=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,h),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!p&&this.target[0]===this.lastTarget[0]&&this.target[1]===this.lastTarget[1]&&this.target[2]===this.lastTarget[2]&&this.target[3]===this.lastTarget[3]&&this.target[4]===this.lastTarget[4])return;this.hook("useBeforeFrame",h),this.renderer.beforeFrame(this.world,h,this.target);const m=this.getScaleFactor(),S=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),x=S.length;for(let N=0;N<x;N++){const I=S[N][0],k=S[N][1],P=S[N][2];this.renderer.prepareLayer(I);const j=P?$t(k,P,this.transformBuffer):k,V=j.length/5;for(let W=0;W<V;W++){const Q=W*5;j[Q]!==0&&(this.renderer.paint(I,W,j[Q+1],j[Q+2],j[Q+3]-j[Q+1],j[Q+4]-j[Q+2]),this.hook("useAfterPaint",I))}}this.renderer.afterFrame(this.world,h,this.target),this.hook("useAfterFrame",h),this.lastTarget[0]=this.target[0],this.lastTarget[1]=this.target[1],this.lastTarget[2]=this.target[2],this.lastTarget[3]=this.target[3],this.lastTarget[4]=this.target[4],this.firstRender=!1,this.pendingUpdate=!1,this.logNextRender=!1,this.renderer.isReady()&&(this.ready=!0,this.world.trigger("ready")),this.world.flushSubscriptions();const O=this.world.getScheduledUpdates(this.target,m),R=O.length;if(R>0)for(let N=0;N<R;N++){const I=O[R-N-1]();I?I.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=i,this.options=B({maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5},u||{}),this.target=se.projection(o),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=se.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new jc(this),this.aggregate=Ft(1),this.world.addLayoutSubscriber(d=>{d==="repaint"&&(this.pendingUpdate=!0),d==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=l,this.render(this.lastTime),this.startControllers()}get x(){return this.target[1]}set x(e){this.target[1]=e}get y(){return this.target[2]}set y(e){this.target[2]=e}get x2(){return this.target[3]}set x2(e){this.target[3]=e}get y2(){return this.target[4]}set y2(e){this.target[4]=e}get width(){return this.target[3]-this.target[1]}set width(e){this.target[3]=this.target[1]+e}get height(){return this.target[4]-this.target[2]}set height(e){this.target[4]=this.target[2]=e}setHomePosition(e){this.homePosition.set(se.projection(e||this.world)),this.pendingUpdate=!0}startControllers(){if(!this.controllersRunning){for(const e of this.controllers)this.controllerStopFunctions.push(e.start(this));this.controllersRunning=!0}}stopControllers(){if(!!this.controllersRunning){for(const e of this.controllerStopFunctions)e();this.controllersRunning=!1,this.controllerStopFunctions=[]}}updateControllerPosition(){for(const e of this.controllers)e.updatePosition(this.x,this.y,this.width,this.height)}triggerResize(){this.renderer.triggerResize&&this.renderer.triggerResize(),this.pendingUpdate=!0}addController(e){this.controllers.push(e),this.controllersRunning&&e.start(this),this.pendingUpdate=!0}cover(){return this.goHome({cover:!0})}getRendererScreenPosition(){return this.renderer.getRendererScreenPosition()}updateRendererScreenPosition(){this.pendingUpdate=!0,this.renderer.resize()}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const i=this.getScaleFactor(),o=e.position?{x:e.position[1],y:e.position[2],width:e.position[3]-e.position[1],height:e.position[4]-e.position[2]}:{x:this.homePosition[1],y:this.homePosition[2],width:this.homePosition[3]-this.homePosition[1],height:this.homePosition[4]-this.homePosition[2]},l=this.width*i,u=this.height*i,d=o.width/l,h=o.height/u,g=l/u;if(e.cover?d>h:d<h){const p=g*o.height,m=(p-o.width)/2;this.target[1]=-m+o.x,this.target[2]=o.y,this.target[3]=p-m+o.x,this.target[4]=o.height+o.y}else{const p=o.width/g,m=(p-o.height)/2;this.target[1]=o.x,this.target[2]=o.y-m,this.target[3]=o.x+o.width,this.target[4]=o.y+p-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,i,o,l){this.updateFocalPosition(e-i,o-l);const u=i/e,d=l/o;this.target[3]=this.target[1]+(this.target[3]-this.target[1])*u,this.target[4]=this.target[2]+(this.target[4]-this.target[2])*d,this.goHome({position:this.focalPosition}),this.renderer.resize(i,l),this.pendingUpdate=!0}updateFocalPosition(e,i){if(!this.manualFocalPosition){const o=this.width,l=this.height,u=Math.min(o,l),d=0,h=0,g=this.x+d,p=this.y+h;if(o<l){const m=this.height-this.width;this.focalPosition=se.projection({x:g,y:p+m/2,width:u-d*2,height:u-h*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=se.projection({x:g+m/2,y:p,width:u-d*2,height:u-h*2}),this.pendingUpdate=!0}}}getViewport(){return this._viewport.x=this.target[1],this._viewport.y=this.target[2],this._viewport.width=this.target[3]-this.target[1],this._viewport.height=this.target[4]-this.target[2],this._viewport}constrainBounds(e,{panPadding:i=0,ref:o=!1}={}){const{minX:l,maxX:u,minY:d,maxY:h}=this.getBounds({target:e,padding:i});let g=!1;const p=o?e:G(e),m=e[3]-e[1],S=e[4]-e[2];return l>e[1]&&(g=!0,p[1]=l,p[3]=l+m),d>e[2]&&(g=!0,p[2]=d,p[4]=d+S),u<e[1]&&(g=!0,p[1]=u,p[3]=u+m),h<e[2]&&(g=!0,p[2]=h,p[4]=h+S),[g,p]}getBounds(e){const i=e.target||this.target,o=e.padding,l=this.options.visibilityRatio,u=Math.abs(1-l);if(this.world.hasActiveZone()){const P=this.world.getActiveZone();if(P){const j=i[3]-i[1]<P.points[3]-P.points[1],V=i[4]-i[2]<P.points[4]-P.points[2];return{minX:j?P.points[1]-o:P.points[1]+(P.points[3]-P.points[1])/2-(i[3]-i[1])/2,maxX:V?P.points[2]-o:P.points[2]+(P.points[4]-P.points[2])/2-(i[4]-i[2])/2,minY:j?P.points[3]+o:P.points[1]+(P.points[3]-P.points[1])/2-(i[3]-i[1])/2,maxY:V?P.points[4]+o:P.points[2]+(P.points[4]-P.points[2])/2-(i[4]-i[2])/2}}}const d=i[3]-i[1],h=this.world.width,g=-d*u,p=h-d-g,m=i[4]-i[2],S=this.world.height,x=-m*u,O=S-m-x,R=Math.max(g,p),N=Math.min(g,p),I=Math.max(x,O),k=Math.min(x,O);return{minX:N,maxX:R,minY:k,maxY:I}}getScaleFactor(e=!1){const i=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return i===0?this._lastGoodScale:(this._lastGoodScale=i,i)}getZoomedPosition(e,{origin:i,fromPos:o}){var l;const u=o?{width:o[3]-o[1],height:o[4]-o[2]}:void 0,d=u?this.renderer.getScale(u.width,u.height):this.getScaleFactor(),h=u?u.width:this.width,g=u?u.height:this.height,p=(l=this.getRendererScreenPosition())==null?void 0:l.width,m=this.world.width,S=p?p/m:1,x=this.options.maxUnderZoom,O=Math.max(S||1,this.options.maxOverZoom),R=1/e,N=d*R;if(R<1){const P=h*d,j=g*d,V=this.world.width/P,W=this.world.height/j;if(V>W){const Q=this.world.width*N,q=~~(h*d)*x;Q<q&&(e=this.world.width*d/(h*d*x))}else{const Q=this.world.height*N,q=~~(g*d)*x;Q<q&&(e=this.world.height*d/(g*d*x))}}else N>1&&(e=d/O);const k=$t(this.target,Rn(e,i?i.x:this.target[1]+(this.target[3]-this.target[1])/2,i?i.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(k,{ref:!0,panPadding:100}),k}clampRegion({x:e,y:i,width:o,height:l,padding:u=0}){const d=this.width,h=this.height,g=o/d<l/h,p=e-u,m=i-u,S=o+u*2,x=l+u*2;if(g){const R=x/h*d;return{x:p-(R-S)/2,y:m,width:R,height:x}}const O=S/d*h;return{x:p,y:m-(O-x)/2,width:S,height:O}}viewerToWorld(e,i){const o=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/o,this._viewerToWorld.y=this.target[2]+i/o,this._viewerToWorld}worldToViewer(e,i,o,l){const u=se.singleBox(o,l,e,i);return At(u,xt(Ft(this.getScaleFactor()),Ke(-this.target[1],-this.target[2]))),{x:u[1],y:u[2],width:u[3]-u[1],height:u[4]-u[2],strand:u}}setScale(e,i){At(this.target,Rn(e,i?i.x:this.target[1]+(this.target[3]-this.target[1])/2,i?i.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const i=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=i}}stop(){return typeof this.stopId!="undefined"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,i){const o=this.hooks[e].length;if(o!==0)for(let l=0;l<o;l++)this.hooks[e][l](i)}registerHook(e,i){return this.hooks[e].push(i),()=>{this.hooks[e]=this.hooks[e].filter(o=>o!==i)}}updateNextFrame(){this.pendingUpdate=!0}}const Wo=/(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)(-?[0-9]+(px|em)\s+|0\s+)?(-?[0-9]+(px|em)\s+|0\s+)?(.*)/g,Qo={},Oi={},Hc={};class Vc{constructor(e,i){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=3,this.loadingQueueOrdered=!0,this.loadingQueue=[],this.currentTask=Promise.resolve(),this.tasksRunning=0,this.averageJobTime=1e3,this.lastKnownScale=1,this.visible=[],this.previousVisible=[],this.drawCalls=[],this._worker=()=>{if(this.loadingQueue.length&&this.tasksRunning<this.parallelTasks&&this.frameTasks<this.parallelTasks){const o=this.loadingQueue.pop();o&&(this.tasksRunning++,this.frameTasks++,this.currentTask=o.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{(this.frameIsRendering||this.loadingQueue.length===0&&this.tasksRunning===0&&this._scheduled)&&(clearInterval(this._scheduled),this._scheduled=0),this._worker()},this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.ctx=e.getContext("2d",{alpha:!1}),this.ctx.imageSmoothingEnabled=!0,this.options=i||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(i==null?void 0:i.dpi)||1}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}resize(){this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return this.firstMeaningfulPaint}afterFrame(e){if(this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((i,o)=>i.scale===o.scale?o.distance-i.distance:i.scale<o.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall){const i=this.drawCalls.shift();i&&i()}this.doOffscreenWork(),this.options.debug&&this.stats&&this.stats.end()}doOffscreenWork(){this.frameTasks=0,this.loadingQueue.length&&(this._worker(),this.loadingQueue.length&&this.tasksRunning<this.parallelTasks&&(this._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,i,o){if(Number.isNaN(e)||Number.isNaN(i))return this.lastKnownScale;const l=this.getCanvasDims(),u=l.width/e,d=l.height/i,h=(u<d?d:u)*(o&&this.dpi||1);return Number.isNaN(h)||(this.lastKnownScale=h),this.lastKnownScale}beforeFrame(e,i,o){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(i);const l=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,l.width,l.height)}paint(e,i,o,l,u,d){const h=this.ctx.globalAlpha;if(e instanceof ot||e instanceof en){if(this.visible.push(e),typeof e.style&&e.style.opacity!=="undefined"){if(!e.style.opacity)return;this.ctx.globalAlpha=e.style.opacity}try{const g=e.__host.canvas,p=this.getCanvasDims();if(g.indices.indexOf(i)===-1&&this.schedulePaintToCanvas(g,e,i,xi({x:o+u/2,y:l+u/2},{x:p.width/2,y:p.height/2})),!this.firstMeaningfulPaint)return;const m=g.canvases[i];m&&(e.crop?e.crop[0]&&this.ctx.drawImage(m,e.display.points[i*5+1]-e.crop[i*5+1],e.display.points[i*5+2]-e.crop[i*5+2],e.crop[i*5+3]-e.crop[i*5+1]-1,e.crop[i*5+4]-e.crop[i*5+2]-1,o,l,u+Number.MIN_VALUE,d+Number.MIN_VALUE):this.ctx.drawImage(m,0,0,e.display.points[i*5+3]-e.display.points[i*5+1]-1,e.display.points[i*5+4]-e.display.points[i*5+2]-1,o,l,u+Number.MIN_VALUE,d+Number.MIN_VALUE))}catch{}}if(this.options.box&&e instanceof An&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const g=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),p=e.props.relativeStyle?1:u/e.width;typeof g.opacity!="undefined"&&(this.ctx.globalAlpha=g.opacity);let m=0;typeof g.borderWidth!="undefined"&&(m=parseInt(g.borderWidth,10)*p);let S=0;typeof g.outlineWidth!="undefined"&&(S=parseInt(g.outlineWidth,10)*p);let x=0;if(typeof g.outlineOffset!="undefined"&&(x=parseInt(g.outlineOffset,10)*p),g.borderColor&&(this.ctx.strokeStyle=g.borderColor),g.boxShadow){const O=g.boxShadow.split(/,(?![^(]*\))/);for(const R of O){const N=Qo[R]||Wo.exec(R)||Wo.exec(R);Qo[R]=N,N&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(N[1])*this.dpi*p,this.ctx.shadowOffsetY=parseInt(N[3])*this.dpi*p,this.ctx.shadowBlur=parseInt(N[5])*this.dpi*p,this.ctx.shadowColor=N[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(o+m,l+m,u,d),this.ctx.restore())}}this.ctx.fillStyle=g.backgroundColor||"transparent",this.ctx.lineWidth=m,m&&this.ctx.strokeRect(o+m/2,l+m/2,u+m,d+m),this.ctx.fillRect(o+m,l+m,u,d),S&&(g.outlineColor&&(this.ctx.strokeStyle=g.outlineColor),this.ctx.lineWidth=S,this.ctx.strokeRect(o-S/2-x,l-S/2-x,u+m*2+S+x*2,d+m*2+S+x*2))}this.ctx.globalAlpha=h}}loadImage(e,i,o){if(Oi[e]&&Oi[e].naturalWidth>0){i(Oi[e]);return}try{const l=document.createElement("img");l.decoding="auto",l.onload=function(){i(l),Oi[e]=l,l.onload=null},this.options.crossOrigin&&(l.crossOrigin="anonymous"),l.src=e}catch(l){o(l)}}schedulePaintToCanvas(e,i,o,l){this.imagesPending++,e.indices.push(o),e.canvases[o]=document.createElement("canvas"),i.__host.canvas.loading=!0;const u=`${i.id}--${i.display.scale}`;this.loadingQueueOrdered=!1,this.loadingQueue.push({id:u,scale:i.display.scale,distance:l,task:()=>new Promise(d=>{if(this.visible.indexOf(i)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(o),1),d();return}const h=i.getImageUrl(o);this.loadImage(h,g=>{this.loadingQueue.push({id:u,scale:i.display.scale,distance:l,task:()=>new Promise(p=>{this.imagesLoaded++,e.loaded.push(o),e.loaded.length===e.indices.length&&(e.loading=!1);const m=i.display.points.slice(o*5,o*5+5),S=e.canvases[o],x=S.getContext("2d");S.width=m[3]-m[1],S.height=m[4]-m[2],this.drawCalls.push(()=>{x.drawImage(g,0,0,m[3]-m[1],m[4]-m[2]),p()})})}),d()},g=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(o),1),console.log("Error loading image",g),d()})})})}afterPaintLayer(e,i){}prepareLayer(e){(!e.__host||!e.__host.canvas)&&(e instanceof ot||e instanceof en)&&this.createImageHost(e)}createImageHost(e){var i;const o=document.createElement("canvas");o.width=e.display.width,o.height=e.display.height,(i=o.getContext("2d"))==null||i.clearRect(0,0,e.display.width,e.display.height),e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:o,canvases:[],indices:[],loaded:[],loading:!1},Hc[e.id]=e.__host}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getViewportBounds(e,i,o){const l=e.getActiveZone();if(l){const u=i[3]-i[1]<l.points[3]-l.points[1],d=i[4]-i[2]<l.points[4]-l.points[2];return{x1:u?l.points[1]-o:l.points[1]+(l.points[3]-l.points[1])/2-(i[3]-i[1])/2,y1:d?l.points[2]-o:l.points[2]+(l.points[4]-l.points[2])/2-(i[4]-i[2])/2,x2:u?l.points[3]+o:l.points[1]+(l.points[3]-l.points[1])/2-(i[3]-i[1])/2,y2:d?l.points[4]+o:l.points[2]+(l.points[4]-l.points[2])/2-(i[4]-i[2])/2}}return null}pendingUpdate(){const e=!this.pendingDrawCall&&this.drawCalls.length===0&&this.imagesPending===0&&this.loadingQueue.length===0&&this.tasksRunning===0;return!this.firstMeaningfulPaint&&e?(this.canvas.style.opacity="1",this.firstMeaningfulPaint=e,!0):this.options.debug?!0:!e}getRendererScreenPosition(){return this.rendererPosition}}class Xo{constructor(e){this.renderers=[];for(const i of e)i&&this.renderers.push(i);this.length=this.renderers.length}afterFrame(e,i,o){for(let l=0;l<this.length;l++)this.renderers[l].afterFrame(e,i,o)}afterPaintLayer(e,i){for(let o=0;o<this.length;o++)this.renderers[o].afterPaintLayer(e,i)}beforeFrame(e,i,o){for(let l=0;l<this.length;l++)this.renderers[l].beforeFrame(e,i,o)}triggerResize(){for(let e=0;e<this.length;e++){const i=this.renderers[e];i.triggerResize&&i.triggerResize()}}getPointsAt(e,i,o,l){return this.renderers[0].getPointsAt(e,i,o,l)}getScale(e,i){return this.renderers[0].getScale(e,i)}getViewportBounds(e,i,o){return this.renderers[0].getViewportBounds(e,i,o)}getRendererScreenPosition(){return this.renderers[0].getRendererScreenPosition()}isReady(){for(let e=0;e<this.length;e++)if(!this.renderers[e].isReady())return!1;return!0}paint(e,i,o,l,u,d){for(let h=0;h<this.length;h++)this.renderers[h].paint(e,i,o,l,u,d)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e){for(let i=0;i<this.length;i++)this.renderers[i].prepareLayer(e)}resize(e,i){for(let o=0;o<this.length;o++)this.renderers[o].resize(e,i)}}class Wc{constructor(e){this.heightRatio=1,this.widthRatio=1,this.target=new Float32Array(5),this.delta=0,this.renderNextFrame=!0,this.canvas=e,this.initialWidth=e.width,this.initialHeight=e.height,this.context=e.getContext("2d"),this.context.globalAlpha=.5,this.aggregate=Ft(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,i,o){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const l=this.initialWidth/e.width,u=this.initialHeight/e.height,d=this.widthRatio>this.heightRatio?l:u;if(this.target=o,this.bounds){const h=e.getPointsAt(this.bounds,this.aggregate,d);for(const[g,p]of h)if(g instanceof ot&&g.__host.canvas){const m=p.length/5;for(let S=0;S<m;S++){const x=g.__host.canvas.canvases[S];if(x){const O={x1:p[S+1]*d,y1:p[S+2]*d,width:(p[S+3]-p[S+1])*d,height:(p[S+4]-p[S+2])*d};this.context.drawImage(x,O.x1,O.y1,O.width,O.height)}}}}e.getPoints().forEach((h,g,p)=>{if(g%5===0&&h){const m={x1:p[g+1]*d,y1:p[g+2]*d,x2:p[g+3]*d,y2:p[g+4]*d,width:(p[g+3]-p[g+1])*d,height:(p[g+4]-p[g+2])*d};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),o&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(o[1]*d,o[2]*d,(o[3]-o[1])*d,(o[4]-o[2])*d))}}getActiveZone(e){return null}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){return 1}beforeFrame(e,i){this.bounds=se.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,i){}paint(e,i,o,l,u,d){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,i,o){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}}var Yo=!1,tn,Wr,Qr,Ni,Ri,qo,zi,Xr,Yr,qr,Zo,Zr,Gr,Go,Ko;function He(){if(!Yo){Yo=!0;var r=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(r),i=/(Mac OS X)|(Windows)|(Linux)/.exec(r);if(Zr=/\b(iPhone|iP[ao]d)/.exec(r),Gr=/\b(iP[ao]d)/.exec(r),qr=/Android/i.exec(r),Go=/FBAN\/\w+;/i.exec(r),Ko=/Mobile/i.exec(r),Zo=!!/Win64/.exec(r),e){tn=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,tn&&document&&document.documentMode&&(tn=document.documentMode);var o=/(?:Trident\/(\d+.\d+))/.exec(r);qo=o?parseFloat(o[1])+4:tn,Wr=e[2]?parseFloat(e[2]):NaN,Qr=e[3]?parseFloat(e[3]):NaN,Ni=e[4]?parseFloat(e[4]):NaN,Ni?(e=/(?:Chrome\/(\d+\.\d+))/.exec(r),Ri=e&&e[1]?parseFloat(e[1]):NaN):Ri=NaN}else tn=Wr=Qr=Ri=Ni=NaN;if(i){if(i[1]){var l=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(r);zi=l?parseFloat(l[1].replace("_",".")):!0}else zi=!1;Xr=!!i[2],Yr=!!i[3]}else zi=Xr=Yr=!1}}var Kr={ie:function(){return He()||tn},ieCompatibilityMode:function(){return He()||qo>tn},ie64:function(){return Kr.ie()&&Zo},firefox:function(){return He()||Wr},opera:function(){return He()||Qr},webkit:function(){return He()||Ni},safari:function(){return Kr.webkit()},chrome:function(){return He()||Ri},windows:function(){return He()||Xr},osx:function(){return He()||zi},linux:function(){return He()||Yr},iphone:function(){return He()||Zr},mobile:function(){return He()||Zr||Gr||qr||Ko},nativeApp:function(){return He()||Go},android:function(){return He()||qr},ipad:function(){return He()||Gr}},Qc=Kr,Ai=!!(typeof window!="undefined"&&window.document&&window.document.createElement),Xc={canUseDOM:Ai,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:Ai&&!!(window.addEventListener||window.attachEvent),canUseViewport:Ai&&!!window.screen,isInWorker:!Ai},Yc=Xc,Jo=Yc,$o;Jo.canUseDOM&&($o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
40
40
|
* Checks if an event is supported in the current execution environment.
|
|
41
41
|
*
|
|
42
42
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
@@ -49,7 +49,7 @@ No matching component was found for:
|
|
|
49
49
|
* @return {boolean} True if the event is supported.
|
|
50
50
|
* @internal
|
|
51
51
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
52
|
-
*/function qc(r,e){if(!Jo.canUseDOM||e&&!("addEventListener"in document))return!1;var i="on"+r,o=i in document;if(!o){var l=document.createElement("div");l.setAttribute(i,"return;"),o=typeof l[i]=="function"}return!o&&$o&&r==="wheel"&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var Zc=qc,Gc=Qc,Kc=Zc,el=10,tl=40,nl=800;function il(r){var e=0,i=0,o=0,l=0;return"detail"in r&&(i=r.detail),"wheelDelta"in r&&(i=-r.wheelDelta/120),"wheelDeltaY"in r&&(i=-r.wheelDeltaY/120),"wheelDeltaX"in r&&(e=-r.wheelDeltaX/120),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=i,i=0),o=e*el,l=i*el,"deltaY"in r&&(l=r.deltaY),"deltaX"in r&&(o=r.deltaX),(o||l)&&r.deltaMode&&(r.deltaMode==1?(o*=tl,l*=tl):(o*=nl,l*=nl)),o&&!e&&(e=o<1?-1:1),l&&!i&&(i=l<1?-1:1),{spinX:e,spinY:i,pixelX:o,pixelY:l}}il.getEventType=function(){return Gc.firefox()?"DOMMouseScroll":Kc("wheel")?"wheel":"mousewheel"};var Jc=il,$c=Jc;function ed(r){return{x:r[1],y:r[2],width:r[3]-r[1],height:r[4]-r[2]}}const td={zoomOutFactor:.8,zoomInFactor:1.25,maxZoomFactor:1,minZoomFactor:.05,zoomDuration:300,zoomWheelConstant:20,zoomClamp:.6,panBounceStiffness:120,panBounceDamping:15,panTimeConstant:240,panPower:.1,nudgeDistance:100,panPadding:0,devicePixelRatio:1,enableWheel:!0,enableClickToZoom:!1,onPanInSketchMode:()=>{}},rl=(r={})=>({start:function(e){const{zoomWheelConstant:i,enableWheel:o,enableClickToZoom:l}=B(B({},td),r),u={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:G(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function d(){e.world.constraintBounds(),p=0}function h(I){if(I.which>1){u.isPressing=!1;return}e.mode==="explore"&&(I.preventDefault(),u.pointerStart.x=I.atlas.x,u.pointerStart.y=I.atlas.y,e.transitionManager.stopTransition(),u.isPressing=!0)}function g(){u.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),u.isPressing=!1)}let p=0;function m(I){if(e.mode==="explore"){if(I.atlasTouches.length===1&&(I.preventDefault(),u.pointerStart.x=I.atlasTouches[0].x,u.pointerStart.y=I.atlasTouches[0].y),I.atlasTouches.length===2){I.preventDefault();const k=I.atlasTouches[0].x,P=I.atlasTouches[1].x;u.pointerStart.x=(k+P)/2;const j=I.atlasTouches[0].y,V=I.atlasTouches[1].y;u.pointerStart.y=(j+V)/2,p=xi({x:I.touches[0].clientX,y:I.touches[0].clientY},{x:I.touches[1].clientX,y:I.touches[1].clientY})}e.transitionManager.stopTransition(),u.isPressing=!0}}function w(I){let k=null,P=null,j=0;if(u.isPressing&&I.touches.length===2){const V=I.touches[0].clientX,W=I.touches[1].clientX;k=(V+W)/2;const Q=I.touches[0].clientY,J=I.touches[1].clientY;P=(Q+J)/2,j=xi({x:I.touches[0].clientX,y:I.touches[0].clientY},{x:I.touches[1].clientX,y:I.touches[1].clientY})}if(u.isPressing&&I.touches.length===1){const V=I.touches[0];k=V.clientX,P=V.clientY}if(k!==null&&P!==null){const V=e.getRendererScreenPosition();if(V){const{x:W,y:Q}=e.viewerToWorld(k-V.x,P-V.y),J=j&&p?j/p:1;e.transitionManager.customTransition(q=>{q.from=G(e.target),q.to=$t(q.from,xt(Ke(u.pointerStart.x-W,u.pointerStart.y-Q),Rn(1/J,W,Q)),u.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=Dt.easeInOutExpo,q.done=!1})}p=j}}function _(I){if(u.isPressing){const k=e.getRendererScreenPosition();if(k){const{x:P,y:j}=e.viewerToWorld(I.clientX-k.x,I.clientY-k.y);e.transitionManager.customTransition(V=>{V.from=G(e.target),V.to=$t(V.from,Ke(u.pointerStart.x-P,u.pointerStart.y-j),u.mousemoveBuffer),V.elapsed_time=0,V.total_time=0,V.timingFunction=Dt.easeInOutExpo,V.done=!1})}}}function O(I){e.mode==="explore"&&e.world.zoomIn(I.atlas)}function R(I){const k=$c(I),P=1+k.spinY/i;e.world.zoomTo(P,I.atlas,!0)}e.world.addEventListener("mouseup",d),e.world.addEventListener("touchend",d),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",h),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",_),window.addEventListener("touchmove",w),l&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",O)),o&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",R));const N=e.world.addLayoutSubscriber((I,k)=>{if(I==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),I==="zoom-to"&&k&&e.transitionManager.zoomTo(k.factor,{origin:k.point,stream:k.stream}),I==="go-home"){const P=k.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(ed(e.homePosition),{transition:P})}if(I==="goto-region"&&k){const P=k.immediate?{duration:0}:{};e.transitionManager.goToRegion(k,{transition:P})}I==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:k!=null&&k.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",d),e.world.removeEventListener("touchend",d),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",h),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",_),e.world.removeEventListener("touchmove",_),l&&e.world.removeEventListener("click",O),o&&e.world.removeEventListener("wheel",R),N()}},updatePosition(){}}),Jr=De.default.createContext("explore"),nd=()=>y.useContext(Jr);function $r(r,e,i){var o,l,u,d,h;e==null&&(e=100);function g(){var m=Date.now()-d;m<e&&m>=0?o=setTimeout(g,e-m):(o=null,i||(h=r.apply(u,l),u=l=null))}var p=function(){u=this,l=arguments,d=Date.now();var m=i&&!o;return o||(o=setTimeout(g,e)),m&&(h=r.apply(u,l),u=l=null),h};return p.clear=function(){o&&(clearTimeout(o),o=null)},p.flush=function(){o&&(h=r.apply(u,l),u=l=null,clearTimeout(o),o=null)},p}$r.debounce=$r;var sl=$r;function ol(r){let{debounce:e,scroll:i,polyfill:o,offsetSize:l}=r===void 0?{debounce:0,scroll:!1,offsetSize:!1}:r;const u=o||(typeof window=="undefined"?class{}:window.ResizeObserver);if(!u)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[d,h]=y.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=y.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:d}),p=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,w=y.useRef(!1);y.useEffect(()=>(w.current=!0,()=>void(w.current=!1)));const[_,O,R]=y.useMemo(()=>{const P=()=>{if(!g.current.element)return;const{left:j,top:V,width:W,height:Q,bottom:J,right:q,x:b,y:le}=g.current.element.getBoundingClientRect(),fe={left:j,top:V,width:W,height:Q,bottom:J,right:q,x:b,y:le};g.current.element instanceof HTMLElement&&l&&(fe.height=g.current.element.offsetHeight,fe.width=g.current.element.offsetWidth),Object.freeze(fe),w.current&&!od(g.current.lastBounds,fe)&&h(g.current.lastBounds=fe)};return[P,m?sl(P,m):P,p?sl(P,p):P]},[h,l,p,m]);function N(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(P=>P.removeEventListener("scroll",R,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function I(){!g.current.element||(g.current.resizeObserver=new u(R),g.current.resizeObserver.observe(g.current.element),i&&g.current.scrollContainers&&g.current.scrollContainers.forEach(P=>P.addEventListener("scroll",R,{capture:!0,passive:!0})))}const k=P=>{!P||P===g.current.element||(N(),g.current.element=P,g.current.scrollContainers=ll(P),I())};return rd(R,Boolean(i)),id(O),y.useEffect(()=>{N(),I()},[i,R,O]),y.useEffect(()=>N,[]),[k,d,_]}function id(r){y.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function rd(r,e){y.useEffect(()=>{if(e){const i=r;return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)}},[r,e])}function ll(r){const e=[];if(!r||r===document.body)return e;const{overflow:i,overflowX:o,overflowY:l}=window.getComputedStyle(r);return[i,o,l].some(u=>u==="auto"||u==="scroll")&&e.push(r),[...e,...ll(r.parentElement)]}const sd=["x","y","top","bottom","left","right","width","height"],od=(r,e)=>sd.every(i=>r[i]===e[i]),es=De.default.createContext(null),ts=De.default.createContext(null);let Fi;if(typeof performance=="object"&&typeof performance.now=="function"){const r=performance;Fi=()=>r.now()}else{const r=Date,e=r.now();Fi=()=>r.now()-e}function al(r,e){r&&r.appendChild&&e&&r.appendChild(e)}function ul(r,e){r&&r.removeChild&&e&&r.removeChild(e)}function ld(r,e){return ul(r.world,e)}function ad(r,e,i){return cl(r.world,e,i)}function cl(r,e,i){r&&r instanceof Li&&(r=r.world),r&&r.insertBefore&&r.insertBefore(e,i)}function dl(r,e,i){if(!!i&&(r.applyProps&&r.applyProps(i),r instanceof _t))for(const o of Ei){const l=o.slice(2).toLowerCase();i[o]!==e[o]&&(e[o]&&r.removeEventListener(l,e[o]),r.addEventListener(l,i[o]))}}function hl(r,e){const i=Object.keys(e);let o=!1;for(const l of i)if(Ei.indexOf(l)!==-1){const u=pn[l];if(u){if(r.activatedEvents.indexOf(u)!==-1)continue;o=!0,r.activatedEvents.push(u)}}o&&r.triggerEventActivation()}const Di=new Map,fl={};function ud(r,d,o,l,u){var h=d,{args:e=[]}=h,i=St(h,["args"]);if(!(o instanceof Li)&&u){const m=w=>w.return?m(w.return):w.stateNode&&w.stateNode.containerInfo;o=m(u)}let g,p=o.world;switch(r){case"world":g=mn.withProps({width:i.width,height:i.height,viewingDirection:"left-to-right"}),g.activatedEvents=p.activatedEvents,g.eventHandlers=p.eventHandlers,g.subscriptions=p.subscriptions,g.triggerEventActivation(),p=g;break;case"box":g=new An;break;case"worldObject":case"world-object":g=new zn;break;case"worldImage":case"world-image":g=new ot;break;case"texture":g=new Vr;break;case"compositeImage":case"composite-image":g=new bc({id:i.id,width:i.width,height:i.height,images:[]});break;case"tiledImage":case"tiled-image":g=en.fromTile(i.uri,i.display,i.tile,i.scaleFactor);break;case"paragraph":g=new Ci,g.text=i.children;break;default:return}return hl(p,i),dl(g,{},i),g}function cd(r,e){if(e instanceof mn)r.world=e;else if(e instanceof zn)r.world.appendChild(e);else if(e)throw new Error("Invalid root")}const Un=Tc({unstable_now:Fi,now:Fi,createInstance:ud,removeChild:ul,appendChild:al,appendInitialChild:al,insertBefore:cl,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout!="undefined"?setTimeout:void 0,cancelTimeout:typeof clearTimeout!="undefined"?clearTimeout:void 0,setTimeout:typeof setTimeout!="undefined"?setTimeout:void 0,clearTimeout:typeof clearTimeout!="undefined"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:cd,removeChildFromContainer:ld,createTextInstance(){},insertInContainerBefore:ad,prepareUpdate(r,e,i,o,l){return hl(l.world,o),o},commitUpdate(r,e,i,o,l,u){r.applyProps&&e&&dl(r,o,e)},finalizeInitialChildren(r){return r==null?void 0:r.__handlers},getChildHostContext(){return fl},getRootHostContext(){return fl},prepareForCommit(){return null},preparePortalMount(){},hideInstance(r){r&&r.points&&(r.points[0]=0)},unhideInstance(r,e){r&&r.points&&(r.points[0]=1)},getPublicInstance(r){return r},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(r){r.pendingUpdate=!0,r.world&&r.world.needsRecalculate&&(r.world.recalculateWorldSize(),r.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});Un.injectIntoDevTools({bundleType:0,version:y.version,rendererPackageName:"@atlas-viewer/atlas"});function gl(r,e){const i=Di.get(r);i&&Un.updateContainer(null,i,null,()=>{Di.delete(r),e&&e(r)})}const dd={render(r,e){const i=Di.get(e);if(i)Un.updateContainer(r,i,null,()=>{});else{const o=Un.createContainer(e,0,null,!1,null,"",()=>{},null);Un.updateContainer(r,o,null,null),Di.set(e,o)}}},hd=De.default.memo(({children:r,setIsReady:e,onCreated:i,bounds:o,preset:l,mode:u="explore"})=>{const d=y.useCallback(function(g){const p=()=>{e(!0)};return y.useEffect(()=>{if(l){l.runtime.goHome();const m=i&&i(l);return void(m&&m.then?m.then(p):p())}return()=>{}},[]),g.children},[l]);return y.useLayoutEffect(()=>{if(l){const h=l.runtime;u!==h.mode&&(h.mode=u),dd.render(M(De.default.StrictMode,{children:M(d,{children:M(ts.Provider,{value:o,children:M(Jr.Provider,{value:u,children:M(es.Provider,{value:l,children:r})})})})}),h)}},[l,u,r]),null});class fd{constructor(e,i){this.fragmentShaderSource=`
|
|
52
|
+
*/function qc(r,e){if(!Jo.canUseDOM||e&&!("addEventListener"in document))return!1;var i="on"+r,o=i in document;if(!o){var l=document.createElement("div");l.setAttribute(i,"return;"),o=typeof l[i]=="function"}return!o&&$o&&r==="wheel"&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var Zc=qc,Gc=Qc,Kc=Zc,el=10,tl=40,nl=800;function il(r){var e=0,i=0,o=0,l=0;return"detail"in r&&(i=r.detail),"wheelDelta"in r&&(i=-r.wheelDelta/120),"wheelDeltaY"in r&&(i=-r.wheelDeltaY/120),"wheelDeltaX"in r&&(e=-r.wheelDeltaX/120),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=i,i=0),o=e*el,l=i*el,"deltaY"in r&&(l=r.deltaY),"deltaX"in r&&(o=r.deltaX),(o||l)&&r.deltaMode&&(r.deltaMode==1?(o*=tl,l*=tl):(o*=nl,l*=nl)),o&&!e&&(e=o<1?-1:1),l&&!i&&(i=l<1?-1:1),{spinX:e,spinY:i,pixelX:o,pixelY:l}}il.getEventType=function(){return Gc.firefox()?"DOMMouseScroll":Kc("wheel")?"wheel":"mousewheel"};var Jc=il,$c=Jc;function ed(r){return{x:r[1],y:r[2],width:r[3]-r[1],height:r[4]-r[2]}}const td={zoomOutFactor:.8,zoomInFactor:1.25,maxZoomFactor:1,minZoomFactor:.05,zoomDuration:300,zoomWheelConstant:20,zoomClamp:.6,panBounceStiffness:120,panBounceDamping:15,panTimeConstant:240,panPower:.1,nudgeDistance:100,panPadding:0,devicePixelRatio:1,enableWheel:!0,enableClickToZoom:!1,onPanInSketchMode:()=>{}},rl=(r={})=>({start:function(e){const{zoomWheelConstant:i,enableWheel:o,enableClickToZoom:l}=B(B({},td),r),u={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:G(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function d(){e.world.constraintBounds(),p=0}function h(I){if(I.which>1){u.isPressing=!1;return}e.mode==="explore"&&(I.preventDefault(),u.pointerStart.x=I.atlas.x,u.pointerStart.y=I.atlas.y,e.transitionManager.stopTransition(),u.isPressing=!0)}function g(){u.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),u.isPressing=!1)}let p=0;function m(I){if(e.mode==="explore"){if(I.atlasTouches.length===1&&(I.preventDefault(),u.pointerStart.x=I.atlasTouches[0].x,u.pointerStart.y=I.atlasTouches[0].y),I.atlasTouches.length===2){I.preventDefault();const k=I.atlasTouches[0].x,P=I.atlasTouches[1].x;u.pointerStart.x=(k+P)/2;const j=I.atlasTouches[0].y,V=I.atlasTouches[1].y;u.pointerStart.y=(j+V)/2,p=xi({x:I.touches[0].clientX,y:I.touches[0].clientY},{x:I.touches[1].clientX,y:I.touches[1].clientY})}e.transitionManager.stopTransition(),u.isPressing=!0}}function S(I){let k=null,P=null,j=0;if(u.isPressing&&I.touches.length===2){const V=I.touches[0].clientX,W=I.touches[1].clientX;k=(V+W)/2;const Q=I.touches[0].clientY,J=I.touches[1].clientY;P=(Q+J)/2,j=xi({x:I.touches[0].clientX,y:I.touches[0].clientY},{x:I.touches[1].clientX,y:I.touches[1].clientY})}if(u.isPressing&&I.touches.length===1){const V=I.touches[0];k=V.clientX,P=V.clientY}if(k!==null&&P!==null){const V=e.getRendererScreenPosition();if(V){const{x:W,y:Q}=e.viewerToWorld(k-V.x,P-V.y),J=j&&p?j/p:1;e.transitionManager.customTransition(q=>{q.from=G(e.target),q.to=$t(q.from,xt(Ke(u.pointerStart.x-W,u.pointerStart.y-Q),Rn(1/J,W,Q)),u.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=Dt.easeInOutExpo,q.done=!1})}p=j}}function x(I){if(u.isPressing){const k=e.getRendererScreenPosition();if(k){const{x:P,y:j}=e.viewerToWorld(I.clientX-k.x,I.clientY-k.y);e.transitionManager.customTransition(V=>{V.from=G(e.target),V.to=$t(V.from,Ke(u.pointerStart.x-P,u.pointerStart.y-j),u.mousemoveBuffer),V.elapsed_time=0,V.total_time=0,V.timingFunction=Dt.easeInOutExpo,V.done=!1})}}}function O(I){e.mode==="explore"&&e.world.zoomIn(I.atlas)}function R(I){const k=$c(I),P=1+k.spinY/i;e.world.zoomTo(P,I.atlas,!0)}e.world.addEventListener("mouseup",d),e.world.addEventListener("touchend",d),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",h),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",x),window.addEventListener("touchmove",S),l&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",O)),o&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",R));const N=e.world.addLayoutSubscriber((I,k)=>{if(I==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),I==="zoom-to"&&k&&e.transitionManager.zoomTo(k.factor,{origin:k.point,stream:k.stream}),I==="go-home"){const P=k.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(ed(e.homePosition),{transition:P})}if(I==="goto-region"&&k){const P=k.immediate?{duration:0}:{};e.transitionManager.goToRegion(k,{transition:P})}I==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:k!=null&&k.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",d),e.world.removeEventListener("touchend",d),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",h),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",x),e.world.removeEventListener("touchmove",x),l&&e.world.removeEventListener("click",O),o&&e.world.removeEventListener("wheel",R),N()}},updatePosition(){}}),Jr=De.default.createContext("explore"),nd=()=>y.useContext(Jr);function $r(r,e,i){var o,l,u,d,h;e==null&&(e=100);function g(){var m=Date.now()-d;m<e&&m>=0?o=setTimeout(g,e-m):(o=null,i||(h=r.apply(u,l),u=l=null))}var p=function(){u=this,l=arguments,d=Date.now();var m=i&&!o;return o||(o=setTimeout(g,e)),m&&(h=r.apply(u,l),u=l=null),h};return p.clear=function(){o&&(clearTimeout(o),o=null)},p.flush=function(){o&&(h=r.apply(u,l),u=l=null,clearTimeout(o),o=null)},p}$r.debounce=$r;var sl=$r;function ol(r){let{debounce:e,scroll:i,polyfill:o,offsetSize:l}=r===void 0?{debounce:0,scroll:!1,offsetSize:!1}:r;const u=o||(typeof window=="undefined"?class{}:window.ResizeObserver);if(!u)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[d,h]=y.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=y.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:d}),p=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,S=y.useRef(!1);y.useEffect(()=>(S.current=!0,()=>void(S.current=!1)));const[x,O,R]=y.useMemo(()=>{const P=()=>{if(!g.current.element)return;const{left:j,top:V,width:W,height:Q,bottom:J,right:q,x:b,y:le}=g.current.element.getBoundingClientRect(),fe={left:j,top:V,width:W,height:Q,bottom:J,right:q,x:b,y:le};g.current.element instanceof HTMLElement&&l&&(fe.height=g.current.element.offsetHeight,fe.width=g.current.element.offsetWidth),Object.freeze(fe),S.current&&!od(g.current.lastBounds,fe)&&h(g.current.lastBounds=fe)};return[P,m?sl(P,m):P,p?sl(P,p):P]},[h,l,p,m]);function N(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(P=>P.removeEventListener("scroll",R,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function I(){!g.current.element||(g.current.resizeObserver=new u(R),g.current.resizeObserver.observe(g.current.element),i&&g.current.scrollContainers&&g.current.scrollContainers.forEach(P=>P.addEventListener("scroll",R,{capture:!0,passive:!0})))}const k=P=>{!P||P===g.current.element||(N(),g.current.element=P,g.current.scrollContainers=ll(P),I())};return rd(R,Boolean(i)),id(O),y.useEffect(()=>{N(),I()},[i,R,O]),y.useEffect(()=>N,[]),[k,d,x]}function id(r){y.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function rd(r,e){y.useEffect(()=>{if(e){const i=r;return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)}},[r,e])}function ll(r){const e=[];if(!r||r===document.body)return e;const{overflow:i,overflowX:o,overflowY:l}=window.getComputedStyle(r);return[i,o,l].some(u=>u==="auto"||u==="scroll")&&e.push(r),[...e,...ll(r.parentElement)]}const sd=["x","y","top","bottom","left","right","width","height"],od=(r,e)=>sd.every(i=>r[i]===e[i]),es=De.default.createContext(null),ts=De.default.createContext(null);let Fi;if(typeof performance=="object"&&typeof performance.now=="function"){const r=performance;Fi=()=>r.now()}else{const r=Date,e=r.now();Fi=()=>r.now()-e}function al(r,e){r&&r.appendChild&&e&&r.appendChild(e)}function ul(r,e){r&&r.removeChild&&e&&r.removeChild(e)}function ld(r,e){return ul(r.world,e)}function ad(r,e,i){return cl(r.world,e,i)}function cl(r,e,i){r&&r instanceof Li&&(r=r.world),r&&r.insertBefore&&r.insertBefore(e,i)}function dl(r,e,i){if(!!i&&(r.applyProps&&r.applyProps(i),r instanceof _t))for(const o of Ei){const l=o.slice(2).toLowerCase();i[o]!==e[o]&&(e[o]&&r.removeEventListener(l,e[o]),r.addEventListener(l,i[o]))}}function hl(r,e){const i=Object.keys(e);let o=!1;for(const l of i)if(Ei.indexOf(l)!==-1){const u=pn[l];if(u){if(r.activatedEvents.indexOf(u)!==-1)continue;o=!0,r.activatedEvents.push(u)}}o&&r.triggerEventActivation()}const Di=new Map,fl={};function ud(r,d,o,l,u){var h=d,{args:e=[]}=h,i=St(h,["args"]);if(!(o instanceof Li)&&u){const m=S=>S.return?m(S.return):S.stateNode&&S.stateNode.containerInfo;o=m(u)}let g,p=o.world;switch(r){case"world":g=mn.withProps({width:i.width,height:i.height,viewingDirection:"left-to-right"}),g.activatedEvents=p.activatedEvents,g.eventHandlers=p.eventHandlers,g.subscriptions=p.subscriptions,g.triggerEventActivation(),p=g;break;case"box":g=new An;break;case"worldObject":case"world-object":g=new zn;break;case"worldImage":case"world-image":g=new ot;break;case"texture":g=new Vr;break;case"compositeImage":case"composite-image":g=new bc({id:i.id,width:i.width,height:i.height,images:[]});break;case"tiledImage":case"tiled-image":g=en.fromTile(i.uri,i.display,i.tile,i.scaleFactor);break;case"paragraph":g=new Ci,g.text=i.children;break;default:return}return hl(p,i),dl(g,{},i),g}function cd(r,e){if(e instanceof mn)r.world=e;else if(e instanceof zn)r.world.appendChild(e);else if(e)throw new Error("Invalid root")}const Un=Tc({unstable_now:Fi,now:Fi,createInstance:ud,removeChild:ul,appendChild:al,appendInitialChild:al,insertBefore:cl,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout!="undefined"?setTimeout:void 0,cancelTimeout:typeof clearTimeout!="undefined"?clearTimeout:void 0,setTimeout:typeof setTimeout!="undefined"?setTimeout:void 0,clearTimeout:typeof clearTimeout!="undefined"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:cd,removeChildFromContainer:ld,createTextInstance(){},insertInContainerBefore:ad,prepareUpdate(r,e,i,o,l){return hl(l.world,o),o},commitUpdate(r,e,i,o,l,u){r.applyProps&&e&&dl(r,o,e)},finalizeInitialChildren(r){return r==null?void 0:r.__handlers},getChildHostContext(){return fl},getRootHostContext(){return fl},prepareForCommit(){return null},preparePortalMount(){},hideInstance(r){r&&r.points&&(r.points[0]=0)},unhideInstance(r,e){r&&r.points&&(r.points[0]=1)},getPublicInstance(r){return r},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(r){r.pendingUpdate=!0,r.world&&r.world.needsRecalculate&&(r.world.recalculateWorldSize(),r.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});Un.injectIntoDevTools({bundleType:0,version:y.version,rendererPackageName:"@atlas-viewer/atlas"});function gl(r,e){const i=Di.get(r);i&&Un.updateContainer(null,i,null,()=>{Di.delete(r),e&&e(r)})}const dd={render(r,e){const i=Di.get(e);if(i)Un.updateContainer(r,i,null,()=>{});else{const o=Un.createContainer(e,0,null,!1,null,"",()=>{},null);Un.updateContainer(r,o,null,null),Di.set(e,o)}}},hd=De.default.memo(({children:r,setIsReady:e,onCreated:i,bounds:o,preset:l,mode:u="explore"})=>{const d=y.useCallback(function(g){const p=()=>{e(!0)};return y.useEffect(()=>{if(l){l.runtime.goHome();const m=i&&i(l);return void(m&&m.then?m.then(p):p())}return()=>{}},[]),g.children},[l]);return y.useLayoutEffect(()=>{if(l){const h=l.runtime;u!==h.mode&&(h.mode=u),dd.render(M(De.default.StrictMode,{children:M(d,{children:M(ts.Provider,{value:o,children:M(Jr.Provider,{value:u,children:M(es.Provider,{value:l,children:r})})})})}),h)}},[l,u,r]),null});class fd{constructor(e,i){this.fragmentShaderSource=`
|
|
53
53
|
precision mediump float;
|
|
54
54
|
|
|
55
55
|
uniform sampler2D u_image;
|
|
@@ -82,14 +82,14 @@ No matching component was found for:
|
|
|
82
82
|
|
|
83
83
|
v_texCoord = a_texCoord;
|
|
84
84
|
}
|
|
85
|
-
`,this.lastResize=0,this.lastKnownScale=1,this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.gl=e.getContext("webgl2"),this.fragmentShader=this.createShader(this.gl.FRAGMENT_SHADER,this.fragmentShaderSource),this.vertexShader=this.createShader(this.gl.VERTEX_SHADER,this.vertexShaderSource),this.program=this.createProgram(this.vertexShader,this.fragmentShader),this.dpi=(i==null?void 0:i.dpi)||1,this.attributes={position:this.gl.getAttribLocation(this.program,"a_position"),texCoord:this.gl.getAttribLocation(this.program,"a_texCoord")},this.uniforms={resolution:this.gl.getUniformLocation(this.program,"u_resolution"),texture:this.gl.getUniformLocation(this.program,"u_texture")},this.buffers={position:this.createArrayBuffer(),texCoord:this.createArrayBuffer(new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]))},this.rectBuffer=new Float32Array(12),this.resize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.enableVertexAttribArray(this.attributes.position)}resize(){this.resizeCanvasToDisplaySize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return!0}beforeFrame(e,i,o){this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.vertexAttribPointer(this.attributes.position,2,this.gl.FLOAT,!1,0,0),this.gl.uniform2f(this.uniforms.resolution,this.gl.canvas.width,this.gl.canvas.height),this.lastResize>1e3&&(this.lastResize=0,this.resizeCanvasToDisplaySize()),this.lastResize+=i}prepareLayer(e){(!e.__host||!e.__host.webgl)&&((e instanceof ot||e instanceof en)&&this.createImageHost(e),e instanceof Vr&&this.createTextureHost(e))}createTextureHost(e){e.__host=e.__host?e.__host:{};const i=this.gl,o=this.gl.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let l;if(e instanceof Vr){const u=e.getTexture();u.source&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,u.source),l=u}i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),e.__host.webgl={height:e.height,width:e.width,texture:o,lastImage:l}}createImageHost(e){const i=[...new Array(e.points.length/5)];e.__host=e.__host?e.__host:{},e.__host.webgl={height:e.height,width:e.width,textures:i,loading:[],loaded:[],lastLevelRendered:-1,onLoad:(o,l)=>{const u=this.gl,d=this.gl.createTexture();u.bindTexture(u.TEXTURE_2D,d),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,l),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.bindTexture(u.TEXTURE_2D,null),e.__host.webgl.textures[o]=d,e.__host.webgl.loaded.push(o)}}}paint(e,i,o,l,u,d){if(e.type==="spacial-content"&&e.__host&&e.__host.webgl){if(e.getTexture){const g=e==null?void 0:e.getTexture();if(g&&e.__host.webgl.lastImage!==g.hash&&g.source&&!e.__host.webgl.error)try{const m=this.gl.RGBA,
|
|
85
|
+
`,this.lastResize=0,this.lastKnownScale=1,this.canvas=e,this.rendererPosition=e.getBoundingClientRect(),this.gl=e.getContext("webgl2"),this.fragmentShader=this.createShader(this.gl.FRAGMENT_SHADER,this.fragmentShaderSource),this.vertexShader=this.createShader(this.gl.VERTEX_SHADER,this.vertexShaderSource),this.program=this.createProgram(this.vertexShader,this.fragmentShader),this.dpi=(i==null?void 0:i.dpi)||1,this.attributes={position:this.gl.getAttribLocation(this.program,"a_position"),texCoord:this.gl.getAttribLocation(this.program,"a_texCoord")},this.uniforms={resolution:this.gl.getUniformLocation(this.program,"u_resolution"),texture:this.gl.getUniformLocation(this.program,"u_texture")},this.buffers={position:this.createArrayBuffer(),texCoord:this.createArrayBuffer(new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]))},this.rectBuffer=new Float32Array(12),this.resize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.useProgram(this.program),this.gl.enableVertexAttribArray(this.attributes.position)}resize(){this.resizeCanvasToDisplaySize(),this.gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),this.rendererPosition=this.canvas.getBoundingClientRect()}isReady(){return!0}beforeFrame(e,i,o){this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.vertexAttribPointer(this.attributes.position,2,this.gl.FLOAT,!1,0,0),this.gl.uniform2f(this.uniforms.resolution,this.gl.canvas.width,this.gl.canvas.height),this.lastResize>1e3&&(this.lastResize=0,this.resizeCanvasToDisplaySize()),this.lastResize+=i}prepareLayer(e){(!e.__host||!e.__host.webgl)&&((e instanceof ot||e instanceof en)&&this.createImageHost(e),e instanceof Vr&&this.createTextureHost(e))}createTextureHost(e){e.__host=e.__host?e.__host:{};const i=this.gl,o=this.gl.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let l;if(e instanceof Vr){const u=e.getTexture();u.source&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,u.source),l=u}i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),e.__host.webgl={height:e.height,width:e.width,texture:o,lastImage:l}}createImageHost(e){const i=[...new Array(e.points.length/5)];e.__host=e.__host?e.__host:{},e.__host.webgl={height:e.height,width:e.width,textures:i,loading:[],loaded:[],lastLevelRendered:-1,onLoad:(o,l)=>{const u=this.gl,d=this.gl.createTexture();u.bindTexture(u.TEXTURE_2D,d),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,l),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.bindTexture(u.TEXTURE_2D,null),e.__host.webgl.textures[o]=d,e.__host.webgl.loaded.push(o)}}}paint(e,i,o,l,u,d){if(e.type==="spacial-content"&&e.__host&&e.__host.webgl){if(e.getTexture){const g=e==null?void 0:e.getTexture();if(g&&e.__host.webgl.lastImage!==g.hash&&g.source&&!e.__host.webgl.error)try{const m=this.gl.RGBA,S=this.gl.RGBA,x=this.gl.UNSIGNED_BYTE;this.gl.bindTexture(this.gl.TEXTURE_2D,e.__host.webgl.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,m,S,x,g.source),e.__host.webgl.lastImage=g.hash}catch(p){e.__host.webgl.error=p}}if(e.__host.webgl.loading&&e.__host.webgl.loading.indexOf(i)===-1&&e.getImageUrl){e.__host.webgl.loading.push(i);const g=document.createElement("img");g.decoding="async",g.crossOrigin="anonymous",g.src=e.getImageUrl(i),g.onload=()=>(g.onload=null,e.__host.webgl.onLoad(i,g))}const h=e.__host.webgl.texture?e.__host.webgl.texture:e.__host.webgl.textures[i];h&&(this.gl.enableVertexAttribArray(this.attributes.texCoord),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffers.texCoord),this.gl.enableVertexAttribArray(this.attributes.texCoord),this.gl.vertexAttribPointer(this.attributes.texCoord,2,this.gl.FLOAT,!1,0,0),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffers.position),this.gl.enableVertexAttribArray(this.attributes.position),this.gl.vertexAttribPointer(this.attributes.position,2,this.gl.FLOAT,!1,0,0),this.gl.bindTexture(this.gl.TEXTURE_2D,h),this.gl.uniform1i(this.uniforms.texture,0),this.setRectangle(o,l,u,d),this.gl.drawArrays(this.gl.TRIANGLES,0,6))}}afterPaintLayer(e,i){}pendingUpdate(){return!0}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}afterFrame(){}getScale(e,i,o){if(Number.isNaN(e)||Number.isNaN(i))return this.lastKnownScale;const l=this.getCanvasDims(),u=l.width/e,d=l.height/i,h=(u<d?d:u)*(o&&this.dpi||1);return Number.isNaN(h)||(this.lastKnownScale=h),this.lastKnownScale}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}getViewportBounds(e,i,o){return null}createShader(e,i){const o=this.gl.createShader(e);if(o){if(this.gl.shaderSource(o,i),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS))return o;const u=this.gl.getShaderInfoLog(o);if(this.gl.deleteShader(o),u)throw new Error(u)}throw new Error("Invalid shader")}createProgram(e,i){const o=this.gl.createProgram();if(o){if(this.gl.attachShader(o,e),this.gl.attachShader(o,i),this.gl.linkProgram(o),this.gl.getProgramParameter(o,this.gl.LINK_STATUS))return o;const u=this.gl.getProgramInfoLog(o);if(this.gl.deleteProgram(o),u)throw new Error(u)}throw new Error("Invalid program")}resizeCanvasToDisplaySize(){const e=this.gl.canvas,i=e.clientWidth,o=e.clientHeight,l=e.width!==i||e.height!==o;return l&&(e.width=i,e.height=o),l}createArrayBuffer(e){const i=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,i),e&&this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),!i)throw new Error("Cannot create buffer");return i}setRectangle(e,i,o,l){this.gl.bufferData(this.gl.ARRAY_BUFFER,this.getRectangle(e,i,o,l),this.gl.STATIC_DRAW)}getRectangle(e,i,o,l){const u=e,d=e+o,h=i,g=i+l;return this.rectBuffer.set([u,h,d,h,u,g,u,g,d,h,d,g]),this.rectBuffer}getRendererScreenPosition(){return this.rendererPosition}}function ns(r,e){const i=e?r:JSON.stringify(r);let o=5381,l=i.length;for(;l;)o=o*33^i.charCodeAt(--l);const d=(o>>>0).toString(16);return d.length%2?"0"+d:d}class pl{constructor(e){this.sheetPrefix=(e==null?void 0:e.sheetPrefix)||"a-",this.$element=document.createElement("style"),this.stylesheetClasses=[],this.activeStylesheetClasses=[],this.sheetsDidUpdate=!1,this.stylesheetEntries={}}getElement(){return this.$element}addStylesheet(e){const i=e.replace(/\s\s+/g," ").replace(/: /g,":").replace(/; /g,";").trim(),o=this.sheetPrefix+ns(i,!0);return this.stylesheetClasses.indexOf(o)!==-1||(this.stylesheetClasses.push(o),this.activeStylesheetClasses.push(o),this.stylesheetEntries[o]=i,this.sheetsDidUpdate=!0),o}removeStylesheet(e){const i=this.sheetPrefix+ns(e,!0);this.stylesheetClasses.indexOf(i)&&(this.stylesheetClasses=this.stylesheetClasses.filter(o=>o!==i)),this.sheetsDidUpdate=!0}clearClasses(){this.activeStylesheetClasses=[]}didUpdateActive(){if(this.activeStylesheetClasses.length){for(const e of this.activeStylesheetClasses)if(this.stylesheetClasses.indexOf(e)===-1)return!0;for(const e of this.stylesheetClasses)if(this.activeStylesheetClasses.indexOf(e)===-1)return!0}return!1}updateSheet(){(this.sheetsDidUpdate||this.didUpdateActive())&&(this.$element.innerText=this.activeStylesheetClasses.map(e=>`.${e}{${this.stylesheetEntries[e]}}`).join(""),this.sheetsDidUpdate=!1,this.stylesheetClasses=[...this.activeStylesheetClasses])}}class ml{constructor(e,i){this.visible=[],this.previousVisible=[],this.htmlIds=[],this.firstMeaningfulPaint=!1,this.paintTx=1,this.zIndex=0,this.htmlContainer=e,this.htmlContainer.innerHTML="",this.rendererPosition=this.htmlContainer.getBoundingClientRect(),this.options=B({triggerResize:()=>{},box:!1,text:!1,sheetPrefix:"",inlineStyles:!1,background:""},i||{}),this.stylesheet=new pl({sheetPrefix:this.options.sheetPrefix}),this.options.inlineStyles||this.htmlContainer.appendChild(this.stylesheet.getElement()),this.options.background&&this.htmlContainer.classList.add(this.stylesheet.addStylesheet(`
|
|
86
86
|
background: ${this.options.background};
|
|
87
87
|
`)),this.classes={hostClassName:this.stylesheet.addStylesheet(`
|
|
88
88
|
position: absolute;
|
|
89
89
|
transform-origin: 0px 0px;
|
|
90
|
-
`),interactive:this.stylesheet.addStylesheet("pointer-events: all"),nonInteractive:this.stylesheet.addStylesheet("pointer-events: none")},this.stylesheet.updateSheet()}createHtmlHost(e){if(this.htmlContainer&&(this.options.box||e.props.className||e.props.html||e.props.href)){const i=document.createElement(e.props.href?"a":"div");if(e.props.href){i.style.display="block",i.href=e.props.href;const o=e.props.hrefTarget||"_blank";i.target=o,o!=="_self"&&(i.rel="noopener noreferrer")}i.title=e.props.title||"",this.options.inlineStyles?(i.style.display="block",i.style.position="absolute",i.style.overflow="hidden",i.style.transformOrigin="0px 0px"):i.classList.add(this.classes.hostClassName),e.__host={element:i,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,i,o){if(e.__revision!==e.__host.revision){const l=e.__host.element,u=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?l.style.pointerEvents="all":u.push(this.classes.interactive):this.options.inlineStyles?l.style.pointerEvents="none":u.push(this.classes.nonInteractive),e.props.href){l.style.display="block",l.href=e.props.href;const g=e.props.hrefTarget||"_blank";l.target=g,g!=="_self"?l.rel="noopener noreferrer":l.rel=""}else l.href&&l.removeAttribute("href");if(e.props.title&&(l.title=e.props.title||""),e.props.className&&(u.push(e.props.className),e.hovering&&u.push(`${e.props.className}--hover`),e.pressing&&u.push(`${e.props.className}--active`)),e.props.relativeStyle?(l.style.width=`${i||e.width}px`,l.style.height=`${o||e.height}px`):(l.style.width=`${e.width}px`,l.style.height=`${e.height}px`),e.props.style){Object.assign(l.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof Ci){e.text&&(l.innerText=e.text),e.backgroundColor&&(l.style.backgroundColor=e.backgroundColor),e.color&&(l.style.color=e.color),e.props.font&&(l.style.font=e.props.font),e.props.textAlign&&(l.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=u.join(" ");l.className=g,l.part=g}e instanceof An&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(l.style.backgroundColor=e.props.backgroundColor),e.props.border!==l.style.border&&(l.style.border=e.props.border));const h=u.join(" ");l.className=h,l.part=h}}afterFrame(e,i,o){this.stylesheet.updateSheet();for(const l of this.previousVisible)this.visible.indexOf(l)===-1&&this.htmlContainer&&l.__id&&this.htmlIds.indexOf(l.__id)!==-1&&this.htmlContainer.removeChild(l.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,i){}beforeFrame(e,i,o){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){const o=this.rendererPosition.width/e,l=this.rendererPosition.height/i;return o<l?l:o}getViewportBounds(e,i,o){return null}isReady(){return!1}paint(e,i,o,l,u,d){if(this.zIndex++,(this.options.text&&e instanceof Ci||e instanceof An&&(this.options.box||e.props.className||e.props.html))&&e.__host.tx!==this.paintTx&&(this.visible.push(e),e.__host.tx=this.paintTx,this.htmlContainer)){this.updateHtmlHost(e,u,d);const h=u/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(o)}px, ${Math.round(l)}px)`:g.style.transform=`translate(${Math.round(o)}px, ${Math.round(l)}px) scale(${h})`,this.previousVisible.indexOf(e)===-1&&this.htmlContainer.appendChild(g),this.htmlIds.indexOf(e.__id)===-1&&this.htmlIds.push(e.__id)}}pendingUpdate(){return!1}prepareLayer(e){e.__host||(e instanceof Ci||e instanceof An)&&this.createHtmlHost(e)}resize(e,i){typeof e!="undefined"&&typeof i!="undefined"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${i}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}}const Ui=class{constructor(r,e,i){this.activatedEvents=[],this.eventHandlers=[],this.pointerMoveEvent=void 0,this.pointerEventState={isClicking:!1,isDragging:!1,isPressed:!1,mousedOver:[],itemsBeingDragged:[],mouseDownStart:{x:0,y:0},lastTouches:[]},this._realPointerMove=l=>{this.pointerMoveEvent=l},this.onWheelEvent=l=>{l.preventDefault(),this.onPointerEvent(l)},this.onTouchEvent=l=>{const u=pn[l.type],d=[],h=l.touches.length;for(let g=0;g<h;g++){const p=l.touches.item(g);if(!p)continue;const{x:m,y:w}=this.runtime.viewerToWorld(p.clientX-this.bounds.left,p.clientY-this.bounds.top),_={id:p.identifier,x:m,y:w};d.push(_)}d.length&&this.assignToEvent(l,d[0].x,d[0].y),u!=="onTouchEnd"?(this.pointerEventState.lastTouches=d,l.atlasTouches=d,this.runtime.world.propagateTouchEvent(u,l,d)):(l.atlasTouches=[],this.runtime.world.propagateTouchEvent(u,l,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=l=>{const u=pn[l.type];if(u&&this.runtime.world.activatedEvents.indexOf(u)!==-1){const{x:d,y:h}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);this.assignToEvent(l,d,h),this.runtime.world.propagatePointerEvent(u,l,d,h)}},this.onPointerDown=l=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=l.clientX,this.pointerEventState.mouseDownStart.y=l.clientY,setTimeout(()=>{this.runtime&&(this.pointerEventState.isClicking=!1)},250),setTimeout(()=>{if(this.runtime&&this.pointerEventState.isPressed&&!this.pointerEventState.isDragging){const u=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",l,u.x,u.y)}},800),this.onPointerEvent(l)},this.onPointerUp=l=>{if(this.pointerEventState.isClicking){const{x:u,y:d}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);this.assignToEvent(l,u,d),this.runtime.world.propagatePointerEvent("onClick",l,u,d)}if(this.pointerEventState.isDragging){for(const u of this.pointerEventState.itemsBeingDragged)u.dispatchEvent("onDragEnd",l);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(l)},this.onPointerMove=l=>{this.pointerMoveEvent=void 0;const{x:u,y:d}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);if(Number.isNaN(u)||Number.isNaN(d))return;this.assignToEvent(l,u,d),this.runtime.world.propagatePointerEvent("onPointerMove",l,u,d);const h=this.runtime.world.propagatePointerEvent("onMouseMove",l,u,d),g=[],p=[];for(const m of h)g.push(m.id),p.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",l),m.dispatchEvent("onPointerEnter",l),m.dispatchEvent("onMouseOver",l),m.dispatchEvent("onPointerOver",l));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",l),m.dispatchEvent("onPointerLeave",l),m.dispatchEvent("onMouseOut",l),m.dispatchEvent("onPointerOut",l));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",l);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&xi(this.pointerEventState.mouseDownStart,{x:l.clientX,y:l.clientY})>50){const m=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",te(B({},l),{atlas:{x:m.x,y:m.y}}),m.x,m.y)}this.pointerEventState.mousedOver=p},this.element=r,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=r.getBoundingClientRect(),this.options=B({simulationRate:0},i||{});let o=0;e.registerHook("useFrame",l=>{o+=l,o>this.options.simulationRate&&this.pointerMoveEvent&&(o=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(r){r==="event-activation"&&this.activateEvents()}assignToEvent(r,e,i){Ui.eventPool.atlas.x=e,Ui.eventPool.atlas.y=i,r.atlas=Ui.eventPool.atlas}activateEvents(){this.element.addEventListener("pointermove",this._realPointerMove),this.element.addEventListener("pointerup",this.onPointerUp),this.element.addEventListener("pointerdown",this.onPointerDown),this.element.addEventListener("mousedown",this.onPointerEvent),this.element.addEventListener("mouseup",this.onPointerEvent),this.element.addEventListener("pointercancel",this.onPointerEvent),this.element.addEventListener("wheel",this.onWheelEvent),this.element.addEventListener("touchstart",this.onTouchEvent),this.element.addEventListener("touchcancel",this.onTouchEvent),this.element.addEventListener("touchend",this.onTouchEvent),this.element.addEventListener("touchmove",this.onTouchEvent)}normalizeEventName(r){return r.startsWith("on")?r.slice(2).toLowerCase():r.toLowerCase()}stop(){this.unsubscribe();for(const[r,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(r),e)}};let is=Ui;is.eventPool={atlas:{x:0,y:0}};function vl({interactive:r=!0,viewport:e,forceRefresh:i,canvasElement:o,overlayElement:l,controllerConfig:u,unstable_webglRenderer:d,dpi:h,debug:g,canvasBox:p=!0,navigatorElement:m,background:w,runtimeOptions:_}){if(!o)throw new Error("Invalid container");o.style.userSelect="none";const O=r?rl(B({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1},u||{})):void 0,R=new Xo([d?new fd(o,{dpi:h}):new Vc(o,{dpi:h,debug:g,box:p,background:w}),l?new ml(l,{box:d||!p,text:!0,triggerResize:i}):void 0,m?new Wc(m):void 0]),N=new Li(R,new mn(1024,1024),e,O?[O]:[],_),I=new is(o,N);return{name:"default-preset",em:I,runtime:N,renderer:R,controller:O,canvas:o,navigator:m,unmount(){gl(N),N.stopControllers(),N.stop(),I&&I.stop()}}}class gd{constructor(e,i){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:o,height:l}=this.rendererPosition;this.width=o,this.height=l,this.options=B({addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000"},i||{}),this.stylesheet=new pl({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
|
|
90
|
+
`),interactive:this.stylesheet.addStylesheet("pointer-events: all"),nonInteractive:this.stylesheet.addStylesheet("pointer-events: none")},this.stylesheet.updateSheet()}createHtmlHost(e){if(this.htmlContainer&&(this.options.box||e.props.className||e.props.html||e.props.href)){const i=document.createElement(e.props.href?"a":"div");if(e.props.href){i.style.display="block",i.href=e.props.href;const o=e.props.hrefTarget||"_blank";i.target=o,o!=="_self"&&(i.rel="noopener noreferrer")}i.title=e.props.title||"",this.options.inlineStyles?(i.style.display="block",i.style.position="absolute",i.style.overflow="hidden",i.style.transformOrigin="0px 0px"):i.classList.add(this.classes.hostClassName),e.__host={element:i,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,i,o){if(e.__revision!==e.__host.revision){const l=e.__host.element,u=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?l.style.pointerEvents="all":u.push(this.classes.interactive):this.options.inlineStyles?l.style.pointerEvents="none":u.push(this.classes.nonInteractive),e.props.href){l.style.display="block",l.href=e.props.href;const g=e.props.hrefTarget||"_blank";l.target=g,g!=="_self"?l.rel="noopener noreferrer":l.rel=""}else l.href&&l.removeAttribute("href");if(e.props.title&&(l.title=e.props.title||""),e.props.className&&(u.push(e.props.className),e.hovering&&u.push(`${e.props.className}--hover`),e.pressing&&u.push(`${e.props.className}--active`)),e.props.relativeStyle?(l.style.width=`${i||e.width}px`,l.style.height=`${o||e.height}px`):(l.style.width=`${e.width}px`,l.style.height=`${e.height}px`),e.props.style){Object.assign(l.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof Ci){e.text&&(l.innerText=e.text),e.backgroundColor&&(l.style.backgroundColor=e.backgroundColor),e.color&&(l.style.color=e.color),e.props.font&&(l.style.font=e.props.font),e.props.textAlign&&(l.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=u.join(" ");l.className=g,l.part=g}e instanceof An&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(l.style.backgroundColor=e.props.backgroundColor),e.props.border!==l.style.border&&(l.style.border=e.props.border));const h=u.join(" ");l.className=h,l.part=h}}afterFrame(e,i,o){this.stylesheet.updateSheet();for(const l of this.previousVisible)this.visible.indexOf(l)===-1&&this.htmlContainer&&l.__id&&this.htmlIds.indexOf(l.__id)!==-1&&this.htmlContainer.removeChild(l.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,i){}beforeFrame(e,i,o){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){const o=this.rendererPosition.width/e,l=this.rendererPosition.height/i;return o<l?l:o}getViewportBounds(e,i,o){return null}isReady(){return!1}paint(e,i,o,l,u,d){if(this.zIndex++,(this.options.text&&e instanceof Ci||e instanceof An&&(this.options.box||e.props.className||e.props.html))&&e.__host.tx!==this.paintTx&&(this.visible.push(e),e.__host.tx=this.paintTx,this.htmlContainer)){this.updateHtmlHost(e,u,d);const h=u/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(o)}px, ${Math.round(l)}px)`:g.style.transform=`translate(${Math.round(o)}px, ${Math.round(l)}px) scale(${h})`,this.previousVisible.indexOf(e)===-1&&this.htmlContainer.appendChild(g),this.htmlIds.indexOf(e.__id)===-1&&this.htmlIds.push(e.__id)}}pendingUpdate(){return!1}prepareLayer(e){e.__host||(e instanceof Ci||e instanceof An)&&this.createHtmlHost(e)}resize(e,i){typeof e!="undefined"&&typeof i!="undefined"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${i}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}}const Ui=class{constructor(r,e,i){this.activatedEvents=[],this.eventHandlers=[],this.pointerMoveEvent=void 0,this.pointerEventState={isClicking:!1,isDragging:!1,isPressed:!1,mousedOver:[],itemsBeingDragged:[],mouseDownStart:{x:0,y:0},lastTouches:[]},this._realPointerMove=l=>{this.pointerMoveEvent=l},this.onWheelEvent=l=>{l.preventDefault(),this.onPointerEvent(l)},this.onTouchEvent=l=>{const u=pn[l.type],d=[],h=l.touches.length;for(let g=0;g<h;g++){const p=l.touches.item(g);if(!p)continue;const{x:m,y:S}=this.runtime.viewerToWorld(p.clientX-this.bounds.left,p.clientY-this.bounds.top),x={id:p.identifier,x:m,y:S};d.push(x)}d.length&&this.assignToEvent(l,d[0].x,d[0].y),u!=="onTouchEnd"?(this.pointerEventState.lastTouches=d,l.atlasTouches=d,this.runtime.world.propagateTouchEvent(u,l,d)):(l.atlasTouches=[],this.runtime.world.propagateTouchEvent(u,l,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=l=>{const u=pn[l.type];if(u&&this.runtime.world.activatedEvents.indexOf(u)!==-1){const{x:d,y:h}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);this.assignToEvent(l,d,h),this.runtime.world.propagatePointerEvent(u,l,d,h)}},this.onPointerDown=l=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=l.clientX,this.pointerEventState.mouseDownStart.y=l.clientY,setTimeout(()=>{this.runtime&&(this.pointerEventState.isClicking=!1)},250),setTimeout(()=>{if(this.runtime&&this.pointerEventState.isPressed&&!this.pointerEventState.isDragging){const u=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",l,u.x,u.y)}},800),this.onPointerEvent(l)},this.onPointerUp=l=>{if(this.pointerEventState.isClicking){const{x:u,y:d}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);this.assignToEvent(l,u,d),this.runtime.world.propagatePointerEvent("onClick",l,u,d)}if(this.pointerEventState.isDragging){for(const u of this.pointerEventState.itemsBeingDragged)u.dispatchEvent("onDragEnd",l);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(l)},this.onPointerMove=l=>{this.pointerMoveEvent=void 0;const{x:u,y:d}=this.runtime.viewerToWorld(l.clientX-this.bounds.left,l.clientY-this.bounds.top);if(Number.isNaN(u)||Number.isNaN(d))return;this.assignToEvent(l,u,d),this.runtime.world.propagatePointerEvent("onPointerMove",l,u,d);const h=this.runtime.world.propagatePointerEvent("onMouseMove",l,u,d),g=[],p=[];for(const m of h)g.push(m.id),p.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",l),m.dispatchEvent("onPointerEnter",l),m.dispatchEvent("onMouseOver",l),m.dispatchEvent("onPointerOver",l));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",l),m.dispatchEvent("onPointerLeave",l),m.dispatchEvent("onMouseOut",l),m.dispatchEvent("onPointerOut",l));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",l);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&xi(this.pointerEventState.mouseDownStart,{x:l.clientX,y:l.clientY})>50){const m=this.runtime.viewerToWorld(this.pointerEventState.mouseDownStart.x-this.bounds.left,this.pointerEventState.mouseDownStart.y-this.bounds.top);this.pointerEventState.isDragging=!0,this.pointerEventState.itemsBeingDragged=this.runtime.world.propagatePointerEvent("onDragStart",te(B({},l),{atlas:{x:m.x,y:m.y}}),m.x,m.y)}this.pointerEventState.mousedOver=p},this.element=r,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=r.getBoundingClientRect(),this.options=B({simulationRate:0},i||{});let o=0;e.registerHook("useFrame",l=>{o+=l,o>this.options.simulationRate&&this.pointerMoveEvent&&(o=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(r){r==="event-activation"&&this.activateEvents()}assignToEvent(r,e,i){Ui.eventPool.atlas.x=e,Ui.eventPool.atlas.y=i,r.atlas=Ui.eventPool.atlas}activateEvents(){this.element.addEventListener("pointermove",this._realPointerMove),this.element.addEventListener("pointerup",this.onPointerUp),this.element.addEventListener("pointerdown",this.onPointerDown),this.element.addEventListener("mousedown",this.onPointerEvent),this.element.addEventListener("mouseup",this.onPointerEvent),this.element.addEventListener("pointercancel",this.onPointerEvent),this.element.addEventListener("wheel",this.onWheelEvent),this.element.addEventListener("touchstart",this.onTouchEvent),this.element.addEventListener("touchcancel",this.onTouchEvent),this.element.addEventListener("touchend",this.onTouchEvent),this.element.addEventListener("touchmove",this.onTouchEvent)}normalizeEventName(r){return r.startsWith("on")?r.slice(2).toLowerCase():r.toLowerCase()}stop(){this.unsubscribe();for(const[r,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(r),e)}};let is=Ui;is.eventPool={atlas:{x:0,y:0}};function vl({interactive:r=!0,viewport:e,forceRefresh:i,canvasElement:o,overlayElement:l,controllerConfig:u,unstable_webglRenderer:d,dpi:h,debug:g,canvasBox:p=!0,navigatorElement:m,background:S,runtimeOptions:x}){if(!o)throw new Error("Invalid container");o.style.userSelect="none";const O=r?rl(B({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1},u||{})):void 0,R=new Xo([d?new fd(o,{dpi:h}):new Vc(o,{dpi:h,debug:g,box:p,background:S}),l?new ml(l,{box:d||!p,text:!0,triggerResize:i}):void 0,m?new Wc(m):void 0]),N=new Li(R,new mn(1024,1024),e,O?[O]:[],x),I=new is(o,N);return{name:"default-preset",em:I,runtime:N,renderer:R,controller:O,canvas:o,navigator:m,unmount(){gl(N),N.stopControllers(),N.stop(),I&&I.stop()}}}class gd{constructor(e,i){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:o,height:l}=this.rendererPosition;this.width=o,this.height=l,this.options=B({addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000"},i||{}),this.stylesheet=new pl({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
|
|
91
91
|
background: ${this.options.background};
|
|
92
|
-
`)),this.options.widthStylesheet&&this.container.appendChild(this.stylesheet.getElement())}isReady(){return!0}resize(){this.rendererPosition=this.container.getBoundingClientRect(),this.width=this.rendererPosition.width,this.height=this.rendererPosition.height}getRendererScreenPosition(){return this.rendererPosition}afterFrame(e,i,o){this.stylesheet.updateSheet();for(const l of this.previouslyVisible)this.currentlyVisible.indexOf(l)===-1&&this.container.removeChild(l);for(const l of this.currentlyVisible)this.previouslyVisible.indexOf(l)===-1&&this.container.appendChild(l);this.previouslyVisible=this.currentlyVisible,this.currentlyVisible=[]}afterPaintLayer(e,i){}beforeFrame(e,i,o){this.stylesheet.clearClasses(),this.zIndex=0}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){if(Number.isNaN(e)||Number.isNaN(i))return this.lastKnownScale;const o=this.width/e,l=this.height/i,u=o<l?l:o;return Number.isNaN(u)||(this.lastKnownScale=u),this.lastKnownScale}getViewportBounds(e,i,o){return null}createImage(){const e=document.createElement("img");return this.options.imageClass?(e.className=this.options.imageClass,this.options.addPart&&e.setAttribute("part",this.options.imageClass)):(e.style.position="absolute",e.style.pointerEvents="none",e.style.userSelect="none"),this.options.setDraggableFalse&&e.setAttribute("draggable","false"),e}paint(e,i,o,l,u,d){if(this.pending=!1,this.zIndex++,e instanceof ot){if(!e.__host){const g=this.createImage();g.src=e.uri,e.__host=g,this.container.appendChild(e.__host)}const h=e.__host;this.currentlyVisible.push(h),h.style.zIndex=`${this.zIndex}`,h.style.opacity=`${e.style.opacity}`,this.options.widthStylesheet?h.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(d+Number.MIN_VALUE).toFixed(2)}px;`):(h.style.width=`${u+Number.MIN_VALUE}px`,h.style.height=`${d+Number.MIN_VALUE}px`),h.style.transform=`translate(${o}px, ${l}px)`}if(e instanceof en){if(e.__host||(e.__host={images:[]}),!e.__host.images[i]){const g=e.getImageUrl(i),p=this.createImage();p.src=g,e.__host.images[i]=p,this.container.appendChild(p)}const h=e.__host.images[i];h.style.zIndex=`${this.zIndex}`,h.style.opacity=`${e.style.opacity}`,this.currentlyVisible.push(h),this.options.widthStylesheet?h.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(d+Number.MIN_VALUE).toFixed(2)}px;`):(h.style.width=`${u+Number.MIN_VALUE}px`,h.style.height=`${d+Number.MIN_VALUE}px`),h.style.transform=`translate(${o}px, ${l}px)`}}pendingUpdate(){return this.pending}prepareLayer(e){}}function pd({interactive:r,viewport:e,forceRefresh:i,containerElement:o,overlayElement:l,controllerConfig:u,background:d}){if(!o)throw new Error("Invalid container");o.style.userSelect="none";const h=r?rl(B({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1},u||{})):void 0,g=new gd(o,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:d}),p=l?new Xo([g,new ml(l,{box:!0,text:!0,triggerResize:i})]):g,m=new Li(p,new mn(1024,1024),e,h?[h]:[]),
|
|
92
|
+
`)),this.options.widthStylesheet&&this.container.appendChild(this.stylesheet.getElement())}isReady(){return!0}resize(){this.rendererPosition=this.container.getBoundingClientRect(),this.width=this.rendererPosition.width,this.height=this.rendererPosition.height}getRendererScreenPosition(){return this.rendererPosition}afterFrame(e,i,o){this.stylesheet.updateSheet();for(const l of this.previouslyVisible)this.currentlyVisible.indexOf(l)===-1&&this.container.removeChild(l);for(const l of this.currentlyVisible)this.previouslyVisible.indexOf(l)===-1&&this.container.appendChild(l);this.previouslyVisible=this.currentlyVisible,this.currentlyVisible=[]}afterPaintLayer(e,i){}beforeFrame(e,i,o){this.stylesheet.clearClasses(),this.zIndex=0}getPointsAt(e,i,o,l){return e.getPointsAt(i,o,l)}getScale(e,i){if(Number.isNaN(e)||Number.isNaN(i))return this.lastKnownScale;const o=this.width/e,l=this.height/i,u=o<l?l:o;return Number.isNaN(u)||(this.lastKnownScale=u),this.lastKnownScale}getViewportBounds(e,i,o){return null}createImage(){const e=document.createElement("img");return this.options.imageClass?(e.className=this.options.imageClass,this.options.addPart&&e.setAttribute("part",this.options.imageClass)):(e.style.position="absolute",e.style.pointerEvents="none",e.style.userSelect="none"),this.options.setDraggableFalse&&e.setAttribute("draggable","false"),e}paint(e,i,o,l,u,d){if(this.pending=!1,this.zIndex++,e instanceof ot){if(!e.__host){const g=this.createImage();g.src=e.uri,e.__host=g,this.container.appendChild(e.__host)}const h=e.__host;this.currentlyVisible.push(h),h.style.zIndex=`${this.zIndex}`,h.style.opacity=`${e.style.opacity}`,this.options.widthStylesheet?h.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(d+Number.MIN_VALUE).toFixed(2)}px;`):(h.style.width=`${u+Number.MIN_VALUE}px`,h.style.height=`${d+Number.MIN_VALUE}px`),h.style.transform=`translate(${o}px, ${l}px)`}if(e instanceof en){if(e.__host||(e.__host={images:[]}),!e.__host.images[i]){const g=e.getImageUrl(i),p=this.createImage();p.src=g,e.__host.images[i]=p,this.container.appendChild(p)}const h=e.__host.images[i];h.style.zIndex=`${this.zIndex}`,h.style.opacity=`${e.style.opacity}`,this.currentlyVisible.push(h),this.options.widthStylesheet?h.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(d+Number.MIN_VALUE).toFixed(2)}px;`):(h.style.width=`${u+Number.MIN_VALUE}px`,h.style.height=`${d+Number.MIN_VALUE}px`),h.style.transform=`translate(${o}px, ${l}px)`}}pendingUpdate(){return this.pending}prepareLayer(e){}}function pd({interactive:r,viewport:e,forceRefresh:i,containerElement:o,overlayElement:l,controllerConfig:u,background:d}){if(!o)throw new Error("Invalid container");o.style.userSelect="none";const h=r?rl(B({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1},u||{})):void 0,g=new gd(o,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:d}),p=l?new Xo([g,new ml(l,{box:!0,text:!0,triggerResize:i})]):g,m=new Li(p,new mn(1024,1024),e,h?[h]:[]),S=new is(o,m);return{name:"static-preset",em:S,runtime:m,renderer:p,controller:h,container:o,overlay:l,unmount(){gl(m),m.stopControllers(),m.stop(),S&&S.stop()}}}const md={"default-preset":vl,"static-preset":pd},vd={};function yd(r,e){const i=y.useRef(),o=y.useRef(),l=y.useRef(),u=y.useRef(),d=y.useRef({width:e.width,height:e.height,didUpdate:!0}),[h="default-preset",g=vd]=Array.isArray(r)?r||[]:[r],[p,m]=y.useState(null);y.useLayoutEffect(()=>{const x=o.current,O=u.current,R=i.current,N=l.current,k=(md[h]||vl)(B({containerElement:O,canvasElement:x,overlayElement:R,navigatorElement:N,viewport:d.current,dpi:window.devicePixelRatio||1,forceRefresh:e.forceRefresh,unstable_webglRenderer:e.unstable_webglRenderer},g||{}));return m(k),()=>{k&&k.unmount()}},[h,g]);const S=y.useMemo(()=>({canvas:o,overlay:i,container:u,navigator:l}),[]);return[h,p,d,S]}function wd(r){return y.useMemo(()=>ns(r),r)}const bn=De.default.forwardRef((r,e)=>M("div",te(B({},r),{ref:e,part:r.className}))),Sd=j=>{var V=j,{htmlChildren:r,renderPreset:e,onCreated:i,mode:o="explore",resetWorldOnChange:l=!0,unstable_webglRenderer:u=!1,unstable_noReconciler:d=!1,hideInlineStyle:h=!1,controllerConfig:g,children:p,overlayStyle:m,containerStyle:S,enableNavigator:x,className:O,containerProps:R={},homePosition:N,background:I,debug:k}=V,P=St(V,["htmlChildren","renderPreset","onCreated","mode","resetWorldOnChange","unstable_webglRenderer","unstable_noReconciler","hideInlineStyle","controllerConfig","children","overlayStyle","containerStyle","enableNavigator","className","containerProps","homePosition","background","debug"]);const[W,Q]=y.useState(I),[J,q]=y.useState(o),[b,le]=y.useState(!1),fe=y.useMemo(()=>(typeof e=="string"&&(e=[e,{}]),W||k?e?[e[0],B({debug:k,background:W},e[1]||{})]:["default-preset",{background:W,debug:k}]:e||"default-preset"),[e,W,k]),[Ee,re,Tt]=ol({scroll:!0}),Ve=y.useRef(),gt=ge=>{Ve.current=ge,Ee(ge)},[on,F,ue,bt]=yd(fe,{width:P.width,height:P.height,forceRefresh:Tt,unstable_webglRenderer:u}),[A,K]=y.useState("");y.useEffect(()=>{q(o)},[o]),y.useEffect(()=>{F&&F.em&&F.em.updateBounds()},[F,re]),y.useEffect(()=>{F&&F.runtime&&(F.runtime.mode=J),b&&F&&(F.ready=!0)},[F,b,J]),y.useEffect(()=>{F&&(F.runtime.manualHomePosition=!!N,F.runtime.setHomePosition(N))},[F,N]),y.useEffect(()=>{if(F){const ge=F.runtime;ge.resize(ue.current.width,P.width,ue.current.height,P.height),ue.current.width=P.width,ue.current.height=P.height,ge.updateNextFrame(),ue.current.didUpdate=!0}},[F,P.width,P.height]),y.useLayoutEffect(()=>{F&&(F.overlay&&(F.overlay.style.width=`${re.width}px`,F.overlay.style.height=`${re.height}px`),F.container&&(F.container.style.width=`${re.width}px`,F.container.style.height=`${re.height}px`))},[F,re.height,re.width]),y.useLayoutEffect(()=>{const ge=()=>{if(F){const Se=F.runtime;ue.current.width!==P.width&&ue.current.height!==P.height&&(Se.resize(ue.current.width,P.width,ue.current.height,P.height),ue.current.width=P.width,ue.current.height=P.height,Se.updateNextFrame(),ue.current.didUpdate=!0)}};return window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[F,P.height,P.width]);const ne={width:120},ce=()=>{if(F&&F.navigator){const ge=F.runtime.world.height,Se=F.runtime.world.width,me=window.devicePixelRatio||1,Pe=ne.width,ct=ne.width/Se*ge;F.navigator.width=Pe*me,F.navigator.height=ct*me,F.navigator.style.width=Pe+"px",F.navigator.style.height=ct+"px"}};y.useLayoutEffect(()=>{if(F){ce();const ge=F.runtime;return ge.world.addLayoutSubscriber(Se=>{Se==="recalculate-world-size"&&(ce(),ge.resize(ue.current.width,P.width,ue.current.height,P.height))})}return()=>{}},[F]);const we=y.useCallback(function(Se){const me=()=>{le(!0)};return y.useEffect(()=>{if(F){F.runtime.goHome();const Pe=i&&i(F);return void(Pe&&Pe.then?Pe.then(me):me())}else throw new Error("Invalid configuration - no runtime found")},[]),Se.children},[F]);y.useEffect(()=>{if(F){const ge=F.runtime;if(l)return ge.world.addLayoutSubscriber(Se=>{Se==="recalculate-world-size"&&ge.goHome()})}return()=>{}},[F,l]),y.useEffect(()=>F?F.runtime.registerHook("useBeforeFrame",()=>{var Se;if(ue.current.didUpdate&&F.canvas){const me=window.devicePixelRatio||1,Pe=ue.current.width,ct=ue.current.height;F.canvas.width=Pe*me,F.canvas.height=ct*me,F.canvas.style.width=Pe+"px",F.canvas.style.height=ct+"px",(Se=F.canvas.getContext("2d"))==null||Se.scale(me,me),F&&F.em&&F.em.updateBounds(),ue.current.didUpdate=!1}}):()=>{},[F,l]),y.useEffect(()=>{const ge=()=>{F&&(q("sketch"),K("mode-sketch")),window.removeEventListener("keyup",ge)},Se=me=>{if(me.code==="Space"&&F&&F.runtime.mode==="sketch"){if(me.target&&me.target.tagName&&me.target.tagName.toLowerCase()==="input")return;me.preventDefault(),q("explore"),K("mode-explore"),window.addEventListener("keyup",ge)}};return window.addEventListener("keydown",Se),()=>{window.removeEventListener("keydown",Se),window.removeEventListener("keyup",ge)}},[F]),y.useLayoutEffect(()=>{if(Ve.current&&!W){const Se=getComputedStyle(Ve.current).getPropertyValue("--atlas-background");Se&&Q(Se)}},[W]);const Xn=P,{height:lt,width:at}=Xn,ut=St(Xn,["height","width"]),Ze=wd([P.width,P.height]);return Te(bn,{ref:gt,className:["atlas",h?"":`atlas-width-${Ze}`,A,O].filter(Boolean).join(" ").trim(),style:B(B({},S),h?{}:{width:P.width,height:P.height}),children:[on==="static-preset"?M(bn,B({className:"atlas-static-container",style:F&&F.controller?void 0:{pointerEvents:"none"},ref:bt.container,tabIndex:0},R)):M("canvas",te(B(B({className:"atlas-canvas",part:"atlas-canvas",tabIndex:0},ut),R),{ref:bt.canvas})),M(bn,{className:"atlas-overlay",style:B({},m||{}),ref:bt.overlay,children:d?M(we,{children:M(ts.Provider,{value:re,children:M(Jr.Provider,{value:J,children:M(es.Provider,{value:F,children:p})})})}):M(hd,{bounds:re,preset:F,mode:J,setIsReady:le,onCreated:i,children:p})}),x?M(bn,{className:"atlas-navigator",children:M("canvas",{className:"atlas-navigator-canvas",part:"atlas-navigator-canvas",ref:bt.navigator})}):null,h?M("style",{children:`.atlas-width-${Ze} { width: ${P.width}px; height: ${P.height}px; }`}):M("style",{children:`
|
|
93
93
|
.atlas { position: relative; user-select: none; display: flex; background: var(--atlas-background, #000); z-index: var(--atlas-z-index, 10); touch-action: none; }
|
|
94
94
|
.atlas-width-${Ze} { width: ${P.width}px; height: ${P.height}px; }
|
|
95
95
|
.atlas-canvas { flex: 1 1 0px; }
|
|
@@ -100,14 +100,14 @@ No matching component was found for:
|
|
|
100
100
|
.atlas-static-image { position: absolute; pointer-events: none; user-select: none; transform-origin: 0px 0px; }
|
|
101
101
|
.atlas-navigator { position: absolute; top: var(--atlas-navigator-top, 10px); right: var(--atlas-navigator-bottom, 10px); left: var(--atlas-navigator-left); bottom: var(--atlas-navigator-bottom); opacity: .8 }
|
|
102
102
|
.atlas-navigator-canvas { width: 100%; }
|
|
103
|
-
`}),r]})};function Ed(r){return Number(r)==r?`${r}px`:r}const xd=l=>{var u=l,{resizeHash:r,aspectRatio:e,containerProps:i={}}=u,o=St(u,["resizeHash","aspectRatio","containerProps"]);const[d,h,g]=ol(),O=o,{height:p,width:m}=O,
|
|
103
|
+
`}),r]})};function Ed(r){return Number(r)==r?`${r}px`:r}const xd=l=>{var u=l,{resizeHash:r,aspectRatio:e,containerProps:i={}}=u,o=St(u,["resizeHash","aspectRatio","containerProps"]);const[d,h,g]=ol(),O=o,{height:p,width:m}=O,S=St(O,["height","width"]);y.useEffect(()=>{g()},[m,p,r,g]);const x=y.useMemo(()=>e?{width:h.width,height:h.width*(1/e)}:h,[h,e]);return Te(bn,te(B({ref:d,className:"atlas-container"},i),{children:[x.width?M(Sd,te(B({width:x.width||100,height:x.height||100},S),{children:o.children})):null,o.hideInlineStyle?null:M("style",{children:`
|
|
104
104
|
.atlas-container {
|
|
105
105
|
display: var(--atlas-container-display, block);
|
|
106
106
|
flex: var(--atlas-container-flex, none);
|
|
107
107
|
width: var(--atlas-container-width, ${m?`${m}px`:"100%"});
|
|
108
|
-
height: var(--atlas-container-height, ${Ed(p||(e?
|
|
108
|
+
height: var(--atlas-container-height, ${Ed(p||(e?x.height:512))})
|
|
109
109
|
}
|
|
110
|
-
`}),o.htmlChildren]}))},_d=()=>y.useContext(es),bi=()=>{const r=_d();return r?r.runtime:void 0},yl=(r,e=[])=>{const i=bi();y.useEffect(()=>i?i.registerHook("useFrame",r):()=>{},e)};function Pd(){return y.useContext(ts)}async function Cd(r,e,i){if(y.version.startsWith("18.")){const o=await Promise.resolve().then(function(){return dh}),l=o.default?o.default.createRoot:o.createRoot;i.current||(i.current=l(r)),i.current.render(e)}else if(typeof ReactDOM!="undefined"){const{render:o}=ReactDOM;o(e,r)}else{const o=await import("react-dom");(o.default?o.default.render:o.render)(e,r)}}const rs=De.default.forwardRef((o,i)=>{var l=o,{children:r}=l,e=St(l,["children"]);const u=y.useRef(),d=bi(),h=y.useRef(0),g=y.useRef(),p=y.useRef();return yl(()=>{if(e.relative){const m=u.current;if(m&&d){const w=d.getScaleFactor();h.current!==w&&(h.current=w,m.style.transformOrigin="0 0",m.style.transform=`scale(${1/h.current})`,m.style.width=`${h.current*100}%`,m.style.height=`${h.current*100}%`)}}},[e.relative]),y.useLayoutEffect(()=>{const m=g.current;i&&m&&(typeof i=="function"?i(m):i.current=m);async function w(){if(m&&m.__host){const _=e.relative?M("div",{ref:u,children:r}):r;await Cd(m.__host.element,_,p)}}m&&m.__host?w():m&&(m.__onCreate=w)},[i,r,g,e.relative]),y.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),M("box",te(B({html:!0},e),{ref:g}))});rs.displayName="HTMLPortal";const wl=(r,e,i=[])=>{const o=bi(),l=o?o.world:void 0;y.useEffect(()=>{if(o){const u=e,d=pn[r];o.world.activatedEvents.push(d);const h=d.slice(2).toLowerCase();return o.world.addEventListener(h,u),()=>{o.world.removeEventListener(h,u)}}return()=>{}},[l,r,...i])};function Sl(r,e){if(r===0)return[0,1];if(e===0)return[1,0];const i=Math.abs(r)/Math.abs(e);return[i,1-i]}function Td(){const r=y.useRef({ctrl:!1,shift:!1,alt:!1});return y.useLayoutEffect(()=>{function e(o){o.key==="Shift"&&(r.current.shift=!0),o.key==="Control"&&(r.current.ctrl=!0),o.key==="Alt"&&(r.current.alt=!0)}function i(o){o.key==="Shift"&&(r.current.shift=!1),o.key==="Control"&&(r.current.ctrl=!1),o.key==="Alt"&&(r.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)}},[]),r}const Id=(r,e)=>{const i=nd(),o=bi(),l=Pd(),u=y.useRef(),d=y.useRef(null),h=y.useRef(),[g,p]=y.useState(!1),m=y.useRef({north:0,south:0,east:0,west:0}),w=Td(),_=k=>P=>{if(p(!0),l&&o){const{top:j,left:V}=l,W=o.viewerToWorld(P.pageX-V,P.pageY-j);h.current={x:W.x,y:W.y},u.current=k}},O=y.useMemo(()=>r.width/r.height,[r.width,r.height]),R=y.useCallback(k=>{if(!Math.abs(k.north-k.south+(k.east-k.west)))return;const j=-k.west+k.east,V=-k.north+k.south,W=r.width+j,Q=r.height+V;if(W/Q>=O){const q=Q*O,b=W-q,[le,fe]=Sl(k.east,k.west);k.west=k.west+b*fe,k.east=k.east-b*le}else{const q=W/O,b=Q-q,[le,fe]=Sl(k.north,k.south);k.north=k.north+b*le,k.south=k.south-b*fe}},[r.width,r.height,O]);yl(()=>{h&&o&&o.updateNextFrame()}),y.useEffect(()=>{o&&o.updateNextFrame()},[o,g]);const N=y.useCallback(k=>{var P;const j=k.atlasTouches?k.atlasTouches[0]:k.atlas?k.atlas:{x:k.pageX,y:k.pageY};if(!o||o.mode!=="sketch")return;const V=d.current,W=!r.maintainAspectRatio&&w.current.alt,Q=!W&&w.current.shift&&((P=u.current)==null?void 0:P.indexOf("-"))!==-1;if((u.current==="translate"||u.current==="east"||u.current==="north-east"||u.current==="south-east")&&(m.current.east=j.x-(h.current?h.current.x:0),W&&(m.current.west=-m.current.east)),(u.current==="translate"||u.current==="west"||u.current==="north-west"||u.current==="south-west")&&(m.current.west=j.x-(h.current?h.current.x:0),W&&(m.current.east=-m.current.west)),(u.current==="translate"||u.current==="north"||u.current==="north-east"||u.current==="north-west")&&(m.current.north=j.y-(h.current?h.current.y:0),W&&(m.current.south=-m.current.north)),(u.current==="translate"||u.current==="south"||u.current==="south-west"||u.current==="south-east")&&(m.current.south=j.y-(h.current?h.current.y:0),W&&(m.current.north=-m.current.south)),(r.maintainAspectRatio||Q)&&R(m.current),V){const J=m.current.west,q=m.current.north,b=r.width+m.current.east,le=r.height+m.current.south;V.points[1]=Math.min(J,b),V.points[2]=Math.min(q,le),V.points[3]=Math.max(J,b),V.points[4]=Math.max(q,le),o.updateNextFrame()}},[o,r.width,r.height,r.maintainAspectRatio]);wl("mousemove",N,[r.width,r.height]),wl("pointermove",N,[r.width,r.height]);const I=y.useRef();return y.useEffect(()=>{I.current=()=>{if(g){const k=m.current.west,P=m.current.north,j=r.width+m.current.east,V=r.height+m.current.south,W=Math.min(k,j),Q=Math.min(P,V),J=Math.max(k,j),q=Math.max(P,V),b={x:(r.x||0)+W,y:(r.y||0)+Q,width:J-W||1,height:q-Q||1};r.maintainAspectRatio,e(b),u.current=void 0,h.current=void 0,m.current.east=0,m.current.west=0,m.current.north=0,m.current.south=0,p(!1)}}},[g,e,r.height,r.width,r.x,r.y]),y.useEffect(()=>{const k=()=>{I.current&&I.current()};return window.addEventListener("pointerup",k),window.addEventListener("touchend",k),()=>{window.removeEventListener("pointerup",k),window.removeEventListener("touchend",k)}},[]),{portalRef:d,mode:i,mouseEvent:_,onPointerMoveCallback:N,isEditing:g}};function kd(h){var g=h,{handleSize:r,resizable:e,onSave:i,children:o,maintainAspectRatio:l,disableCardinalControls:u}=g,d=St(g,["handleSize","resizable","onSave","children","maintainAspectRatio","disableCardinalControls"]);const p=typeof r=="undefined"?l?10:8:r,{portalRef:m,mode:w,mouseEvent:_,isEditing:O}=Id({x:d.x||0,y:d.y||0,width:d.width,height:d.height,maintainAspectRatio:l},i),R=y.useMemo(()=>_("translate"),[_]),N=y.useMemo(()=>_("east"),[_]),I=y.useMemo(()=>_("west"),[_]),k=y.useMemo(()=>_("south"),[_]),P=y.useMemo(()=>_("north"),[_]),j=y.useMemo(()=>_("south-east"),[_]),V=y.useMemo(()=>_("south-west"),[_]),W=y.useMemo(()=>_("north-east"),[_]),Q=y.useMemo(()=>_("north-west"),[_]),J=w==="sketch",q={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:l||u?"50%":2,position:"absolute",background:"#fff",pointerEvents:O?"none":J?"initial":"none"};return M(Et,{children:Te("world-object",te(B({},d),{children:[o,J&&e?M(rs,{ref:m,target:{x:0,y:0,height:d.height,width:d.width},relative:!0,interactive:!1,children:J&&e?Te(Et,{children:[M("div",{onMouseDown:R,onTouchStart:R,style:{display:"block",width:"100%",height:"100%",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:O?"none":J?"initial":"none"}}),l?null:Te(Et,{children:[M("div",{title:"east",onTouchStart:N,onMouseDown:N,style:te(B({},q),{cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:u?0:1,transform:`translate(${p/2}px, -${p}px)`})}),M("div",{title:"west",onMouseDown:I,style:te(B({},q),{cursor:"w-resize",position:"absolute",height:p*2,width:p,left:0,top:"50%",opacity:u?0:1,transform:`translate(-${p/2}px, -${p}px)`})}),M("div",{title:"north",onMouseDown:P,style:te(B({},q),{cursor:"n-resize",position:"absolute",height:p,width:p*2,left:"50%",top:0,opacity:u?0:1,transform:`translate(-${p}px, -${p/2}px)`})}),M("div",{title:"south",onMouseDown:k,style:te(B({},q),{cursor:"s-resize",position:"absolute",height:p,width:p*2,left:"50%",bottom:0,opacity:u?0:1,transform:`translate(-${p}px, ${p/2}px)`})})]}),M("div",{title:"north-east",onMouseDown:W,style:te(B({},q),{cursor:"ne-resize",position:"absolute",height:p,width:p,right:0,top:0,transform:`translate(${p/2}px, -${p/2}px)`})}),M("div",{title:"south-east",onMouseDown:j,style:te(B({},q),{cursor:"se-resize",position:"absolute",height:p,width:p,bottom:0,right:0,transform:`translate(${p/2}px, ${p/2}px)`})}),M("div",{title:"south-west",onMouseDown:V,style:te(B({},q),{cursor:"sw-resize",position:"absolute",height:p,width:p,bottom:0,left:0,transform:`translate(-${p/2}px, ${p/2}px)`})}),M("div",{title:"north-west",onMouseDown:Q,style:te(B({},q),{cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`})})]}):null}):null]}))})}function Md({interactive:r,region:e,onClick:i,onSave:o,maintainAspectRatio:l,disableCardinalControls:u,isEditing:d,style:h={backgroundColor:"rgba(0,0,0,.5)"}}){const g=y.useCallback(p=>{o(B({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width},p))},[o,e.id,e.x,e.y,e.height,e.width]);return M(kd,{x:e.x,y:e.y,width:e.width,height:e.height,resizable:d,onSave:g,maintainAspectRatio:l,disableCardinalControls:u,children:M("box",{interactive:r,onClick:p=>{p.preventDefault(),p.stopPropagation(),i(e)},target:{x:0,y:0,width:e.width,height:e.height},style:h})})}const Ld=r=>{const e=r.width/r.tiles.width,i=r.tiles.imageService.tiles||[],o=r.tiles.imageService.sizes||[],l=y.useMemo(()=>{const u=r.tiles.imageService.id||r.tiles.imageService["@id"];return u&&u.endsWith("/info.json")?u.slice(0,-1*10):u},[r.tiles.imageService.id]);return M("world-object",{scale:e,height:r.tiles.height,width:r.tiles.width,x:r.x,y:r.y,onClick:r.onClick,children:Te("composite-image",{id:r.tiles.imageService.id,width:r.tiles.width,height:r.tiles.height,children:[r.tiles.thumbnail?M("world-image",{priority:!0,uri:r.tiles.thumbnail.id,target:{width:r.tiles.width,height:r.tiles.height},display:{width:r.tiles.thumbnail.width,height:r.tiles.thumbnail.height}}):null,o.map((u,d)=>M("world-image",{uri:`${l}/full/${u.width},${u.height}/0/default.jpg`,target:{width:r.tiles.width,height:r.tiles.height},display:{width:u.width,height:u.height}},d)),i.map(u=>(u.scaleFactors||[]).map(d=>M("tiled-image",{uri:r.tiles.imageService.id,display:{width:r.tiles.width,height:r.tiles.height},tile:u,scaleFactor:d},`${r.tiles.imageService.id}-tile-${d}`)))]},r.tiles.imageService.id)},r.tiles.imageService.id)};function Od(r,e){return r?e?te(B(B({},r),e||{}),{":hover":r[":hover"]?Object.assign(r[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":r[":active"]?Object.assign(r[":active"]||{},e[":active"]||{}):e[":hover"]}):r:e}function ss(r,e){return ss=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},ss(r,e)}function Nd(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ss(r,e)}var Rd=function(e,i){return e===void 0&&(e=[]),i===void 0&&(i=[]),e.length!==i.length||e.some(function(o,l){return!Object.is(o,i[l])})},El={error:null},zd=function(r){Nd(e,r);function e(){for(var o,l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return o=r.call.apply(r,[this].concat(u))||this,o.state=El,o.resetErrorBoundary=function(){for(var h,g=arguments.length,p=new Array(g),m=0;m<g;m++)p[m]=arguments[m];o.props.onReset==null||(h=o.props).onReset.apply(h,p),o.reset()},o}e.getDerivedStateFromError=function(l){return{error:l}};var i=e.prototype;return i.reset=function(){this.setState(El)},i.componentDidCatch=function(l,u){var d,h;(d=(h=this.props).onError)==null||d.call(h,l,u)},i.componentDidUpdate=function(l,u){var d=this.state.error,h=this.props.resetKeys;if(d!==null&&u.error!==null&&Rd(l.resetKeys,h)){var g,p;(g=(p=this.props).onResetKeysChange)==null||g.call(p,l.resetKeys,h),this.reset()}},i.render=function(){var l=this.state.error,u=this.props,d=u.fallbackRender,h=u.FallbackComponent,g=u.fallback;if(l!==null){var p={error:l,resetErrorBoundary:this.resetErrorBoundary};if(Hr.isValidElement(g))return g;if(typeof d=="function")return d(p);if(h)return Hr.createElement(h,p);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(Hr.Component);const Ad={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},Bi=De.default.createContext(Ad),Pt=()=>y.useContext(Bi);function Ut({value:r,children:e}){const i=Pt(),o=y.useMemo(()=>B(B({},i),r),[r,i]);return M(Bi.Provider,{value:o,children:e})}const Bn=De.default.createContext({vault:null,setVaultInstance:r=>{}});function xl({vault:r,vaultOptions:e,useGlobal:i,resources:o,children:l}){const[u,d]=y.useState(()=>r||(i?ke.globalVault(e):e?new ke.Vault(e):new ke.Vault));return M(Bn.Provider,{value:{vault:u,setVaultInstance:d},children:M(Ut,{value:o||{},children:l})})}const Me=()=>{const{vault:r}=y.useContext(Bn);if(r===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return r};function os(r,{noCache:e=!1}={}){const i=typeof r=="string"?r:r.id,o=Me(),[l,u]=y.useState(i),[d,h]=y.useState(void 0),g=y.useMemo(()=>o.get(i,{skipSelfReturn:!0})||void 0,[i,o]),[p,m]=y.useState(g);return y.useEffect(()=>{(async()=>{try{const w=g&&!e?g:await o.load(i),_=w?w.id||w["@id"]:null;w&&l!==_&&u(_),m(w)}catch(w){h(w)}})()},[i,e]),{isLoaded:!!p,id:l,requestId:i,error:d,resource:p,cached:!!(p&&p===g)}}function _l(r,e){const{id:i,isLoaded:o,error:l,resource:u,requestId:d,cached:h}=os(r,e);return{id:i,isLoaded:o,error:l,manifest:u,requestId:d,cached:h}}function Pl({manifest:r,children:e}){return M(Ut,{value:{manifest:r},children:e})}function ls({canvas:r,children:e}){return M(Ut,{value:{canvas:r},children:e})}function Ne(r,e=[]){const i=Me(),[o,l]=y.useState(()=>r(i.getState(),i));return y.useEffect(()=>i.subscribe(u=>r(u,i),u=>{l(u)},!1),e),o}const jn=De.default.createContext([]);function Cl(){const r=y.useContext(jn);return Ne(e=>r.map(i=>e.iiif.entities.Canvas[i]).filter(Boolean),[r])}function nn(r={},e=[]){const{id:i,selector:o}=r,l=Pt();Me();const u=i||l.manifest,d=Ne(h=>u?h.iiif.entities.Manifest[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}function Tl({range:r,children:e}){return M(Ut,{value:{range:r},children:e})}function Il(r,e){for(const i of e.items){if(i.type==="Canvas")return i;if(i.type==="Range"){const o=Il(r,r.get(i));if(o)return o}}return null}function as(r,e){const i=[];for(const o of e.items)if(o.type==="Canvas"&&(o.id.indexOf("#")!==-1?i.push({id:o.id.split("#")[0],type:"Canvas"}):i.push(o)),o.type==="Range"&&i.push(...as(r,r.get(o))),o.type==="SpecificResource"){const l=typeof o.source=="string"?o.source:o.source.id;i.push({id:l,type:"Canvas"})}return i}function Fd(r,e,i){for(const o of e.structures){const l=us(r,r.get(o),i);if(l)return l}return null}function us(r,e,i){var o;for(const l of e.items){const u=(o=l.id)==null?void 0:o.split("#")[0];if(l.type==="SpecificResource"&&l.source===i||l.type==="Canvas"&&i===u)return e;if(l.type==="Range"){const d=us(r,r.get(l),i);if(d)return d}}return null}function Dd(r,e,i,o=!1){const l=e.behavior,u=i?r.get(i):null;if(!u)return[];const d=u.behavior,h=o?!1:l.includes("paged"),g=h?!1:l.includes("continuous"),p=h||g?!1:l.includes("individuals"),m=d.includes("facing-pages"),w=d.includes("non-paged");if(m||w||p||o)return[{id:u.id,type:"Canvas"}];const[_,O]=cs(r,e);if(g)return _;const R=_.findIndex(N=>N.id===i);if(R===-1)return[];for(const N of O)if(N.includes(R))return N.map(I=>_[I]);return[{id:u.id,type:"Canvas"}]}function cs(r,e,{disablePaging:i}={}){const o=e.behavior,l=o.includes("paged"),u=l?!1:o.includes("continuous"),d=l||u?!1:o.includes("individuals"),h=e.type==="Manifest"?e.items:as(r,e);if(u)return[h,[h.map((w,_)=>_)]];if(d||!l||i)return[h,h.map((w,_)=>[_])];const g=[];let p=[];const m=()=>{p.length&&(g.push([...p]),p=[])};for(let w=0;w<h.length;w++){const _=r.get(h[w]);if(w===0||_.behavior.includes("facing-pages")){m(),g.push([w]);continue}_.behavior.includes("non-paged")||(p.push(w),p.length>1&&m())}return p.length&&m(),[h,g]}function kl(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.range,d=Ne(h=>u?h.iiif.entities.Range[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}function Ml({startCanvas:r,disablePaging:e}){var R;const i=Me(),o=nn(),l=kl(),[u,d]=y.useState(void 0),h=l||o;if(!h)throw new Error("Nothing selected");const[g,p]=y.useMemo(()=>cs(i,h,{disablePaging:e}),[i,h]),m=y.useCallback(N=>{const I=p.findIndex(k=>k.includes(N));d(I===-1?0:I)},[g,p]),w=y.useCallback(N=>{const I=g.findIndex(k=>k.id===N);I!==-1?m(I):d(0)},[g,p]),_=y.useCallback(()=>{d(N=>N>=p.length?N:N+1)},[p]),O=y.useCallback(()=>{d(N=>N<=0?0:N-1)},[p]);return typeof u=="undefined"&&(r?w(r):d(0)),{visibleItems:((R=p[u])==null?void 0:R.map(N=>g[N].id))||[],cursor:u,items:g,sequence:p,setSequenceIndex:d,setCanvasIndex:m,setCanvasId:w,next:_,previous:O}}const Hn=()=>{},Vn=y.createContext({setCurrentCanvasId:Hn,setCurrentCanvasIndex:Hn,nextCanvas:Hn,previousCanvas:Hn,items:[],sequence:[],setSequenceIndex:Hn,currentSequenceIndex:0});function Ll(r){const e=nn(),{cursor:i,visibleItems:o,next:l,sequence:u,items:d,setCanvasIndex:h,setCanvasId:g,previous:p,setSequenceIndex:m}=Ml({startCanvas:r.startCanvas,disablePaging:r.pagingEnabled===!1}),w=y.useMemo(()=>({sequence:u,items:d,setCurrentCanvasId:g,nextCanvas:l,previousCanvas:p,totalCanvases:d.length,setCurrentCanvasIndex:h,setSequenceIndex:m,currentSequenceIndex:i}),[u,d,g,l,p,d,h,m,i]);return e?M(Vn.Provider,{value:w,children:M(jn.Provider,{value:o,children:M(ls,{canvas:o[0],children:r.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),M("div",{children:"Sorry, something went wrong."}))}function Ud(r){const e=_l(r.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),M("div",{children:"Sorry, something went wrong."});if(!e.isLoaded)return M("div",{children:"Loading..."});const i=M(Ll,te(B({},r),{children:r.children}));return M(Pl,{manifest:e.id,children:r.rangeId?M(Tl,{range:r.rangeId,children:i}):i})}function bd(){return y.useContext(Vn)}function Ol(){return{VaultContext:y.useContext(Bn),ResourceContext:y.useContext(Bi),SimpleViewerReactContext:y.useContext(Vn),VisibleCanvasReactContext:y.useContext(jn)}}function Nl(r){return M(xl,{vault:r.bridge.VaultContext.vault||void 0,resources:r.bridge.ResourceContext,children:M(jn.Provider,{value:r.bridge.VisibleCanvasReactContext,children:M(Vn.Provider,{value:r.bridge.SimpleViewerReactContext,children:r.children})})})}function Rl(r){return r==null}function zl(r){throw new Error("Argument "+r+" is empty.")}function Bd(r){return typeof r=="string"||typeof r=="symbol"}function Al(r){return!Bd(r)}function Fl(r){throw new Error("Argument "+r+" is invalid, it should be an action type of type: string | symbol")}function jd(r,e){return Rl(r)&&zl(1),Al(r)&&Fl(1),Object.assign(function(){var i=e!=null?e.apply(void 0,arguments):void 0;return Object.assign({type:r},i)},{getType:function(){return r},toString:function(){return r}})}function Re(r,e,i){return Rl(r)&&zl(1),Al(r)&&Fl(1),function(){return jd(r,function(){var o=arguments.length<=0?void 0:arguments[0],l=arguments.length<=1?void 0:arguments[1];return e==null&&i==null||(o=e!=null?e.apply(void 0,arguments):void 0,l=i!=null?i.apply(void 0,arguments):void 0),Object.assign({},o!==void 0&&{payload:o},{},l!==void 0&&{meta:l})})}}const Hd="@iiif/IMPORT_ENTITIES",Vd="@iiif/MODIFY_ENTITY_FIELD",Wd="@iiif/REORDER_ENTITY_FIELD",Qd="@iiif/ADD_REFERENCE",Xd="@iiif/REMOVE_REFERENCE",Yd=Re(Hd)(),qd=Re(Vd)(),Zd=Re(Wd)(),Gd=Re(Qd)(),Kd=Re(Xd)(),ds={importEntities:Yd,modifyEntityField:qd,reorderEntityField:Zd,addReference:Gd,removeReference:Kd},Jd="@iiif/ADD_MAPPING",$d="@iiif/ADD_MAPPINGS";Re(Jd)(),Re($d)();const eh="@iiif/SET_META_VALUE",th="@iiif/SET_META_VALUE_DYNAMIC",nh="@iiif/UNSET_META_VALUE";Re(eh)(),Re(th)(),Re(nh)();const ih="@iiif/REQUEST_RESOURCE",rh="@iiif/REQUEST_ERROR",sh="@iiif/REQUEST_MISMATCH",oh="@iiif/REQUEST_COMPLETE",lh="@iiif/REQUEST_OFFLINE_RESOURCE";Re(ih)(),Re(rh)(),Re(sh)(),Re(oh)(),Re(lh)();const ah="@iiif/BATCH",uh="@iiif/BATCH_IMPORT";Re(ah)(),Re(uh)();function Dl(){const e=Me().getStore();return y.useMemo(()=>i=>e.dispatch(i),[e])}function Ul(r){return typeof r!="string"&&r&&r.bindToVault}function bl(){const r=Me(),e=y.useRef([]),i=Dl(),o=y.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);y.useLayoutEffect(()=>{const h={id:o,type:"AnnotationPage",behavior:[],motivation:null,label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],logo:[],rendering:[],service:[]};i(ds.importEntities({entities:{AnnotationPage:{[h.id]:h}}}))},[o]);const l=Ne(h=>o?h.iiif.entities.AnnotationPage[o]:null,[o]),u=y.useCallback((h,g)=>{if(o){if(Ul(h)){const w=h;w.__vault||w.bindToVault(r),h=typeof w.source=="string"?w.source:w.source.id,e.current[h]=w}else typeof h!="string"&&(h=h.id);const p=r.get({id:o,type:"AnnotationPage"}),m=r.get({id:h,type:"Annotation"});p&&m&&(p.items.find(w=>w.id===m.id)||i(ds.addReference({id:o,type:"AnnotationPage",key:"items",reference:{id:h,type:"Annotation"},index:g})))}},[o]),d=y.useCallback(h=>{o&&(Ul(h)?h=typeof h.source=="string"?h.source:h.source.id:typeof h!="string"&&(h=h.id),e.current[h]&&e.current[h].beforeRemove(),r.get({id:o,type:"AnnotationPage"})&&i(ds.removeReference({id:o,type:"AnnotationPage",key:"items",reference:{id:h,type:"Annotation"}})))},[o]);return[l,{addAnnotation:u,removeAnnotation:d}]}const Bl=y.createContext(null);function jl(){const r=y.useContext(Bl);return[r.fullPage,{addAnnotation:r.addAnnotation,removeAnnotation:r.removeAnnotation}]}function Hl({children:r}){const[e,{addAnnotation:i,removeAnnotation:o}]=bl();return M(Bl.Provider,{value:y.useMemo(()=>({fullPage:e,addAnnotation:i,removeAnnotation:o}),[e]),children:r})}function ch({width:r,style:e,height:i}){return M("div",{style:te(B({width:r,height:i,minHeight:500},e||{}),{background:"#f9f9f9"}),children:"Unknown error"})}const ji=y.createContext(null);function Vl(){return y.useContext(ji)}const hs=De.default.createContext(null),fs=De.default.createContext(null);function vn({children:r,overlay:e}){const i=y.useContext(e?fs:hs),o=Vl();return y.useLayoutEffect(()=>{if(i)try{i.render(M(ji.Provider,{value:o,children:r}))}catch{}},[r,o]),null}var Hi={},Wl,Vi,Ql=Sc.default;Vi=Hi.createRoot=Ql.createRoot,Wl=Hi.hydrateRoot=Ql.hydrateRoot;var dh=wc({__proto__:null,default:Hi,get createRoot(){return Vi},get hydrateRoot(){return Wl}},[Hi]);function hh(l){var u=l,{children:r,errorFallback:e,outerContainerProps:i={}}=u,o=St(u,["children","errorFallback","outerContainerProps"]);const d=y.useRef(null),[h,g]=y.useState(),[p,m]=y.useState(),w=y.useRef(null),[_,O]=y.useState(),R=Ol(),N=e||ch;return y.useLayoutEffect(()=>{const I={};if(d.current){const k=document.createElement("div");d.current.appendChild(k),I.portal=Vi(k),g(I.portal)}if(w.current){const k=document.createElement("div");w.current.appendChild(k),I.overlayPortal=Vi(k),O(I.overlayPortal)}return()=>{g(null),O(null),setTimeout(()=>{I.portal&&I.portal.unmount(),I.overlayPortal&&I.overlayPortal.unmount()},0)}},[]),Te(zd,{fallbackRender:()=>M(N,B({},o)),children:[M(xd,te(B({},o),{containerProps:B({style:{position:"relative"}},o.containerProps||{}),htmlChildren:M("div",{ref:w}),onCreated:I=>{m(I),o.onCreated&&o.onCreated(I)},children:M(ji.Provider,{value:p,children:M(hs.Provider,{value:h,children:M(fs.Provider,{value:_,children:M(Nl,{bridge:R,children:M(Hl,{children:r})})})})})})),M("div",{ref:d})]})}function Xl(r){return{addEventListener(e,i,o,l){if(!!e)return r.setMetaValue([e.id,"eventManager",i],u=>{const d=u||[];for(const h of d)if(h.callback===o)return d;return[...d,{callback:o,scope:l}]}),o},removeEventListener(e,i,o){!e||r.setMetaValue([e.id,"eventManager",i],l=>(l||[]).filter(u=>u.callback!==o))},getListenersAsProps(e,i){const o=typeof e=="string"?{id:e}:e;if(!o||!o.id)return{};const l=r.getResourceMeta(o.id,"eventManager"),u={};if(l&&o)for(const d of Object.keys(l))u[d]=h=>{const g=r.get(o);for(const{callback:p,scope:m}of l[d]||[])(!m||i&&m.indexOf(i)!==-1)&&p(h,g)};return u}}}function gs(r,e){const i=Me(),o=y.useMemo(()=>Xl(i),[i]),l=Ne(()=>r&&r.id?i.getResourceMeta(r.id,"eventManager"):null,[r]);return y.useMemo(()=>r?o.getListenersAsProps(r,e):{},[l,r,i,e])}function ps(r){return{applyStyles(e,i,o){const l=typeof e=="string"?e:e.id;return r.setMetaValue([l,"styles",i],o)},getAppliedStyles(e){const i=typeof e=="string"?e:e.id;return r.getResourceMeta(i,"styles")}}}function Wn(r,e){const i=Me(),o=y.useMemo(()=>ps(i),[i]);return Ne(()=>{if(!r)return null;const l=o.getAppliedStyles(r.id);return l?e?l[e]:l:void 0},[r,e])}var fh=Object.defineProperty,gh=Object.defineProperties,ph=Object.getOwnPropertyDescriptors,Yl=Object.getOwnPropertySymbols,mh=Object.prototype.hasOwnProperty,vh=Object.prototype.propertyIsEnumerable,ql=(r,e,i)=>e in r?fh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,Zl=(r,e)=>{for(var i in e||(e={}))mh.call(e,i)&&ql(r,i,e[i]);if(Yl)for(var i of Yl(e))vh.call(e,i)&&ql(r,i,e[i]);return r},Gl=(r,e)=>gh(r,ph(e));const yh=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,wh=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;function Wi(r){if(Array.isArray(r))return r.reduce((e,i)=>{const{selector:o,selectors:l}=Wi(i);return o&&(e.selector||(e.selector=o),e.selectors.push(...l)),e},{selector:null,selectors:[]});if(!r)return{selector:null,selectors:[]};if(typeof r=="string"){const[e,i]=r.split("#");return i?Wi({type:"FragmentSelector",value:i}):{selector:null,selectors:[]}}if(r.type==="PointSelector"&&(r.t||r.t===0)){const e={type:"TemporalSelector",temporal:{startTime:r.t}};return{selector:e,selectors:[e]}}if(r.type==="FragmentSelector"){const e=yh.exec(r.value);if(e){const o={type:"BoxSelector",spatial:{unit:e[2]==="percent:"||e[2]==="pct:"?"percent":"pixel",x:parseFloat(e[3]),y:parseFloat(e[4]),width:parseFloat(e[5]),height:parseFloat(e[6])}};return{selector:o,selectors:[o]}}const i=r.value.match(wh);if(i){const o={type:"TemporalSelector",temporal:{startTime:i[4]?parseFloat(i[4]):0,endTime:i[7]?parseFloat(i[7]):void 0}};return{selector:o,selectors:[o]}}return{selector:null,selectors:[]}}return{selector:null,selectors:[]}}function rn(r,e={}){if(Array.isArray(r))return rn(r[0]);if(typeof r=="string"){const[i,o]=r.split("#");return o?rn({type:"SpecificResource",source:{id:i,type:"Unknown"},selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:{id:i,type:e.typeMap&&e.typeMap[i]||"Unknown"},selector:null,selectors:[]}}if(r.type==="Choice"||r.type==="List"||r.type==="Composite"||r.type==="Independents")return rn(r.items[0]);if(r.type==="SpecificResource"){r.source.type==="Canvas"&&r.source.partOf&&typeof r.source.partOf=="string"&&(r.source.partOf=[{id:r.source.partOf,type:"Manifest"}]);const{selector:i,selectors:o}=r.selector?Wi(r.selector):{selector:null,selectors:[]};return{type:"SpecificResource",source:r.source,selector:i,selectors:o}}if(r.id){r.type==="Canvas"&&r.partOf&&typeof r.partOf=="string"&&(r.partOf=[{id:r.partOf,type:"Manifest"}]);const[i,o]=r.id.split("#");return o?rn({type:"SpecificResource",source:Gl(Zl({},r),{id:i}),selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:Gl(Zl({},r),{id:i}),selector:null,selectors:[]}}return{type:"SpecificResource",source:r,selector:null,selectors:[]}}function ms(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=Me(),d=i||l.annotation,h=Ne(p=>d?p.iiif.entities.Annotation[d]:void 0,[d]),g=Ne(p=>h&&h.body?h.body.map(m=>m?p.iiif.entities[m.type][m.id]:null).filter(Boolean):[],[h]);return y.useMemo(()=>{if(!h)return;const p=te(B({},h),{body:g,target:rn(h.target,{typeMap:u.getState().iiif.mapping})});return o?o(p):p},[h,o,g,...e])}function Ct(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.canvas,d=Ne(h=>u?h.iiif.entities.Canvas[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}const Kl=({id:r,style:e,className:i,interactive:o})=>{const l=ms({id:r}),u=Wn(l,"atlas"),d=Wn(l,"html"),h=gs(l,["atlas"]),g=Ct(),p=y.useMemo(()=>Od(e,u),[e,u]);return g&&l&&l.target&&l.target.selector&&l.target.selector.type==="BoxSelector"&&l.target.source&&l.target.source.id===g.id?M(Md,B({id:l.id,isEditing:!0,region:l.target.selector.spatial,style:p,className:(d==null?void 0:d.className)||i,interactive:!!((d==null?void 0:d.href)||o),href:(d==null?void 0:d.href)||null,title:(d==null?void 0:d.title)||null,hrefTarget:(d==null?void 0:d.target)||null},h)):null},vs=({className:r,page:e})=>{var l;const i=Wn(e,"atlas"),o=Wn(e,"html");return Ne(u=>e.id?u.iiif.entities.AnnotationPage[e.id]:null,[]),M(y.Fragment,{children:(l=e.items)==null?void 0:l.map(u=>M(Kl,{id:u.id,style:i,className:(o==null?void 0:o.className)||r},u.id))})};function Jl({id:r,image:e,thumbnail:i,isStatic:o,x:l=0,y:u=0,children:d,onClick:h}){var g,p,m,w;return M(y.Fragment,{children:e.service?Te(y.Fragment,{children:[M(Ld,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:i&&i.type==="fixed"?i:void 0},x:((g=e.target)==null?void 0:g.spatial.x)+l,y:((p=e.target)==null?void 0:p.spatial.y)+u,width:(m=e.target)==null?void 0:m.spatial.width,height:(w=e.target)==null?void 0:w.spatial.height,onClick:h}),d]},"service"):Te(y.Fragment,{children:[M("world-image",{onClick:h,uri:e.id,target:e.target.spatial,display:e.width&&e.height?{width:e.width,height:e.height}:void 0}),d]},"no-service")},r)}var Sh=Object.defineProperty,Eh=Object.defineProperties,xh=Object.getOwnPropertyDescriptors,$l=Object.getOwnPropertySymbols,_h=Object.prototype.hasOwnProperty,Ph=Object.prototype.propertyIsEnumerable,ea=(r,e,i)=>e in r?Sh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,ta=(r,e)=>{for(var i in e||(e={}))_h.call(e,i)&&ea(r,i,e[i]);if($l)for(var i of $l(e))Ph.call(e,i)&&ea(r,i,e[i]);return r},na=(r,e)=>Eh(r,xh(e));const Ch=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,Th=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;function ys(r){if(Array.isArray(r))return r.reduce((e,i)=>{const{selector:o,selectors:l}=ys(i);return o&&(e.selector||(e.selector=o),e.selectors.push(...l)),e},{selector:null,selectors:[]});if(!r)return{selector:null,selectors:[]};if(typeof r=="string"){const[e,i]=r.split("#");return i?ys({type:"FragmentSelector",value:i}):{selector:null,selectors:[]}}if(r.type==="PointSelector"&&(r.t||r.t===0)){const e={type:"TemporalSelector",temporal:{startTime:r.t}};return{selector:e,selectors:[e]}}if(r.type==="FragmentSelector"){const e=Ch.exec(r.value);if(e){const o={type:"BoxSelector",spatial:{unit:e[2]==="percent:"||e[2]==="pct:"?"percent":"pixel",x:parseFloat(e[3]),y:parseFloat(e[4]),width:parseFloat(e[5]),height:parseFloat(e[6])}};return{selector:o,selectors:[o]}}const i=r.value.match(Th);if(i){const o={type:"TemporalSelector",temporal:{startTime:i[4]?parseFloat(i[4]):0,endTime:i[7]?parseFloat(i[7]):void 0}};return{selector:o,selectors:[o]}}return{selector:null,selectors:[]}}return{selector:null,selectors:[]}}function Qn(r,e={}){if(Array.isArray(r))return Qn(r[0]);if(typeof r=="string"){const[i,o]=r.split("#");return o?Qn({type:"SpecificResource",source:{id:i,type:"Unknown"},selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:{id:i,type:e.typeMap&&e.typeMap[i]||"Unknown"},selector:null,selectors:[]}}if(r.type==="Choice"||r.type==="List"||r.type==="Composite"||r.type==="Independents")return Qn(r.items[0]);if(r.type==="SpecificResource"){r.source.type==="Canvas"&&r.source.partOf&&typeof r.source.partOf=="string"&&(r.source.partOf=[{id:r.source.partOf,type:"Manifest"}]);const{selector:i,selectors:o}=r.selector?ys(r.selector):{selector:null,selectors:[]};return{type:"SpecificResource",source:r.source,selector:i,selectors:o}}if(r.id){r.type==="Canvas"&&r.partOf&&typeof r.partOf=="string"&&(r.partOf=[{id:r.partOf,type:"Manifest"}]);const[i,o]=r.id.split("#");return o?Qn({type:"SpecificResource",source:na(ta({},r),{id:i}),selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:na(ta({},r),{id:i}),selector:null,selectors:[]}}return{type:"SpecificResource",source:r,selector:null,selectors:[]}}function ia(r){return r.type==="SpecificResource"?[r.source,{selector:r.selector}]:[r,{selector:null}]}function ra(r,e,i){const o=[];let l=null;const u=[];for(const d of e){const h=r.get(d.body,{skipSelfReturn:!1});for(const g of h){if(!g)continue;const[p,{selector:m}]=ia(g),w=(p.type||"unknown").toLowerCase();if(w==="choice"){const _=r.get(p.items),O=i.length?i.map(R=>_.find(N=>N.id===R)).filter(Boolean):[_[0]];O.length===0&&O.push(_[0]),l={type:"single-choice",items:_.map(R=>({id:R.id,label:R.label,selected:O.indexOf(R)!==-1})),label:g.label},h.push(...O);continue}o.indexOf(w)===-1&&o.push(w),u.push({annotationId:d.id,type:w,resource:p,target:d.target,selector:m})}}return{types:o,items:u,choice:l}}function ws(r,e){const{selector:i,source:o}=Qn(e);if(o.id!==r.id)return[null,o];const l={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}};return[i?i.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:i.temporal,spatial:l.spatial}:i:null,o]}const sa={makeChoice:()=>{}},Qi={type:"unknown"},Le=r=>({type:"unknown",reason:r,annotations:{pages:[]}}),oa=(r,e)=>({type:"empty",width:r,height:e,annotations:{pages:[]},image:null,images:[]});function Ih(r,e){var o;const i=(o=r==null?void 0:r.iiif)==null?void 0:o.meta[e];return i?i.annotationPageManager:null}function kh(r,e){return Ne(i=>{const o=[];if(!r)return o;const l=Object.keys(i.iiif.entities.AnnotationPage);for(const u of l)if(!e||e.indexOf(u)!==-1){const d=Ih(i,u);d&&d.views&&d.views[r]&&o.push(u)}return o},[r,e])}function la({canvas:r,manifest:e,all:i,canvases:o}){const l=[];if(e)for(const u of e.annotations)l.indexOf(u.id)===-1&&l.push(u.id);if(i){if(o&&o.length)for(const u of o)for(const d of u.annotations)l.indexOf(d.id)===-1&&l.push(d.id)}else if(r)for(const u of r.annotations)l.indexOf(u.id)===-1&&l.push(u.id);return l}function Mh(r,e){var o;const i=(o=r==null?void 0:r.iiif)==null?void 0:o.meta[e];return i?i.annotationPageManager:null}function aa(r,e={}){const i=Me(),o=nn(),l=Ct(),u=Cl(),d=y.useMemo(()=>la({all:e.all,manifest:o,canvas:l,canvases:u}),[e.all,l,u,o]),h=kh(r,e.all?void 0:d),g=y.useCallback(m=>{!r||i.setMetaValue([m,"annotationPageManager","views"],w=>w&&!w[r]?w:te(B({},w||{}),{[r]:!1}))},[r,i]),p=y.useCallback((m,w={})=>{if(!r)return;const _=i.getState(),O=[];if(w!=null&&w.deselectOthers){const R=Object.keys(_.iiif.entities.AnnotationPage);for(const N of R){const I=Mh(_,N);I&&I.views&&I.views[r]&&O.push(N)}}for(const R of O)g(R);i.setMetaValue([m,"annotationPageManager","views"],R=>R&&R[r]?R:te(B({},R||{}),{[r]:!0}))},[r,g,i]);return{availablePageIds:d,enabledPageIds:h,setPageEnabled:p,setPageDisabled:g}}function ua(r,e){return Ne((i,o)=>o.get(r.map(l=>({id:l,type:e}))),[r,e])}const ca=De.default.createContext(new Jt.ImageServiceLoader);function Xi(){return y.useContext(ca)}function da(){const r=Xi(),[e,i]=y.useState({}),o=y.useRef(!1);return y.useEffect(()=>()=>{o.current=!0},[]),[y.useCallback((u,{height:d,width:h})=>{if(u){const g=u.id||u["@id"],p=r.loadServiceSync({id:g,width:u.width||h,height:u.height||d,source:u});p?u=p:e[g]||(o.current||i(m=>te(B({},m),{[g]:"loading"})),r.loadService({id:g,width:u.width||h,height:u.height||d}).then(()=>{o.current||i(m=>te(B({},m),{[g]:"done"}))}))}return u},[r,e]),e]}function Yi(r={}){const e=ms(),i=Ct(r.canvasId?{id:r.canvasId}:void 0);return Ne((o,l)=>{if(!i)return[];if(e&&r.enableSingleAnnotation)return[e];const u=l.get(i.items),d=[];for(const h of u)d.push(...l.get(h.items));return d},[i])}function ha(r,e=[]){const i=Me(),o=Yi({enableSingleAnnotation:r==null?void 0:r.enableSingleAnnotation}),[l,u]=y.useState((r==null?void 0:r.defaultChoices)||[]),d=y.useMemo(()=>ra(i,o,l),[i,o,l,...e]),g={makeChoice:y.useCallback((p,{deselectOthers:m=!0,deselect:w=!1}={})=>{if(d.choice){if(d.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");u(_=>{if(w){const R=_.filter(N=>N!==p);if(R.length===0){const N=d.items[0].resource.id;return N?[N]:[]}return R}if(m)return[p];const O=[..._];if(O.length===0&&d.items.length){const R=d.items[0].resource.id;R&&O.push(R)}return _.indexOf(p)!==-1?_:[..._,p]})}},[d.choice])};return[d,g]}function fa(r,e,i){const o=[];for(const l of e.items){const u=l.resource&&l.resource.type==="SpecificResource"?l.resource.source:l.resource;if(!u.id)return Le("No resource Identifier");let d;if(u.service){const R=Jt.getImageServices(u);R[0]&&(d=i(R[0],r))}const h={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}},[g,p]=ws(r,l.target);if(p.id!==r.id)continue;const m={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}},w=l.resource.type==="SpecificResource"?rn(l.resource):null,_=w&&w.selector&&(w.selector.type==="BoxSelector"||w.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:w.selector.spatial.x,y:w.selector.spatial.y,width:w.selector.spatial.width,height:w.selector.spatial.height}}:m;d&&!d.id&&(d.id=d["@id"]);const O={id:u.id,type:"Image",annotationId:l.annotationId,width:g?u.width:r.width,height:g?u.height:r.height,service:d,sizes:d&&d.sizes?d.sizes:u.width&&u.height?[{width:u.width,height:u.height}]:[],target:g&&g.type!=="PointSelector"?g:h,selector:_};o.push(O)}return{type:"images",image:o[0],images:o,choice:e.choice}}const Lh=["model/gltf-binary"];function Oh(r,e){const o=e.items[0].resource;return o.format?Lh.indexOf(o.format)===-1?Le(`3D format: ${o.format} is unsupported`):{type:"3d-model",model:o}:Le("Unknown format")}function Nh(r,e){var o;if(!r.duration)return Le("No duration on canvas");if(e.items.length>1)return Le("Only one audio source supported");const i=(o=e.items[0])==null?void 0:o.resource;return i?i.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:r.duration,url:i.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}},format:i.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}}},annotations:{pages:[]}}:Le("Audio does not have format"):Le("Unknown audio")}function Rh(r,e){var l;const i=e.items.filter(u=>u.type==="video");if(!r.duration)return Le("No duration on canvas");if(i.length>1)return Le("Only one video source supported");const o=(l=i[0])==null?void 0:l.resource;return o?o.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:r.duration,url:o.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}},format:o.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}}},annotations:{pages:[]}}:Le("Video does not have format"):Le("Unknown video")}function ga(r,e={},i){const o=r.language||i||"none";switch(r.type){case"TextualBody":{typeof r.value!="undefined"&&(e[o]=r.value);break}case"List":case"Composite":case"Choice":r.items&&r.items.forEach(l=>ga(l,e,o))}return e}function zh(r,e){const i=[];return e.items.forEach(o=>{if(o.resource){const[l]=ws(r,o.target);i.push({annotationId:o.annotationId,text:ga(o.resource),target:l})}}),{type:"textual-content",items:i}}function pa(r){const e=nn(),i=Ct(),o=Me(),[l,u]=da(),{enabledPageIds:d}=aa((r==null?void 0:r.annotationPageManagerId)||(e==null?void 0:e.id)||(i==null?void 0:i.id),{all:!1}),h=ua(d,"AnnotationPage"),g=(r==null?void 0:r.strategies)||["empty","images","media","textual-content","complex-timeline"],[p,m]=ha(r,[u]),w=y.useMemo(()=>{if(!i)return Qi;if(p.types.length===0)return g.indexOf("empty")!==-1?oa(i.width,i.height):Qi;if(p.types.length!==1)if(p.types.length===2&&p.types.indexOf("text")!==-1)p.types=p.types.filter(O=>O!=="text");else return g.indexOf("complex-timeline")===-1?Le("Complex timeline not supported"):Le("ComplexTimelineStrategy not yet supported");const _=p.types[0];return _==="image"?g.indexOf("images")===-1?Le("Image not supported"):fa(i,p,l):_==="Model"||_==="model"?g.indexOf("3d-model")===-1?Le("3D not supported"):Oh(i,p):_==="textualbody"?g.indexOf("textual-content")===-1?Le("Textual content not supported"):zh(i,p):_==="sound"||_==="audio"?g.indexOf("media")===-1?Le("Media not supported"):Nh(i,p):_==="video"?g.indexOf("media")===-1?Le("Media not supported"):Rh(i,p):Qi},[i,p,o,m.makeChoice]);return y.useMemo(()=>w.type==="unknown"?[w,sa]:[te(B({},w),{annotations:{pages:h}}),m],[w,h])}const ma=(r,e=[])=>{const i=Me();y.useEffect(()=>{r(i)},[i,...e])};function Ah(r,e={}){const i=e.imageServiceLoader||new Jt.ImageServiceLoader;async function o(l,u,d,h=[],g){if(typeof l=="string")return{best:Jt.getFixedSizeFromImage(l),fallback:[],log:[]};const p=r.get(l);if(typeof p=="string")return{best:Jt.getFixedSizeFromImage(p),fallback:[],log:[]};switch(p.type){case"Annotation":{const m=p.body,w=r.get(m[0]);return g&&!w.width&&(w.width=g.width,w.height=g.height),await i.getThumbnailFromResource(w,u,d,h)}case"Canvas":{const m=p;if(m.thumbnail&&m.thumbnail.length){const w=r.get(m.thumbnail[0]),_=await i.getImageCandidates(w,d);_&&_.length&&h.push(..._)}return o(m.items[0],u,d,h,{width:m.width,height:m.height})}case"AnnotationPage":return o(p.items[0],u,d,h,g);case"Choice":return o(p.items[0],u,d,h,g);case"Collection":{const w=p.items[0];return o(w,u,d,h,g)}case"Manifest":{const w=p.items[0];return o(w,u,d,h,g)}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!p.width&&(p.width=g.width,p.height=g.height),i.getThumbnailFromResource(p,u,d,h);case"Service":case"Range":case"AnnotationCollection":case"CanvasReference":case"ContentResource":return{best:void 0,fallback:[],log:[]}}return{best:void 0,fallback:[],log:[]}}return{getBestThumbnailAtSize:o}}function va(r,e,{canvasId:i,manifestId:o}={}){const l=Me(),u=Xi(),d=y.useMemo(()=>Ah(l,{imageServiceLoader:u}),[l,u]),[h,g]=y.useState(),p=nn(o?{id:o}:void 0),m=Ct(i?{id:i}:void 0),w=m||p,_=y.useRef(!1);if(y.useEffect(()=>(_.current=!1,()=>{_.current=!0}),[]),!w)throw new Error("Must be called under a manifest or canvas context.");return ma(O=>{d.getBestThumbnailAtSize(w,r,e).then(R=>{R.best&&!_.current&&g(R.best)})},[w]),h}function Fh(r){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:r}}function Dh(r,e){switch(e.type){case"FINISHED":return te(B({},r),{isFinished:!0,isPlaying:!1,playRequested:!1});case"PLAY_PAUSE":return te(B({},r),{isFinished:!1,isPlaying:!r.isPlaying});case"PLAY_REQUESTED":return te(B({},r),{isFinished:!1,playRequested:!0});case"PAUSE":return te(B({},r),{isPlaying:!1});case"PLAY":return te(B({},r),{isFinished:!1,playRequested:!1,isPlaying:!0});case"MUTE":return te(B({},r),{isMuted:!0});case"SET_VOLUME":return te(B({},r),{volume:e.volume,isMuted:e.volume===0});case"TOGGLE_MUTE":return te(B({},r),{isMuted:!r.isMuted});case"UNMUTE":return te(B({},r),{isMuted:!1})}return r}function ya(r){const e=Math.round(r);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function Ss(r){const[e,i]=y.useReducer(Dh,Fh(r.duration)),o=y.useRef(null),l=y.useRef(null),u=y.useRef(null),d=y.useRef(!1),h=y.useCallback(()=>{l.current&&o.current&&(l.current.innerHTML=ya(o.current.currentTime),u.current&&(u.current.style.width=`${o.current.currentTime/r.duration*100}%`),d.current!==o.current.muted&&(d.current=o.current.muted,i(o.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[r.duration]),g=y.useCallback(()=>{o.current&&(i({type:"PLAY_REQUESTED"}),o.current.play().then(()=>{i({type:"PLAY"})}),h())},[h]),p=y.useCallback(()=>{o.current&&(o.current.duration>0&&o.current.paused?g():m())},[h]),m=y.useCallback(()=>{o.current&&(o.current.pause(),i({type:"PAUSE"}),h())},[h]),w=y.useCallback(()=>{o.current&&(o.current.muted=!o.current.muted,i(o.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),_=y.useCallback(()=>{o.current&&(o.current.muted=!0,i({type:"MUTE"}))},[]),O=y.useCallback(()=>{o.current&&(o.current.muted=!1,i({type:"UNMUTE"}))},[]),R=y.useCallback(k=>{o.current&&(o.current.muted=!1,o.current.volume=k/100,i({type:"SET_VOLUME",volume:k}))},[]),N=y.useCallback(k=>{o.current&&(o.current.currentTime=Math.max(0,Math.min(k*r.duration,r.duration)),h())},[]),I=y.useCallback(k=>{o.current&&(o.current.currentTime=Math.max(0,Math.min(k,r.duration)),h())},[]);return y.useEffect(()=>{const k=setInterval(()=>{h()},350);return()=>clearInterval(k)},[h,r.duration]),y.useEffect(()=>{const k=()=>{i({type:"FINISHED"})},P=o.current;return P==null||P.addEventListener("ended",k),()=>P==null?void 0:P.removeEventListener("ended",k)},[]),[{element:o,currentTime:l,progress:u},e,{play:g,pause:m,playPause:p,mute:_,unmute:O,toggleMute:w,setVolume:R,setDurationPercent:N,setTime:I}]}const wa=y.createContext(null),Sa=y.createContext(null),Ea=y.createContext(null);function Uh(){const r=y.useContext(wa);if(!r)throw new Error("Ctx not found");return r}function bh(){const r=y.useContext(Sa);if(!r)throw new Error("Ctx not found");return r}function Bh(){const r=y.useContext(Ea);if(!r)throw new Error("Ctx not found");return r}function Es({actions:r,state:e,children:i,currentTime:o,progress:l,element:u}){return M(Ea.Provider,{value:{currentTime:o,progress:l,element:u},children:M(Sa.Provider,{value:r,children:M(wa.Provider,{value:e,children:i})})})}function jh({media:r,children:e}){const[{element:i,currentTime:o,progress:l},u,d]=Ss({duration:r.duration});return M(Et,{children:M(vn,{children:Te(Es,{state:u,actions:d,currentTime:o,progress:l,element:i,children:[M("audio",{ref:i,src:r.url}),e]})})})}function Hh({media:r,children:e}){const[{element:i,currentTime:o,progress:l},u,d]=Ss({duration:r.duration});return Te(Et,{children:[Te(vn,{overlay:!0,children:[M("style",{children:`
|
|
110
|
+
`}),o.htmlChildren]}))},_d=()=>y.useContext(es),bi=()=>{const r=_d();return r?r.runtime:void 0},yl=(r,e=[])=>{const i=bi();y.useEffect(()=>i?i.registerHook("useFrame",r):()=>{},e)};function Pd(){return y.useContext(ts)}async function Cd(r,e,i){if(y.version.startsWith("18.")){const o=await Promise.resolve().then(function(){return dh}),l=o.default?o.default.createRoot:o.createRoot;i.current||(i.current=l(r)),i.current.render(e)}else if(typeof ReactDOM!="undefined"){const{render:o}=ReactDOM;o(e,r)}else{const o=await import("react-dom");(o.default?o.default.render:o.render)(e,r)}}const rs=De.default.forwardRef((o,i)=>{var l=o,{children:r}=l,e=St(l,["children"]);const u=y.useRef(),d=bi(),h=y.useRef(0),g=y.useRef(),p=y.useRef();return yl(()=>{if(e.relative){const m=u.current;if(m&&d){const S=d.getScaleFactor();h.current!==S&&(h.current=S,m.style.transformOrigin="0 0",m.style.transform=`scale(${1/h.current})`,m.style.width=`${h.current*100}%`,m.style.height=`${h.current*100}%`)}}},[e.relative]),y.useLayoutEffect(()=>{const m=g.current;i&&m&&(typeof i=="function"?i(m):i.current=m);async function S(){if(m&&m.__host){const x=e.relative?M("div",{ref:u,children:r}):r;await Cd(m.__host.element,x,p)}}m&&m.__host?S():m&&(m.__onCreate=S)},[i,r,g,e.relative]),y.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),M("box",te(B({html:!0},e),{ref:g}))});rs.displayName="HTMLPortal";const wl=(r,e,i=[])=>{const o=bi(),l=o?o.world:void 0;y.useEffect(()=>{if(o){const u=e,d=pn[r];o.world.activatedEvents.push(d);const h=d.slice(2).toLowerCase();return o.world.addEventListener(h,u),()=>{o.world.removeEventListener(h,u)}}return()=>{}},[l,r,...i])};function Sl(r,e){if(r===0)return[0,1];if(e===0)return[1,0];const i=Math.abs(r)/Math.abs(e);return[i,1-i]}function Td(){const r=y.useRef({ctrl:!1,shift:!1,alt:!1});return y.useLayoutEffect(()=>{function e(o){o.key==="Shift"&&(r.current.shift=!0),o.key==="Control"&&(r.current.ctrl=!0),o.key==="Alt"&&(r.current.alt=!0)}function i(o){o.key==="Shift"&&(r.current.shift=!1),o.key==="Control"&&(r.current.ctrl=!1),o.key==="Alt"&&(r.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",i)}},[]),r}const Id=(r,e)=>{const i=nd(),o=bi(),l=Pd(),u=y.useRef(),d=y.useRef(null),h=y.useRef(),[g,p]=y.useState(!1),m=y.useRef({north:0,south:0,east:0,west:0}),S=Td(),x=k=>P=>{if(p(!0),l&&o){const{top:j,left:V}=l,W=o.viewerToWorld(P.pageX-V,P.pageY-j);h.current={x:W.x,y:W.y},u.current=k}},O=y.useMemo(()=>r.width/r.height,[r.width,r.height]),R=y.useCallback(k=>{if(!Math.abs(k.north-k.south+(k.east-k.west)))return;const j=-k.west+k.east,V=-k.north+k.south,W=r.width+j,Q=r.height+V;if(W/Q>=O){const q=Q*O,b=W-q,[le,fe]=Sl(k.east,k.west);k.west=k.west+b*fe,k.east=k.east-b*le}else{const q=W/O,b=Q-q,[le,fe]=Sl(k.north,k.south);k.north=k.north+b*le,k.south=k.south-b*fe}},[r.width,r.height,O]);yl(()=>{h&&o&&o.updateNextFrame()}),y.useEffect(()=>{o&&o.updateNextFrame()},[o,g]);const N=y.useCallback(k=>{var P;const j=k.atlasTouches?k.atlasTouches[0]:k.atlas?k.atlas:{x:k.pageX,y:k.pageY};if(!o||o.mode!=="sketch")return;const V=d.current,W=!r.maintainAspectRatio&&S.current.alt,Q=!W&&S.current.shift&&((P=u.current)==null?void 0:P.indexOf("-"))!==-1;if((u.current==="translate"||u.current==="east"||u.current==="north-east"||u.current==="south-east")&&(m.current.east=j.x-(h.current?h.current.x:0),W&&(m.current.west=-m.current.east)),(u.current==="translate"||u.current==="west"||u.current==="north-west"||u.current==="south-west")&&(m.current.west=j.x-(h.current?h.current.x:0),W&&(m.current.east=-m.current.west)),(u.current==="translate"||u.current==="north"||u.current==="north-east"||u.current==="north-west")&&(m.current.north=j.y-(h.current?h.current.y:0),W&&(m.current.south=-m.current.north)),(u.current==="translate"||u.current==="south"||u.current==="south-west"||u.current==="south-east")&&(m.current.south=j.y-(h.current?h.current.y:0),W&&(m.current.north=-m.current.south)),(r.maintainAspectRatio||Q)&&R(m.current),V){const J=m.current.west,q=m.current.north,b=r.width+m.current.east,le=r.height+m.current.south;V.points[1]=Math.min(J,b),V.points[2]=Math.min(q,le),V.points[3]=Math.max(J,b),V.points[4]=Math.max(q,le),o.updateNextFrame()}},[o,r.width,r.height,r.maintainAspectRatio]);wl("mousemove",N,[r.width,r.height]),wl("pointermove",N,[r.width,r.height]);const I=y.useRef();return y.useEffect(()=>{I.current=()=>{if(g){const k=m.current.west,P=m.current.north,j=r.width+m.current.east,V=r.height+m.current.south,W=Math.min(k,j),Q=Math.min(P,V),J=Math.max(k,j),q=Math.max(P,V),b={x:(r.x||0)+W,y:(r.y||0)+Q,width:J-W||1,height:q-Q||1};r.maintainAspectRatio,e(b),u.current=void 0,h.current=void 0,m.current.east=0,m.current.west=0,m.current.north=0,m.current.south=0,p(!1)}}},[g,e,r.height,r.width,r.x,r.y]),y.useEffect(()=>{const k=()=>{I.current&&I.current()};return window.addEventListener("pointerup",k),window.addEventListener("touchend",k),()=>{window.removeEventListener("pointerup",k),window.removeEventListener("touchend",k)}},[]),{portalRef:d,mode:i,mouseEvent:x,onPointerMoveCallback:N,isEditing:g}};function kd(h){var g=h,{handleSize:r,resizable:e,onSave:i,children:o,maintainAspectRatio:l,disableCardinalControls:u}=g,d=St(g,["handleSize","resizable","onSave","children","maintainAspectRatio","disableCardinalControls"]);const p=typeof r=="undefined"?l?10:8:r,{portalRef:m,mode:S,mouseEvent:x,isEditing:O}=Id({x:d.x||0,y:d.y||0,width:d.width,height:d.height,maintainAspectRatio:l},i),R=y.useMemo(()=>x("translate"),[x]),N=y.useMemo(()=>x("east"),[x]),I=y.useMemo(()=>x("west"),[x]),k=y.useMemo(()=>x("south"),[x]),P=y.useMemo(()=>x("north"),[x]),j=y.useMemo(()=>x("south-east"),[x]),V=y.useMemo(()=>x("south-west"),[x]),W=y.useMemo(()=>x("north-east"),[x]),Q=y.useMemo(()=>x("north-west"),[x]),J=S==="sketch",q={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:l||u?"50%":2,position:"absolute",background:"#fff",pointerEvents:O?"none":J?"initial":"none"};return M(Et,{children:Te("world-object",te(B({},d),{children:[o,J&&e?M(rs,{ref:m,target:{x:0,y:0,height:d.height,width:d.width},relative:!0,interactive:!1,children:J&&e?Te(Et,{children:[M("div",{onMouseDown:R,onTouchStart:R,style:{display:"block",width:"100%",height:"100%",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:O?"none":J?"initial":"none"}}),l?null:Te(Et,{children:[M("div",{title:"east",onTouchStart:N,onMouseDown:N,style:te(B({},q),{cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:u?0:1,transform:`translate(${p/2}px, -${p}px)`})}),M("div",{title:"west",onMouseDown:I,style:te(B({},q),{cursor:"w-resize",position:"absolute",height:p*2,width:p,left:0,top:"50%",opacity:u?0:1,transform:`translate(-${p/2}px, -${p}px)`})}),M("div",{title:"north",onMouseDown:P,style:te(B({},q),{cursor:"n-resize",position:"absolute",height:p,width:p*2,left:"50%",top:0,opacity:u?0:1,transform:`translate(-${p}px, -${p/2}px)`})}),M("div",{title:"south",onMouseDown:k,style:te(B({},q),{cursor:"s-resize",position:"absolute",height:p,width:p*2,left:"50%",bottom:0,opacity:u?0:1,transform:`translate(-${p}px, ${p/2}px)`})})]}),M("div",{title:"north-east",onMouseDown:W,style:te(B({},q),{cursor:"ne-resize",position:"absolute",height:p,width:p,right:0,top:0,transform:`translate(${p/2}px, -${p/2}px)`})}),M("div",{title:"south-east",onMouseDown:j,style:te(B({},q),{cursor:"se-resize",position:"absolute",height:p,width:p,bottom:0,right:0,transform:`translate(${p/2}px, ${p/2}px)`})}),M("div",{title:"south-west",onMouseDown:V,style:te(B({},q),{cursor:"sw-resize",position:"absolute",height:p,width:p,bottom:0,left:0,transform:`translate(-${p/2}px, ${p/2}px)`})}),M("div",{title:"north-west",onMouseDown:Q,style:te(B({},q),{cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`})})]}):null}):null]}))})}function Md({interactive:r,region:e,onClick:i,onSave:o,maintainAspectRatio:l,disableCardinalControls:u,isEditing:d,style:h={backgroundColor:"rgba(0,0,0,.5)"}}){const g=y.useCallback(p=>{o(B({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width},p))},[o,e.id,e.x,e.y,e.height,e.width]);return M(kd,{x:e.x,y:e.y,width:e.width,height:e.height,resizable:d,onSave:g,maintainAspectRatio:l,disableCardinalControls:u,children:M("box",{interactive:r,onClick:p=>{p.preventDefault(),p.stopPropagation(),i(e)},target:{x:0,y:0,width:e.width,height:e.height},style:h})})}const Ld=r=>{const e=r.width/r.tiles.width,i=r.tiles.imageService.tiles||[],o=r.tiles.imageService.sizes||[],l=y.useMemo(()=>{const u=r.tiles.imageService.id||r.tiles.imageService["@id"];return u&&u.endsWith("/info.json")?u.slice(0,-1*10):u},[r.tiles.imageService.id]);return M("world-object",{scale:e,height:r.tiles.height,width:r.tiles.width,x:r.x,y:r.y,onClick:r.onClick,children:Te("composite-image",{id:r.tiles.imageService.id,width:r.tiles.width,height:r.tiles.height,children:[r.tiles.thumbnail?M("world-image",{priority:!0,uri:r.tiles.thumbnail.id,target:{width:r.tiles.width,height:r.tiles.height},display:{width:r.tiles.thumbnail.width,height:r.tiles.thumbnail.height}}):null,o.map((u,d)=>M("world-image",{uri:`${l}/full/${u.width},${u.height}/0/default.jpg`,target:{width:r.tiles.width,height:r.tiles.height},display:{width:u.width,height:u.height}},d)),i.map(u=>(u.scaleFactors||[]).map(d=>M("tiled-image",{uri:r.tiles.imageService.id,display:{width:r.tiles.width,height:r.tiles.height},tile:u,scaleFactor:d},`${r.tiles.imageService.id}-tile-${d}`)))]},r.tiles.imageService.id)},r.tiles.imageService.id)};function Od(r,e){return r?e?te(B(B({},r),e||{}),{":hover":r[":hover"]?Object.assign(r[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":r[":active"]?Object.assign(r[":active"]||{},e[":active"]||{}):e[":hover"]}):r:e}function ss(r,e){return ss=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},ss(r,e)}function Nd(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ss(r,e)}var Rd=function(e,i){return e===void 0&&(e=[]),i===void 0&&(i=[]),e.length!==i.length||e.some(function(o,l){return!Object.is(o,i[l])})},El={error:null},zd=function(r){Nd(e,r);function e(){for(var o,l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return o=r.call.apply(r,[this].concat(u))||this,o.state=El,o.resetErrorBoundary=function(){for(var h,g=arguments.length,p=new Array(g),m=0;m<g;m++)p[m]=arguments[m];o.props.onReset==null||(h=o.props).onReset.apply(h,p),o.reset()},o}e.getDerivedStateFromError=function(l){return{error:l}};var i=e.prototype;return i.reset=function(){this.setState(El)},i.componentDidCatch=function(l,u){var d,h;(d=(h=this.props).onError)==null||d.call(h,l,u)},i.componentDidUpdate=function(l,u){var d=this.state.error,h=this.props.resetKeys;if(d!==null&&u.error!==null&&Rd(l.resetKeys,h)){var g,p;(g=(p=this.props).onResetKeysChange)==null||g.call(p,l.resetKeys,h),this.reset()}},i.render=function(){var l=this.state.error,u=this.props,d=u.fallbackRender,h=u.FallbackComponent,g=u.fallback;if(l!==null){var p={error:l,resetErrorBoundary:this.resetErrorBoundary};if(Hr.isValidElement(g))return g;if(typeof d=="function")return d(p);if(h)return Hr.createElement(h,p);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(Hr.Component);const Ad={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},Bi=De.default.createContext(Ad),Pt=()=>y.useContext(Bi);function Ut({value:r,children:e}){const i=Pt(),o=y.useMemo(()=>B(B({},i),r),[r,i]);return M(Bi.Provider,{value:o,children:e})}const Bn=De.default.createContext({vault:null,setVaultInstance:r=>{}});function xl({vault:r,vaultOptions:e,useGlobal:i,resources:o,children:l}){const[u,d]=y.useState(()=>r||(i?ke.globalVault(e):e?new ke.Vault(e):new ke.Vault));return M(Bn.Provider,{value:{vault:u,setVaultInstance:d},children:M(Ut,{value:o||{},children:l})})}const Me=()=>{const{vault:r}=y.useContext(Bn);if(r===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return r};function os(r,{noCache:e=!1}={}){const i=typeof r=="string"?r:r.id,o=Me(),[l,u]=y.useState(i),[d,h]=y.useState(void 0),g=y.useMemo(()=>o.get(i,{skipSelfReturn:!0})||void 0,[i,o]),[p,m]=y.useState(g);return y.useEffect(()=>{(async()=>{try{const S=g&&!e?g:await o.load(i),x=S?S.id||S["@id"]:null;S&&l!==x&&u(x),m(S)}catch(S){h(S)}})()},[i,e]),{isLoaded:!!p,id:l,requestId:i,error:d,resource:p,cached:!!(p&&p===g)}}function _l(r,e){const{id:i,isLoaded:o,error:l,resource:u,requestId:d,cached:h}=os(r,e);return{id:i,isLoaded:o,error:l,manifest:u,requestId:d,cached:h}}function Pl({manifest:r,children:e}){return M(Ut,{value:{manifest:r},children:e})}function ls({canvas:r,children:e}){return M(Ut,{value:{canvas:r},children:e})}function Ne(r,e=[]){const i=Me(),[o,l]=y.useState(()=>r(i.getState(),i));return y.useEffect(()=>i.subscribe(u=>r(u,i),u=>{l(u)},!1),e),o}const jn=De.default.createContext([]);function Cl(){const r=y.useContext(jn);return Ne(e=>r.map(i=>e.iiif.entities.Canvas[i]).filter(Boolean),[r])}function nn(r={},e=[]){const{id:i,selector:o}=r,l=Pt();Me();const u=i||l.manifest,d=Ne(h=>u?h.iiif.entities.Manifest[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}function Tl({range:r,children:e}){return M(Ut,{value:{range:r},children:e})}function Il(r,e){for(const i of e.items){if(i.type==="Canvas")return i;if(i.type==="Range"){const o=Il(r,r.get(i));if(o)return o}}return null}function as(r,e){const i=[];for(const o of e.items)if(o.type==="Canvas"&&(o.id.indexOf("#")!==-1?i.push({id:o.id.split("#")[0],type:"Canvas"}):i.push(o)),o.type==="Range"&&i.push(...as(r,r.get(o))),o.type==="SpecificResource"){const l=typeof o.source=="string"?o.source:o.source.id;i.push({id:l,type:"Canvas"})}return i}function Fd(r,e,i){for(const o of e.structures){const l=us(r,r.get(o),i);if(l)return l}return null}function us(r,e,i){var o;for(const l of e.items){const u=(o=l.id)==null?void 0:o.split("#")[0];if(l.type==="SpecificResource"&&l.source===i||l.type==="Canvas"&&i===u)return e;if(l.type==="Range"){const d=us(r,r.get(l),i);if(d)return d}}return null}function Dd(r,e,i,o=!1){const l=e.behavior,u=i?r.get(i):null;if(!u)return[];const d=u.behavior,h=o?!1:l.includes("paged"),g=h?!1:l.includes("continuous"),p=h||g?!1:l.includes("individuals"),m=d.includes("facing-pages"),S=d.includes("non-paged");if(m||S||p||o)return[{id:u.id,type:"Canvas"}];const[x,O]=cs(r,e);if(g)return x;const R=x.findIndex(N=>N.id===i);if(R===-1)return[];for(const N of O)if(N.includes(R))return N.map(I=>x[I]);return[{id:u.id,type:"Canvas"}]}function cs(r,e,{disablePaging:i}={}){const o=e.behavior,l=o.includes("paged"),u=l?!1:o.includes("continuous"),d=l||u?!1:o.includes("individuals"),h=e.type==="Manifest"?e.items:as(r,e);if(u)return[h,[h.map((x,O)=>O)]];if(d||!l||i)return[h,h.map((x,O)=>[O])];const g=[];let p=[];const m=()=>{p.length&&(g.push([...p]),p=[])};let S=0;for(let x=0;x<h.length;x++){const O=r.get(h[x]);if(O.behavior.includes("non-paged")){x===S&&S++;continue}if(x===S||O.behavior.includes("facing-pages")){m(),g.push([x]);continue}p.push(x),p.length>1&&m()}return p.length&&m(),[h,g]}function kl(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.range,d=Ne(h=>u?h.iiif.entities.Range[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}function Ml({startCanvas:r,disablePaging:e}){var R;const i=Me(),o=nn(),l=kl(),[u,d]=y.useState(void 0),h=l||o;if(!h)throw new Error("Nothing selected");const[g,p]=y.useMemo(()=>cs(i,h,{disablePaging:e}),[i,h]),m=y.useCallback(N=>{const I=p.findIndex(k=>k.includes(N));d(I===-1?0:I)},[g,p]),S=y.useCallback(N=>{const I=g.findIndex(k=>k.id===N);I!==-1?m(I):d(0)},[g,p]),x=y.useCallback(()=>{d(N=>N>=p.length?N:N+1)},[p]),O=y.useCallback(()=>{d(N=>N<=0?0:N-1)},[p]);return typeof u=="undefined"&&(r?S(r):d(0)),{visibleItems:((R=p[u])==null?void 0:R.map(N=>g[N].id))||[],cursor:u,items:g,sequence:p,setSequenceIndex:d,setCanvasIndex:m,setCanvasId:S,next:x,previous:O}}const Hn=()=>{},Vn=y.createContext({setCurrentCanvasId:Hn,setCurrentCanvasIndex:Hn,nextCanvas:Hn,previousCanvas:Hn,items:[],sequence:[],setSequenceIndex:Hn,currentSequenceIndex:0});function Ll(r){const e=nn(),{cursor:i,visibleItems:o,next:l,sequence:u,items:d,setCanvasIndex:h,setCanvasId:g,previous:p,setSequenceIndex:m}=Ml({startCanvas:r.startCanvas,disablePaging:r.pagingEnabled===!1}),S=y.useMemo(()=>({sequence:u,items:d,setCurrentCanvasId:g,nextCanvas:l,previousCanvas:p,totalCanvases:d.length,setCurrentCanvasIndex:h,setSequenceIndex:m,currentSequenceIndex:i}),[u,d,g,l,p,d,h,m,i]);return e?M(Vn.Provider,{value:S,children:M(jn.Provider,{value:o,children:M(ls,{canvas:o[0],children:r.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),M("div",{children:"Sorry, something went wrong."}))}function Ud(r){const e=_l(r.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),M("div",{children:"Sorry, something went wrong."});if(!e.isLoaded)return M("div",{children:"Loading..."});const i=M(Ll,te(B({},r),{children:r.children}));return M(Pl,{manifest:e.id,children:r.rangeId?M(Tl,{range:r.rangeId,children:i}):i})}function bd(){return y.useContext(Vn)}function Ol(){return{VaultContext:y.useContext(Bn),ResourceContext:y.useContext(Bi),SimpleViewerReactContext:y.useContext(Vn),VisibleCanvasReactContext:y.useContext(jn)}}function Nl(r){return M(xl,{vault:r.bridge.VaultContext.vault||void 0,resources:r.bridge.ResourceContext,children:M(jn.Provider,{value:r.bridge.VisibleCanvasReactContext,children:M(Vn.Provider,{value:r.bridge.SimpleViewerReactContext,children:r.children})})})}function Rl(r){return r==null}function zl(r){throw new Error("Argument "+r+" is empty.")}function Bd(r){return typeof r=="string"||typeof r=="symbol"}function Al(r){return!Bd(r)}function Fl(r){throw new Error("Argument "+r+" is invalid, it should be an action type of type: string | symbol")}function jd(r,e){return Rl(r)&&zl(1),Al(r)&&Fl(1),Object.assign(function(){var i=e!=null?e.apply(void 0,arguments):void 0;return Object.assign({type:r},i)},{getType:function(){return r},toString:function(){return r}})}function Re(r,e,i){return Rl(r)&&zl(1),Al(r)&&Fl(1),function(){return jd(r,function(){var o=arguments.length<=0?void 0:arguments[0],l=arguments.length<=1?void 0:arguments[1];return e==null&&i==null||(o=e!=null?e.apply(void 0,arguments):void 0,l=i!=null?i.apply(void 0,arguments):void 0),Object.assign({},o!==void 0&&{payload:o},{},l!==void 0&&{meta:l})})}}const Hd="@iiif/IMPORT_ENTITIES",Vd="@iiif/MODIFY_ENTITY_FIELD",Wd="@iiif/REORDER_ENTITY_FIELD",Qd="@iiif/ADD_REFERENCE",Xd="@iiif/REMOVE_REFERENCE",Yd=Re(Hd)(),qd=Re(Vd)(),Zd=Re(Wd)(),Gd=Re(Qd)(),Kd=Re(Xd)(),ds={importEntities:Yd,modifyEntityField:qd,reorderEntityField:Zd,addReference:Gd,removeReference:Kd},Jd="@iiif/ADD_MAPPING",$d="@iiif/ADD_MAPPINGS";Re(Jd)(),Re($d)();const eh="@iiif/SET_META_VALUE",th="@iiif/SET_META_VALUE_DYNAMIC",nh="@iiif/UNSET_META_VALUE";Re(eh)(),Re(th)(),Re(nh)();const ih="@iiif/REQUEST_RESOURCE",rh="@iiif/REQUEST_ERROR",sh="@iiif/REQUEST_MISMATCH",oh="@iiif/REQUEST_COMPLETE",lh="@iiif/REQUEST_OFFLINE_RESOURCE";Re(ih)(),Re(rh)(),Re(sh)(),Re(oh)(),Re(lh)();const ah="@iiif/BATCH",uh="@iiif/BATCH_IMPORT";Re(ah)(),Re(uh)();function Dl(){const e=Me().getStore();return y.useMemo(()=>i=>e.dispatch(i),[e])}function Ul(r){return typeof r!="string"&&r&&r.bindToVault}function bl(){const r=Me(),e=y.useRef([]),i=Dl(),o=y.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);y.useLayoutEffect(()=>{const h={id:o,type:"AnnotationPage",behavior:[],motivation:null,label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],logo:[],rendering:[],service:[]};i(ds.importEntities({entities:{AnnotationPage:{[h.id]:h}}}))},[o]);const l=Ne(h=>o?h.iiif.entities.AnnotationPage[o]:null,[o]),u=y.useCallback((h,g)=>{if(o){if(Ul(h)){const S=h;S.__vault||S.bindToVault(r),h=typeof S.source=="string"?S.source:S.source.id,e.current[h]=S}else typeof h!="string"&&(h=h.id);const p=r.get({id:o,type:"AnnotationPage"}),m=r.get({id:h,type:"Annotation"});p&&m&&(p.items.find(S=>S.id===m.id)||i(ds.addReference({id:o,type:"AnnotationPage",key:"items",reference:{id:h,type:"Annotation"},index:g})))}},[o]),d=y.useCallback(h=>{o&&(Ul(h)?h=typeof h.source=="string"?h.source:h.source.id:typeof h!="string"&&(h=h.id),e.current[h]&&e.current[h].beforeRemove(),r.get({id:o,type:"AnnotationPage"})&&i(ds.removeReference({id:o,type:"AnnotationPage",key:"items",reference:{id:h,type:"Annotation"}})))},[o]);return[l,{addAnnotation:u,removeAnnotation:d}]}const Bl=y.createContext(null);function jl(){const r=y.useContext(Bl);return[r.fullPage,{addAnnotation:r.addAnnotation,removeAnnotation:r.removeAnnotation}]}function Hl({children:r}){const[e,{addAnnotation:i,removeAnnotation:o}]=bl();return M(Bl.Provider,{value:y.useMemo(()=>({fullPage:e,addAnnotation:i,removeAnnotation:o}),[e]),children:r})}function ch({width:r,style:e,height:i}){return M("div",{style:te(B({width:r,height:i,minHeight:500},e||{}),{background:"#f9f9f9"}),children:"Unknown error"})}const ji=y.createContext(null);function Vl(){return y.useContext(ji)}const hs=De.default.createContext(null),fs=De.default.createContext(null);function vn({children:r,overlay:e}){const i=y.useContext(e?fs:hs),o=Vl();return y.useLayoutEffect(()=>{if(i)try{i.render(M(ji.Provider,{value:o,children:r}))}catch{}},[r,o]),null}var Hi={},Wl,Vi,Ql=Sc.default;Vi=Hi.createRoot=Ql.createRoot,Wl=Hi.hydrateRoot=Ql.hydrateRoot;var dh=wc({__proto__:null,default:Hi,get createRoot(){return Vi},get hydrateRoot(){return Wl}},[Hi]);function hh(l){var u=l,{children:r,errorFallback:e,outerContainerProps:i={}}=u,o=St(u,["children","errorFallback","outerContainerProps"]);const d=y.useRef(null),[h,g]=y.useState(),[p,m]=y.useState(),S=y.useRef(null),[x,O]=y.useState(),R=Ol(),N=e||ch;return y.useLayoutEffect(()=>{const I={};if(d.current){const k=document.createElement("div");d.current.appendChild(k),I.portal=Vi(k),g(I.portal)}if(S.current){const k=document.createElement("div");S.current.appendChild(k),I.overlayPortal=Vi(k),O(I.overlayPortal)}return()=>{g(null),O(null),setTimeout(()=>{I.portal&&I.portal.unmount(),I.overlayPortal&&I.overlayPortal.unmount()},0)}},[]),Te(zd,{fallbackRender:()=>M(N,B({},o)),children:[M(xd,te(B({},o),{containerProps:B({style:{position:"relative"}},o.containerProps||{}),htmlChildren:M("div",{ref:S}),onCreated:I=>{m(I),o.onCreated&&o.onCreated(I)},children:M(ji.Provider,{value:p,children:M(hs.Provider,{value:h,children:M(fs.Provider,{value:x,children:M(Nl,{bridge:R,children:M(Hl,{children:r})})})})})})),M("div",{ref:d})]})}function Xl(r){return{addEventListener(e,i,o,l){if(!!e)return r.setMetaValue([e.id,"eventManager",i],u=>{const d=u||[];for(const h of d)if(h.callback===o)return d;return[...d,{callback:o,scope:l}]}),o},removeEventListener(e,i,o){!e||r.setMetaValue([e.id,"eventManager",i],l=>(l||[]).filter(u=>u.callback!==o))},getListenersAsProps(e,i){const o=typeof e=="string"?{id:e}:e;if(!o||!o.id)return{};const l=r.getResourceMeta(o.id,"eventManager"),u={};if(l&&o)for(const d of Object.keys(l))u[d]=h=>{const g=r.get(o);for(const{callback:p,scope:m}of l[d]||[])(!m||i&&m.indexOf(i)!==-1)&&p(h,g)};return u}}}function gs(r,e){const i=Me(),o=y.useMemo(()=>Xl(i),[i]),l=Ne(()=>r&&r.id?i.getResourceMeta(r.id,"eventManager"):null,[r]);return y.useMemo(()=>r?o.getListenersAsProps(r,e):{},[l,r,i,e])}function ps(r){return{applyStyles(e,i,o){const l=typeof e=="string"?e:e.id;return r.setMetaValue([l,"styles",i],o)},getAppliedStyles(e){const i=typeof e=="string"?e:e.id;return r.getResourceMeta(i,"styles")}}}function Wn(r,e){const i=Me(),o=y.useMemo(()=>ps(i),[i]);return Ne(()=>{if(!r)return null;const l=o.getAppliedStyles(r.id);return l?e?l[e]:l:void 0},[r,e])}var fh=Object.defineProperty,gh=Object.defineProperties,ph=Object.getOwnPropertyDescriptors,Yl=Object.getOwnPropertySymbols,mh=Object.prototype.hasOwnProperty,vh=Object.prototype.propertyIsEnumerable,ql=(r,e,i)=>e in r?fh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,Zl=(r,e)=>{for(var i in e||(e={}))mh.call(e,i)&&ql(r,i,e[i]);if(Yl)for(var i of Yl(e))vh.call(e,i)&&ql(r,i,e[i]);return r},Gl=(r,e)=>gh(r,ph(e));const yh=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,wh=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;function Wi(r){if(Array.isArray(r))return r.reduce((e,i)=>{const{selector:o,selectors:l}=Wi(i);return o&&(e.selector||(e.selector=o),e.selectors.push(...l)),e},{selector:null,selectors:[]});if(!r)return{selector:null,selectors:[]};if(typeof r=="string"){const[e,i]=r.split("#");return i?Wi({type:"FragmentSelector",value:i}):{selector:null,selectors:[]}}if(r.type==="PointSelector"&&(r.t||r.t===0)){const e={type:"TemporalSelector",temporal:{startTime:r.t}};return{selector:e,selectors:[e]}}if(r.type==="FragmentSelector"){const e=yh.exec(r.value);if(e){const o={type:"BoxSelector",spatial:{unit:e[2]==="percent:"||e[2]==="pct:"?"percent":"pixel",x:parseFloat(e[3]),y:parseFloat(e[4]),width:parseFloat(e[5]),height:parseFloat(e[6])}};return{selector:o,selectors:[o]}}const i=r.value.match(wh);if(i){const o={type:"TemporalSelector",temporal:{startTime:i[4]?parseFloat(i[4]):0,endTime:i[7]?parseFloat(i[7]):void 0}};return{selector:o,selectors:[o]}}return{selector:null,selectors:[]}}return{selector:null,selectors:[]}}function rn(r,e={}){if(Array.isArray(r))return rn(r[0]);if(typeof r=="string"){const[i,o]=r.split("#");return o?rn({type:"SpecificResource",source:{id:i,type:"Unknown"},selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:{id:i,type:e.typeMap&&e.typeMap[i]||"Unknown"},selector:null,selectors:[]}}if(r.type==="Choice"||r.type==="List"||r.type==="Composite"||r.type==="Independents")return rn(r.items[0]);if(r.type==="SpecificResource"){r.source.type==="Canvas"&&r.source.partOf&&typeof r.source.partOf=="string"&&(r.source.partOf=[{id:r.source.partOf,type:"Manifest"}]);const{selector:i,selectors:o}=r.selector?Wi(r.selector):{selector:null,selectors:[]};return{type:"SpecificResource",source:r.source,selector:i,selectors:o}}if(r.id){r.type==="Canvas"&&r.partOf&&typeof r.partOf=="string"&&(r.partOf=[{id:r.partOf,type:"Manifest"}]);const[i,o]=r.id.split("#");return o?rn({type:"SpecificResource",source:Gl(Zl({},r),{id:i}),selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:Gl(Zl({},r),{id:i}),selector:null,selectors:[]}}return{type:"SpecificResource",source:r,selector:null,selectors:[]}}function ms(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=Me(),d=i||l.annotation,h=Ne(p=>d?p.iiif.entities.Annotation[d]:void 0,[d]),g=Ne(p=>h&&h.body?h.body.map(m=>m?p.iiif.entities[m.type][m.id]:null).filter(Boolean):[],[h]);return y.useMemo(()=>{if(!h)return;const p=te(B({},h),{body:g,target:rn(h.target,{typeMap:u.getState().iiif.mapping})});return o?o(p):p},[h,o,g,...e])}function Ct(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.canvas,d=Ne(h=>u?h.iiif.entities.Canvas[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}const Kl=({id:r,style:e,className:i,interactive:o})=>{const l=ms({id:r}),u=Wn(l,"atlas"),d=Wn(l,"html"),h=gs(l,["atlas"]),g=Ct(),p=y.useMemo(()=>Od(e,u),[e,u]);return g&&l&&l.target&&l.target.selector&&l.target.selector.type==="BoxSelector"&&l.target.source&&l.target.source.id===g.id?M(Md,B({id:l.id,isEditing:!0,region:l.target.selector.spatial,style:p,className:(d==null?void 0:d.className)||i,interactive:!!((d==null?void 0:d.href)||o),href:(d==null?void 0:d.href)||null,title:(d==null?void 0:d.title)||null,hrefTarget:(d==null?void 0:d.target)||null},h)):null},vs=({className:r,page:e})=>{var l;const i=Wn(e,"atlas"),o=Wn(e,"html");return Ne(u=>e.id?u.iiif.entities.AnnotationPage[e.id]:null,[]),M(y.Fragment,{children:(l=e.items)==null?void 0:l.map(u=>M(Kl,{id:u.id,style:i,className:(o==null?void 0:o.className)||r},u.id))})};function Jl({id:r,image:e,thumbnail:i,isStatic:o,x:l=0,y:u=0,children:d,onClick:h}){var g,p,m,S;return M(y.Fragment,{children:e.service?Te(y.Fragment,{children:[M(Ld,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:i&&i.type==="fixed"?i:void 0},x:((g=e.target)==null?void 0:g.spatial.x)+l,y:((p=e.target)==null?void 0:p.spatial.y)+u,width:(m=e.target)==null?void 0:m.spatial.width,height:(S=e.target)==null?void 0:S.spatial.height,onClick:h}),d]},"service"):Te(y.Fragment,{children:[M("world-image",{onClick:h,uri:e.id,target:e.target.spatial,display:e.width&&e.height?{width:e.width,height:e.height}:void 0}),d]},"no-service")},r)}var Sh=Object.defineProperty,Eh=Object.defineProperties,xh=Object.getOwnPropertyDescriptors,$l=Object.getOwnPropertySymbols,_h=Object.prototype.hasOwnProperty,Ph=Object.prototype.propertyIsEnumerable,ea=(r,e,i)=>e in r?Sh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,ta=(r,e)=>{for(var i in e||(e={}))_h.call(e,i)&&ea(r,i,e[i]);if($l)for(var i of $l(e))Ph.call(e,i)&&ea(r,i,e[i]);return r},na=(r,e)=>Eh(r,xh(e));const Ch=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,Th=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/;function ys(r){if(Array.isArray(r))return r.reduce((e,i)=>{const{selector:o,selectors:l}=ys(i);return o&&(e.selector||(e.selector=o),e.selectors.push(...l)),e},{selector:null,selectors:[]});if(!r)return{selector:null,selectors:[]};if(typeof r=="string"){const[e,i]=r.split("#");return i?ys({type:"FragmentSelector",value:i}):{selector:null,selectors:[]}}if(r.type==="PointSelector"&&(r.t||r.t===0)){const e={type:"TemporalSelector",temporal:{startTime:r.t}};return{selector:e,selectors:[e]}}if(r.type==="FragmentSelector"){const e=Ch.exec(r.value);if(e){const o={type:"BoxSelector",spatial:{unit:e[2]==="percent:"||e[2]==="pct:"?"percent":"pixel",x:parseFloat(e[3]),y:parseFloat(e[4]),width:parseFloat(e[5]),height:parseFloat(e[6])}};return{selector:o,selectors:[o]}}const i=r.value.match(Th);if(i){const o={type:"TemporalSelector",temporal:{startTime:i[4]?parseFloat(i[4]):0,endTime:i[7]?parseFloat(i[7]):void 0}};return{selector:o,selectors:[o]}}return{selector:null,selectors:[]}}return{selector:null,selectors:[]}}function Qn(r,e={}){if(Array.isArray(r))return Qn(r[0]);if(typeof r=="string"){const[i,o]=r.split("#");return o?Qn({type:"SpecificResource",source:{id:i,type:"Unknown"},selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:{id:i,type:e.typeMap&&e.typeMap[i]||"Unknown"},selector:null,selectors:[]}}if(r.type==="Choice"||r.type==="List"||r.type==="Composite"||r.type==="Independents")return Qn(r.items[0]);if(r.type==="SpecificResource"){r.source.type==="Canvas"&&r.source.partOf&&typeof r.source.partOf=="string"&&(r.source.partOf=[{id:r.source.partOf,type:"Manifest"}]);const{selector:i,selectors:o}=r.selector?ys(r.selector):{selector:null,selectors:[]};return{type:"SpecificResource",source:r.source,selector:i,selectors:o}}if(r.id){r.type==="Canvas"&&r.partOf&&typeof r.partOf=="string"&&(r.partOf=[{id:r.partOf,type:"Manifest"}]);const[i,o]=r.id.split("#");return o?Qn({type:"SpecificResource",source:na(ta({},r),{id:i}),selector:{type:"FragmentSelector",value:o}}):{type:"SpecificResource",source:na(ta({},r),{id:i}),selector:null,selectors:[]}}return{type:"SpecificResource",source:r,selector:null,selectors:[]}}function ia(r){return r.type==="SpecificResource"?[r.source,{selector:r.selector}]:[r,{selector:null}]}function ra(r,e,i){const o=[];let l=null;const u=[];for(const d of e){const h=r.get(d.body,{skipSelfReturn:!1});for(const g of h){if(!g)continue;const[p,{selector:m}]=ia(g),S=(p.type||"unknown").toLowerCase();if(S==="choice"){const x=r.get(p.items),O=i.length?i.map(R=>x.find(N=>N.id===R)).filter(Boolean):[x[0]];O.length===0&&O.push(x[0]),l={type:"single-choice",items:x.map(R=>({id:R.id,label:R.label,selected:O.indexOf(R)!==-1})),label:g.label},h.push(...O);continue}o.indexOf(S)===-1&&o.push(S),u.push({annotationId:d.id,type:S,resource:p,target:d.target,selector:m})}}return{types:o,items:u,choice:l}}function ws(r,e){const{selector:i,source:o}=Qn(e);if(o.id!==r.id)return[null,o];const l={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}};return[i?i.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:i.temporal,spatial:l.spatial}:i:null,o]}const sa={makeChoice:()=>{}},Qi={type:"unknown"},Le=r=>({type:"unknown",reason:r,annotations:{pages:[]}}),oa=(r,e)=>({type:"empty",width:r,height:e,annotations:{pages:[]},image:null,images:[]});function Ih(r,e){var o;const i=(o=r==null?void 0:r.iiif)==null?void 0:o.meta[e];return i?i.annotationPageManager:null}function kh(r,e){return Ne(i=>{const o=[];if(!r)return o;const l=Object.keys(i.iiif.entities.AnnotationPage);for(const u of l)if(!e||e.indexOf(u)!==-1){const d=Ih(i,u);d&&d.views&&d.views[r]&&o.push(u)}return o},[r,e])}function la({canvas:r,manifest:e,all:i,canvases:o}){const l=[];if(e)for(const u of e.annotations)l.indexOf(u.id)===-1&&l.push(u.id);if(i){if(o&&o.length)for(const u of o)for(const d of u.annotations)l.indexOf(d.id)===-1&&l.push(d.id)}else if(r)for(const u of r.annotations)l.indexOf(u.id)===-1&&l.push(u.id);return l}function Mh(r,e){var o;const i=(o=r==null?void 0:r.iiif)==null?void 0:o.meta[e];return i?i.annotationPageManager:null}function aa(r,e={}){const i=Me(),o=nn(),l=Ct(),u=Cl(),d=y.useMemo(()=>la({all:e.all,manifest:o,canvas:l,canvases:u}),[e.all,l,u,o]),h=kh(r,e.all?void 0:d),g=y.useCallback(m=>{!r||i.setMetaValue([m,"annotationPageManager","views"],S=>S&&!S[r]?S:te(B({},S||{}),{[r]:!1}))},[r,i]),p=y.useCallback((m,S={})=>{if(!r)return;const x=i.getState(),O=[];if(S!=null&&S.deselectOthers){const R=Object.keys(x.iiif.entities.AnnotationPage);for(const N of R){const I=Mh(x,N);I&&I.views&&I.views[r]&&O.push(N)}}for(const R of O)g(R);i.setMetaValue([m,"annotationPageManager","views"],R=>R&&R[r]?R:te(B({},R||{}),{[r]:!0}))},[r,g,i]);return{availablePageIds:d,enabledPageIds:h,setPageEnabled:p,setPageDisabled:g}}function ua(r,e){return Ne((i,o)=>o.get(r.map(l=>({id:l,type:e}))),[r,e])}const ca=De.default.createContext(new Jt.ImageServiceLoader);function Xi(){return y.useContext(ca)}function da(){const r=Xi(),[e,i]=y.useState({}),o=y.useRef(!1);return y.useEffect(()=>()=>{o.current=!0},[]),[y.useCallback((u,{height:d,width:h})=>{if(u){const g=u.id||u["@id"],p=r.loadServiceSync({id:g,width:u.width||h,height:u.height||d,source:u});p?u=p:e[g]||(o.current||i(m=>te(B({},m),{[g]:"loading"})),r.loadService({id:g,width:u.width||h,height:u.height||d}).then(()=>{o.current||i(m=>te(B({},m),{[g]:"done"}))}))}return u},[r,e]),e]}function Yi(r={}){const e=ms(),i=Ct(r.canvasId?{id:r.canvasId}:void 0);return Ne((o,l)=>{if(!i)return[];if(e&&r.enableSingleAnnotation)return[e];const u=l.get(i.items),d=[];for(const h of u)d.push(...l.get(h.items));return d},[i])}function ha(r,e=[]){const i=Me(),o=Yi({enableSingleAnnotation:r==null?void 0:r.enableSingleAnnotation}),[l,u]=y.useState((r==null?void 0:r.defaultChoices)||[]),d=y.useMemo(()=>ra(i,o,l),[i,o,l,...e]),g={makeChoice:y.useCallback((p,{deselectOthers:m=!0,deselect:S=!1}={})=>{if(d.choice){if(d.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");u(x=>{if(S){const R=x.filter(N=>N!==p);if(R.length===0){const N=d.items[0].resource.id;return N?[N]:[]}return R}if(m)return[p];const O=[...x];if(O.length===0&&d.items.length){const R=d.items[0].resource.id;R&&O.push(R)}return x.indexOf(p)!==-1?x:[...x,p]})}},[d.choice])};return[d,g]}function fa(r,e,i){const o=[];for(const l of e.items){const u=l.resource&&l.resource.type==="SpecificResource"?l.resource.source:l.resource;if(!u.id)return Le("No resource Identifier");let d;if(u.service){const R=Jt.getImageServices(u);R[0]&&(d=i(R[0],r))}const h={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}},[g,p]=ws(r,l.target);if(p.id!==r.id)continue;const m={type:"BoxSelector",spatial:{x:0,y:0,width:r.width,height:r.height}},S=l.resource.type==="SpecificResource"?rn(l.resource):null,x=S&&S.selector&&(S.selector.type==="BoxSelector"||S.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:S.selector.spatial.x,y:S.selector.spatial.y,width:S.selector.spatial.width,height:S.selector.spatial.height}}:m;d&&!d.id&&(d.id=d["@id"]);const O={id:u.id,type:"Image",annotationId:l.annotationId,width:g?u.width:r.width,height:g?u.height:r.height,service:d,sizes:d&&d.sizes?d.sizes:u.width&&u.height?[{width:u.width,height:u.height}]:[],target:g&&g.type!=="PointSelector"?g:h,selector:x};o.push(O)}return{type:"images",image:o[0],images:o,choice:e.choice}}const Lh=["model/gltf-binary"];function Oh(r,e){const o=e.items[0].resource;return o.format?Lh.indexOf(o.format)===-1?Le(`3D format: ${o.format} is unsupported`):{type:"3d-model",model:o}:Le("Unknown format")}function Nh(r,e){var o;if(!r.duration)return Le("No duration on canvas");if(e.items.length>1)return Le("Only one audio source supported");const i=(o=e.items[0])==null?void 0:o.resource;return i?i.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:r.duration,url:i.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}},format:i.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}}},annotations:{pages:[]}}:Le("Audio does not have format"):Le("Unknown audio")}function Rh(r,e){var l;const i=e.items.filter(u=>u.type==="video");if(!r.duration)return Le("No duration on canvas");if(i.length>1)return Le("Only one video source supported");const o=(l=i[0])==null?void 0:l.resource;return o?o.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:r.duration,url:o.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}},format:o.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:r.duration}}},annotations:{pages:[]}}:Le("Video does not have format"):Le("Unknown video")}function ga(r,e={},i){const o=r.language||i||"none";switch(r.type){case"TextualBody":{typeof r.value!="undefined"&&(e[o]=r.value);break}case"List":case"Composite":case"Choice":r.items&&r.items.forEach(l=>ga(l,e,o))}return e}function zh(r,e){const i=[];return e.items.forEach(o=>{if(o.resource){const[l]=ws(r,o.target);i.push({annotationId:o.annotationId,text:ga(o.resource),target:l})}}),{type:"textual-content",items:i}}function pa(r){const e=nn(),i=Ct(),o=Me(),[l,u]=da(),{enabledPageIds:d}=aa((r==null?void 0:r.annotationPageManagerId)||(e==null?void 0:e.id)||(i==null?void 0:i.id),{all:!1}),h=ua(d,"AnnotationPage"),g=(r==null?void 0:r.strategies)||["empty","images","media","textual-content","complex-timeline"],[p,m]=ha(r,[u]),S=y.useMemo(()=>{if(!i)return Qi;if(p.types.length===0)return g.indexOf("empty")!==-1?oa(i.width,i.height):Qi;if(p.types.length!==1)if(p.types.length===2&&p.types.indexOf("text")!==-1)p.types=p.types.filter(O=>O!=="text");else return g.indexOf("complex-timeline")===-1?Le("Complex timeline not supported"):Le("ComplexTimelineStrategy not yet supported");const x=p.types[0];return x==="image"?g.indexOf("images")===-1?Le("Image not supported"):fa(i,p,l):x==="Model"||x==="model"?g.indexOf("3d-model")===-1?Le("3D not supported"):Oh(i,p):x==="textualbody"?g.indexOf("textual-content")===-1?Le("Textual content not supported"):zh(i,p):x==="sound"||x==="audio"?g.indexOf("media")===-1?Le("Media not supported"):Nh(i,p):x==="video"?g.indexOf("media")===-1?Le("Media not supported"):Rh(i,p):Qi},[i,p,o,m.makeChoice]);return y.useMemo(()=>S.type==="unknown"?[S,sa]:[te(B({},S),{annotations:{pages:h}}),m],[S,h])}const ma=(r,e=[])=>{const i=Me();y.useEffect(()=>{r(i)},[i,...e])};function Ah(r,e={}){const i=e.imageServiceLoader||new Jt.ImageServiceLoader;async function o(l,u,d,h=[],g){if(typeof l=="string")return{best:Jt.getFixedSizeFromImage(l),fallback:[],log:[]};const p=r.get(l);if(typeof p=="string")return{best:Jt.getFixedSizeFromImage(p),fallback:[],log:[]};switch(p.type){case"Annotation":{const m=p.body,S=r.get(m[0]);return g&&!S.width&&(S.width=g.width,S.height=g.height),await i.getThumbnailFromResource(S,u,d,h)}case"Canvas":{const m=p;if(m.thumbnail&&m.thumbnail.length){const S=r.get(m.thumbnail[0]),x=await i.getImageCandidates(S,d);x&&x.length&&h.push(...x)}return o(m.items[0],u,d,h,{width:m.width,height:m.height})}case"AnnotationPage":return o(p.items[0],u,d,h,g);case"Choice":return o(p.items[0],u,d,h,g);case"Collection":{const S=p.items[0];return o(S,u,d,h,g)}case"Manifest":{const S=p.items[0];return o(S,u,d,h,g)}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!p.width&&(p.width=g.width,p.height=g.height),i.getThumbnailFromResource(p,u,d,h);case"Service":case"Range":case"AnnotationCollection":case"CanvasReference":case"ContentResource":return{best:void 0,fallback:[],log:[]}}return{best:void 0,fallback:[],log:[]}}return{getBestThumbnailAtSize:o}}function va(r,e,{canvasId:i,manifestId:o}={}){const l=Me(),u=Xi(),d=y.useMemo(()=>Ah(l,{imageServiceLoader:u}),[l,u]),[h,g]=y.useState(),p=nn(o?{id:o}:void 0),m=Ct(i?{id:i}:void 0),S=m||p,x=y.useRef(!1);if(y.useEffect(()=>(x.current=!1,()=>{x.current=!0}),[]),!S)throw new Error("Must be called under a manifest or canvas context.");return ma(O=>{d.getBestThumbnailAtSize(S,r,e).then(R=>{R.best&&!x.current&&g(R.best)})},[S]),h}function Fh(r){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:r}}function Dh(r,e){switch(e.type){case"FINISHED":return te(B({},r),{isFinished:!0,isPlaying:!1,playRequested:!1});case"PLAY_PAUSE":return te(B({},r),{isFinished:!1,isPlaying:!r.isPlaying});case"PLAY_REQUESTED":return te(B({},r),{isFinished:!1,playRequested:!0});case"PAUSE":return te(B({},r),{isPlaying:!1});case"PLAY":return te(B({},r),{isFinished:!1,playRequested:!1,isPlaying:!0});case"MUTE":return te(B({},r),{isMuted:!0});case"SET_VOLUME":return te(B({},r),{volume:e.volume,isMuted:e.volume===0});case"TOGGLE_MUTE":return te(B({},r),{isMuted:!r.isMuted});case"UNMUTE":return te(B({},r),{isMuted:!1})}return r}function ya(r){const e=Math.round(r);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function Ss(r){const[e,i]=y.useReducer(Dh,Fh(r.duration)),o=y.useRef(null),l=y.useRef(null),u=y.useRef(null),d=y.useRef(!1),h=y.useCallback(()=>{l.current&&o.current&&(l.current.innerHTML=ya(o.current.currentTime),u.current&&(u.current.style.width=`${o.current.currentTime/r.duration*100}%`),d.current!==o.current.muted&&(d.current=o.current.muted,i(o.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[r.duration]),g=y.useCallback(()=>{o.current&&(i({type:"PLAY_REQUESTED"}),o.current.play().then(()=>{i({type:"PLAY"})}),h())},[h]),p=y.useCallback(()=>{o.current&&(o.current.duration>0&&o.current.paused?g():m())},[h]),m=y.useCallback(()=>{o.current&&(o.current.pause(),i({type:"PAUSE"}),h())},[h]),S=y.useCallback(()=>{o.current&&(o.current.muted=!o.current.muted,i(o.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),x=y.useCallback(()=>{o.current&&(o.current.muted=!0,i({type:"MUTE"}))},[]),O=y.useCallback(()=>{o.current&&(o.current.muted=!1,i({type:"UNMUTE"}))},[]),R=y.useCallback(k=>{o.current&&(o.current.muted=!1,o.current.volume=k/100,i({type:"SET_VOLUME",volume:k}))},[]),N=y.useCallback(k=>{o.current&&(o.current.currentTime=Math.max(0,Math.min(k*r.duration,r.duration)),h())},[]),I=y.useCallback(k=>{o.current&&(o.current.currentTime=Math.max(0,Math.min(k,r.duration)),h())},[]);return y.useEffect(()=>{const k=setInterval(()=>{h()},350);return()=>clearInterval(k)},[h,r.duration]),y.useEffect(()=>{const k=()=>{i({type:"FINISHED"})},P=o.current;return P==null||P.addEventListener("ended",k),()=>P==null?void 0:P.removeEventListener("ended",k)},[]),[{element:o,currentTime:l,progress:u},e,{play:g,pause:m,playPause:p,mute:x,unmute:O,toggleMute:S,setVolume:R,setDurationPercent:N,setTime:I}]}const wa=y.createContext(null),Sa=y.createContext(null),Ea=y.createContext(null);function Uh(){const r=y.useContext(wa);if(!r)throw new Error("Ctx not found");return r}function bh(){const r=y.useContext(Sa);if(!r)throw new Error("Ctx not found");return r}function Bh(){const r=y.useContext(Ea);if(!r)throw new Error("Ctx not found");return r}function Es({actions:r,state:e,children:i,currentTime:o,progress:l,element:u}){return M(Ea.Provider,{value:{currentTime:o,progress:l,element:u},children:M(Sa.Provider,{value:r,children:M(wa.Provider,{value:e,children:i})})})}function jh({media:r,children:e}){const[{element:i,currentTime:o,progress:l},u,d]=Ss({duration:r.duration});return M(Et,{children:M(vn,{children:Te(Es,{state:u,actions:d,currentTime:o,progress:l,element:i,children:[M("audio",{ref:i,src:r.url}),e]})})})}function Hh({media:r,children:e}){const[{element:i,currentTime:o,progress:l},u,d]=Ss({duration:r.duration});return Te(Et,{children:[Te(vn,{overlay:!0,children:[M("style",{children:`
|
|
111
111
|
.video-container {
|
|
112
112
|
position: absolute;
|
|
113
113
|
top: 0;
|
|
@@ -134,6 +134,6 @@ No matching component was found for:
|
|
|
134
134
|
pointer-events: visible;
|
|
135
135
|
}
|
|
136
136
|
`}),M("div",{className:"model-container",children:M("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:r.id})})]})}function xa({style:r}){const e=Ct();return!e||!e.height||!e.width?null:M("box",{interactive:!1,target:{x:0,y:0,width:e.width,height:e.height},style:r})}var Wh=Object.defineProperty,Qh=Object.defineProperties,Xh=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,_a=Object.prototype.hasOwnProperty,Pa=Object.prototype.propertyIsEnumerable,Ca=(r,e,i)=>e in r?Wh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,sn=(r,e)=>{for(var i in e||(e={}))_a.call(e,i)&&Ca(r,i,e[i]);if(qi)for(var i of qi(e))Pa.call(e,i)&&Ca(r,i,e[i]);return r},Zi=(r,e)=>Qh(r,Xh(e)),Ta=(r,e)=>{var i={};for(var o in r)_a.call(r,o)&&e.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&qi)for(var o of qi(r))e.indexOf(o)<0&&Pa.call(r,o)&&(i[o]=r[o]);return i};function Yh(r,e,i){return e in r?Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[e]=i,r}function qh(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ia(r,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function Zh(r,e,i){return e&&Ia(r.prototype,e),i&&Ia(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}var Gh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},Kh,Jh=De.default.createContext();function $h(){return Gh}var ef=function(){function r(){qh(this,r),this.usedNamespaces={}}return Zh(r,[{key:"addUsedNamespaces",value:function(i){var o=this;i.forEach(function(l){o.usedNamespaces[l]||(o.usedNamespaces[l]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),r}();function tf(){return Kh}function nf(){if(console&&console.warn){for(var r,e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];typeof i[0]=="string"&&(i[0]="react-i18next:: ".concat(i[0])),(r=console).warn.apply(r,i)}}var ka={};function xs(){for(var r=arguments.length,e=new Array(r),i=0;i<r;i++)e[i]=arguments[i];typeof e[0]=="string"&&ka[e[0]]||(typeof e[0]=="string"&&(ka[e[0]]=new Date),nf.apply(void 0,e))}function Ma(r,e,i){r.loadNamespaces(e,function(){if(r.isInitialized)i();else{var o=function l(){setTimeout(function(){r.off("initialized",l)},0),i()};r.on("initialized",o)}})}function rf(r,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return xs("i18n.languages were undefined or empty",e.languages),!0;var o=e.languages[0],l=e.options?e.options.fallbackLng:!1,u=e.languages[e.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var d=function(g,p){var m=e.services.backendConnector.state["".concat(g,"|").concat(p)];return m===-1||m===2};return i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!d(e.isLanguageChangingTo,r)?!1:!!(e.hasResourceBundle(o,r)||!e.services.backendConnector.backend||d(o,r)&&(!l||d(u,r)))}function sf(r){if(Array.isArray(r))return r}function of(r,e){var i=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var o=[],l=!0,u=!1,d,h;try{for(i=i.call(r);!(l=(d=i.next()).done)&&(o.push(d.value),!(e&&o.length===e));l=!0);}catch(g){u=!0,h=g}finally{try{!l&&i.return!=null&&i.return()}finally{if(u)throw h}}return o}}function La(r,e){(e==null||e>r.length)&&(e=r.length);for(var i=0,o=new Array(e);i<e;i++)o[i]=r[i];return o}function lf(r,e){if(!!r){if(typeof r=="string")return La(r,e);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return La(r,e)}}function af(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
137
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uf(r,e){return sf(r)||of(r,e)||lf(r,e)||af()}function Oa(r,e){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,o)}return i}function _s(r){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Oa(Object(i),!0).forEach(function(o){Yh(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Oa(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}function Na(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.i18n,o=y.useContext(Jh)||{},l=o.i18n,u=o.defaultNS,d=i||l||tf();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new ef),!d){xs("You will need to pass in an i18next instance by using initReactI18next");var h=function(J){return Array.isArray(J)?J[J.length-1]:J},g=[h,{},!1];return g.t=h,g.i18n={},g.ready=!1,g}d.options.react&&d.options.react.wait!==void 0&&xs("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var p=_s(_s(_s({},$h()),d.options.react),e),m=p.useSuspense,
|
|
138
|
-
`,fallbackLanguages:d=[],closest:h}=i,g=Object.keys(r||{}),p=h?e:Ra(e,g,d,o);if(!r)return l;if(typeof r=="string")return r;const m=p?r[p]:void 0;return m?typeof m=="string"?m:m.join(u):""}function hf(r,e=[]){const{i18n:i}=Na(),o=i&&i.languages?i.languages:[],l=i&&i.language?i.language:"en";return y.useMemo(()=>{const u=r();return Ra(l,u,o)},[o,l,...e])}function ff(r,e){const i=hf(()=>Object.keys(r||{}),[r]);return[y.useMemo(()=>df(r,i,{defaultText:e,closest:!0}),[i,e,r]),i]}const gf=r=>{var e=r,{as:i,defaultText:o,enableDangerouslySetInnerHTML:l,children:u}=e,d=Ta(e,["as","defaultText","enableDangerouslySetInnerHTML","children"]);const[h,g]=ff(u,o);return g?M(cf,te(B({},Zi(sn({},d),{as:i,language:g,title:l?void 0:h,dangerouslySetInnerHTML:l?{__html:h}:void 0})),{children:l?void 0:h})):i?M(i,te(B({},sn({},d)),{children:h})):M("span",te(B({},Zi(sn({},d),{title:l?void 0:h,dangerouslySetInnerHTML:l?{__html:h}:void 0})),{children:l?void 0:h}))};function za({x:r,y:e,onChoiceChange:i,registerActions:o,defaultChoices:l,isStatic:u,renderViewerControls:d,renderMediaControls:h,strategies:g,backgroundStyle:p,alwaysShowBackground:m,onClickPaintingAnnotation:
|
|
137
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uf(r,e){return sf(r)||of(r,e)||lf(r,e)||af()}function Oa(r,e){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,o)}return i}function _s(r){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Oa(Object(i),!0).forEach(function(o){Yh(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Oa(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}function Na(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.i18n,o=y.useContext(Jh)||{},l=o.i18n,u=o.defaultNS,d=i||l||tf();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new ef),!d){xs("You will need to pass in an i18next instance by using initReactI18next");var h=function(J){return Array.isArray(J)?J[J.length-1]:J},g=[h,{},!1];return g.t=h,g.i18n={},g.ready=!1,g}d.options.react&&d.options.react.wait!==void 0&&xs("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var p=_s(_s(_s({},$h()),d.options.react),e),m=p.useSuspense,S=p.keyPrefix,x=r||u||d.options&&d.options.defaultNS;x=typeof x=="string"?[x]:x||["translation"],d.reportNamespaces.addUsedNamespaces&&d.reportNamespaces.addUsedNamespaces(x);var O=(d.isInitialized||d.initializedStoreOnce)&&x.every(function(Q){return rf(Q,d,p)});function R(){return d.getFixedT(null,p.nsMode==="fallback"?x:x[0],S)}var N=y.useState(R),I=uf(N,2),k=I[0],P=I[1],j=y.useRef(!0);y.useEffect(function(){var Q=p.bindI18n,J=p.bindI18nStore;j.current=!0,!O&&!m&&Ma(d,x,function(){j.current&&P(R)});function q(){j.current&&P(R)}return Q&&d&&d.on(Q,q),J&&d&&d.store.on(J,q),function(){j.current=!1,Q&&d&&Q.split(" ").forEach(function(b){return d.off(b,q)}),J&&d&&J.split(" ").forEach(function(b){return d.store.off(b,q)})}},[d,x.join()]);var V=y.useRef(!0);y.useEffect(function(){j.current&&!V.current&&P(R),V.current=!1},[d]);var W=[k,d,O];if(W.t=k,W.i18n=d,W.ready=O,O||!O&&!m)return W;throw new Promise(function(Q){Ma(d,x,function(){Q()})})}function cf(r){var e=r,{as:i,language:o,children:l}=e,u=Ta(e,["as","language","children"]);const{i18n:d}=Na(),h=y.useMemo(()=>d.dir?d.dir(o):"ltr",[o]);return y.useMemo(()=>d.services?d.services.languageUtils.getLanguagePartFromCode(d.language)===d.services.languageUtils.getLanguagePartFromCode(o):!1,[d.language,o])?i?M(i,te(B({},sn({},u)),{children:l})):M("span",te(B({},sn({},u)),{children:l})):i?M(i,te(B({},Zi(sn({},u),{lang:o,dir:h})),{children:l})):M("span",te(B({},Zi(sn({},u),{lang:o,dir:h})),{children:l}))}function Ra(r,e,i=[],o=!1){if(!r||!e||e.length===0)return;if(e.length===1)return e[0];if(e.indexOf(r)!==-1)return r;const l=r.indexOf("-")!==-1?r.slice(0,r.indexOf("-")):null;if(l&&e.indexOf(l)!==-1)return l;for(const u of i)if(e.indexOf(u)!==-1)return u;if(!o){const d=e.map(h=>h.indexOf("-")!==-1?h.slice(0,h.indexOf("-")):null).indexOf(r);if(d!==-1)return e[d];for(const h of i){const g=h.indexOf("-")!==-1?h.slice(0,h.indexOf("-")):null,p=g?e.indexOf(g):-1;if(p!==-1)return e[p]}}return e.indexOf("none")!==-1?"none":e.indexOf("@none")!==-1?"@none":e[0]}function df(r,e,i={}){const{strictFallback:o=!1,defaultText:l="",separator:u=`
|
|
138
|
+
`,fallbackLanguages:d=[],closest:h}=i,g=Object.keys(r||{}),p=h?e:Ra(e,g,d,o);if(!r)return l;if(typeof r=="string")return r;const m=p?r[p]:void 0;return m?typeof m=="string"?m:m.join(u):""}function hf(r,e=[]){const{i18n:i}=Na(),o=i&&i.languages?i.languages:[],l=i&&i.language?i.language:"en";return y.useMemo(()=>{const u=r();return Ra(l,u,o)},[o,l,...e])}function ff(r,e){const i=hf(()=>Object.keys(r||{}),[r]);return[y.useMemo(()=>df(r,i,{defaultText:e,closest:!0}),[i,e,r]),i]}const gf=r=>{var e=r,{as:i,defaultText:o,enableDangerouslySetInnerHTML:l,children:u}=e,d=Ta(e,["as","defaultText","enableDangerouslySetInnerHTML","children"]);const[h,g]=ff(u,o);return g?M(cf,te(B({},Zi(sn({},d),{as:i,language:g,title:l?void 0:h,dangerouslySetInnerHTML:l?{__html:h}:void 0})),{children:l?void 0:h})):i?M(i,te(B({},sn({},d)),{children:h})):M("span",te(B({},Zi(sn({},d),{title:l?void 0:h,dangerouslySetInnerHTML:l?{__html:h}:void 0})),{children:l?void 0:h}))};function za({x:r,y:e,onChoiceChange:i,registerActions:o,defaultChoices:l,isStatic:u,renderViewerControls:d,renderMediaControls:h,strategies:g,backgroundStyle:p,alwaysShowBackground:m,onClickPaintingAnnotation:S,children:x}){const O=Ct(),R=gs(O,["deep-zoom"]),[N]=jl(),I=Me(),k=y.useMemo(()=>ps(I),[I]),[P,j]=pa({strategies:g||["images"],defaultChoices:l==null?void 0:l.map(({id:b})=>b)}),V=P.type==="images"?P.choice:void 0;y.useEffect(()=>{o&&o(j)},[P.annotations]),y.useEffect(()=>{if(l)for(const b of l)typeof b.opacity!="undefined"&&k.applyStyles({id:b.id},"atlas",{opacity:b.opacity})},[l]),y.useLayoutEffect(()=>{i&&i(V)},[V]);const W=va({maxWidth:256,maxHeight:256});if(!O)return null;const Q=O.accompanyingCanvas,J=W&&W.type==="fixed"?M("world-object",{height:O.height,width:O.width,x:r,y:e,children:M("world-image",{uri:W.id,target:{x:0,y:0,width:O.width,height:O.height},display:W.width&&W.height?{width:W.width,height:W.height}:void 0})}):null;if(P.type==="unknown"){if(J)return J;throw new Error(P.reason||"Unknown image strategy")}const q=Te(y.Fragment,{children:[N?M(vs,{page:N}):null,P.annotations&&P.annotations.pages?P.annotations.pages.map(b=>M(vs,{page:b},b.id)):null,x]});return Te(Et,{children:[Te("world-object",te(B({height:O.height,width:O.width,x:r,y:e},R),{children:[P.type==="empty"||m?M(xa,{style:p}):null,P.type==="textual-content"?P.items.map((b,le)=>Te(Et,{children:[M(rs,{onClick:S?fe=>{fe.stopPropagation(),S(b.annotationId,b,fe)}:void 0,target:b.target.spatial||void 0,children:M(gf,{children:b.text})},le),q]})):null,P.type==="images"?Te(Et,{children:[P.images.map((b,le)=>M(Jl,{isStatic:u,image:b,id:b.id,thumbnail:le===0?W:void 0,onClick:S?fe=>{fe.stopPropagation(),S(b.annotationId,b,fe)}:void 0},b.id)),q]}):null,(P.type==="images"||P.type==="empty"||P.type==="textual-content")&&d?M(vn,{overlay:!0,children:d(P)}):null,P.type==="3d-model"?M(Vh,{model:P.model}):null,P.type==="media"?M(Et,{children:P.media.type==="Sound"?Te(jh,{media:P.media,children:[J,h?h(P):null]}):P.media.type==="Video"?Te(Hh,{media:P.media,children:[J,h?h(P):null]}):null}):null]}),`${O.id}/${P.type}`),P.type==="media"&&P.media.type==="Sound"&&Q?M(ls,{canvas:Q.id,children:M(za,{renderViewerControls:d})}):null]})}const pf={RenderImage:Jl,RenderCanvas:za,RenderAnnotationPage:vs,RenderAnnotation:Kl,Viewer:hh,CanvasBackground:xa};function mf({annotation:r,children:e}){return M(Ut,{value:{annotation:r},children:e})}function vf({annotationPage:r,children:e}){return M(Ut,{value:{annotationPage:r},children:e})}function yf({collection:r,children:e}){return M(Ut,{value:{collection:r},children:e})}function wf(r={},e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.annotationPage,d=Ne(h=>u?h.iiif.entities.AnnotationPage[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,...e])}function Sf(r,e={}){return Yi(e)}function Ef(r,e=!1){}function xf(r){const i=Pt().manifest,o=r?r.map(l=>typeof l=="string"?l:l==null?void 0:l.id):[];return Ne(l=>{const u=i?l.iiif.entities.Manifest[i]:void 0,d=(u==null?void 0:u.items)||[];if(typeof r=="undefined")return d;const h=[];for(const g of(u==null?void 0:u.items)||[])o.indexOf(g.id)!==-1&&h.push(g);return h},[o.join("/")])}function _f(r,e=[]){const{id:i,selector:o}=r,l=Pt(),u=i||l.collection,d=Ne(h=>u?h.iiif.entities.Collection[u]:void 0,[u]);return y.useMemo(()=>{if(!!d)return o?o(d):d},[d,o,...e])}function Pf(r,e,i,o,l=[]){const u=Me(),d=y.useMemo(()=>Xl(u),[u]);y.useEffect(()=>{const h=r;return h?(d.addEventListener(h,e,i,o),()=>{d.removeEventListener(h,e,i)}):()=>{}},[d,r,e,...l])}function Cf(){const r=y.useContext(Bn);return r&&r.vault?r.vault:ke.globalVault()}function Tf(r,e){const{id:i,isLoaded:o,error:l,resource:u,requestId:d,cached:h}=os(r,e);return{id:i,isLoaded:o,error:l,manifest:u,requestId:d,cached:h}}function Aa({cacheKey:r}={}){const e=Ct(),i=Yi(),o=Me(),l=Xi(),[u,d]=y.useState(void 0),[h,g]=y.useState(!1),[p,m]=y.useState("idle"),[S,x]=y.useState(void 0),O=e?e.id:"undefined",R=y.useMemo(()=>{try{if(e&&i.length){const I=i[0],k=o.get(I.body[0]),j=Jt.getImageServices(k)[0];return j&&l.loadServiceSync({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0}}catch(I){console.error(I)}},[O,r,e]),N=p==="success"&&u?u:R;return y.useEffect(()=>{(async()=>{try{if(e&&i.length){const I=i[0],k=o.get(I.body[0]),j=Jt.getImageServices(k)[0];if(!j)return;g(!0),m("loading");try{const V=await l.loadService({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0;d(V),m("success"),g(!1)}catch(V){m("error"),x(V)}}}catch(I){m("error"),x(I)}})()},[O,r]),y.useMemo(()=>({data:N,isFetching:h,status:p,error:S}),[N,h,p,S])}function If(){const r=Aa();return{isLoading:r.isFetching,tile:r.data?{id:r.data.id||r.data["@id"],width:r.data.width,height:r.data.height,imageService:r.data,thumbnail:void 0}:null}}function kf(){const r=nn();return r?r.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function Mf(){const r=Me();return y.useMemo(()=>ps(r),[r])}L.AnnotationContext=mf,L.AnnotationPageContext=vf,L.CanvasContext=ls,L.CanvasPanel=pf,L.CanvasPortal=vn,L.CollectionContext=yf,L.ContextBridge=Nl,L.ImageServiceLoaderContext=ca,L.InnerViewerProvider=Ll,L.ManifestContext=Pl,L.MediaPlayerProvider=Es,L.OverlayPortalContext=fs,L.PortalContext=hs,L.RangeContext=Tl,L.ReactVaultContext=Bn,L.ResourceProvider=Ut,L.ResourceReactContext=Bi,L.SimpleViewerProvider=Ud,L.SimpleViewerReactContext=Vn,L.VaultProvider=xl,L.ViewerPresetContext=ji,L.VirtualAnnotationProvider=Hl,L.VisibleCanvasReactContext=jn,L.emptyActions=sa,L.emptyStrategy=oa,L.expandTarget=rn,L.findAllCanvasesInRange=as,L.findFirstCanvasFromRange=Il,L.findManifestSelectedRange=Fd,L.findSelectedRange=us,L.flattenAnnotationPageIds=la,L.formatTime=ya,L.getImageStrategy=fa,L.getManifestSequence=cs,L.getPaintables=ra,L.getParsedTargetSelector=ws,L.getVisibleCanvasesFromCanvasId=Dd,L.parseSelector=Wi,L.parseSpecificResource=ia,L.unknownResponse=Qi,L.unsupportedStrategy=Le,L.useAnnotation=ms,L.useAnnotationPage=wf,L.useAnnotationPageManager=aa,L.useAnnotationsAtTime=Sf,L.useCanvas=Ct,L.useCanvasClock=Ef,L.useCanvasSequence=Ml,L.useCanvasSubset=xf,L.useCollection=_f,L.useContextBridge=Ol,L.useDispatch=Dl,L.useEventListener=Pf,L.useExistingVault=Cf,L.useExternalCollection=Tf,L.useExternalManifest=_l,L.useExternalResource=os,L.useImageService=Aa,L.useImageServiceLoader=Xi,L.useImageTile=If,L.useLoadImageService=da,L.useManifest=nn,L.useMediaActions=bh,L.useMediaElements=Bh,L.useMediaState=Uh,L.usePaintables=ha,L.usePaintingAnnotations=Yi,L.useRange=kl,L.useRenderingStrategy=pa,L.useResourceContext=Pt,L.useResourceEvents=gs,L.useResources=ua,L.useSearchService=kf,L.useSimpleMediaPlayer=Ss,L.useSimpleViewer=bd,L.useStyleHelper=Mf,L.useStyles=Wn,L.useThumbnail=va,L.useVault=Me,L.useVaultEffect=ma,L.useVaultSelector=Ne,L.useViewerPreset=Vl,L.useVirtualAnnotationPage=bl,L.useVirtualAnnotationPageContext=jl,L.useVisibleCanvases=Cl,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
139
139
|
//# sourceMappingURL=index.umd.js.map
|