react-iiif-vault 1.0.3 → 1.0.4

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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(de,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react"),require("react-dom"),require("@atlas-viewer/iiif-image-api")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@atlas-viewer/iiif-image-api"],R):(de=typeof globalThis<"u"?globalThis:de||self,R(de.ReactIIIFVault={},de.React,de.ReactDOM,de.IIIFImageApi))})(this,function(de,R,by,Ka){"use strict";function Xw(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Kw(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in t)){const u=Object.getOwnPropertyDescriptor(i,a);u&&Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const se=Xw(R);function Zw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mp={exports:{}},Zu={};/**
1
+ (function(fe,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react"),require("react-dom"),require("@atlas-viewer/iiif-image-api")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@atlas-viewer/iiif-image-api"],T):(fe=typeof globalThis<"u"?globalThis:fe||self,T(fe.ReactIIIFVault={},fe.React,fe.ReactDOM,fe.IIIFImageApi))})(this,function(fe,T,by,Ka){"use strict";function eC(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function tC(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in t)){const u=Object.getOwnPropertyDescriptor(i,a);u&&Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const se=eC(T);function nC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mp={exports:{}},Zu={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.development.js
4
4
  *
@@ -6,17 +6,17 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ey;function Jw(){return Ey||(Ey=1,process.env.NODE_ENV!=="production"&&function(){var t=R,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),M=Symbol.iterator,k="@@iterator";function L(z){if(z===null||typeof z!="object")return null;var fe=M&&z[M]||z[k];return typeof fe=="function"?fe:null}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(z){{for(var fe=arguments.length,Te=new Array(fe>1?fe-1:0),Ke=1;Ke<fe;Ke++)Te[Ke-1]=arguments[Ke];j("error",z,Te)}}function j(z,fe,Te){{var Ke=P.ReactDebugCurrentFrame,Ct=Ke.getStackAddendum();Ct!==""&&(fe+="%s",Te=Te.concat([Ct]));var Ot=Te.map(function(pt){return String(pt)});Ot.unshift("Warning: "+fe),Function.prototype.apply.call(console[z],console,Ot)}}var q=!1,ee=!1,H=!1,Z=!1,ie=!1,W;W=Symbol.for("react.module.reference");function re(z){return!!(typeof z=="string"||typeof z=="function"||z===i||z===u||ie||z===a||z===S||z===m||Z||z===_||q||ee||H||typeof z=="object"&&z!==null&&(z.$$typeof===T||z.$$typeof===x||z.$$typeof===f||z.$$typeof===p||z.$$typeof===g||z.$$typeof===W||z.getModuleId!==void 0))}function ge(z,fe,Te){var Ke=z.displayName;if(Ke)return Ke;var Ct=fe.displayName||fe.name||"";return Ct!==""?Te+"("+Ct+")":Te}function be(z){return z.displayName||"Context"}function Ee(z){if(z==null)return null;if(typeof z.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case i:return"Fragment";case n:return"Portal";case u:return"Profiler";case a:return"StrictMode";case S:return"Suspense";case m:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case p:var fe=z;return be(fe)+".Consumer";case f:var Te=z;return be(Te._context)+".Provider";case g:return ge(z,z.render,"ForwardRef");case x:var Ke=z.displayName||null;return Ke!==null?Ke:Ee(z.type)||"Memo";case T:{var Ct=z,Ot=Ct._payload,pt=Ct._init;try{return Ee(pt(Ot))}catch{return null}}}return null}var Ue=Object.assign,je=0,Xe,ce,me,tt,mt,he,Fe;function $e(){}$e.__reactDisabledLog=!0;function ht(){{if(je===0){Xe=console.log,ce=console.info,me=console.warn,tt=console.error,mt=console.group,he=console.groupCollapsed,Fe=console.groupEnd;var z={configurable:!0,enumerable:!0,value:$e,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}je++}}function gt(){{if(je--,je===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ue({},z,{value:Xe}),info:Ue({},z,{value:ce}),warn:Ue({},z,{value:me}),error:Ue({},z,{value:tt}),group:Ue({},z,{value:mt}),groupCollapsed:Ue({},z,{value:he}),groupEnd:Ue({},z,{value:Fe})})}je<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var gn=P.ReactCurrentDispatcher,Xt;function yt(z,fe,Te){{if(Xt===void 0)try{throw Error()}catch(Ct){var Ke=Ct.stack.trim().match(/\n( *(at )?)/);Xt=Ke&&Ke[1]||""}return`
10
- `+Xt+z}}var Be=!1,nt;{var ot=typeof WeakMap=="function"?WeakMap:Map;nt=new ot}function lt(z,fe){if(!z||Be)return"";{var Te=nt.get(z);if(Te!==void 0)return Te}var Ke;Be=!0;var Ct=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ot;Ot=gn.current,gn.current=null,ht();try{if(fe){var pt=function(){throw Error()};if(Object.defineProperty(pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pt,[])}catch(vt){Ke=vt}Reflect.construct(z,[],pt)}else{try{pt.call()}catch(vt){Ke=vt}z.call(pt.prototype)}}else{try{throw Error()}catch(vt){Ke=vt}z()}}catch(vt){if(vt&&Ke&&typeof vt.stack=="string"){for(var ft=vt.stack.split(`
9
+ */var Ey;function iC(){return Ey||(Ey=1,process.env.NODE_ENV!=="production"&&function(){var t=T,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),M=Symbol.iterator,k="@@iterator";function L(z){if(z===null||typeof z!="object")return null;var de=M&&z[M]||z[k];return typeof de=="function"?de:null}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(z){{for(var de=arguments.length,Te=new Array(de>1?de-1:0),Ke=1;Ke<de;Ke++)Te[Ke-1]=arguments[Ke];j("error",z,Te)}}function j(z,de,Te){{var Ke=P.ReactDebugCurrentFrame,Ct=Ke.getStackAddendum();Ct!==""&&(de+="%s",Te=Te.concat([Ct]));var Ot=Te.map(function(pt){return String(pt)});Ot.unshift("Warning: "+de),Function.prototype.apply.call(console[z],console,Ot)}}var q=!1,ee=!1,H=!1,Z=!1,ie=!1,W;W=Symbol.for("react.module.reference");function re(z){return!!(typeof z=="string"||typeof z=="function"||z===i||z===u||ie||z===a||z===S||z===m||Z||z===_||q||ee||H||typeof z=="object"&&z!==null&&(z.$$typeof===R||z.$$typeof===x||z.$$typeof===f||z.$$typeof===p||z.$$typeof===g||z.$$typeof===W||z.getModuleId!==void 0))}function ge(z,de,Te){var Ke=z.displayName;if(Ke)return Ke;var Ct=de.displayName||de.name||"";return Ct!==""?Te+"("+Ct+")":Te}function be(z){return z.displayName||"Context"}function Ee(z){if(z==null)return null;if(typeof z.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case i:return"Fragment";case n:return"Portal";case u:return"Profiler";case a:return"StrictMode";case S:return"Suspense";case m:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case p:var de=z;return be(de)+".Consumer";case f:var Te=z;return be(Te._context)+".Provider";case g:return ge(z,z.render,"ForwardRef");case x:var Ke=z.displayName||null;return Ke!==null?Ke:Ee(z.type)||"Memo";case R:{var Ct=z,Ot=Ct._payload,pt=Ct._init;try{return Ee(pt(Ot))}catch{return null}}}return null}var Ue=Object.assign,je=0,Xe,ce,me,tt,mt,he,Fe;function $e(){}$e.__reactDisabledLog=!0;function ht(){{if(je===0){Xe=console.log,ce=console.info,me=console.warn,tt=console.error,mt=console.group,he=console.groupCollapsed,Fe=console.groupEnd;var z={configurable:!0,enumerable:!0,value:$e,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}je++}}function gt(){{if(je--,je===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ue({},z,{value:Xe}),info:Ue({},z,{value:ce}),warn:Ue({},z,{value:me}),error:Ue({},z,{value:tt}),group:Ue({},z,{value:mt}),groupCollapsed:Ue({},z,{value:he}),groupEnd:Ue({},z,{value:Fe})})}je<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var gn=P.ReactCurrentDispatcher,Xt;function yt(z,de,Te){{if(Xt===void 0)try{throw Error()}catch(Ct){var Ke=Ct.stack.trim().match(/\n( *(at )?)/);Xt=Ke&&Ke[1]||""}return`
10
+ `+Xt+z}}var Be=!1,nt;{var ot=typeof WeakMap=="function"?WeakMap:Map;nt=new ot}function lt(z,de){if(!z||Be)return"";{var Te=nt.get(z);if(Te!==void 0)return Te}var Ke;Be=!0;var Ct=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ot;Ot=gn.current,gn.current=null,ht();try{if(de){var pt=function(){throw Error()};if(Object.defineProperty(pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pt,[])}catch(vt){Ke=vt}Reflect.construct(z,[],pt)}else{try{pt.call()}catch(vt){Ke=vt}z.call(pt.prototype)}}else{try{throw Error()}catch(vt){Ke=vt}z()}}catch(vt){if(vt&&Ke&&typeof vt.stack=="string"){for(var ft=vt.stack.split(`
11
11
  `),bn=Ke.stack.split(`
12
12
  `),jt=ft.length-1,$t=bn.length-1;jt>=1&&$t>=0&&ft[jt]!==bn[$t];)$t--;for(;jt>=1&&$t>=0;jt--,$t--)if(ft[jt]!==bn[$t]){if(jt!==1||$t!==1)do if(jt--,$t--,$t<0||ft[jt]!==bn[$t]){var jn=`
13
- `+ft[jt].replace(" at new "," at ");return z.displayName&&jn.includes("<anonymous>")&&(jn=jn.replace("<anonymous>",z.displayName)),typeof z=="function"&&nt.set(z,jn),jn}while(jt>=1&&$t>=0);break}}}finally{Be=!1,gn.current=Ot,gt(),Error.prepareStackTrace=Ct}var ii=z?z.displayName||z.name:"",Fi=ii?yt(ii):"";return typeof z=="function"&&nt.set(z,Fi),Fi}function Et(z,fe,Te){return lt(z,!1)}function wt(z){var fe=z.prototype;return!!(fe&&fe.isReactComponent)}function yn(z,fe,Te){if(z==null)return"";if(typeof z=="function")return lt(z,wt(z));if(typeof z=="string")return yt(z);switch(z){case S:return yt("Suspense");case m:return yt("SuspenseList")}if(typeof z=="object")switch(z.$$typeof){case g:return Et(z.render);case x:return yn(z.type,fe,Te);case T:{var Ke=z,Ct=Ke._payload,Ot=Ke._init;try{return yn(Ot(Ct),fe,Te)}catch{}}}return""}var Kt=Object.prototype.hasOwnProperty,tr={},U=P.ReactDebugCurrentFrame;function I(z){if(z){var fe=z._owner,Te=yn(z.type,z._source,fe?fe.type:null);U.setExtraStackFrame(Te)}else U.setExtraStackFrame(null)}function G(z,fe,Te,Ke,Ct){{var Ot=Function.call.bind(Kt);for(var pt in z)if(Ot(z,pt)){var ft=void 0;try{if(typeof z[pt]!="function"){var bn=Error((Ke||"React class")+": "+Te+" type `"+pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw bn.name="Invariant Violation",bn}ft=z[pt](fe,pt,Ke,Te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(jt){ft=jt}ft&&!(ft instanceof Error)&&(I(Ct),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ke||"React class",Te,pt,typeof ft),I(null)),ft instanceof Error&&!(ft.message in tr)&&(tr[ft.message]=!0,I(Ct),O("Failed %s type: %s",Te,ft.message),I(null))}}}var Se=Array.isArray;function ut(z){return Se(z)}function We(z){{var fe=typeof Symbol=="function"&&Symbol.toStringTag,Te=fe&&z[Symbol.toStringTag]||z.constructor.name||"Object";return Te}}function Sn(z){try{return ji(z),!1}catch{return!0}}function ji(z){return""+z}function xe(z){if(Sn(z))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",We(z)),ji(z)}var ct=P.ReactCurrentOwner,pi={key:!0,ref:!0,__self:!0,__source:!0},Pt,it,Re;Re={};function De(z){if(Kt.call(z,"ref")){var fe=Object.getOwnPropertyDescriptor(z,"ref").get;if(fe&&fe.isReactWarning)return!1}return z.ref!==void 0}function at(z){if(Kt.call(z,"key")){var fe=Object.getOwnPropertyDescriptor(z,"key").get;if(fe&&fe.isReactWarning)return!1}return z.key!==void 0}function Dt(z,fe){if(typeof z.ref=="string"&&ct.current&&fe&&ct.current.stateNode!==fe){var Te=Ee(ct.current.type);Re[Te]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Ee(ct.current.type),z.ref),Re[Te]=!0)}}function rt(z,fe){{var Te=function(){Pt||(Pt=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",fe))};Te.isReactWarning=!0,Object.defineProperty(z,"key",{get:Te,configurable:!0})}}function ln(z,fe){{var Te=function(){it||(it=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",fe))};Te.isReactWarning=!0,Object.defineProperty(z,"ref",{get:Te,configurable:!0})}}var en=function(z,fe,Te,Ke,Ct,Ot,pt){var ft={$$typeof:e,type:z,key:fe,ref:Te,props:pt,_owner:Ot};return ft._store={},Object.defineProperty(ft._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ft,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.defineProperty(ft,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ct}),Object.freeze&&(Object.freeze(ft.props),Object.freeze(ft)),ft};function Wn(z,fe,Te,Ke,Ct){{var Ot,pt={},ft=null,bn=null;Te!==void 0&&(xe(Te),ft=""+Te),at(fe)&&(xe(fe.key),ft=""+fe.key),De(fe)&&(bn=fe.ref,Dt(fe,Ct));for(Ot in fe)Kt.call(fe,Ot)&&!pi.hasOwnProperty(Ot)&&(pt[Ot]=fe[Ot]);if(z&&z.defaultProps){var jt=z.defaultProps;for(Ot in jt)pt[Ot]===void 0&&(pt[Ot]=jt[Ot])}if(ft||bn){var $t=typeof z=="function"?z.displayName||z.name||"Unknown":z;ft&&rt(pt,$t),bn&&ln(pt,$t)}return en(z,ft,bn,Ct,Ke,ct.current,pt)}}var sn=P.ReactCurrentOwner,Ri=P.ReactDebugCurrentFrame;function es(z){if(z){var fe=z._owner,Te=yn(z.type,z._source,fe?fe.type:null);Ri.setExtraStackFrame(Te)}else Ri.setExtraStackFrame(null)}var po;po=!1;function vo(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ts(){{if(sn.current){var z=Ee(sn.current.type);if(z)return`
13
+ `+ft[jt].replace(" at new "," at ");return z.displayName&&jn.includes("<anonymous>")&&(jn=jn.replace("<anonymous>",z.displayName)),typeof z=="function"&&nt.set(z,jn),jn}while(jt>=1&&$t>=0);break}}}finally{Be=!1,gn.current=Ot,gt(),Error.prepareStackTrace=Ct}var ii=z?z.displayName||z.name:"",Fi=ii?yt(ii):"";return typeof z=="function"&&nt.set(z,Fi),Fi}function Et(z,de,Te){return lt(z,!1)}function wt(z){var de=z.prototype;return!!(de&&de.isReactComponent)}function yn(z,de,Te){if(z==null)return"";if(typeof z=="function")return lt(z,wt(z));if(typeof z=="string")return yt(z);switch(z){case S:return yt("Suspense");case m:return yt("SuspenseList")}if(typeof z=="object")switch(z.$$typeof){case g:return Et(z.render);case x:return yn(z.type,de,Te);case R:{var Ke=z,Ct=Ke._payload,Ot=Ke._init;try{return yn(Ot(Ct),de,Te)}catch{}}}return""}var Kt=Object.prototype.hasOwnProperty,tr={},U=P.ReactDebugCurrentFrame;function I(z){if(z){var de=z._owner,Te=yn(z.type,z._source,de?de.type:null);U.setExtraStackFrame(Te)}else U.setExtraStackFrame(null)}function G(z,de,Te,Ke,Ct){{var Ot=Function.call.bind(Kt);for(var pt in z)if(Ot(z,pt)){var ft=void 0;try{if(typeof z[pt]!="function"){var bn=Error((Ke||"React class")+": "+Te+" type `"+pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw bn.name="Invariant Violation",bn}ft=z[pt](de,pt,Ke,Te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(jt){ft=jt}ft&&!(ft instanceof Error)&&(I(Ct),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ke||"React class",Te,pt,typeof ft),I(null)),ft instanceof Error&&!(ft.message in tr)&&(tr[ft.message]=!0,I(Ct),O("Failed %s type: %s",Te,ft.message),I(null))}}}var Se=Array.isArray;function ut(z){return Se(z)}function We(z){{var de=typeof Symbol=="function"&&Symbol.toStringTag,Te=de&&z[Symbol.toStringTag]||z.constructor.name||"Object";return Te}}function Sn(z){try{return ji(z),!1}catch{return!0}}function ji(z){return""+z}function xe(z){if(Sn(z))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",We(z)),ji(z)}var ct=P.ReactCurrentOwner,pi={key:!0,ref:!0,__self:!0,__source:!0},Pt,it,Re;Re={};function De(z){if(Kt.call(z,"ref")){var de=Object.getOwnPropertyDescriptor(z,"ref").get;if(de&&de.isReactWarning)return!1}return z.ref!==void 0}function at(z){if(Kt.call(z,"key")){var de=Object.getOwnPropertyDescriptor(z,"key").get;if(de&&de.isReactWarning)return!1}return z.key!==void 0}function Dt(z,de){if(typeof z.ref=="string"&&ct.current&&de&&ct.current.stateNode!==de){var Te=Ee(ct.current.type);Re[Te]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Ee(ct.current.type),z.ref),Re[Te]=!0)}}function rt(z,de){{var Te=function(){Pt||(Pt=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",de))};Te.isReactWarning=!0,Object.defineProperty(z,"key",{get:Te,configurable:!0})}}function ln(z,de){{var Te=function(){it||(it=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",de))};Te.isReactWarning=!0,Object.defineProperty(z,"ref",{get:Te,configurable:!0})}}var en=function(z,de,Te,Ke,Ct,Ot,pt){var ft={$$typeof:e,type:z,key:de,ref:Te,props:pt,_owner:Ot};return ft._store={},Object.defineProperty(ft._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ft,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.defineProperty(ft,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ct}),Object.freeze&&(Object.freeze(ft.props),Object.freeze(ft)),ft};function Wn(z,de,Te,Ke,Ct){{var Ot,pt={},ft=null,bn=null;Te!==void 0&&(xe(Te),ft=""+Te),at(de)&&(xe(de.key),ft=""+de.key),De(de)&&(bn=de.ref,Dt(de,Ct));for(Ot in de)Kt.call(de,Ot)&&!pi.hasOwnProperty(Ot)&&(pt[Ot]=de[Ot]);if(z&&z.defaultProps){var jt=z.defaultProps;for(Ot in jt)pt[Ot]===void 0&&(pt[Ot]=jt[Ot])}if(ft||bn){var $t=typeof z=="function"?z.displayName||z.name||"Unknown":z;ft&&rt(pt,$t),bn&&ln(pt,$t)}return en(z,ft,bn,Ct,Ke,ct.current,pt)}}var sn=P.ReactCurrentOwner,Ri=P.ReactDebugCurrentFrame;function es(z){if(z){var de=z._owner,Te=yn(z.type,z._source,de?de.type:null);Ri.setExtraStackFrame(Te)}else Ri.setExtraStackFrame(null)}var po;po=!1;function vo(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ts(){{if(sn.current){var z=Ee(sn.current.type);if(z)return`
14
14
 
15
- Check the render method of \``+z+"`."}return""}}function Ai(z){{if(z!==void 0){var fe=z.fileName.replace(/^.*[\\\/]/,""),Te=z.lineNumber;return`
15
+ Check the render method of \``+z+"`."}return""}}function Ai(z){{if(z!==void 0){var de=z.fileName.replace(/^.*[\\\/]/,""),Te=z.lineNumber;return`
16
16
 
17
- Check your code at `+fe+":"+Te+"."}return""}}var Ea={};function mo(z){{var fe=ts();if(!fe){var Te=typeof z=="string"?z:z.displayName||z.name;Te&&(fe=`
17
+ Check your code at `+de+":"+Te+"."}return""}}var Ea={};function mo(z){{var de=ts();if(!de){var Te=typeof z=="string"?z:z.displayName||z.name;Te&&(de=`
18
18
 
19
- Check the top-level render call using <`+Te+">.")}return fe}}function ks(z,fe){{if(!z._store||z._store.validated||z.key!=null)return;z._store.validated=!0;var Te=mo(fe);if(Ea[Te])return;Ea[Te]=!0;var Ke="";z&&z._owner&&z._owner!==sn.current&&(Ke=" It was passed a child from "+Ee(z._owner.type)+"."),es(z),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Te,Ke),es(null)}}function nr(z,fe){{if(typeof z!="object")return;if(ut(z))for(var Te=0;Te<z.length;Te++){var Ke=z[Te];vo(Ke)&&ks(Ke,fe)}else if(vo(z))z._store&&(z._store.validated=!0);else if(z){var Ct=L(z);if(typeof Ct=="function"&&Ct!==z.entries)for(var Ot=Ct.call(z),pt;!(pt=Ot.next()).done;)vo(pt.value)&&ks(pt.value,fe)}}}function $l(z){{var fe=z.type;if(fe==null||typeof fe=="string")return;var Te;if(typeof fe=="function")Te=fe.propTypes;else if(typeof fe=="object"&&(fe.$$typeof===g||fe.$$typeof===x))Te=fe.propTypes;else return;if(Te){var Ke=Ee(fe);G(Te,z.props,"prop",Ke,z)}else if(fe.PropTypes!==void 0&&!po){po=!0;var Ct=Ee(fe);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ct||"Unknown")}typeof fe.getDefaultProps=="function"&&!fe.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wl(z){{for(var fe=Object.keys(z.props),Te=0;Te<fe.length;Te++){var Ke=fe[Te];if(Ke!=="children"&&Ke!=="key"){es(z),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),es(null);break}}z.ref!==null&&(es(z),O("Invalid attribute `ref` supplied to `React.Fragment`."),es(null))}}function ns(z,fe,Te,Ke,Ct,Ot){{var pt=re(z);if(!pt){var ft="";(z===void 0||typeof z=="object"&&z!==null&&Object.keys(z).length===0)&&(ft+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var bn=Ai(Ct);bn?ft+=bn:ft+=ts();var jt;z===null?jt="null":ut(z)?jt="array":z!==void 0&&z.$$typeof===e?(jt="<"+(Ee(z.type)||"Unknown")+" />",ft=" Did you accidentally export a JSX literal instead of a component?"):jt=typeof z,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",jt,ft)}var $t=Wn(z,fe,Te,Ct,Ot);if($t==null)return $t;if(pt){var jn=fe.children;if(jn!==void 0)if(Ke)if(ut(jn)){for(var ii=0;ii<jn.length;ii++)nr(jn[ii],z);Object.freeze&&Object.freeze(jn)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else nr(jn,z)}return z===i?Wl($t):$l($t),$t}}function Pc(z,fe,Te){return ns(z,fe,Te,!0)}function Dc(z,fe,Te){return ns(z,fe,Te,!1)}var ql=Dc,Yl=Pc;Zu.Fragment=i,Zu.jsx=ql,Zu.jsxs=Yl}()),Zu}var Ju={};/**
19
+ Check the top-level render call using <`+Te+">.")}return de}}function ks(z,de){{if(!z._store||z._store.validated||z.key!=null)return;z._store.validated=!0;var Te=mo(de);if(Ea[Te])return;Ea[Te]=!0;var Ke="";z&&z._owner&&z._owner!==sn.current&&(Ke=" It was passed a child from "+Ee(z._owner.type)+"."),es(z),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Te,Ke),es(null)}}function nr(z,de){{if(typeof z!="object")return;if(ut(z))for(var Te=0;Te<z.length;Te++){var Ke=z[Te];vo(Ke)&&ks(Ke,de)}else if(vo(z))z._store&&(z._store.validated=!0);else if(z){var Ct=L(z);if(typeof Ct=="function"&&Ct!==z.entries)for(var Ot=Ct.call(z),pt;!(pt=Ot.next()).done;)vo(pt.value)&&ks(pt.value,de)}}}function $l(z){{var de=z.type;if(de==null||typeof de=="string")return;var Te;if(typeof de=="function")Te=de.propTypes;else if(typeof de=="object"&&(de.$$typeof===g||de.$$typeof===x))Te=de.propTypes;else return;if(Te){var Ke=Ee(de);G(Te,z.props,"prop",Ke,z)}else if(de.PropTypes!==void 0&&!po){po=!0;var Ct=Ee(de);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ct||"Unknown")}typeof de.getDefaultProps=="function"&&!de.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wl(z){{for(var de=Object.keys(z.props),Te=0;Te<de.length;Te++){var Ke=de[Te];if(Ke!=="children"&&Ke!=="key"){es(z),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),es(null);break}}z.ref!==null&&(es(z),O("Invalid attribute `ref` supplied to `React.Fragment`."),es(null))}}function ns(z,de,Te,Ke,Ct,Ot){{var pt=re(z);if(!pt){var ft="";(z===void 0||typeof z=="object"&&z!==null&&Object.keys(z).length===0)&&(ft+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var bn=Ai(Ct);bn?ft+=bn:ft+=ts();var jt;z===null?jt="null":ut(z)?jt="array":z!==void 0&&z.$$typeof===e?(jt="<"+(Ee(z.type)||"Unknown")+" />",ft=" Did you accidentally export a JSX literal instead of a component?"):jt=typeof z,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",jt,ft)}var $t=Wn(z,de,Te,Ct,Ot);if($t==null)return $t;if(pt){var jn=de.children;if(jn!==void 0)if(Ke)if(ut(jn)){for(var ii=0;ii<jn.length;ii++)nr(jn[ii],z);Object.freeze&&Object.freeze(jn)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else nr(jn,z)}return z===i?Wl($t):$l($t),$t}}function Pc(z,de,Te){return ns(z,de,Te,!0)}function Dc(z,de,Te){return ns(z,de,Te,!1)}var ql=Dc,Yl=Pc;Zu.Fragment=i,Zu.jsx=ql,Zu.jsxs=Yl}()),Zu}var Ju={};/**
20
20
  * @license React
21
21
  * react-jsx-runtime.production.min.js
22
22
  *
@@ -24,50 +24,50 @@ Check the top-level render call using <`+Te+">.")}return fe}}function ks(z,fe){{
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var xy;function eC(){if(xy)return Ju;xy=1;var t=R,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(p,g,S){var m,x={},T=null,_=null;S!==void 0&&(T=""+S),g.key!==void 0&&(T=""+g.key),g.ref!==void 0&&(_=g.ref);for(m in g)i.call(g,m)&&!u.hasOwnProperty(m)&&(x[m]=g[m]);if(p&&p.defaultProps)for(m in g=p.defaultProps,g)x[m]===void 0&&(x[m]=g[m]);return{$$typeof:e,type:p,key:T,ref:_,props:x,_owner:a.current}}return Ju.Fragment=n,Ju.jsx=f,Ju.jsxs=f,Ju}process.env.NODE_ENV==="production"?Mp.exports=eC():Mp.exports=Jw();var oe=Mp.exports,Op={exports:{}},Vf={exports:{}};/*
27
+ */var xy;function rC(){if(xy)return Ju;xy=1;var t=T,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(p,g,S){var m,x={},R=null,_=null;S!==void 0&&(R=""+S),g.key!==void 0&&(R=""+g.key),g.ref!==void 0&&(_=g.ref);for(m in g)i.call(g,m)&&!u.hasOwnProperty(m)&&(x[m]=g[m]);if(p&&p.defaultProps)for(m in g=p.defaultProps,g)x[m]===void 0&&(x[m]=g[m]);return{$$typeof:e,type:p,key:R,ref:_,props:x,_owner:a.current}}return Ju.Fragment=n,Ju.jsx=f,Ju.jsxs=f,Ju}process.env.NODE_ENV==="production"?Mp.exports=rC():Mp.exports=iC();var oe=Mp.exports,Op={exports:{}},Vf={exports:{}};/*
28
28
  object-assign
29
29
  (c) Sindre Sorhus
30
30
  @license MIT
31
- */var _p,wy;function Cy(){if(wy)return _p;wy=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function a(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var f={},p=0;p<10;p++)f["_"+String.fromCharCode(p)]=p;var g=Object.getOwnPropertyNames(f).map(function(m){return f[m]});if(g.join("")!=="0123456789")return!1;var S={};return"abcdefghijklmnopqrst".split("").forEach(function(m){S[m]=m}),Object.keys(Object.assign({},S)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _p=a()?Object.assign:function(u,f){for(var p,g=i(u),S,m=1;m<arguments.length;m++){p=Object(arguments[m]);for(var x in p)e.call(p,x)&&(g[x]=p[x]);if(t){S=t(p);for(var T=0;T<S.length;T++)n.call(p,S[T])&&(g[S[T]]=p[S[T]])}}return g},_p}var $f={exports:{}},Lp={};/** @license React v0.20.2
31
+ */var _p,wy;function Cy(){if(wy)return _p;wy=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function a(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var f={},p=0;p<10;p++)f["_"+String.fromCharCode(p)]=p;var g=Object.getOwnPropertyNames(f).map(function(m){return f[m]});if(g.join("")!=="0123456789")return!1;var S={};return"abcdefghijklmnopqrst".split("").forEach(function(m){S[m]=m}),Object.keys(Object.assign({},S)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _p=a()?Object.assign:function(u,f){for(var p,g=i(u),S,m=1;m<arguments.length;m++){p=Object(arguments[m]);for(var x in p)e.call(p,x)&&(g[x]=p[x]);if(t){S=t(p);for(var R=0;R<S.length;R++)n.call(p,S[R])&&(g[S[R]]=p[S[R]])}}return g},_p}var $f={exports:{}},Lp={};/** @license React v0.20.2
32
32
  * scheduler.development.js
33
33
  *
34
34
  * Copyright (c) Facebook, Inc. and its affiliates.
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var Ty;function tC(){return Ty||(Ty=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=!1,n=!1,i,a,u,f,p=typeof performance=="object"&&typeof performance.now=="function";if(p){var g=performance;t.unstable_now=function(){return g.now()}}else{var S=Date,m=S.now();t.unstable_now=function(){return S.now()-m}}if(typeof window>"u"||typeof MessageChannel!="function"){var x=null,T=null,_=function(){if(x!==null)try{var Re=t.unstable_now(),De=!0;x(De,Re),x=null}catch(at){throw setTimeout(_,0),at}};i=function(Re){x!==null?setTimeout(i,0,Re):(x=Re,setTimeout(_,0))},a=function(Re,De){T=setTimeout(Re,De)},u=function(){clearTimeout(T)},t.unstable_shouldYield=function(){return!1},f=t.unstable_forceFrameRate=function(){}}else{var M=window.setTimeout,k=window.clearTimeout;if(typeof console<"u"){var L=window.requestAnimationFrame,P=window.cancelAnimationFrame;typeof L!="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 P!="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 O=!1,j=null,q=-1,ee=5,H=0;t.unstable_shouldYield=function(){return t.unstable_now()>=H},f=function(){},t.unstable_forceFrameRate=function(Re){if(Re<0||Re>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}Re>0?ee=Math.floor(1e3/Re):ee=5};var Z=function(){if(j!==null){var Re=t.unstable_now();H=Re+ee;var De=!0;try{var at=j(De,Re);at?W.postMessage(null):(O=!1,j=null)}catch(Dt){throw W.postMessage(null),Dt}}else O=!1},ie=new MessageChannel,W=ie.port2;ie.port1.onmessage=Z,i=function(Re){j=Re,O||(O=!0,W.postMessage(null))},a=function(Re,De){q=M(function(){Re(t.unstable_now())},De)},u=function(){k(q),q=-1}}function re(Re,De){var at=Re.length;Re.push(De),Ee(Re,De,at)}function ge(Re){var De=Re[0];return De===void 0?null:De}function be(Re){var De=Re[0];if(De!==void 0){var at=Re.pop();return at!==De&&(Re[0]=at,Ue(Re,at,0)),De}else return null}function Ee(Re,De,at){for(var Dt=at;;){var rt=Dt-1>>>1,ln=Re[rt];if(ln!==void 0&&je(ln,De)>0)Re[rt]=De,Re[Dt]=ln,Dt=rt;else return}}function Ue(Re,De,at){for(var Dt=at,rt=Re.length;Dt<rt;){var ln=(Dt+1)*2-1,en=Re[ln],Wn=ln+1,sn=Re[Wn];if(en!==void 0&&je(en,De)<0)sn!==void 0&&je(sn,en)<0?(Re[Dt]=sn,Re[Wn]=De,Dt=Wn):(Re[Dt]=en,Re[ln]=De,Dt=ln);else if(sn!==void 0&&je(sn,De)<0)Re[Dt]=sn,Re[Wn]=De,Dt=Wn;else return}}function je(Re,De){var at=Re.sortIndex-De.sortIndex;return at!==0?at:Re.id-De.id}var Xe=1,ce=2,me=3,tt=4,mt=5;function he(Re,De){}var Fe=1073741823,$e=-1,ht=250,gt=5e3,gn=1e4,Xt=Fe,yt=[],Be=[],nt=1,ot=null,lt=me,Et=!1,wt=!1,yn=!1;function Kt(Re){for(var De=ge(Be);De!==null;){if(De.callback===null)be(Be);else if(De.startTime<=Re)be(Be),De.sortIndex=De.expirationTime,re(yt,De);else return;De=ge(Be)}}function tr(Re){if(yn=!1,Kt(Re),!wt)if(ge(yt)!==null)wt=!0,i(U);else{var De=ge(Be);De!==null&&a(tr,De.startTime-Re)}}function U(Re,De){wt=!1,yn&&(yn=!1,u()),Et=!0;var at=lt;try{var Dt;if(!n)return I(Re,De)}finally{ot=null,lt=at,Et=!1}}function I(Re,De){var at=De;for(Kt(at),ot=ge(yt);ot!==null&&!e&&!(ot.expirationTime>at&&(!Re||t.unstable_shouldYield()));){var Dt=ot.callback;if(typeof Dt=="function"){ot.callback=null,lt=ot.priorityLevel;var rt=ot.expirationTime<=at,ln=Dt(rt);at=t.unstable_now(),typeof ln=="function"?ot.callback=ln:ot===ge(yt)&&be(yt),Kt(at)}else be(yt);ot=ge(yt)}if(ot!==null)return!0;var en=ge(Be);return en!==null&&a(tr,en.startTime-at),!1}function G(Re,De){switch(Re){case Xe:case ce:case me:case tt:case mt:break;default:Re=me}var at=lt;lt=Re;try{return De()}finally{lt=at}}function Se(Re){var De;switch(lt){case Xe:case ce:case me:De=me;break;default:De=lt;break}var at=lt;lt=De;try{return Re()}finally{lt=at}}function ut(Re){var De=lt;return function(){var at=lt;lt=De;try{return Re.apply(this,arguments)}finally{lt=at}}}function We(Re,De,at){var Dt=t.unstable_now(),rt;if(typeof at=="object"&&at!==null){var ln=at.delay;typeof ln=="number"&&ln>0?rt=Dt+ln:rt=Dt}else rt=Dt;var en;switch(Re){case Xe:en=$e;break;case ce:en=ht;break;case mt:en=Xt;break;case tt:en=gn;break;case me:default:en=gt;break}var Wn=rt+en,sn={id:nt++,callback:De,priorityLevel:Re,startTime:rt,expirationTime:Wn,sortIndex:-1};return rt>Dt?(sn.sortIndex=rt,re(Be,sn),ge(yt)===null&&sn===ge(Be)&&(yn?u():yn=!0,a(tr,rt-Dt))):(sn.sortIndex=Wn,re(yt,sn),!wt&&!Et&&(wt=!0,i(U))),sn}function Sn(){}function ji(){!wt&&!Et&&(wt=!0,i(U))}function xe(){return ge(yt)}function ct(Re){Re.callback=null}function pi(){return lt}var Pt=f,it=null;t.unstable_IdlePriority=mt,t.unstable_ImmediatePriority=Xe,t.unstable_LowPriority=tt,t.unstable_NormalPriority=me,t.unstable_Profiling=it,t.unstable_UserBlockingPriority=ce,t.unstable_cancelCallback=ct,t.unstable_continueExecution=ji,t.unstable_getCurrentPriorityLevel=pi,t.unstable_getFirstCallbackNode=xe,t.unstable_next=Se,t.unstable_pauseExecution=Sn,t.unstable_requestPaint=Pt,t.unstable_runWithPriority=G,t.unstable_scheduleCallback=We,t.unstable_wrapCallback=ut}()}(Lp)),Lp}var Pp={};/** @license React v0.20.2
38
+ */var Ty;function sC(){return Ty||(Ty=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=!1,n=!1,i,a,u,f,p=typeof performance=="object"&&typeof performance.now=="function";if(p){var g=performance;t.unstable_now=function(){return g.now()}}else{var S=Date,m=S.now();t.unstable_now=function(){return S.now()-m}}if(typeof window>"u"||typeof MessageChannel!="function"){var x=null,R=null,_=function(){if(x!==null)try{var Re=t.unstable_now(),De=!0;x(De,Re),x=null}catch(at){throw setTimeout(_,0),at}};i=function(Re){x!==null?setTimeout(i,0,Re):(x=Re,setTimeout(_,0))},a=function(Re,De){R=setTimeout(Re,De)},u=function(){clearTimeout(R)},t.unstable_shouldYield=function(){return!1},f=t.unstable_forceFrameRate=function(){}}else{var M=window.setTimeout,k=window.clearTimeout;if(typeof console<"u"){var L=window.requestAnimationFrame,P=window.cancelAnimationFrame;typeof L!="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 P!="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 O=!1,j=null,q=-1,ee=5,H=0;t.unstable_shouldYield=function(){return t.unstable_now()>=H},f=function(){},t.unstable_forceFrameRate=function(Re){if(Re<0||Re>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}Re>0?ee=Math.floor(1e3/Re):ee=5};var Z=function(){if(j!==null){var Re=t.unstable_now();H=Re+ee;var De=!0;try{var at=j(De,Re);at?W.postMessage(null):(O=!1,j=null)}catch(Dt){throw W.postMessage(null),Dt}}else O=!1},ie=new MessageChannel,W=ie.port2;ie.port1.onmessage=Z,i=function(Re){j=Re,O||(O=!0,W.postMessage(null))},a=function(Re,De){q=M(function(){Re(t.unstable_now())},De)},u=function(){k(q),q=-1}}function re(Re,De){var at=Re.length;Re.push(De),Ee(Re,De,at)}function ge(Re){var De=Re[0];return De===void 0?null:De}function be(Re){var De=Re[0];if(De!==void 0){var at=Re.pop();return at!==De&&(Re[0]=at,Ue(Re,at,0)),De}else return null}function Ee(Re,De,at){for(var Dt=at;;){var rt=Dt-1>>>1,ln=Re[rt];if(ln!==void 0&&je(ln,De)>0)Re[rt]=De,Re[Dt]=ln,Dt=rt;else return}}function Ue(Re,De,at){for(var Dt=at,rt=Re.length;Dt<rt;){var ln=(Dt+1)*2-1,en=Re[ln],Wn=ln+1,sn=Re[Wn];if(en!==void 0&&je(en,De)<0)sn!==void 0&&je(sn,en)<0?(Re[Dt]=sn,Re[Wn]=De,Dt=Wn):(Re[Dt]=en,Re[ln]=De,Dt=ln);else if(sn!==void 0&&je(sn,De)<0)Re[Dt]=sn,Re[Wn]=De,Dt=Wn;else return}}function je(Re,De){var at=Re.sortIndex-De.sortIndex;return at!==0?at:Re.id-De.id}var Xe=1,ce=2,me=3,tt=4,mt=5;function he(Re,De){}var Fe=1073741823,$e=-1,ht=250,gt=5e3,gn=1e4,Xt=Fe,yt=[],Be=[],nt=1,ot=null,lt=me,Et=!1,wt=!1,yn=!1;function Kt(Re){for(var De=ge(Be);De!==null;){if(De.callback===null)be(Be);else if(De.startTime<=Re)be(Be),De.sortIndex=De.expirationTime,re(yt,De);else return;De=ge(Be)}}function tr(Re){if(yn=!1,Kt(Re),!wt)if(ge(yt)!==null)wt=!0,i(U);else{var De=ge(Be);De!==null&&a(tr,De.startTime-Re)}}function U(Re,De){wt=!1,yn&&(yn=!1,u()),Et=!0;var at=lt;try{var Dt;if(!n)return I(Re,De)}finally{ot=null,lt=at,Et=!1}}function I(Re,De){var at=De;for(Kt(at),ot=ge(yt);ot!==null&&!e&&!(ot.expirationTime>at&&(!Re||t.unstable_shouldYield()));){var Dt=ot.callback;if(typeof Dt=="function"){ot.callback=null,lt=ot.priorityLevel;var rt=ot.expirationTime<=at,ln=Dt(rt);at=t.unstable_now(),typeof ln=="function"?ot.callback=ln:ot===ge(yt)&&be(yt),Kt(at)}else be(yt);ot=ge(yt)}if(ot!==null)return!0;var en=ge(Be);return en!==null&&a(tr,en.startTime-at),!1}function G(Re,De){switch(Re){case Xe:case ce:case me:case tt:case mt:break;default:Re=me}var at=lt;lt=Re;try{return De()}finally{lt=at}}function Se(Re){var De;switch(lt){case Xe:case ce:case me:De=me;break;default:De=lt;break}var at=lt;lt=De;try{return Re()}finally{lt=at}}function ut(Re){var De=lt;return function(){var at=lt;lt=De;try{return Re.apply(this,arguments)}finally{lt=at}}}function We(Re,De,at){var Dt=t.unstable_now(),rt;if(typeof at=="object"&&at!==null){var ln=at.delay;typeof ln=="number"&&ln>0?rt=Dt+ln:rt=Dt}else rt=Dt;var en;switch(Re){case Xe:en=$e;break;case ce:en=ht;break;case mt:en=Xt;break;case tt:en=gn;break;case me:default:en=gt;break}var Wn=rt+en,sn={id:nt++,callback:De,priorityLevel:Re,startTime:rt,expirationTime:Wn,sortIndex:-1};return rt>Dt?(sn.sortIndex=rt,re(Be,sn),ge(yt)===null&&sn===ge(Be)&&(yn?u():yn=!0,a(tr,rt-Dt))):(sn.sortIndex=Wn,re(yt,sn),!wt&&!Et&&(wt=!0,i(U))),sn}function Sn(){}function ji(){!wt&&!Et&&(wt=!0,i(U))}function xe(){return ge(yt)}function ct(Re){Re.callback=null}function pi(){return lt}var Pt=f,it=null;t.unstable_IdlePriority=mt,t.unstable_ImmediatePriority=Xe,t.unstable_LowPriority=tt,t.unstable_NormalPriority=me,t.unstable_Profiling=it,t.unstable_UserBlockingPriority=ce,t.unstable_cancelCallback=ct,t.unstable_continueExecution=ji,t.unstable_getCurrentPriorityLevel=pi,t.unstable_getFirstCallbackNode=xe,t.unstable_next=Se,t.unstable_pauseExecution=Sn,t.unstable_requestPaint=Pt,t.unstable_runWithPriority=G,t.unstable_scheduleCallback=We,t.unstable_wrapCallback=ut}()}(Lp)),Lp}var Pp={};/** @license React v0.20.2
39
39
  * scheduler.production.min.js
40
40
  *
41
41
  * Copyright (c) Facebook, Inc. and its affiliates.
42
42
  *
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
- */var Ry;function nC(){return Ry||(Ry=1,function(t){var e,n,i,a;if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();t.unstable_now=function(){return f.now()-p}}if(typeof window>"u"||typeof MessageChannel!="function"){var g=null,S=null,m=function(){if(g!==null)try{var he=t.unstable_now();g(!0,he),g=null}catch(Fe){throw setTimeout(m,0),Fe}};e=function(he){g!==null?setTimeout(e,0,he):(g=he,setTimeout(m,0))},n=function(he,Fe){S=setTimeout(he,Fe)},i=function(){clearTimeout(S)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var x=window.setTimeout,T=window.clearTimeout;if(typeof console<"u"){var _=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 _!="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 M=!1,k=null,L=-1,P=5,O=0;t.unstable_shouldYield=function(){return t.unstable_now()>=O},a=function(){},t.unstable_forceFrameRate=function(he){0>he||125<he?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<he?Math.floor(1e3/he):5};var j=new MessageChannel,q=j.port2;j.port1.onmessage=function(){if(k!==null){var he=t.unstable_now();O=he+P;try{k(!0,he)?q.postMessage(null):(M=!1,k=null)}catch(Fe){throw q.postMessage(null),Fe}}else M=!1},e=function(he){k=he,M||(M=!0,q.postMessage(null))},n=function(he,Fe){L=x(function(){he(t.unstable_now())},Fe)},i=function(){T(L),L=-1}}function ee(he,Fe){var $e=he.length;he.push(Fe);e:for(;;){var ht=$e-1>>>1,gt=he[ht];if(gt!==void 0&&0<ie(gt,Fe))he[ht]=Fe,he[$e]=gt,$e=ht;else break e}}function H(he){return he=he[0],he===void 0?null:he}function Z(he){var Fe=he[0];if(Fe!==void 0){var $e=he.pop();if($e!==Fe){he[0]=$e;e:for(var ht=0,gt=he.length;ht<gt;){var gn=2*(ht+1)-1,Xt=he[gn],yt=gn+1,Be=he[yt];if(Xt!==void 0&&0>ie(Xt,$e))Be!==void 0&&0>ie(Be,Xt)?(he[ht]=Be,he[yt]=$e,ht=yt):(he[ht]=Xt,he[gn]=$e,ht=gn);else if(Be!==void 0&&0>ie(Be,$e))he[ht]=Be,he[yt]=$e,ht=yt;else break e}}return Fe}return null}function ie(he,Fe){var $e=he.sortIndex-Fe.sortIndex;return $e!==0?$e:he.id-Fe.id}var W=[],re=[],ge=1,be=null,Ee=3,Ue=!1,je=!1,Xe=!1;function ce(he){for(var Fe=H(re);Fe!==null;){if(Fe.callback===null)Z(re);else if(Fe.startTime<=he)Z(re),Fe.sortIndex=Fe.expirationTime,ee(W,Fe);else break;Fe=H(re)}}function me(he){if(Xe=!1,ce(he),!je)if(H(W)!==null)je=!0,e(tt);else{var Fe=H(re);Fe!==null&&n(me,Fe.startTime-he)}}function tt(he,Fe){je=!1,Xe&&(Xe=!1,i()),Ue=!0;var $e=Ee;try{for(ce(Fe),be=H(W);be!==null&&(!(be.expirationTime>Fe)||he&&!t.unstable_shouldYield());){var ht=be.callback;if(typeof ht=="function"){be.callback=null,Ee=be.priorityLevel;var gt=ht(be.expirationTime<=Fe);Fe=t.unstable_now(),typeof gt=="function"?be.callback=gt:be===H(W)&&Z(W),ce(Fe)}else Z(W);be=H(W)}if(be!==null)var gn=!0;else{var Xt=H(re);Xt!==null&&n(me,Xt.startTime-Fe),gn=!1}return gn}finally{be=null,Ee=$e,Ue=!1}}var mt=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(he){he.callback=null},t.unstable_continueExecution=function(){je||Ue||(je=!0,e(tt))},t.unstable_getCurrentPriorityLevel=function(){return Ee},t.unstable_getFirstCallbackNode=function(){return H(W)},t.unstable_next=function(he){switch(Ee){case 1:case 2:case 3:var Fe=3;break;default:Fe=Ee}var $e=Ee;Ee=Fe;try{return he()}finally{Ee=$e}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=mt,t.unstable_runWithPriority=function(he,Fe){switch(he){case 1:case 2:case 3:case 4:case 5:break;default:he=3}var $e=Ee;Ee=he;try{return Fe()}finally{Ee=$e}},t.unstable_scheduleCallback=function(he,Fe,$e){var ht=t.unstable_now();switch(typeof $e=="object"&&$e!==null?($e=$e.delay,$e=typeof $e=="number"&&0<$e?ht+$e:ht):$e=ht,he){case 1:var gt=-1;break;case 2:gt=250;break;case 5:gt=1073741823;break;case 4:gt=1e4;break;default:gt=5e3}return gt=$e+gt,he={id:ge++,callback:Fe,priorityLevel:he,startTime:$e,expirationTime:gt,sortIndex:-1},$e>ht?(he.sortIndex=$e,ee(re,he),H(W)===null&&he===H(re)&&(Xe?i():Xe=!0,n(me,$e-ht))):(he.sortIndex=gt,ee(W,he),je||Ue||(je=!0,e(tt))),he},t.unstable_wrapCallback=function(he){var Fe=Ee;return function(){var $e=Ee;Ee=Fe;try{return he.apply(this,arguments)}finally{Ee=$e}}}}(Pp)),Pp}var Ay;function My(){return Ay||(Ay=1,process.env.NODE_ENV==="production"?$f.exports=nC():$f.exports=tC()),$f.exports}var Wf={exports:{}},Dp={};/** @license React v0.20.2
45
+ */var Ry;function aC(){return Ry||(Ry=1,function(t){var e,n,i,a;if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();t.unstable_now=function(){return f.now()-p}}if(typeof window>"u"||typeof MessageChannel!="function"){var g=null,S=null,m=function(){if(g!==null)try{var he=t.unstable_now();g(!0,he),g=null}catch(Fe){throw setTimeout(m,0),Fe}};e=function(he){g!==null?setTimeout(e,0,he):(g=he,setTimeout(m,0))},n=function(he,Fe){S=setTimeout(he,Fe)},i=function(){clearTimeout(S)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var x=window.setTimeout,R=window.clearTimeout;if(typeof console<"u"){var _=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 _!="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 M=!1,k=null,L=-1,P=5,O=0;t.unstable_shouldYield=function(){return t.unstable_now()>=O},a=function(){},t.unstable_forceFrameRate=function(he){0>he||125<he?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<he?Math.floor(1e3/he):5};var j=new MessageChannel,q=j.port2;j.port1.onmessage=function(){if(k!==null){var he=t.unstable_now();O=he+P;try{k(!0,he)?q.postMessage(null):(M=!1,k=null)}catch(Fe){throw q.postMessage(null),Fe}}else M=!1},e=function(he){k=he,M||(M=!0,q.postMessage(null))},n=function(he,Fe){L=x(function(){he(t.unstable_now())},Fe)},i=function(){R(L),L=-1}}function ee(he,Fe){var $e=he.length;he.push(Fe);e:for(;;){var ht=$e-1>>>1,gt=he[ht];if(gt!==void 0&&0<ie(gt,Fe))he[ht]=Fe,he[$e]=gt,$e=ht;else break e}}function H(he){return he=he[0],he===void 0?null:he}function Z(he){var Fe=he[0];if(Fe!==void 0){var $e=he.pop();if($e!==Fe){he[0]=$e;e:for(var ht=0,gt=he.length;ht<gt;){var gn=2*(ht+1)-1,Xt=he[gn],yt=gn+1,Be=he[yt];if(Xt!==void 0&&0>ie(Xt,$e))Be!==void 0&&0>ie(Be,Xt)?(he[ht]=Be,he[yt]=$e,ht=yt):(he[ht]=Xt,he[gn]=$e,ht=gn);else if(Be!==void 0&&0>ie(Be,$e))he[ht]=Be,he[yt]=$e,ht=yt;else break e}}return Fe}return null}function ie(he,Fe){var $e=he.sortIndex-Fe.sortIndex;return $e!==0?$e:he.id-Fe.id}var W=[],re=[],ge=1,be=null,Ee=3,Ue=!1,je=!1,Xe=!1;function ce(he){for(var Fe=H(re);Fe!==null;){if(Fe.callback===null)Z(re);else if(Fe.startTime<=he)Z(re),Fe.sortIndex=Fe.expirationTime,ee(W,Fe);else break;Fe=H(re)}}function me(he){if(Xe=!1,ce(he),!je)if(H(W)!==null)je=!0,e(tt);else{var Fe=H(re);Fe!==null&&n(me,Fe.startTime-he)}}function tt(he,Fe){je=!1,Xe&&(Xe=!1,i()),Ue=!0;var $e=Ee;try{for(ce(Fe),be=H(W);be!==null&&(!(be.expirationTime>Fe)||he&&!t.unstable_shouldYield());){var ht=be.callback;if(typeof ht=="function"){be.callback=null,Ee=be.priorityLevel;var gt=ht(be.expirationTime<=Fe);Fe=t.unstable_now(),typeof gt=="function"?be.callback=gt:be===H(W)&&Z(W),ce(Fe)}else Z(W);be=H(W)}if(be!==null)var gn=!0;else{var Xt=H(re);Xt!==null&&n(me,Xt.startTime-Fe),gn=!1}return gn}finally{be=null,Ee=$e,Ue=!1}}var mt=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(he){he.callback=null},t.unstable_continueExecution=function(){je||Ue||(je=!0,e(tt))},t.unstable_getCurrentPriorityLevel=function(){return Ee},t.unstable_getFirstCallbackNode=function(){return H(W)},t.unstable_next=function(he){switch(Ee){case 1:case 2:case 3:var Fe=3;break;default:Fe=Ee}var $e=Ee;Ee=Fe;try{return he()}finally{Ee=$e}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=mt,t.unstable_runWithPriority=function(he,Fe){switch(he){case 1:case 2:case 3:case 4:case 5:break;default:he=3}var $e=Ee;Ee=he;try{return Fe()}finally{Ee=$e}},t.unstable_scheduleCallback=function(he,Fe,$e){var ht=t.unstable_now();switch(typeof $e=="object"&&$e!==null?($e=$e.delay,$e=typeof $e=="number"&&0<$e?ht+$e:ht):$e=ht,he){case 1:var gt=-1;break;case 2:gt=250;break;case 5:gt=1073741823;break;case 4:gt=1e4;break;default:gt=5e3}return gt=$e+gt,he={id:ge++,callback:Fe,priorityLevel:he,startTime:$e,expirationTime:gt,sortIndex:-1},$e>ht?(he.sortIndex=$e,ee(re,he),H(W)===null&&he===H(re)&&(Xe?i():Xe=!0,n(me,$e-ht))):(he.sortIndex=gt,ee(W,he),je||Ue||(je=!0,e(tt))),he},t.unstable_wrapCallback=function(he){var Fe=Ee;return function(){var $e=Ee;Ee=Fe;try{return he.apply(this,arguments)}finally{Ee=$e}}}}(Pp)),Pp}var Ay;function My(){return Ay||(Ay=1,process.env.NODE_ENV==="production"?$f.exports=aC():$f.exports=sC()),$f.exports}var Wf={exports:{}},Dp={};/** @license React v0.20.2
46
46
  * scheduler-tracing.development.js
47
47
  *
48
48
  * Copyright (c) Facebook, Inc. and its affiliates.
49
49
  *
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
- */var Oy;function iC(){return Oy||(Oy=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=0,n=0,i=0;t.__interactionsRef=null,t.__subscriberRef=null,t.__interactionsRef={current:new Set},t.__subscriberRef={current:null};function a(O){var j=t.__interactionsRef.current;t.__interactionsRef.current=new Set;try{return O()}finally{t.__interactionsRef.current=j}}function u(){return t.__interactionsRef.current}function f(){return++i}function p(O,j,q){var ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,H={__count:1,id:n++,name:O,timestamp:j},Z=t.__interactionsRef.current,ie=new Set(Z);ie.add(H),t.__interactionsRef.current=ie;var W=t.__subscriberRef.current,re;try{W!==null&&W.onInteractionTraced(H)}finally{try{W!==null&&W.onWorkStarted(ie,ee)}finally{try{re=q()}finally{t.__interactionsRef.current=Z;try{W!==null&&W.onWorkStopped(ie,ee)}finally{H.__count--,W!==null&&H.__count===0&&W.onInteractionScheduledWorkCompleted(H)}}}}return re}function g(O){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,q=t.__interactionsRef.current,ee=t.__subscriberRef.current;ee!==null&&ee.onWorkScheduled(q,j),q.forEach(function(ie){ie.__count++});var H=!1;function Z(){var ie=t.__interactionsRef.current;t.__interactionsRef.current=q,ee=t.__subscriberRef.current;try{var W;try{ee!==null&&ee.onWorkStarted(q,j)}finally{try{W=O.apply(void 0,arguments)}finally{t.__interactionsRef.current=ie,ee!==null&&ee.onWorkStopped(q,j)}}return W}finally{H||(H=!0,q.forEach(function(re){re.__count--,ee!==null&&re.__count===0&&ee.onInteractionScheduledWorkCompleted(re)}))}}return Z.cancel=function(){ee=t.__subscriberRef.current;try{ee!==null&&ee.onWorkCanceled(q,j)}finally{q.forEach(function(W){W.__count--,ee&&W.__count===0&&ee.onInteractionScheduledWorkCompleted(W)})}},Z}var S=null;S=new Set;function m(O){S.add(O),S.size===1&&(t.__subscriberRef.current={onInteractionScheduledWorkCompleted:_,onInteractionTraced:T,onWorkCanceled:P,onWorkScheduled:M,onWorkStarted:k,onWorkStopped:L})}function x(O){S.delete(O),S.size===0&&(t.__subscriberRef.current=null)}function T(O){var j=!1,q=null;if(S.forEach(function(ee){try{ee.onInteractionTraced(O)}catch(H){j||(j=!0,q=H)}}),j)throw q}function _(O){var j=!1,q=null;if(S.forEach(function(ee){try{ee.onInteractionScheduledWorkCompleted(O)}catch(H){j||(j=!0,q=H)}}),j)throw q}function M(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkScheduled(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function k(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkStarted(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function L(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkStopped(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function P(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkCanceled(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}t.unstable_clear=a,t.unstable_getCurrent=u,t.unstable_getThreadID=f,t.unstable_subscribe=m,t.unstable_trace=p,t.unstable_unsubscribe=x,t.unstable_wrap=g}()}(Dp)),Dp}var Rr={};/** @license React v0.20.2
52
+ */var Oy;function oC(){return Oy||(Oy=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=0,n=0,i=0;t.__interactionsRef=null,t.__subscriberRef=null,t.__interactionsRef={current:new Set},t.__subscriberRef={current:null};function a(O){var j=t.__interactionsRef.current;t.__interactionsRef.current=new Set;try{return O()}finally{t.__interactionsRef.current=j}}function u(){return t.__interactionsRef.current}function f(){return++i}function p(O,j,q){var ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,H={__count:1,id:n++,name:O,timestamp:j},Z=t.__interactionsRef.current,ie=new Set(Z);ie.add(H),t.__interactionsRef.current=ie;var W=t.__subscriberRef.current,re;try{W!==null&&W.onInteractionTraced(H)}finally{try{W!==null&&W.onWorkStarted(ie,ee)}finally{try{re=q()}finally{t.__interactionsRef.current=Z;try{W!==null&&W.onWorkStopped(ie,ee)}finally{H.__count--,W!==null&&H.__count===0&&W.onInteractionScheduledWorkCompleted(H)}}}}return re}function g(O){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,q=t.__interactionsRef.current,ee=t.__subscriberRef.current;ee!==null&&ee.onWorkScheduled(q,j),q.forEach(function(ie){ie.__count++});var H=!1;function Z(){var ie=t.__interactionsRef.current;t.__interactionsRef.current=q,ee=t.__subscriberRef.current;try{var W;try{ee!==null&&ee.onWorkStarted(q,j)}finally{try{W=O.apply(void 0,arguments)}finally{t.__interactionsRef.current=ie,ee!==null&&ee.onWorkStopped(q,j)}}return W}finally{H||(H=!0,q.forEach(function(re){re.__count--,ee!==null&&re.__count===0&&ee.onInteractionScheduledWorkCompleted(re)}))}}return Z.cancel=function(){ee=t.__subscriberRef.current;try{ee!==null&&ee.onWorkCanceled(q,j)}finally{q.forEach(function(W){W.__count--,ee&&W.__count===0&&ee.onInteractionScheduledWorkCompleted(W)})}},Z}var S=null;S=new Set;function m(O){S.add(O),S.size===1&&(t.__subscriberRef.current={onInteractionScheduledWorkCompleted:_,onInteractionTraced:R,onWorkCanceled:P,onWorkScheduled:M,onWorkStarted:k,onWorkStopped:L})}function x(O){S.delete(O),S.size===0&&(t.__subscriberRef.current=null)}function R(O){var j=!1,q=null;if(S.forEach(function(ee){try{ee.onInteractionTraced(O)}catch(H){j||(j=!0,q=H)}}),j)throw q}function _(O){var j=!1,q=null;if(S.forEach(function(ee){try{ee.onInteractionScheduledWorkCompleted(O)}catch(H){j||(j=!0,q=H)}}),j)throw q}function M(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkScheduled(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function k(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkStarted(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function L(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkStopped(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}function P(O,j){var q=!1,ee=null;if(S.forEach(function(H){try{H.onWorkCanceled(O,j)}catch(Z){q||(q=!0,ee=Z)}}),q)throw ee}t.unstable_clear=a,t.unstable_getCurrent=u,t.unstable_getThreadID=f,t.unstable_subscribe=m,t.unstable_trace=p,t.unstable_unsubscribe=x,t.unstable_wrap=g}()}(Dp)),Dp}var Rr={};/** @license React v0.20.2
53
53
  * scheduler-tracing.production.min.js
54
54
  *
55
55
  * Copyright (c) Facebook, Inc. and its affiliates.
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var _y;function rC(){if(_y)return Rr;_y=1;var t=0;return Rr.__interactionsRef=null,Rr.__subscriberRef=null,Rr.unstable_clear=function(e){return e()},Rr.unstable_getCurrent=function(){return null},Rr.unstable_getThreadID=function(){return++t},Rr.unstable_subscribe=function(){},Rr.unstable_trace=function(e,n,i){return i()},Rr.unstable_unsubscribe=function(){},Rr.unstable_wrap=function(e){return e},Rr}var Ly;function sC(){return Ly||(Ly=1,process.env.NODE_ENV==="production"?Wf.exports=rC():Wf.exports=iC()),Wf.exports}/** @license React v0.26.2
59
+ */var _y;function lC(){if(_y)return Rr;_y=1;var t=0;return Rr.__interactionsRef=null,Rr.__subscriberRef=null,Rr.unstable_clear=function(e){return e()},Rr.unstable_getCurrent=function(){return null},Rr.unstable_getThreadID=function(){return++t},Rr.unstable_subscribe=function(){},Rr.unstable_trace=function(e,n,i){return i()},Rr.unstable_unsubscribe=function(){},Rr.unstable_wrap=function(e){return e},Rr}var Ly;function uC(){return Ly||(Ly=1,process.env.NODE_ENV==="production"?Wf.exports=lC():Wf.exports=oC()),Wf.exports}/** @license React v0.26.2
60
60
  * react-reconciler.development.js
61
61
  *
62
62
  * Copyright (c) Facebook, Inc. and its affiliates.
63
63
  *
64
64
  * This source code is licensed under the MIT license found in the
65
65
  * LICENSE file in the root directory of this source tree.
66
- */Vf.exports;var Py;function aC(){return Py||(Py=1,function(t){process.env.NODE_ENV!=="production"&&(t.exports=function(n){var i={},a=R,u=Cy(),f=My(),p=sC(),g=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var s=arguments.length,c=new Array(s>1?s-1:0),h=1;h<s;h++)c[h-1]=arguments[h];x("warn",r,c)}}function m(r){{for(var s=arguments.length,c=new Array(s>1?s-1:0),h=1;h<s;h++)c[h-1]=arguments[h];x("error",r,c)}}function x(r,s,c){{var h=g.ReactDebugCurrentFrame,v=h.getStackAddendum();v!==""&&(s+="%s",c=c.concat([v]));var b=c.map(function(w){return""+w});b.unshift("Warning: "+s),Function.prototype.apply.call(console[r],console,b)}}var T=0,_=1,M=2,k=3,L=4,P=5,O=6,j=7,q=8,ee=9,H=10,Z=11,ie=12,W=13,re=14,ge=15,be=16,Ee=17,Ue=18,je=19,Xe=20,ce=21,me=22,tt=23,mt=24;function he(r){return r._reactInternals}function Fe(r,s){r._reactInternals=s}var $e=60103,ht=60106,gt=60107,gn=60108,Xt=60114,yt=60109,Be=60110,nt=60112,ot=60113,lt=60120,Et=60115,wt=60116,yn=60121,Kt=60119,tr=60129,U=60130,I=60131;if(typeof Symbol=="function"&&Symbol.for){var G=Symbol.for;$e=G("react.element"),ht=G("react.portal"),gt=G("react.fragment"),gn=G("react.strict_mode"),Xt=G("react.profiler"),yt=G("react.provider"),Be=G("react.context"),nt=G("react.forward_ref"),ot=G("react.suspense"),lt=G("react.suspense_list"),Et=G("react.memo"),wt=G("react.lazy"),yn=G("react.block"),G("react.server.block"),G("react.fundamental"),Kt=G("react.scope"),G("react.opaque.id"),tr=G("react.debug_trace_mode"),U=G("react.offscreen"),I=G("react.legacy_hidden")}var Se=typeof Symbol=="function"&&Symbol.iterator,ut="@@iterator";function We(r){if(r===null||typeof r!="object")return null;var s=Se&&r[Se]||r[ut];return typeof s=="function"?s:null}function Sn(r,s,c){var h=s.displayName||s.name||"";return r.displayName||(h!==""?c+"("+h+")":c)}function ji(r){return r.displayName||"Context"}function xe(r){if(r==null)return null;if(typeof r.tag=="number"&&m("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case gt:return"Fragment";case ht:return"Portal";case Xt:return"Profiler";case gn:return"StrictMode";case ot:return"Suspense";case lt:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Be:var s=r;return ji(s)+".Consumer";case yt:var c=r;return ji(c._context)+".Provider";case nt:return Sn(r,r.render,"ForwardRef");case Et:return xe(r.type);case yn:return xe(r._render);case wt:{var h=r,v=h._payload,b=h._init;try{return xe(b(v))}catch{return null}}}return null}var ct=0,pi=1,Pt=2,it=4,Re=6,De=8,at=16,Dt=32,rt=64,ln=128,en=256,Wn=512,sn=8192,Ri=1024,es=1028,po=932,vo=2047,ts=2048,Ai=4096,Ea=16384,mo=!0,ks=!1,nr=!1,$l=!1,Wl=g.ReactCurrentOwner;function ns(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{var h=s;do s=h,(s.flags&(Pt|Ri))!==ct&&(c=s.return),h=s.return;while(h)}return s.tag===k?c:null}function Pc(r){return ns(r)===r}function Dc(r){{var s=Wl.current;if(s!==null&&s.tag===_){var c=s,h=c.stateNode;h._warnedAboutRefsInRender||m("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",xe(c.type)||"A component"),h._warnedAboutRefsInRender=!0}}var v=he(r);return v?ns(v)===v:!1}function ql(r){if(ns(r)!==r)throw Error("Unable to find node on an unmounted component.")}function Yl(r){var s=r.alternate;if(!s){var c=ns(r);if(c===null)throw Error("Unable to find node on an unmounted component.");return c!==r?null:r}for(var h=r,v=s;;){var b=h.return;if(b===null)break;var w=b.alternate;if(w===null){var A=b.return;if(A!==null){h=v=A;continue}break}if(b.child===w.child){for(var D=b.child;D;){if(D===h)return ql(b),r;if(D===v)return ql(b),s;D=D.sibling}throw Error("Unable to find node on an unmounted component.")}if(h.return!==v.return)h=b,v=w;else{for(var F=!1,$=b.child;$;){if($===h){F=!0,h=b,v=w;break}if($===v){F=!0,v=b,h=w;break}$=$.sibling}if(!F){for($=w.child;$;){if($===h){F=!0,h=w,v=b;break}if($===v){F=!0,v=w,h=b;break}$=$.sibling}if(!F)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(h.alternate!==v)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(h.tag!==k)throw Error("Unable to find node on an unmounted component.");return h.stateNode.current===h?r:s}function z(r){var s=Yl(r);if(!s)return null;for(var c=s;;){if(c.tag===P||c.tag===O)return c;if(c.child){c.child.return=c,c=c.child;continue}if(c===s)return null;for(;!c.sibling;){if(!c.return||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function fe(r){var s=Yl(r);if(!s)return null;for(var c=s;;){if(c.tag===P||c.tag===O||ks)return c;if(c.child&&c.tag!==L){c.child.return=c,c=c.child;continue}if(c===s)return null;for(;!c.sibling;){if(!c.return||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function Te(r,s){for(var c=s,h=r.alternate;c!==null;){if(c===r||c===h)return!0;c=c.return}return!1}var Ke=n.getPublicInstance,Ct=n.getRootHostContext,Ot=n.getChildHostContext,pt=n.prepareForCommit,ft=n.resetAfterCommit,bn=n.createInstance,jt=n.appendInitialChild,$t=n.finalizeInitialChildren,jn=n.prepareUpdate,ii=n.shouldSetTextContent,Fi=n.createTextInstance,vt=n.scheduleTimeout,un=n.cancelTimeout,vr=n.noTimeout;n.now;var cn=n.isPrimaryRenderer,qn=n.warnsIfNotActing,Fn=n.supportsMutation,mr=n.supportsPersistence,tn=n.supportsHydration;n.getFundamentalComponentInstance,n.mountFundamentalComponent,n.shouldUpdateFundamentalComponent;var Ql=n.getInstanceFromNode;n.isOpaqueHydratingObject;var Zd=n.makeOpaqueHydratingObject;n.makeClientId;var Jd=n.makeClientIdInDEV,go=n.beforeActiveInstanceBlur,eh=n.afterActiveInstanceBlur,kc=n.preparePortalMount;n.preparePortalMount,n.getInstanceFromScope;var Bi=n.supportsTestSelectors,dm=n.findFiberRoot,Gl=n.getBoundingRect,Wt=n.getTextContent,ir=n.isHiddenSubtree,hm=n.matchAccessibilityRole,pm=n.setFocusIfFocusable,yo=n.setupIntersectionObserver,th=n.appendChild,Xl=n.appendChildToContainer,xa=n.commitTextUpdate,Ic=n.commitMount,Kl=n.commitUpdate,is=n.insertBefore,vm=n.insertInContainerBefore,mm=n.removeChild,gm=n.removeChildFromContainer,nh=n.resetTextContent,Nc=n.hideInstance,zc=n.hideTextInstance,ym=n.unhideInstance,ih=n.unhideTextInstance;n.updateFundamentalComponent,n.unmountFundamentalComponent;var So=n.clearContainer,Sm=n.cloneInstance,bo=n.createContainerChildSet,Uc=n.appendChildToContainerChildSet,rh=n.finalizeContainerChildren,jc=n.replaceContainerChildren,Fc=n.cloneHiddenInstance,Zl=n.cloneHiddenTextInstance;n.cloneInstance;var bm=n.canHydrateInstance,Lr=n.canHydrateTextInstance;n.canHydrateSuspenseInstance;var Jl=n.isSuspenseInstancePending,Bc=n.isSuspenseInstanceFallback;n.registerSuspenseInstanceRetry;var eu=n.getNextHydratableSibling,Dn=n.getFirstHydratableChild,wa=n.hydrateInstance,sh=n.hydrateTextInstance;n.hydrateSuspenseInstance;var Pr=n.getNextHydratableInstanceAfterSuspenseInstance,Ca=n.commitHydratedContainer,Hi=n.commitHydratedSuspenseInstance;n.clearSuspenseBoundary,n.clearSuspenseBoundaryFromContainer;var ah=n.didNotMatchHydratedContainerTextInstance,Em=n.didNotMatchHydratedTextInstance,xm=n.didNotHydrateContainerInstance,Vi=n.didNotHydrateInstance,wm=n.didNotFindHydratableContainerInstance,tu=n.didNotFindHydratableContainerTextInstance,Cm=n.didNotFindHydratableContainerSuspenseInstance,rr=n.didNotFindHydratableInstance,nu=n.didNotFindHydratableTextInstance,iu=n.didNotFindHydratableSuspenseInstance,gr=0,Eo,ru,Hc,su,Vc,Is,Mi;function Dr(){}Dr.__reactDisabledLog=!0;function $i(){{if(gr===0){Eo=console.log,ru=console.info,Hc=console.warn,su=console.error,Vc=console.group,Is=console.groupCollapsed,Mi=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Dr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}gr++}}function sr(){{if(gr--,gr===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},r,{value:Eo}),info:u({},r,{value:ru}),warn:u({},r,{value:Hc}),error:u({},r,{value:su}),group:u({},r,{value:Vc}),groupCollapsed:u({},r,{value:Is}),groupEnd:u({},r,{value:Mi})})}gr<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var yr=g.ReactCurrentDispatcher,Sr;function kr(r,s,c){{if(Sr===void 0)try{throw Error()}catch(v){var h=v.stack.trim().match(/\n( *(at )?)/);Sr=h&&h[1]||""}return`
66
+ */Vf.exports;var Py;function cC(){return Py||(Py=1,function(t){process.env.NODE_ENV!=="production"&&(t.exports=function(n){var i={},a=T,u=Cy(),f=My(),p=uC(),g=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var s=arguments.length,c=new Array(s>1?s-1:0),h=1;h<s;h++)c[h-1]=arguments[h];x("warn",r,c)}}function m(r){{for(var s=arguments.length,c=new Array(s>1?s-1:0),h=1;h<s;h++)c[h-1]=arguments[h];x("error",r,c)}}function x(r,s,c){{var h=g.ReactDebugCurrentFrame,v=h.getStackAddendum();v!==""&&(s+="%s",c=c.concat([v]));var b=c.map(function(w){return""+w});b.unshift("Warning: "+s),Function.prototype.apply.call(console[r],console,b)}}var R=0,_=1,M=2,k=3,L=4,P=5,O=6,j=7,q=8,ee=9,H=10,Z=11,ie=12,W=13,re=14,ge=15,be=16,Ee=17,Ue=18,je=19,Xe=20,ce=21,me=22,tt=23,mt=24;function he(r){return r._reactInternals}function Fe(r,s){r._reactInternals=s}var $e=60103,ht=60106,gt=60107,gn=60108,Xt=60114,yt=60109,Be=60110,nt=60112,ot=60113,lt=60120,Et=60115,wt=60116,yn=60121,Kt=60119,tr=60129,U=60130,I=60131;if(typeof Symbol=="function"&&Symbol.for){var G=Symbol.for;$e=G("react.element"),ht=G("react.portal"),gt=G("react.fragment"),gn=G("react.strict_mode"),Xt=G("react.profiler"),yt=G("react.provider"),Be=G("react.context"),nt=G("react.forward_ref"),ot=G("react.suspense"),lt=G("react.suspense_list"),Et=G("react.memo"),wt=G("react.lazy"),yn=G("react.block"),G("react.server.block"),G("react.fundamental"),Kt=G("react.scope"),G("react.opaque.id"),tr=G("react.debug_trace_mode"),U=G("react.offscreen"),I=G("react.legacy_hidden")}var Se=typeof Symbol=="function"&&Symbol.iterator,ut="@@iterator";function We(r){if(r===null||typeof r!="object")return null;var s=Se&&r[Se]||r[ut];return typeof s=="function"?s:null}function Sn(r,s,c){var h=s.displayName||s.name||"";return r.displayName||(h!==""?c+"("+h+")":c)}function ji(r){return r.displayName||"Context"}function xe(r){if(r==null)return null;if(typeof r.tag=="number"&&m("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case gt:return"Fragment";case ht:return"Portal";case Xt:return"Profiler";case gn:return"StrictMode";case ot:return"Suspense";case lt:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case Be:var s=r;return ji(s)+".Consumer";case yt:var c=r;return ji(c._context)+".Provider";case nt:return Sn(r,r.render,"ForwardRef");case Et:return xe(r.type);case yn:return xe(r._render);case wt:{var h=r,v=h._payload,b=h._init;try{return xe(b(v))}catch{return null}}}return null}var ct=0,pi=1,Pt=2,it=4,Re=6,De=8,at=16,Dt=32,rt=64,ln=128,en=256,Wn=512,sn=8192,Ri=1024,es=1028,po=932,vo=2047,ts=2048,Ai=4096,Ea=16384,mo=!0,ks=!1,nr=!1,$l=!1,Wl=g.ReactCurrentOwner;function ns(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{var h=s;do s=h,(s.flags&(Pt|Ri))!==ct&&(c=s.return),h=s.return;while(h)}return s.tag===k?c:null}function Pc(r){return ns(r)===r}function Dc(r){{var s=Wl.current;if(s!==null&&s.tag===_){var c=s,h=c.stateNode;h._warnedAboutRefsInRender||m("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",xe(c.type)||"A component"),h._warnedAboutRefsInRender=!0}}var v=he(r);return v?ns(v)===v:!1}function ql(r){if(ns(r)!==r)throw Error("Unable to find node on an unmounted component.")}function Yl(r){var s=r.alternate;if(!s){var c=ns(r);if(c===null)throw Error("Unable to find node on an unmounted component.");return c!==r?null:r}for(var h=r,v=s;;){var b=h.return;if(b===null)break;var w=b.alternate;if(w===null){var A=b.return;if(A!==null){h=v=A;continue}break}if(b.child===w.child){for(var D=b.child;D;){if(D===h)return ql(b),r;if(D===v)return ql(b),s;D=D.sibling}throw Error("Unable to find node on an unmounted component.")}if(h.return!==v.return)h=b,v=w;else{for(var F=!1,$=b.child;$;){if($===h){F=!0,h=b,v=w;break}if($===v){F=!0,v=b,h=w;break}$=$.sibling}if(!F){for($=w.child;$;){if($===h){F=!0,h=w,v=b;break}if($===v){F=!0,v=w,h=b;break}$=$.sibling}if(!F)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(h.alternate!==v)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(h.tag!==k)throw Error("Unable to find node on an unmounted component.");return h.stateNode.current===h?r:s}function z(r){var s=Yl(r);if(!s)return null;for(var c=s;;){if(c.tag===P||c.tag===O)return c;if(c.child){c.child.return=c,c=c.child;continue}if(c===s)return null;for(;!c.sibling;){if(!c.return||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function de(r){var s=Yl(r);if(!s)return null;for(var c=s;;){if(c.tag===P||c.tag===O||ks)return c;if(c.child&&c.tag!==L){c.child.return=c,c=c.child;continue}if(c===s)return null;for(;!c.sibling;){if(!c.return||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function Te(r,s){for(var c=s,h=r.alternate;c!==null;){if(c===r||c===h)return!0;c=c.return}return!1}var Ke=n.getPublicInstance,Ct=n.getRootHostContext,Ot=n.getChildHostContext,pt=n.prepareForCommit,ft=n.resetAfterCommit,bn=n.createInstance,jt=n.appendInitialChild,$t=n.finalizeInitialChildren,jn=n.prepareUpdate,ii=n.shouldSetTextContent,Fi=n.createTextInstance,vt=n.scheduleTimeout,un=n.cancelTimeout,vr=n.noTimeout;n.now;var cn=n.isPrimaryRenderer,qn=n.warnsIfNotActing,Fn=n.supportsMutation,mr=n.supportsPersistence,tn=n.supportsHydration;n.getFundamentalComponentInstance,n.mountFundamentalComponent,n.shouldUpdateFundamentalComponent;var Ql=n.getInstanceFromNode;n.isOpaqueHydratingObject;var Zd=n.makeOpaqueHydratingObject;n.makeClientId;var Jd=n.makeClientIdInDEV,go=n.beforeActiveInstanceBlur,eh=n.afterActiveInstanceBlur,kc=n.preparePortalMount;n.preparePortalMount,n.getInstanceFromScope;var Bi=n.supportsTestSelectors,dm=n.findFiberRoot,Gl=n.getBoundingRect,Wt=n.getTextContent,ir=n.isHiddenSubtree,hm=n.matchAccessibilityRole,pm=n.setFocusIfFocusable,yo=n.setupIntersectionObserver,th=n.appendChild,Xl=n.appendChildToContainer,xa=n.commitTextUpdate,Ic=n.commitMount,Kl=n.commitUpdate,is=n.insertBefore,vm=n.insertInContainerBefore,mm=n.removeChild,gm=n.removeChildFromContainer,nh=n.resetTextContent,Nc=n.hideInstance,zc=n.hideTextInstance,ym=n.unhideInstance,ih=n.unhideTextInstance;n.updateFundamentalComponent,n.unmountFundamentalComponent;var So=n.clearContainer,Sm=n.cloneInstance,bo=n.createContainerChildSet,Uc=n.appendChildToContainerChildSet,rh=n.finalizeContainerChildren,jc=n.replaceContainerChildren,Fc=n.cloneHiddenInstance,Zl=n.cloneHiddenTextInstance;n.cloneInstance;var bm=n.canHydrateInstance,Lr=n.canHydrateTextInstance;n.canHydrateSuspenseInstance;var Jl=n.isSuspenseInstancePending,Bc=n.isSuspenseInstanceFallback;n.registerSuspenseInstanceRetry;var eu=n.getNextHydratableSibling,Dn=n.getFirstHydratableChild,wa=n.hydrateInstance,sh=n.hydrateTextInstance;n.hydrateSuspenseInstance;var Pr=n.getNextHydratableInstanceAfterSuspenseInstance,Ca=n.commitHydratedContainer,Hi=n.commitHydratedSuspenseInstance;n.clearSuspenseBoundary,n.clearSuspenseBoundaryFromContainer;var ah=n.didNotMatchHydratedContainerTextInstance,Em=n.didNotMatchHydratedTextInstance,xm=n.didNotHydrateContainerInstance,Vi=n.didNotHydrateInstance,wm=n.didNotFindHydratableContainerInstance,tu=n.didNotFindHydratableContainerTextInstance,Cm=n.didNotFindHydratableContainerSuspenseInstance,rr=n.didNotFindHydratableInstance,nu=n.didNotFindHydratableTextInstance,iu=n.didNotFindHydratableSuspenseInstance,gr=0,Eo,ru,Hc,su,Vc,Is,Mi;function Dr(){}Dr.__reactDisabledLog=!0;function $i(){{if(gr===0){Eo=console.log,ru=console.info,Hc=console.warn,su=console.error,Vc=console.group,Is=console.groupCollapsed,Mi=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Dr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}gr++}}function sr(){{if(gr--,gr===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},r,{value:Eo}),info:u({},r,{value:ru}),warn:u({},r,{value:Hc}),error:u({},r,{value:su}),group:u({},r,{value:Vc}),groupCollapsed:u({},r,{value:Is}),groupEnd:u({},r,{value:Mi})})}gr<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var yr=g.ReactCurrentDispatcher,Sr;function kr(r,s,c){{if(Sr===void 0)try{throw Error()}catch(v){var h=v.stack.trim().match(/\n( *(at )?)/);Sr=h&&h[1]||""}return`
67
67
  `+Sr+r}}var Ns=!1,xo;{var oh=typeof WeakMap=="function"?WeakMap:Map;xo=new oh}function Ta(r,s){if(!r||Ns)return"";{var c=xo.get(r);if(c!==void 0)return c}var h;Ns=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=yr.current,yr.current=null,$i();try{if(s){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(ye){h=ye}Reflect.construct(r,[],w)}else{try{w.call()}catch(ye){h=ye}r.call(w.prototype)}}else{try{throw Error()}catch(ye){h=ye}r()}}catch(ye){if(ye&&h&&typeof ye.stack=="string"){for(var A=ye.stack.split(`
68
68
  `),D=h.stack.split(`
69
69
  `),F=A.length-1,$=D.length-1;F>=1&&$>=0&&A[F]!==D[$];)$--;for(;F>=1&&$>=0;F--,$--)if(A[F]!==D[$]){if(F!==1||$!==1)do if(F--,$--,$<0||A[F]!==D[$]){var X=`
70
- `+A[F].replace(" at new "," at ");return typeof r=="function"&&xo.set(r,X),X}while(F>=1&&$>=0);break}}}finally{Ns=!1,yr.current=b,sr(),Error.prepareStackTrace=v}var J=r?r.displayName||r.name:"",pe=J?kr(J):"";return typeof r=="function"&&xo.set(r,pe),pe}function au(r,s,c){return Ta(r,!0)}function Ra(r,s,c){return Ta(r,!1)}function lh(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function ou(r,s,c){if(r==null)return"";if(typeof r=="function")return Ta(r,lh(r));if(typeof r=="string")return kr(r);switch(r){case ot:return kr("Suspense");case lt:return kr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case nt:return Ra(r.render);case Et:return ou(r.type,s,c);case yn:return Ra(r._render);case wt:{var h=r,v=h._payload,b=h._init;try{return ou(b(v),s,c)}catch{}}}return""}var lu={},wo=g.ReactDebugCurrentFrame;function rs(r){if(r){var s=r._owner,c=ou(r.type,r._source,s?s.type:null);wo.setExtraStackFrame(c)}else wo.setExtraStackFrame(null)}function vi(r,s,c,h,v){{var b=Function.call.bind(Object.prototype.hasOwnProperty);for(var w in r)if(b(r,w)){var A=void 0;try{if(typeof r[w]!="function"){var D=Error((h||"React class")+": "+c+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}A=r[w](s,w,h,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){A=F}A&&!(A instanceof Error)&&(rs(v),m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",h||"React class",c,w,typeof A),rs(null)),A instanceof Error&&!(A.message in lu)&&(lu[A.message]=!0,rs(v),m("Failed %s type: %s",c,A.message),rs(null))}}}var uu=[],zs;zs=[];var br=-1;function Wi(r){return{current:r}}function Ft(r,s){if(br<0){m("Unexpected pop.");return}s!==zs[br]&&m("Unexpected Fiber popped."),r.current=uu[br],uu[br]=null,zs[br]=null,br--}function En(r,s,c){br++,uu[br]=r.current,zs[br]=c,r.current=s}var ss;ss={};var fn={};Object.freeze(fn);var ar=Wi(fn),ri=Wi(!1),cu=fn;function as(r,s,c){return c&&Yn(s)?cu:ar.current}function an(r,s,c){{var h=r.stateNode;h.__reactInternalMemoizedUnmaskedChildContext=s,h.__reactInternalMemoizedMaskedChildContext=c}}function Ir(r,s){{var c=r.type,h=c.contextTypes;if(!h)return fn;var v=r.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===s)return v.__reactInternalMemoizedMaskedChildContext;var b={};for(var w in h)b[w]=s[w];{var A=xe(c)||"Unknown";vi(h,b,"context",A)}return v&&an(r,s,b),b}}function qi(){return ri.current}function Yn(r){{var s=r.childContextTypes;return s!=null}}function Oi(r){Ft(ri,r),Ft(ar,r)}function fu(r){Ft(ri,r),Ft(ar,r)}function $c(r,s,c){{if(ar.current!==fn)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");En(ar,s,r),En(ri,c,r)}}function du(r,s,c){{var h=r.stateNode,v=s.childContextTypes;if(typeof h.getChildContext!="function"){{var b=xe(s)||"Unknown";ss[b]||(ss[b]=!0,m("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",b,b))}return c}var w=h.getChildContext();for(var A in w)if(!(A in v))throw Error((xe(s)||"Unknown")+'.getChildContext(): key "'+A+'" is not defined in childContextTypes.');{var D=xe(s)||"Unknown";vi(v,w,"child context",D)}return u({},c,w)}}function Co(r){{var s=r.stateNode,c=s&&s.__reactInternalMemoizedMergedChildContext||fn;return cu=ar.current,En(ar,c,r),En(ri,ri.current,r),!0}}function To(r,s,c){{var h=r.stateNode;if(!h)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(c){var v=du(r,s,cu);h.__reactInternalMemoizedMergedChildContext=v,Ft(ri,r),Ft(ar,r),En(ar,v,r),En(ri,c,r)}else Ft(ri,r),En(ri,c,r)}}function Wc(r){{if(!(Pc(r)&&r.tag===_))throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var s=r;do{switch(s.tag){case k:return s.stateNode.context;case _:{var c=s.type;if(Yn(c))return s.stateNode.__reactInternalMemoizedMergedChildContext;break}}s=s.return}while(s!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var Us=0,hu=1,Aa=2,si=null,mi=null,qt=!1,Qn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function Bn(r){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return m("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{si=s.inject(r),mi=s}catch(c){m("React instrumentation encountered an error: %s.",c)}return!0}function pu(r,s){if(mi&&typeof mi.onScheduleFiberRoot=="function")try{mi.onScheduleFiberRoot(si,r,s)}catch(c){qt||(qt=!0,m("React instrumentation encountered an error: %s",c))}}function Ro(r,s){if(mi&&typeof mi.onCommitFiberRoot=="function")try{var c=(r.current.flags&rt)===rt;mo&&mi.onCommitFiberRoot(si,r,s,c)}catch(h){qt||(qt=!0,m("React instrumentation encountered an error: %s",h))}}function gi(r){if(mi&&typeof mi.onCommitFiberUnmount=="function")try{mi.onCommitFiberUnmount(si,r)}catch(s){qt||(qt=!0,m("React instrumentation encountered an error: %s",s))}}var qc=f.unstable_now;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var vu=99,os=98,ls=97,Er=96,Ma=95,Ao=90;qc();var js=15,Mo=14,Yc=13,us=12,Oo=11,Fs=10,_o=9,Nr=8,mu=7,Lo=6,Oa=5,Qc=4,Gc=3,Po=2,gu=1,zr=0,uh=31,le=0,Gn=0,Rt=1,Do=2,yu=4,Su=24,ch=32,Yi=192,ai=256,bu=3584,Xc=4096,Bs=4186112,_a=62914560,Hs=33554432,ko=67108864,Kc=134217727,Eu=134217728,xu=805306368,_i=1073741824,on=-1,Zc=zr;function Jc(){return Zc}function ef(r){Zc=r}var Bt=Nr;function Ur(r){if((Rt&r)!==le)return Bt=js,Rt;if((Do&r)!==le)return Bt=Mo,Do;if((yu&r)!==le)return Bt=Yc,yu;var s=Su&r;if(s!==le)return Bt=us,s;if((r&ch)!==le)return Bt=Oo,ch;var c=Yi&r;if(c!==le)return Bt=Fs,c;if((r&ai)!==le)return Bt=_o,ai;var h=bu&r;if(h!==le)return Bt=Nr,h;if((r&Xc)!==le)return Bt=mu,Xc;var v=Bs&r;if(v!==le)return Bt=Lo,v;var b=_a&r;if(b!==le)return Bt=Oa,b;if(r&ko)return Bt=Qc,ko;if((r&Eu)!==le)return Bt=Gc,Eu;var w=xu&r;return w!==le?(Bt=Po,w):(_i&r)!==le?(Bt=gu,_i):(m("Should have found matching lanes. This is a bug in React."),Bt=Nr,r)}function fh(r){switch(r){case vu:return js;case os:return Fs;case ls:case Er:return Nr;case Ma:return Po;default:return zr}}function jr(r){switch(r){case js:case Mo:return vu;case Yc:case us:case Oo:case Fs:return os;case _o:case Nr:case mu:case Lo:case Qc:case Oa:return ls;case Gc:case Po:case gu:return Ma;case zr:return Ao;default:throw Error("Invalid update priority: "+r+". This is a bug in React.")}}function yi(r,s){var c=r.pendingLanes;if(c===le)return Bt=zr,le;var h=le,v=zr,b=r.expiredLanes,w=r.suspendedLanes,A=r.pingedLanes;if(b!==le)h=b,v=Bt=js;else{var D=c&Kc;if(D!==le){var F=D&~w;if(F!==le)h=Ur(F),v=Bt;else{var $=D&A;$!==le&&(h=Ur($),v=Bt)}}else{var X=c&~w;X!==le?(h=Ur(X),v=Bt):A!==le&&(h=Ur(A),v=Bt)}}if(h===le)return le;if(h=c&mh(h),s!==le&&s!==h&&(s&w)===le){Ur(s);var J=Bt;if(v<=J)return s;Bt=v}var pe=r.entangledLanes;if(pe!==le)for(var ye=r.entanglements,Ce=h&pe;Ce>0;){var Ze=cs(Ce),bt=1<<Ze;h|=ye[Ze],Ce&=~bt}return h}function Io(r,s){for(var c=r.eventTimes,h=on;s>0;){var v=cs(s),b=1<<v,w=c[v];w>h&&(h=w),s&=~b}return h}function No(r,s){Ur(r);var c=Bt;return c>=Fs?s+250:c>=Lo?s+5e3:on}function wu(r,s){for(var c=r.pendingLanes,h=r.suspendedLanes,v=r.pingedLanes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A,F=b[A];F===on?((D&h)===le||(D&v)!==le)&&(b[A]=No(D,s)):F<=s&&(r.expiredLanes|=D),w&=~D}}function Cu(r){return Ur(r.pendingLanes)}function tf(r){var s=r.pendingLanes&~_i;return s!==le?s:s&_i?_i:le}function zo(){return Bt}function dh(r){return(r&Kc)!==le}function hh(r){return(r&_a)===r}function nf(r){return(r&Bs)===r}function La(r,s){switch(r){case zr:break;case js:return Rt;case Mo:return Do;case us:{var c=oi(Su&~s);return c===Gn?La(Fs,s):c}case Fs:{var h=oi(Yi&~s);return h===Gn?La(Nr,s):h}case Nr:{var v=oi(bu&~s);return v===Gn&&(v=oi(Bs&~s),v===Gn&&(v=oi(bu))),v}case Lo:case Oa:break;case Po:var b=oi(xu&~s);return b===Gn&&(b=oi(xu)),b}throw Error("Invalid update priority: "+r+". This is a bug in React.")}function Tm(r,s){var c=oi(Bs&~s);return c===Gn&&(c=oi(Bs&~r),c===Gn&&(c=oi(Bs))),c}function ph(r){var s=oi(_a&~r);return s===Gn&&(s=oi(_a)),s}function vh(r){return r&-r}function Rm(r){var s=31-Bo(r);return s<0?le:1<<s}function mh(r){return(Rm(r)<<1)-1}function oi(r){return vh(r)}function cs(r){return 31-Bo(r)}function Am(r){return cs(r)}function Hn(r,s){return(r&s)!==le}function fs(r,s){return(r&s)===s}function At(r,s){return r|s}function Uo(r,s){return r&~s}function Mm(r){return r}function gh(r,s){return r!==Gn&&r<s?r:s}function jo(r){for(var s=[],c=0;c<uh;c++)s.push(r);return s}function Pa(r,s,c){r.pendingLanes|=s;var h=s-1;r.suspendedLanes&=h,r.pingedLanes&=h;var v=r.eventTimes,b=Am(s);v[b]=c}function yh(r,s){r.suspendedLanes|=s,r.pingedLanes&=~s;for(var c=r.expirationTimes,h=s;h>0;){var v=cs(h),b=1<<v;c[v]=on,h&=~b}}function Tu(r,s,c){r.pingedLanes|=r.suspendedLanes&s}function Sh(r,s){r.expiredLanes|=s&r.pendingLanes}function Ru(r){r.expiredLanes|=Su&r.pendingLanes}function Om(r){return(r&Su)!==le}function Fo(r,s){r.mutableReadLanes|=s&r.pendingLanes}function Au(r,s){var c=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s;for(var h=r.entanglements,v=r.eventTimes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A;h[A]=le,v[A]=on,b[A]=on,w&=~D}}function Mu(r,s){r.entangledLanes|=s;for(var c=r.entanglements,h=s;h>0;){var v=cs(h),b=1<<v;c[v]|=s,h&=~b}}var Bo=Math.clz32?Math.clz32:rf,Ou=Math.log,Ho=Math.LN2;function rf(r){return r===0?32:31-(Ou(r)/Ho|0)|0}var sf=f.unstable_runWithPriority,Vo=f.unstable_scheduleCallback,af=f.unstable_cancelCallback,of=f.unstable_shouldYield,$o=f.unstable_requestPaint,lf=f.unstable_now,_m=f.unstable_getCurrentPriorityLevel,Vs=f.unstable_ImmediatePriority,_u=f.unstable_UserBlockingPriority,Lu=f.unstable_NormalPriority,Qe=f.unstable_LowPriority,Xn=f.unstable_IdlePriority;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var xn={},Nt=99,Li=98,Qi=97,kn=96,Wo=95,ds=90,qo=of,Da=$o!==void 0?$o:function(){},or=null,ka=null,Yo=!1,Pu=lf(),nn=Pu<1e4?lf:function(){return lf()-Pu};function _e(){switch(_m()){case Vs:return Nt;case _u:return Li;case Lu:return Qi;case Qe:return kn;case Xn:return Wo;default:throw Error("Unknown priority level.")}}function Qo(r){switch(r){case Nt:return Vs;case Li:return _u;case Qi:return Lu;case kn:return Qe;case Wo:return Xn;default:throw Error("Unknown priority level.")}}function lr(r,s){var c=Qo(r);return sf(c,s)}function Vn(r,s,c){var h=Qo(r);return Vo(h,s,c)}function hs(r){return or===null?(or=[r],ka=Vo(Vs,Du)):or.push(r),xn}function Ia(r){r!==xn&&af(r)}function Kn(){if(ka!==null){var r=ka;ka=null,af(r)}Du()}function Du(){if(!Yo&&or!==null){Yo=!0;var r=0;try{var s=!0,c=or;lr(Nt,function(){for(;r<c.length;r++){var h=c[r];do h=h(s);while(h!==null)}}),or=null}catch(h){throw or!==null&&(or=or.slice(r+1)),Vo(Vs,Kn),h}finally{Yo=!1}}}var Yt=0,_t=1,In=2,Fr=4,Zn=8,Br=16,ku=g.ReactCurrentBatchConfig,Go=0;function Xo(){return ku.transition}function Si(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var An=typeof Object.is=="function"?Object.is:Si,Hr=Object.prototype.hasOwnProperty;function $s(r,s){if(An(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),h=Object.keys(s);if(c.length!==h.length)return!1;for(var v=0;v<c.length;v++)if(!Hr.call(s,c[v])||!An(r[c[v]],s[c[v]]))return!1;return!0}function Pi(r){switch(r._debugOwner&&r._debugOwner.type,r._debugSource,r.tag){case P:return kr(r.type);case be:return kr("Lazy");case W:return kr("Suspense");case je:return kr("SuspenseList");case T:case M:case ge:return Ra(r.type);case Z:return Ra(r.type.render);case me:return Ra(r.type._render);case _:return au(r.type);default:return""}}function uf(r){try{var s="",c=r;do s+=Pi(c),c=c.return;while(c);return s}catch(h){return`
70
+ `+A[F].replace(" at new "," at ");return typeof r=="function"&&xo.set(r,X),X}while(F>=1&&$>=0);break}}}finally{Ns=!1,yr.current=b,sr(),Error.prepareStackTrace=v}var J=r?r.displayName||r.name:"",pe=J?kr(J):"";return typeof r=="function"&&xo.set(r,pe),pe}function au(r,s,c){return Ta(r,!0)}function Ra(r,s,c){return Ta(r,!1)}function lh(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function ou(r,s,c){if(r==null)return"";if(typeof r=="function")return Ta(r,lh(r));if(typeof r=="string")return kr(r);switch(r){case ot:return kr("Suspense");case lt:return kr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case nt:return Ra(r.render);case Et:return ou(r.type,s,c);case yn:return Ra(r._render);case wt:{var h=r,v=h._payload,b=h._init;try{return ou(b(v),s,c)}catch{}}}return""}var lu={},wo=g.ReactDebugCurrentFrame;function rs(r){if(r){var s=r._owner,c=ou(r.type,r._source,s?s.type:null);wo.setExtraStackFrame(c)}else wo.setExtraStackFrame(null)}function vi(r,s,c,h,v){{var b=Function.call.bind(Object.prototype.hasOwnProperty);for(var w in r)if(b(r,w)){var A=void 0;try{if(typeof r[w]!="function"){var D=Error((h||"React class")+": "+c+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}A=r[w](s,w,h,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(F){A=F}A&&!(A instanceof Error)&&(rs(v),m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",h||"React class",c,w,typeof A),rs(null)),A instanceof Error&&!(A.message in lu)&&(lu[A.message]=!0,rs(v),m("Failed %s type: %s",c,A.message),rs(null))}}}var uu=[],zs;zs=[];var br=-1;function Wi(r){return{current:r}}function Ft(r,s){if(br<0){m("Unexpected pop.");return}s!==zs[br]&&m("Unexpected Fiber popped."),r.current=uu[br],uu[br]=null,zs[br]=null,br--}function En(r,s,c){br++,uu[br]=r.current,zs[br]=c,r.current=s}var ss;ss={};var fn={};Object.freeze(fn);var ar=Wi(fn),ri=Wi(!1),cu=fn;function as(r,s,c){return c&&Yn(s)?cu:ar.current}function an(r,s,c){{var h=r.stateNode;h.__reactInternalMemoizedUnmaskedChildContext=s,h.__reactInternalMemoizedMaskedChildContext=c}}function Ir(r,s){{var c=r.type,h=c.contextTypes;if(!h)return fn;var v=r.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===s)return v.__reactInternalMemoizedMaskedChildContext;var b={};for(var w in h)b[w]=s[w];{var A=xe(c)||"Unknown";vi(h,b,"context",A)}return v&&an(r,s,b),b}}function qi(){return ri.current}function Yn(r){{var s=r.childContextTypes;return s!=null}}function Oi(r){Ft(ri,r),Ft(ar,r)}function fu(r){Ft(ri,r),Ft(ar,r)}function $c(r,s,c){{if(ar.current!==fn)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");En(ar,s,r),En(ri,c,r)}}function du(r,s,c){{var h=r.stateNode,v=s.childContextTypes;if(typeof h.getChildContext!="function"){{var b=xe(s)||"Unknown";ss[b]||(ss[b]=!0,m("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",b,b))}return c}var w=h.getChildContext();for(var A in w)if(!(A in v))throw Error((xe(s)||"Unknown")+'.getChildContext(): key "'+A+'" is not defined in childContextTypes.');{var D=xe(s)||"Unknown";vi(v,w,"child context",D)}return u({},c,w)}}function Co(r){{var s=r.stateNode,c=s&&s.__reactInternalMemoizedMergedChildContext||fn;return cu=ar.current,En(ar,c,r),En(ri,ri.current,r),!0}}function To(r,s,c){{var h=r.stateNode;if(!h)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(c){var v=du(r,s,cu);h.__reactInternalMemoizedMergedChildContext=v,Ft(ri,r),Ft(ar,r),En(ar,v,r),En(ri,c,r)}else Ft(ri,r),En(ri,c,r)}}function Wc(r){{if(!(Pc(r)&&r.tag===_))throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var s=r;do{switch(s.tag){case k:return s.stateNode.context;case _:{var c=s.type;if(Yn(c))return s.stateNode.__reactInternalMemoizedMergedChildContext;break}}s=s.return}while(s!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var Us=0,hu=1,Aa=2,si=null,mi=null,qt=!1,Qn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function Bn(r){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return m("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{si=s.inject(r),mi=s}catch(c){m("React instrumentation encountered an error: %s.",c)}return!0}function pu(r,s){if(mi&&typeof mi.onScheduleFiberRoot=="function")try{mi.onScheduleFiberRoot(si,r,s)}catch(c){qt||(qt=!0,m("React instrumentation encountered an error: %s",c))}}function Ro(r,s){if(mi&&typeof mi.onCommitFiberRoot=="function")try{var c=(r.current.flags&rt)===rt;mo&&mi.onCommitFiberRoot(si,r,s,c)}catch(h){qt||(qt=!0,m("React instrumentation encountered an error: %s",h))}}function gi(r){if(mi&&typeof mi.onCommitFiberUnmount=="function")try{mi.onCommitFiberUnmount(si,r)}catch(s){qt||(qt=!0,m("React instrumentation encountered an error: %s",s))}}var qc=f.unstable_now;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var vu=99,os=98,ls=97,Er=96,Ma=95,Ao=90;qc();var js=15,Mo=14,Yc=13,us=12,Oo=11,Fs=10,_o=9,Nr=8,mu=7,Lo=6,Oa=5,Qc=4,Gc=3,Po=2,gu=1,zr=0,uh=31,le=0,Gn=0,Rt=1,Do=2,yu=4,Su=24,ch=32,Yi=192,ai=256,bu=3584,Xc=4096,Bs=4186112,_a=62914560,Hs=33554432,ko=67108864,Kc=134217727,Eu=134217728,xu=805306368,_i=1073741824,on=-1,Zc=zr;function Jc(){return Zc}function ef(r){Zc=r}var Bt=Nr;function Ur(r){if((Rt&r)!==le)return Bt=js,Rt;if((Do&r)!==le)return Bt=Mo,Do;if((yu&r)!==le)return Bt=Yc,yu;var s=Su&r;if(s!==le)return Bt=us,s;if((r&ch)!==le)return Bt=Oo,ch;var c=Yi&r;if(c!==le)return Bt=Fs,c;if((r&ai)!==le)return Bt=_o,ai;var h=bu&r;if(h!==le)return Bt=Nr,h;if((r&Xc)!==le)return Bt=mu,Xc;var v=Bs&r;if(v!==le)return Bt=Lo,v;var b=_a&r;if(b!==le)return Bt=Oa,b;if(r&ko)return Bt=Qc,ko;if((r&Eu)!==le)return Bt=Gc,Eu;var w=xu&r;return w!==le?(Bt=Po,w):(_i&r)!==le?(Bt=gu,_i):(m("Should have found matching lanes. This is a bug in React."),Bt=Nr,r)}function fh(r){switch(r){case vu:return js;case os:return Fs;case ls:case Er:return Nr;case Ma:return Po;default:return zr}}function jr(r){switch(r){case js:case Mo:return vu;case Yc:case us:case Oo:case Fs:return os;case _o:case Nr:case mu:case Lo:case Qc:case Oa:return ls;case Gc:case Po:case gu:return Ma;case zr:return Ao;default:throw Error("Invalid update priority: "+r+". This is a bug in React.")}}function yi(r,s){var c=r.pendingLanes;if(c===le)return Bt=zr,le;var h=le,v=zr,b=r.expiredLanes,w=r.suspendedLanes,A=r.pingedLanes;if(b!==le)h=b,v=Bt=js;else{var D=c&Kc;if(D!==le){var F=D&~w;if(F!==le)h=Ur(F),v=Bt;else{var $=D&A;$!==le&&(h=Ur($),v=Bt)}}else{var X=c&~w;X!==le?(h=Ur(X),v=Bt):A!==le&&(h=Ur(A),v=Bt)}}if(h===le)return le;if(h=c&mh(h),s!==le&&s!==h&&(s&w)===le){Ur(s);var J=Bt;if(v<=J)return s;Bt=v}var pe=r.entangledLanes;if(pe!==le)for(var ye=r.entanglements,Ce=h&pe;Ce>0;){var Ze=cs(Ce),bt=1<<Ze;h|=ye[Ze],Ce&=~bt}return h}function Io(r,s){for(var c=r.eventTimes,h=on;s>0;){var v=cs(s),b=1<<v,w=c[v];w>h&&(h=w),s&=~b}return h}function No(r,s){Ur(r);var c=Bt;return c>=Fs?s+250:c>=Lo?s+5e3:on}function wu(r,s){for(var c=r.pendingLanes,h=r.suspendedLanes,v=r.pingedLanes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A,F=b[A];F===on?((D&h)===le||(D&v)!==le)&&(b[A]=No(D,s)):F<=s&&(r.expiredLanes|=D),w&=~D}}function Cu(r){return Ur(r.pendingLanes)}function tf(r){var s=r.pendingLanes&~_i;return s!==le?s:s&_i?_i:le}function zo(){return Bt}function dh(r){return(r&Kc)!==le}function hh(r){return(r&_a)===r}function nf(r){return(r&Bs)===r}function La(r,s){switch(r){case zr:break;case js:return Rt;case Mo:return Do;case us:{var c=oi(Su&~s);return c===Gn?La(Fs,s):c}case Fs:{var h=oi(Yi&~s);return h===Gn?La(Nr,s):h}case Nr:{var v=oi(bu&~s);return v===Gn&&(v=oi(Bs&~s),v===Gn&&(v=oi(bu))),v}case Lo:case Oa:break;case Po:var b=oi(xu&~s);return b===Gn&&(b=oi(xu)),b}throw Error("Invalid update priority: "+r+". This is a bug in React.")}function Tm(r,s){var c=oi(Bs&~s);return c===Gn&&(c=oi(Bs&~r),c===Gn&&(c=oi(Bs))),c}function ph(r){var s=oi(_a&~r);return s===Gn&&(s=oi(_a)),s}function vh(r){return r&-r}function Rm(r){var s=31-Bo(r);return s<0?le:1<<s}function mh(r){return(Rm(r)<<1)-1}function oi(r){return vh(r)}function cs(r){return 31-Bo(r)}function Am(r){return cs(r)}function Hn(r,s){return(r&s)!==le}function fs(r,s){return(r&s)===s}function At(r,s){return r|s}function Uo(r,s){return r&~s}function Mm(r){return r}function gh(r,s){return r!==Gn&&r<s?r:s}function jo(r){for(var s=[],c=0;c<uh;c++)s.push(r);return s}function Pa(r,s,c){r.pendingLanes|=s;var h=s-1;r.suspendedLanes&=h,r.pingedLanes&=h;var v=r.eventTimes,b=Am(s);v[b]=c}function yh(r,s){r.suspendedLanes|=s,r.pingedLanes&=~s;for(var c=r.expirationTimes,h=s;h>0;){var v=cs(h),b=1<<v;c[v]=on,h&=~b}}function Tu(r,s,c){r.pingedLanes|=r.suspendedLanes&s}function Sh(r,s){r.expiredLanes|=s&r.pendingLanes}function Ru(r){r.expiredLanes|=Su&r.pendingLanes}function Om(r){return(r&Su)!==le}function Fo(r,s){r.mutableReadLanes|=s&r.pendingLanes}function Au(r,s){var c=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s;for(var h=r.entanglements,v=r.eventTimes,b=r.expirationTimes,w=c;w>0;){var A=cs(w),D=1<<A;h[A]=le,v[A]=on,b[A]=on,w&=~D}}function Mu(r,s){r.entangledLanes|=s;for(var c=r.entanglements,h=s;h>0;){var v=cs(h),b=1<<v;c[v]|=s,h&=~b}}var Bo=Math.clz32?Math.clz32:rf,Ou=Math.log,Ho=Math.LN2;function rf(r){return r===0?32:31-(Ou(r)/Ho|0)|0}var sf=f.unstable_runWithPriority,Vo=f.unstable_scheduleCallback,af=f.unstable_cancelCallback,of=f.unstable_shouldYield,$o=f.unstable_requestPaint,lf=f.unstable_now,_m=f.unstable_getCurrentPriorityLevel,Vs=f.unstable_ImmediatePriority,_u=f.unstable_UserBlockingPriority,Lu=f.unstable_NormalPriority,Qe=f.unstable_LowPriority,Xn=f.unstable_IdlePriority;if(!(p.__interactionsRef!=null&&p.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");var xn={},Nt=99,Li=98,Qi=97,kn=96,Wo=95,ds=90,qo=of,Da=$o!==void 0?$o:function(){},or=null,ka=null,Yo=!1,Pu=lf(),nn=Pu<1e4?lf:function(){return lf()-Pu};function _e(){switch(_m()){case Vs:return Nt;case _u:return Li;case Lu:return Qi;case Qe:return kn;case Xn:return Wo;default:throw Error("Unknown priority level.")}}function Qo(r){switch(r){case Nt:return Vs;case Li:return _u;case Qi:return Lu;case kn:return Qe;case Wo:return Xn;default:throw Error("Unknown priority level.")}}function lr(r,s){var c=Qo(r);return sf(c,s)}function Vn(r,s,c){var h=Qo(r);return Vo(h,s,c)}function hs(r){return or===null?(or=[r],ka=Vo(Vs,Du)):or.push(r),xn}function Ia(r){r!==xn&&af(r)}function Kn(){if(ka!==null){var r=ka;ka=null,af(r)}Du()}function Du(){if(!Yo&&or!==null){Yo=!0;var r=0;try{var s=!0,c=or;lr(Nt,function(){for(;r<c.length;r++){var h=c[r];do h=h(s);while(h!==null)}}),or=null}catch(h){throw or!==null&&(or=or.slice(r+1)),Vo(Vs,Kn),h}finally{Yo=!1}}}var Yt=0,_t=1,In=2,Fr=4,Zn=8,Br=16,ku=g.ReactCurrentBatchConfig,Go=0;function Xo(){return ku.transition}function Si(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var An=typeof Object.is=="function"?Object.is:Si,Hr=Object.prototype.hasOwnProperty;function $s(r,s){if(An(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),h=Object.keys(s);if(c.length!==h.length)return!1;for(var v=0;v<c.length;v++)if(!Hr.call(s,c[v])||!An(r[c[v]],s[c[v]]))return!1;return!0}function Pi(r){switch(r._debugOwner&&r._debugOwner.type,r._debugSource,r.tag){case P:return kr(r.type);case be:return kr("Lazy");case W:return kr("Suspense");case je:return kr("SuspenseList");case R:case M:case ge:return Ra(r.type);case Z:return Ra(r.type.render);case me:return Ra(r.type._render);case _:return au(r.type);default:return""}}function uf(r){try{var s="",c=r;do s+=Pi(c),c=c.return;while(c);return s}catch(h){return`
71
71
  Error generating stack: `+h.message+`
72
72
  `+h.stack}}var Ws=g.ReactDebugCurrentFrame,Jn=null,Na=!1;function bh(){{if(Jn===null)return null;var r=Jn._debugOwner;if(r!==null&&typeof r<"u")return xe(r.type)}return null}function Eh(){return Jn===null?"":uf(Jn)}function $n(){Ws.getCurrentStack=null,Jn=null,Na=!1}function wn(r){Ws.getCurrentStack=Eh,Jn=r,Na=!1}function li(r){Na=r}function xh(){return Na}var Gi={recordUnsafeLifecycleWarnings:function(r,s){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(r,s){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Ko=function(r){for(var s=null,c=r;c!==null;)c.mode&_t&&(s=c),c=c.return;return s},qs=function(r){var s=[];return r.forEach(function(c){s.push(c)}),s.sort().join(", ")},Zo=[],za=[],Ua=[],ur=[],Jo=[],el=[],ui=new Set;Gi.recordUnsafeLifecycleWarnings=function(r,s){ui.has(r.type)||(typeof s.componentWillMount=="function"&&s.componentWillMount.__suppressDeprecationWarning!==!0&&Zo.push(r),r.mode&_t&&typeof s.UNSAFE_componentWillMount=="function"&&za.push(r),typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Ua.push(r),r.mode&_t&&typeof s.UNSAFE_componentWillReceiveProps=="function"&&ur.push(r),typeof s.componentWillUpdate=="function"&&s.componentWillUpdate.__suppressDeprecationWarning!==!0&&Jo.push(r),r.mode&_t&&typeof s.UNSAFE_componentWillUpdate=="function"&&el.push(r))},Gi.flushPendingUnsafeLifecycleWarnings=function(){var r=new Set;Zo.length>0&&(Zo.forEach(function(J){r.add(xe(J.type)||"Component"),ui.add(J.type)}),Zo=[]);var s=new Set;za.length>0&&(za.forEach(function(J){s.add(xe(J.type)||"Component"),ui.add(J.type)}),za=[]);var c=new Set;Ua.length>0&&(Ua.forEach(function(J){c.add(xe(J.type)||"Component"),ui.add(J.type)}),Ua=[]);var h=new Set;ur.length>0&&(ur.forEach(function(J){h.add(xe(J.type)||"Component"),ui.add(J.type)}),ur=[]);var v=new Set;Jo.length>0&&(Jo.forEach(function(J){v.add(xe(J.type)||"Component"),ui.add(J.type)}),Jo=[]);var b=new Set;if(el.length>0&&(el.forEach(function(J){b.add(xe(J.type)||"Component"),ui.add(J.type)}),el=[]),s.size>0){var w=qs(s);m(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
73
73
 
@@ -112,11 +112,11 @@ The above lifecycles should be removed. Learn more about this warning here:
112
112
  https://reactjs.org/link/unsafe-component-lifecycles`,Ze,bt,pe!==null?`
113
113
  `+pe:"",ye!==null?`
114
114
  `+ye:"",Ce!==null?`
115
- `+Ce:""))}}}return h&&an(r,v,b),$}function Pm(r,s){var c=s.state;typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),c!==s.state&&(m("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",xe(r.type)||"Component"),et.enqueueReplaceState(s,s.state,null))}function BE(r,s,c,h){var v=s.state;if(typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==v){{var b=xe(r.type)||"Component";He.has(b)||(He.add(b),m("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",b))}et.enqueueReplaceState(s,s.state,null)}}function Dm(r,s,c,h){Cn(r,s,c);var v=r.stateNode;v.props=c,v.state=r.memoizedState,v.refs=we,ju(r);var b=s.contextType;if(typeof b=="object"&&b!==null)v.context=Ht(b);else{var w=as(r,s,!0);v.context=Ir(r,w)}{if(v.state===c){var A=xe(s)||"Component";V.has(A)||(V.add(A),m("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",A))}r.mode&_t&&Gi.recordLegacyContextWarning(r,v),Gi.recordUnsafeLifecycleWarnings(r,v)}d(r,c,v,h),v.state=r.memoizedState;var D=s.getDerivedStateFromProps;typeof D=="function"&&(It(r,s,D,c),v.state=r.memoizedState),typeof s.getDerivedStateFromProps!="function"&&typeof v.getSnapshotBeforeUpdate!="function"&&(typeof v.UNSAFE_componentWillMount=="function"||typeof v.componentWillMount=="function")&&(Pm(r,v),d(r,c,v,h),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=it)}function DD(r,s,c,h){var v=r.stateNode,b=r.memoizedProps;v.props=b;var w=v.context,A=s.contextType,D=fn;if(typeof A=="object"&&A!==null)D=Ht(A);else{var F=as(r,s,!0);D=Ir(r,F)}var $=s.getDerivedStateFromProps,X=typeof $=="function"||typeof v.getSnapshotBeforeUpdate=="function";!X&&(typeof v.UNSAFE_componentWillReceiveProps=="function"||typeof v.componentWillReceiveProps=="function")&&(b!==c||w!==D)&&BE(r,v,c,D),E();var J=r.memoizedState,pe=v.state=J;if(d(r,c,v,h),pe=r.memoizedState,b===c&&J===pe&&!qi()&&!C())return typeof v.componentDidMount=="function"&&(r.flags|=it),!1;typeof $=="function"&&(It(r,s,$,c),pe=r.memoizedState);var ye=C()||Mt(r,s,b,c,J,pe,D);return ye?(!X&&(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"&&(r.flags|=it)):(typeof v.componentDidMount=="function"&&(r.flags|=it),r.memoizedProps=c,r.memoizedState=pe),v.props=c,v.state=pe,v.context=D,ye}function kD(r,s,c,h,v){var b=s.stateNode;ll(r,s);var w=s.memoizedProps,A=s.type===s.elementType?w:cr(s.type,w);b.props=A;var D=s.pendingProps,F=b.context,$=c.contextType,X=fn;if(typeof $=="object"&&$!==null)X=Ht($);else{var J=as(s,c,!0);X=Ir(s,J)}var pe=c.getDerivedStateFromProps,ye=typeof pe=="function"||typeof b.getSnapshotBeforeUpdate=="function";!ye&&(typeof b.UNSAFE_componentWillReceiveProps=="function"||typeof b.componentWillReceiveProps=="function")&&(w!==D||F!==X)&&BE(s,b,h,X),E();var Ce=s.memoizedState,Ze=b.state=Ce;if(d(s,h,b,v),Ze=s.memoizedState,w===D&&Ce===Ze&&!qi()&&!C())return typeof b.componentDidUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=en),!1;typeof pe=="function"&&(It(s,c,pe,h),Ze=s.memoizedState);var bt=C()||Mt(s,c,A,h,Ce,Ze,X);return bt?(!ye&&(typeof b.UNSAFE_componentWillUpdate=="function"||typeof b.componentWillUpdate=="function")&&(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,Ze,X),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,Ze,X)),typeof b.componentDidUpdate=="function"&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=en)):(typeof b.componentDidUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=en),s.memoizedProps=h,s.memoizedState=Ze),b.props=h,b.state=Ze,b.context=X,bt}var km,Im,Nm,zm,Um,HE=function(r,s){};km=!1,Im=!1,Nm={},zm={},Um={},HE=function(r,s){if(!(r===null||typeof r!="object")&&!(!r._store||r._store.validated||r.key!=null)){if(typeof r._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");r._store.validated=!0;var c=xe(s.type)||"Component";zm[c]||(zm[c]=!0,m('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var wh=Array.isArray;function pf(r,s,c){var h=c.ref;if(h!==null&&typeof h!="function"&&typeof h!="object"){if((r.mode&_t||$l)&&!(c._owner&&c._self&&c._owner.stateNode!==c._self)){var v=xe(r.type)||"Component";Nm[v]||(m('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h),Nm[v]=!0)}if(c._owner){var b=c._owner,w;if(b){var A=b;if(A.tag!==_)throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");w=A.stateNode}if(!w)throw Error("Missing owner for string ref "+h+". This error is likely caused by a bug in React. Please file an issue.");var D=""+h;if(s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===D)return s.ref;var F=function($){var X=w.refs;X===we&&(X=w.refs={}),$===null?delete X[D]:X[D]=$};return F._stringRef=D,F}else{if(typeof h!="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!c._owner)throw Error("Element ref was specified as a string ("+h+`) but no owner was set. This could happen for one of the following reasons:
115
+ `+Ce:""))}}}return h&&an(r,v,b),$}function Pm(r,s){var c=s.state;typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),c!==s.state&&(m("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",xe(r.type)||"Component"),et.enqueueReplaceState(s,s.state,null))}function WE(r,s,c,h){var v=s.state;if(typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==v){{var b=xe(r.type)||"Component";He.has(b)||(He.add(b),m("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",b))}et.enqueueReplaceState(s,s.state,null)}}function Dm(r,s,c,h){Cn(r,s,c);var v=r.stateNode;v.props=c,v.state=r.memoizedState,v.refs=we,ju(r);var b=s.contextType;if(typeof b=="object"&&b!==null)v.context=Ht(b);else{var w=as(r,s,!0);v.context=Ir(r,w)}{if(v.state===c){var A=xe(s)||"Component";V.has(A)||(V.add(A),m("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",A))}r.mode&_t&&Gi.recordLegacyContextWarning(r,v),Gi.recordUnsafeLifecycleWarnings(r,v)}d(r,c,v,h),v.state=r.memoizedState;var D=s.getDerivedStateFromProps;typeof D=="function"&&(It(r,s,D,c),v.state=r.memoizedState),typeof s.getDerivedStateFromProps!="function"&&typeof v.getSnapshotBeforeUpdate!="function"&&(typeof v.UNSAFE_componentWillMount=="function"||typeof v.componentWillMount=="function")&&(Pm(r,v),d(r,c,v,h),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=it)}function kD(r,s,c,h){var v=r.stateNode,b=r.memoizedProps;v.props=b;var w=v.context,A=s.contextType,D=fn;if(typeof A=="object"&&A!==null)D=Ht(A);else{var F=as(r,s,!0);D=Ir(r,F)}var $=s.getDerivedStateFromProps,X=typeof $=="function"||typeof v.getSnapshotBeforeUpdate=="function";!X&&(typeof v.UNSAFE_componentWillReceiveProps=="function"||typeof v.componentWillReceiveProps=="function")&&(b!==c||w!==D)&&WE(r,v,c,D),E();var J=r.memoizedState,pe=v.state=J;if(d(r,c,v,h),pe=r.memoizedState,b===c&&J===pe&&!qi()&&!C())return typeof v.componentDidMount=="function"&&(r.flags|=it),!1;typeof $=="function"&&(It(r,s,$,c),pe=r.memoizedState);var ye=C()||Mt(r,s,b,c,J,pe,D);return ye?(!X&&(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"&&(r.flags|=it)):(typeof v.componentDidMount=="function"&&(r.flags|=it),r.memoizedProps=c,r.memoizedState=pe),v.props=c,v.state=pe,v.context=D,ye}function ID(r,s,c,h,v){var b=s.stateNode;ll(r,s);var w=s.memoizedProps,A=s.type===s.elementType?w:cr(s.type,w);b.props=A;var D=s.pendingProps,F=b.context,$=c.contextType,X=fn;if(typeof $=="object"&&$!==null)X=Ht($);else{var J=as(s,c,!0);X=Ir(s,J)}var pe=c.getDerivedStateFromProps,ye=typeof pe=="function"||typeof b.getSnapshotBeforeUpdate=="function";!ye&&(typeof b.UNSAFE_componentWillReceiveProps=="function"||typeof b.componentWillReceiveProps=="function")&&(w!==D||F!==X)&&WE(s,b,h,X),E();var Ce=s.memoizedState,Ze=b.state=Ce;if(d(s,h,b,v),Ze=s.memoizedState,w===D&&Ce===Ze&&!qi()&&!C())return typeof b.componentDidUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=en),!1;typeof pe=="function"&&(It(s,c,pe,h),Ze=s.memoizedState);var bt=C()||Mt(s,c,A,h,Ce,Ze,X);return bt?(!ye&&(typeof b.UNSAFE_componentWillUpdate=="function"||typeof b.componentWillUpdate=="function")&&(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,Ze,X),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,Ze,X)),typeof b.componentDidUpdate=="function"&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=en)):(typeof b.componentDidUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=it),typeof b.getSnapshotBeforeUpdate=="function"&&(w!==r.memoizedProps||Ce!==r.memoizedState)&&(s.flags|=en),s.memoizedProps=h,s.memoizedState=Ze),b.props=h,b.state=Ze,b.context=X,bt}var km,Im,Nm,zm,Um,qE=function(r,s){};km=!1,Im=!1,Nm={},zm={},Um={},qE=function(r,s){if(!(r===null||typeof r!="object")&&!(!r._store||r._store.validated||r.key!=null)){if(typeof r._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");r._store.validated=!0;var c=xe(s.type)||"Component";zm[c]||(zm[c]=!0,m('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var wh=Array.isArray;function pf(r,s,c){var h=c.ref;if(h!==null&&typeof h!="function"&&typeof h!="object"){if((r.mode&_t||$l)&&!(c._owner&&c._self&&c._owner.stateNode!==c._self)){var v=xe(r.type)||"Component";Nm[v]||(m('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h),Nm[v]=!0)}if(c._owner){var b=c._owner,w;if(b){var A=b;if(A.tag!==_)throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");w=A.stateNode}if(!w)throw Error("Missing owner for string ref "+h+". This error is likely caused by a bug in React. Please file an issue.");var D=""+h;if(s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===D)return s.ref;var F=function($){var X=w.refs;X===we&&(X=w.refs={}),$===null?delete X[D]:X[D]=$};return F._stringRef=D,F}else{if(typeof h!="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!c._owner)throw Error("Element ref was specified as a string ("+h+`) but no owner was set. This could happen for one of the following reasons:
116
116
  1. You may be adding a ref to a function component
117
117
  2. You may be adding a ref to a component that was not created inside a component's render method
118
118
  3. You have multiple copies of React loaded
119
- See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return h}function Ch(r,s){if(r.type!=="textarea")throw Error("Objects are not valid as a React child (found: "+(Object.prototype.toString.call(s)==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}function Th(r){{var s=xe(r.type)||"Component";if(Um[s])return;Um[s]=!0,m("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function VE(r){function s(K,ae){if(r){var Y=K.lastEffect;Y!==null?(Y.nextEffect=ae,K.lastEffect=ae):K.firstEffect=K.lastEffect=ae,ae.nextEffect=null,ae.flags=De}}function c(K,ae){if(!r)return null;for(var Y=ae;Y!==null;)s(K,Y),Y=Y.sibling;return null}function h(K,ae){for(var Y=new Map,ve=ae;ve!==null;)ve.key!==null?Y.set(ve.key,ve):Y.set(ve.index,ve),ve=ve.sibling;return Y}function v(K,ae){var Y=wl(K,ae);return Y.index=0,Y.sibling=null,Y}function b(K,ae,Y){if(K.index=Y,!r)return ae;var ve=K.alternate;if(ve!==null){var Le=ve.index;return Le<ae?(K.flags=Pt,ae):Le}else return K.flags=Pt,ae}function w(K){return r&&K.alternate===null&&(K.flags=Pt),K}function A(K,ae,Y,ve){if(ae===null||ae.tag!==O){var Le=py(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y);return Ie.return=K,Ie}}function D(K,ae,Y,ve){if(ae!==null&&(ae.elementType===Y.type||Mw(ae,Y))){var Le=v(ae,Y.props);return Le.ref=pf(K,ae,Y),Le.return=K,Le._debugSource=Y._source,Le._debugOwner=Y._owner,Le}var Ie=dy(Y,K.mode,ve);return Ie.ref=pf(K,ae,Y),Ie.return=K,Ie}function F(K,ae,Y,ve){if(ae===null||ae.tag!==L||ae.stateNode.containerInfo!==Y.containerInfo||ae.stateNode.implementation!==Y.implementation){var Le=vy(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y.children||[]);return Ie.return=K,Ie}}function $(K,ae,Y,ve,Le){if(ae===null||ae.tag!==j){var Ie=Cl(Y,K.mode,ve,Le);return Ie.return=K,Ie}else{var xt=v(ae,Y);return xt.return=K,xt}}function X(K,ae,Y){if(typeof ae=="string"||typeof ae=="number"){var ve=py(""+ae,K.mode,Y);return ve.return=K,ve}if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case $e:{var Le=dy(ae,K.mode,Y);return Le.ref=pf(K,null,ae),Le.return=K,Le}case ht:{var Ie=vy(ae,K.mode,Y);return Ie.return=K,Ie}}if(wh(ae)||We(ae)){var xt=Cl(ae,K.mode,Y,null);return xt.return=K,xt}Ch(K,ae)}return typeof ae=="function"&&Th(K),null}function J(K,ae,Y,ve){var Le=ae!==null?ae.key:null;if(typeof Y=="string"||typeof Y=="number")return Le!==null?null:A(K,ae,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case $e:return Y.key===Le?Y.type===gt?$(K,ae,Y.props.children,ve,Le):D(K,ae,Y,ve):null;case ht:return Y.key===Le?F(K,ae,Y,ve):null}if(wh(Y)||We(Y))return Le!==null?null:$(K,ae,Y,ve,null);Ch(K,Y)}return typeof Y=="function"&&Th(K),null}function pe(K,ae,Y,ve,Le){if(typeof ve=="string"||typeof ve=="number"){var Ie=K.get(Y)||null;return A(ae,Ie,""+ve,Le)}if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case $e:{var xt=K.get(ve.key===null?Y:ve.key)||null;return ve.type===gt?$(ae,xt,ve.props.children,Le,ve.key):D(ae,xt,ve,Le)}case ht:{var rn=K.get(ve.key===null?Y:ve.key)||null;return F(ae,rn,ve,Le)}}if(wh(ve)||We(ve)){var hn=K.get(Y)||null;return $(ae,hn,ve,Le,null)}Ch(ae,ve)}return typeof ve=="function"&&Th(ae),null}function ye(K,ae,Y){{if(typeof K!="object"||K===null)return ae;switch(K.$$typeof){case $e:case ht:HE(K,Y);var ve=K.key;if(typeof ve!="string")break;if(ae===null){ae=new Set,ae.add(ve);break}if(!ae.has(ve)){ae.add(ve);break}m("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",ve);break}}return ae}function Ce(K,ae,Y,ve){for(var Le=null,Ie=0;Ie<Y.length;Ie++){var xt=Y[Ie];Le=ye(xt,Le,K)}for(var rn=null,hn=null,zt=ae,Nn=0,Lt=0,pn=null;zt!==null&&Lt<Y.length;Lt++){zt.index>Lt?(pn=zt,zt=null):pn=zt.sibling;var ti=J(K,zt,Y[Lt],ve);if(ti===null){zt===null&&(zt=pn);break}r&&zt&&ti.alternate===null&&s(K,zt),Nn=b(ti,Nn,Lt),hn===null?rn=ti:hn.sibling=ti,hn=ti,zt=pn}if(Lt===Y.length)return c(K,zt),rn;if(zt===null){for(;Lt<Y.length;Lt++){var Mn=X(K,Y[Lt],ve);Mn!==null&&(Nn=b(Mn,Nn,Lt),hn===null?rn=Mn:hn.sibling=Mn,hn=Mn)}return rn}for(var bs=h(K,zt);Lt<Y.length;Lt++){var On=pe(bs,K,Lt,Y[Lt],ve);On!==null&&(r&&On.alternate!==null&&bs.delete(On.key===null?Lt:On.key),Nn=b(On,Nn,Lt),hn===null?rn=On:hn.sibling=On,hn=On)}return r&&bs.forEach(function(Es){return s(K,Es)}),rn}function Ze(K,ae,Y,ve){var Le=We(Y);if(typeof Le!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Y[Symbol.toStringTag]==="Generator"&&(Im||m("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Im=!0),Y.entries===Le&&(km||m("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),km=!0);var Ie=Le.call(Y);if(Ie)for(var xt=null,rn=Ie.next();!rn.done;rn=Ie.next()){var hn=rn.value;xt=ye(hn,xt,K)}}var zt=Le.call(Y);if(zt==null)throw Error("An iterable object provided no iterator.");for(var Nn=null,Lt=null,pn=ae,ti=0,Mn=0,bs=null,On=zt.next();pn!==null&&!On.done;Mn++,On=zt.next()){pn.index>Mn?(bs=pn,pn=null):bs=pn.sibling;var Es=J(K,pn,On.value,ve);if(Es===null){pn===null&&(pn=bs);break}r&&pn&&Es.alternate===null&&s(K,pn),ti=b(Es,ti,Mn),Lt===null?Nn=Es:Lt.sibling=Es,Lt=Es,pn=bs}if(On.done)return c(K,pn),Nn;if(pn===null){for(;!On.done;Mn++,On=zt.next()){var Tl=X(K,On.value,ve);Tl!==null&&(ti=b(Tl,ti,Mn),Lt===null?Nn=Tl:Lt.sibling=Tl,Lt=Tl)}return Nn}for(var Sy=h(K,pn);!On.done;Mn++,On=zt.next()){var Xa=pe(Sy,K,Mn,On.value,ve);Xa!==null&&(r&&Xa.alternate!==null&&Sy.delete(Xa.key===null?Mn:Xa.key),ti=b(Xa,ti,Mn),Lt===null?Nn=Xa:Lt.sibling=Xa,Lt=Xa)}return r&&Sy.forEach(function(IN){return s(K,IN)}),Nn}function bt(K,ae,Y,ve){if(ae!==null&&ae.tag===O){c(K,ae.sibling);var Le=v(ae,Y);return Le.return=K,Le}c(K,ae);var Ie=py(Y,K.mode,ve);return Ie.return=K,Ie}function st(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le){switch(Ie.tag){case j:{if(Y.type===gt){c(K,Ie.sibling);var xt=v(Ie,Y.props.children);return xt.return=K,xt._debugSource=Y._source,xt._debugOwner=Y._owner,xt}break}case me:default:{if(Ie.elementType===Y.type||Mw(Ie,Y)){c(K,Ie.sibling);var rn=v(Ie,Y.props);return rn.ref=pf(K,Ie,Y),rn.return=K,rn._debugSource=Y._source,rn._debugOwner=Y._owner,rn}break}}c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}if(Y.type===gt){var hn=Cl(Y.props.children,K.mode,ve,Y.key);return hn.return=K,hn}else{var zt=dy(Y,K.mode,ve);return zt.ref=pf(K,ae,Y),zt.return=K,zt}}function Jt(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le)if(Ie.tag===L&&Ie.stateNode.containerInfo===Y.containerInfo&&Ie.stateNode.implementation===Y.implementation){c(K,Ie.sibling);var xt=v(Ie,Y.children||[]);return xt.return=K,xt}else{c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}var rn=vy(Y,K.mode,ve);return rn.return=K,rn}function Rn(K,ae,Y,ve){var Le=typeof Y=="object"&&Y!==null&&Y.type===gt&&Y.key===null;Le&&(Y=Y.props.children);var Ie=typeof Y=="object"&&Y!==null;if(Ie)switch(Y.$$typeof){case $e:return w(st(K,ae,Y,ve));case ht:return w(Jt(K,ae,Y,ve))}if(typeof Y=="string"||typeof Y=="number")return w(bt(K,ae,""+Y,ve));if(wh(Y))return Ce(K,ae,Y,ve);if(We(Y))return Ze(K,ae,Y,ve);if(Ie&&Ch(K,Y),typeof Y=="function"&&Th(K),typeof Y>"u"&&!Le)switch(K.tag){case _:{var xt=K.stateNode;if(xt.render._isMockFunction)break}case me:case T:case Z:case ge:throw Error((xe(K.type)||"Component")+"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.")}return c(K,ae)}return Rn}var Rh=VE(!0),$E=VE(!1);function ID(r,s){if(!(r===null||s.child===r.child))throw Error("Resuming work not yet implemented.");if(s.child!==null){var c=s.child,h=wl(c,c.pendingProps);for(s.child=h,h.return=s;c.sibling!==null;)c=c.sibling,h=h.sibling=wl(c,c.pendingProps),h.return=s;h.sibling=null}}function ND(r,s){for(var c=r.child;c!==null;)uN(c,s),c=c.sibling}var vf={},Va=Wi(vf),mf=Wi(vf),Ah=Wi(vf);function Mh(r){if(r===vf)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return r}function jm(){var r=Mh(Ah.current);return r}function Fm(r,s){En(Ah,s,r),En(mf,r,r),En(Va,vf,r);var c=Ct(s);Ft(Va,r),En(Va,c,r)}function Fu(r){Ft(Va,r),Ft(mf,r),Ft(Ah,r)}function gf(){var r=Mh(Va.current);return r}function WE(r){var s=Mh(Ah.current),c=Mh(Va.current),h=Ot(c,r.type,s);c!==h&&(En(mf,r,r),En(Va,h,r))}function Bm(r){mf.current===r&&(Ft(Va,r),Ft(mf,r))}var zD=0,qE=1,Hm=1,yf=2,$r=Wi(zD);function Oh(r,s){return(r&s)!==0}function Sf(r){return r&qE}function Vm(r,s){return r&qE|s}function UD(r,s){return r|s}function ul(r,s){En($r,s,r)}function Bu(r){Ft($r,r)}function jD(r,s){var c=r.memoizedState;if(c!==null)return c.dehydrated!==null;var h=r.memoizedProps;return h.fallback===void 0?!1:h.unstable_avoidThisFallback!==!0?!0:!s}function _h(r){for(var s=r;s!==null;){if(s.tag===W){var c=s.memoizedState;if(c!==null){var h=c.dehydrated;if(h===null||Jl(h)||Bc(h))return s}}else if(s.tag===je&&s.memoizedProps.revealOrder!==void 0){var v=(s.flags&rt)!==ct;if(v)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)return null;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var $m=0,cl=1,fl=2,bf=4,xr=null,dl=null,$a=!1;function FD(r){if(!tn)return!1;var s=r.stateNode.containerInfo;return dl=Dn(s),xr=r,$a=!0,!0}function YE(r,s){switch(r.tag){case k:xm(r.stateNode.containerInfo,s);break;case P:Vi(r.type,r.memoizedProps,r.stateNode,s);break}var c=vN();c.stateNode=s,c.return=r,c.flags=De,r.lastEffect!==null?(r.lastEffect.nextEffect=c,r.lastEffect=c):r.firstEffect=r.lastEffect=c}function QE(r,s){switch(s.flags=s.flags&~Ri|Pt,r.tag){case k:{var c=r.stateNode.containerInfo;switch(s.tag){case P:var h=s.type,v=s.pendingProps;wm(c,h,v);break;case O:var b=s.pendingProps;tu(c,b);break;case W:Cm(c);break}break}case P:{var w=r.type,A=r.memoizedProps,D=r.stateNode;switch(s.tag){case P:var F=s.type,$=s.pendingProps;rr(w,A,D,F,$);break;case O:var X=s.pendingProps;nu(w,A,D,X);break;case W:iu(w,A,D);break}break}default:return}}function GE(r,s){switch(r.tag){case P:{var c=r.type,h=r.pendingProps,v=bm(s,c,h);return v!==null?(r.stateNode=v,!0):!1}case O:{var b=r.pendingProps,w=Lr(s,b);return w!==null?(r.stateNode=w,!0):!1}case W:return!1;default:return!1}}function Wm(r){if($a){var s=dl;if(!s){QE(xr,r),$a=!1,xr=r;return}var c=s;if(!GE(r,s)){if(s=eu(c),!s||!GE(r,s)){QE(xr,r),$a=!1,xr=r;return}YE(xr,c)}xr=r,dl=Dn(s)}}function BD(r,s,c){if(!tn)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var h=r.stateNode,v=wa(h,r.type,r.memoizedProps,s,c,r);return r.updateQueue=v,v!==null}function HD(r){if(!tn)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.stateNode,c=r.memoizedProps,h=sh(s,c,r);if(h){var v=xr;if(v!==null)switch(v.tag){case k:{var b=v.stateNode.containerInfo;ah(b,s,c);break}case P:{var w=v.type,A=v.memoizedProps,D=v.stateNode;Em(w,A,D,s,c);break}}}return h}function VD(r){if(!tn)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.memoizedState,c=s!==null?s.dehydrated:null;if(!c)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return Pr(c)}function XE(r){for(var s=r.return;s!==null&&s.tag!==P&&s.tag!==k&&s.tag!==W;)s=s.return;xr=s}function Lh(r){if(!tn||r!==xr)return!1;if(!$a)return XE(r),$a=!0,!1;var s=r.type;if(r.tag!==P||s!=="head"&&s!=="body"&&!ii(s,r.memoizedProps))for(var c=dl;c;)YE(r,c),c=eu(c);return XE(r),r.tag===W?dl=VD(r):dl=xr?eu(r.stateNode):null,!0}function qm(){tn&&(xr=null,dl=null,$a=!1)}function Ym(){return $a}var Ef=[],xf;xf={};function $D(r){Ef.push(r)}function Qm(){for(var r=0;r<Ef.length;r++){var s=Ef[r];cn?s._workInProgressVersionPrimary=null:s._workInProgressVersionSecondary=null}Ef.length=0}function WD(r){return cn?r._workInProgressVersionPrimary:r._workInProgressVersionSecondary}function KE(r,s){cn?r._workInProgressVersionPrimary=s:r._workInProgressVersionSecondary=s,Ef.push(r)}function qD(r){cn?r._currentPrimaryRenderer==null?r._currentPrimaryRenderer=xf:r._currentPrimaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."):r._currentSecondaryRenderer==null?r._currentSecondaryRenderer=xf:r._currentSecondaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.")}var Oe=g.ReactCurrentDispatcher,wr=g.ReactCurrentBatchConfig,Gm,Xm;Xm={},Gm=new Set;var wf=le,Zt=null,bi=null,ei=null,Ph=!1,Cf=!1,YD=25,ue=null,Cr=null,Wa=-1,Km=!1;function Gt(){{var r=ue;Cr===null?Cr=[r]:Cr.push(r)}}function Pe(){{var r=ue;Cr!==null&&(Wa++,Cr[Wa]!==r&&QD(r))}}function Tf(r){r!=null&&!Array.isArray(r)&&m("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",ue,typeof r)}function QD(r){{var s=xe(Zt.type);if(!Gm.has(s)&&(Gm.add(s),Cr!==null)){for(var c="",h=30,v=0;v<=Wa;v++){for(var b=Cr[v],w=v===Wa?r:b,A=v+1+". "+b;A.length<h;)A+=" ";A+=w+`
119
+ See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return h}function Ch(r,s){if(r.type!=="textarea")throw Error("Objects are not valid as a React child (found: "+(Object.prototype.toString.call(s)==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}function Th(r){{var s=xe(r.type)||"Component";if(Um[s])return;Um[s]=!0,m("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function YE(r){function s(K,ae){if(r){var Y=K.lastEffect;Y!==null?(Y.nextEffect=ae,K.lastEffect=ae):K.firstEffect=K.lastEffect=ae,ae.nextEffect=null,ae.flags=De}}function c(K,ae){if(!r)return null;for(var Y=ae;Y!==null;)s(K,Y),Y=Y.sibling;return null}function h(K,ae){for(var Y=new Map,ve=ae;ve!==null;)ve.key!==null?Y.set(ve.key,ve):Y.set(ve.index,ve),ve=ve.sibling;return Y}function v(K,ae){var Y=wl(K,ae);return Y.index=0,Y.sibling=null,Y}function b(K,ae,Y){if(K.index=Y,!r)return ae;var ve=K.alternate;if(ve!==null){var Le=ve.index;return Le<ae?(K.flags=Pt,ae):Le}else return K.flags=Pt,ae}function w(K){return r&&K.alternate===null&&(K.flags=Pt),K}function A(K,ae,Y,ve){if(ae===null||ae.tag!==O){var Le=py(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y);return Ie.return=K,Ie}}function D(K,ae,Y,ve){if(ae!==null&&(ae.elementType===Y.type||Pw(ae,Y))){var Le=v(ae,Y.props);return Le.ref=pf(K,ae,Y),Le.return=K,Le._debugSource=Y._source,Le._debugOwner=Y._owner,Le}var Ie=dy(Y,K.mode,ve);return Ie.ref=pf(K,ae,Y),Ie.return=K,Ie}function F(K,ae,Y,ve){if(ae===null||ae.tag!==L||ae.stateNode.containerInfo!==Y.containerInfo||ae.stateNode.implementation!==Y.implementation){var Le=vy(Y,K.mode,ve);return Le.return=K,Le}else{var Ie=v(ae,Y.children||[]);return Ie.return=K,Ie}}function $(K,ae,Y,ve,Le){if(ae===null||ae.tag!==j){var Ie=Cl(Y,K.mode,ve,Le);return Ie.return=K,Ie}else{var xt=v(ae,Y);return xt.return=K,xt}}function X(K,ae,Y){if(typeof ae=="string"||typeof ae=="number"){var ve=py(""+ae,K.mode,Y);return ve.return=K,ve}if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case $e:{var Le=dy(ae,K.mode,Y);return Le.ref=pf(K,null,ae),Le.return=K,Le}case ht:{var Ie=vy(ae,K.mode,Y);return Ie.return=K,Ie}}if(wh(ae)||We(ae)){var xt=Cl(ae,K.mode,Y,null);return xt.return=K,xt}Ch(K,ae)}return typeof ae=="function"&&Th(K),null}function J(K,ae,Y,ve){var Le=ae!==null?ae.key:null;if(typeof Y=="string"||typeof Y=="number")return Le!==null?null:A(K,ae,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case $e:return Y.key===Le?Y.type===gt?$(K,ae,Y.props.children,ve,Le):D(K,ae,Y,ve):null;case ht:return Y.key===Le?F(K,ae,Y,ve):null}if(wh(Y)||We(Y))return Le!==null?null:$(K,ae,Y,ve,null);Ch(K,Y)}return typeof Y=="function"&&Th(K),null}function pe(K,ae,Y,ve,Le){if(typeof ve=="string"||typeof ve=="number"){var Ie=K.get(Y)||null;return A(ae,Ie,""+ve,Le)}if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case $e:{var xt=K.get(ve.key===null?Y:ve.key)||null;return ve.type===gt?$(ae,xt,ve.props.children,Le,ve.key):D(ae,xt,ve,Le)}case ht:{var rn=K.get(ve.key===null?Y:ve.key)||null;return F(ae,rn,ve,Le)}}if(wh(ve)||We(ve)){var hn=K.get(Y)||null;return $(ae,hn,ve,Le,null)}Ch(ae,ve)}return typeof ve=="function"&&Th(ae),null}function ye(K,ae,Y){{if(typeof K!="object"||K===null)return ae;switch(K.$$typeof){case $e:case ht:qE(K,Y);var ve=K.key;if(typeof ve!="string")break;if(ae===null){ae=new Set,ae.add(ve);break}if(!ae.has(ve)){ae.add(ve);break}m("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",ve);break}}return ae}function Ce(K,ae,Y,ve){for(var Le=null,Ie=0;Ie<Y.length;Ie++){var xt=Y[Ie];Le=ye(xt,Le,K)}for(var rn=null,hn=null,zt=ae,Nn=0,Lt=0,pn=null;zt!==null&&Lt<Y.length;Lt++){zt.index>Lt?(pn=zt,zt=null):pn=zt.sibling;var ti=J(K,zt,Y[Lt],ve);if(ti===null){zt===null&&(zt=pn);break}r&&zt&&ti.alternate===null&&s(K,zt),Nn=b(ti,Nn,Lt),hn===null?rn=ti:hn.sibling=ti,hn=ti,zt=pn}if(Lt===Y.length)return c(K,zt),rn;if(zt===null){for(;Lt<Y.length;Lt++){var Mn=X(K,Y[Lt],ve);Mn!==null&&(Nn=b(Mn,Nn,Lt),hn===null?rn=Mn:hn.sibling=Mn,hn=Mn)}return rn}for(var bs=h(K,zt);Lt<Y.length;Lt++){var On=pe(bs,K,Lt,Y[Lt],ve);On!==null&&(r&&On.alternate!==null&&bs.delete(On.key===null?Lt:On.key),Nn=b(On,Nn,Lt),hn===null?rn=On:hn.sibling=On,hn=On)}return r&&bs.forEach(function(Es){return s(K,Es)}),rn}function Ze(K,ae,Y,ve){var Le=We(Y);if(typeof Le!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Y[Symbol.toStringTag]==="Generator"&&(Im||m("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Im=!0),Y.entries===Le&&(km||m("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),km=!0);var Ie=Le.call(Y);if(Ie)for(var xt=null,rn=Ie.next();!rn.done;rn=Ie.next()){var hn=rn.value;xt=ye(hn,xt,K)}}var zt=Le.call(Y);if(zt==null)throw Error("An iterable object provided no iterator.");for(var Nn=null,Lt=null,pn=ae,ti=0,Mn=0,bs=null,On=zt.next();pn!==null&&!On.done;Mn++,On=zt.next()){pn.index>Mn?(bs=pn,pn=null):bs=pn.sibling;var Es=J(K,pn,On.value,ve);if(Es===null){pn===null&&(pn=bs);break}r&&pn&&Es.alternate===null&&s(K,pn),ti=b(Es,ti,Mn),Lt===null?Nn=Es:Lt.sibling=Es,Lt=Es,pn=bs}if(On.done)return c(K,pn),Nn;if(pn===null){for(;!On.done;Mn++,On=zt.next()){var Tl=X(K,On.value,ve);Tl!==null&&(ti=b(Tl,ti,Mn),Lt===null?Nn=Tl:Lt.sibling=Tl,Lt=Tl)}return Nn}for(var Sy=h(K,pn);!On.done;Mn++,On=zt.next()){var Xa=pe(Sy,K,Mn,On.value,ve);Xa!==null&&(r&&Xa.alternate!==null&&Sy.delete(Xa.key===null?Mn:Xa.key),ti=b(Xa,ti,Mn),Lt===null?Nn=Xa:Lt.sibling=Xa,Lt=Xa)}return r&&Sy.forEach(function(NN){return s(K,NN)}),Nn}function bt(K,ae,Y,ve){if(ae!==null&&ae.tag===O){c(K,ae.sibling);var Le=v(ae,Y);return Le.return=K,Le}c(K,ae);var Ie=py(Y,K.mode,ve);return Ie.return=K,Ie}function st(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le){switch(Ie.tag){case j:{if(Y.type===gt){c(K,Ie.sibling);var xt=v(Ie,Y.props.children);return xt.return=K,xt._debugSource=Y._source,xt._debugOwner=Y._owner,xt}break}case me:default:{if(Ie.elementType===Y.type||Pw(Ie,Y)){c(K,Ie.sibling);var rn=v(Ie,Y.props);return rn.ref=pf(K,Ie,Y),rn.return=K,rn._debugSource=Y._source,rn._debugOwner=Y._owner,rn}break}}c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}if(Y.type===gt){var hn=Cl(Y.props.children,K.mode,ve,Y.key);return hn.return=K,hn}else{var zt=dy(Y,K.mode,ve);return zt.ref=pf(K,ae,Y),zt.return=K,zt}}function Jt(K,ae,Y,ve){for(var Le=Y.key,Ie=ae;Ie!==null;){if(Ie.key===Le)if(Ie.tag===L&&Ie.stateNode.containerInfo===Y.containerInfo&&Ie.stateNode.implementation===Y.implementation){c(K,Ie.sibling);var xt=v(Ie,Y.children||[]);return xt.return=K,xt}else{c(K,Ie);break}else s(K,Ie);Ie=Ie.sibling}var rn=vy(Y,K.mode,ve);return rn.return=K,rn}function Rn(K,ae,Y,ve){var Le=typeof Y=="object"&&Y!==null&&Y.type===gt&&Y.key===null;Le&&(Y=Y.props.children);var Ie=typeof Y=="object"&&Y!==null;if(Ie)switch(Y.$$typeof){case $e:return w(st(K,ae,Y,ve));case ht:return w(Jt(K,ae,Y,ve))}if(typeof Y=="string"||typeof Y=="number")return w(bt(K,ae,""+Y,ve));if(wh(Y))return Ce(K,ae,Y,ve);if(We(Y))return Ze(K,ae,Y,ve);if(Ie&&Ch(K,Y),typeof Y=="function"&&Th(K),typeof Y>"u"&&!Le)switch(K.tag){case _:{var xt=K.stateNode;if(xt.render._isMockFunction)break}case me:case R:case Z:case ge:throw Error((xe(K.type)||"Component")+"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.")}return c(K,ae)}return Rn}var Rh=YE(!0),QE=YE(!1);function ND(r,s){if(!(r===null||s.child===r.child))throw Error("Resuming work not yet implemented.");if(s.child!==null){var c=s.child,h=wl(c,c.pendingProps);for(s.child=h,h.return=s;c.sibling!==null;)c=c.sibling,h=h.sibling=wl(c,c.pendingProps),h.return=s;h.sibling=null}}function zD(r,s){for(var c=r.child;c!==null;)cN(c,s),c=c.sibling}var vf={},Va=Wi(vf),mf=Wi(vf),Ah=Wi(vf);function Mh(r){if(r===vf)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return r}function jm(){var r=Mh(Ah.current);return r}function Fm(r,s){En(Ah,s,r),En(mf,r,r),En(Va,vf,r);var c=Ct(s);Ft(Va,r),En(Va,c,r)}function Fu(r){Ft(Va,r),Ft(mf,r),Ft(Ah,r)}function gf(){var r=Mh(Va.current);return r}function GE(r){var s=Mh(Ah.current),c=Mh(Va.current),h=Ot(c,r.type,s);c!==h&&(En(mf,r,r),En(Va,h,r))}function Bm(r){mf.current===r&&(Ft(Va,r),Ft(mf,r))}var UD=0,XE=1,Hm=1,yf=2,$r=Wi(UD);function Oh(r,s){return(r&s)!==0}function Sf(r){return r&XE}function Vm(r,s){return r&XE|s}function jD(r,s){return r|s}function ul(r,s){En($r,s,r)}function Bu(r){Ft($r,r)}function FD(r,s){var c=r.memoizedState;if(c!==null)return c.dehydrated!==null;var h=r.memoizedProps;return h.fallback===void 0?!1:h.unstable_avoidThisFallback!==!0?!0:!s}function _h(r){for(var s=r;s!==null;){if(s.tag===W){var c=s.memoizedState;if(c!==null){var h=c.dehydrated;if(h===null||Jl(h)||Bc(h))return s}}else if(s.tag===je&&s.memoizedProps.revealOrder!==void 0){var v=(s.flags&rt)!==ct;if(v)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)return null;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var $m=0,cl=1,fl=2,bf=4,xr=null,dl=null,$a=!1;function BD(r){if(!tn)return!1;var s=r.stateNode.containerInfo;return dl=Dn(s),xr=r,$a=!0,!0}function KE(r,s){switch(r.tag){case k:xm(r.stateNode.containerInfo,s);break;case P:Vi(r.type,r.memoizedProps,r.stateNode,s);break}var c=mN();c.stateNode=s,c.return=r,c.flags=De,r.lastEffect!==null?(r.lastEffect.nextEffect=c,r.lastEffect=c):r.firstEffect=r.lastEffect=c}function ZE(r,s){switch(s.flags=s.flags&~Ri|Pt,r.tag){case k:{var c=r.stateNode.containerInfo;switch(s.tag){case P:var h=s.type,v=s.pendingProps;wm(c,h,v);break;case O:var b=s.pendingProps;tu(c,b);break;case W:Cm(c);break}break}case P:{var w=r.type,A=r.memoizedProps,D=r.stateNode;switch(s.tag){case P:var F=s.type,$=s.pendingProps;rr(w,A,D,F,$);break;case O:var X=s.pendingProps;nu(w,A,D,X);break;case W:iu(w,A,D);break}break}default:return}}function JE(r,s){switch(r.tag){case P:{var c=r.type,h=r.pendingProps,v=bm(s,c,h);return v!==null?(r.stateNode=v,!0):!1}case O:{var b=r.pendingProps,w=Lr(s,b);return w!==null?(r.stateNode=w,!0):!1}case W:return!1;default:return!1}}function Wm(r){if($a){var s=dl;if(!s){ZE(xr,r),$a=!1,xr=r;return}var c=s;if(!JE(r,s)){if(s=eu(c),!s||!JE(r,s)){ZE(xr,r),$a=!1,xr=r;return}KE(xr,c)}xr=r,dl=Dn(s)}}function HD(r,s,c){if(!tn)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var h=r.stateNode,v=wa(h,r.type,r.memoizedProps,s,c,r);return r.updateQueue=v,v!==null}function VD(r){if(!tn)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.stateNode,c=r.memoizedProps,h=sh(s,c,r);if(h){var v=xr;if(v!==null)switch(v.tag){case k:{var b=v.stateNode.containerInfo;ah(b,s,c);break}case P:{var w=v.type,A=v.memoizedProps,D=v.stateNode;Em(w,A,D,s,c);break}}}return h}function $D(r){if(!tn)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var s=r.memoizedState,c=s!==null?s.dehydrated:null;if(!c)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return Pr(c)}function ex(r){for(var s=r.return;s!==null&&s.tag!==P&&s.tag!==k&&s.tag!==W;)s=s.return;xr=s}function Lh(r){if(!tn||r!==xr)return!1;if(!$a)return ex(r),$a=!0,!1;var s=r.type;if(r.tag!==P||s!=="head"&&s!=="body"&&!ii(s,r.memoizedProps))for(var c=dl;c;)KE(r,c),c=eu(c);return ex(r),r.tag===W?dl=$D(r):dl=xr?eu(r.stateNode):null,!0}function qm(){tn&&(xr=null,dl=null,$a=!1)}function Ym(){return $a}var Ef=[],xf;xf={};function WD(r){Ef.push(r)}function Qm(){for(var r=0;r<Ef.length;r++){var s=Ef[r];cn?s._workInProgressVersionPrimary=null:s._workInProgressVersionSecondary=null}Ef.length=0}function qD(r){return cn?r._workInProgressVersionPrimary:r._workInProgressVersionSecondary}function tx(r,s){cn?r._workInProgressVersionPrimary=s:r._workInProgressVersionSecondary=s,Ef.push(r)}function YD(r){cn?r._currentPrimaryRenderer==null?r._currentPrimaryRenderer=xf:r._currentPrimaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."):r._currentSecondaryRenderer==null?r._currentSecondaryRenderer=xf:r._currentSecondaryRenderer!==xf&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.")}var Oe=g.ReactCurrentDispatcher,wr=g.ReactCurrentBatchConfig,Gm,Xm;Xm={},Gm=new Set;var wf=le,Zt=null,bi=null,ei=null,Ph=!1,Cf=!1,QD=25,ue=null,Cr=null,Wa=-1,Km=!1;function Gt(){{var r=ue;Cr===null?Cr=[r]:Cr.push(r)}}function Pe(){{var r=ue;Cr!==null&&(Wa++,Cr[Wa]!==r&&GD(r))}}function Tf(r){r!=null&&!Array.isArray(r)&&m("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",ue,typeof r)}function GD(r){{var s=xe(Zt.type);if(!Gm.has(s)&&(Gm.add(s),Cr!==null)){for(var c="",h=30,v=0;v<=Wa;v++){for(var b=Cr[v],w=v===Wa?r:b,A=v+1+". "+b;A.length<h;)A+=" ";A+=w+`
120
120
  `,c+=A}m(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
121
121
 
122
122
  Previous render Next render
@@ -129,15 +129,15 @@ See https://reactjs.org/link/refs-must-have-owner for more information.`)}}retur
129
129
  See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function Zm(r,s){if(Km)return!1;if(s===null)return m("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",ue),!1;r.length!==s.length&&m(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
130
130
 
131
131
  Previous: %s
132
- Incoming: %s`,ue,"["+s.join(", ")+"]","["+r.join(", ")+"]");for(var c=0;c<s.length&&c<r.length;c++)if(!An(r[c],s[c]))return!1;return!0}function Hu(r,s,c,h,v,b){wf=b,Zt=s,Cr=r!==null?r._debugHookTypes:null,Wa=-1,Km=r!==null&&r.type!==s.type,s.memoizedState=null,s.updateQueue=null,s.lanes=le,r!==null&&r.memoizedState!==null?Oe.current=dx:Cr!==null?Oe.current=fx:Oe.current=cx;var w=c(h,v);if(Cf){var A=0;do{if(Cf=!1,!(A<YD))throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");A+=1,Km=!1,bi=null,ei=null,s.updateQueue=null,Wa=-1,Oe.current=hx,w=c(h,v)}while(Cf)}Oe.current=$h,s._debugHookTypes=Cr;var D=bi!==null&&bi.next!==null;if(wf=le,Zt=null,bi=null,ei=null,ue=null,Cr=null,Wa=-1,Ph=!1,D)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return w}function ZE(r,s,c){s.updateQueue=r.updateQueue,s.flags&=~(Wn|it),r.lanes=Uo(r.lanes,c)}function JE(){if(Oe.current=$h,Ph){for(var r=Zt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ph=!1}wf=le,Zt=null,bi=null,ei=null,Cr=null,Wa=-1,ue=null,Vh=!1,Cf=!1}function hl(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Zt.memoizedState=ei=r:ei=ei.next=r,ei}function pl(){var r;if(bi===null){var s=Zt.alternate;s!==null?r=s.memoizedState:r=null}else r=bi.next;var c;if(ei===null?c=Zt.memoizedState:c=ei.next,c!==null)ei=c,c=ei.next,bi=r;else{if(r===null)throw Error("Rendered more hooks than during the previous render.");bi=r;var h={memoizedState:bi.memoizedState,baseState:bi.baseState,baseQueue:bi.baseQueue,queue:bi.queue,next:null};ei===null?Zt.memoizedState=ei=h:ei=ei.next=h}return ei}function GD(){return{lastEffect:null}}function Dh(r,s){return typeof s=="function"?s(r):s}function Jm(r,s,c){var h=hl(),v;c!==void 0?v=c(s):v=s,h.memoizedState=h.baseState=v;var b=h.queue={pending:null,dispatch:null,lastRenderedReducer:r,lastRenderedState:v},w=b.dispatch=dg.bind(null,Zt,b);return[h.memoizedState,w]}function eg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=bi,w=b.baseQueue,A=v.pending;if(A!==null){if(w!==null){var D=w.next,F=A.next;w.next=F,A.next=D}b.baseQueue!==w&&m("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),b.baseQueue=w=A,v.pending=null}if(w!==null){var $=w.next,X=b.baseState,J=null,pe=null,ye=null,Ce=$;do{var Ze=Ce.lane;if(fs(wf,Ze)){if(ye!==null){var st={lane:Gn,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye=ye.next=st}if(Ce.eagerReducer===r)X=Ce.eagerState;else{var Jt=Ce.action;X=r(X,Jt)}}else{var bt={lane:Ze,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye===null?(pe=ye=bt,J=X):ye=ye.next=bt,Zt.lanes=At(Zt.lanes,Ze),Zg(Ze)}Ce=Ce.next}while(Ce!==null&&Ce!==$);ye===null?J=X:ye.next=pe,An(X,h.memoizedState)||Rg(),h.memoizedState=X,h.baseState=J,h.baseQueue=ye,v.lastRenderedState=X}var Rn=v.dispatch;return[h.memoizedState,Rn]}function tg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=v.dispatch,w=v.pending,A=h.memoizedState;if(w!==null){v.pending=null;var D=w.next,F=D;do{var $=F.action;A=r(A,$),F=F.next}while(F!==D);An(A,h.memoizedState)||Rg(),h.memoizedState=A,h.baseQueue===null&&(h.baseState=A),v.lastRenderedState=A}return[A,b]}function ex(r,s,c){qD(s);var h=s._getVersion,v=h(s._source),b=!1,w=WD(s);if(w!==null?b=w===v:(b=fs(wf,r.mutableReadLanes),b&&KE(s,v)),b){var A=c(s._source);return typeof A=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),A}else throw $D(s),Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.")}function tx(r,s,c,h){var v=cI();if(v===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");var b=s._getVersion,w=b(s._source),A=Oe.current,D=A.useState(function(){return ex(v,s,c)}),F=D[0],$=D[1],X=F,J=ei,pe=r.memoizedState,ye=pe.refs,Ce=ye.getSnapshot,Ze=pe.source,bt=pe.subscribe,st=Zt;if(r.memoizedState={refs:ye,source:s,subscribe:h},A.useEffect(function(){ye.getSnapshot=c,ye.setSnapshot=$;var Rn=b(s._source);if(!An(w,Rn)){var K=c(s._source);if(typeof K=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),!An(X,K)){$(K);var ae=Ya(st);Fo(v,ae)}Mu(v,v.mutableReadLanes)}},[c,s,h]),A.useEffect(function(){var Rn=function(){var ae=ye.getSnapshot,Y=ye.setSnapshot;try{Y(ae(s._source));var ve=Ya(st);Fo(v,ve)}catch(Le){Y(function(){throw Le})}},K=h(s._source,Rn);return typeof K!="function"&&m("Mutable source subscribe function must return an unsubscribe function."),K},[s,h]),!An(Ce,c)||!An(Ze,s)||!An(bt,h)){var Jt={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:X};Jt.dispatch=$=dg.bind(null,Zt,Jt),J.queue=Jt,J.baseQueue=null,X=ex(v,s,c),J.memoizedState=J.baseState=X}return X}function ng(r,s,c){var h=hl();return h.memoizedState={refs:{getSnapshot:s,setSnapshot:null},source:r,subscribe:c},tx(h,r,s,c)}function kh(r,s,c){var h=pl();return tx(h,r,s,c)}function vl(r){var s=hl();typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r;var c=s.queue={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:r},h=c.dispatch=dg.bind(null,Zt,c);return[s.memoizedState,h]}function Rf(r){return eg(Dh)}function Af(r){return tg(Dh)}function Ih(r,s,c,h){var v={tag:r,create:s,destroy:c,deps:h,next:null},b=Zt.updateQueue;if(b===null)b=GD(),Zt.updateQueue=b,b.lastEffect=v.next=v;else{var w=b.lastEffect;if(w===null)b.lastEffect=v.next=v;else{var A=w.next;w.next=v,v.next=A,b.lastEffect=v}}return v}function Nh(r){var s=hl(),c={current:r};return Object.seal(c),s.memoizedState=c,c}function Vu(r){var s=pl();return s.memoizedState}function ig(r,s,c,h){var v=hl(),b=h===void 0?null:h;Zt.flags|=r,v.memoizedState=Ih(cl|s,c,void 0,b)}function rg(r,s,c,h){var v=pl(),b=h===void 0?null:h,w=void 0;if(bi!==null){var A=bi.memoizedState;if(w=A.destroy,b!==null){var D=A.deps;if(Zm(b,D)){Ih(s,c,w,b);return}}}Zt.flags|=r,v.memoizedState=Ih(cl|s,c,w,b)}function zh(r,s){return typeof jest<"u"&&Sw(Zt),ig(it|Wn,bf,r,s)}function $u(r,s){return typeof jest<"u"&&Sw(Zt),rg(it|Wn,bf,r,s)}function sg(r,s){return ig(it,fl,r,s)}function Uh(r,s){return rg(it,fl,r,s)}function nx(r,s){if(typeof s=="function"){var c=s,h=r();return c(h),function(){c(null)}}else if(s!=null){var v=s;v.hasOwnProperty("current")||m("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(v).join(", ")+"}");var b=r();return v.current=b,function(){v.current=null}}}function ag(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return ig(it,fl,nx.bind(null,s,r),h)}function jh(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return rg(it,fl,nx.bind(null,s,r),h)}function XD(r,s){}var Fh=XD;function og(r,s){var c=hl(),h=s===void 0?null:s;return c.memoizedState=[r,h],r}function Bh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}return c.memoizedState=[r,h],r}function lg(r,s){var c=hl(),h=s===void 0?null:s,v=r();return c.memoizedState=[v,h],v}function Hh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}var w=r();return c.memoizedState=[w,h],w}function ug(r){var s=vl(r),c=s[0],h=s[1];return zh(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function ix(r){var s=Rf(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function rx(r){var s=Af(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function KD(r,s){var c=_e();lr(c<Li?Li:c,function(){r(!0)}),lr(c>Qi?Qi:c,function(){var h=wr.transition;wr.transition=1;try{r(!1),s()}finally{wr.transition=h}})}function cg(){var r=vl(!1),s=r[0],c=r[1],h=KD.bind(null,c);return Nh(h),[h,s]}function sx(){var r=Rf(),s=r[0],c=Vu(),h=c.current;return[h,s]}function ax(){var r=Af(),s=r[0],c=Vu(),h=c.current;return[h,s]}var Vh=!1;function ZD(){return Vh}function ox(r){{var s=xe(r.type)||"Unknown";xh()&&!Xm[s]&&(m("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."),Xm[s]=!0)}}function fg(){var r=Jd.bind(null,ox.bind(null,Zt));if(Ym()){var s=!1,c=Zt,h=function(){throw s||(s=!0,Vh=!0,b(r()),Vh=!1,ox(c)),Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.")},v=Zd(h),b=vl(v)[1];return(Zt.mode&In)===Yt&&(Zt.flags|=it|Wn,Ih(cl|bf,function(){b(r())},void 0,null)),v}else{var w=r();return vl(w),w}}function lx(){var r=Rf()[0];return r}function ux(){var r=Af()[0];return r}function dg(r,s,c){typeof arguments[3]=="function"&&m("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var h=Ji(),v=Ya(r),b={lane:v,action:c,eagerReducer:null,eagerState:null,next:null},w=s.pending;w===null?b.next=b:(b.next=w.next,w.next=b),s.pending=b;var A=r.alternate;if(r===Zt||A!==null&&A===Zt)Cf=Ph=!0;else{if(r.lanes===le&&(A===null||A.lanes===le)){var D=s.lastRenderedReducer;if(D!==null){var F;F=Oe.current,Oe.current=Wr;try{var $=s.lastRenderedState,X=D($,c);if(b.eagerReducer=D,b.eagerState=X,An(X,$))return}catch{}finally{Oe.current=F}}}typeof jest<"u"&&(yw(r),XI(r)),fi(r,v,h)}}var $h={readContext:Ht,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useOpaqueIdentifier:Xi,unstable_isNewReconciler:nr},cx=null,fx=null,dx=null,hx=null,ms=null,Wr=null,Wh=null;{var hg=function(){m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},dt=function(){m("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};cx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Gt(),Tf(s),og(r,s)},useContext:function(r,s){return ue="useContext",Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Gt(),Tf(s),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Gt(),Tf(c),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Gt(),Tf(s),sg(r,s)},useMemo:function(r,s){ue="useMemo",Gt(),Tf(s);var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Gt(),Nh(r)},useState:function(r){ue="useState",Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Gt(),ug(r)},useTransition:function(){return ue="useTransition",Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Gt(),fg()},unstable_isNewReconciler:nr},fx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),og(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),sg(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Nh(r)},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ug(r)},useTransition:function(){return ue="useTransition",Pe(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),fg()},unstable_isNewReconciler:nr},dx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ix(r)},useTransition:function(){return ue="useTransition",Pe(),sx()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),lx()},unstable_isNewReconciler:nr},hx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wh;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wh;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wh;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),rx(r)},useTransition:function(){return ue="useTransition",Pe(),ax()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),ux()},unstable_isNewReconciler:nr},ms={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Gt(),og(r,s)},useContext:function(r,s){return ue="useContext",dt(),Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Gt(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Gt(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Gt(),sg(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Gt();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Gt(),Nh(r)},useState:function(r){ue="useState",dt(),Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Gt(),ug(r)},useTransition:function(){return ue="useTransition",dt(),Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Gt(),fg()},unstable_isNewReconciler:nr},Wr={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),ix(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),sx()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),lx()},unstable_isNewReconciler:nr},Wh={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),rx(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),ax()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),ux()},unstable_isNewReconciler:nr}}var qh=f.unstable_now,px=0,Mf=-1;function JD(){return px}function vx(){px=qh()}function pg(r){Mf=qh(),r.actualStartTime<0&&(r.actualStartTime=qh())}function mx(r){Mf=-1}function Yh(r,s){if(Mf>=0){var c=qh()-Mf;r.actualDuration+=c,s&&(r.selfBaseDuration=c),Mf=-1}}function vg(r){for(var s=r.child;s;)r.actualDuration+=s.actualDuration,s=s.sibling}var Of=g.ReactCurrentOwner,gs=!1,mg,_f,gg,yg,Sg,ml,bg,Qh;mg={},_f={},gg={},yg={},Sg={},ml=!1,bg={},Qh={};function Ki(r,s,c,h){r===null?s.child=$E(s,null,c,h):s.child=Rh(s,r.child,c,h)}function ek(r,s,c,h){s.child=Rh(s,r.child,null,h),s.child=Rh(s,null,c,h)}function gx(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w=c.render,A=s.ref,D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,w,h,A,v),s.mode&_t){$i();try{D=Hu(r,s,w,h,A,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(ZE(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function yx(r,s,c,h,v,b){if(r===null){var w=c.type;if(oN(w)&&c.compare===null&&c.defaultProps===void 0){var A=w;return A=Ku(w),s.tag=ge,s.type=A,Cg(s,w),Sx(r,s,A,h,v,b)}{var D=w.propTypes;D&&vi(D,h,"prop",xe(w))}var F=fy(c.type,null,h,s,s.mode,b);return F.ref=s.ref,F.return=s,s.child=F,F}{var $=c.type,X=$.propTypes;X&&vi(X,h,"prop",xe($))}var J=r.child;if(!Hn(v,b)){var pe=J.memoizedProps,ye=c.compare;if(ye=ye!==null?ye:$s,ye(pe,h)&&r.ref===s.ref)return Xs(r,s,b)}s.flags|=pi;var Ce=wl(J,h);return Ce.ref=s.ref,Ce.return=s,s.child=Ce,Ce}function Sx(r,s,c,h,v,b){if(s.type!==s.elementType){var w=s.elementType;if(w.$$typeof===wt){var A=w,D=A._payload,F=A._init;try{w=F(D)}catch{w=null}var $=w&&w.propTypes;$&&vi($,h,"prop",xe(w))}}if(r!==null){var X=r.memoizedProps;if($s(X,h)&&r.ref===s.ref&&s.type===r.type)if(gs=!1,Hn(b,v))(r.flags&Ea)!==ct&&(gs=!0);else return s.lanes=r.lanes,Xs(r,s,b)}return xg(r,s,c,h,b)}function Eg(r,s,c){var h=s.pendingProps,v=h.children,b=r!==null?r.memoizedState:null;if(h.mode==="hidden"||h.mode==="unstable-defer-without-hiding")if((s.mode&Fr)===Yt){var w={baseLanes:le};s.memoizedState=w,Ep(s,c)}else if(Hn(c,_i)){var $={baseLanes:le};s.memoizedState=$;var X=b!==null?b.baseLanes:c;Ep(s,X)}else{var A;if(b!==null){var D=b.baseLanes;A=At(D,c)}else A=c;Rp(_i),s.lanes=s.childLanes=_i;var F={baseLanes:A};return s.memoizedState=F,Ep(s,A),null}else{var J;b!==null?(J=At(b.baseLanes,c),s.memoizedState=null):J=c,Ep(s,J)}return Ki(r,s,v,c),s.child}var tk=Eg;function nk(r,s,c){var h=s.pendingProps;return Ki(r,s,h,c),s.child}function ik(r,s,c){var h=s.pendingProps.children;return Ki(r,s,h,c),s.child}function rk(r,s,c){{s.flags|=it;var h=s.stateNode;h.effectDuration=0,h.passiveEffectDuration=0}var v=s.pendingProps,b=v.children;return Ki(r,s,b,c),s.child}function bx(r,s){var c=s.ref;(r===null&&c!==null||r!==null&&r.ref!==c)&&(s.flags|=ln)}function xg(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;{var A=as(s,c,!0);w=Ir(s,A)}var D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,c,h,w,v),s.mode&_t){$i();try{D=Hu(r,s,c,h,w,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(ZE(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function Ex(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;Yn(c)?(w=!0,Co(s)):w=!1,Fa(s,v);var A=s.stateNode,D;A===null?(r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),Vr(s,c,h),Dm(s,c,h,v),D=!0):r===null?D=DD(s,c,h,v):D=kD(r,s,c,h,v);var F=wg(r,s,c,D,w,v);{var $=s.stateNode;D&&$.props!==h&&(ml||m("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",xe(s.type)||"a component"),ml=!0)}return F}function wg(r,s,c,h,v,b){bx(r,s);var w=(s.flags&rt)!==ct;if(!h&&!w)return v&&To(s,c,!1),Xs(r,s,b);var A=s.stateNode;Of.current=s;var D;if(w&&typeof c.getDerivedStateFromError!="function")D=null,mx();else{if(li(!0),D=A.render(),s.mode&_t){$i();try{A.render()}finally{sr()}}li(!1)}return s.flags|=pi,r!==null&&w?ek(r,s,D,b):Ki(r,s,D,b),s.memoizedState=A.state,v&&To(s,c,!0),s.child}function xx(r){var s=r.stateNode;s.pendingContext?$c(r,s.pendingContext,s.pendingContext!==s.context):s.context&&$c(r,s.context,!1),Fm(r,s.containerInfo)}function sk(r,s,c){xx(s);var h=s.updateQueue;if(!(r!==null&&h!==null))throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");var v=s.pendingProps,b=s.memoizedState,w=b!==null?b.element:null;ll(r,s),d(s,v,null,c);var A=s.memoizedState,D=A.element;if(D===w)return qm(),Xs(r,s,c);var F=s.stateNode;if(F.hydrate&&FD(s)){if(tn){var $=F.mutableSourceEagerHydrationData;if($!=null)for(var X=0;X<$.length;X+=2){var J=$[X],pe=$[X+1];KE(J,pe)}}var ye=$E(s,null,D,c);s.child=ye;for(var Ce=ye;Ce;)Ce.flags=Ce.flags&~Pt|Ri,Ce=Ce.sibling}else Ki(r,s,D,c),qm();return s.child}function ak(r,s,c){WE(s),r===null&&Wm(s);var h=s.type,v=s.pendingProps,b=r!==null?r.memoizedProps:null,w=v.children,A=ii(h,v);return A?w=null:b!==null&&ii(h,b)&&(s.flags|=at),bx(r,s),Ki(r,s,w,c),s.child}function ok(r,s){return r===null&&Wm(s),null}function lk(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var b=s.pendingProps,w=c,A=w._payload,D=w._init,F=D(A);s.type=F;var $=s.tag=lN(F),X=cr(F,b),J;switch($){case T:return Cg(s,F),s.type=F=Ku(F),J=xg(null,s,F,X,v),J;case _:return s.type=F=sy(F),J=Ex(null,s,F,X,v),J;case Z:return s.type=F=ay(F),J=gx(null,s,F,X,v),J;case re:{if(s.type!==s.elementType){var pe=F.propTypes;pe&&vi(pe,X,"prop",xe(F))}return J=yx(null,s,F,cr(F.type,X),h,v),J}}var ye="";throw F!==null&&typeof F=="object"&&F.$$typeof===wt&&(ye=" Did you wrap a component in React.lazy() more than once?"),Error("Element type is invalid. Received a promise that resolves to: "+F+". Lazy element type must resolve to a class or function."+ye)}function uk(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),s.tag=_;var b;return Yn(c)?(b=!0,Co(s)):b=!1,Fa(s,v),Vr(s,c,h),Dm(s,c,h,v),wg(null,s,c,!0,b,v)}function ck(r,s,c,h){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var v=s.pendingProps,b;{var w=as(s,c,!1);b=Ir(s,w)}Fa(s,h);var A;{if(c.prototype&&typeof c.prototype.render=="function"){var D=xe(c)||"Unknown";mg[D]||(m("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",D,D),mg[D]=!0)}s.mode&_t&&Gi.recordLegacyContextWarning(s,null),li(!0),Of.current=s,A=Hu(null,s,c,v,b,h),li(!1)}if(s.flags|=pi,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){var F=xe(c)||"Unknown";_f[F]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",F,F,F),_f[F]=!0)}if(typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){{var $=xe(c)||"Unknown";_f[$]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",$,$,$),_f[$]=!0)}s.tag=_,s.memoizedState=null,s.updateQueue=null;var X=!1;Yn(c)?(X=!0,Co(s)):X=!1,s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ju(s);var J=c.getDerivedStateFromProps;return typeof J=="function"&&It(s,c,J,v),St(s,A),Dm(s,c,v,h),wg(null,s,c,!0,X,h)}else{if(s.tag=T,s.mode&_t){$i();try{A=Hu(null,s,c,v,b,h)}finally{sr()}}return Ki(null,s,A,h),Cg(s,c),s.child}}function Cg(r,s){{if(s&&s.childContextTypes&&m("%s(...): childContextTypes cannot be defined on a function component.",s.displayName||s.name||"Component"),r.ref!==null){var c="",h=bh();h&&(c+=`
132
+ Incoming: %s`,ue,"["+s.join(", ")+"]","["+r.join(", ")+"]");for(var c=0;c<s.length&&c<r.length;c++)if(!An(r[c],s[c]))return!1;return!0}function Hu(r,s,c,h,v,b){wf=b,Zt=s,Cr=r!==null?r._debugHookTypes:null,Wa=-1,Km=r!==null&&r.type!==s.type,s.memoizedState=null,s.updateQueue=null,s.lanes=le,r!==null&&r.memoizedState!==null?Oe.current=mx:Cr!==null?Oe.current=vx:Oe.current=px;var w=c(h,v);if(Cf){var A=0;do{if(Cf=!1,!(A<QD))throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");A+=1,Km=!1,bi=null,ei=null,s.updateQueue=null,Wa=-1,Oe.current=gx,w=c(h,v)}while(Cf)}Oe.current=$h,s._debugHookTypes=Cr;var D=bi!==null&&bi.next!==null;if(wf=le,Zt=null,bi=null,ei=null,ue=null,Cr=null,Wa=-1,Ph=!1,D)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return w}function nx(r,s,c){s.updateQueue=r.updateQueue,s.flags&=~(Wn|it),r.lanes=Uo(r.lanes,c)}function ix(){if(Oe.current=$h,Ph){for(var r=Zt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ph=!1}wf=le,Zt=null,bi=null,ei=null,Cr=null,Wa=-1,ue=null,Vh=!1,Cf=!1}function hl(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Zt.memoizedState=ei=r:ei=ei.next=r,ei}function pl(){var r;if(bi===null){var s=Zt.alternate;s!==null?r=s.memoizedState:r=null}else r=bi.next;var c;if(ei===null?c=Zt.memoizedState:c=ei.next,c!==null)ei=c,c=ei.next,bi=r;else{if(r===null)throw Error("Rendered more hooks than during the previous render.");bi=r;var h={memoizedState:bi.memoizedState,baseState:bi.baseState,baseQueue:bi.baseQueue,queue:bi.queue,next:null};ei===null?Zt.memoizedState=ei=h:ei=ei.next=h}return ei}function XD(){return{lastEffect:null}}function Dh(r,s){return typeof s=="function"?s(r):s}function Jm(r,s,c){var h=hl(),v;c!==void 0?v=c(s):v=s,h.memoizedState=h.baseState=v;var b=h.queue={pending:null,dispatch:null,lastRenderedReducer:r,lastRenderedState:v},w=b.dispatch=dg.bind(null,Zt,b);return[h.memoizedState,w]}function eg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=bi,w=b.baseQueue,A=v.pending;if(A!==null){if(w!==null){var D=w.next,F=A.next;w.next=F,A.next=D}b.baseQueue!==w&&m("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),b.baseQueue=w=A,v.pending=null}if(w!==null){var $=w.next,X=b.baseState,J=null,pe=null,ye=null,Ce=$;do{var Ze=Ce.lane;if(fs(wf,Ze)){if(ye!==null){var st={lane:Gn,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye=ye.next=st}if(Ce.eagerReducer===r)X=Ce.eagerState;else{var Jt=Ce.action;X=r(X,Jt)}}else{var bt={lane:Ze,action:Ce.action,eagerReducer:Ce.eagerReducer,eagerState:Ce.eagerState,next:null};ye===null?(pe=ye=bt,J=X):ye=ye.next=bt,Zt.lanes=At(Zt.lanes,Ze),Zg(Ze)}Ce=Ce.next}while(Ce!==null&&Ce!==$);ye===null?J=X:ye.next=pe,An(X,h.memoizedState)||Rg(),h.memoizedState=X,h.baseState=J,h.baseQueue=ye,v.lastRenderedState=X}var Rn=v.dispatch;return[h.memoizedState,Rn]}function tg(r,s,c){var h=pl(),v=h.queue;if(v===null)throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");v.lastRenderedReducer=r;var b=v.dispatch,w=v.pending,A=h.memoizedState;if(w!==null){v.pending=null;var D=w.next,F=D;do{var $=F.action;A=r(A,$),F=F.next}while(F!==D);An(A,h.memoizedState)||Rg(),h.memoizedState=A,h.baseQueue===null&&(h.baseState=A),v.lastRenderedState=A}return[A,b]}function rx(r,s,c){YD(s);var h=s._getVersion,v=h(s._source),b=!1,w=qD(s);if(w!==null?b=w===v:(b=fs(wf,r.mutableReadLanes),b&&tx(s,v)),b){var A=c(s._source);return typeof A=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),A}else throw WD(s),Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.")}function sx(r,s,c,h){var v=fI();if(v===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");var b=s._getVersion,w=b(s._source),A=Oe.current,D=A.useState(function(){return rx(v,s,c)}),F=D[0],$=D[1],X=F,J=ei,pe=r.memoizedState,ye=pe.refs,Ce=ye.getSnapshot,Ze=pe.source,bt=pe.subscribe,st=Zt;if(r.memoizedState={refs:ye,source:s,subscribe:h},A.useEffect(function(){ye.getSnapshot=c,ye.setSnapshot=$;var Rn=b(s._source);if(!An(w,Rn)){var K=c(s._source);if(typeof K=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),!An(X,K)){$(K);var ae=Ya(st);Fo(v,ae)}Mu(v,v.mutableReadLanes)}},[c,s,h]),A.useEffect(function(){var Rn=function(){var ae=ye.getSnapshot,Y=ye.setSnapshot;try{Y(ae(s._source));var ve=Ya(st);Fo(v,ve)}catch(Le){Y(function(){throw Le})}},K=h(s._source,Rn);return typeof K!="function"&&m("Mutable source subscribe function must return an unsubscribe function."),K},[s,h]),!An(Ce,c)||!An(Ze,s)||!An(bt,h)){var Jt={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:X};Jt.dispatch=$=dg.bind(null,Zt,Jt),J.queue=Jt,J.baseQueue=null,X=rx(v,s,c),J.memoizedState=J.baseState=X}return X}function ng(r,s,c){var h=hl();return h.memoizedState={refs:{getSnapshot:s,setSnapshot:null},source:r,subscribe:c},sx(h,r,s,c)}function kh(r,s,c){var h=pl();return sx(h,r,s,c)}function vl(r){var s=hl();typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r;var c=s.queue={pending:null,dispatch:null,lastRenderedReducer:Dh,lastRenderedState:r},h=c.dispatch=dg.bind(null,Zt,c);return[s.memoizedState,h]}function Rf(r){return eg(Dh)}function Af(r){return tg(Dh)}function Ih(r,s,c,h){var v={tag:r,create:s,destroy:c,deps:h,next:null},b=Zt.updateQueue;if(b===null)b=XD(),Zt.updateQueue=b,b.lastEffect=v.next=v;else{var w=b.lastEffect;if(w===null)b.lastEffect=v.next=v;else{var A=w.next;w.next=v,v.next=A,b.lastEffect=v}}return v}function Nh(r){var s=hl(),c={current:r};return Object.seal(c),s.memoizedState=c,c}function Vu(r){var s=pl();return s.memoizedState}function ig(r,s,c,h){var v=hl(),b=h===void 0?null:h;Zt.flags|=r,v.memoizedState=Ih(cl|s,c,void 0,b)}function rg(r,s,c,h){var v=pl(),b=h===void 0?null:h,w=void 0;if(bi!==null){var A=bi.memoizedState;if(w=A.destroy,b!==null){var D=A.deps;if(Zm(b,D)){Ih(s,c,w,b);return}}}Zt.flags|=r,v.memoizedState=Ih(cl|s,c,w,b)}function zh(r,s){return typeof jest<"u"&&ww(Zt),ig(it|Wn,bf,r,s)}function $u(r,s){return typeof jest<"u"&&ww(Zt),rg(it|Wn,bf,r,s)}function sg(r,s){return ig(it,fl,r,s)}function Uh(r,s){return rg(it,fl,r,s)}function ax(r,s){if(typeof s=="function"){var c=s,h=r();return c(h),function(){c(null)}}else if(s!=null){var v=s;v.hasOwnProperty("current")||m("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(v).join(", ")+"}");var b=r();return v.current=b,function(){v.current=null}}}function ag(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return ig(it,fl,ax.bind(null,s,r),h)}function jh(r,s,c){typeof s!="function"&&m("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null");var h=c!=null?c.concat([r]):null;return rg(it,fl,ax.bind(null,s,r),h)}function KD(r,s){}var Fh=KD;function og(r,s){var c=hl(),h=s===void 0?null:s;return c.memoizedState=[r,h],r}function Bh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}return c.memoizedState=[r,h],r}function lg(r,s){var c=hl(),h=s===void 0?null:s,v=r();return c.memoizedState=[v,h],v}function Hh(r,s){var c=pl(),h=s===void 0?null:s,v=c.memoizedState;if(v!==null&&h!==null){var b=v[1];if(Zm(h,b))return v[0]}var w=r();return c.memoizedState=[w,h],w}function ug(r){var s=vl(r),c=s[0],h=s[1];return zh(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function ox(r){var s=Rf(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function lx(r){var s=Af(),c=s[0],h=s[1];return $u(function(){var v=wr.transition;wr.transition=1;try{h(r)}finally{wr.transition=v}},[r]),c}function ZD(r,s){var c=_e();lr(c<Li?Li:c,function(){r(!0)}),lr(c>Qi?Qi:c,function(){var h=wr.transition;wr.transition=1;try{r(!1),s()}finally{wr.transition=h}})}function cg(){var r=vl(!1),s=r[0],c=r[1],h=ZD.bind(null,c);return Nh(h),[h,s]}function ux(){var r=Rf(),s=r[0],c=Vu(),h=c.current;return[h,s]}function cx(){var r=Af(),s=r[0],c=Vu(),h=c.current;return[h,s]}var Vh=!1;function JD(){return Vh}function fx(r){{var s=xe(r.type)||"Unknown";xh()&&!Xm[s]&&(m("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."),Xm[s]=!0)}}function fg(){var r=Jd.bind(null,fx.bind(null,Zt));if(Ym()){var s=!1,c=Zt,h=function(){throw s||(s=!0,Vh=!0,b(r()),Vh=!1,fx(c)),Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.")},v=Zd(h),b=vl(v)[1];return(Zt.mode&In)===Yt&&(Zt.flags|=it|Wn,Ih(cl|bf,function(){b(r())},void 0,null)),v}else{var w=r();return vl(w),w}}function dx(){var r=Rf()[0];return r}function hx(){var r=Af()[0];return r}function dg(r,s,c){typeof arguments[3]=="function"&&m("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var h=Ji(),v=Ya(r),b={lane:v,action:c,eagerReducer:null,eagerState:null,next:null},w=s.pending;w===null?b.next=b:(b.next=w.next,w.next=b),s.pending=b;var A=r.alternate;if(r===Zt||A!==null&&A===Zt)Cf=Ph=!0;else{if(r.lanes===le&&(A===null||A.lanes===le)){var D=s.lastRenderedReducer;if(D!==null){var F;F=Oe.current,Oe.current=Wr;try{var $=s.lastRenderedState,X=D($,c);if(b.eagerReducer=D,b.eagerState=X,An(X,$))return}catch{}finally{Oe.current=F}}}typeof jest<"u"&&(xw(r),KI(r)),fi(r,v,h)}}var $h={readContext:Ht,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useOpaqueIdentifier:Xi,unstable_isNewReconciler:nr},px=null,vx=null,mx=null,gx=null,ms=null,Wr=null,Wh=null;{var hg=function(){m("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},dt=function(){m("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};px={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Gt(),Tf(s),og(r,s)},useContext:function(r,s){return ue="useContext",Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Gt(),Tf(s),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Gt(),Tf(c),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Gt(),Tf(s),sg(r,s)},useMemo:function(r,s){ue="useMemo",Gt(),Tf(s);var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Gt(),Nh(r)},useState:function(r){ue="useState",Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Gt(),ug(r)},useTransition:function(){return ue="useTransition",Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Gt(),fg()},unstable_isNewReconciler:nr},vx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),og(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),sg(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Nh(r)},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ug(r)},useTransition:function(){return ue="useTransition",Pe(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),fg()},unstable_isNewReconciler:nr},mx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),ox(r)},useTransition:function(){return ue="useTransition",Pe(),ux()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),dx()},unstable_isNewReconciler:nr},gx={readContext:function(r,s){return Ht(r,s)},useCallback:function(r,s){return ue="useCallback",Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",Pe();var c=Oe.current;Oe.current=Wh;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",Pe();var h=Oe.current;Oe.current=Wh;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",Pe(),Vu()},useState:function(r){ue="useState",Pe();var s=Oe.current;Oe.current=Wh;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",Pe(),lx(r)},useTransition:function(){return ue="useTransition",Pe(),cx()},useMutableSource:function(r,s,c){return ue="useMutableSource",Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",Pe(),hx()},unstable_isNewReconciler:nr},ms={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Gt(),og(r,s)},useContext:function(r,s){return ue="useContext",dt(),Gt(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Gt(),zh(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Gt(),ag(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Gt(),sg(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Gt();var c=Oe.current;Oe.current=ms;try{return lg(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Gt();var h=Oe.current;Oe.current=ms;try{return Jm(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Gt(),Nh(r)},useState:function(r){ue="useState",dt(),Gt();var s=Oe.current;Oe.current=ms;try{return vl(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Gt(),void 0},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Gt(),ug(r)},useTransition:function(){return ue="useTransition",dt(),Gt(),cg()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Gt(),ng(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Gt(),fg()},unstable_isNewReconciler:nr},Wr={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return eg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Rf(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),ox(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),ux()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),dx()},unstable_isNewReconciler:nr},Wh={readContext:function(r,s){return hg(),Ht(r,s)},useCallback:function(r,s){return ue="useCallback",dt(),Pe(),Bh(r,s)},useContext:function(r,s){return ue="useContext",dt(),Pe(),Ht(r,s)},useEffect:function(r,s){return ue="useEffect",dt(),Pe(),$u(r,s)},useImperativeHandle:function(r,s,c){return ue="useImperativeHandle",dt(),Pe(),jh(r,s,c)},useLayoutEffect:function(r,s){return ue="useLayoutEffect",dt(),Pe(),Uh(r,s)},useMemo:function(r,s){ue="useMemo",dt(),Pe();var c=Oe.current;Oe.current=Wr;try{return Hh(r,s)}finally{Oe.current=c}},useReducer:function(r,s,c){ue="useReducer",dt(),Pe();var h=Oe.current;Oe.current=Wr;try{return tg(r,s,c)}finally{Oe.current=h}},useRef:function(r){return ue="useRef",dt(),Pe(),Vu()},useState:function(r){ue="useState",dt(),Pe();var s=Oe.current;Oe.current=Wr;try{return Af(r)}finally{Oe.current=s}},useDebugValue:function(r,s){return ue="useDebugValue",dt(),Pe(),Fh()},useDeferredValue:function(r){return ue="useDeferredValue",dt(),Pe(),lx(r)},useTransition:function(){return ue="useTransition",dt(),Pe(),cx()},useMutableSource:function(r,s,c){return ue="useMutableSource",dt(),Pe(),kh(r,s,c)},useOpaqueIdentifier:function(){return ue="useOpaqueIdentifier",dt(),Pe(),hx()},unstable_isNewReconciler:nr}}var qh=f.unstable_now,yx=0,Mf=-1;function ek(){return yx}function Sx(){yx=qh()}function pg(r){Mf=qh(),r.actualStartTime<0&&(r.actualStartTime=qh())}function bx(r){Mf=-1}function Yh(r,s){if(Mf>=0){var c=qh()-Mf;r.actualDuration+=c,s&&(r.selfBaseDuration=c),Mf=-1}}function vg(r){for(var s=r.child;s;)r.actualDuration+=s.actualDuration,s=s.sibling}var Of=g.ReactCurrentOwner,gs=!1,mg,_f,gg,yg,Sg,ml,bg,Qh;mg={},_f={},gg={},yg={},Sg={},ml=!1,bg={},Qh={};function Ki(r,s,c,h){r===null?s.child=QE(s,null,c,h):s.child=Rh(s,r.child,c,h)}function tk(r,s,c,h){s.child=Rh(s,r.child,null,h),s.child=Rh(s,null,c,h)}function Ex(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w=c.render,A=s.ref,D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,w,h,A,v),s.mode&_t){$i();try{D=Hu(r,s,w,h,A,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(nx(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function xx(r,s,c,h,v,b){if(r===null){var w=c.type;if(lN(w)&&c.compare===null&&c.defaultProps===void 0){var A=w;return A=Ku(w),s.tag=ge,s.type=A,Cg(s,w),wx(r,s,A,h,v,b)}{var D=w.propTypes;D&&vi(D,h,"prop",xe(w))}var F=fy(c.type,null,h,s,s.mode,b);return F.ref=s.ref,F.return=s,s.child=F,F}{var $=c.type,X=$.propTypes;X&&vi(X,h,"prop",xe($))}var J=r.child;if(!Hn(v,b)){var pe=J.memoizedProps,ye=c.compare;if(ye=ye!==null?ye:$s,ye(pe,h)&&r.ref===s.ref)return Xs(r,s,b)}s.flags|=pi;var Ce=wl(J,h);return Ce.ref=s.ref,Ce.return=s,s.child=Ce,Ce}function wx(r,s,c,h,v,b){if(s.type!==s.elementType){var w=s.elementType;if(w.$$typeof===wt){var A=w,D=A._payload,F=A._init;try{w=F(D)}catch{w=null}var $=w&&w.propTypes;$&&vi($,h,"prop",xe(w))}}if(r!==null){var X=r.memoizedProps;if($s(X,h)&&r.ref===s.ref&&s.type===r.type)if(gs=!1,Hn(b,v))(r.flags&Ea)!==ct&&(gs=!0);else return s.lanes=r.lanes,Xs(r,s,b)}return xg(r,s,c,h,b)}function Eg(r,s,c){var h=s.pendingProps,v=h.children,b=r!==null?r.memoizedState:null;if(h.mode==="hidden"||h.mode==="unstable-defer-without-hiding")if((s.mode&Fr)===Yt){var w={baseLanes:le};s.memoizedState=w,Ep(s,c)}else if(Hn(c,_i)){var $={baseLanes:le};s.memoizedState=$;var X=b!==null?b.baseLanes:c;Ep(s,X)}else{var A;if(b!==null){var D=b.baseLanes;A=At(D,c)}else A=c;Rp(_i),s.lanes=s.childLanes=_i;var F={baseLanes:A};return s.memoizedState=F,Ep(s,A),null}else{var J;b!==null?(J=At(b.baseLanes,c),s.memoizedState=null):J=c,Ep(s,J)}return Ki(r,s,v,c),s.child}var nk=Eg;function ik(r,s,c){var h=s.pendingProps;return Ki(r,s,h,c),s.child}function rk(r,s,c){var h=s.pendingProps.children;return Ki(r,s,h,c),s.child}function sk(r,s,c){{s.flags|=it;var h=s.stateNode;h.effectDuration=0,h.passiveEffectDuration=0}var v=s.pendingProps,b=v.children;return Ki(r,s,b,c),s.child}function Cx(r,s){var c=s.ref;(r===null&&c!==null||r!==null&&r.ref!==c)&&(s.flags|=ln)}function xg(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;{var A=as(s,c,!0);w=Ir(s,A)}var D;Fa(s,v);{if(Of.current=s,li(!0),D=Hu(r,s,c,h,w,v),s.mode&_t){$i();try{D=Hu(r,s,c,h,w,v)}finally{sr()}}li(!1)}return r!==null&&!gs?(nx(r,s,v),Xs(r,s,v)):(s.flags|=pi,Ki(r,s,D,v),s.child)}function Tx(r,s,c,h,v){if(s.type!==s.elementType){var b=c.propTypes;b&&vi(b,h,"prop",xe(c))}var w;Yn(c)?(w=!0,Co(s)):w=!1,Fa(s,v);var A=s.stateNode,D;A===null?(r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),Vr(s,c,h),Dm(s,c,h,v),D=!0):r===null?D=kD(s,c,h,v):D=ID(r,s,c,h,v);var F=wg(r,s,c,D,w,v);{var $=s.stateNode;D&&$.props!==h&&(ml||m("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",xe(s.type)||"a component"),ml=!0)}return F}function wg(r,s,c,h,v,b){Cx(r,s);var w=(s.flags&rt)!==ct;if(!h&&!w)return v&&To(s,c,!1),Xs(r,s,b);var A=s.stateNode;Of.current=s;var D;if(w&&typeof c.getDerivedStateFromError!="function")D=null,bx();else{if(li(!0),D=A.render(),s.mode&_t){$i();try{A.render()}finally{sr()}}li(!1)}return s.flags|=pi,r!==null&&w?tk(r,s,D,b):Ki(r,s,D,b),s.memoizedState=A.state,v&&To(s,c,!0),s.child}function Rx(r){var s=r.stateNode;s.pendingContext?$c(r,s.pendingContext,s.pendingContext!==s.context):s.context&&$c(r,s.context,!1),Fm(r,s.containerInfo)}function ak(r,s,c){Rx(s);var h=s.updateQueue;if(!(r!==null&&h!==null))throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");var v=s.pendingProps,b=s.memoizedState,w=b!==null?b.element:null;ll(r,s),d(s,v,null,c);var A=s.memoizedState,D=A.element;if(D===w)return qm(),Xs(r,s,c);var F=s.stateNode;if(F.hydrate&&BD(s)){if(tn){var $=F.mutableSourceEagerHydrationData;if($!=null)for(var X=0;X<$.length;X+=2){var J=$[X],pe=$[X+1];tx(J,pe)}}var ye=QE(s,null,D,c);s.child=ye;for(var Ce=ye;Ce;)Ce.flags=Ce.flags&~Pt|Ri,Ce=Ce.sibling}else Ki(r,s,D,c),qm();return s.child}function ok(r,s,c){GE(s),r===null&&Wm(s);var h=s.type,v=s.pendingProps,b=r!==null?r.memoizedProps:null,w=v.children,A=ii(h,v);return A?w=null:b!==null&&ii(h,b)&&(s.flags|=at),Cx(r,s),Ki(r,s,w,c),s.child}function lk(r,s){return r===null&&Wm(s),null}function uk(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var b=s.pendingProps,w=c,A=w._payload,D=w._init,F=D(A);s.type=F;var $=s.tag=uN(F),X=cr(F,b),J;switch($){case R:return Cg(s,F),s.type=F=Ku(F),J=xg(null,s,F,X,v),J;case _:return s.type=F=sy(F),J=Tx(null,s,F,X,v),J;case Z:return s.type=F=ay(F),J=Ex(null,s,F,X,v),J;case re:{if(s.type!==s.elementType){var pe=F.propTypes;pe&&vi(pe,X,"prop",xe(F))}return J=xx(null,s,F,cr(F.type,X),h,v),J}}var ye="";throw F!==null&&typeof F=="object"&&F.$$typeof===wt&&(ye=" Did you wrap a component in React.lazy() more than once?"),Error("Element type is invalid. Received a promise that resolves to: "+F+". Lazy element type must resolve to a class or function."+ye)}function ck(r,s,c,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt),s.tag=_;var b;return Yn(c)?(b=!0,Co(s)):b=!1,Fa(s,v),Vr(s,c,h),Dm(s,c,h,v),wg(null,s,c,!0,b,v)}function fk(r,s,c,h){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=Pt);var v=s.pendingProps,b;{var w=as(s,c,!1);b=Ir(s,w)}Fa(s,h);var A;{if(c.prototype&&typeof c.prototype.render=="function"){var D=xe(c)||"Unknown";mg[D]||(m("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",D,D),mg[D]=!0)}s.mode&_t&&Gi.recordLegacyContextWarning(s,null),li(!0),Of.current=s,A=Hu(null,s,c,v,b,h),li(!1)}if(s.flags|=pi,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){var F=xe(c)||"Unknown";_f[F]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",F,F,F),_f[F]=!0)}if(typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0){{var $=xe(c)||"Unknown";_f[$]||(m("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",$,$,$),_f[$]=!0)}s.tag=_,s.memoizedState=null,s.updateQueue=null;var X=!1;Yn(c)?(X=!0,Co(s)):X=!1,s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ju(s);var J=c.getDerivedStateFromProps;return typeof J=="function"&&It(s,c,J,v),St(s,A),Dm(s,c,v,h),wg(null,s,c,!0,X,h)}else{if(s.tag=R,s.mode&_t){$i();try{A=Hu(null,s,c,v,b,h)}finally{sr()}}return Ki(null,s,A,h),Cg(s,c),s.child}}function Cg(r,s){{if(s&&s.childContextTypes&&m("%s(...): childContextTypes cannot be defined on a function component.",s.displayName||s.name||"Component"),r.ref!==null){var c="",h=bh();h&&(c+=`
133
133
 
134
- Check the render method of \``+h+"`.");var v=h||r._debugID||"",b=r._debugSource;b&&(v=b.fileName+":"+b.lineNumber),Sg[v]||(Sg[v]=!0,m("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",c))}if(typeof s.getDerivedStateFromProps=="function"){var w=xe(s)||"Unknown";yg[w]||(m("%s: Function components do not support getDerivedStateFromProps.",w),yg[w]=!0)}if(typeof s.contextType=="object"&&s.contextType!==null){var A=xe(s)||"Unknown";gg[A]||(m("%s: Function components do not support contextType.",A),gg[A]=!0)}}}var Gh={dehydrated:null,retryLane:Gn};function Xh(r){return{baseLanes:r}}function wx(r,s){return{baseLanes:At(r.baseLanes,s)}}function fk(r,s,c,h){if(s!==null){var v=s.memoizedState;if(v===null)return!1}return Oh(r,yf)}function Cx(r,s){return Uo(r.childLanes,s)}function Tx(r,s,c){var h=s.pendingProps;Iw(s)&&(s.flags|=rt);var v=$r.current,b=!1,w=(s.flags&rt)!==ct;if(w||fk(v,r)?(b=!0,s.flags&=~rt):(r===null||r.memoizedState!==null)&&h.fallback!==void 0&&h.unstable_avoidThisFallback!==!0&&(v=UD(v,Hm)),v=Sf(v),ul(s,v),r===null){h.fallback!==void 0&&Wm(s);var A=h.children,D=h.fallback;if(b){var F=Rx(s,A,D,c),$=s.child;return $.memoizedState=Xh(c),s.memoizedState=Gh,F}else if(typeof h.unstable_expectedLoadTime=="number"){var X=Rx(s,A,D,c),J=s.child;return J.memoizedState=Xh(c),s.memoizedState=Gh,s.lanes=Hs,Rp(Hs),X}else return dk(s,A,c)}else{var pe=r.memoizedState;if(pe!==null)if(b){var ye=h.fallback,Ce=h.children,Ze=Ox(r,s,Ce,ye,c),bt=s.child,st=r.child.memoizedState;return bt.memoizedState=st===null?Xh(c):wx(st,c),bt.childLanes=Cx(r,c),s.memoizedState=Gh,Ze}else{var Jt=h.children,Rn=Mx(r,s,Jt,c);return s.memoizedState=null,Rn}else if(b){var K=h.fallback,ae=h.children,Y=Ox(r,s,ae,K,c),ve=s.child,Le=r.child.memoizedState;return ve.memoizedState=Le===null?Xh(c):wx(Le,c),ve.childLanes=Cx(r,c),s.memoizedState=Gh,Y}else{var Ie=h.children,xt=Mx(r,s,Ie,c);return s.memoizedState=null,xt}}}function dk(r,s,c){var h=r.mode,v={mode:"visible",children:s},b=hy(v,h,c,null);return b.return=r,r.child=b,b}function Rx(r,s,c,h){var v=r.mode,b=r.child,w={mode:"hidden",children:s},A,D;return(v&In)===Yt&&b!==null?(A=b,A.childLanes=le,A.pendingProps=w,r.mode&Zn&&(A.actualDuration=0,A.actualStartTime=-1,A.selfBaseDuration=0,A.treeBaseDuration=0),D=Cl(c,v,h,null)):(A=hy(w,v,le,null),D=Cl(c,v,h,null)),A.return=r,D.return=r,A.sibling=D,r.child=A,D}function Ax(r,s){return wl(r,s)}function Mx(r,s,c,h){var v=r.child,b=v.sibling,w=Ax(v,{mode:"visible",children:c});return(s.mode&In)===Yt&&(w.lanes=h),w.return=s,w.sibling=null,b!==null&&(b.nextEffect=null,b.flags=De,s.firstEffect=s.lastEffect=b),s.child=w,w}function Ox(r,s,c,h,v){var b=s.mode,w=r.child,A=w.sibling,D={mode:"hidden",children:c},F;if((b&In)===Yt&&s.child!==w){var $=s.child;F=$,F.childLanes=le,F.pendingProps=D,s.mode&Zn&&(F.actualDuration=0,F.actualStartTime=-1,F.selfBaseDuration=w.selfBaseDuration,F.treeBaseDuration=w.treeBaseDuration);var X=F.lastEffect;X!==null?(s.firstEffect=F.firstEffect,s.lastEffect=X,X.nextEffect=null):s.firstEffect=s.lastEffect=null}else F=Ax(w,D);var J;return A!==null?J=wl(A,h):(J=Cl(h,b,v,null),J.flags|=Pt),J.return=s,F.return=s,F.sibling=J,s.child=F,J}function _x(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),Di(r.return,s)}function hk(r,s,c){for(var h=s;h!==null;){if(h.tag===W){var v=h.memoizedState;v!==null&&_x(h,c)}else if(h.tag===je)_x(h,c);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)return;for(;h.sibling===null;){if(h.return===null||h.return===r)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function pk(r){for(var s=r,c=null;s!==null;){var h=s.alternate;h!==null&&_h(h)===null&&(c=s),s=s.sibling}return c}function vk(r){if(r!==void 0&&r!=="forwards"&&r!=="backwards"&&r!=="together"&&!bg[r])if(bg[r]=!0,typeof r=="string")switch(r.toLowerCase()){case"together":case"forwards":case"backwards":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',r,r.toLowerCase());break}case"forward":case"backward":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',r,r.toLowerCase());break}default:m('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r);break}else m('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r)}function mk(r,s){r!==void 0&&!Qh[r]&&(r!=="collapsed"&&r!=="hidden"?(Qh[r]=!0,m('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',r)):s!=="forwards"&&s!=="backwards"&&(Qh[r]=!0,m('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',r)))}function Lx(r,s){{var c=Array.isArray(r),h=!c&&typeof We(r)=="function";if(c||h){var v=c?"array":"iterable";return m("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",v,s,v),!1}}return!0}function gk(r,s){if((s==="forwards"||s==="backwards")&&r!==void 0&&r!==null&&r!==!1)if(Array.isArray(r)){for(var c=0;c<r.length;c++)if(!Lx(r[c],c))return}else{var h=We(r);if(typeof h=="function"){var v=h.call(r);if(v)for(var b=v.next(),w=0;!b.done;b=v.next()){if(!Lx(b.value,w))return;w++}}else m('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',s)}}function Tg(r,s,c,h,v,b){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,lastEffect:b}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=c,w.tailMode=v,w.lastEffect=b)}function Px(r,s,c){var h=s.pendingProps,v=h.revealOrder,b=h.tail,w=h.children;vk(v),mk(b,v),gk(w,v),Ki(r,s,w,c);var A=$r.current,D=Oh(A,yf);if(D)A=Vm(A,yf),s.flags|=rt;else{var F=r!==null&&(r.flags&rt)!==ct;F&&hk(s,s.child,c),A=Sf(A)}if(ul(s,A),(s.mode&In)===Yt)s.memoizedState=null;else switch(v){case"forwards":{var $=pk(s.child),X;$===null?(X=s.child,s.child=null):(X=$.sibling,$.sibling=null),Tg(s,!1,X,$,b,s.lastEffect);break}case"backwards":{var J=null,pe=s.child;for(s.child=null;pe!==null;){var ye=pe.alternate;if(ye!==null&&_h(ye)===null){s.child=pe;break}var Ce=pe.sibling;pe.sibling=J,J=pe,pe=Ce}Tg(s,!0,J,null,b,s.lastEffect);break}case"together":{Tg(s,!1,null,null,void 0,s.lastEffect);break}default:s.memoizedState=null}return s.child}function yk(r,s,c){Fm(s,s.stateNode.containerInfo);var h=s.pendingProps;return r===null?s.child=Rh(s,null,h,c):Ki(r,s,h,c),s.child}var Dx=!1;function Sk(r,s,c){var h=s.type,v=h._context,b=s.pendingProps,w=s.memoizedProps,A=b.value;{"value"in b||Dx||(Dx=!0,m("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var D=s.type.propTypes;D&&vi(D,b,"prop","Context.Provider")}if(rl(s,A),w!==null){var F=w.value,$=Lm(v,A,F);if($===0){if(w.children===b.children&&!qi())return Xs(r,s,c)}else df(s,v,$,c)}var X=b.children;return Ki(r,s,X,c),s.child}var kx=!1;function bk(r,s,c){var h=s.type;h._context===void 0?h!==h.Consumer&&(kx||(kx=!0,m("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):h=h._context;var v=s.pendingProps,b=v.children;typeof b!="function"&&m("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Fa(s,c);var w=Ht(h,v.unstable_observedBits),A;return Of.current=s,li(!0),A=b(w),li(!1),s.flags|=pi,Ki(r,s,A,c),s.child}function Rg(){gs=!0}function Xs(r,s,c){return r!==null&&(s.dependencies=r.dependencies),mx(),Zg(s.lanes),Hn(c,s.childLanes)?(ID(r,s),s.child):null}function Ek(r,s,c){{var h=s.return;if(h===null)throw new Error("Cannot swap the root fiber.");if(r.alternate=null,s.alternate=null,c.index=s.index,c.sibling=s.sibling,c.return=s.return,c.ref=s.ref,s===h.child)h.child=c;else{var v=h.child;if(v===null)throw new Error("Expected parent to have a child.");for(;v.sibling!==s;)if(v=v.sibling,v===null)throw new Error("Expected to find the previous sibling.");v.sibling=c}var b=h.lastEffect;return b!==null?(b.nextEffect=r,h.lastEffect=r):h.firstEffect=h.lastEffect=r,r.nextEffect=null,r.flags=De,c.flags|=Pt,c}}function Ix(r,s,c){var h=s.lanes;if(s._debugNeedsRemount&&r!==null)return Ek(r,s,fy(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes));if(r!==null){var v=r.memoizedProps,b=s.pendingProps;if(v!==b||qi()||s.type!==r.type)gs=!0;else if(Hn(c,h))(r.flags&Ea)!==ct?gs=!0:gs=!1;else{switch(gs=!1,s.tag){case k:xx(s),qm();break;case P:WE(s);break;case _:{var w=s.type;Yn(w)&&Co(s);break}case L:Fm(s,s.stateNode.containerInfo);break;case H:{var A=s.memoizedProps.value;rl(s,A);break}case ie:{var D=Hn(c,s.childLanes);D&&(s.flags|=it);var F=s.stateNode;F.effectDuration=0,F.passiveEffectDuration=0}break;case W:{var $=s.memoizedState;if($!==null){var X=s.child,J=X.childLanes;if(Hn(c,J))return Tx(r,s,c);ul(s,Sf($r.current));var pe=Xs(r,s,c);return pe!==null?pe.sibling:null}else ul(s,Sf($r.current));break}case je:{var ye=(r.flags&rt)!==ct,Ce=Hn(c,s.childLanes);if(ye){if(Ce)return Px(r,s,c);s.flags|=rt}var Ze=s.memoizedState;if(Ze!==null&&(Ze.rendering=null,Ze.tail=null,Ze.lastEffect=null),ul(s,$r.current),Ce)break;return null}case tt:case mt:return s.lanes=le,Eg(r,s,c)}return Xs(r,s,c)}}else gs=!1;switch(s.lanes=le,s.tag){case M:return ck(r,s,s.type,c);case be:{var bt=s.elementType;return lk(r,s,bt,h,c)}case T:{var st=s.type,Jt=s.pendingProps,Rn=s.elementType===st?Jt:cr(st,Jt);return xg(r,s,st,Rn,c)}case _:{var K=s.type,ae=s.pendingProps,Y=s.elementType===K?ae:cr(K,ae);return Ex(r,s,K,Y,c)}case k:return sk(r,s,c);case P:return ak(r,s,c);case O:return ok(r,s);case W:return Tx(r,s,c);case L:return yk(r,s,c);case Z:{var ve=s.type,Le=s.pendingProps,Ie=s.elementType===ve?Le:cr(ve,Le);return gx(r,s,ve,Ie,c)}case j:return nk(r,s,c);case q:return ik(r,s,c);case ie:return rk(r,s,c);case H:return Sk(r,s,c);case ee:return bk(r,s,c);case re:{var xt=s.type,rn=s.pendingProps,hn=cr(xt,rn);if(s.type!==s.elementType){var zt=xt.propTypes;zt&&vi(zt,hn,"prop",xe(xt))}return hn=cr(xt.type,hn),yx(r,s,xt,hn,h,c)}case ge:return Sx(r,s,s.type,s.pendingProps,h,c);case Ee:{var Nn=s.type,Lt=s.pendingProps,pn=s.elementType===Nn?Lt:cr(Nn,Lt);return uk(r,s,Nn,pn,c)}case je:return Px(r,s,c);case Xe:break;case ce:break;case me:break;case tt:return Eg(r,s,c);case mt:return tk(r,s,c)}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function ys(r){r.flags|=it}function Nx(r){r.flags|=ln}var Lf,Pf,Kh,Zh;if(Fn)Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P||v.tag===O)jt(r,v.stateNode);else if(v.tag!==L){if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Pf=function(r){},Kh=function(r,s,c,h,v){var b=r.memoizedProps;if(b!==h){var w=s.stateNode,A=gf(),D=jn(w,c,b,h,v,A);s.updateQueue=D,D&&ys(s)}},Zh=function(r,s,c,h){c!==h&&ys(s)};else if(mr){Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}jt(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}jt(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,Lf(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};var zx=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}Uc(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}Uc(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,zx(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};Pf=function(r){var s=r.stateNode,c=r.firstEffect===null;if(!c){var h=s.containerInfo,v=bo(h);zx(v,r,!1,!1),s.pendingChildren=v,ys(r),rh(h,v)}},Kh=function(r,s,c,h,v){var b=r.stateNode,w=r.memoizedProps,A=s.firstEffect===null;if(A&&w===h){s.stateNode=b;return}var D=s.stateNode,F=gf(),$=null;if(w!==h&&($=jn(D,c,w,h,v,F)),A&&$===null){s.stateNode=b;return}var X=Sm(b,$,c,w,h,s,A,D);$t(X,c,h,v,F)&&ys(s),s.stateNode=X,A?ys(s):Lf(X,s,!1,!1)},Zh=function(r,s,c,h){if(c!==h){var v=jm(),b=gf();s.stateNode=Fi(h,v,b,s),ys(s)}else s.stateNode=r.stateNode}}else Pf=function(r){},Kh=function(r,s,c,h,v){},Zh=function(r,s,c,h){};function Df(r,s){if(!Ym())switch(r.tailMode){case"hidden":{for(var c=r.tail,h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?r.tail=null:h.sibling=null;break}case"collapsed":{for(var v=r.tail,b=null;v!==null;)v.alternate!==null&&(b=v),v=v.sibling;b===null?!s&&r.tail!==null?r.tail.sibling=null:r.tail=null:b.sibling=null;break}}}function Ux(r,s,c){var h=s.pendingProps;switch(s.tag){case M:case be:case ge:case T:case Z:case j:case q:case ie:case ee:case re:return null;case _:{var v=s.type;return Yn(v)&&Oi(s),null}case k:{Fu(s),fu(s),Qm();var b=s.stateNode;if(b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),r===null||r.child===null){var w=Lh(s);w?ys(s):b.hydrate||(s.flags|=en)}return Pf(s),null}case P:{Bm(s);var A=jm(),D=s.type;if(r!==null&&s.stateNode!=null)Kh(r,s,D,h,A),r.ref!==s.ref&&Nx(s);else{if(!h){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return null}var F=gf(),$=Lh(s);if($)BD(s,A,F)&&ys(s);else{var X=bn(D,h,A,F,s);Lf(X,s,!1,!1),s.stateNode=X,$t(X,D,h,A,F)&&ys(s)}s.ref!==null&&Nx(s)}return null}case O:{var J=h;if(r&&s.stateNode!=null){var pe=r.memoizedProps;Zh(r,s,pe,J)}else{if(typeof J!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var ye=jm(),Ce=gf(),Ze=Lh(s);Ze?HD(s)&&ys(s):s.stateNode=Fi(J,ye,Ce,s)}return null}case W:{Bu(s);var bt=s.memoizedState;if((s.flags&rt)!==ct)return s.lanes=c,(s.mode&Zn)!==Yt&&vg(s),s;var st=bt!==null,Jt=!1;if(r===null)s.memoizedProps.fallback!==void 0&&Lh(s);else{var Rn=r.memoizedState;Jt=Rn!==null}if(st&&!Jt&&(s.mode&In)!==Yt){var K=r===null&&s.memoizedProps.unstable_avoidThisFallback!==!0;K||Oh($r.current,Hm)?xI():wI()}return mr&&st&&(s.flags|=it),Fn&&(st||Jt)&&(s.flags|=it),null}case L:return Fu(s),Pf(s),r===null&&kc(s.stateNode.containerInfo),null;case H:return Uu(s),null;case Ee:{var ae=s.type;return Yn(ae)&&Oi(s),null}case je:{Bu(s);var Y=s.memoizedState;if(Y===null)return null;var ve=(s.flags&rt)!==ct,Le=Y.rendering;if(Le===null)if(ve)Df(Y,!1);else{var Ie=TI()&&(r===null||(r.flags&rt)===ct);if(!Ie)for(var xt=s.child;xt!==null;){var rn=_h(xt);if(rn!==null){ve=!0,s.flags|=rt,Df(Y,!1);var hn=rn.updateQueue;return hn!==null&&(s.updateQueue=hn,s.flags|=it),Y.lastEffect===null&&(s.firstEffect=null),s.lastEffect=Y.lastEffect,ND(s,c),ul(s,Vm($r.current,yf)),s.child}xt=xt.sibling}Y.tail!==null&&nn()>aw()&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}else{if(!ve){var zt=_h(Le);if(zt!==null){s.flags|=rt,ve=!0;var Nn=zt.updateQueue;if(Nn!==null&&(s.updateQueue=Nn,s.flags|=it),Df(Y,!0),Y.tail===null&&Y.tailMode==="hidden"&&!Le.alternate&&!Ym()){var Lt=s.lastEffect=Y.lastEffect;return Lt!==null&&(Lt.nextEffect=null),null}}else nn()*2-Y.renderingStartTime>aw()&&c!==_i&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}if(Y.isBackwards)Le.sibling=s.child,s.child=Le;else{var pn=Y.last;pn!==null?pn.sibling=Le:s.child=Le,Y.last=Le}}if(Y.tail!==null){var ti=Y.tail;Y.rendering=ti,Y.tail=ti.sibling,Y.lastEffect=s.lastEffect,Y.renderingStartTime=nn(),ti.sibling=null;var Mn=$r.current;return ve?Mn=Vm(Mn,yf):Mn=Sf(Mn),ul(s,Mn),ti}return null}case Xe:break;case ce:break;case me:break;case tt:case mt:{if(Kg(s),r!==null){var bs=s.memoizedState,On=r.memoizedState,Es=On!==null,Tl=bs!==null;Es!==Tl&&h.mode!=="unstable-defer-without-hiding"&&(s.flags|=it)}return null}}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function xk(r,s){switch(r.tag){case _:{var c=r.type;Yn(c)&&Oi(r);var h=r.flags;return h&Ai?(r.flags=h&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case k:{Fu(r),fu(r),Qm();var v=r.flags;if((v&rt)!==ct)throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");return r.flags=v&~Ai|rt,r}case P:return Bm(r),null;case W:{Bu(r);var b=r.flags;return b&Ai?(r.flags=b&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case je:return Bu(r),null;case L:return Fu(r),null;case H:return Uu(r),null;case tt:case mt:return Kg(r),null;default:return null}}function jx(r){switch(r.tag){case _:{var s=r.type.childContextTypes;s!=null&&Oi(r);break}case k:{Fu(r),fu(r),Qm();break}case P:{Bm(r);break}case L:Fu(r);break;case W:Bu(r);break;case je:Bu(r);break;case H:Uu(r);break;case tt:case mt:Kg(r);break}}function Ag(r,s){return{value:r,source:s,stack:uf(s)}}function wk(r,s){return!0}function Mg(r,s){try{var c=wk(r,s);if(c===!1)return;var h=s.value,v=s.source,b=s.stack,w=b!==null?b:"";if(h!=null&&h._suppressLogging){if(r.tag===_)return;console.error(h)}var A=v?xe(v.type):null,D=A?"The above error occurred in the <"+A+"> component:":"The above error occurred in one of your React components:",F,$=xe(r.type);$?F="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+$+"."):F=`Consider adding an error boundary to your tree to customize error handling behavior.
134
+ Check the render method of \``+h+"`.");var v=h||r._debugID||"",b=r._debugSource;b&&(v=b.fileName+":"+b.lineNumber),Sg[v]||(Sg[v]=!0,m("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",c))}if(typeof s.getDerivedStateFromProps=="function"){var w=xe(s)||"Unknown";yg[w]||(m("%s: Function components do not support getDerivedStateFromProps.",w),yg[w]=!0)}if(typeof s.contextType=="object"&&s.contextType!==null){var A=xe(s)||"Unknown";gg[A]||(m("%s: Function components do not support contextType.",A),gg[A]=!0)}}}var Gh={dehydrated:null,retryLane:Gn};function Xh(r){return{baseLanes:r}}function Ax(r,s){return{baseLanes:At(r.baseLanes,s)}}function dk(r,s,c,h){if(s!==null){var v=s.memoizedState;if(v===null)return!1}return Oh(r,yf)}function Mx(r,s){return Uo(r.childLanes,s)}function Ox(r,s,c){var h=s.pendingProps;jw(s)&&(s.flags|=rt);var v=$r.current,b=!1,w=(s.flags&rt)!==ct;if(w||dk(v,r)?(b=!0,s.flags&=~rt):(r===null||r.memoizedState!==null)&&h.fallback!==void 0&&h.unstable_avoidThisFallback!==!0&&(v=jD(v,Hm)),v=Sf(v),ul(s,v),r===null){h.fallback!==void 0&&Wm(s);var A=h.children,D=h.fallback;if(b){var F=_x(s,A,D,c),$=s.child;return $.memoizedState=Xh(c),s.memoizedState=Gh,F}else if(typeof h.unstable_expectedLoadTime=="number"){var X=_x(s,A,D,c),J=s.child;return J.memoizedState=Xh(c),s.memoizedState=Gh,s.lanes=Hs,Rp(Hs),X}else return hk(s,A,c)}else{var pe=r.memoizedState;if(pe!==null)if(b){var ye=h.fallback,Ce=h.children,Ze=Dx(r,s,Ce,ye,c),bt=s.child,st=r.child.memoizedState;return bt.memoizedState=st===null?Xh(c):Ax(st,c),bt.childLanes=Mx(r,c),s.memoizedState=Gh,Ze}else{var Jt=h.children,Rn=Px(r,s,Jt,c);return s.memoizedState=null,Rn}else if(b){var K=h.fallback,ae=h.children,Y=Dx(r,s,ae,K,c),ve=s.child,Le=r.child.memoizedState;return ve.memoizedState=Le===null?Xh(c):Ax(Le,c),ve.childLanes=Mx(r,c),s.memoizedState=Gh,Y}else{var Ie=h.children,xt=Px(r,s,Ie,c);return s.memoizedState=null,xt}}}function hk(r,s,c){var h=r.mode,v={mode:"visible",children:s},b=hy(v,h,c,null);return b.return=r,r.child=b,b}function _x(r,s,c,h){var v=r.mode,b=r.child,w={mode:"hidden",children:s},A,D;return(v&In)===Yt&&b!==null?(A=b,A.childLanes=le,A.pendingProps=w,r.mode&Zn&&(A.actualDuration=0,A.actualStartTime=-1,A.selfBaseDuration=0,A.treeBaseDuration=0),D=Cl(c,v,h,null)):(A=hy(w,v,le,null),D=Cl(c,v,h,null)),A.return=r,D.return=r,A.sibling=D,r.child=A,D}function Lx(r,s){return wl(r,s)}function Px(r,s,c,h){var v=r.child,b=v.sibling,w=Lx(v,{mode:"visible",children:c});return(s.mode&In)===Yt&&(w.lanes=h),w.return=s,w.sibling=null,b!==null&&(b.nextEffect=null,b.flags=De,s.firstEffect=s.lastEffect=b),s.child=w,w}function Dx(r,s,c,h,v){var b=s.mode,w=r.child,A=w.sibling,D={mode:"hidden",children:c},F;if((b&In)===Yt&&s.child!==w){var $=s.child;F=$,F.childLanes=le,F.pendingProps=D,s.mode&Zn&&(F.actualDuration=0,F.actualStartTime=-1,F.selfBaseDuration=w.selfBaseDuration,F.treeBaseDuration=w.treeBaseDuration);var X=F.lastEffect;X!==null?(s.firstEffect=F.firstEffect,s.lastEffect=X,X.nextEffect=null):s.firstEffect=s.lastEffect=null}else F=Lx(w,D);var J;return A!==null?J=wl(A,h):(J=Cl(h,b,v,null),J.flags|=Pt),J.return=s,F.return=s,F.sibling=J,s.child=F,J}function kx(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),Di(r.return,s)}function pk(r,s,c){for(var h=s;h!==null;){if(h.tag===W){var v=h.memoizedState;v!==null&&kx(h,c)}else if(h.tag===je)kx(h,c);else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===r)return;for(;h.sibling===null;){if(h.return===null||h.return===r)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function vk(r){for(var s=r,c=null;s!==null;){var h=s.alternate;h!==null&&_h(h)===null&&(c=s),s=s.sibling}return c}function mk(r){if(r!==void 0&&r!=="forwards"&&r!=="backwards"&&r!=="together"&&!bg[r])if(bg[r]=!0,typeof r=="string")switch(r.toLowerCase()){case"together":case"forwards":case"backwards":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',r,r.toLowerCase());break}case"forward":case"backward":{m('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',r,r.toLowerCase());break}default:m('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r);break}else m('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',r)}function gk(r,s){r!==void 0&&!Qh[r]&&(r!=="collapsed"&&r!=="hidden"?(Qh[r]=!0,m('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',r)):s!=="forwards"&&s!=="backwards"&&(Qh[r]=!0,m('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',r)))}function Ix(r,s){{var c=Array.isArray(r),h=!c&&typeof We(r)=="function";if(c||h){var v=c?"array":"iterable";return m("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",v,s,v),!1}}return!0}function yk(r,s){if((s==="forwards"||s==="backwards")&&r!==void 0&&r!==null&&r!==!1)if(Array.isArray(r)){for(var c=0;c<r.length;c++)if(!Ix(r[c],c))return}else{var h=We(r);if(typeof h=="function"){var v=h.call(r);if(v)for(var b=v.next(),w=0;!b.done;b=v.next()){if(!Ix(b.value,w))return;w++}}else m('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',s)}}function Tg(r,s,c,h,v,b){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,lastEffect:b}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=c,w.tailMode=v,w.lastEffect=b)}function Nx(r,s,c){var h=s.pendingProps,v=h.revealOrder,b=h.tail,w=h.children;mk(v),gk(b,v),yk(w,v),Ki(r,s,w,c);var A=$r.current,D=Oh(A,yf);if(D)A=Vm(A,yf),s.flags|=rt;else{var F=r!==null&&(r.flags&rt)!==ct;F&&pk(s,s.child,c),A=Sf(A)}if(ul(s,A),(s.mode&In)===Yt)s.memoizedState=null;else switch(v){case"forwards":{var $=vk(s.child),X;$===null?(X=s.child,s.child=null):(X=$.sibling,$.sibling=null),Tg(s,!1,X,$,b,s.lastEffect);break}case"backwards":{var J=null,pe=s.child;for(s.child=null;pe!==null;){var ye=pe.alternate;if(ye!==null&&_h(ye)===null){s.child=pe;break}var Ce=pe.sibling;pe.sibling=J,J=pe,pe=Ce}Tg(s,!0,J,null,b,s.lastEffect);break}case"together":{Tg(s,!1,null,null,void 0,s.lastEffect);break}default:s.memoizedState=null}return s.child}function Sk(r,s,c){Fm(s,s.stateNode.containerInfo);var h=s.pendingProps;return r===null?s.child=Rh(s,null,h,c):Ki(r,s,h,c),s.child}var zx=!1;function bk(r,s,c){var h=s.type,v=h._context,b=s.pendingProps,w=s.memoizedProps,A=b.value;{"value"in b||zx||(zx=!0,m("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var D=s.type.propTypes;D&&vi(D,b,"prop","Context.Provider")}if(rl(s,A),w!==null){var F=w.value,$=Lm(v,A,F);if($===0){if(w.children===b.children&&!qi())return Xs(r,s,c)}else df(s,v,$,c)}var X=b.children;return Ki(r,s,X,c),s.child}var Ux=!1;function Ek(r,s,c){var h=s.type;h._context===void 0?h!==h.Consumer&&(Ux||(Ux=!0,m("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):h=h._context;var v=s.pendingProps,b=v.children;typeof b!="function"&&m("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Fa(s,c);var w=Ht(h,v.unstable_observedBits),A;return Of.current=s,li(!0),A=b(w),li(!1),s.flags|=pi,Ki(r,s,A,c),s.child}function Rg(){gs=!0}function Xs(r,s,c){return r!==null&&(s.dependencies=r.dependencies),bx(),Zg(s.lanes),Hn(c,s.childLanes)?(ND(r,s),s.child):null}function xk(r,s,c){{var h=s.return;if(h===null)throw new Error("Cannot swap the root fiber.");if(r.alternate=null,s.alternate=null,c.index=s.index,c.sibling=s.sibling,c.return=s.return,c.ref=s.ref,s===h.child)h.child=c;else{var v=h.child;if(v===null)throw new Error("Expected parent to have a child.");for(;v.sibling!==s;)if(v=v.sibling,v===null)throw new Error("Expected to find the previous sibling.");v.sibling=c}var b=h.lastEffect;return b!==null?(b.nextEffect=r,h.lastEffect=r):h.firstEffect=h.lastEffect=r,r.nextEffect=null,r.flags=De,c.flags|=Pt,c}}function jx(r,s,c){var h=s.lanes;if(s._debugNeedsRemount&&r!==null)return xk(r,s,fy(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes));if(r!==null){var v=r.memoizedProps,b=s.pendingProps;if(v!==b||qi()||s.type!==r.type)gs=!0;else if(Hn(c,h))(r.flags&Ea)!==ct?gs=!0:gs=!1;else{switch(gs=!1,s.tag){case k:Rx(s),qm();break;case P:GE(s);break;case _:{var w=s.type;Yn(w)&&Co(s);break}case L:Fm(s,s.stateNode.containerInfo);break;case H:{var A=s.memoizedProps.value;rl(s,A);break}case ie:{var D=Hn(c,s.childLanes);D&&(s.flags|=it);var F=s.stateNode;F.effectDuration=0,F.passiveEffectDuration=0}break;case W:{var $=s.memoizedState;if($!==null){var X=s.child,J=X.childLanes;if(Hn(c,J))return Ox(r,s,c);ul(s,Sf($r.current));var pe=Xs(r,s,c);return pe!==null?pe.sibling:null}else ul(s,Sf($r.current));break}case je:{var ye=(r.flags&rt)!==ct,Ce=Hn(c,s.childLanes);if(ye){if(Ce)return Nx(r,s,c);s.flags|=rt}var Ze=s.memoizedState;if(Ze!==null&&(Ze.rendering=null,Ze.tail=null,Ze.lastEffect=null),ul(s,$r.current),Ce)break;return null}case tt:case mt:return s.lanes=le,Eg(r,s,c)}return Xs(r,s,c)}}else gs=!1;switch(s.lanes=le,s.tag){case M:return fk(r,s,s.type,c);case be:{var bt=s.elementType;return uk(r,s,bt,h,c)}case R:{var st=s.type,Jt=s.pendingProps,Rn=s.elementType===st?Jt:cr(st,Jt);return xg(r,s,st,Rn,c)}case _:{var K=s.type,ae=s.pendingProps,Y=s.elementType===K?ae:cr(K,ae);return Tx(r,s,K,Y,c)}case k:return ak(r,s,c);case P:return ok(r,s,c);case O:return lk(r,s);case W:return Ox(r,s,c);case L:return Sk(r,s,c);case Z:{var ve=s.type,Le=s.pendingProps,Ie=s.elementType===ve?Le:cr(ve,Le);return Ex(r,s,ve,Ie,c)}case j:return ik(r,s,c);case q:return rk(r,s,c);case ie:return sk(r,s,c);case H:return bk(r,s,c);case ee:return Ek(r,s,c);case re:{var xt=s.type,rn=s.pendingProps,hn=cr(xt,rn);if(s.type!==s.elementType){var zt=xt.propTypes;zt&&vi(zt,hn,"prop",xe(xt))}return hn=cr(xt.type,hn),xx(r,s,xt,hn,h,c)}case ge:return wx(r,s,s.type,s.pendingProps,h,c);case Ee:{var Nn=s.type,Lt=s.pendingProps,pn=s.elementType===Nn?Lt:cr(Nn,Lt);return ck(r,s,Nn,pn,c)}case je:return Nx(r,s,c);case Xe:break;case ce:break;case me:break;case tt:return Eg(r,s,c);case mt:return nk(r,s,c)}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function ys(r){r.flags|=it}function Fx(r){r.flags|=ln}var Lf,Pf,Kh,Zh;if(Fn)Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P||v.tag===O)jt(r,v.stateNode);else if(v.tag!==L){if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Pf=function(r){},Kh=function(r,s,c,h,v){var b=r.memoizedProps;if(b!==h){var w=s.stateNode,A=gf(),D=jn(w,c,b,h,v,A);s.updateQueue=D,D&&ys(s)}},Zh=function(r,s,c,h){c!==h&&ys(s)};else if(mr){Lf=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}jt(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}jt(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,Lf(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};var Bx=function(r,s,c,h){for(var v=s.child;v!==null;){if(v.tag===P){var b=v.stateNode;if(c&&h){var w=v.memoizedProps,A=v.type;b=Fc(b,A,w,v)}Uc(r,b)}else if(v.tag===O){var D=v.stateNode;if(c&&h){var F=v.memoizedProps;D=Zl(D,F,v)}Uc(r,D)}else if(v.tag!==L){if(v.tag===W){if((v.flags&it)!==ct){var $=v.memoizedState!==null;if($){var X=v.child;if(X!==null){X.child!==null&&(X.child.return=X,Bx(r,X,!0,$));var J=X.sibling;if(J!==null){J.return=v,v=J;continue}}}}if(v.child!==null){v.child.return=v,v=v.child;continue}}else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v=v,v===s)return;for(;v.sibling===null;){if(v.return===null||v.return===s)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};Pf=function(r){var s=r.stateNode,c=r.firstEffect===null;if(!c){var h=s.containerInfo,v=bo(h);Bx(v,r,!1,!1),s.pendingChildren=v,ys(r),rh(h,v)}},Kh=function(r,s,c,h,v){var b=r.stateNode,w=r.memoizedProps,A=s.firstEffect===null;if(A&&w===h){s.stateNode=b;return}var D=s.stateNode,F=gf(),$=null;if(w!==h&&($=jn(D,c,w,h,v,F)),A&&$===null){s.stateNode=b;return}var X=Sm(b,$,c,w,h,s,A,D);$t(X,c,h,v,F)&&ys(s),s.stateNode=X,A?ys(s):Lf(X,s,!1,!1)},Zh=function(r,s,c,h){if(c!==h){var v=jm(),b=gf();s.stateNode=Fi(h,v,b,s),ys(s)}else s.stateNode=r.stateNode}}else Pf=function(r){},Kh=function(r,s,c,h,v){},Zh=function(r,s,c,h){};function Df(r,s){if(!Ym())switch(r.tailMode){case"hidden":{for(var c=r.tail,h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?r.tail=null:h.sibling=null;break}case"collapsed":{for(var v=r.tail,b=null;v!==null;)v.alternate!==null&&(b=v),v=v.sibling;b===null?!s&&r.tail!==null?r.tail.sibling=null:r.tail=null:b.sibling=null;break}}}function Hx(r,s,c){var h=s.pendingProps;switch(s.tag){case M:case be:case ge:case R:case Z:case j:case q:case ie:case ee:case re:return null;case _:{var v=s.type;return Yn(v)&&Oi(s),null}case k:{Fu(s),fu(s),Qm();var b=s.stateNode;if(b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),r===null||r.child===null){var w=Lh(s);w?ys(s):b.hydrate||(s.flags|=en)}return Pf(s),null}case P:{Bm(s);var A=jm(),D=s.type;if(r!==null&&s.stateNode!=null)Kh(r,s,D,h,A),r.ref!==s.ref&&Fx(s);else{if(!h){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return null}var F=gf(),$=Lh(s);if($)HD(s,A,F)&&ys(s);else{var X=bn(D,h,A,F,s);Lf(X,s,!1,!1),s.stateNode=X,$t(X,D,h,A,F)&&ys(s)}s.ref!==null&&Fx(s)}return null}case O:{var J=h;if(r&&s.stateNode!=null){var pe=r.memoizedProps;Zh(r,s,pe,J)}else{if(typeof J!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var ye=jm(),Ce=gf(),Ze=Lh(s);Ze?VD(s)&&ys(s):s.stateNode=Fi(J,ye,Ce,s)}return null}case W:{Bu(s);var bt=s.memoizedState;if((s.flags&rt)!==ct)return s.lanes=c,(s.mode&Zn)!==Yt&&vg(s),s;var st=bt!==null,Jt=!1;if(r===null)s.memoizedProps.fallback!==void 0&&Lh(s);else{var Rn=r.memoizedState;Jt=Rn!==null}if(st&&!Jt&&(s.mode&In)!==Yt){var K=r===null&&s.memoizedProps.unstable_avoidThisFallback!==!0;K||Oh($r.current,Hm)?wI():CI()}return mr&&st&&(s.flags|=it),Fn&&(st||Jt)&&(s.flags|=it),null}case L:return Fu(s),Pf(s),r===null&&kc(s.stateNode.containerInfo),null;case H:return Uu(s),null;case Ee:{var ae=s.type;return Yn(ae)&&Oi(s),null}case je:{Bu(s);var Y=s.memoizedState;if(Y===null)return null;var ve=(s.flags&rt)!==ct,Le=Y.rendering;if(Le===null)if(ve)Df(Y,!1);else{var Ie=RI()&&(r===null||(r.flags&rt)===ct);if(!Ie)for(var xt=s.child;xt!==null;){var rn=_h(xt);if(rn!==null){ve=!0,s.flags|=rt,Df(Y,!1);var hn=rn.updateQueue;return hn!==null&&(s.updateQueue=hn,s.flags|=it),Y.lastEffect===null&&(s.firstEffect=null),s.lastEffect=Y.lastEffect,zD(s,c),ul(s,Vm($r.current,yf)),s.child}xt=xt.sibling}Y.tail!==null&&nn()>cw()&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}else{if(!ve){var zt=_h(Le);if(zt!==null){s.flags|=rt,ve=!0;var Nn=zt.updateQueue;if(Nn!==null&&(s.updateQueue=Nn,s.flags|=it),Df(Y,!0),Y.tail===null&&Y.tailMode==="hidden"&&!Le.alternate&&!Ym()){var Lt=s.lastEffect=Y.lastEffect;return Lt!==null&&(Lt.nextEffect=null),null}}else nn()*2-Y.renderingStartTime>cw()&&c!==_i&&(s.flags|=rt,ve=!0,Df(Y,!1),s.lanes=Hs,Rp(Hs))}if(Y.isBackwards)Le.sibling=s.child,s.child=Le;else{var pn=Y.last;pn!==null?pn.sibling=Le:s.child=Le,Y.last=Le}}if(Y.tail!==null){var ti=Y.tail;Y.rendering=ti,Y.tail=ti.sibling,Y.lastEffect=s.lastEffect,Y.renderingStartTime=nn(),ti.sibling=null;var Mn=$r.current;return ve?Mn=Vm(Mn,yf):Mn=Sf(Mn),ul(s,Mn),ti}return null}case Xe:break;case ce:break;case me:break;case tt:case mt:{if(Kg(s),r!==null){var bs=s.memoizedState,On=r.memoizedState,Es=On!==null,Tl=bs!==null;Es!==Tl&&h.mode!=="unstable-defer-without-hiding"&&(s.flags|=it)}return null}}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function wk(r,s){switch(r.tag){case _:{var c=r.type;Yn(c)&&Oi(r);var h=r.flags;return h&Ai?(r.flags=h&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case k:{Fu(r),fu(r),Qm();var v=r.flags;if((v&rt)!==ct)throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");return r.flags=v&~Ai|rt,r}case P:return Bm(r),null;case W:{Bu(r);var b=r.flags;return b&Ai?(r.flags=b&~Ai|rt,(r.mode&Zn)!==Yt&&vg(r),r):null}case je:return Bu(r),null;case L:return Fu(r),null;case H:return Uu(r),null;case tt:case mt:return Kg(r),null;default:return null}}function Vx(r){switch(r.tag){case _:{var s=r.type.childContextTypes;s!=null&&Oi(r);break}case k:{Fu(r),fu(r),Qm();break}case P:{Bm(r);break}case L:Fu(r);break;case W:Bu(r);break;case je:Bu(r);break;case H:Uu(r);break;case tt:case mt:Kg(r);break}}function Ag(r,s){return{value:r,source:s,stack:uf(s)}}function Ck(r,s){return!0}function Mg(r,s){try{var c=Ck(r,s);if(c===!1)return;var h=s.value,v=s.source,b=s.stack,w=b!==null?b:"";if(h!=null&&h._suppressLogging){if(r.tag===_)return;console.error(h)}var A=v?xe(v.type):null,D=A?"The above error occurred in the <"+A+"> component:":"The above error occurred in one of your React components:",F,$=xe(r.type);$?F="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+$+"."):F=`Consider adding an error boundary to your tree to customize error handling behavior.
135
135
  Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;var X=D+`
136
136
  `+w+`
137
137
 
138
- `+(""+F);console.error(X)}catch(J){setTimeout(function(){throw J})}}var Ck=typeof WeakMap=="function"?WeakMap:Map;function Fx(r,s,c){var h=ps(on,c);h.tag=al,h.payload={element:null};var v=s.value;return h.callback=function(){jI(v),Mg(r,s)},h}function Bx(r,s,c){var h=ps(on,c);h.tag=al;var v=r.type.getDerivedStateFromError;if(typeof v=="function"){var b=s.value;h.payload=function(){return Mg(r,s),v(b)}}var w=r.stateNode;return w!==null&&typeof w.componentDidCatch=="function"?h.callback=function(){Ow(r),typeof v!="function"&&(zI(this),Mg(r,s));var D=s.value,F=s.stack;this.componentDidCatch(D,{componentStack:F!==null?F:""}),typeof v!="function"&&(Hn(r.lanes,Rt)||m("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",xe(r.type)||"Unknown"))}:h.callback=function(){Ow(r)},h}function Tk(r,s,c){var h=r.pingCache,v;if(h===null?(h=r.pingCache=new Ck,v=new Set,h.set(s,v)):(v=h.get(s),v===void 0&&(v=new Set,h.set(s,v))),!v.has(c)){v.add(c);var b=FI.bind(null,r,s,c);s.then(b,b)}}function Rk(r,s,c,h,v){if(c.flags|=ts,c.firstEffect=c.lastEffect=null,h!==null&&typeof h=="object"&&typeof h.then=="function"){var b=h;if((c.mode&In)===Yt){var w=c.alternate;w?(c.updateQueue=w.updateQueue,c.memoizedState=w.memoizedState,c.lanes=w.lanes):(c.updateQueue=null,c.memoizedState=null)}var A=Oh($r.current,Hm),D=s;do{if(D.tag===W&&jD(D,A)){var F=D.updateQueue;if(F===null){var $=new Set;$.add(b),D.updateQueue=$}else F.add(b);if((D.mode&In)===Yt){if(D.flags|=rt,c.flags|=Ea,c.flags&=~(po|ts),c.tag===_){var X=c.alternate;if(X===null)c.tag=Ee;else{var J=ps(on,Rt);J.tag=Ba,vs(c,J)}}c.lanes=At(c.lanes,Rt);return}Tk(r,b,v),D.flags|=Ai,D.lanes=v;return}D=D.return}while(D!==null);h=new Error((xe(c.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
138
+ `+(""+F);console.error(X)}catch(J){setTimeout(function(){throw J})}}var Tk=typeof WeakMap=="function"?WeakMap:Map;function $x(r,s,c){var h=ps(on,c);h.tag=al,h.payload={element:null};var v=s.value;return h.callback=function(){FI(v),Mg(r,s)},h}function Wx(r,s,c){var h=ps(on,c);h.tag=al;var v=r.type.getDerivedStateFromError;if(typeof v=="function"){var b=s.value;h.payload=function(){return Mg(r,s),v(b)}}var w=r.stateNode;return w!==null&&typeof w.componentDidCatch=="function"?h.callback=function(){Dw(r),typeof v!="function"&&(UI(this),Mg(r,s));var D=s.value,F=s.stack;this.componentDidCatch(D,{componentStack:F!==null?F:""}),typeof v!="function"&&(Hn(r.lanes,Rt)||m("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",xe(r.type)||"Unknown"))}:h.callback=function(){Dw(r)},h}function Rk(r,s,c){var h=r.pingCache,v;if(h===null?(h=r.pingCache=new Tk,v=new Set,h.set(s,v)):(v=h.get(s),v===void 0&&(v=new Set,h.set(s,v))),!v.has(c)){v.add(c);var b=BI.bind(null,r,s,c);s.then(b,b)}}function Ak(r,s,c,h,v){if(c.flags|=ts,c.firstEffect=c.lastEffect=null,h!==null&&typeof h=="object"&&typeof h.then=="function"){var b=h;if((c.mode&In)===Yt){var w=c.alternate;w?(c.updateQueue=w.updateQueue,c.memoizedState=w.memoizedState,c.lanes=w.lanes):(c.updateQueue=null,c.memoizedState=null)}var A=Oh($r.current,Hm),D=s;do{if(D.tag===W&&FD(D,A)){var F=D.updateQueue;if(F===null){var $=new Set;$.add(b),D.updateQueue=$}else F.add(b);if((D.mode&In)===Yt){if(D.flags|=rt,c.flags|=Ea,c.flags&=~(po|ts),c.tag===_){var X=c.alternate;if(X===null)c.tag=Ee;else{var J=ps(on,Rt);J.tag=Ba,vs(c,J)}}c.lanes=At(c.lanes,Rt);return}Rk(r,b,v),D.flags|=Ai,D.lanes=v;return}D=D.return}while(D!==null);h=new Error((xe(c.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
139
139
 
140
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}CI(),h=Ag(h,c);var pe=s;do{switch(pe.tag){case k:{var ye=h;pe.flags|=Ai;var Ce=oi(v);pe.lanes=At(pe.lanes,Ce);var Ze=Fx(pe,ye,Ce);o(pe,Ze);return}case _:var bt=h,st=pe.type,Jt=pe.stateNode;if((pe.flags&rt)===ct&&(typeof st.getDerivedStateFromError=="function"||Jt!==null&&typeof Jt.componentDidCatch=="function"&&!Jg(Jt))){pe.flags|=Ai;var Rn=oi(v);pe.lanes=At(pe.lanes,Rn);var K=Bx(pe,bt,Rn);o(pe,K);return}break}pe=pe.return}while(pe!==null)}function Hx(r,s,c,h,v,b,w,A,D){var F=Array.prototype.slice.call(arguments,3);try{s.apply(c,F)}catch($){this.onError($)}}var Vx=Hx;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var Og=document.createElement("react");Vx=function(s,c,h,v,b,w,A,D,F){if(!(typeof document<"u"))throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var $=document.createEvent("Event"),X=!1,J=!0,pe=window.event,ye=Object.getOwnPropertyDescriptor(window,"event");function Ce(){Og.removeEventListener(ae,bt,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=pe)}var Ze=Array.prototype.slice.call(arguments,3);function bt(){X=!0,Ce(),c.apply(h,Ze),J=!1}var st,Jt=!1,Rn=!1;function K(Y){if(st=Y.error,Jt=!0,st===null&&Y.colno===0&&Y.lineno===0&&(Rn=!0),Y.defaultPrevented&&st!=null&&typeof st=="object")try{st._suppressLogging=!0}catch{}}var ae="react-"+(s||"invokeguardedcallback");if(window.addEventListener("error",K),Og.addEventListener(ae,bt,!1),$.initEvent(ae,!1,!1),Og.dispatchEvent($),ye&&Object.defineProperty(window,"event",ye),X&&J&&(Jt?Rn&&(st=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):st=new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(st)),window.removeEventListener("error",K),!X)return Ce(),Hx.apply(this,arguments)}}var Ak=Vx,kf=!1,Jh=null,Mk={onError:function(r){kf=!0,Jh=r}};function Ks(r,s,c,h,v,b,w,A,D){kf=!1,Jh=null,Ak.apply(Mk,arguments)}function Zs(){return kf}function Js(){if(kf){var r=Jh;return kf=!1,Jh=null,r}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}var $x=null;$x=new Set;var Ok=typeof WeakSet=="function"?WeakSet:Set,_k=function(r,s){s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()};function Lk(r,s){if(Ks(null,_k,null,r,s),Zs()){var c=Js();Qa(r,c)}}function Wx(r){var s=r.ref;if(s!==null)if(typeof s=="function"){if(Ks(null,s,null,null),Zs()){var c=Js();Qa(r,c)}}else s.current=null}function Pk(r,s){if(Ks(null,s,null),Zs()){var c=Js();Qa(r,c)}}function Dk(r,s){switch(s.tag){case T:case Z:case ge:case me:return;case _:{if(s.flags&en&&r!==null){var c=r.memoizedProps,h=r.memoizedState,v=s.stateNode;s.type===s.elementType&&!ml&&(v.props!==s.memoizedProps&&m("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(s.type)||"instance"),v.state!==s.memoizedState&&m("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(s.type)||"instance"));var b=v.getSnapshotBeforeUpdate(s.elementType===s.type?c:cr(s.type,c),h);{var w=$x;b===void 0&&!w.has(s.type)&&(w.add(s.type),m("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",xe(s.type)))}v.__reactInternalSnapshotBeforeUpdate=b}return}case k:{if(Fn&&s.flags&en){var A=s.stateNode;So(A.containerInfo)}return}case P:case O:case L:case Ee:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function qx(r,s){var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var w=b.destroy;b.destroy=void 0,w!==void 0&&w()}b=b.next}while(b!==v)}}function kk(r,s){var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var w=b.create;b.destroy=w();{var A=b.destroy;if(A!==void 0&&typeof A!="function"){var D=void 0;A===null?D=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof A.then=="function"?D=`
140
+ Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}TI(),h=Ag(h,c);var pe=s;do{switch(pe.tag){case k:{var ye=h;pe.flags|=Ai;var Ce=oi(v);pe.lanes=At(pe.lanes,Ce);var Ze=$x(pe,ye,Ce);o(pe,Ze);return}case _:var bt=h,st=pe.type,Jt=pe.stateNode;if((pe.flags&rt)===ct&&(typeof st.getDerivedStateFromError=="function"||Jt!==null&&typeof Jt.componentDidCatch=="function"&&!Jg(Jt))){pe.flags|=Ai;var Rn=oi(v);pe.lanes=At(pe.lanes,Rn);var K=Wx(pe,bt,Rn);o(pe,K);return}break}pe=pe.return}while(pe!==null)}function qx(r,s,c,h,v,b,w,A,D){var F=Array.prototype.slice.call(arguments,3);try{s.apply(c,F)}catch($){this.onError($)}}var Yx=qx;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var Og=document.createElement("react");Yx=function(s,c,h,v,b,w,A,D,F){if(!(typeof document<"u"))throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var $=document.createEvent("Event"),X=!1,J=!0,pe=window.event,ye=Object.getOwnPropertyDescriptor(window,"event");function Ce(){Og.removeEventListener(ae,bt,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=pe)}var Ze=Array.prototype.slice.call(arguments,3);function bt(){X=!0,Ce(),c.apply(h,Ze),J=!1}var st,Jt=!1,Rn=!1;function K(Y){if(st=Y.error,Jt=!0,st===null&&Y.colno===0&&Y.lineno===0&&(Rn=!0),Y.defaultPrevented&&st!=null&&typeof st=="object")try{st._suppressLogging=!0}catch{}}var ae="react-"+(s||"invokeguardedcallback");if(window.addEventListener("error",K),Og.addEventListener(ae,bt,!1),$.initEvent(ae,!1,!1),Og.dispatchEvent($),ye&&Object.defineProperty(window,"event",ye),X&&J&&(Jt?Rn&&(st=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):st=new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(st)),window.removeEventListener("error",K),!X)return Ce(),qx.apply(this,arguments)}}var Mk=Yx,kf=!1,Jh=null,Ok={onError:function(r){kf=!0,Jh=r}};function Ks(r,s,c,h,v,b,w,A,D){kf=!1,Jh=null,Mk.apply(Ok,arguments)}function Zs(){return kf}function Js(){if(kf){var r=Jh;return kf=!1,Jh=null,r}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}var Qx=null;Qx=new Set;var _k=typeof WeakSet=="function"?WeakSet:Set,Lk=function(r,s){s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()};function Pk(r,s){if(Ks(null,Lk,null,r,s),Zs()){var c=Js();Qa(r,c)}}function Gx(r){var s=r.ref;if(s!==null)if(typeof s=="function"){if(Ks(null,s,null,null),Zs()){var c=Js();Qa(r,c)}}else s.current=null}function Dk(r,s){if(Ks(null,s,null),Zs()){var c=Js();Qa(r,c)}}function kk(r,s){switch(s.tag){case R:case Z:case ge:case me:return;case _:{if(s.flags&en&&r!==null){var c=r.memoizedProps,h=r.memoizedState,v=s.stateNode;s.type===s.elementType&&!ml&&(v.props!==s.memoizedProps&&m("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(s.type)||"instance"),v.state!==s.memoizedState&&m("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(s.type)||"instance"));var b=v.getSnapshotBeforeUpdate(s.elementType===s.type?c:cr(s.type,c),h);{var w=Qx;b===void 0&&!w.has(s.type)&&(w.add(s.type),m("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",xe(s.type)))}v.__reactInternalSnapshotBeforeUpdate=b}return}case k:{if(Fn&&s.flags&en){var A=s.stateNode;So(A.containerInfo)}return}case P:case O:case L:case Ee:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Xx(r,s){var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var w=b.destroy;b.destroy=void 0,w!==void 0&&w()}b=b.next}while(b!==v)}}function Ik(r,s){var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var w=b.create;b.destroy=w();{var A=b.destroy;if(A!==void 0&&typeof A!="function"){var D=void 0;A===null?D=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof A.then=="function"?D=`
141
141
 
142
142
  It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
143
143
 
@@ -150,11 +150,11 @@ useEffect(() => {
150
150
  fetchData();
151
151
  }, [someId]); // Or [] if effect doesn't need props or state
152
152
 
153
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:D=" You returned: "+A,m("An effect function must not return anything besides a function, which is used for clean-up.%s",D)}}}b=b.next}while(b!==v)}}function Ik(r){var s=r.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next,v=h;do{var b=v,w=b.next,A=b.tag;(A&bf)!==$m&&(A&cl)!==$m&&(pw(r,v),kI(r,v)),v=w}while(v!==h)}}function Nk(r,s,c,h){switch(c.tag){case T:case Z:case ge:case me:{kk(fl|cl,c),Ik(c);return}case _:{var v=c.stateNode;if(c.flags&it)if(s===null)c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidMount();else{var b=c.elementType===c.type?s.memoizedProps:cr(c.type,s.memoizedProps),w=s.memoizedState;c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidUpdate(b,w,v.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&(c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),N(c,A,v));return}case k:{var D=c.updateQueue;if(D!==null){var F=null;if(c.child!==null)switch(c.child.tag){case P:F=Ke(c.child.stateNode);break;case _:F=c.child.stateNode;break}N(c,D,F)}return}case P:{var $=c.stateNode;if(s===null&&c.flags&it){var X=c.type,J=c.memoizedProps;Ic($,X,J,c)}return}case O:return;case L:return;case ie:{{var pe=c.memoizedProps;pe.onCommit;var ye=pe.onRender;c.stateNode.effectDuration;var Ce=JD();typeof ye=="function"&&ye(c.memoizedProps.id,s===null?"mount":"update",c.actualDuration,c.treeBaseDuration,c.actualStartTime,Ce,r.memoizedInteractions)}return}case W:{$k(r,c);return}case je:case Ee:case Xe:case ce:case tt:case mt:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Yx(r,s){if(Fn)for(var c=r;;){if(c.tag===P){var h=c.stateNode;s?Nc(h):ym(c.stateNode,c.memoizedProps)}else if(c.tag===O){var v=c.stateNode;s?zc(v):ih(v,c.memoizedProps)}else if(!((c.tag===tt||c.tag===mt)&&c.memoizedState!==null&&c!==r)){if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===r)return;for(;c.sibling===null;){if(c.return===null||c.return===r)return;c=c.return}c.sibling.return=c.return,c=c.sibling}}function zk(r){var s=r.ref;if(s!==null){var c=r.stateNode,h;switch(r.tag){case P:h=Ke(c);break;default:h=c}typeof s=="function"?s(h):(s.hasOwnProperty("current")||m("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",xe(r.type)),s.current=h)}}function Uk(r){var s=r.ref;s!==null&&(typeof s=="function"?s(null):s.current=null)}function Qx(r,s,c){switch(gi(s),s.tag){case T:case Z:case re:case ge:case me:{var h=s.updateQueue;if(h!==null){var v=h.lastEffect;if(v!==null){var b=v.next,w=b;do{var A=w,D=A.destroy,F=A.tag;D!==void 0&&((F&bf)!==$m?pw(s,w):Pk(s,D)),w=w.next}while(w!==b)}}return}case _:{Wx(s);var $=s.stateNode;typeof $.componentWillUnmount=="function"&&Lk(s,$);return}case P:{Wx(s);return}case L:{Fn?Jx(r,s):mr&&jk(s);return}case Xe:return;case Ue:return;case ce:return}}function Gx(r,s,c){for(var h=s;;){if(Qx(r,h),h.child!==null&&(!Fn||h.tag!==L)){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function Xx(r){r.alternate=null,r.child=null,r.dependencies=null,r.firstEffect=null,r.lastEffect=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.return=null,r.updateQueue=null,r._debugOwner=null}function jk(r){if(mr){var s=r.stateNode,c=s.containerInfo,h=bo(c);jc(c,h)}}function Fk(r){if(mr){switch(r.tag){case _:case P:case O:case Xe:return;case k:case L:{var s=r.stateNode,c=s.containerInfo,h=s.pendingChildren;jc(c,h);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}}function Bk(r){for(var s=r.return;s!==null;){if(Kx(s))return s;s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function Kx(r){return r.tag===P||r.tag===k||r.tag===L}function Hk(r){var s=r;e:for(;;){for(;s.sibling===null;){if(s.return===null||Kx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==P&&s.tag!==O&&s.tag!==Ue;){if(s.flags&Pt||s.child===null||s.tag===L)continue e;s.child.return=s,s=s.child}if(!(s.flags&Pt))return s.stateNode}}function Zx(r){if(Fn){var s=Bk(r),c,h,v=s.stateNode;switch(s.tag){case P:c=v,h=!1;break;case k:c=v.containerInfo,h=!0;break;case L:c=v.containerInfo,h=!0;break;case Xe:default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}s.flags&at&&(nh(c),s.flags&=~at);var b=Hk(r);h?_g(r,b,c):Lg(r,b,c)}}function _g(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?vm(c,b,s):Xl(c,b)}else if(h!==L){var w=r.child;if(w!==null){_g(w,s,c);for(var A=w.sibling;A!==null;)_g(A,s,c),A=A.sibling}}}function Lg(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?is(c,b,s):th(c,b)}else if(h!==L){var w=r.child;if(w!==null){Lg(w,s,c);for(var A=w.sibling;A!==null;)Lg(A,s,c),A=A.sibling}}}function Jx(r,s,c){for(var h=s,v=!1,b,w;;){if(!v){var A=h.return;e:for(;;){if(A===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");var D=A.stateNode;switch(A.tag){case P:b=D,w=!1;break e;case k:b=D.containerInfo,w=!0;break e;case L:b=D.containerInfo,w=!0;break e}A=A.return}v=!0}if(h.tag===P||h.tag===O)Gx(r,h),w?gm(b,h.stateNode):mm(b,h.stateNode);else if(h.tag===L){if(h.child!==null){b=h.stateNode.containerInfo,w=!0,h.child.return=h,h=h.child;continue}}else if(Qx(r,h),h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return,h.tag===L&&(v=!1)}h.sibling.return=h.return,h=h.sibling}}function Vk(r,s,c){Fn?Jx(r,s):Gx(r,s);var h=s.alternate;Xx(s),h!==null&&Xx(h)}function Pg(r,s){if(!Fn){switch(s.tag){case T:case Z:case re:case ge:case me:{qx(fl|cl,s);return}case ie:return;case W:{ew(s),ep(s);return}case je:{ep(s);return}case k:{if(tn){var c=s.stateNode;c.hydrate&&(c.hydrate=!1,Ca(c.containerInfo))}break}case tt:case mt:return}Fk(s);return}switch(s.tag){case T:case Z:case re:case ge:case me:{qx(fl|cl,s);return}case _:return;case P:{var h=s.stateNode;if(h!=null){var v=s.memoizedProps,b=r!==null?r.memoizedProps:v,w=s.type,A=s.updateQueue;s.updateQueue=null,A!==null&&Kl(h,A,w,b,v,s)}return}case O:{if(s.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var D=s.stateNode,F=s.memoizedProps,$=r!==null?r.memoizedProps:F;xa(D,$,F);return}case k:{if(tn){var X=s.stateNode;X.hydrate&&(X.hydrate=!1,Ca(X.containerInfo))}return}case ie:return;case W:{ew(s),ep(s);return}case je:{ep(s);return}case Ee:return;case Xe:break;case ce:break;case tt:case mt:{var J=s.memoizedState,pe=J!==null;Yx(s,pe);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function ew(r){var s=r.memoizedState;if(s!==null&&(EI(),Fn)){var c=r.child;Yx(c,!0)}}function $k(r,s){if(tn){var c=s.memoizedState;if(c===null){var h=s.alternate;if(h!==null){var v=h.memoizedState;if(v!==null){var b=v.dehydrated;b!==null&&Hi(b)}}}}}function ep(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var c=r.stateNode;c===null&&(c=r.stateNode=new Ok),s.forEach(function(h){var v=HI.bind(null,r,h);c.has(h)||(h.__reactDoNotTraceInteractions!==!0&&(v=p.unstable_wrap(v)),c.add(h),h.then(v,v))})}}function Wk(r,s){if(r!==null){var c=r.memoizedState;if(c===null||c.dehydrated!==null){var h=s.memoizedState;return h!==null&&h.dehydrated===null}}return!1}function qk(r){Fn&&nh(r.stateNode)}var tp=0,np=1,ip=2,rp=3,sp=4;if(typeof Symbol=="function"&&Symbol.for){var If=Symbol.for;tp=If("selector.component"),np=If("selector.has_pseudo_class"),ip=If("selector.role"),rp=If("selector.test_id"),sp=If("selector.text")}function Yk(r){return{$$typeof:tp,value:r}}function Qk(r){return{$$typeof:np,value:r}}function Gk(r){return{$$typeof:ip,value:r}}function Xk(r){return{$$typeof:sp,value:r}}function Kk(r){return{$$typeof:rp,value:r}}function Dg(r){var s=Ql(r);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}else{var c=dm(r);if(c===null)throw Error("Could not find React container within specified host subtree.");return c.stateNode.current}}function kg(r,s){switch(s.$$typeof){case tp:if(r.type===s.value)return!0;break;case np:return Zk(r,s.value);case ip:if(r.tag===P){var c=r.stateNode;if(hm(c,s.value))return!0}break;case sp:if(r.tag===P||r.tag===O){var h=Wt(r);if(h!==null&&h.indexOf(s.value)>=0)return!0}break;case rp:if(r.tag===P){var v=r.memoizedProps["data-testname"];if(typeof v=="string"&&v.toLowerCase()===s.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type "+s+" specified.")}return!1}function Ig(r){switch(r.$$typeof){case tp:var s=xe(r.value)||"Unknown";return"<"+s+">";case np:return":has("+(Ig(r)||"")+")";case ip:return'[role="'+r.value+'"]';case sp:return'"'+r.value+'"';case rp:return'[data-testname="'+r.value+'"]';default:throw Error("Invalid selector type "+r+" specified.")}}function tw(r,s){for(var c=[],h=[r,0],v=0;v<h.length;){var b=h[v++],w=h[v++],A=s[w];if(!(b.tag===P&&ir(b))){for(;A!=null&&kg(b,A);)w++,A=s[w];if(w===s.length)c.push(b);else for(var D=b.child;D!==null;)h.push(D,w),D=D.sibling}}return c}function Zk(r,s){for(var c=[r,0],h=0;h<c.length;){var v=c[h++],b=c[h++],w=s[b];if(!(v.tag===P&&ir(v))){for(;w!=null&&kg(v,w);)b++,w=s[b];if(b===s.length)return!0;for(var A=v.child;A!==null;)c.push(A,b),A=A.sibling}}return!1}function ap(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=tw(c,s),v=[],b=Array.from(h),w=0;w<b.length;){var A=b[w++];if(A.tag===P){if(ir(A))continue;v.push(A.stateNode)}else for(var D=A.child;D!==null;)b.push(D),D=D.sibling}return v}function Jk(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=0,v=[],b=[c,0],w=0;w<b.length;){var A=b[w++],D=b[w++],F=s[D];if(!(A.tag===P&&ir(A))&&(kg(A,F)&&(v.push(Ig(F)),D++,D>h&&(h=D)),D<s.length))for(var $=A.child;$!==null;)b.push($,D),$=$.sibling}if(h<s.length){for(var X=[],J=h;J<s.length;J++)X.push(Ig(s[J]));return`findAllNodes was able to match part of the selector:
153
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:D=" You returned: "+A,m("An effect function must not return anything besides a function, which is used for clean-up.%s",D)}}}b=b.next}while(b!==v)}}function Nk(r){var s=r.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next,v=h;do{var b=v,w=b.next,A=b.tag;(A&bf)!==$m&&(A&cl)!==$m&&(yw(r,v),II(r,v)),v=w}while(v!==h)}}function zk(r,s,c,h){switch(c.tag){case R:case Z:case ge:case me:{Ik(fl|cl,c),Nk(c);return}case _:{var v=c.stateNode;if(c.flags&it)if(s===null)c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidMount();else{var b=c.elementType===c.type?s.memoizedProps:cr(c.type,s.memoizedProps),w=s.memoizedState;c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),v.componentDidUpdate(b,w,v.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&(c.type===c.elementType&&!ml&&(v.props!==c.memoizedProps&&m("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",xe(c.type)||"instance"),v.state!==c.memoizedState&&m("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",xe(c.type)||"instance")),N(c,A,v));return}case k:{var D=c.updateQueue;if(D!==null){var F=null;if(c.child!==null)switch(c.child.tag){case P:F=Ke(c.child.stateNode);break;case _:F=c.child.stateNode;break}N(c,D,F)}return}case P:{var $=c.stateNode;if(s===null&&c.flags&it){var X=c.type,J=c.memoizedProps;Ic($,X,J,c)}return}case O:return;case L:return;case ie:{{var pe=c.memoizedProps;pe.onCommit;var ye=pe.onRender;c.stateNode.effectDuration;var Ce=ek();typeof ye=="function"&&ye(c.memoizedProps.id,s===null?"mount":"update",c.actualDuration,c.treeBaseDuration,c.actualStartTime,Ce,r.memoizedInteractions)}return}case W:{Wk(r,c);return}case je:case Ee:case Xe:case ce:case tt:case mt:return}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function Kx(r,s){if(Fn)for(var c=r;;){if(c.tag===P){var h=c.stateNode;s?Nc(h):ym(c.stateNode,c.memoizedProps)}else if(c.tag===O){var v=c.stateNode;s?zc(v):ih(v,c.memoizedProps)}else if(!((c.tag===tt||c.tag===mt)&&c.memoizedState!==null&&c!==r)){if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===r)return;for(;c.sibling===null;){if(c.return===null||c.return===r)return;c=c.return}c.sibling.return=c.return,c=c.sibling}}function Uk(r){var s=r.ref;if(s!==null){var c=r.stateNode,h;switch(r.tag){case P:h=Ke(c);break;default:h=c}typeof s=="function"?s(h):(s.hasOwnProperty("current")||m("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",xe(r.type)),s.current=h)}}function jk(r){var s=r.ref;s!==null&&(typeof s=="function"?s(null):s.current=null)}function Zx(r,s,c){switch(gi(s),s.tag){case R:case Z:case re:case ge:case me:{var h=s.updateQueue;if(h!==null){var v=h.lastEffect;if(v!==null){var b=v.next,w=b;do{var A=w,D=A.destroy,F=A.tag;D!==void 0&&((F&bf)!==$m?yw(s,w):Dk(s,D)),w=w.next}while(w!==b)}}return}case _:{Gx(s);var $=s.stateNode;typeof $.componentWillUnmount=="function"&&Pk(s,$);return}case P:{Gx(s);return}case L:{Fn?iw(r,s):mr&&Fk(s);return}case Xe:return;case Ue:return;case ce:return}}function Jx(r,s,c){for(var h=s;;){if(Zx(r,h),h.child!==null&&(!Fn||h.tag!==L)){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return}h.sibling.return=h.return,h=h.sibling}}function ew(r){r.alternate=null,r.child=null,r.dependencies=null,r.firstEffect=null,r.lastEffect=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.return=null,r.updateQueue=null,r._debugOwner=null}function Fk(r){if(mr){var s=r.stateNode,c=s.containerInfo,h=bo(c);jc(c,h)}}function Bk(r){if(mr){switch(r.tag){case _:case P:case O:case Xe:return;case k:case L:{var s=r.stateNode,c=s.containerInfo,h=s.pendingChildren;jc(c,h);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}}function Hk(r){for(var s=r.return;s!==null;){if(tw(s))return s;s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function tw(r){return r.tag===P||r.tag===k||r.tag===L}function Vk(r){var s=r;e:for(;;){for(;s.sibling===null;){if(s.return===null||tw(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==P&&s.tag!==O&&s.tag!==Ue;){if(s.flags&Pt||s.child===null||s.tag===L)continue e;s.child.return=s,s=s.child}if(!(s.flags&Pt))return s.stateNode}}function nw(r){if(Fn){var s=Hk(r),c,h,v=s.stateNode;switch(s.tag){case P:c=v,h=!1;break;case k:c=v.containerInfo,h=!0;break;case L:c=v.containerInfo,h=!0;break;case Xe:default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}s.flags&at&&(nh(c),s.flags&=~at);var b=Vk(r);h?_g(r,b,c):Lg(r,b,c)}}function _g(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?vm(c,b,s):Xl(c,b)}else if(h!==L){var w=r.child;if(w!==null){_g(w,s,c);for(var A=w.sibling;A!==null;)_g(A,s,c),A=A.sibling}}}function Lg(r,s,c){var h=r.tag,v=h===P||h===O;if(v||ks){var b=v?r.stateNode:r.stateNode.instance;s?is(c,b,s):th(c,b)}else if(h!==L){var w=r.child;if(w!==null){Lg(w,s,c);for(var A=w.sibling;A!==null;)Lg(A,s,c),A=A.sibling}}}function iw(r,s,c){for(var h=s,v=!1,b,w;;){if(!v){var A=h.return;e:for(;;){if(A===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");var D=A.stateNode;switch(A.tag){case P:b=D,w=!1;break e;case k:b=D.containerInfo,w=!0;break e;case L:b=D.containerInfo,w=!0;break e}A=A.return}v=!0}if(h.tag===P||h.tag===O)Jx(r,h),w?gm(b,h.stateNode):mm(b,h.stateNode);else if(h.tag===L){if(h.child!==null){b=h.stateNode.containerInfo,w=!0,h.child.return=h,h=h.child;continue}}else if(Zx(r,h),h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)return;for(;h.sibling===null;){if(h.return===null||h.return===s)return;h=h.return,h.tag===L&&(v=!1)}h.sibling.return=h.return,h=h.sibling}}function $k(r,s,c){Fn?iw(r,s):Jx(r,s);var h=s.alternate;ew(s),h!==null&&ew(h)}function Pg(r,s){if(!Fn){switch(s.tag){case R:case Z:case re:case ge:case me:{Xx(fl|cl,s);return}case ie:return;case W:{rw(s),ep(s);return}case je:{ep(s);return}case k:{if(tn){var c=s.stateNode;c.hydrate&&(c.hydrate=!1,Ca(c.containerInfo))}break}case tt:case mt:return}Bk(s);return}switch(s.tag){case R:case Z:case re:case ge:case me:{Xx(fl|cl,s);return}case _:return;case P:{var h=s.stateNode;if(h!=null){var v=s.memoizedProps,b=r!==null?r.memoizedProps:v,w=s.type,A=s.updateQueue;s.updateQueue=null,A!==null&&Kl(h,A,w,b,v,s)}return}case O:{if(s.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var D=s.stateNode,F=s.memoizedProps,$=r!==null?r.memoizedProps:F;xa(D,$,F);return}case k:{if(tn){var X=s.stateNode;X.hydrate&&(X.hydrate=!1,Ca(X.containerInfo))}return}case ie:return;case W:{rw(s),ep(s);return}case je:{ep(s);return}case Ee:return;case Xe:break;case ce:break;case tt:case mt:{var J=s.memoizedState,pe=J!==null;Kx(s,pe);return}}throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}function rw(r){var s=r.memoizedState;if(s!==null&&(xI(),Fn)){var c=r.child;Kx(c,!0)}}function Wk(r,s){if(tn){var c=s.memoizedState;if(c===null){var h=s.alternate;if(h!==null){var v=h.memoizedState;if(v!==null){var b=v.dehydrated;b!==null&&Hi(b)}}}}}function ep(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var c=r.stateNode;c===null&&(c=r.stateNode=new _k),s.forEach(function(h){var v=VI.bind(null,r,h);c.has(h)||(h.__reactDoNotTraceInteractions!==!0&&(v=p.unstable_wrap(v)),c.add(h),h.then(v,v))})}}function qk(r,s){if(r!==null){var c=r.memoizedState;if(c===null||c.dehydrated!==null){var h=s.memoizedState;return h!==null&&h.dehydrated===null}}return!1}function Yk(r){Fn&&nh(r.stateNode)}var tp=0,np=1,ip=2,rp=3,sp=4;if(typeof Symbol=="function"&&Symbol.for){var If=Symbol.for;tp=If("selector.component"),np=If("selector.has_pseudo_class"),ip=If("selector.role"),rp=If("selector.test_id"),sp=If("selector.text")}function Qk(r){return{$$typeof:tp,value:r}}function Gk(r){return{$$typeof:np,value:r}}function Xk(r){return{$$typeof:ip,value:r}}function Kk(r){return{$$typeof:sp,value:r}}function Zk(r){return{$$typeof:rp,value:r}}function Dg(r){var s=Ql(r);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}else{var c=dm(r);if(c===null)throw Error("Could not find React container within specified host subtree.");return c.stateNode.current}}function kg(r,s){switch(s.$$typeof){case tp:if(r.type===s.value)return!0;break;case np:return Jk(r,s.value);case ip:if(r.tag===P){var c=r.stateNode;if(hm(c,s.value))return!0}break;case sp:if(r.tag===P||r.tag===O){var h=Wt(r);if(h!==null&&h.indexOf(s.value)>=0)return!0}break;case rp:if(r.tag===P){var v=r.memoizedProps["data-testname"];if(typeof v=="string"&&v.toLowerCase()===s.value.toLowerCase())return!0}break;default:throw Error("Invalid selector type "+s+" specified.")}return!1}function Ig(r){switch(r.$$typeof){case tp:var s=xe(r.value)||"Unknown";return"<"+s+">";case np:return":has("+(Ig(r)||"")+")";case ip:return'[role="'+r.value+'"]';case sp:return'"'+r.value+'"';case rp:return'[data-testname="'+r.value+'"]';default:throw Error("Invalid selector type "+r+" specified.")}}function sw(r,s){for(var c=[],h=[r,0],v=0;v<h.length;){var b=h[v++],w=h[v++],A=s[w];if(!(b.tag===P&&ir(b))){for(;A!=null&&kg(b,A);)w++,A=s[w];if(w===s.length)c.push(b);else for(var D=b.child;D!==null;)h.push(D,w),D=D.sibling}}return c}function Jk(r,s){for(var c=[r,0],h=0;h<c.length;){var v=c[h++],b=c[h++],w=s[b];if(!(v.tag===P&&ir(v))){for(;w!=null&&kg(v,w);)b++,w=s[b];if(b===s.length)return!0;for(var A=v.child;A!==null;)c.push(A,b),A=A.sibling}}return!1}function ap(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=sw(c,s),v=[],b=Array.from(h),w=0;w<b.length;){var A=b[w++];if(A.tag===P){if(ir(A))continue;v.push(A.stateNode)}else for(var D=A.child;D!==null;)b.push(D),D=D.sibling}return v}function eI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=0,v=[],b=[c,0],w=0;w<b.length;){var A=b[w++],D=b[w++],F=s[D];if(!(A.tag===P&&ir(A))&&(kg(A,F)&&(v.push(Ig(F)),D++,D>h&&(h=D)),D<s.length))for(var $=A.child;$!==null;)b.push($,D),$=$.sibling}if(h<s.length){for(var X=[],J=h;J<s.length;J++)X.push(Ig(s[J]));return`findAllNodes was able to match part of the selector:
154
154
  `+(" "+v.join(" > ")+`
155
155
 
156
156
  `)+`No matching component was found for:
157
- `+(" "+X.join(" > "))}return null}function eI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=ap(r,s),h=[],v=0;v<c.length;v++)h.push(Gl(c[v]));for(var b=h.length-1;b>0;b--)for(var w=h[b],A=w.x,D=A+w.width,F=w.y,$=F+w.height,X=b-1;X>=0;X--)if(b!==X){var J=h[X],pe=J.x,ye=pe+J.width,Ce=J.y,Ze=Ce+J.height;if(A>=pe&&F>=Ce&&D<=ye&&$<=Ze){h.splice(b,1);break}else if(A===pe&&w.width===J.width&&!(Ze<F)&&!(Ce>$)){Ce>F&&(J.height+=Ce-F,J.y=F),Ze<$&&(J.height=$-Ce),h.splice(b,1);break}else if(F===Ce&&w.height===J.height&&!(ye<A)&&!(pe>D)){pe>A&&(J.width+=pe-A,J.x=A),ye<D&&(J.width=D-pe),h.splice(b,1);break}}return h}function tI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=tw(c,s),v=Array.from(h),b=0;b<v.length;){var w=v[b++];if(!ir(w)){if(w.tag===P){var A=w.stateNode;if(pm(A))return!0}for(var D=w.child;D!==null;)v.push(D),D=D.sibling}}return!1}var op=[];function nI(){Bi&&op.forEach(function(r){return r()})}function iI(r,s,c,h){if(!Bi)throw Error("Test selector API is not supported by this renderer.");var v=ap(r,s),b=yo(v,c,h),w=b.disconnect,A=b.observe,D=b.unobserve,F=function(){var $=ap(r,s);v.forEach(function(X){$.indexOf(X)<0&&D(X)}),$.forEach(function(X){v.indexOf(X)<0&&A(X)})};return op.push(F),{disconnect:function(){var $=op.indexOf(F);$>=0&&op.splice($,1),w()}}}var nw=!1,lp=null;function rI(r){if(lp===null)try{var s=("require"+Math.random()).slice(0,7),c=t&&t[s];lp=c.call(t,"timers").setImmediate}catch{lp=function(v){nw===!1&&(nw=!0,typeof MessageChannel>"u"&&m("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var b=new MessageChannel;b.port1.onmessage=v,b.port2.postMessage(void 0)}}return lp(r)}var sI=Math.ceil,Ng=g.ReactCurrentDispatcher,zg=g.ReactCurrentOwner,Wu=g.IsSomeRendererActing,dn=0,Nf=1,aI=2,Ug=4,jg=8,Zi=16,qr=32,iw=64,ea=0,up=1,cp=2,fp=3,dp=4,Fg=5,Ye=dn,Ii=null,Tn=null,Ni=le,Ss=le,Bg=Wi(le),ci=ea,hp=null,gl=le,pp=le,yl=le,vp=le,Hg=null,Vg=0,rw=500,sw=1/0,oI=500;function qa(){sw=nn()+oI}function aw(){return sw}var ke=null,mp=!1,$g=null,qu=null,ta=!1,Yu=null,zf=ds,Wg=le,qg=[],Yg=[],na=null,lI=50,Uf=0,Qg=null,uI=50,gp=0,Sl=null,jf=on,ia=le,yp=le,Gg=!1,Ff=null,Bf=!1;function cI(){return Ii}function Ji(){return(Ye&(Zi|qr))!==dn?nn():(jf!==on||(jf=nn()),jf)}function Ya(r){var s=r.mode;if((s&In)===Yt)return Rt;if((s&Fr)===Yt)return _e()===Nt?Rt:Do;ia===le&&(ia=gl);var c=Xo()!==Go;if(c)return yp!==le&&(yp=Hg!==null?Hg.pendingLanes:le),Tm(ia,yp);var h=_e(),v;if((Ye&Ug)!==dn&&h===Li)v=La(us,ia);else{var b=fh(h);v=La(b,ia)}return v}function fI(r){var s=r.mode;return(s&In)===Yt?Rt:(s&Fr)===Yt?_e()===Nt?Rt:Do:(ia===le&&(ia=gl),ph(ia))}function fi(r,s,c){$I(),QI(r);var h=Sp(r,s);if(h===null)return qI(r),null;Pa(h,s,c),h===Ii&&(yl=At(yl,s),ci===dp&&Qu(h,Ni));var v=_e();s===Rt?(Ye&jg)!==dn&&(Ye&(Zi|qr))===dn?(Ga(h,s),Xg(h)):(dr(h,c),Ga(h,s),Ye===dn&&(qa(),Kn())):((Ye&Ug)!==dn&&(v===Li||v===Nt)&&(na===null?na=new Set([h]):na.add(h)),dr(h,c),Ga(h,s)),Hg=h}function Sp(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),c===null&&(r.flags&(Pt|Ri))!==ct&&mw(r);for(var h=r,v=r.return;v!==null;)v.childLanes=At(v.childLanes,s),c=v.alternate,c!==null?c.childLanes=At(c.childLanes,s):(v.flags&(Pt|Ri))!==ct&&mw(r),h=v,v=v.return;if(h.tag===k){var b=h.stateNode;return b}else return null}function dr(r,s){var c=r.callbackNode;wu(r,s);var h=yi(r,r===Ii?Ni:le),v=zo();if(h===le){c!==null&&(Ia(c),r.callbackNode=null,r.callbackPriority=zr);return}if(c!==null){var b=r.callbackPriority;if(b===v)return;Ia(c)}var w;if(v===js)w=hs(Xg.bind(null,r));else if(v===Mo)w=Vn(Nt,Xg.bind(null,r));else{var A=jr(v);w=Vn(A,ow.bind(null,r))}r.callbackPriority=v,r.callbackNode=w}function ow(r){if(jf=on,ia=le,yp=le,(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var s=r.callbackNode,c=Yr();if(c&&r.callbackNode!==s)return null;var h=yi(r,r===Ii?Ni:le);if(h===le)return null;var v=AI(r,h);if(Hn(gl,yl))Gu(r,le);else if(v!==ea){if(v===cp&&(Ye|=iw,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),h=tf(r),h!==le&&(v=Hf(r,h))),v===up){var b=hp;throw Gu(r,le),Qu(r,h),dr(r,nn()),b}var w=r.current.alternate;r.finishedWork=w,r.finishedLanes=h,dI(r,v,h)}return dr(r,nn()),r.callbackNode===s?ow.bind(null,r):null}function dI(r,s,c){switch(s){case ea:case up:throw Error("Root did not complete. This is a bug in React.");case cp:{bl(r);break}case fp:{if(Qu(r,c),hh(c)&&!Cw()){var h=Vg+rw-nn();if(h>10){var v=yi(r,le);if(v!==le)break;var b=r.suspendedLanes;if(!fs(b,c)){Ji(),Tu(r,b);break}r.timeoutHandle=vt(bl.bind(null,r),h);break}}bl(r);break}case dp:{if(Qu(r,c),nf(c))break;if(!Cw()){var w=Io(r,c),A=w,D=nn()-A,F=VI(D)-D;if(F>10){r.timeoutHandle=vt(bl.bind(null,r),F);break}}bl(r);break}case Fg:{bl(r);break}default:throw Error("Unknown root exit status.")}}function Qu(r,s){s=Uo(s,vp),s=Uo(s,yl),yh(r,s)}function Xg(r){if((Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");Yr();var s,c;if(r===Ii&&Hn(r.expiredLanes,Ni)?(s=Ni,c=Hf(r,s),Hn(gl,yl)&&(s=yi(r,s),c=Hf(r,s))):(s=yi(r,le),c=Hf(r,s)),r.tag!==Us&&c===cp&&(Ye|=iw,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),s=tf(r),s!==le&&(c=Hf(r,s))),c===up){var h=hp;throw Gu(r,le),Qu(r,s),dr(r,nn()),h}var v=r.current.alternate;return r.finishedWork=v,r.finishedLanes=s,bl(r),dr(r,nn()),null}function hI(r,s){Sh(r,s),dr(r,nn()),(Ye&(Zi|qr))===dn&&(qa(),Kn())}function pI(){if((Ye&(Nf|Zi|qr))!==dn){(Ye&Zi)!==dn&&m("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");return}mI(),Yr()}function vI(r){return lr(Qi,r)}function mI(){if(na!==null){var r=na;na=null,r.forEach(function(s){Ru(s),dr(s,nn())})}Kn()}function lw(r,s){var c=Ye;Ye|=Nf;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function gI(r,s){var c=Ye;Ye|=aI;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function yI(r,s,c,h,v){var b=Ye;Ye|=Ug;try{return lr(Li,r.bind(null,s,c,h,v))}finally{Ye=b,Ye===dn&&(qa(),Kn())}}function SI(r,s){var c=Ye;Ye&=~Nf,Ye|=jg;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function bp(r,s){var c=Ye;if((c&(Zi|qr))!==dn)return m("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),r(s);Ye|=Nf;try{return r?lr(Nt,r.bind(null,s)):void 0}finally{Ye=c,Kn()}}function bI(r){var s=Ye;Ye|=Nf;try{lr(Nt,r)}finally{Ye=s,Ye===dn&&(qa(),Kn())}}function Ep(r,s){En(Bg,Ss,r),Ss=At(Ss,s),gl=At(gl,s)}function Kg(r){Ss=Bg.current,Ft(Bg,r)}function Gu(r,s){r.finishedWork=null,r.finishedLanes=le;var c=r.timeoutHandle;if(c!==vr&&(r.timeoutHandle=vr,un(c)),Tn!==null)for(var h=Tn.return;h!==null;)jx(h),h=h.return;Ii=r,Tn=wl(r.current,null),Ni=Ss=gl=s,ci=ea,hp=null,pp=le,yl=le,vp=le,Sl=null,Gi.discardPendingWarnings()}function uw(r,s){do{var c=Tn;try{if(il(),JE(),$n(),zg.current=null,c===null||c.return===null){ci=up,hp=s,Tn=null;return}mo&&c.mode&Zn&&Yh(c,!0),Rk(r,c.return,c,s,Ni),hw(c)}catch(h){s=h,Tn===c&&c!==null?(c=c.return,Tn=c):c=Tn;continue}return}while(!0)}function cw(){var r=Ng.current;return Ng.current=$h,r===null?$h:r}function fw(r){Ng.current=r}function xp(r){{var s=p.__interactionsRef.current;return p.__interactionsRef.current=r.memoizedInteractions,s}}function wp(r){p.__interactionsRef.current=r}function EI(){Vg=nn()}function Zg(r){pp=At(r,pp)}function xI(){ci===ea&&(ci=fp)}function wI(){(ci===ea||ci===fp)&&(ci=dp),Ii!==null&&(dh(pp)||dh(yl))&&Qu(Ii,Ni)}function CI(){ci!==Fg&&(ci=cp)}function TI(){return ci===ea}function Hf(r,s){var c=Ye;Ye|=Zi;var h=cw();(Ii!==r||Ni!==s)&&(Gu(r,s),xw(r,s));var v=xp(r);do try{RI();break}catch(b){uw(r,b)}while(!0);if(il(),wp(v),Ye=c,fw(h),Tn!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Ii=null,Ni=le,ci}function RI(){for(;Tn!==null;)dw(Tn)}function AI(r,s){var c=Ye;Ye|=Zi;var h=cw();(Ii!==r||Ni!==s)&&(qa(),Gu(r,s),xw(r,s));var v=xp(r);do try{MI();break}catch(b){uw(r,b)}while(!0);return il(),wp(v),fw(h),Ye=c,Tn!==null?ea:(Ii=null,Ni=le,ci)}function MI(){for(;Tn!==null&&!qo();)dw(Tn)}function dw(r){var s=r.alternate;wn(r);var c;(r.mode&Zn)!==Yt?(pg(r),c=ey(s,r,Ss),Yh(r,!0)):c=ey(s,r,Ss),$n(),r.memoizedProps=r.pendingProps,c===null?hw(r):Tn=c,zg.current=null}function hw(r){var s=r;do{var c=s.alternate,h=s.return;if((s.flags&ts)===ct){wn(s);var v=void 0;if((s.mode&Zn)===Yt?v=Ux(c,s,Ss):(pg(s),v=Ux(c,s,Ss),Yh(s,!1)),$n(),v!==null){Tn=v;return}if(OI(s),h!==null&&(h.flags&ts)===ct){h.firstEffect===null&&(h.firstEffect=s.firstEffect),s.lastEffect!==null&&(h.lastEffect!==null&&(h.lastEffect.nextEffect=s.firstEffect),h.lastEffect=s.lastEffect);var b=s.flags;b>pi&&(h.lastEffect!==null?h.lastEffect.nextEffect=s:h.firstEffect=s,h.lastEffect=s)}}else{var w=xk(s);if(w!==null){w.flags&=vo,Tn=w;return}if((s.mode&Zn)!==Yt){Yh(s,!1);for(var A=s.actualDuration,D=s.child;D!==null;)A+=D.actualDuration,D=D.sibling;s.actualDuration=A}h!==null&&(h.firstEffect=h.lastEffect=null,h.flags|=ts)}var F=s.sibling;if(F!==null){Tn=F;return}s=h,Tn=s}while(s!==null);ci===ea&&(ci=Fg)}function OI(r){if(!((r.tag===mt||r.tag===tt)&&r.memoizedState!==null&&!Hn(Ss,_i)&&(r.mode&Fr)!==le)){var s=le;if((r.mode&Zn)!==Yt){for(var c=r.actualDuration,h=r.selfBaseDuration,v=r.alternate===null||r.child!==r.alternate.child,b=r.child;b!==null;)s=At(s,At(b.lanes,b.childLanes)),v&&(c+=b.actualDuration),h+=b.treeBaseDuration,b=b.sibling;var w=r.tag===W&&r.memoizedState!==null;if(w){var A=r.child;A!==null&&(h-=A.treeBaseDuration)}r.actualDuration=c,r.treeBaseDuration=h}else for(var D=r.child;D!==null;)s=At(s,At(D.lanes,D.childLanes)),D=D.sibling;r.childLanes=s}}function bl(r){var s=_e();return lr(Nt,_I.bind(null,r,s)),null}function _I(r,s){do Yr();while(Yu!==null);if(WI(),(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var c=r.finishedWork,h=r.finishedLanes;if(c===null)return null;if(r.finishedWork=null,r.finishedLanes=le,c===r.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");r.callbackNode=null;var v=At(c.lanes,c.childLanes);Au(r,v),na!==null&&!Om(v)&&na.has(r)&&na.delete(r),r===Ii&&(Ii=null,Tn=null,Ni=le);var b;if(c.flags>pi?c.lastEffect!==null?(c.lastEffect.nextEffect=c,b=c.firstEffect):b=c:b=c.firstEffect,b!==null){var w=Ye;Ye|=qr;var A=xp(r);zg.current=null,Ff=pt(r.containerInfo),Bf=!1,ke=b;do if(Ks(null,LI,null),Zs()){if(ke===null)throw Error("Should be working on an effect.");var D=Js();Qa(ke,D),ke=ke.nextEffect}while(ke!==null);Ff=null,vx(),ke=b;do if(Ks(null,PI,null,r,s),Zs()){if(ke===null)throw Error("Should be working on an effect.");var F=Js();Qa(ke,F),ke=ke.nextEffect}while(ke!==null);Bf&&eh(),ft(r.containerInfo),r.current=c,ke=b;do if(Ks(null,DI,null,r,h),Zs()){if(ke===null)throw Error("Should be working on an effect.");var $=Js();Qa(ke,$),ke=ke.nextEffect}while(ke!==null);ke=null,Da(),wp(A),Ye=w}else r.current=c,vx();var X=ta;if(ta)ta=!1,Yu=r,Wg=h,zf=s;else for(ke=b;ke!==null;){var J=ke.nextEffect;ke.nextEffect=null,ke.flags&De&&Aw(ke),ke=J}if(v=r.pendingLanes,v!==le){if(Sl!==null){var pe=Sl;Sl=null;for(var ye=0;ye<pe.length;ye++)Ew(r,pe[ye],r.memoizedInteractions)}Ga(r,v)}else qu=null;if(X||ww(r,h),v===Rt?r===Qg?Uf++:(Uf=0,Qg=r):Uf=0,Ro(c.stateNode,s),nI(),dr(r,nn()),mp){mp=!1;var Ce=$g;throw $g=null,Ce}return(Ye&jg)!==dn||Kn(),null}function LI(){for(;ke!==null;){var r=ke.alternate;!Bf&&Ff!==null&&((ke.flags&De)!==ct?Te(ke,Ff)&&(Bf=!0,go()):ke.tag===W&&Wk(r,ke)&&Te(ke,Ff)&&(Bf=!0,go()));var s=ke.flags;(s&en)!==ct&&(wn(ke),Dk(r,ke),$n()),(s&Wn)!==ct&&(ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))),ke=ke.nextEffect}}function PI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&at&&qk(ke),c&ln){var h=ke.alternate;h!==null&&Uk(h)}var v=c&(Pt|it|De|Ri);switch(v){case Pt:{Zx(ke),ke.flags&=~Pt;break}case Re:{Zx(ke),ke.flags&=~Pt;var b=ke.alternate;Pg(b,ke);break}case Ri:{ke.flags&=~Ri;break}case es:{ke.flags&=~Ri;var w=ke.alternate;Pg(w,ke);break}case it:{var A=ke.alternate;Pg(A,ke);break}case De:{Vk(r,ke);break}}$n(),ke=ke.nextEffect}}function DI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&(it|Dt)){var h=ke.alternate;Nk(r,h,ke)}c&ln&&zk(ke),$n(),ke=ke.nextEffect}}function Yr(){if(zf!==ds){var r=zf>Qi?Qi:zf;return zf=ds,lr(r,NI)}return!1}function kI(r,s){qg.push(s,r),ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function pw(r,s){Yg.push(s,r);{r.flags|=sn;var c=r.alternate;c!==null&&(c.flags|=sn)}ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function II(r){var s=r.create;r.destroy=s()}function NI(){if(Yu===null)return!1;var r=Yu,s=Wg;if(Yu=null,Wg=le,(Ye&(Zi|qr))!==dn)throw Error("Cannot flush passive effects while already rendering.");Gg=!0;var c=Ye;Ye|=qr;var h=xp(r),v=Yg;Yg=[];for(var b=0;b<v.length;b+=2){var w=v[b],A=v[b+1],D=w.destroy;w.destroy=void 0;{A.flags&=~sn;var F=A.alternate;F!==null&&(F.flags&=~sn)}if(typeof D=="function"){if(wn(A),Ks(null,D,null),Zs()){if(A===null)throw Error("Should be working on an effect.");var $=Js();Qa(A,$)}$n()}}var X=qg;qg=[];for(var J=0;J<X.length;J+=2){var pe=X[J],ye=X[J+1];{if(wn(ye),Ks(null,II,null,pe),Zs()){if(ye===null)throw Error("Should be working on an effect.");var Ce=Js();Qa(ye,Ce)}$n()}}for(var Ze=r.current.firstEffect;Ze!==null;){var bt=Ze.nextEffect;Ze.nextEffect=null,Ze.flags&De&&Aw(Ze),Ze=bt}return wp(h),ww(r,s),Gg=!1,Ye=c,Kn(),gp=Yu===null?0:gp+1,!0}function Jg(r){return qu!==null&&qu.has(r)}function zI(r){qu===null?qu=new Set([r]):qu.add(r)}function UI(r){mp||(mp=!0,$g=r)}var jI=UI;function vw(r,s,c){var h=Ag(c,s),v=Fx(r,h,Rt);vs(r,v);var b=Ji(),w=Sp(r,Rt);w!==null&&(Pa(w,Rt,b),dr(w,b),Ga(w,Rt))}function Qa(r,s){if(r.tag===k){vw(r,r,s);return}for(var c=r.return;c!==null;){if(c.tag===k){vw(c,r,s);return}else if(c.tag===_){var h=c.type,v=c.stateNode;if(typeof h.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&!Jg(v)){var b=Ag(s,r),w=Bx(c,b,Rt);vs(c,w);var A=Ji(),D=Sp(c,Rt);if(D!==null)Pa(D,Rt,A),dr(D,A),Ga(D,Rt);else if(typeof v.componentDidCatch=="function"&&!Jg(v))try{v.componentDidCatch(s,b)}catch{}return}}c=c.return}}function FI(r,s,c){var h=r.pingCache;h!==null&&h.delete(s);var v=Ji();Tu(r,c),Ii===r&&fs(Ni,c)&&(ci===dp||ci===fp&&hh(Ni)&&nn()-Vg<rw?Gu(r,le):vp=At(vp,c)),dr(r,v),Ga(r,c)}function BI(r,s){s===Gn&&(s=fI(r));var c=Ji(),h=Sp(r,s);h!==null&&(Pa(h,s,c),dr(h,c),Ga(h,s))}function HI(r,s){var c=Gn,h;h=r.stateNode,h!==null&&h.delete(s),BI(r,c)}function VI(r){return r<120?120:r<480?480:r<1080?1080:r<1920?1920:r<3e3?3e3:r<4320?4320:sI(r/1960)*1960}function $I(){if(Uf>lI)throw Uf=0,Qg=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");gp>uI&&(gp=0,m("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}function WI(){Gi.flushLegacyContextWarning(),Gi.flushPendingUnsafeLifecycleWarnings()}var Cp=null;function mw(r){{if((Ye&Zi)!==dn||!(r.mode&(In|Fr)))return;var s=r.tag;if(s!==M&&s!==k&&s!==_&&s!==T&&s!==Z&&s!==re&&s!==ge&&s!==me)return;var c=xe(r.type)||"ReactComponent";if(Cp!==null){if(Cp.has(c))return;Cp.add(c)}else Cp=new Set([c]);var h=Jn;try{wn(r),m("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{h?wn(r):$n()}}}var Tp=null;function qI(r){{var s=r.tag;if(s!==k&&s!==_&&s!==T&&s!==Z&&s!==re&&s!==ge&&s!==me||(r.flags&sn)!==ct)return;var c=xe(r.type)||"ReactComponent";if(Tp!==null){if(Tp.has(c))return;Tp.add(c)}else Tp=new Set([c]);if(!Gg){var h=Jn;try{wn(r),m("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.",s===_?"the componentWillUnmount method":"a useEffect cleanup function")}finally{h?wn(r):$n()}}}}var ey;{var YI=null;ey=function(r,s,c){var h=Lw(YI,s);try{return Ix(r,s,c)}catch(b){if(b!==null&&typeof b=="object"&&typeof b.then=="function")throw b;if(il(),JE(),jx(s),Lw(s,h),s.mode&Zn&&pg(s),Ks(null,Ix,null,r,s,c),Zs()){var v=Js();throw v}else throw b}}}var gw=!1,ty;ty=new Set;function QI(r){if(Na&&(Ye&Zi)!==dn&&!ZD())switch(r.tag){case T:case Z:case ge:{var s=Tn&&xe(Tn.type)||"Unknown",c=s;if(!ty.has(c)){ty.add(c);var h=xe(r.type)||"Unknown";m("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",h,s,s)}break}case _:{gw||(m("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),gw=!0);break}}}var El={current:!1};function yw(r){if(qn===!0&&Wu.current===!0&&El.current!==!0){var s=Jn;try{wn(r),m(`It looks like you're using the wrong act() around your test interactions.
157
+ `+(" "+X.join(" > "))}return null}function tI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=ap(r,s),h=[],v=0;v<c.length;v++)h.push(Gl(c[v]));for(var b=h.length-1;b>0;b--)for(var w=h[b],A=w.x,D=A+w.width,F=w.y,$=F+w.height,X=b-1;X>=0;X--)if(b!==X){var J=h[X],pe=J.x,ye=pe+J.width,Ce=J.y,Ze=Ce+J.height;if(A>=pe&&F>=Ce&&D<=ye&&$<=Ze){h.splice(b,1);break}else if(A===pe&&w.width===J.width&&!(Ze<F)&&!(Ce>$)){Ce>F&&(J.height+=Ce-F,J.y=F),Ze<$&&(J.height=$-Ce),h.splice(b,1);break}else if(F===Ce&&w.height===J.height&&!(ye<A)&&!(pe>D)){pe>A&&(J.width+=pe-A,J.x=A),ye<D&&(J.width=D-pe),h.splice(b,1);break}}return h}function nI(r,s){if(!Bi)throw Error("Test selector API is not supported by this renderer.");for(var c=Dg(r),h=sw(c,s),v=Array.from(h),b=0;b<v.length;){var w=v[b++];if(!ir(w)){if(w.tag===P){var A=w.stateNode;if(pm(A))return!0}for(var D=w.child;D!==null;)v.push(D),D=D.sibling}}return!1}var op=[];function iI(){Bi&&op.forEach(function(r){return r()})}function rI(r,s,c,h){if(!Bi)throw Error("Test selector API is not supported by this renderer.");var v=ap(r,s),b=yo(v,c,h),w=b.disconnect,A=b.observe,D=b.unobserve,F=function(){var $=ap(r,s);v.forEach(function(X){$.indexOf(X)<0&&D(X)}),$.forEach(function(X){v.indexOf(X)<0&&A(X)})};return op.push(F),{disconnect:function(){var $=op.indexOf(F);$>=0&&op.splice($,1),w()}}}var aw=!1,lp=null;function sI(r){if(lp===null)try{var s=("require"+Math.random()).slice(0,7),c=t&&t[s];lp=c.call(t,"timers").setImmediate}catch{lp=function(v){aw===!1&&(aw=!0,typeof MessageChannel>"u"&&m("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var b=new MessageChannel;b.port1.onmessage=v,b.port2.postMessage(void 0)}}return lp(r)}var aI=Math.ceil,Ng=g.ReactCurrentDispatcher,zg=g.ReactCurrentOwner,Wu=g.IsSomeRendererActing,dn=0,Nf=1,oI=2,Ug=4,jg=8,Zi=16,qr=32,ow=64,ea=0,up=1,cp=2,fp=3,dp=4,Fg=5,Ye=dn,Ii=null,Tn=null,Ni=le,Ss=le,Bg=Wi(le),ci=ea,hp=null,gl=le,pp=le,yl=le,vp=le,Hg=null,Vg=0,lw=500,uw=1/0,lI=500;function qa(){uw=nn()+lI}function cw(){return uw}var ke=null,mp=!1,$g=null,qu=null,ta=!1,Yu=null,zf=ds,Wg=le,qg=[],Yg=[],na=null,uI=50,Uf=0,Qg=null,cI=50,gp=0,Sl=null,jf=on,ia=le,yp=le,Gg=!1,Ff=null,Bf=!1;function fI(){return Ii}function Ji(){return(Ye&(Zi|qr))!==dn?nn():(jf!==on||(jf=nn()),jf)}function Ya(r){var s=r.mode;if((s&In)===Yt)return Rt;if((s&Fr)===Yt)return _e()===Nt?Rt:Do;ia===le&&(ia=gl);var c=Xo()!==Go;if(c)return yp!==le&&(yp=Hg!==null?Hg.pendingLanes:le),Tm(ia,yp);var h=_e(),v;if((Ye&Ug)!==dn&&h===Li)v=La(us,ia);else{var b=fh(h);v=La(b,ia)}return v}function dI(r){var s=r.mode;return(s&In)===Yt?Rt:(s&Fr)===Yt?_e()===Nt?Rt:Do:(ia===le&&(ia=gl),ph(ia))}function fi(r,s,c){WI(),GI(r);var h=Sp(r,s);if(h===null)return YI(r),null;Pa(h,s,c),h===Ii&&(yl=At(yl,s),ci===dp&&Qu(h,Ni));var v=_e();s===Rt?(Ye&jg)!==dn&&(Ye&(Zi|qr))===dn?(Ga(h,s),Xg(h)):(dr(h,c),Ga(h,s),Ye===dn&&(qa(),Kn())):((Ye&Ug)!==dn&&(v===Li||v===Nt)&&(na===null?na=new Set([h]):na.add(h)),dr(h,c),Ga(h,s)),Hg=h}function Sp(r,s){r.lanes=At(r.lanes,s);var c=r.alternate;c!==null&&(c.lanes=At(c.lanes,s)),c===null&&(r.flags&(Pt|Ri))!==ct&&bw(r);for(var h=r,v=r.return;v!==null;)v.childLanes=At(v.childLanes,s),c=v.alternate,c!==null?c.childLanes=At(c.childLanes,s):(v.flags&(Pt|Ri))!==ct&&bw(r),h=v,v=v.return;if(h.tag===k){var b=h.stateNode;return b}else return null}function dr(r,s){var c=r.callbackNode;wu(r,s);var h=yi(r,r===Ii?Ni:le),v=zo();if(h===le){c!==null&&(Ia(c),r.callbackNode=null,r.callbackPriority=zr);return}if(c!==null){var b=r.callbackPriority;if(b===v)return;Ia(c)}var w;if(v===js)w=hs(Xg.bind(null,r));else if(v===Mo)w=Vn(Nt,Xg.bind(null,r));else{var A=jr(v);w=Vn(A,fw.bind(null,r))}r.callbackPriority=v,r.callbackNode=w}function fw(r){if(jf=on,ia=le,yp=le,(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var s=r.callbackNode,c=Yr();if(c&&r.callbackNode!==s)return null;var h=yi(r,r===Ii?Ni:le);if(h===le)return null;var v=MI(r,h);if(Hn(gl,yl))Gu(r,le);else if(v!==ea){if(v===cp&&(Ye|=ow,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),h=tf(r),h!==le&&(v=Hf(r,h))),v===up){var b=hp;throw Gu(r,le),Qu(r,h),dr(r,nn()),b}var w=r.current.alternate;r.finishedWork=w,r.finishedLanes=h,hI(r,v,h)}return dr(r,nn()),r.callbackNode===s?fw.bind(null,r):null}function hI(r,s,c){switch(s){case ea:case up:throw Error("Root did not complete. This is a bug in React.");case cp:{bl(r);break}case fp:{if(Qu(r,c),hh(c)&&!Mw()){var h=Vg+lw-nn();if(h>10){var v=yi(r,le);if(v!==le)break;var b=r.suspendedLanes;if(!fs(b,c)){Ji(),Tu(r,b);break}r.timeoutHandle=vt(bl.bind(null,r),h);break}}bl(r);break}case dp:{if(Qu(r,c),nf(c))break;if(!Mw()){var w=Io(r,c),A=w,D=nn()-A,F=$I(D)-D;if(F>10){r.timeoutHandle=vt(bl.bind(null,r),F);break}}bl(r);break}case Fg:{bl(r);break}default:throw Error("Unknown root exit status.")}}function Qu(r,s){s=Uo(s,vp),s=Uo(s,yl),yh(r,s)}function Xg(r){if((Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");Yr();var s,c;if(r===Ii&&Hn(r.expiredLanes,Ni)?(s=Ni,c=Hf(r,s),Hn(gl,yl)&&(s=yi(r,s),c=Hf(r,s))):(s=yi(r,le),c=Hf(r,s)),r.tag!==Us&&c===cp&&(Ye|=ow,r.hydrate&&(r.hydrate=!1,So(r.containerInfo)),s=tf(r),s!==le&&(c=Hf(r,s))),c===up){var h=hp;throw Gu(r,le),Qu(r,s),dr(r,nn()),h}var v=r.current.alternate;return r.finishedWork=v,r.finishedLanes=s,bl(r),dr(r,nn()),null}function pI(r,s){Sh(r,s),dr(r,nn()),(Ye&(Zi|qr))===dn&&(qa(),Kn())}function vI(){if((Ye&(Nf|Zi|qr))!==dn){(Ye&Zi)!==dn&&m("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");return}gI(),Yr()}function mI(r){return lr(Qi,r)}function gI(){if(na!==null){var r=na;na=null,r.forEach(function(s){Ru(s),dr(s,nn())})}Kn()}function dw(r,s){var c=Ye;Ye|=Nf;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function yI(r,s){var c=Ye;Ye|=oI;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function SI(r,s,c,h,v){var b=Ye;Ye|=Ug;try{return lr(Li,r.bind(null,s,c,h,v))}finally{Ye=b,Ye===dn&&(qa(),Kn())}}function bI(r,s){var c=Ye;Ye&=~Nf,Ye|=jg;try{return r(s)}finally{Ye=c,Ye===dn&&(qa(),Kn())}}function bp(r,s){var c=Ye;if((c&(Zi|qr))!==dn)return m("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),r(s);Ye|=Nf;try{return r?lr(Nt,r.bind(null,s)):void 0}finally{Ye=c,Kn()}}function EI(r){var s=Ye;Ye|=Nf;try{lr(Nt,r)}finally{Ye=s,Ye===dn&&(qa(),Kn())}}function Ep(r,s){En(Bg,Ss,r),Ss=At(Ss,s),gl=At(gl,s)}function Kg(r){Ss=Bg.current,Ft(Bg,r)}function Gu(r,s){r.finishedWork=null,r.finishedLanes=le;var c=r.timeoutHandle;if(c!==vr&&(r.timeoutHandle=vr,un(c)),Tn!==null)for(var h=Tn.return;h!==null;)Vx(h),h=h.return;Ii=r,Tn=wl(r.current,null),Ni=Ss=gl=s,ci=ea,hp=null,pp=le,yl=le,vp=le,Sl=null,Gi.discardPendingWarnings()}function hw(r,s){do{var c=Tn;try{if(il(),ix(),$n(),zg.current=null,c===null||c.return===null){ci=up,hp=s,Tn=null;return}mo&&c.mode&Zn&&Yh(c,!0),Ak(r,c.return,c,s,Ni),gw(c)}catch(h){s=h,Tn===c&&c!==null?(c=c.return,Tn=c):c=Tn;continue}return}while(!0)}function pw(){var r=Ng.current;return Ng.current=$h,r===null?$h:r}function vw(r){Ng.current=r}function xp(r){{var s=p.__interactionsRef.current;return p.__interactionsRef.current=r.memoizedInteractions,s}}function wp(r){p.__interactionsRef.current=r}function xI(){Vg=nn()}function Zg(r){pp=At(r,pp)}function wI(){ci===ea&&(ci=fp)}function CI(){(ci===ea||ci===fp)&&(ci=dp),Ii!==null&&(dh(pp)||dh(yl))&&Qu(Ii,Ni)}function TI(){ci!==Fg&&(ci=cp)}function RI(){return ci===ea}function Hf(r,s){var c=Ye;Ye|=Zi;var h=pw();(Ii!==r||Ni!==s)&&(Gu(r,s),Rw(r,s));var v=xp(r);do try{AI();break}catch(b){hw(r,b)}while(!0);if(il(),wp(v),Ye=c,vw(h),Tn!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Ii=null,Ni=le,ci}function AI(){for(;Tn!==null;)mw(Tn)}function MI(r,s){var c=Ye;Ye|=Zi;var h=pw();(Ii!==r||Ni!==s)&&(qa(),Gu(r,s),Rw(r,s));var v=xp(r);do try{OI();break}catch(b){hw(r,b)}while(!0);return il(),wp(v),vw(h),Ye=c,Tn!==null?ea:(Ii=null,Ni=le,ci)}function OI(){for(;Tn!==null&&!qo();)mw(Tn)}function mw(r){var s=r.alternate;wn(r);var c;(r.mode&Zn)!==Yt?(pg(r),c=ey(s,r,Ss),Yh(r,!0)):c=ey(s,r,Ss),$n(),r.memoizedProps=r.pendingProps,c===null?gw(r):Tn=c,zg.current=null}function gw(r){var s=r;do{var c=s.alternate,h=s.return;if((s.flags&ts)===ct){wn(s);var v=void 0;if((s.mode&Zn)===Yt?v=Hx(c,s,Ss):(pg(s),v=Hx(c,s,Ss),Yh(s,!1)),$n(),v!==null){Tn=v;return}if(_I(s),h!==null&&(h.flags&ts)===ct){h.firstEffect===null&&(h.firstEffect=s.firstEffect),s.lastEffect!==null&&(h.lastEffect!==null&&(h.lastEffect.nextEffect=s.firstEffect),h.lastEffect=s.lastEffect);var b=s.flags;b>pi&&(h.lastEffect!==null?h.lastEffect.nextEffect=s:h.firstEffect=s,h.lastEffect=s)}}else{var w=wk(s);if(w!==null){w.flags&=vo,Tn=w;return}if((s.mode&Zn)!==Yt){Yh(s,!1);for(var A=s.actualDuration,D=s.child;D!==null;)A+=D.actualDuration,D=D.sibling;s.actualDuration=A}h!==null&&(h.firstEffect=h.lastEffect=null,h.flags|=ts)}var F=s.sibling;if(F!==null){Tn=F;return}s=h,Tn=s}while(s!==null);ci===ea&&(ci=Fg)}function _I(r){if(!((r.tag===mt||r.tag===tt)&&r.memoizedState!==null&&!Hn(Ss,_i)&&(r.mode&Fr)!==le)){var s=le;if((r.mode&Zn)!==Yt){for(var c=r.actualDuration,h=r.selfBaseDuration,v=r.alternate===null||r.child!==r.alternate.child,b=r.child;b!==null;)s=At(s,At(b.lanes,b.childLanes)),v&&(c+=b.actualDuration),h+=b.treeBaseDuration,b=b.sibling;var w=r.tag===W&&r.memoizedState!==null;if(w){var A=r.child;A!==null&&(h-=A.treeBaseDuration)}r.actualDuration=c,r.treeBaseDuration=h}else for(var D=r.child;D!==null;)s=At(s,At(D.lanes,D.childLanes)),D=D.sibling;r.childLanes=s}}function bl(r){var s=_e();return lr(Nt,LI.bind(null,r,s)),null}function LI(r,s){do Yr();while(Yu!==null);if(qI(),(Ye&(Zi|qr))!==dn)throw Error("Should not already be working.");var c=r.finishedWork,h=r.finishedLanes;if(c===null)return null;if(r.finishedWork=null,r.finishedLanes=le,c===r.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");r.callbackNode=null;var v=At(c.lanes,c.childLanes);Au(r,v),na!==null&&!Om(v)&&na.has(r)&&na.delete(r),r===Ii&&(Ii=null,Tn=null,Ni=le);var b;if(c.flags>pi?c.lastEffect!==null?(c.lastEffect.nextEffect=c,b=c.firstEffect):b=c:b=c.firstEffect,b!==null){var w=Ye;Ye|=qr;var A=xp(r);zg.current=null,Ff=pt(r.containerInfo),Bf=!1,ke=b;do if(Ks(null,PI,null),Zs()){if(ke===null)throw Error("Should be working on an effect.");var D=Js();Qa(ke,D),ke=ke.nextEffect}while(ke!==null);Ff=null,Sx(),ke=b;do if(Ks(null,DI,null,r,s),Zs()){if(ke===null)throw Error("Should be working on an effect.");var F=Js();Qa(ke,F),ke=ke.nextEffect}while(ke!==null);Bf&&eh(),ft(r.containerInfo),r.current=c,ke=b;do if(Ks(null,kI,null,r,h),Zs()){if(ke===null)throw Error("Should be working on an effect.");var $=Js();Qa(ke,$),ke=ke.nextEffect}while(ke!==null);ke=null,Da(),wp(A),Ye=w}else r.current=c,Sx();var X=ta;if(ta)ta=!1,Yu=r,Wg=h,zf=s;else for(ke=b;ke!==null;){var J=ke.nextEffect;ke.nextEffect=null,ke.flags&De&&Lw(ke),ke=J}if(v=r.pendingLanes,v!==le){if(Sl!==null){var pe=Sl;Sl=null;for(var ye=0;ye<pe.length;ye++)Tw(r,pe[ye],r.memoizedInteractions)}Ga(r,v)}else qu=null;if(X||Aw(r,h),v===Rt?r===Qg?Uf++:(Uf=0,Qg=r):Uf=0,Ro(c.stateNode,s),iI(),dr(r,nn()),mp){mp=!1;var Ce=$g;throw $g=null,Ce}return(Ye&jg)!==dn||Kn(),null}function PI(){for(;ke!==null;){var r=ke.alternate;!Bf&&Ff!==null&&((ke.flags&De)!==ct?Te(ke,Ff)&&(Bf=!0,go()):ke.tag===W&&qk(r,ke)&&Te(ke,Ff)&&(Bf=!0,go()));var s=ke.flags;(s&en)!==ct&&(wn(ke),kk(r,ke),$n()),(s&Wn)!==ct&&(ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))),ke=ke.nextEffect}}function DI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&at&&Yk(ke),c&ln){var h=ke.alternate;h!==null&&jk(h)}var v=c&(Pt|it|De|Ri);switch(v){case Pt:{nw(ke),ke.flags&=~Pt;break}case Re:{nw(ke),ke.flags&=~Pt;var b=ke.alternate;Pg(b,ke);break}case Ri:{ke.flags&=~Ri;break}case es:{ke.flags&=~Ri;var w=ke.alternate;Pg(w,ke);break}case it:{var A=ke.alternate;Pg(A,ke);break}case De:{$k(r,ke);break}}$n(),ke=ke.nextEffect}}function kI(r,s){for(;ke!==null;){wn(ke);var c=ke.flags;if(c&(it|Dt)){var h=ke.alternate;zk(r,h,ke)}c&ln&&Uk(ke),$n(),ke=ke.nextEffect}}function Yr(){if(zf!==ds){var r=zf>Qi?Qi:zf;return zf=ds,lr(r,zI)}return!1}function II(r,s){qg.push(s,r),ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function yw(r,s){Yg.push(s,r);{r.flags|=sn;var c=r.alternate;c!==null&&(c.flags|=sn)}ta||(ta=!0,Vn(Qi,function(){return Yr(),null}))}function NI(r){var s=r.create;r.destroy=s()}function zI(){if(Yu===null)return!1;var r=Yu,s=Wg;if(Yu=null,Wg=le,(Ye&(Zi|qr))!==dn)throw Error("Cannot flush passive effects while already rendering.");Gg=!0;var c=Ye;Ye|=qr;var h=xp(r),v=Yg;Yg=[];for(var b=0;b<v.length;b+=2){var w=v[b],A=v[b+1],D=w.destroy;w.destroy=void 0;{A.flags&=~sn;var F=A.alternate;F!==null&&(F.flags&=~sn)}if(typeof D=="function"){if(wn(A),Ks(null,D,null),Zs()){if(A===null)throw Error("Should be working on an effect.");var $=Js();Qa(A,$)}$n()}}var X=qg;qg=[];for(var J=0;J<X.length;J+=2){var pe=X[J],ye=X[J+1];{if(wn(ye),Ks(null,NI,null,pe),Zs()){if(ye===null)throw Error("Should be working on an effect.");var Ce=Js();Qa(ye,Ce)}$n()}}for(var Ze=r.current.firstEffect;Ze!==null;){var bt=Ze.nextEffect;Ze.nextEffect=null,Ze.flags&De&&Lw(Ze),Ze=bt}return wp(h),Aw(r,s),Gg=!1,Ye=c,Kn(),gp=Yu===null?0:gp+1,!0}function Jg(r){return qu!==null&&qu.has(r)}function UI(r){qu===null?qu=new Set([r]):qu.add(r)}function jI(r){mp||(mp=!0,$g=r)}var FI=jI;function Sw(r,s,c){var h=Ag(c,s),v=$x(r,h,Rt);vs(r,v);var b=Ji(),w=Sp(r,Rt);w!==null&&(Pa(w,Rt,b),dr(w,b),Ga(w,Rt))}function Qa(r,s){if(r.tag===k){Sw(r,r,s);return}for(var c=r.return;c!==null;){if(c.tag===k){Sw(c,r,s);return}else if(c.tag===_){var h=c.type,v=c.stateNode;if(typeof h.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&!Jg(v)){var b=Ag(s,r),w=Wx(c,b,Rt);vs(c,w);var A=Ji(),D=Sp(c,Rt);if(D!==null)Pa(D,Rt,A),dr(D,A),Ga(D,Rt);else if(typeof v.componentDidCatch=="function"&&!Jg(v))try{v.componentDidCatch(s,b)}catch{}return}}c=c.return}}function BI(r,s,c){var h=r.pingCache;h!==null&&h.delete(s);var v=Ji();Tu(r,c),Ii===r&&fs(Ni,c)&&(ci===dp||ci===fp&&hh(Ni)&&nn()-Vg<lw?Gu(r,le):vp=At(vp,c)),dr(r,v),Ga(r,c)}function HI(r,s){s===Gn&&(s=dI(r));var c=Ji(),h=Sp(r,s);h!==null&&(Pa(h,s,c),dr(h,c),Ga(h,s))}function VI(r,s){var c=Gn,h;h=r.stateNode,h!==null&&h.delete(s),HI(r,c)}function $I(r){return r<120?120:r<480?480:r<1080?1080:r<1920?1920:r<3e3?3e3:r<4320?4320:aI(r/1960)*1960}function WI(){if(Uf>uI)throw Uf=0,Qg=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");gp>cI&&(gp=0,m("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}function qI(){Gi.flushLegacyContextWarning(),Gi.flushPendingUnsafeLifecycleWarnings()}var Cp=null;function bw(r){{if((Ye&Zi)!==dn||!(r.mode&(In|Fr)))return;var s=r.tag;if(s!==M&&s!==k&&s!==_&&s!==R&&s!==Z&&s!==re&&s!==ge&&s!==me)return;var c=xe(r.type)||"ReactComponent";if(Cp!==null){if(Cp.has(c))return;Cp.add(c)}else Cp=new Set([c]);var h=Jn;try{wn(r),m("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{h?wn(r):$n()}}}var Tp=null;function YI(r){{var s=r.tag;if(s!==k&&s!==_&&s!==R&&s!==Z&&s!==re&&s!==ge&&s!==me||(r.flags&sn)!==ct)return;var c=xe(r.type)||"ReactComponent";if(Tp!==null){if(Tp.has(c))return;Tp.add(c)}else Tp=new Set([c]);if(!Gg){var h=Jn;try{wn(r),m("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.",s===_?"the componentWillUnmount method":"a useEffect cleanup function")}finally{h?wn(r):$n()}}}}var ey;{var QI=null;ey=function(r,s,c){var h=Iw(QI,s);try{return jx(r,s,c)}catch(b){if(b!==null&&typeof b=="object"&&typeof b.then=="function")throw b;if(il(),ix(),Vx(s),Iw(s,h),s.mode&Zn&&pg(s),Ks(null,jx,null,r,s,c),Zs()){var v=Js();throw v}else throw b}}}var Ew=!1,ty;ty=new Set;function GI(r){if(Na&&(Ye&Zi)!==dn&&!JD())switch(r.tag){case R:case Z:case ge:{var s=Tn&&xe(Tn.type)||"Unknown",c=s;if(!ty.has(c)){ty.add(c);var h=xe(r.type)||"Unknown";m("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",h,s,s)}break}case _:{Ew||(m("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Ew=!0);break}}}var El={current:!1};function xw(r){if(qn===!0&&Wu.current===!0&&El.current!==!0){var s=Jn;try{wn(r),m(`It looks like you're using the wrong act() around your test interactions.
158
158
  Be sure to use the matching version of act() corresponding to your renderer:
159
159
 
160
160
  // for react-dom:
@@ -166,7 +166,7 @@ act(() => ...);
166
166
  import TestRenderer from react-test-renderer';
167
167
  const {act} = TestRenderer;
168
168
  // ...
169
- act(() => ...);`)}finally{s?wn(r):$n()}}}function Sw(r){qn===!0&&(r.mode&_t)!==Yt&&Wu.current===!1&&El.current===!1&&m(`An update to %s ran an effect, but was not wrapped in act(...).
169
+ act(() => ...);`)}finally{s?wn(r):$n()}}}function ww(r){qn===!0&&(r.mode&_t)!==Yt&&Wu.current===!1&&El.current===!1&&m(`An update to %s ran an effect, but was not wrapped in act(...).
170
170
 
171
171
  When testing, code that causes React state updates should be wrapped into act(...):
172
172
 
@@ -175,7 +175,7 @@ act(() => {
175
175
  });
176
176
  /* assert on the output */
177
177
 
178
- This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,xe(r.type))}function GI(r){if(qn===!0&&Ye===dn&&Wu.current===!1&&El.current===!1){var s=Jn;try{wn(r),m(`An update to %s inside a test was not wrapped in act(...).
178
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,xe(r.type))}function XI(r){if(qn===!0&&Ye===dn&&Wu.current===!1&&El.current===!1){var s=Jn;try{wn(r),m(`An update to %s inside a test was not wrapped in act(...).
179
179
 
180
180
  When testing, code that causes React state updates should be wrapped into act(...):
181
181
 
@@ -184,33 +184,33 @@ act(() => {
184
184
  });
185
185
  /* assert on the output */
186
186
 
187
- This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,xe(r.type))}finally{s?wn(r):$n()}}}var XI=GI,bw=!1;function KI(r){bw===!1&&f.unstable_flushAllWithoutAsserting===void 0&&(r.mode&In||r.mode&Fr)&&(bw=!0,m(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest:
187
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,xe(r.type))}finally{s?wn(r):$n()}}}var KI=XI,Cw=!1;function ZI(r){Cw===!1&&f.unstable_flushAllWithoutAsserting===void 0&&(r.mode&In||r.mode&Fr)&&(Cw=!0,m(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest:
188
188
  jest.mock('scheduler', () => require('scheduler/unstable_mock'));
189
189
 
190
- For more info, visit https://reactjs.org/link/mock-scheduler`))}function ny(r,s){return s*1e3+r.interactionThreadID}function Rp(r){Sl===null?Sl=[r]:Sl.push(r)}function Ew(r,s,c){if(c.size>0){var h=r.pendingInteractionMap,v=h.get(s);v!=null?c.forEach(function(A){v.has(A)||A.__count++,v.add(A)}):(h.set(s,new Set(c)),c.forEach(function(A){A.__count++}));var b=p.__subscriberRef.current;if(b!==null){var w=ny(r,s);b.onWorkScheduled(c,w)}}}function Ga(r,s){Ew(r,s,p.__interactionsRef.current)}function xw(r,s){var c=new Set;if(r.pendingInteractionMap.forEach(function(b,w){Hn(s,w)&&b.forEach(function(A){return c.add(A)})}),r.memoizedInteractions=c,c.size>0){var h=p.__subscriberRef.current;if(h!==null){var v=ny(r,s);try{h.onWorkStarted(c,v)}catch(b){Vn(Nt,function(){throw b})}}}}function ww(r,s){var c=r.pendingLanes,h;try{if(h=p.__subscriberRef.current,h!==null&&r.memoizedInteractions.size>0){var v=ny(r,s);h.onWorkStopped(r.memoizedInteractions,v)}}catch(w){Vn(Nt,function(){throw w})}finally{var b=r.pendingInteractionMap;b.forEach(function(w,A){Hn(c,A)||(b.delete(A),w.forEach(function(D){if(D.__count--,h!==null&&D.__count===0)try{h.onInteractionScheduledWorkCompleted(D)}catch(F){Vn(Nt,function(){throw F})}}))})}}function Cw(){return xl>0}var iy=f.unstable_flushAllWithoutAsserting,Tw=typeof iy=="function";function ry(){if(iy!==void 0)try{return iy()}finally{}else try{for(var r=!1;Yr();)r=!0;return r}finally{}}function Rw(r){try{ry(),rI(function(){ry()?Rw(r):r()})}catch(s){r(s)}}var xl=0;function ZI(r){var s=xl;xl++;var c=Wu.current,h=El.current;Wu.current=!0,El.current=!0;function v(){xl--,Wu.current=c,El.current=h,xl>s&&m("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ")}var b;try{b=lw(r)}catch(A){throw v(),A}if(b!==null&&typeof b=="object"&&typeof b.then=="function"){var w=!1;return typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){w===!1&&m("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")}),{then:function(A,D){w=!0,b.then(function(){if(xl>1||Tw===!0&&c===!0){v(),A();return}Rw(function(F){v(),F?D(F):A()})},function(F){v(),D(F)})}}}else{b!==void 0&&m("The callback passed to act(...) function must return undefined, or a Promise. You returned %s",b);try{xl===1&&(Tw===!1||c===!1)&&ry(),v()}catch(A){throw v(),A}return{then:function(A){m("Do not await the result of calling act(...) with sync logic, it is not a Promise."),A()}}}}function Aw(r){r.sibling=null,r.stateNode=null}var Tr=null,Xu=null,JI=function(r){Tr=r};function Ku(r){{if(Tr===null)return r;var s=Tr(r);return s===void 0?r:s.current}}function sy(r){return Ku(r)}function ay(r){{if(Tr===null)return r;var s=Tr(r);if(s===void 0){if(r!=null&&typeof r.render=="function"){var c=Ku(r.render);if(r.render!==c){var h={$$typeof:nt,render:c};return r.displayName!==void 0&&(h.displayName=r.displayName),h}}return r}return s.current}}function Mw(r,s){{if(Tr===null)return!1;var c=r.elementType,h=s.type,v=!1,b=typeof h=="object"&&h!==null?h.$$typeof:null;switch(r.tag){case _:{typeof h=="function"&&(v=!0);break}case T:{(typeof h=="function"||b===wt)&&(v=!0);break}case Z:{(b===nt||b===wt)&&(v=!0);break}case re:case ge:{(b===Et||b===wt)&&(v=!0);break}default:return!1}if(v){var w=Tr(c);if(w!==void 0&&w===Tr(h))return!0}return!1}}function Ow(r){{if(Tr===null||typeof WeakSet!="function")return;Xu===null&&(Xu=new WeakSet),Xu.add(r)}}var eN=function(r,s){{if(Tr===null)return;var c=s.staleFamilies,h=s.updatedFamilies;Yr(),bp(function(){oy(r.current,h,c)})}},tN=function(r,s){{if(r.context!==fn)return;Yr(),bp(function(){Pw(s,r,null,null)})}};function oy(r,s,c){{var h=r.alternate,v=r.child,b=r.sibling,w=r.tag,A=r.type,D=null;switch(w){case T:case ge:case _:D=A;break;case Z:D=A.render;break}if(Tr===null)throw new Error("Expected resolveFamily to be set during hot reload.");var F=!1,$=!1;if(D!==null){var X=Tr(D);X!==void 0&&(c.has(X)?$=!0:s.has(X)&&(w===_?$=!0:F=!0))}Xu!==null&&(Xu.has(r)||h!==null&&Xu.has(h))&&($=!0),$&&(r._debugNeedsRemount=!0),($||F)&&fi(r,Rt,on),v!==null&&!$&&oy(v,s,c),b!==null&&oy(b,s,c)}}var nN=function(r,s){{var c=new Set,h=new Set(s.map(function(v){return v.current}));return ly(r.current,h,c),c}};function ly(r,s,c){{var h=r.child,v=r.sibling,b=r.tag,w=r.type,A=null;switch(b){case T:case ge:case _:A=w;break;case Z:A=w.render;break}var D=!1;A!==null&&s.has(A)&&(D=!0),D?iN(r,c):h!==null&&ly(h,s,c),v!==null&&ly(v,s,c)}}function iN(r,s){{var c=rN(r,s);if(c)return;for(var h=r;;){switch(h.tag){case P:s.add(h.stateNode);return;case L:s.add(h.stateNode.containerInfo);return;case k:s.add(h.stateNode.containerInfo);return}if(h.return===null)throw new Error("Expected to reach root first.");h=h.return}}}function rN(r,s){for(var c=r,h=!1;;){if(c.tag===P)h=!0,s.add(c.stateNode);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===r)return h;for(;c.sibling===null;){if(c.return===null||c.return===r)return h;c=c.return}c.sibling.return=c.return,c=c.sibling}return!1}var uy;{uy=!1;try{var _w=Object.preventExtensions({})}catch{uy=!0}}var sN=1;function aN(r,s,c,h){this.tag=r,this.key=c,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=s,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=h,this.flags=ct,this.nextEffect=null,this.firstEffect=null,this.lastEffect=null,this.lanes=le,this.childLanes=le,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugID=sN++,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!uy&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var hr=function(r,s,c,h){return new aN(r,s,c,h)};function cy(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function oN(r){return typeof r=="function"&&!cy(r)&&r.defaultProps===void 0}function lN(r){if(typeof r=="function")return cy(r)?_:T;if(r!=null){var s=r.$$typeof;if(s===nt)return Z;if(s===Et)return re}return M}function wl(r,s){var c=r.alternate;c===null?(c=hr(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c._debugID=r._debugID,c._debugSource=r._debugSource,c._debugOwner=r._debugOwner,c._debugHookTypes=r._debugHookTypes,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=ct,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1),c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue;var h=r.dependencies;switch(c.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.selfBaseDuration=r.selfBaseDuration,c.treeBaseDuration=r.treeBaseDuration,c._debugNeedsRemount=r._debugNeedsRemount,c.tag){case M:case T:case ge:c.type=Ku(r.type);break;case _:c.type=sy(r.type);break;case Z:c.type=ay(r.type);break}return c}function uN(r,s){r.flags&=Pt,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null;var c=r.alternate;if(c===null)r.childLanes=le,r.lanes=s,r.child=null,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null,r.selfBaseDuration=0,r.treeBaseDuration=0;else{r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type;var h=c.dependencies;r.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},r.selfBaseDuration=c.selfBaseDuration,r.treeBaseDuration=c.treeBaseDuration}return r}function cN(r){var s;return r===Aa?s=Fr|In|_t:r===hu?s=In|_t:s=Yt,Qn&&(s|=Zn),hr(k,null,null,s)}function fy(r,s,c,h,v,b){var w=M,A=r;if(typeof r=="function")cy(r)?(w=_,A=sy(A)):A=Ku(A);else if(typeof r=="string")w=P;else e:switch(r){case gt:return Cl(c.children,v,b,s);case tr:w=q,v|=Br;break;case gn:w=q,v|=_t;break;case Xt:return fN(c,v,b,s);case ot:return dN(c,v,b,s);case lt:return hN(c,v,b,s);case U:return hy(c,v,b,s);case I:return pN(c,v,b,s);case Kt:default:{if(typeof r=="object"&&r!==null)switch(r.$$typeof){case yt:w=H;break e;case Be:w=ee;break e;case nt:w=Z,A=ay(A);break e;case Et:w=re;break e;case wt:w=be,A=null;break e;case yn:w=me;break e}var D="";{(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(D+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=h?xe(h.type):null;F&&(D+=`
190
+ For more info, visit https://reactjs.org/link/mock-scheduler`))}function ny(r,s){return s*1e3+r.interactionThreadID}function Rp(r){Sl===null?Sl=[r]:Sl.push(r)}function Tw(r,s,c){if(c.size>0){var h=r.pendingInteractionMap,v=h.get(s);v!=null?c.forEach(function(A){v.has(A)||A.__count++,v.add(A)}):(h.set(s,new Set(c)),c.forEach(function(A){A.__count++}));var b=p.__subscriberRef.current;if(b!==null){var w=ny(r,s);b.onWorkScheduled(c,w)}}}function Ga(r,s){Tw(r,s,p.__interactionsRef.current)}function Rw(r,s){var c=new Set;if(r.pendingInteractionMap.forEach(function(b,w){Hn(s,w)&&b.forEach(function(A){return c.add(A)})}),r.memoizedInteractions=c,c.size>0){var h=p.__subscriberRef.current;if(h!==null){var v=ny(r,s);try{h.onWorkStarted(c,v)}catch(b){Vn(Nt,function(){throw b})}}}}function Aw(r,s){var c=r.pendingLanes,h;try{if(h=p.__subscriberRef.current,h!==null&&r.memoizedInteractions.size>0){var v=ny(r,s);h.onWorkStopped(r.memoizedInteractions,v)}}catch(w){Vn(Nt,function(){throw w})}finally{var b=r.pendingInteractionMap;b.forEach(function(w,A){Hn(c,A)||(b.delete(A),w.forEach(function(D){if(D.__count--,h!==null&&D.__count===0)try{h.onInteractionScheduledWorkCompleted(D)}catch(F){Vn(Nt,function(){throw F})}}))})}}function Mw(){return xl>0}var iy=f.unstable_flushAllWithoutAsserting,Ow=typeof iy=="function";function ry(){if(iy!==void 0)try{return iy()}finally{}else try{for(var r=!1;Yr();)r=!0;return r}finally{}}function _w(r){try{ry(),sI(function(){ry()?_w(r):r()})}catch(s){r(s)}}var xl=0;function JI(r){var s=xl;xl++;var c=Wu.current,h=El.current;Wu.current=!0,El.current=!0;function v(){xl--,Wu.current=c,El.current=h,xl>s&&m("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ")}var b;try{b=dw(r)}catch(A){throw v(),A}if(b!==null&&typeof b=="object"&&typeof b.then=="function"){var w=!1;return typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){w===!1&&m("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);")}),{then:function(A,D){w=!0,b.then(function(){if(xl>1||Ow===!0&&c===!0){v(),A();return}_w(function(F){v(),F?D(F):A()})},function(F){v(),D(F)})}}}else{b!==void 0&&m("The callback passed to act(...) function must return undefined, or a Promise. You returned %s",b);try{xl===1&&(Ow===!1||c===!1)&&ry(),v()}catch(A){throw v(),A}return{then:function(A){m("Do not await the result of calling act(...) with sync logic, it is not a Promise."),A()}}}}function Lw(r){r.sibling=null,r.stateNode=null}var Tr=null,Xu=null,eN=function(r){Tr=r};function Ku(r){{if(Tr===null)return r;var s=Tr(r);return s===void 0?r:s.current}}function sy(r){return Ku(r)}function ay(r){{if(Tr===null)return r;var s=Tr(r);if(s===void 0){if(r!=null&&typeof r.render=="function"){var c=Ku(r.render);if(r.render!==c){var h={$$typeof:nt,render:c};return r.displayName!==void 0&&(h.displayName=r.displayName),h}}return r}return s.current}}function Pw(r,s){{if(Tr===null)return!1;var c=r.elementType,h=s.type,v=!1,b=typeof h=="object"&&h!==null?h.$$typeof:null;switch(r.tag){case _:{typeof h=="function"&&(v=!0);break}case R:{(typeof h=="function"||b===wt)&&(v=!0);break}case Z:{(b===nt||b===wt)&&(v=!0);break}case re:case ge:{(b===Et||b===wt)&&(v=!0);break}default:return!1}if(v){var w=Tr(c);if(w!==void 0&&w===Tr(h))return!0}return!1}}function Dw(r){{if(Tr===null||typeof WeakSet!="function")return;Xu===null&&(Xu=new WeakSet),Xu.add(r)}}var tN=function(r,s){{if(Tr===null)return;var c=s.staleFamilies,h=s.updatedFamilies;Yr(),bp(function(){oy(r.current,h,c)})}},nN=function(r,s){{if(r.context!==fn)return;Yr(),bp(function(){Nw(s,r,null,null)})}};function oy(r,s,c){{var h=r.alternate,v=r.child,b=r.sibling,w=r.tag,A=r.type,D=null;switch(w){case R:case ge:case _:D=A;break;case Z:D=A.render;break}if(Tr===null)throw new Error("Expected resolveFamily to be set during hot reload.");var F=!1,$=!1;if(D!==null){var X=Tr(D);X!==void 0&&(c.has(X)?$=!0:s.has(X)&&(w===_?$=!0:F=!0))}Xu!==null&&(Xu.has(r)||h!==null&&Xu.has(h))&&($=!0),$&&(r._debugNeedsRemount=!0),($||F)&&fi(r,Rt,on),v!==null&&!$&&oy(v,s,c),b!==null&&oy(b,s,c)}}var iN=function(r,s){{var c=new Set,h=new Set(s.map(function(v){return v.current}));return ly(r.current,h,c),c}};function ly(r,s,c){{var h=r.child,v=r.sibling,b=r.tag,w=r.type,A=null;switch(b){case R:case ge:case _:A=w;break;case Z:A=w.render;break}var D=!1;A!==null&&s.has(A)&&(D=!0),D?rN(r,c):h!==null&&ly(h,s,c),v!==null&&ly(v,s,c)}}function rN(r,s){{var c=sN(r,s);if(c)return;for(var h=r;;){switch(h.tag){case P:s.add(h.stateNode);return;case L:s.add(h.stateNode.containerInfo);return;case k:s.add(h.stateNode.containerInfo);return}if(h.return===null)throw new Error("Expected to reach root first.");h=h.return}}}function sN(r,s){for(var c=r,h=!1;;){if(c.tag===P)h=!0,s.add(c.stateNode);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===r)return h;for(;c.sibling===null;){if(c.return===null||c.return===r)return h;c=c.return}c.sibling.return=c.return,c=c.sibling}return!1}var uy;{uy=!1;try{var kw=Object.preventExtensions({})}catch{uy=!0}}var aN=1;function oN(r,s,c,h){this.tag=r,this.key=c,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=s,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=h,this.flags=ct,this.nextEffect=null,this.firstEffect=null,this.lastEffect=null,this.lanes=le,this.childLanes=le,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugID=aN++,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!uy&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var hr=function(r,s,c,h){return new oN(r,s,c,h)};function cy(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function lN(r){return typeof r=="function"&&!cy(r)&&r.defaultProps===void 0}function uN(r){if(typeof r=="function")return cy(r)?_:R;if(r!=null){var s=r.$$typeof;if(s===nt)return Z;if(s===Et)return re}return M}function wl(r,s){var c=r.alternate;c===null?(c=hr(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c._debugID=r._debugID,c._debugSource=r._debugSource,c._debugOwner=r._debugOwner,c._debugHookTypes=r._debugHookTypes,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=ct,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1),c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue;var h=r.dependencies;switch(c.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.selfBaseDuration=r.selfBaseDuration,c.treeBaseDuration=r.treeBaseDuration,c._debugNeedsRemount=r._debugNeedsRemount,c.tag){case M:case R:case ge:c.type=Ku(r.type);break;case _:c.type=sy(r.type);break;case Z:c.type=ay(r.type);break}return c}function cN(r,s){r.flags&=Pt,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null;var c=r.alternate;if(c===null)r.childLanes=le,r.lanes=s,r.child=null,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null,r.selfBaseDuration=0,r.treeBaseDuration=0;else{r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type;var h=c.dependencies;r.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},r.selfBaseDuration=c.selfBaseDuration,r.treeBaseDuration=c.treeBaseDuration}return r}function fN(r){var s;return r===Aa?s=Fr|In|_t:r===hu?s=In|_t:s=Yt,Qn&&(s|=Zn),hr(k,null,null,s)}function fy(r,s,c,h,v,b){var w=M,A=r;if(typeof r=="function")cy(r)?(w=_,A=sy(A)):A=Ku(A);else if(typeof r=="string")w=P;else e:switch(r){case gt:return Cl(c.children,v,b,s);case tr:w=q,v|=Br;break;case gn:w=q,v|=_t;break;case Xt:return dN(c,v,b,s);case ot:return hN(c,v,b,s);case lt:return pN(c,v,b,s);case U:return hy(c,v,b,s);case I:return vN(c,v,b,s);case Kt:default:{if(typeof r=="object"&&r!==null)switch(r.$$typeof){case yt:w=H;break e;case Be:w=ee;break e;case nt:w=Z,A=ay(A);break e;case Et:w=re;break e;case wt:w=be,A=null;break e;case yn:w=me;break e}var D="";{(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(D+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=h?xe(h.type):null;F&&(D+=`
191
191
 
192
- Check the render method of \``+F+"`.")}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(r==null?r:typeof r)+"."+D)}}var $=hr(w,c,s,v);return $.elementType=r,$.type=A,$.lanes=b,$._debugOwner=h,$}function dy(r,s,c){var h=null;h=r._owner;var v=r.type,b=r.key,w=r.props,A=fy(v,b,w,h,s,c);return A._debugSource=r._source,A._debugOwner=r._owner,A}function Cl(r,s,c,h){var v=hr(j,r,h,s);return v.lanes=c,v}function fN(r,s,c,h){typeof r.id!="string"&&m('Profiler must specify an "id" as a prop');var v=hr(ie,r,h,s|Zn);return v.elementType=Xt,v.type=Xt,v.lanes=c,v.stateNode={effectDuration:0,passiveEffectDuration:0},v}function dN(r,s,c,h){var v=hr(W,r,h,s);return v.type=ot,v.elementType=ot,v.lanes=c,v}function hN(r,s,c,h){var v=hr(je,r,h,s);return v.type=lt,v.elementType=lt,v.lanes=c,v}function hy(r,s,c,h){var v=hr(tt,r,h,s);return v.type=U,v.elementType=U,v.lanes=c,v}function pN(r,s,c,h){var v=hr(mt,r,h,s);return v.type=I,v.elementType=I,v.lanes=c,v}function py(r,s,c){var h=hr(O,r,null,s);return h.lanes=c,h}function vN(){var r=hr(P,null,null,Yt);return r.elementType="DELETED",r.type="DELETED",r}function vy(r,s,c){var h=r.children!==null?r.children:[],v=hr(L,h,r.key,s);return v.lanes=c,v.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},v}function Lw(r,s){return r===null&&(r=hr(M,null,null,Yt)),r.tag=s.tag,r.key=s.key,r.elementType=s.elementType,r.type=s.type,r.stateNode=s.stateNode,r.return=s.return,r.child=s.child,r.sibling=s.sibling,r.index=s.index,r.ref=s.ref,r.pendingProps=s.pendingProps,r.memoizedProps=s.memoizedProps,r.updateQueue=s.updateQueue,r.memoizedState=s.memoizedState,r.dependencies=s.dependencies,r.mode=s.mode,r.flags=s.flags,r.nextEffect=s.nextEffect,r.firstEffect=s.firstEffect,r.lastEffect=s.lastEffect,r.lanes=s.lanes,r.childLanes=s.childLanes,r.alternate=s.alternate,r.actualDuration=s.actualDuration,r.actualStartTime=s.actualStartTime,r.selfBaseDuration=s.selfBaseDuration,r.treeBaseDuration=s.treeBaseDuration,r._debugID=s._debugID,r._debugSource=s._debugSource,r._debugOwner=s._debugOwner,r._debugNeedsRemount=s._debugNeedsRemount,r._debugHookTypes=s._debugHookTypes,r}function mN(r,s,c){switch(this.tag=s,this.containerInfo=r,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=vr,this.context=null,this.pendingContext=null,this.hydrate=c,this.callbackNode=null,this.callbackPriority=zr,this.eventTimes=jo(le),this.expirationTimes=jo(on),this.pendingLanes=le,this.suspendedLanes=le,this.pingedLanes=le,this.expiredLanes=le,this.mutableReadLanes=le,this.finishedLanes=le,this.entangledLanes=le,this.entanglements=jo(le),tn&&(this.mutableSourceEagerHydrationData=null),this.interactionThreadID=p.unstable_getThreadID(),this.memoizedInteractions=new Set,this.pendingInteractionMap=new Map,s){case hu:this._debugRootType="createBlockingRoot()";break;case Aa:this._debugRootType="createRoot()";break;case Us:this._debugRootType="createLegacyRoot()";break}}function gN(r,s,c,h){var v=new mN(r,s,c),b=cN(s);return v.current=b,b.stateNode=v,ju(b),v}function yN(r,s){var c=s._getVersion,h=c(s._source);r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[s,h]:r.mutableSourceEagerHydrationData.push(s,h)}function SN(r,s,c){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ht,key:h==null?null:""+h,children:r,containerInfo:s,implementation:c}}var my,gy;my=!1,gy={};function bN(r){if(!r)return fn;var s=he(r),c=Wc(s);if(s.tag===_){var h=s.type;if(Yn(h))return du(s,h,c)}return c}function EN(r){var s=he(r);if(s===void 0)throw typeof r.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(r));var c=z(s);return c===null?null:c.stateNode}function xN(r,s){{var c=he(r);if(c===void 0)throw typeof r.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(r));var h=z(c);if(h===null)return null;if(h.mode&_t){var v=xe(c.type)||"Component";if(!gy[v]){gy[v]=!0;var b=Jn;try{wn(h),c.mode&_t?m("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,v):m("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,v)}finally{b?wn(b):$n()}}}return h.stateNode}}function wN(r,s,c,h){return gN(r,s,c)}function Pw(r,s,c,h){pu(s,r);var v=s.current,b=Ji();typeof jest<"u"&&(KI(v),yw(v));var w=Ya(v),A=bN(c);s.context===null?s.context=A:s.pendingContext=A,Na&&Jn!==null&&!my&&(my=!0,m(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
192
+ Check the render method of \``+F+"`.")}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(r==null?r:typeof r)+"."+D)}}var $=hr(w,c,s,v);return $.elementType=r,$.type=A,$.lanes=b,$._debugOwner=h,$}function dy(r,s,c){var h=null;h=r._owner;var v=r.type,b=r.key,w=r.props,A=fy(v,b,w,h,s,c);return A._debugSource=r._source,A._debugOwner=r._owner,A}function Cl(r,s,c,h){var v=hr(j,r,h,s);return v.lanes=c,v}function dN(r,s,c,h){typeof r.id!="string"&&m('Profiler must specify an "id" as a prop');var v=hr(ie,r,h,s|Zn);return v.elementType=Xt,v.type=Xt,v.lanes=c,v.stateNode={effectDuration:0,passiveEffectDuration:0},v}function hN(r,s,c,h){var v=hr(W,r,h,s);return v.type=ot,v.elementType=ot,v.lanes=c,v}function pN(r,s,c,h){var v=hr(je,r,h,s);return v.type=lt,v.elementType=lt,v.lanes=c,v}function hy(r,s,c,h){var v=hr(tt,r,h,s);return v.type=U,v.elementType=U,v.lanes=c,v}function vN(r,s,c,h){var v=hr(mt,r,h,s);return v.type=I,v.elementType=I,v.lanes=c,v}function py(r,s,c){var h=hr(O,r,null,s);return h.lanes=c,h}function mN(){var r=hr(P,null,null,Yt);return r.elementType="DELETED",r.type="DELETED",r}function vy(r,s,c){var h=r.children!==null?r.children:[],v=hr(L,h,r.key,s);return v.lanes=c,v.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},v}function Iw(r,s){return r===null&&(r=hr(M,null,null,Yt)),r.tag=s.tag,r.key=s.key,r.elementType=s.elementType,r.type=s.type,r.stateNode=s.stateNode,r.return=s.return,r.child=s.child,r.sibling=s.sibling,r.index=s.index,r.ref=s.ref,r.pendingProps=s.pendingProps,r.memoizedProps=s.memoizedProps,r.updateQueue=s.updateQueue,r.memoizedState=s.memoizedState,r.dependencies=s.dependencies,r.mode=s.mode,r.flags=s.flags,r.nextEffect=s.nextEffect,r.firstEffect=s.firstEffect,r.lastEffect=s.lastEffect,r.lanes=s.lanes,r.childLanes=s.childLanes,r.alternate=s.alternate,r.actualDuration=s.actualDuration,r.actualStartTime=s.actualStartTime,r.selfBaseDuration=s.selfBaseDuration,r.treeBaseDuration=s.treeBaseDuration,r._debugID=s._debugID,r._debugSource=s._debugSource,r._debugOwner=s._debugOwner,r._debugNeedsRemount=s._debugNeedsRemount,r._debugHookTypes=s._debugHookTypes,r}function gN(r,s,c){switch(this.tag=s,this.containerInfo=r,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=vr,this.context=null,this.pendingContext=null,this.hydrate=c,this.callbackNode=null,this.callbackPriority=zr,this.eventTimes=jo(le),this.expirationTimes=jo(on),this.pendingLanes=le,this.suspendedLanes=le,this.pingedLanes=le,this.expiredLanes=le,this.mutableReadLanes=le,this.finishedLanes=le,this.entangledLanes=le,this.entanglements=jo(le),tn&&(this.mutableSourceEagerHydrationData=null),this.interactionThreadID=p.unstable_getThreadID(),this.memoizedInteractions=new Set,this.pendingInteractionMap=new Map,s){case hu:this._debugRootType="createBlockingRoot()";break;case Aa:this._debugRootType="createRoot()";break;case Us:this._debugRootType="createLegacyRoot()";break}}function yN(r,s,c,h){var v=new gN(r,s,c),b=fN(s);return v.current=b,b.stateNode=v,ju(b),v}function SN(r,s){var c=s._getVersion,h=c(s._source);r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[s,h]:r.mutableSourceEagerHydrationData.push(s,h)}function bN(r,s,c){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ht,key:h==null?null:""+h,children:r,containerInfo:s,implementation:c}}var my,gy;my=!1,gy={};function EN(r){if(!r)return fn;var s=he(r),c=Wc(s);if(s.tag===_){var h=s.type;if(Yn(h))return du(s,h,c)}return c}function xN(r){var s=he(r);if(s===void 0)throw typeof r.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(r));var c=z(s);return c===null?null:c.stateNode}function wN(r,s){{var c=he(r);if(c===void 0)throw typeof r.render=="function"?Error("Unable to find node on an unmounted component."):Error("Argument appears to not be a ReactComponent. Keys: "+Object.keys(r));var h=z(c);if(h===null)return null;if(h.mode&_t){var v=xe(c.type)||"Component";if(!gy[v]){gy[v]=!0;var b=Jn;try{wn(h),c.mode&_t?m("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,v):m("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",s,s,v)}finally{b?wn(b):$n()}}}return h.stateNode}}function CN(r,s,c,h){return yN(r,s,c)}function Nw(r,s,c,h){pu(s,r);var v=s.current,b=Ji();typeof jest<"u"&&(ZI(v),xw(v));var w=Ya(v),A=EN(c);s.context===null?s.context=A:s.pendingContext=A,Na&&Jn!==null&&!my&&(my=!0,m(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
193
193
 
194
- Check the render method of %s.`,xe(Jn.type)||"Unknown"));var D=ps(b,w);return D.payload={element:r},h=h===void 0?null:h,h!==null&&(typeof h!="function"&&m("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",h),D.callback=h),vs(v,D),fi(v,w,b),w}function CN(r){var s=r.current;if(!s.child)return null;switch(s.child.tag){case P:return Ke(s.child.stateNode);default:return s.child.stateNode}}function TN(r){switch(r.tag){case k:var s=r.stateNode;if(s.hydrate){var c=Cu(s);hI(s,c)}break;case W:var h=Ji();bp(function(){return fi(r,Rt,h)});var v=yu;Ap(r,v);break}}function Dw(r,s){var c=r.memoizedState;c!==null&&c.dehydrated!==null&&(c.retryLane=gh(c.retryLane,s))}function Ap(r,s){Dw(r,s);var c=r.alternate;c&&Dw(c,s)}function RN(r){if(r.tag===W){var s=Ji(),c=yu;fi(r,c,s),Ap(r,c)}}function AN(r){if(r.tag===W){var s=Ji(),c=ko;fi(r,c,s),Ap(r,c)}}function MN(r){if(r.tag===W){var s=Ji(),c=Ya(r);fi(r,c,s),Ap(r,c)}}function ON(r,s){var c=Jc();try{return ef(r),s()}finally{ef(c)}}function _N(r){var s=fe(r);return s===null?null:s.tag===Xe?s.stateNode.instance:s.stateNode}var kw=function(r){return!1};function Iw(r){return kw(r)}var Nw=null,zw=null,Uw=null,jw=null,Fw=null,Bw=null,Hw=null,Vw=null;{var $w=function(r,s,c){var h=s[c],v=Array.isArray(r)?r.slice():u({},r);return c+1===s.length?(Array.isArray(v)?v.splice(h,1):delete v[h],v):(v[h]=$w(r[h],s,c+1),v)},Ww=function(r,s){return $w(r,s,0)},qw=function(r,s,c,h){var v=s[h],b=Array.isArray(r)?r.slice():u({},r);if(h+1===s.length){var w=c[h];b[w]=b[v],Array.isArray(b)?b.splice(v,1):delete b[v]}else b[v]=qw(r[v],s,c,h+1);return b},Yw=function(r,s,c){if(s.length!==c.length){S("copyWithRename() expects paths of the same length");return}else for(var h=0;h<c.length-1;h++)if(s[h]!==c[h]){S("copyWithRename() expects paths to be the same except for the deepest key");return}return qw(r,s,c,0)},Qw=function(r,s,c,h){if(c>=s.length)return h;var v=s[c],b=Array.isArray(r)?r.slice():u({},r);return b[v]=Qw(r[v],s,c+1,h),b},Gw=function(r,s,c){return Qw(r,s,0,c)},yy=function(r,s){for(var c=r.memoizedState;c!==null&&s>0;)c=c.next,s--;return c};Nw=function(r,s,c,h){var v=yy(r,s);if(v!==null){var b=Gw(v.memoizedState,c,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},zw=function(r,s,c){var h=yy(r,s);if(h!==null){var v=Ww(h.memoizedState,c);h.memoizedState=v,h.baseState=v,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},Uw=function(r,s,c,h){var v=yy(r,s);if(v!==null){var b=Yw(v.memoizedState,c,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},jw=function(r,s,c){r.pendingProps=Gw(r.memoizedProps,s,c),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},Fw=function(r,s){r.pendingProps=Ww(r.memoizedProps,s),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},Bw=function(r,s,c){r.pendingProps=Yw(r.memoizedProps,s,c),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},Hw=function(r){fi(r,Rt,on)},Vw=function(r){kw=r}}function LN(r){var s=z(r);return s===null?null:s.stateNode}function PN(r){return null}function DN(){return Jn}function kN(r){var s=r.findFiberByHostInstance,c=g.ReactCurrentDispatcher;return Bn({bundleType:r.bundleType,version:r.version,rendererPackageName:r.rendererPackageName,rendererConfig:r.rendererConfig,overrideHookState:Nw,overrideHookStateDeletePath:zw,overrideHookStateRenamePath:Uw,overrideProps:jw,overridePropsDeletePath:Fw,overridePropsRenamePath:Bw,setSuspenseHandler:Vw,scheduleUpdate:Hw,currentDispatcherRef:c,findHostInstanceByFiber:LN,findFiberByHostInstance:s||PN,findHostInstancesForRefresh:nN,scheduleRefresh:eN,scheduleRoot:tN,setRefreshHandler:JI,getCurrentFiber:DN})}return i.IsThisRendererActing=El,i.act=ZI,i.attemptContinuousHydration=AN,i.attemptHydrationAtCurrentPriority=MN,i.attemptSynchronousHydration=TN,i.attemptUserBlockingHydration=RN,i.batchedEventUpdates=gI,i.batchedUpdates=lw,i.createComponentSelector=Yk,i.createContainer=wN,i.createHasPsuedoClassSelector=Qk,i.createPortal=SN,i.createRoleSelector=Gk,i.createTestNameSelector=Kk,i.createTextSelector=Xk,i.deferredUpdates=vI,i.discreteUpdates=yI,i.findAllNodes=ap,i.findBoundingRects=eI,i.findHostInstance=EN,i.findHostInstanceWithNoPortals=_N,i.findHostInstanceWithWarning=xN,i.flushControlled=bI,i.flushDiscreteUpdates=pI,i.flushPassiveEffects=Yr,i.flushSync=bp,i.focusWithin=tI,i.getCurrentUpdateLanePriority=Jc,i.getFindAllNodesFailureDescription=Jk,i.getPublicRootInstance=CN,i.injectIntoDevTools=kN,i.observeVisibleRects=iI,i.registerMutableSourceForHydration=yN,i.runWithPriority=ON,i.shouldSuspend=Iw,i.unbatchedUpdates=SI,i.updateContainer=Pw,i})}(Vf)),Vf.exports}var qf={exports:{}};/** @license React v0.26.2
194
+ Check the render method of %s.`,xe(Jn.type)||"Unknown"));var D=ps(b,w);return D.payload={element:r},h=h===void 0?null:h,h!==null&&(typeof h!="function"&&m("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",h),D.callback=h),vs(v,D),fi(v,w,b),w}function TN(r){var s=r.current;if(!s.child)return null;switch(s.child.tag){case P:return Ke(s.child.stateNode);default:return s.child.stateNode}}function RN(r){switch(r.tag){case k:var s=r.stateNode;if(s.hydrate){var c=Cu(s);pI(s,c)}break;case W:var h=Ji();bp(function(){return fi(r,Rt,h)});var v=yu;Ap(r,v);break}}function zw(r,s){var c=r.memoizedState;c!==null&&c.dehydrated!==null&&(c.retryLane=gh(c.retryLane,s))}function Ap(r,s){zw(r,s);var c=r.alternate;c&&zw(c,s)}function AN(r){if(r.tag===W){var s=Ji(),c=yu;fi(r,c,s),Ap(r,c)}}function MN(r){if(r.tag===W){var s=Ji(),c=ko;fi(r,c,s),Ap(r,c)}}function ON(r){if(r.tag===W){var s=Ji(),c=Ya(r);fi(r,c,s),Ap(r,c)}}function _N(r,s){var c=Jc();try{return ef(r),s()}finally{ef(c)}}function LN(r){var s=de(r);return s===null?null:s.tag===Xe?s.stateNode.instance:s.stateNode}var Uw=function(r){return!1};function jw(r){return Uw(r)}var Fw=null,Bw=null,Hw=null,Vw=null,$w=null,Ww=null,qw=null,Yw=null;{var Qw=function(r,s,c){var h=s[c],v=Array.isArray(r)?r.slice():u({},r);return c+1===s.length?(Array.isArray(v)?v.splice(h,1):delete v[h],v):(v[h]=Qw(r[h],s,c+1),v)},Gw=function(r,s){return Qw(r,s,0)},Xw=function(r,s,c,h){var v=s[h],b=Array.isArray(r)?r.slice():u({},r);if(h+1===s.length){var w=c[h];b[w]=b[v],Array.isArray(b)?b.splice(v,1):delete b[v]}else b[v]=Xw(r[v],s,c,h+1);return b},Kw=function(r,s,c){if(s.length!==c.length){S("copyWithRename() expects paths of the same length");return}else for(var h=0;h<c.length-1;h++)if(s[h]!==c[h]){S("copyWithRename() expects paths to be the same except for the deepest key");return}return Xw(r,s,c,0)},Zw=function(r,s,c,h){if(c>=s.length)return h;var v=s[c],b=Array.isArray(r)?r.slice():u({},r);return b[v]=Zw(r[v],s,c+1,h),b},Jw=function(r,s,c){return Zw(r,s,0,c)},yy=function(r,s){for(var c=r.memoizedState;c!==null&&s>0;)c=c.next,s--;return c};Fw=function(r,s,c,h){var v=yy(r,s);if(v!==null){var b=Jw(v.memoizedState,c,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},Bw=function(r,s,c){var h=yy(r,s);if(h!==null){var v=Gw(h.memoizedState,c);h.memoizedState=v,h.baseState=v,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},Hw=function(r,s,c,h){var v=yy(r,s);if(v!==null){var b=Kw(v.memoizedState,c,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=u({},r.memoizedProps),fi(r,Rt,on)}},Vw=function(r,s,c){r.pendingProps=Jw(r.memoizedProps,s,c),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},$w=function(r,s){r.pendingProps=Gw(r.memoizedProps,s),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},Ww=function(r,s,c){r.pendingProps=Kw(r.memoizedProps,s,c),r.alternate&&(r.alternate.pendingProps=r.pendingProps),fi(r,Rt,on)},qw=function(r){fi(r,Rt,on)},Yw=function(r){Uw=r}}function PN(r){var s=z(r);return s===null?null:s.stateNode}function DN(r){return null}function kN(){return Jn}function IN(r){var s=r.findFiberByHostInstance,c=g.ReactCurrentDispatcher;return Bn({bundleType:r.bundleType,version:r.version,rendererPackageName:r.rendererPackageName,rendererConfig:r.rendererConfig,overrideHookState:Fw,overrideHookStateDeletePath:Bw,overrideHookStateRenamePath:Hw,overrideProps:Vw,overridePropsDeletePath:$w,overridePropsRenamePath:Ww,setSuspenseHandler:Yw,scheduleUpdate:qw,currentDispatcherRef:c,findHostInstanceByFiber:PN,findFiberByHostInstance:s||DN,findHostInstancesForRefresh:iN,scheduleRefresh:tN,scheduleRoot:nN,setRefreshHandler:eN,getCurrentFiber:kN})}return i.IsThisRendererActing=El,i.act=JI,i.attemptContinuousHydration=MN,i.attemptHydrationAtCurrentPriority=ON,i.attemptSynchronousHydration=RN,i.attemptUserBlockingHydration=AN,i.batchedEventUpdates=yI,i.batchedUpdates=dw,i.createComponentSelector=Qk,i.createContainer=CN,i.createHasPsuedoClassSelector=Gk,i.createPortal=bN,i.createRoleSelector=Xk,i.createTestNameSelector=Zk,i.createTextSelector=Kk,i.deferredUpdates=mI,i.discreteUpdates=SI,i.findAllNodes=ap,i.findBoundingRects=tI,i.findHostInstance=xN,i.findHostInstanceWithNoPortals=LN,i.findHostInstanceWithWarning=wN,i.flushControlled=EI,i.flushDiscreteUpdates=vI,i.flushPassiveEffects=Yr,i.flushSync=bp,i.focusWithin=nI,i.getCurrentUpdateLanePriority=Jc,i.getFindAllNodesFailureDescription=eI,i.getPublicRootInstance=TN,i.injectIntoDevTools=IN,i.observeVisibleRects=rI,i.registerMutableSourceForHydration=SN,i.runWithPriority=_N,i.shouldSuspend=jw,i.unbatchedUpdates=bI,i.updateContainer=Nw,i})}(Vf)),Vf.exports}var qf={exports:{}};/** @license React v0.26.2
195
195
  * react-reconciler.production.min.js
196
196
  *
197
197
  * Copyright (c) Facebook, Inc. and its affiliates.
198
198
  *
199
199
  * This source code is licensed under the MIT license found in the
200
200
  * LICENSE file in the root directory of this source tree.
201
- */qf.exports;var Dy;function oC(){return Dy||(Dy=1,function(t){t.exports=function(n){var i={},a=Cy(),u=R,f=My();function p(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" 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,S=60103,m=60106,x=60107,T=60108,_=60114,M=60109,k=60110,L=60112,P=60113,O=60120,j=60115,q=60116,ee=60121,H=60129,Z=60130,ie=60131;if(typeof Symbol=="function"&&Symbol.for){var W=Symbol.for;S=W("react.element"),m=W("react.portal"),x=W("react.fragment"),T=W("react.strict_mode"),_=W("react.profiler"),M=W("react.provider"),k=W("react.context"),L=W("react.forward_ref"),P=W("react.suspense"),O=W("react.suspense_list"),j=W("react.memo"),q=W("react.lazy"),ee=W("react.block"),W("react.scope"),H=W("react.debug_trace_mode"),Z=W("react.offscreen"),ie=W("react.legacy_hidden")}var re=typeof Symbol=="function"&&Symbol.iterator;function ge(o){return o===null||typeof o!="object"?null:(o=re&&o[re]||o["@@iterator"],typeof o=="function"?o:null)}function be(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case m:return"Portal";case _:return"Profiler";case T:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case k:return(o.displayName||"Context")+".Consumer";case M:return(o._context.displayName||"Context")+".Provider";case L:var l=o.render;return l=l.displayName||l.name||"",o.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case j:return be(o.type);case ee:return be(o._render);case q:l=o._payload,o=o._init;try{return be(o(l))}catch{}}return null}function Ee(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,l.flags&1026&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function Ue(o){if(Ee(o)!==o)throw Error(p(188))}function je(o){var l=o.alternate;if(!l){if(l=Ee(o),l===null)throw Error(p(188));return l!==o?null:o}for(var d=o,y=l;;){var E=d.return;if(E===null)break;var C=E.alternate;if(C===null){if(y=E.return,y!==null){d=y;continue}break}if(E.child===C.child){for(C=E.child;C;){if(C===d)return Ue(E),o;if(C===y)return Ue(E),l;C=C.sibling}throw Error(p(188))}if(d.return!==y.return)d=E,y=C;else{for(var N=!1,B=E.child;B;){if(B===d){N=!0,d=E,y=C;break}if(B===y){N=!0,y=E,d=C;break}B=B.sibling}if(!N){for(B=C.child;B;){if(B===d){N=!0,d=C,y=E;break}if(B===y){N=!0,y=C,d=E;break}B=B.sibling}if(!N)throw Error(p(189))}}if(d.alternate!==y)throw Error(p(190))}if(d.tag!==3)throw Error(p(188));return d.stateNode.current===d?o:l}function Xe(o){if(o=je(o),!o)return null;for(var l=o;;){if(l.tag===5||l.tag===6)return l;if(l.child)l.child.return=l,l=l.child;else{if(l===o)break;for(;!l.sibling;){if(!l.return||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function ce(o){if(o=je(o),!o)return null;for(var l=o;;){if(l.tag===5||l.tag===6)return l;if(l.child&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===o)break;for(;!l.sibling;){if(!l.return||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function me(o,l){for(var d=o.alternate;l!==null;){if(l===o||l===d)return!0;l=l.return}return!1}var tt=n.getPublicInstance,mt=n.getRootHostContext,he=n.getChildHostContext,Fe=n.prepareForCommit,$e=n.resetAfterCommit,ht=n.createInstance,gt=n.appendInitialChild,gn=n.finalizeInitialChildren,Xt=n.prepareUpdate,yt=n.shouldSetTextContent,Be=n.createTextInstance,nt=n.scheduleTimeout,ot=n.cancelTimeout,lt=n.noTimeout,Et=n.isPrimaryRenderer,wt=n.supportsMutation,yn=n.supportsPersistence,Kt=n.supportsHydration,tr=n.getInstanceFromNode,U=n.makeOpaqueHydratingObject,I=n.makeClientId,G=n.beforeActiveInstanceBlur,Se=n.afterActiveInstanceBlur,ut=n.preparePortalMount,We=n.supportsTestSelectors,Sn=n.findFiberRoot,ji=n.getBoundingRect,xe=n.getTextContent,ct=n.isHiddenSubtree,pi=n.matchAccessibilityRole,Pt=n.setFocusIfFocusable,it=n.setupIntersectionObserver,Re=n.appendChild,De=n.appendChildToContainer,at=n.commitTextUpdate,Dt=n.commitMount,rt=n.commitUpdate,ln=n.insertBefore,en=n.insertInContainerBefore,Wn=n.removeChild,sn=n.removeChildFromContainer,Ri=n.resetTextContent,es=n.hideInstance,po=n.hideTextInstance,vo=n.unhideInstance,ts=n.unhideTextInstance,Ai=n.clearContainer,Ea=n.cloneInstance,mo=n.createContainerChildSet,ks=n.appendChildToContainerChildSet,nr=n.finalizeContainerChildren,$l=n.replaceContainerChildren,Wl=n.cloneHiddenInstance,ns=n.cloneHiddenTextInstance,Pc=n.canHydrateInstance,Dc=n.canHydrateTextInstance,ql=n.isSuspenseInstancePending,Yl=n.isSuspenseInstanceFallback,z=n.getNextHydratableSibling,fe=n.getFirstHydratableChild,Te=n.hydrateInstance,Ke=n.hydrateTextInstance,Ct=n.getNextHydratableInstanceAfterSuspenseInstance,Ot=n.commitHydratedContainer,pt=n.commitHydratedSuspenseInstance,ft;function bn(o){if(ft===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);ft=l&&l[1]||""}return`
201
+ */qf.exports;var Dy;function fC(){return Dy||(Dy=1,function(t){t.exports=function(n){var i={},a=Cy(),u=T,f=My();function p(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" 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,S=60103,m=60106,x=60107,R=60108,_=60114,M=60109,k=60110,L=60112,P=60113,O=60120,j=60115,q=60116,ee=60121,H=60129,Z=60130,ie=60131;if(typeof Symbol=="function"&&Symbol.for){var W=Symbol.for;S=W("react.element"),m=W("react.portal"),x=W("react.fragment"),R=W("react.strict_mode"),_=W("react.profiler"),M=W("react.provider"),k=W("react.context"),L=W("react.forward_ref"),P=W("react.suspense"),O=W("react.suspense_list"),j=W("react.memo"),q=W("react.lazy"),ee=W("react.block"),W("react.scope"),H=W("react.debug_trace_mode"),Z=W("react.offscreen"),ie=W("react.legacy_hidden")}var re=typeof Symbol=="function"&&Symbol.iterator;function ge(o){return o===null||typeof o!="object"?null:(o=re&&o[re]||o["@@iterator"],typeof o=="function"?o:null)}function be(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case m:return"Portal";case _:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case k:return(o.displayName||"Context")+".Consumer";case M:return(o._context.displayName||"Context")+".Provider";case L:var l=o.render;return l=l.displayName||l.name||"",o.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case j:return be(o.type);case ee:return be(o._render);case q:l=o._payload,o=o._init;try{return be(o(l))}catch{}}return null}function Ee(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,l.flags&1026&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function Ue(o){if(Ee(o)!==o)throw Error(p(188))}function je(o){var l=o.alternate;if(!l){if(l=Ee(o),l===null)throw Error(p(188));return l!==o?null:o}for(var d=o,y=l;;){var E=d.return;if(E===null)break;var C=E.alternate;if(C===null){if(y=E.return,y!==null){d=y;continue}break}if(E.child===C.child){for(C=E.child;C;){if(C===d)return Ue(E),o;if(C===y)return Ue(E),l;C=C.sibling}throw Error(p(188))}if(d.return!==y.return)d=E,y=C;else{for(var N=!1,B=E.child;B;){if(B===d){N=!0,d=E,y=C;break}if(B===y){N=!0,y=E,d=C;break}B=B.sibling}if(!N){for(B=C.child;B;){if(B===d){N=!0,d=C,y=E;break}if(B===y){N=!0,y=C,d=E;break}B=B.sibling}if(!N)throw Error(p(189))}}if(d.alternate!==y)throw Error(p(190))}if(d.tag!==3)throw Error(p(188));return d.stateNode.current===d?o:l}function Xe(o){if(o=je(o),!o)return null;for(var l=o;;){if(l.tag===5||l.tag===6)return l;if(l.child)l.child.return=l,l=l.child;else{if(l===o)break;for(;!l.sibling;){if(!l.return||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function ce(o){if(o=je(o),!o)return null;for(var l=o;;){if(l.tag===5||l.tag===6)return l;if(l.child&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===o)break;for(;!l.sibling;){if(!l.return||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}}return null}function me(o,l){for(var d=o.alternate;l!==null;){if(l===o||l===d)return!0;l=l.return}return!1}var tt=n.getPublicInstance,mt=n.getRootHostContext,he=n.getChildHostContext,Fe=n.prepareForCommit,$e=n.resetAfterCommit,ht=n.createInstance,gt=n.appendInitialChild,gn=n.finalizeInitialChildren,Xt=n.prepareUpdate,yt=n.shouldSetTextContent,Be=n.createTextInstance,nt=n.scheduleTimeout,ot=n.cancelTimeout,lt=n.noTimeout,Et=n.isPrimaryRenderer,wt=n.supportsMutation,yn=n.supportsPersistence,Kt=n.supportsHydration,tr=n.getInstanceFromNode,U=n.makeOpaqueHydratingObject,I=n.makeClientId,G=n.beforeActiveInstanceBlur,Se=n.afterActiveInstanceBlur,ut=n.preparePortalMount,We=n.supportsTestSelectors,Sn=n.findFiberRoot,ji=n.getBoundingRect,xe=n.getTextContent,ct=n.isHiddenSubtree,pi=n.matchAccessibilityRole,Pt=n.setFocusIfFocusable,it=n.setupIntersectionObserver,Re=n.appendChild,De=n.appendChildToContainer,at=n.commitTextUpdate,Dt=n.commitMount,rt=n.commitUpdate,ln=n.insertBefore,en=n.insertInContainerBefore,Wn=n.removeChild,sn=n.removeChildFromContainer,Ri=n.resetTextContent,es=n.hideInstance,po=n.hideTextInstance,vo=n.unhideInstance,ts=n.unhideTextInstance,Ai=n.clearContainer,Ea=n.cloneInstance,mo=n.createContainerChildSet,ks=n.appendChildToContainerChildSet,nr=n.finalizeContainerChildren,$l=n.replaceContainerChildren,Wl=n.cloneHiddenInstance,ns=n.cloneHiddenTextInstance,Pc=n.canHydrateInstance,Dc=n.canHydrateTextInstance,ql=n.isSuspenseInstancePending,Yl=n.isSuspenseInstanceFallback,z=n.getNextHydratableSibling,de=n.getFirstHydratableChild,Te=n.hydrateInstance,Ke=n.hydrateTextInstance,Ct=n.getNextHydratableInstanceAfterSuspenseInstance,Ot=n.commitHydratedContainer,pt=n.commitHydratedSuspenseInstance,ft;function bn(o){if(ft===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);ft=l&&l[1]||""}return`
202
202
  `+ft+o}var jt=!1;function $t(o,l){if(!o||jt)return"";jt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(te){var y=te}Reflect.construct(o,[],l)}else{try{l.call()}catch(te){y=te}o.call(l.prototype)}else{try{throw Error()}catch(te){y=te}o()}}catch(te){if(te&&y&&typeof te.stack=="string"){for(var E=te.stack.split(`
203
203
  `),C=y.stack.split(`
204
204
  `),N=E.length-1,B=C.length-1;1<=N&&0<=B&&E[N]!==C[B];)B--;for(;1<=N&&0<=B;N--,B--)if(E[N]!==C[B]){if(N!==1||B!==1)do if(N--,B--,0>B||E[N]!==C[B])return`
205
- `+E[N].replace(" at new "," at ");while(1<=N&&0<=B);break}}}finally{jt=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?bn(o):""}var jn=[],ii=-1;function Fi(o){return{current:o}}function vt(o){0>ii||(o.current=jn[ii],jn[ii]=null,ii--)}function un(o,l){ii++,jn[ii]=o.current,o.current=l}var vr={},cn=Fi(vr),qn=Fi(!1),Fn=vr;function mr(o,l){var d=o.type.contextTypes;if(!d)return vr;var y=o.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var E={},C;for(C in d)E[C]=l[C];return y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=E),E}function tn(o){return o=o.childContextTypes,o!=null}function Ql(){vt(qn),vt(cn)}function Zd(o,l,d){if(cn.current!==vr)throw Error(p(168));un(cn,l),un(qn,d)}function Jd(o,l,d){var y=o.stateNode;if(o=l.childContextTypes,typeof y.getChildContext!="function")return d;y=y.getChildContext();for(var E in y)if(!(E in o))throw Error(p(108,be(l)||"Unknown",E));return a({},d,y)}function go(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||vr,Fn=cn.current,un(cn,o),un(qn,qn.current),!0}function eh(o,l,d){var y=o.stateNode;if(!y)throw Error(p(169));d?(o=Jd(o,l,Fn),y.__reactInternalMemoizedMergedChildContext=o,vt(qn),vt(cn),un(cn,o)):vt(qn),un(qn,d)}var kc=null,Bi=null,dm=f.unstable_now;dm();var Gl=0,Wt=8;function ir(o){if(1&o)return Wt=15,1;if(2&o)return Wt=14,2;if(4&o)return Wt=13,4;var l=24&o;return l!==0?(Wt=12,l):o&32?(Wt=11,32):(l=192&o,l!==0?(Wt=10,l):o&256?(Wt=9,256):(l=3584&o,l!==0?(Wt=8,l):o&4096?(Wt=7,4096):(l=4186112&o,l!==0?(Wt=6,l):(l=62914560&o,l!==0?(Wt=5,l):o&67108864?(Wt=4,67108864):o&134217728?(Wt=3,134217728):(l=805306368&o,l!==0?(Wt=2,l):1073741824&o?(Wt=1,1073741824):(Wt=8,o))))))}function hm(o){switch(o){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function pm(o){switch(o){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(p(358,o))}}function yo(o,l){var d=o.pendingLanes;if(d===0)return Wt=0;var y=0,E=0,C=o.expiredLanes,N=o.suspendedLanes,B=o.pingedLanes;if(C!==0)y=C,E=Wt=15;else if(C=d&134217727,C!==0){var te=C&~N;te!==0?(y=ir(te),E=Wt):(B&=C,B!==0&&(y=ir(B),E=Wt))}else C=d&~N,C!==0?(y=ir(C),E=Wt):B!==0&&(y=ir(B),E=Wt);if(y===0)return 0;if(y=31-is(y),y=d&((0>y?0:1<<y)<<1)-1,l!==0&&l!==y&&!(l&N)){if(ir(l),E<=Wt)return l;Wt=E}if(l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=y;0<l;)d=31-is(l),E=1<<d,y|=o[d],l&=~E;return y}function th(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Xl(o,l){switch(o){case 15:return 1;case 14:return 2;case 12:return o=xa(24&~l),o===0?Xl(10,l):o;case 10:return o=xa(192&~l),o===0?Xl(8,l):o;case 8:return o=xa(3584&~l),o===0&&(o=xa(4186112&~l),o===0&&(o=512)),o;case 2:return l=xa(805306368&~l),l===0&&(l=268435456),l}throw Error(p(358,o))}function xa(o){return o&-o}function Ic(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Kl(o,l,d){o.pendingLanes|=l;var y=l-1;o.suspendedLanes&=y,o.pingedLanes&=y,o=o.eventTimes,l=31-is(l),o[l]=d}var is=Math.clz32?Math.clz32:gm,vm=Math.log,mm=Math.LN2;function gm(o){return o===0?32:31-(vm(o)/mm|0)|0}var nh=f.unstable_runWithPriority,Nc=f.unstable_scheduleCallback,zc=f.unstable_cancelCallback,ym=f.unstable_shouldYield,ih=f.unstable_requestPaint,So=f.unstable_now,Sm=f.unstable_getCurrentPriorityLevel,bo=f.unstable_ImmediatePriority,Uc=f.unstable_UserBlockingPriority,rh=f.unstable_NormalPriority,jc=f.unstable_LowPriority,Fc=f.unstable_IdlePriority,Zl={},bm=ih!==void 0?ih:function(){},Lr=null,Jl=null,Bc=!1,eu=So(),Dn=1e4>eu?So:function(){return So()-eu};function wa(){switch(Sm()){case bo:return 99;case Uc:return 98;case rh:return 97;case jc:return 96;case Fc:return 95;default:throw Error(p(332))}}function sh(o){switch(o){case 99:return bo;case 98:return Uc;case 97:return rh;case 96:return jc;case 95:return Fc;default:throw Error(p(332))}}function Pr(o,l){return o=sh(o),nh(o,l)}function Ca(o,l,d){return o=sh(o),Nc(o,l,d)}function Hi(){if(Jl!==null){var o=Jl;Jl=null,zc(o)}ah()}function ah(){if(!Bc&&Lr!==null){Bc=!0;var o=0;try{var l=Lr;Pr(99,function(){for(;o<l.length;o++){var d=l[o];do d=d(!0);while(d!==null)}}),Lr=null}catch(d){throw Lr!==null&&(Lr=Lr.slice(o+1)),Nc(bo,Hi),d}finally{Bc=!1}}}var Em=g.ReactCurrentBatchConfig;function xm(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Vi=typeof Object.is=="function"?Object.is:xm,wm=Object.prototype.hasOwnProperty;function tu(o,l){if(Vi(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),y=Object.keys(l);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++)if(!wm.call(l,d[y])||!Vi(o[d[y]],l[d[y]]))return!1;return!0}function Cm(o){switch(o.tag){case 5:return bn(o.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 2:case 15:return o=$t(o.type,!1),o;case 11:return o=$t(o.type.render,!1),o;case 22:return o=$t(o.type._render,!1),o;case 1:return o=$t(o.type,!0),o;default:return""}}function rr(o,l){if(o&&o.defaultProps){l=a({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}var nu=Fi(null),iu=null,gr=null,Eo=null;function ru(){Eo=gr=iu=null}function Hc(o,l){o=o.type._context,Et?(un(nu,o._currentValue),o._currentValue=l):(un(nu,o._currentValue2),o._currentValue2=l)}function su(o){var l=nu.current;vt(nu),o=o.type._context,Et?o._currentValue=l:o._currentValue2=l}function Vc(o,l){for(;o!==null;){var d=o.alternate;if((o.childLanes&l)===l){if(d===null||(d.childLanes&l)===l)break;d.childLanes|=l}else o.childLanes|=l,d!==null&&(d.childLanes|=l);o=o.return}}function Is(o,l){iu=o,Eo=gr=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&l&&(Yi=!0),o.firstContext=null)}function Mi(o,l){if(Eo!==o&&l!==!1&&l!==0)if((typeof l!="number"||l===1073741823)&&(Eo=o,l=1073741823),l={context:o,observedBits:l,next:null},gr===null){if(iu===null)throw Error(p(308));gr=l,iu.dependencies={lanes:0,firstContext:l,responders:null}}else gr=gr.next=l;return Et?o._currentValue:o._currentValue2}var Dr=!1;function $i(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function sr(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function yr(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Sr(o,l){if(o=o.updateQueue,o!==null){o=o.shared;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}}function kr(o,l){var d=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var E=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var N={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?E=C=N:C=C.next=N,d=d.next}while(d!==null);C===null?E=C=l:C=C.next=l}else E=C=l;d={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:C,shared:y.shared,effects:y.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Ns(o,l,d,y){var E=o.updateQueue;Dr=!1;var C=E.firstBaseUpdate,N=E.lastBaseUpdate,B=E.shared.pending;if(B!==null){E.shared.pending=null;var te=B,we=te.next;te.next=null,N===null?C=we:N.next=we,N=te;var He=o.alternate;if(He!==null){He=He.updateQueue;var Je=He.lastBaseUpdate;Je!==N&&(Je===null?He.firstBaseUpdate=we:Je.next=we,He.lastBaseUpdate=te)}}if(C!==null){Je=E.baseState,N=0,He=we=te=null;do{B=C.lane;var Me=C.eventTime;if((y&B)===B){He!==null&&(He=He.next={eventTime:Me,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var kt=o,Qt=C;switch(B=l,Me=d,Qt.tag){case 1:if(kt=Qt.payload,typeof kt=="function"){Je=kt.call(Me,Je,B);break e}Je=kt;break e;case 3:kt.flags=kt.flags&-4097|64;case 0:if(kt=Qt.payload,B=typeof kt=="function"?kt.call(Me,Je,B):kt,B==null)break e;Je=a({},Je,B);break e;case 2:Dr=!0}}C.callback!==null&&(o.flags|=32,B=E.effects,B===null?E.effects=[C]:B.push(C))}else Me={eventTime:Me,lane:B,tag:C.tag,payload:C.payload,callback:C.callback,next:null},He===null?(we=He=Me,te=Je):He=He.next=Me,N|=B;if(C=C.next,C===null){if(B=E.shared.pending,B===null)break;C=B.next,B.next=null,E.lastBaseUpdate=B,E.shared.pending=null}}while(!0);He===null&&(te=Je),E.baseState=te,E.firstBaseUpdate=we,E.lastBaseUpdate=He,qo|=N,o.lanes=N,o.memoizedState=Je}}function xo(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var y=o[l],E=y.callback;if(E!==null){if(y.callback=null,y=d,typeof E!="function")throw Error(p(191,E));E.call(y)}}}var oh=new u.Component().refs;function Ta(o,l,d,y){l=o.memoizedState,d=d(y,l),d=d==null?l:a({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var au={isMounted:function(o){return(o=o._reactInternals)?Ee(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.tag=1,C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Si(),y=An(o),E=yr(d,y);E.tag=2,l!=null&&(E.callback=l),Sr(o,E),Hr(o,y,d)}};function Ra(o,l,d,y,E,C,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,N):l.prototype&&l.prototype.isPureReactComponent?!tu(d,y)||!tu(E,C):!0}function lh(o,l,d){var y=!1,E=vr,C=l.contextType;return typeof C=="object"&&C!==null?C=Mi(C):(E=tn(l)?Fn:cn.current,y=l.contextTypes,C=(y=y!=null)?mr(o,E):vr),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=au,o.stateNode=l,l._reactInternals=o,y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=E,o.__reactInternalMemoizedMaskedChildContext=C),l}function ou(o,l,d,y){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,y),l.state!==o&&au.enqueueReplaceState(l,l.state,null)}function lu(o,l,d,y){var E=o.stateNode;E.props=d,E.state=o.memoizedState,E.refs=oh,$i(o);var C=l.contextType;typeof C=="object"&&C!==null?E.context=Mi(C):(C=tn(l)?Fn:cn.current,E.context=mr(o,C)),Ns(o,d,E,y),E.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Ta(o,l,C,d),E.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(l=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),l!==E.state&&au.enqueueReplaceState(E,E.state,null),Ns(o,d,E,y),E.state=o.memoizedState),typeof E.componentDidMount=="function"&&(o.flags|=4)}var wo=Array.isArray;function rs(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(p(309));var y=d.stateNode}if(!y)throw Error(p(147,o));var E=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(C){var N=y.refs;N===oh&&(N=y.refs={}),C===null?delete N[E]:N[E]=C},l._stringRef=E,l)}if(typeof o!="string")throw Error(p(284));if(!d._owner)throw Error(p(290,o))}return o}function vi(o,l){if(o.type!=="textarea")throw Error(p(31,Object.prototype.toString.call(l)==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":l))}function uu(o){function l(Q,V){if(o){var ne=Q.lastEffect;ne!==null?(ne.nextEffect=V,Q.lastEffect=V):Q.firstEffect=Q.lastEffect=V,V.nextEffect=null,V.flags=8}}function d(Q,V){if(!o)return null;for(;V!==null;)l(Q,V),V=V.sibling;return null}function y(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function E(Q,V){return Q=Ht(Q,V),Q.index=0,Q.sibling=null,Q}function C(Q,V,ne){return Q.index=ne,o?(ne=Q.alternate,ne!==null?(ne=ne.index,ne<V?(Q.flags=2,V):ne):(Q.flags=2,V)):V}function N(Q){return o&&Q.alternate===null&&(Q.flags=2),Q}function B(Q,V,ne,Ae){return V===null||V.tag!==6?(V=al(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function te(Q,V,ne,Ae){return V!==null&&V.elementType===ne.type?(Ae=E(V,ne.props),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae)}function we(Q,V,ne,Ae){return V===null||V.tag!==4||V.stateNode.containerInfo!==ne.containerInfo||V.stateNode.implementation!==ne.implementation?(V=Ha(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne.children||[]),V.return=Q,V)}function He(Q,V,ne,Ae,Ve){return V===null||V.tag!==7?(V=Gs(ne,Q.mode,Ae,Ve),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function Je(Q,V,ne){if(typeof V=="string"||typeof V=="number")return V=al(""+V,Q.mode,ne),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return ne=sl(V.type,V.key,V.props,null,Q.mode,ne),ne.ref=rs(Q,null,V),ne.return=Q,ne;case m:return V=Ha(V,Q.mode,ne),V.return=Q,V}if(wo(V)||ge(V))return V=Gs(V,Q.mode,ne,null),V.return=Q,V;vi(Q,V)}return null}function Me(Q,V,ne,Ae){var Ve=V!==null?V.key:null;if(typeof ne=="string"||typeof ne=="number")return Ve!==null?null:B(Q,V,""+ne,Ae);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ve?ne.type===x?He(Q,V,ne.props.children,Ae,Ve):te(Q,V,ne,Ae):null;case m:return ne.key===Ve?we(Q,V,ne,Ae):null}if(wo(ne)||ge(ne))return Ve!==null?null:He(Q,V,ne,Ae,null);vi(Q,ne)}return null}function kt(Q,V,ne,Ae,Ve){if(typeof Ae=="string"||typeof Ae=="number")return Q=Q.get(ne)||null,B(V,Q,""+Ae,Ve);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case S:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,Ae.type===x?He(V,Q,Ae.props.children,Ve,Ae.key):te(V,Q,Ae,Ve);case m:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,we(V,Q,Ae,Ve)}if(wo(Ae)||ge(Ae))return Q=Q.get(ne)||null,He(V,Q,Ae,Ve,null);vi(V,Ae)}return null}function Qt(Q,V,ne,Ae){for(var Ve=null,It=null,et=V,Mt=V=0,Cn=null;et!==null&&Mt<ne.length;Mt++){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var St=Me(Q,et,ne[Mt],Ae);if(St===null){et===null&&(et=Cn);break}o&&et&&St.alternate===null&&l(Q,et),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St,et=Cn}if(Mt===ne.length)return d(Q,et),Ve;if(et===null){for(;Mt<ne.length;Mt++)et=Je(Q,ne[Mt],Ae),et!==null&&(V=C(et,V,Mt),It===null?Ve=et:It.sibling=et,It=et);return Ve}for(et=y(Q,et);Mt<ne.length;Mt++)Cn=kt(et,Q,Mt,ne[Mt],Ae),Cn!==null&&(o&&Cn.alternate!==null&&et.delete(Cn.key===null?Mt:Cn.key),V=C(Cn,V,Mt),It===null?Ve=Cn:It.sibling=Cn,It=Cn);return o&&et.forEach(function(Vr){return l(Q,Vr)}),Ve}function ki(Q,V,ne,Ae){var Ve=ge(ne);if(typeof Ve!="function")throw Error(p(150));if(ne=Ve.call(ne),ne==null)throw Error(p(151));for(var It=Ve=null,et=V,Mt=V=0,Cn=null,St=ne.next();et!==null&&!St.done;Mt++,St=ne.next()){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var Vr=Me(Q,et,St.value,Ae);if(Vr===null){et===null&&(et=Cn);break}o&&et&&Vr.alternate===null&&l(Q,et),V=C(Vr,V,Mt),It===null?Ve=Vr:It.sibling=Vr,It=Vr,et=Cn}if(St.done)return d(Q,et),Ve;if(et===null){for(;!St.done;Mt++,St=ne.next())St=Je(Q,St.value,Ae),St!==null&&(V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return Ve}for(et=y(Q,et);!St.done;Mt++,St=ne.next())St=kt(et,Q,Mt,St.value,Ae),St!==null&&(o&&St.alternate!==null&&et.delete(St.key===null?Mt:St.key),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return o&&et.forEach(function(Pm){return l(Q,Pm)}),Ve}return function(Q,V,ne,Ae){var Ve=typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null;Ve&&(ne=ne.props.children);var It=typeof ne=="object"&&ne!==null;if(It)switch(ne.$$typeof){case S:e:{for(It=ne.key,Ve=V;Ve!==null;){if(Ve.key===It){switch(Ve.tag){case 7:if(ne.type===x){d(Q,Ve.sibling),V=E(Ve,ne.props.children),V.return=Q,Q=V;break e}break;default:if(Ve.elementType===ne.type){d(Q,Ve.sibling),V=E(Ve,ne.props),V.ref=rs(Q,Ve,ne),V.return=Q,Q=V;break e}}d(Q,Ve);break}else l(Q,Ve);Ve=Ve.sibling}ne.type===x?(V=Gs(ne.props.children,Q.mode,Ae,ne.key),V.return=Q,Q=V):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Q=Ae)}return N(Q);case m:e:{for(Ve=ne.key;V!==null;){if(V.key===Ve)if(V.tag===4&&V.stateNode.containerInfo===ne.containerInfo&&V.stateNode.implementation===ne.implementation){d(Q,V.sibling),V=E(V,ne.children||[]),V.return=Q,Q=V;break e}else{d(Q,V);break}else l(Q,V);V=V.sibling}V=Ha(ne,Q.mode,Ae),V.return=Q,Q=V}return N(Q)}if(typeof ne=="string"||typeof ne=="number")return ne=""+ne,V!==null&&V.tag===6?(d(Q,V.sibling),V=E(V,ne),V.return=Q,Q=V):(d(Q,V),V=al(ne,Q.mode,Ae),V.return=Q,Q=V),N(Q);if(wo(ne))return Qt(Q,V,ne,Ae);if(ge(ne))return ki(Q,V,ne,Ae);if(It&&vi(Q,ne),typeof ne>"u"&&!Ve)switch(Q.tag){case 1:case 22:case 0:case 11:case 15:throw Error(p(152,be(Q.type)||"Component"))}return d(Q,V)}}var zs=uu(!0),br=uu(!1),Wi={},Ft=Fi(Wi),En=Fi(Wi),ss=Fi(Wi);function fn(o){if(o===Wi)throw Error(p(174));return o}function ar(o,l){un(ss,l),un(En,o),un(Ft,Wi),o=mt(l),vt(Ft),un(Ft,o)}function ri(){vt(Ft),vt(En),vt(ss)}function cu(o){var l=fn(ss.current),d=fn(Ft.current);l=he(d,o.type,l),d!==l&&(un(En,o),un(Ft,l))}function as(o){En.current===o&&(vt(Ft),vt(En))}var an=Fi(0);function Ir(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||ql(d)||Yl(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&64)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var qi=null,Yn=null,Oi=!1;function fu(o,l){var d=Di(5,null,null,0);d.elementType="DELETED",d.type="DELETED",d.stateNode=l,d.return=o,d.flags=8,o.lastEffect!==null?(o.lastEffect.nextEffect=d,o.lastEffect=d):o.firstEffect=o.lastEffect=d}function $c(o,l){switch(o.tag){case 5:return l=Pc(l,o.type,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 6:return l=Dc(l,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 13:return!1;default:return!1}}function du(o){if(Oi){var l=Yn;if(l){var d=l;if(!$c(o,l)){if(l=z(d),!l||!$c(o,l)){o.flags=o.flags&-1025|2,Oi=!1,qi=o;return}fu(qi,d)}qi=o,Yn=fe(l)}else o.flags=o.flags&-1025|2,Oi=!1,qi=o}}function Co(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qi=o}function To(o){if(!Kt||o!==qi)return!1;if(!Oi)return Co(o),Oi=!0,!1;var l=o.type;if(o.tag!==5||l!=="head"&&l!=="body"&&!yt(l,o.memoizedProps))for(l=Yn;l;)fu(o,l),l=z(l);if(Co(o),o.tag===13){if(!Kt)throw Error(p(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(p(317));Yn=Ct(o)}else Yn=qi?z(o.stateNode):null;return!0}function Wc(){Kt&&(Yn=qi=null,Oi=!1)}var Us=[];function hu(){for(var o=0;o<Us.length;o++){var l=Us[o];Et?l._workInProgressVersionPrimary=null:l._workInProgressVersionSecondary=null}Us.length=0}var Aa=g.ReactCurrentDispatcher,si=g.ReactCurrentBatchConfig,mi=0,qt=null,Qn=null,Bn=null,pu=!1,Ro=!1;function gi(){throw Error(p(321))}function qc(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Vi(o[d],l[d]))return!1;return!0}function vu(o,l,d,y,E,C){if(mi=C,qt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Aa.current=o===null||o.memoizedState===null?Do:yu,o=d(y,E),Ro){C=0;do{if(Ro=!1,!(25>C))throw Error(p(301));C+=1,Bn=Qn=null,l.updateQueue=null,Aa.current=Su,o=d(y,E)}while(Ro)}if(Aa.current=Rt,l=Qn!==null&&Qn.next!==null,mi=0,Bn=Qn=qt=null,pu=!1,l)throw Error(p(300));return o}function os(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o,Bn}function ls(){if(Qn===null){var o=qt.alternate;o=o!==null?o.memoizedState:null}else o=Qn.next;var l=Bn===null?qt.memoizedState:Bn.next;if(l!==null)Bn=l,Qn=o;else{if(o===null)throw Error(p(310));Qn=o,o={memoizedState:Qn.memoizedState,baseState:Qn.baseState,baseQueue:Qn.baseQueue,queue:Qn.queue,next:null},Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o}return Bn}function Er(o,l){return typeof l=="function"?l(o):l}function Ma(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=Qn,E=y.baseQueue,C=d.pending;if(C!==null){if(E!==null){var N=E.next;E.next=C.next,C.next=N}y.baseQueue=E=C,d.pending=null}if(E!==null){E=E.next,y=y.baseState;var B=N=C=null,te=E;do{var we=te.lane;if((mi&we)===we)B!==null&&(B=B.next={lane:0,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null}),y=te.eagerReducer===o?te.eagerState:o(y,te.action);else{var He={lane:we,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null};B===null?(N=B=He,C=y):B=B.next=He,qt.lanes|=we,qo|=we}te=te.next}while(te!==null&&te!==E);B===null?C=y:B.next=N,Vi(y,l.memoizedState)||(Yi=!0),l.memoizedState=y,l.baseState=C,l.baseQueue=B,d.lastRenderedState=y}return[l.memoizedState,d.dispatch]}function Ao(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=d.dispatch,E=d.pending,C=l.memoizedState;if(E!==null){d.pending=null;var N=E=E.next;do C=o(C,N.action),N=N.next;while(N!==E);Vi(C,l.memoizedState)||(Yi=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,y]}function js(o,l,d){var y=l._getVersion;y=y(l._source);var E=Et?l._workInProgressVersionPrimary:l._workInProgressVersionSecondary;if(E!==null?o=E===y:(o=o.mutableReadLanes,(o=(mi&o)===o)&&(Et?l._workInProgressVersionPrimary=y:l._workInProgressVersionSecondary=y,Us.push(l))),o)return d(l._source);throw Us.push(l),Error(p(350))}function Mo(o,l,d,y){var E=Xn;if(E===null)throw Error(p(349));var C=l._getVersion,N=C(l._source),B=Aa.current,te=B.useState(function(){return js(E,l,d)}),we=te[1],He=te[0];te=Bn;var Je=o.memoizedState,Me=Je.refs,kt=Me.getSnapshot,Qt=Je.source;Je=Je.subscribe;var ki=qt;return o.memoizedState={refs:Me,source:l,subscribe:y},B.useEffect(function(){Me.getSnapshot=d,Me.setSnapshot=we;var Q=C(l._source);if(!Vi(N,Q)){Q=d(l._source),Vi(He,Q)||(we(Q),Q=An(ki),E.mutableReadLanes|=Q&E.pendingLanes),Q=E.mutableReadLanes,E.entangledLanes|=Q;for(var V=E.entanglements,ne=Q;0<ne;){var Ae=31-is(ne),Ve=1<<Ae;V[Ae]|=Q,ne&=~Ve}}},[d,l,y]),B.useEffect(function(){return y(l._source,function(){var Q=Me.getSnapshot,V=Me.setSnapshot;try{V(Q(l._source));var ne=An(ki);E.mutableReadLanes|=ne&E.pendingLanes}catch(Ae){V(function(){throw Ae})}})},[l,y]),Vi(kt,d)&&Vi(Qt,l)&&Vi(Je,y)||(o={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:He},o.dispatch=we=Gn.bind(null,qt,o),te.queue=o,te.baseQueue=null,He=js(E,l,d),te.memoizedState=te.baseState=He),He}function Yc(o,l,d){var y=ls();return Mo(y,o,l,d)}function us(o){var l=os();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o=l.queue={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:o},o=o.dispatch=Gn.bind(null,qt,o),[l.memoizedState,o]}function Oo(o,l,d,y){return o={tag:o,create:l,destroy:d,deps:y,next:null},l=qt.updateQueue,l===null?(l={lastEffect:null},qt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(y=d.next,d.next=o,o.next=y,l.lastEffect=o)),o}function Fs(o){var l=os();return o={current:o},l.memoizedState=o}function _o(){return ls().memoizedState}function Nr(o,l,d,y){var E=os();qt.flags|=o,E.memoizedState=Oo(1|l,d,void 0,y===void 0?null:y)}function mu(o,l,d,y){var E=ls();y=y===void 0?null:y;var C=void 0;if(Qn!==null){var N=Qn.memoizedState;if(C=N.destroy,y!==null&&qc(y,N.deps)){Oo(l,d,C,y);return}}qt.flags|=o,E.memoizedState=Oo(1|l,d,C,y)}function Lo(o,l){return Nr(516,4,o,l)}function Oa(o,l){return mu(516,4,o,l)}function Qc(o,l){return mu(4,2,o,l)}function Gc(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Po(o,l,d){return d=d!=null?d.concat([o]):null,mu(4,2,Gc.bind(null,l,o),d)}function gu(){}function zr(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(d.memoizedState=[o,l],o)}function uh(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(o=o(),d.memoizedState=[o,l],o)}function le(o,l){var d=wa();Pr(98>d?98:d,function(){o(!0)}),Pr(97<d?97:d,function(){var y=si.transition;si.transition=1;try{o(!1),l()}finally{si.transition=y}})}function Gn(o,l,d){var y=Si(),E=An(o),C={lane:E,action:d,eagerReducer:null,eagerState:null,next:null},N=l.pending;if(N===null?C.next=C:(C.next=N.next,N.next=C),l.pending=C,N=o.alternate,o===qt||N!==null&&N===qt)Ro=pu=!0;else{if(o.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var B=l.lastRenderedState,te=N(B,d);if(C.eagerReducer=N,C.eagerState=te,Vi(te,B))return}catch{}finally{}Hr(o,E,y)}}var Rt={readContext:Mi,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useOpaqueIdentifier:gi,unstable_isNewReconciler:!1},Do={readContext:Mi,useCallback:function(o,l){return os().memoizedState=[o,l===void 0?null:l],o},useContext:Mi,useEffect:Lo,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,Nr(4,2,Gc.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Nr(4,2,o,l)},useMemo:function(o,l){var d=os();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var y=os();return l=d!==void 0?d(l):l,y.memoizedState=y.baseState=l,o=y.queue={pending:null,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},o=o.dispatch=Gn.bind(null,qt,o),[y.memoizedState,o]},useRef:Fs,useState:us,useDebugValue:gu,useDeferredValue:function(o){var l=us(o),d=l[0],y=l[1];return Lo(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=us(!1),l=o[0];return o=le.bind(null,o[1]),Fs(o),[o,l]},useMutableSource:function(o,l,d){var y=os();return y.memoizedState={refs:{getSnapshot:l,setSnapshot:null},source:o,subscribe:d},Mo(y,o,l,d)},useOpaqueIdentifier:function(){if(Oi){var o=!1,l=U(function(){throw o||(o=!0,d(I())),Error(p(355))}),d=us(l)[1];return!(qt.mode&2)&&(qt.flags|=516,Oo(5,function(){d(I())},void 0,null)),l}return l=I(),us(l),l},unstable_isNewReconciler:!1},yu={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ma,useRef:_o,useState:function(){return Ma(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ma(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ma(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ma(Er)[0]},unstable_isNewReconciler:!1},Su={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ao,useRef:_o,useState:function(){return Ao(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ao(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ao(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ao(Er)[0]},unstable_isNewReconciler:!1},ch=g.ReactCurrentOwner,Yi=!1;function ai(o,l,d,y){l.child=o===null?br(l,null,d,y):zs(l,o.child,d,y)}function bu(o,l,d,y,E){d=d.render;var C=l.ref;return Is(l,E),y=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,y,E),l.child)}function Xc(o,l,d,y,E,C){if(o===null){var N=d.type;return typeof N=="function"&&!df(N)&&N.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=N,Bs(o,l,N,y,E,C)):(o=sl(d.type,null,y,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}return N=o.child,!(E&C)&&(E=N.memoizedProps,d=d.compare,d=d!==null?d:tu,d(E,y)&&o.ref===l.ref)?jr(o,l,C):(l.flags|=1,o=Ht(N,y),o.ref=l.ref,o.return=l,l.child=o)}function Bs(o,l,d,y,E,C){if(o!==null&&tu(o.memoizedProps,y)&&o.ref===l.ref)if(Yi=!1,(C&E)!==0)o.flags&16384&&(Yi=!0);else return l.lanes=o.lanes,jr(o,l,C);return ko(o,l,d,y,C)}function _a(o,l,d){var y=l.pendingProps,E=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden"||y.mode==="unstable-defer-without-hiding")if(!(l.mode&4))l.memoizedState={baseLanes:0},$n(l,d);else if(d&1073741824)l.memoizedState={baseLanes:0},$n(l,C!==null?C.baseLanes:d);else return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o},$n(l,o),null;else C!==null?(y=C.baseLanes|d,l.memoizedState=null):y=d,$n(l,y);return ai(o,l,E,d),l.child}function Hs(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=128)}function ko(o,l,d,y,E){var C=tn(d)?Fn:cn.current;return C=mr(l,C),Is(l,E),d=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,d,E),l.child)}function Kc(o,l,d,y,E){if(tn(d)){var C=!0;go(l)}else C=!1;if(Is(l,E),l.stateNode===null)o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),lh(l,d,y),lu(l,d,y,E),y=!0;else if(o===null){var N=l.stateNode,B=l.memoizedProps;N.props=B;var te=N.context,we=d.contextType;typeof we=="object"&&we!==null?we=Mi(we):(we=tn(d)?Fn:cn.current,we=mr(l,we));var He=d.getDerivedStateFromProps,Je=typeof He=="function"||typeof N.getSnapshotBeforeUpdate=="function";Je||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==y||te!==we)&&ou(l,N,y,we),Dr=!1;var Me=l.memoizedState;N.state=Me,Ns(l,y,N,E),te=l.memoizedState,B!==y||Me!==te||qn.current||Dr?(typeof He=="function"&&(Ta(l,d,He,y),te=l.memoizedState),(B=Dr||Ra(l,d,B,y,Me,te,we))?(Je||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4)):(typeof N.componentDidMount=="function"&&(l.flags|=4),l.memoizedProps=y,l.memoizedState=te),N.props=y,N.state=te,N.context=we,y=B):(typeof N.componentDidMount=="function"&&(l.flags|=4),y=!1)}else{N=l.stateNode,sr(o,l),B=l.memoizedProps,we=l.type===l.elementType?B:rr(l.type,B),N.props=we,Je=l.pendingProps,Me=N.context,te=d.contextType,typeof te=="object"&&te!==null?te=Mi(te):(te=tn(d)?Fn:cn.current,te=mr(l,te));var kt=d.getDerivedStateFromProps;(He=typeof kt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==Je||Me!==te)&&ou(l,N,y,te),Dr=!1,Me=l.memoizedState,N.state=Me,Ns(l,y,N,E);var Qt=l.memoizedState;B!==Je||Me!==Qt||qn.current||Dr?(typeof kt=="function"&&(Ta(l,d,kt,y),Qt=l.memoizedState),(we=Dr||Ra(l,d,we,y,Me,Qt,te))?(He||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Qt,te),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Qt,te)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=256)):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),l.memoizedProps=y,l.memoizedState=Qt),N.props=y,N.state=Qt,N.context=te,y=we):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),y=!1)}return Eu(o,l,d,y,C,E)}function Eu(o,l,d,y,E,C){Hs(o,l);var N=(l.flags&64)!==0;if(!y&&!N)return E&&eh(l,d,!1),jr(o,l,C);y=l.stateNode,ch.current=l;var B=N&&typeof d.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,o!==null&&N?(l.child=zs(l,o.child,null,C),l.child=zs(l,null,B,C)):ai(o,l,B,C),l.memoizedState=y.state,E&&eh(l,d,!0),l.child}function xu(o){var l=o.stateNode;l.pendingContext?Zd(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Zd(o,l.context,!1),ar(o,l.containerInfo)}var _i={dehydrated:null,retryLane:0};function on(o,l,d){var y=l.pendingProps,E=an.current,C=!1,N;return(N=(l.flags&64)!==0)||(N=o!==null&&o.memoizedState===null?!1:(E&2)!==0),N?(C=!0,l.flags&=-65):o!==null&&o.memoizedState===null||y.fallback===void 0||y.unstable_avoidThisFallback===!0||(E|=1),un(an,E&1),o===null?(y.fallback!==void 0&&du(l),o=y.children,E=y.fallback,C?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,o):typeof y.unstable_expectedLoadTime=="number"?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,l.lanes=33554432,o):(d=Ba({mode:"visible",children:o},l.mode,d,null),d.return=l,l.child=d)):o.memoizedState!==null?C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d):C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d)}function Zc(o,l,d,y){var E=o.mode,C=o.child;return l={mode:"hidden",children:l},!(E&2)&&C!==null?(C.childLanes=0,C.pendingProps=l):C=Ba(l,E,0,null),d=Gs(d,E,y,null),C.return=o,d.return=o,C.sibling=d,o.child=C,d}function Jc(o,l,d,y){var E=o.child;return o=E.sibling,d=Ht(E,{mode:"visible",children:d}),!(l.mode&2)&&(d.lanes=y),d.return=l,d.sibling=null,o!==null&&(o.nextEffect=null,o.flags=8,l.firstEffect=l.lastEffect=o),l.child=d}function ef(o,l,d,y,E){var C=l.mode,N=o.child;o=N.sibling;var B={mode:"hidden",children:d};return!(C&2)&&l.child!==N?(d=l.child,d.childLanes=0,d.pendingProps=B,N=d.lastEffect,N!==null?(l.firstEffect=d.firstEffect,l.lastEffect=N,N.nextEffect=null):l.firstEffect=l.lastEffect=null):d=Ht(N,B),o!==null?y=Ht(o,y):(y=Gs(y,C,E,null),y.flags|=2),y.return=l,d.return=l,d.sibling=y,l.child=d,y}function Bt(o,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l),Vc(o.return,l)}function Ur(o,l,d,y,E,C){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:E,lastEffect:C}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=y,N.tail=d,N.tailMode=E,N.lastEffect=C)}function fh(o,l,d){var y=l.pendingProps,E=y.revealOrder,C=y.tail;if(ai(o,l,y.children,d),y=an.current,y&2)y=y&1|2,l.flags|=64;else{if(o!==null&&o.flags&64)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Bt(o,d);else if(o.tag===19)Bt(o,d);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}if(un(an,y),!(l.mode&2))l.memoizedState=null;else switch(E){case"forwards":for(d=l.child,E=null;d!==null;)o=d.alternate,o!==null&&Ir(o)===null&&(E=d),d=d.sibling;d=E,d===null?(E=l.child,l.child=null):(E=d.sibling,d.sibling=null),Ur(l,!1,E,d,C,l.lastEffect);break;case"backwards":for(d=null,E=l.child,l.child=null;E!==null;){if(o=E.alternate,o!==null&&Ir(o)===null){l.child=E;break}o=E.sibling,E.sibling=d,d=E,E=o}Ur(l,!0,d,null,C,l.lastEffect);break;case"together":Ur(l,!1,null,null,void 0,l.lastEffect);break;default:l.memoizedState=null}return l.child}function jr(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),qo|=l.lanes,d&l.childLanes){if(o!==null&&l.child!==o.child)throw Error(p(153));if(l.child!==null){for(o=l.child,d=Ht(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Ht(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}return null}function yi(o){o.flags|=4}var Io,No,wu,Cu;if(wt)Io=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)gt(o,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},No=function(){},wu=function(o,l,d,y,E){if(o=o.memoizedProps,o!==y){var C=l.stateNode,N=fn(Ft.current);d=Xt(C,d,o,y,E,N),(l.updateQueue=d)&&yi(l)}},Cu=function(o,l,d,y){d!==y&&yi(l)};else if(yn){Io=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),gt(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),gt(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Io(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};var tf=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),ks(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),ks(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,tf(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};No=function(o){var l=o.stateNode;if(o.firstEffect!==null){var d=l.containerInfo,y=mo(d);tf(y,o,!1,!1),l.pendingChildren=y,yi(o),nr(d,y)}},wu=function(o,l,d,y,E){var C=o.stateNode,N=o.memoizedProps;if((o=l.firstEffect===null)&&N===y)l.stateNode=C;else{var B=l.stateNode,te=fn(Ft.current),we=null;N!==y&&(we=Xt(B,d,N,y,E,te)),o&&we===null?l.stateNode=C:(C=Ea(C,we,d,N,y,l,o,B),gn(C,d,y,E,te)&&yi(l),l.stateNode=C,o?yi(l):Io(C,l,!1,!1))}},Cu=function(o,l,d,y){d!==y?(o=fn(ss.current),d=fn(Ft.current),l.stateNode=Be(y,o,d,l),yi(l)):l.stateNode=o.stateNode}}else No=function(){},wu=function(){},Cu=function(){};function zo(o,l){if(!Oi)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function dh(o,l,d){var y=l.pendingProps;switch(l.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 tn(l.type)&&Ql(),null;case 3:return ri(),vt(qn),vt(cn),hu(),y=l.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(o===null||o.child===null)&&(To(l)?yi(l):y.hydrate||(l.flags|=256)),No(l),null;case 5:as(l);var E=fn(ss.current);if(d=l.type,o!==null&&l.stateNode!=null)wu(o,l,d,y,E),o.ref!==l.ref&&(l.flags|=128);else{if(!y){if(l.stateNode===null)throw Error(p(166));return null}if(o=fn(Ft.current),To(l)){if(!Kt)throw Error(p(175));o=Te(l.stateNode,l.type,l.memoizedProps,E,o,l),l.updateQueue=o,o!==null&&yi(l)}else{var C=ht(d,y,E,o,l);Io(C,l,!1,!1),l.stateNode=C,gn(C,d,y,E,o)&&yi(l)}l.ref!==null&&(l.flags|=128)}return null;case 6:if(o&&l.stateNode!=null)Cu(o,l,o.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(p(166));if(o=fn(ss.current),E=fn(Ft.current),To(l)){if(!Kt)throw Error(p(176));Ke(l.stateNode,l.memoizedProps,l)&&yi(l)}else l.stateNode=Be(y,o,E,l)}return null;case 13:return vt(an),y=l.memoizedState,l.flags&64?(l.lanes=d,l):(y=y!==null,E=!1,o===null?l.memoizedProps.fallback!==void 0&&To(l):E=o.memoizedState!==null,y&&!E&&l.mode&2&&(o===null&&l.memoizedProps.unstable_avoidThisFallback!==!0||an.current&1?kn===0&&(kn=3):((kn===0||kn===3)&&(kn=4),Xn===null||!(qo&134217727)&&!(Da&134217727)||Ws(Xn,Nt))),yn&&y&&(l.flags|=4),wt&&(y||E)&&(l.flags|=4),null);case 4:return ri(),No(l),o===null&&ut(l.stateNode.containerInfo),null;case 10:return su(l),null;case 17:return tn(l.type)&&Ql(),null;case 19:if(vt(an),y=l.memoizedState,y===null)return null;if(E=(l.flags&64)!==0,C=y.rendering,C===null)if(E)zo(y,!1);else{if(kn!==0||o!==null&&o.flags&64)for(o=l.child;o!==null;){if(C=Ir(o),C!==null){for(l.flags|=64,zo(y,!1),o=C.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),y.lastEffect===null&&(l.firstEffect=null),l.lastEffect=y.lastEffect,o=d,y=l.child;y!==null;)E=y,d=o,E.flags&=2,E.nextEffect=null,E.firstEffect=null,E.lastEffect=null,C=E.alternate,C===null?(E.childLanes=0,E.lanes=d,E.child=null,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=C.childLanes,E.lanes=C.lanes,E.child=C.child,E.memoizedProps=C.memoizedProps,E.memoizedState=C.memoizedState,E.updateQueue=C.updateQueue,E.type=C.type,d=C.dependencies,E.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return un(an,an.current&1|2),l.child}o=o.sibling}y.tail!==null&&Dn()>Pu&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432)}else{if(!E)if(o=Ir(C),o!==null){if(l.flags|=64,E=!0,o=o.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),zo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!C.alternate&&!Oi)return l=l.lastEffect=y.lastEffect,l!==null&&(l.nextEffect=null),null}else 2*Dn()-y.renderingStartTime>Pu&&d!==1073741824&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432);y.isBackwards?(C.sibling=l.child,l.child=C):(o=y.last,o!==null?o.sibling=C:l.child=C,y.last=C)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.lastEffect=l.lastEffect,y.renderingStartTime=Dn(),o.sibling=null,l=an.current,un(an,E?l&1|2:l&1),o):null;case 23:case 24:return wn(),o!==null&&o.memoizedState!==null!=(l.memoizedState!==null)&&y.mode!=="unstable-defer-without-hiding"&&(l.flags|=4),null}throw Error(p(156,l.tag))}function hh(o){switch(o.tag){case 1:tn(o.type)&&Ql();var l=o.flags;return l&4096?(o.flags=l&-4097|64,o):null;case 3:if(ri(),vt(qn),vt(cn),hu(),l=o.flags,l&64)throw Error(p(285));return o.flags=l&-4097|64,o;case 5:return as(o),null;case 13:return vt(an),l=o.flags,l&4096?(o.flags=l&-4097|64,o):null;case 19:return vt(an),null;case 4:return ri(),null;case 10:return su(o),null;case 23:case 24:return wn(),null;default:return null}}function nf(o,l){try{var d="",y=l;do d+=Cm(y),y=y.return;while(y);var E=d}catch(C){E=`
205
+ `+E[N].replace(" at new "," at ");while(1<=N&&0<=B);break}}}finally{jt=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?bn(o):""}var jn=[],ii=-1;function Fi(o){return{current:o}}function vt(o){0>ii||(o.current=jn[ii],jn[ii]=null,ii--)}function un(o,l){ii++,jn[ii]=o.current,o.current=l}var vr={},cn=Fi(vr),qn=Fi(!1),Fn=vr;function mr(o,l){var d=o.type.contextTypes;if(!d)return vr;var y=o.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var E={},C;for(C in d)E[C]=l[C];return y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=E),E}function tn(o){return o=o.childContextTypes,o!=null}function Ql(){vt(qn),vt(cn)}function Zd(o,l,d){if(cn.current!==vr)throw Error(p(168));un(cn,l),un(qn,d)}function Jd(o,l,d){var y=o.stateNode;if(o=l.childContextTypes,typeof y.getChildContext!="function")return d;y=y.getChildContext();for(var E in y)if(!(E in o))throw Error(p(108,be(l)||"Unknown",E));return a({},d,y)}function go(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||vr,Fn=cn.current,un(cn,o),un(qn,qn.current),!0}function eh(o,l,d){var y=o.stateNode;if(!y)throw Error(p(169));d?(o=Jd(o,l,Fn),y.__reactInternalMemoizedMergedChildContext=o,vt(qn),vt(cn),un(cn,o)):vt(qn),un(qn,d)}var kc=null,Bi=null,dm=f.unstable_now;dm();var Gl=0,Wt=8;function ir(o){if(1&o)return Wt=15,1;if(2&o)return Wt=14,2;if(4&o)return Wt=13,4;var l=24&o;return l!==0?(Wt=12,l):o&32?(Wt=11,32):(l=192&o,l!==0?(Wt=10,l):o&256?(Wt=9,256):(l=3584&o,l!==0?(Wt=8,l):o&4096?(Wt=7,4096):(l=4186112&o,l!==0?(Wt=6,l):(l=62914560&o,l!==0?(Wt=5,l):o&67108864?(Wt=4,67108864):o&134217728?(Wt=3,134217728):(l=805306368&o,l!==0?(Wt=2,l):1073741824&o?(Wt=1,1073741824):(Wt=8,o))))))}function hm(o){switch(o){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function pm(o){switch(o){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(p(358,o))}}function yo(o,l){var d=o.pendingLanes;if(d===0)return Wt=0;var y=0,E=0,C=o.expiredLanes,N=o.suspendedLanes,B=o.pingedLanes;if(C!==0)y=C,E=Wt=15;else if(C=d&134217727,C!==0){var te=C&~N;te!==0?(y=ir(te),E=Wt):(B&=C,B!==0&&(y=ir(B),E=Wt))}else C=d&~N,C!==0?(y=ir(C),E=Wt):B!==0&&(y=ir(B),E=Wt);if(y===0)return 0;if(y=31-is(y),y=d&((0>y?0:1<<y)<<1)-1,l!==0&&l!==y&&!(l&N)){if(ir(l),E<=Wt)return l;Wt=E}if(l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=y;0<l;)d=31-is(l),E=1<<d,y|=o[d],l&=~E;return y}function th(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Xl(o,l){switch(o){case 15:return 1;case 14:return 2;case 12:return o=xa(24&~l),o===0?Xl(10,l):o;case 10:return o=xa(192&~l),o===0?Xl(8,l):o;case 8:return o=xa(3584&~l),o===0&&(o=xa(4186112&~l),o===0&&(o=512)),o;case 2:return l=xa(805306368&~l),l===0&&(l=268435456),l}throw Error(p(358,o))}function xa(o){return o&-o}function Ic(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Kl(o,l,d){o.pendingLanes|=l;var y=l-1;o.suspendedLanes&=y,o.pingedLanes&=y,o=o.eventTimes,l=31-is(l),o[l]=d}var is=Math.clz32?Math.clz32:gm,vm=Math.log,mm=Math.LN2;function gm(o){return o===0?32:31-(vm(o)/mm|0)|0}var nh=f.unstable_runWithPriority,Nc=f.unstable_scheduleCallback,zc=f.unstable_cancelCallback,ym=f.unstable_shouldYield,ih=f.unstable_requestPaint,So=f.unstable_now,Sm=f.unstable_getCurrentPriorityLevel,bo=f.unstable_ImmediatePriority,Uc=f.unstable_UserBlockingPriority,rh=f.unstable_NormalPriority,jc=f.unstable_LowPriority,Fc=f.unstable_IdlePriority,Zl={},bm=ih!==void 0?ih:function(){},Lr=null,Jl=null,Bc=!1,eu=So(),Dn=1e4>eu?So:function(){return So()-eu};function wa(){switch(Sm()){case bo:return 99;case Uc:return 98;case rh:return 97;case jc:return 96;case Fc:return 95;default:throw Error(p(332))}}function sh(o){switch(o){case 99:return bo;case 98:return Uc;case 97:return rh;case 96:return jc;case 95:return Fc;default:throw Error(p(332))}}function Pr(o,l){return o=sh(o),nh(o,l)}function Ca(o,l,d){return o=sh(o),Nc(o,l,d)}function Hi(){if(Jl!==null){var o=Jl;Jl=null,zc(o)}ah()}function ah(){if(!Bc&&Lr!==null){Bc=!0;var o=0;try{var l=Lr;Pr(99,function(){for(;o<l.length;o++){var d=l[o];do d=d(!0);while(d!==null)}}),Lr=null}catch(d){throw Lr!==null&&(Lr=Lr.slice(o+1)),Nc(bo,Hi),d}finally{Bc=!1}}}var Em=g.ReactCurrentBatchConfig;function xm(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Vi=typeof Object.is=="function"?Object.is:xm,wm=Object.prototype.hasOwnProperty;function tu(o,l){if(Vi(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),y=Object.keys(l);if(d.length!==y.length)return!1;for(y=0;y<d.length;y++)if(!wm.call(l,d[y])||!Vi(o[d[y]],l[d[y]]))return!1;return!0}function Cm(o){switch(o.tag){case 5:return bn(o.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 2:case 15:return o=$t(o.type,!1),o;case 11:return o=$t(o.type.render,!1),o;case 22:return o=$t(o.type._render,!1),o;case 1:return o=$t(o.type,!0),o;default:return""}}function rr(o,l){if(o&&o.defaultProps){l=a({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}var nu=Fi(null),iu=null,gr=null,Eo=null;function ru(){Eo=gr=iu=null}function Hc(o,l){o=o.type._context,Et?(un(nu,o._currentValue),o._currentValue=l):(un(nu,o._currentValue2),o._currentValue2=l)}function su(o){var l=nu.current;vt(nu),o=o.type._context,Et?o._currentValue=l:o._currentValue2=l}function Vc(o,l){for(;o!==null;){var d=o.alternate;if((o.childLanes&l)===l){if(d===null||(d.childLanes&l)===l)break;d.childLanes|=l}else o.childLanes|=l,d!==null&&(d.childLanes|=l);o=o.return}}function Is(o,l){iu=o,Eo=gr=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&l&&(Yi=!0),o.firstContext=null)}function Mi(o,l){if(Eo!==o&&l!==!1&&l!==0)if((typeof l!="number"||l===1073741823)&&(Eo=o,l=1073741823),l={context:o,observedBits:l,next:null},gr===null){if(iu===null)throw Error(p(308));gr=l,iu.dependencies={lanes:0,firstContext:l,responders:null}}else gr=gr.next=l;return Et?o._currentValue:o._currentValue2}var Dr=!1;function $i(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function sr(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function yr(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Sr(o,l){if(o=o.updateQueue,o!==null){o=o.shared;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}}function kr(o,l){var d=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var E=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var N={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?E=C=N:C=C.next=N,d=d.next}while(d!==null);C===null?E=C=l:C=C.next=l}else E=C=l;d={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:C,shared:y.shared,effects:y.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Ns(o,l,d,y){var E=o.updateQueue;Dr=!1;var C=E.firstBaseUpdate,N=E.lastBaseUpdate,B=E.shared.pending;if(B!==null){E.shared.pending=null;var te=B,we=te.next;te.next=null,N===null?C=we:N.next=we,N=te;var He=o.alternate;if(He!==null){He=He.updateQueue;var Je=He.lastBaseUpdate;Je!==N&&(Je===null?He.firstBaseUpdate=we:Je.next=we,He.lastBaseUpdate=te)}}if(C!==null){Je=E.baseState,N=0,He=we=te=null;do{B=C.lane;var Me=C.eventTime;if((y&B)===B){He!==null&&(He=He.next={eventTime:Me,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var kt=o,Qt=C;switch(B=l,Me=d,Qt.tag){case 1:if(kt=Qt.payload,typeof kt=="function"){Je=kt.call(Me,Je,B);break e}Je=kt;break e;case 3:kt.flags=kt.flags&-4097|64;case 0:if(kt=Qt.payload,B=typeof kt=="function"?kt.call(Me,Je,B):kt,B==null)break e;Je=a({},Je,B);break e;case 2:Dr=!0}}C.callback!==null&&(o.flags|=32,B=E.effects,B===null?E.effects=[C]:B.push(C))}else Me={eventTime:Me,lane:B,tag:C.tag,payload:C.payload,callback:C.callback,next:null},He===null?(we=He=Me,te=Je):He=He.next=Me,N|=B;if(C=C.next,C===null){if(B=E.shared.pending,B===null)break;C=B.next,B.next=null,E.lastBaseUpdate=B,E.shared.pending=null}}while(!0);He===null&&(te=Je),E.baseState=te,E.firstBaseUpdate=we,E.lastBaseUpdate=He,qo|=N,o.lanes=N,o.memoizedState=Je}}function xo(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var y=o[l],E=y.callback;if(E!==null){if(y.callback=null,y=d,typeof E!="function")throw Error(p(191,E));E.call(y)}}}var oh=new u.Component().refs;function Ta(o,l,d,y){l=o.memoizedState,d=d(y,l),d=d==null?l:a({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var au={isMounted:function(o){return(o=o._reactInternals)?Ee(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var y=Si(),E=An(o),C=yr(y,E);C.tag=1,C.payload=l,d!=null&&(C.callback=d),Sr(o,C),Hr(o,E,y)},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Si(),y=An(o),E=yr(d,y);E.tag=2,l!=null&&(E.callback=l),Sr(o,E),Hr(o,y,d)}};function Ra(o,l,d,y,E,C,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,N):l.prototype&&l.prototype.isPureReactComponent?!tu(d,y)||!tu(E,C):!0}function lh(o,l,d){var y=!1,E=vr,C=l.contextType;return typeof C=="object"&&C!==null?C=Mi(C):(E=tn(l)?Fn:cn.current,y=l.contextTypes,C=(y=y!=null)?mr(o,E):vr),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=au,o.stateNode=l,l._reactInternals=o,y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=E,o.__reactInternalMemoizedMaskedChildContext=C),l}function ou(o,l,d,y){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,y),l.state!==o&&au.enqueueReplaceState(l,l.state,null)}function lu(o,l,d,y){var E=o.stateNode;E.props=d,E.state=o.memoizedState,E.refs=oh,$i(o);var C=l.contextType;typeof C=="object"&&C!==null?E.context=Mi(C):(C=tn(l)?Fn:cn.current,E.context=mr(o,C)),Ns(o,d,E,y),E.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Ta(o,l,C,d),E.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(l=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),l!==E.state&&au.enqueueReplaceState(E,E.state,null),Ns(o,d,E,y),E.state=o.memoizedState),typeof E.componentDidMount=="function"&&(o.flags|=4)}var wo=Array.isArray;function rs(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(p(309));var y=d.stateNode}if(!y)throw Error(p(147,o));var E=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(C){var N=y.refs;N===oh&&(N=y.refs={}),C===null?delete N[E]:N[E]=C},l._stringRef=E,l)}if(typeof o!="string")throw Error(p(284));if(!d._owner)throw Error(p(290,o))}return o}function vi(o,l){if(o.type!=="textarea")throw Error(p(31,Object.prototype.toString.call(l)==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":l))}function uu(o){function l(Q,V){if(o){var ne=Q.lastEffect;ne!==null?(ne.nextEffect=V,Q.lastEffect=V):Q.firstEffect=Q.lastEffect=V,V.nextEffect=null,V.flags=8}}function d(Q,V){if(!o)return null;for(;V!==null;)l(Q,V),V=V.sibling;return null}function y(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function E(Q,V){return Q=Ht(Q,V),Q.index=0,Q.sibling=null,Q}function C(Q,V,ne){return Q.index=ne,o?(ne=Q.alternate,ne!==null?(ne=ne.index,ne<V?(Q.flags=2,V):ne):(Q.flags=2,V)):V}function N(Q){return o&&Q.alternate===null&&(Q.flags=2),Q}function B(Q,V,ne,Ae){return V===null||V.tag!==6?(V=al(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function te(Q,V,ne,Ae){return V!==null&&V.elementType===ne.type?(Ae=E(V,ne.props),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Ae)}function we(Q,V,ne,Ae){return V===null||V.tag!==4||V.stateNode.containerInfo!==ne.containerInfo||V.stateNode.implementation!==ne.implementation?(V=Ha(ne,Q.mode,Ae),V.return=Q,V):(V=E(V,ne.children||[]),V.return=Q,V)}function He(Q,V,ne,Ae,Ve){return V===null||V.tag!==7?(V=Gs(ne,Q.mode,Ae,Ve),V.return=Q,V):(V=E(V,ne),V.return=Q,V)}function Je(Q,V,ne){if(typeof V=="string"||typeof V=="number")return V=al(""+V,Q.mode,ne),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case S:return ne=sl(V.type,V.key,V.props,null,Q.mode,ne),ne.ref=rs(Q,null,V),ne.return=Q,ne;case m:return V=Ha(V,Q.mode,ne),V.return=Q,V}if(wo(V)||ge(V))return V=Gs(V,Q.mode,ne,null),V.return=Q,V;vi(Q,V)}return null}function Me(Q,V,ne,Ae){var Ve=V!==null?V.key:null;if(typeof ne=="string"||typeof ne=="number")return Ve!==null?null:B(Q,V,""+ne,Ae);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ve?ne.type===x?He(Q,V,ne.props.children,Ae,Ve):te(Q,V,ne,Ae):null;case m:return ne.key===Ve?we(Q,V,ne,Ae):null}if(wo(ne)||ge(ne))return Ve!==null?null:He(Q,V,ne,Ae,null);vi(Q,ne)}return null}function kt(Q,V,ne,Ae,Ve){if(typeof Ae=="string"||typeof Ae=="number")return Q=Q.get(ne)||null,B(V,Q,""+Ae,Ve);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case S:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,Ae.type===x?He(V,Q,Ae.props.children,Ve,Ae.key):te(V,Q,Ae,Ve);case m:return Q=Q.get(Ae.key===null?ne:Ae.key)||null,we(V,Q,Ae,Ve)}if(wo(Ae)||ge(Ae))return Q=Q.get(ne)||null,He(V,Q,Ae,Ve,null);vi(V,Ae)}return null}function Qt(Q,V,ne,Ae){for(var Ve=null,It=null,et=V,Mt=V=0,Cn=null;et!==null&&Mt<ne.length;Mt++){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var St=Me(Q,et,ne[Mt],Ae);if(St===null){et===null&&(et=Cn);break}o&&et&&St.alternate===null&&l(Q,et),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St,et=Cn}if(Mt===ne.length)return d(Q,et),Ve;if(et===null){for(;Mt<ne.length;Mt++)et=Je(Q,ne[Mt],Ae),et!==null&&(V=C(et,V,Mt),It===null?Ve=et:It.sibling=et,It=et);return Ve}for(et=y(Q,et);Mt<ne.length;Mt++)Cn=kt(et,Q,Mt,ne[Mt],Ae),Cn!==null&&(o&&Cn.alternate!==null&&et.delete(Cn.key===null?Mt:Cn.key),V=C(Cn,V,Mt),It===null?Ve=Cn:It.sibling=Cn,It=Cn);return o&&et.forEach(function(Vr){return l(Q,Vr)}),Ve}function ki(Q,V,ne,Ae){var Ve=ge(ne);if(typeof Ve!="function")throw Error(p(150));if(ne=Ve.call(ne),ne==null)throw Error(p(151));for(var It=Ve=null,et=V,Mt=V=0,Cn=null,St=ne.next();et!==null&&!St.done;Mt++,St=ne.next()){et.index>Mt?(Cn=et,et=null):Cn=et.sibling;var Vr=Me(Q,et,St.value,Ae);if(Vr===null){et===null&&(et=Cn);break}o&&et&&Vr.alternate===null&&l(Q,et),V=C(Vr,V,Mt),It===null?Ve=Vr:It.sibling=Vr,It=Vr,et=Cn}if(St.done)return d(Q,et),Ve;if(et===null){for(;!St.done;Mt++,St=ne.next())St=Je(Q,St.value,Ae),St!==null&&(V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return Ve}for(et=y(Q,et);!St.done;Mt++,St=ne.next())St=kt(et,Q,Mt,St.value,Ae),St!==null&&(o&&St.alternate!==null&&et.delete(St.key===null?Mt:St.key),V=C(St,V,Mt),It===null?Ve=St:It.sibling=St,It=St);return o&&et.forEach(function(Pm){return l(Q,Pm)}),Ve}return function(Q,V,ne,Ae){var Ve=typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null;Ve&&(ne=ne.props.children);var It=typeof ne=="object"&&ne!==null;if(It)switch(ne.$$typeof){case S:e:{for(It=ne.key,Ve=V;Ve!==null;){if(Ve.key===It){switch(Ve.tag){case 7:if(ne.type===x){d(Q,Ve.sibling),V=E(Ve,ne.props.children),V.return=Q,Q=V;break e}break;default:if(Ve.elementType===ne.type){d(Q,Ve.sibling),V=E(Ve,ne.props),V.ref=rs(Q,Ve,ne),V.return=Q,Q=V;break e}}d(Q,Ve);break}else l(Q,Ve);Ve=Ve.sibling}ne.type===x?(V=Gs(ne.props.children,Q.mode,Ae,ne.key),V.return=Q,Q=V):(Ae=sl(ne.type,ne.key,ne.props,null,Q.mode,Ae),Ae.ref=rs(Q,V,ne),Ae.return=Q,Q=Ae)}return N(Q);case m:e:{for(Ve=ne.key;V!==null;){if(V.key===Ve)if(V.tag===4&&V.stateNode.containerInfo===ne.containerInfo&&V.stateNode.implementation===ne.implementation){d(Q,V.sibling),V=E(V,ne.children||[]),V.return=Q,Q=V;break e}else{d(Q,V);break}else l(Q,V);V=V.sibling}V=Ha(ne,Q.mode,Ae),V.return=Q,Q=V}return N(Q)}if(typeof ne=="string"||typeof ne=="number")return ne=""+ne,V!==null&&V.tag===6?(d(Q,V.sibling),V=E(V,ne),V.return=Q,Q=V):(d(Q,V),V=al(ne,Q.mode,Ae),V.return=Q,Q=V),N(Q);if(wo(ne))return Qt(Q,V,ne,Ae);if(ge(ne))return ki(Q,V,ne,Ae);if(It&&vi(Q,ne),typeof ne>"u"&&!Ve)switch(Q.tag){case 1:case 22:case 0:case 11:case 15:throw Error(p(152,be(Q.type)||"Component"))}return d(Q,V)}}var zs=uu(!0),br=uu(!1),Wi={},Ft=Fi(Wi),En=Fi(Wi),ss=Fi(Wi);function fn(o){if(o===Wi)throw Error(p(174));return o}function ar(o,l){un(ss,l),un(En,o),un(Ft,Wi),o=mt(l),vt(Ft),un(Ft,o)}function ri(){vt(Ft),vt(En),vt(ss)}function cu(o){var l=fn(ss.current),d=fn(Ft.current);l=he(d,o.type,l),d!==l&&(un(En,o),un(Ft,l))}function as(o){En.current===o&&(vt(Ft),vt(En))}var an=Fi(0);function Ir(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||ql(d)||Yl(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&64)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var qi=null,Yn=null,Oi=!1;function fu(o,l){var d=Di(5,null,null,0);d.elementType="DELETED",d.type="DELETED",d.stateNode=l,d.return=o,d.flags=8,o.lastEffect!==null?(o.lastEffect.nextEffect=d,o.lastEffect=d):o.firstEffect=o.lastEffect=d}function $c(o,l){switch(o.tag){case 5:return l=Pc(l,o.type,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 6:return l=Dc(l,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 13:return!1;default:return!1}}function du(o){if(Oi){var l=Yn;if(l){var d=l;if(!$c(o,l)){if(l=z(d),!l||!$c(o,l)){o.flags=o.flags&-1025|2,Oi=!1,qi=o;return}fu(qi,d)}qi=o,Yn=de(l)}else o.flags=o.flags&-1025|2,Oi=!1,qi=o}}function Co(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;qi=o}function To(o){if(!Kt||o!==qi)return!1;if(!Oi)return Co(o),Oi=!0,!1;var l=o.type;if(o.tag!==5||l!=="head"&&l!=="body"&&!yt(l,o.memoizedProps))for(l=Yn;l;)fu(o,l),l=z(l);if(Co(o),o.tag===13){if(!Kt)throw Error(p(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(p(317));Yn=Ct(o)}else Yn=qi?z(o.stateNode):null;return!0}function Wc(){Kt&&(Yn=qi=null,Oi=!1)}var Us=[];function hu(){for(var o=0;o<Us.length;o++){var l=Us[o];Et?l._workInProgressVersionPrimary=null:l._workInProgressVersionSecondary=null}Us.length=0}var Aa=g.ReactCurrentDispatcher,si=g.ReactCurrentBatchConfig,mi=0,qt=null,Qn=null,Bn=null,pu=!1,Ro=!1;function gi(){throw Error(p(321))}function qc(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Vi(o[d],l[d]))return!1;return!0}function vu(o,l,d,y,E,C){if(mi=C,qt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Aa.current=o===null||o.memoizedState===null?Do:yu,o=d(y,E),Ro){C=0;do{if(Ro=!1,!(25>C))throw Error(p(301));C+=1,Bn=Qn=null,l.updateQueue=null,Aa.current=Su,o=d(y,E)}while(Ro)}if(Aa.current=Rt,l=Qn!==null&&Qn.next!==null,mi=0,Bn=Qn=qt=null,pu=!1,l)throw Error(p(300));return o}function os(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o,Bn}function ls(){if(Qn===null){var o=qt.alternate;o=o!==null?o.memoizedState:null}else o=Qn.next;var l=Bn===null?qt.memoizedState:Bn.next;if(l!==null)Bn=l,Qn=o;else{if(o===null)throw Error(p(310));Qn=o,o={memoizedState:Qn.memoizedState,baseState:Qn.baseState,baseQueue:Qn.baseQueue,queue:Qn.queue,next:null},Bn===null?qt.memoizedState=Bn=o:Bn=Bn.next=o}return Bn}function Er(o,l){return typeof l=="function"?l(o):l}function Ma(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=Qn,E=y.baseQueue,C=d.pending;if(C!==null){if(E!==null){var N=E.next;E.next=C.next,C.next=N}y.baseQueue=E=C,d.pending=null}if(E!==null){E=E.next,y=y.baseState;var B=N=C=null,te=E;do{var we=te.lane;if((mi&we)===we)B!==null&&(B=B.next={lane:0,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null}),y=te.eagerReducer===o?te.eagerState:o(y,te.action);else{var He={lane:we,action:te.action,eagerReducer:te.eagerReducer,eagerState:te.eagerState,next:null};B===null?(N=B=He,C=y):B=B.next=He,qt.lanes|=we,qo|=we}te=te.next}while(te!==null&&te!==E);B===null?C=y:B.next=N,Vi(y,l.memoizedState)||(Yi=!0),l.memoizedState=y,l.baseState=C,l.baseQueue=B,d.lastRenderedState=y}return[l.memoizedState,d.dispatch]}function Ao(o){var l=ls(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=d.dispatch,E=d.pending,C=l.memoizedState;if(E!==null){d.pending=null;var N=E=E.next;do C=o(C,N.action),N=N.next;while(N!==E);Vi(C,l.memoizedState)||(Yi=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,y]}function js(o,l,d){var y=l._getVersion;y=y(l._source);var E=Et?l._workInProgressVersionPrimary:l._workInProgressVersionSecondary;if(E!==null?o=E===y:(o=o.mutableReadLanes,(o=(mi&o)===o)&&(Et?l._workInProgressVersionPrimary=y:l._workInProgressVersionSecondary=y,Us.push(l))),o)return d(l._source);throw Us.push(l),Error(p(350))}function Mo(o,l,d,y){var E=Xn;if(E===null)throw Error(p(349));var C=l._getVersion,N=C(l._source),B=Aa.current,te=B.useState(function(){return js(E,l,d)}),we=te[1],He=te[0];te=Bn;var Je=o.memoizedState,Me=Je.refs,kt=Me.getSnapshot,Qt=Je.source;Je=Je.subscribe;var ki=qt;return o.memoizedState={refs:Me,source:l,subscribe:y},B.useEffect(function(){Me.getSnapshot=d,Me.setSnapshot=we;var Q=C(l._source);if(!Vi(N,Q)){Q=d(l._source),Vi(He,Q)||(we(Q),Q=An(ki),E.mutableReadLanes|=Q&E.pendingLanes),Q=E.mutableReadLanes,E.entangledLanes|=Q;for(var V=E.entanglements,ne=Q;0<ne;){var Ae=31-is(ne),Ve=1<<Ae;V[Ae]|=Q,ne&=~Ve}}},[d,l,y]),B.useEffect(function(){return y(l._source,function(){var Q=Me.getSnapshot,V=Me.setSnapshot;try{V(Q(l._source));var ne=An(ki);E.mutableReadLanes|=ne&E.pendingLanes}catch(Ae){V(function(){throw Ae})}})},[l,y]),Vi(kt,d)&&Vi(Qt,l)&&Vi(Je,y)||(o={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:He},o.dispatch=we=Gn.bind(null,qt,o),te.queue=o,te.baseQueue=null,He=js(E,l,d),te.memoizedState=te.baseState=He),He}function Yc(o,l,d){var y=ls();return Mo(y,o,l,d)}function us(o){var l=os();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o=l.queue={pending:null,dispatch:null,lastRenderedReducer:Er,lastRenderedState:o},o=o.dispatch=Gn.bind(null,qt,o),[l.memoizedState,o]}function Oo(o,l,d,y){return o={tag:o,create:l,destroy:d,deps:y,next:null},l=qt.updateQueue,l===null?(l={lastEffect:null},qt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(y=d.next,d.next=o,o.next=y,l.lastEffect=o)),o}function Fs(o){var l=os();return o={current:o},l.memoizedState=o}function _o(){return ls().memoizedState}function Nr(o,l,d,y){var E=os();qt.flags|=o,E.memoizedState=Oo(1|l,d,void 0,y===void 0?null:y)}function mu(o,l,d,y){var E=ls();y=y===void 0?null:y;var C=void 0;if(Qn!==null){var N=Qn.memoizedState;if(C=N.destroy,y!==null&&qc(y,N.deps)){Oo(l,d,C,y);return}}qt.flags|=o,E.memoizedState=Oo(1|l,d,C,y)}function Lo(o,l){return Nr(516,4,o,l)}function Oa(o,l){return mu(516,4,o,l)}function Qc(o,l){return mu(4,2,o,l)}function Gc(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Po(o,l,d){return d=d!=null?d.concat([o]):null,mu(4,2,Gc.bind(null,l,o),d)}function gu(){}function zr(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(d.memoizedState=[o,l],o)}function uh(o,l){var d=ls();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&qc(l,y[1])?y[0]:(o=o(),d.memoizedState=[o,l],o)}function le(o,l){var d=wa();Pr(98>d?98:d,function(){o(!0)}),Pr(97<d?97:d,function(){var y=si.transition;si.transition=1;try{o(!1),l()}finally{si.transition=y}})}function Gn(o,l,d){var y=Si(),E=An(o),C={lane:E,action:d,eagerReducer:null,eagerState:null,next:null},N=l.pending;if(N===null?C.next=C:(C.next=N.next,N.next=C),l.pending=C,N=o.alternate,o===qt||N!==null&&N===qt)Ro=pu=!0;else{if(o.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var B=l.lastRenderedState,te=N(B,d);if(C.eagerReducer=N,C.eagerState=te,Vi(te,B))return}catch{}finally{}Hr(o,E,y)}}var Rt={readContext:Mi,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useOpaqueIdentifier:gi,unstable_isNewReconciler:!1},Do={readContext:Mi,useCallback:function(o,l){return os().memoizedState=[o,l===void 0?null:l],o},useContext:Mi,useEffect:Lo,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,Nr(4,2,Gc.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Nr(4,2,o,l)},useMemo:function(o,l){var d=os();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var y=os();return l=d!==void 0?d(l):l,y.memoizedState=y.baseState=l,o=y.queue={pending:null,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},o=o.dispatch=Gn.bind(null,qt,o),[y.memoizedState,o]},useRef:Fs,useState:us,useDebugValue:gu,useDeferredValue:function(o){var l=us(o),d=l[0],y=l[1];return Lo(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=us(!1),l=o[0];return o=le.bind(null,o[1]),Fs(o),[o,l]},useMutableSource:function(o,l,d){var y=os();return y.memoizedState={refs:{getSnapshot:l,setSnapshot:null},source:o,subscribe:d},Mo(y,o,l,d)},useOpaqueIdentifier:function(){if(Oi){var o=!1,l=U(function(){throw o||(o=!0,d(I())),Error(p(355))}),d=us(l)[1];return!(qt.mode&2)&&(qt.flags|=516,Oo(5,function(){d(I())},void 0,null)),l}return l=I(),us(l),l},unstable_isNewReconciler:!1},yu={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ma,useRef:_o,useState:function(){return Ma(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ma(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ma(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ma(Er)[0]},unstable_isNewReconciler:!1},Su={readContext:Mi,useCallback:zr,useContext:Mi,useEffect:Oa,useImperativeHandle:Po,useLayoutEffect:Qc,useMemo:uh,useReducer:Ao,useRef:_o,useState:function(){return Ao(Er)},useDebugValue:gu,useDeferredValue:function(o){var l=Ao(Er),d=l[0],y=l[1];return Oa(function(){var E=si.transition;si.transition=1;try{y(o)}finally{si.transition=E}},[o]),d},useTransition:function(){var o=Ao(Er)[0];return[_o().current,o]},useMutableSource:Yc,useOpaqueIdentifier:function(){return Ao(Er)[0]},unstable_isNewReconciler:!1},ch=g.ReactCurrentOwner,Yi=!1;function ai(o,l,d,y){l.child=o===null?br(l,null,d,y):zs(l,o.child,d,y)}function bu(o,l,d,y,E){d=d.render;var C=l.ref;return Is(l,E),y=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,y,E),l.child)}function Xc(o,l,d,y,E,C){if(o===null){var N=d.type;return typeof N=="function"&&!df(N)&&N.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=N,Bs(o,l,N,y,E,C)):(o=sl(d.type,null,y,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}return N=o.child,!(E&C)&&(E=N.memoizedProps,d=d.compare,d=d!==null?d:tu,d(E,y)&&o.ref===l.ref)?jr(o,l,C):(l.flags|=1,o=Ht(N,y),o.ref=l.ref,o.return=l,l.child=o)}function Bs(o,l,d,y,E,C){if(o!==null&&tu(o.memoizedProps,y)&&o.ref===l.ref)if(Yi=!1,(C&E)!==0)o.flags&16384&&(Yi=!0);else return l.lanes=o.lanes,jr(o,l,C);return ko(o,l,d,y,C)}function _a(o,l,d){var y=l.pendingProps,E=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden"||y.mode==="unstable-defer-without-hiding")if(!(l.mode&4))l.memoizedState={baseLanes:0},$n(l,d);else if(d&1073741824)l.memoizedState={baseLanes:0},$n(l,C!==null?C.baseLanes:d);else return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o},$n(l,o),null;else C!==null?(y=C.baseLanes|d,l.memoizedState=null):y=d,$n(l,y);return ai(o,l,E,d),l.child}function Hs(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=128)}function ko(o,l,d,y,E){var C=tn(d)?Fn:cn.current;return C=mr(l,C),Is(l,E),d=vu(o,l,d,y,C,E),o!==null&&!Yi?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~E,jr(o,l,E)):(l.flags|=1,ai(o,l,d,E),l.child)}function Kc(o,l,d,y,E){if(tn(d)){var C=!0;go(l)}else C=!1;if(Is(l,E),l.stateNode===null)o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),lh(l,d,y),lu(l,d,y,E),y=!0;else if(o===null){var N=l.stateNode,B=l.memoizedProps;N.props=B;var te=N.context,we=d.contextType;typeof we=="object"&&we!==null?we=Mi(we):(we=tn(d)?Fn:cn.current,we=mr(l,we));var He=d.getDerivedStateFromProps,Je=typeof He=="function"||typeof N.getSnapshotBeforeUpdate=="function";Je||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==y||te!==we)&&ou(l,N,y,we),Dr=!1;var Me=l.memoizedState;N.state=Me,Ns(l,y,N,E),te=l.memoizedState,B!==y||Me!==te||qn.current||Dr?(typeof He=="function"&&(Ta(l,d,He,y),te=l.memoizedState),(B=Dr||Ra(l,d,B,y,Me,te,we))?(Je||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4)):(typeof N.componentDidMount=="function"&&(l.flags|=4),l.memoizedProps=y,l.memoizedState=te),N.props=y,N.state=te,N.context=we,y=B):(typeof N.componentDidMount=="function"&&(l.flags|=4),y=!1)}else{N=l.stateNode,sr(o,l),B=l.memoizedProps,we=l.type===l.elementType?B:rr(l.type,B),N.props=we,Je=l.pendingProps,Me=N.context,te=d.contextType,typeof te=="object"&&te!==null?te=Mi(te):(te=tn(d)?Fn:cn.current,te=mr(l,te));var kt=d.getDerivedStateFromProps;(He=typeof kt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B!==Je||Me!==te)&&ou(l,N,y,te),Dr=!1,Me=l.memoizedState,N.state=Me,Ns(l,y,N,E);var Qt=l.memoizedState;B!==Je||Me!==Qt||qn.current||Dr?(typeof kt=="function"&&(Ta(l,d,kt,y),Qt=l.memoizedState),(we=Dr||Ra(l,d,we,y,Me,Qt,te))?(He||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Qt,te),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Qt,te)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=256)):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),l.memoizedProps=y,l.memoizedState=Qt),N.props=y,N.state=Qt,N.context=te,y=we):(typeof N.componentDidUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&Me===o.memoizedState||(l.flags|=256),y=!1)}return Eu(o,l,d,y,C,E)}function Eu(o,l,d,y,E,C){Hs(o,l);var N=(l.flags&64)!==0;if(!y&&!N)return E&&eh(l,d,!1),jr(o,l,C);y=l.stateNode,ch.current=l;var B=N&&typeof d.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,o!==null&&N?(l.child=zs(l,o.child,null,C),l.child=zs(l,null,B,C)):ai(o,l,B,C),l.memoizedState=y.state,E&&eh(l,d,!0),l.child}function xu(o){var l=o.stateNode;l.pendingContext?Zd(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Zd(o,l.context,!1),ar(o,l.containerInfo)}var _i={dehydrated:null,retryLane:0};function on(o,l,d){var y=l.pendingProps,E=an.current,C=!1,N;return(N=(l.flags&64)!==0)||(N=o!==null&&o.memoizedState===null?!1:(E&2)!==0),N?(C=!0,l.flags&=-65):o!==null&&o.memoizedState===null||y.fallback===void 0||y.unstable_avoidThisFallback===!0||(E|=1),un(an,E&1),o===null?(y.fallback!==void 0&&du(l),o=y.children,E=y.fallback,C?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,o):typeof y.unstable_expectedLoadTime=="number"?(o=Zc(l,o,E,d),l.child.memoizedState={baseLanes:d},l.memoizedState=_i,l.lanes=33554432,o):(d=Ba({mode:"visible",children:o},l.mode,d,null),d.return=l,l.child=d)):o.memoizedState!==null?C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d):C?(y=ef(o,l,y.children,y.fallback,d),C=l.child,E=o.child.memoizedState,C.memoizedState=E===null?{baseLanes:d}:{baseLanes:E.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=_i,y):(d=Jc(o,l,y.children,d),l.memoizedState=null,d)}function Zc(o,l,d,y){var E=o.mode,C=o.child;return l={mode:"hidden",children:l},!(E&2)&&C!==null?(C.childLanes=0,C.pendingProps=l):C=Ba(l,E,0,null),d=Gs(d,E,y,null),C.return=o,d.return=o,C.sibling=d,o.child=C,d}function Jc(o,l,d,y){var E=o.child;return o=E.sibling,d=Ht(E,{mode:"visible",children:d}),!(l.mode&2)&&(d.lanes=y),d.return=l,d.sibling=null,o!==null&&(o.nextEffect=null,o.flags=8,l.firstEffect=l.lastEffect=o),l.child=d}function ef(o,l,d,y,E){var C=l.mode,N=o.child;o=N.sibling;var B={mode:"hidden",children:d};return!(C&2)&&l.child!==N?(d=l.child,d.childLanes=0,d.pendingProps=B,N=d.lastEffect,N!==null?(l.firstEffect=d.firstEffect,l.lastEffect=N,N.nextEffect=null):l.firstEffect=l.lastEffect=null):d=Ht(N,B),o!==null?y=Ht(o,y):(y=Gs(y,C,E,null),y.flags|=2),y.return=l,d.return=l,d.sibling=y,l.child=d,y}function Bt(o,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l),Vc(o.return,l)}function Ur(o,l,d,y,E,C){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:E,lastEffect:C}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=y,N.tail=d,N.tailMode=E,N.lastEffect=C)}function fh(o,l,d){var y=l.pendingProps,E=y.revealOrder,C=y.tail;if(ai(o,l,y.children,d),y=an.current,y&2)y=y&1|2,l.flags|=64;else{if(o!==null&&o.flags&64)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Bt(o,d);else if(o.tag===19)Bt(o,d);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}if(un(an,y),!(l.mode&2))l.memoizedState=null;else switch(E){case"forwards":for(d=l.child,E=null;d!==null;)o=d.alternate,o!==null&&Ir(o)===null&&(E=d),d=d.sibling;d=E,d===null?(E=l.child,l.child=null):(E=d.sibling,d.sibling=null),Ur(l,!1,E,d,C,l.lastEffect);break;case"backwards":for(d=null,E=l.child,l.child=null;E!==null;){if(o=E.alternate,o!==null&&Ir(o)===null){l.child=E;break}o=E.sibling,E.sibling=d,d=E,E=o}Ur(l,!0,d,null,C,l.lastEffect);break;case"together":Ur(l,!1,null,null,void 0,l.lastEffect);break;default:l.memoizedState=null}return l.child}function jr(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),qo|=l.lanes,d&l.childLanes){if(o!==null&&l.child!==o.child)throw Error(p(153));if(l.child!==null){for(o=l.child,d=Ht(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Ht(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}return null}function yi(o){o.flags|=4}var Io,No,wu,Cu;if(wt)Io=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)gt(o,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},No=function(){},wu=function(o,l,d,y,E){if(o=o.memoizedProps,o!==y){var C=l.stateNode,N=fn(Ft.current);d=Xt(C,d,o,y,E,N),(l.updateQueue=d)&&yi(l)}},Cu=function(o,l,d,y){d!==y&&yi(l)};else if(yn){Io=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),gt(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),gt(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,Io(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};var tf=function(o,l,d,y){for(var E=l.child;E!==null;){if(E.tag===5){var C=E.stateNode;d&&y&&(C=Wl(C,E.type,E.memoizedProps,E)),ks(o,C)}else if(E.tag===6)C=E.stateNode,d&&y&&(C=ns(C,E.memoizedProps,E)),ks(o,C);else if(E.tag!==4){if(E.tag===13&&E.flags&4&&(C=E.memoizedState!==null)){var N=E.child;if(N!==null&&(N.child!==null&&(N.child.return=N,tf(o,N,!0,C)),C=N.sibling,C!==null)){C.return=E,E=C;continue}}if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===l)break;for(;E.sibling===null;){if(E.return===null||E.return===l)return;E=E.return}E.sibling.return=E.return,E=E.sibling}};No=function(o){var l=o.stateNode;if(o.firstEffect!==null){var d=l.containerInfo,y=mo(d);tf(y,o,!1,!1),l.pendingChildren=y,yi(o),nr(d,y)}},wu=function(o,l,d,y,E){var C=o.stateNode,N=o.memoizedProps;if((o=l.firstEffect===null)&&N===y)l.stateNode=C;else{var B=l.stateNode,te=fn(Ft.current),we=null;N!==y&&(we=Xt(B,d,N,y,E,te)),o&&we===null?l.stateNode=C:(C=Ea(C,we,d,N,y,l,o,B),gn(C,d,y,E,te)&&yi(l),l.stateNode=C,o?yi(l):Io(C,l,!1,!1))}},Cu=function(o,l,d,y){d!==y?(o=fn(ss.current),d=fn(Ft.current),l.stateNode=Be(y,o,d,l),yi(l)):l.stateNode=o.stateNode}}else No=function(){},wu=function(){},Cu=function(){};function zo(o,l){if(!Oi)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function dh(o,l,d){var y=l.pendingProps;switch(l.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 tn(l.type)&&Ql(),null;case 3:return ri(),vt(qn),vt(cn),hu(),y=l.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(o===null||o.child===null)&&(To(l)?yi(l):y.hydrate||(l.flags|=256)),No(l),null;case 5:as(l);var E=fn(ss.current);if(d=l.type,o!==null&&l.stateNode!=null)wu(o,l,d,y,E),o.ref!==l.ref&&(l.flags|=128);else{if(!y){if(l.stateNode===null)throw Error(p(166));return null}if(o=fn(Ft.current),To(l)){if(!Kt)throw Error(p(175));o=Te(l.stateNode,l.type,l.memoizedProps,E,o,l),l.updateQueue=o,o!==null&&yi(l)}else{var C=ht(d,y,E,o,l);Io(C,l,!1,!1),l.stateNode=C,gn(C,d,y,E,o)&&yi(l)}l.ref!==null&&(l.flags|=128)}return null;case 6:if(o&&l.stateNode!=null)Cu(o,l,o.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(p(166));if(o=fn(ss.current),E=fn(Ft.current),To(l)){if(!Kt)throw Error(p(176));Ke(l.stateNode,l.memoizedProps,l)&&yi(l)}else l.stateNode=Be(y,o,E,l)}return null;case 13:return vt(an),y=l.memoizedState,l.flags&64?(l.lanes=d,l):(y=y!==null,E=!1,o===null?l.memoizedProps.fallback!==void 0&&To(l):E=o.memoizedState!==null,y&&!E&&l.mode&2&&(o===null&&l.memoizedProps.unstable_avoidThisFallback!==!0||an.current&1?kn===0&&(kn=3):((kn===0||kn===3)&&(kn=4),Xn===null||!(qo&134217727)&&!(Da&134217727)||Ws(Xn,Nt))),yn&&y&&(l.flags|=4),wt&&(y||E)&&(l.flags|=4),null);case 4:return ri(),No(l),o===null&&ut(l.stateNode.containerInfo),null;case 10:return su(l),null;case 17:return tn(l.type)&&Ql(),null;case 19:if(vt(an),y=l.memoizedState,y===null)return null;if(E=(l.flags&64)!==0,C=y.rendering,C===null)if(E)zo(y,!1);else{if(kn!==0||o!==null&&o.flags&64)for(o=l.child;o!==null;){if(C=Ir(o),C!==null){for(l.flags|=64,zo(y,!1),o=C.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),y.lastEffect===null&&(l.firstEffect=null),l.lastEffect=y.lastEffect,o=d,y=l.child;y!==null;)E=y,d=o,E.flags&=2,E.nextEffect=null,E.firstEffect=null,E.lastEffect=null,C=E.alternate,C===null?(E.childLanes=0,E.lanes=d,E.child=null,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=C.childLanes,E.lanes=C.lanes,E.child=C.child,E.memoizedProps=C.memoizedProps,E.memoizedState=C.memoizedState,E.updateQueue=C.updateQueue,E.type=C.type,d=C.dependencies,E.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return un(an,an.current&1|2),l.child}o=o.sibling}y.tail!==null&&Dn()>Pu&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432)}else{if(!E)if(o=Ir(C),o!==null){if(l.flags|=64,E=!0,o=o.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),zo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!C.alternate&&!Oi)return l=l.lastEffect=y.lastEffect,l!==null&&(l.nextEffect=null),null}else 2*Dn()-y.renderingStartTime>Pu&&d!==1073741824&&(l.flags|=64,E=!0,zo(y,!1),l.lanes=33554432);y.isBackwards?(C.sibling=l.child,l.child=C):(o=y.last,o!==null?o.sibling=C:l.child=C,y.last=C)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.lastEffect=l.lastEffect,y.renderingStartTime=Dn(),o.sibling=null,l=an.current,un(an,E?l&1|2:l&1),o):null;case 23:case 24:return wn(),o!==null&&o.memoizedState!==null!=(l.memoizedState!==null)&&y.mode!=="unstable-defer-without-hiding"&&(l.flags|=4),null}throw Error(p(156,l.tag))}function hh(o){switch(o.tag){case 1:tn(o.type)&&Ql();var l=o.flags;return l&4096?(o.flags=l&-4097|64,o):null;case 3:if(ri(),vt(qn),vt(cn),hu(),l=o.flags,l&64)throw Error(p(285));return o.flags=l&-4097|64,o;case 5:return as(o),null;case 13:return vt(an),l=o.flags,l&4096?(o.flags=l&-4097|64,o):null;case 19:return vt(an),null;case 4:return ri(),null;case 10:return su(o),null;case 23:case 24:return wn(),null;default:return null}}function nf(o,l){try{var d="",y=l;do d+=Cm(y),y=y.return;while(y);var E=d}catch(C){E=`
206
206
  Error generating stack: `+C.message+`
207
207
  `+C.stack}return{value:o,source:l,stack:E}}function La(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var Tm=typeof WeakMap=="function"?WeakMap:Map;function ph(o,l,d){d=yr(-1,d),d.tag=3,d.payload={element:null};var y=l.value;return d.callback=function(){Qo||(Qo=!0,lr=y),La(o,l)},d}function vh(o,l,d){d=yr(-1,d),d.tag=3;var y=o.type.getDerivedStateFromError;if(typeof y=="function"){var E=l.value;d.payload=function(){return La(o,l),y(E)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){typeof y!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this),La(o,l));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})}),d}var Rm=typeof WeakSet=="function"?WeakSet:Set;function mh(o){var l=o.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){fr(o,d)}else l.current=null}function oi(o,l){switch(l.tag){case 0:case 11:case 15:case 22:return;case 1:if(l.flags&256&&o!==null){var d=o.memoizedProps,y=o.memoizedState;o=l.stateNode,l=o.getSnapshotBeforeUpdate(l.elementType===l.type?d:rr(l.type,d),y),o.__reactInternalSnapshotBeforeUpdate=l}return;case 3:wt&&l.flags&256&&Ai(l.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(p(163))}function cs(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var y=d.destroy;d.destroy=void 0,y!==void 0&&y()}d=d.next}while(d!==l)}}function Am(o,l,d){switch(d.tag){case 0:case 11:case 15:case 22:if(l=d.updateQueue,l=l!==null?l.lastEffect:null,l!==null){o=l=l.next;do{if((o.tag&3)===3){var y=o.create;o.destroy=y()}o=o.next}while(o!==l)}if(l=d.updateQueue,l=l!==null?l.lastEffect:null,l!==null){o=l=l.next;do{var E=o;y=E.next,E=E.tag,E&4&&E&1&&(cf(d,o),Iu(d,o)),o=y}while(o!==l)}return;case 1:o=d.stateNode,d.flags&4&&(l===null?o.componentDidMount():(y=d.elementType===d.type?l.memoizedProps:rr(d.type,l.memoizedProps),o.componentDidUpdate(y,l.memoizedState,o.__reactInternalSnapshotBeforeUpdate))),l=d.updateQueue,l!==null&&xo(d,l,o);return;case 3:if(l=d.updateQueue,l!==null){if(o=null,d.child!==null)switch(d.child.tag){case 5:o=tt(d.child.stateNode);break;case 1:o=d.child.stateNode}xo(d,l,o)}return;case 5:o=d.stateNode,l===null&&d.flags&4&&Dt(o,d.type,d.memoizedProps,d);return;case 6:return;case 4:return;case 12:return;case 13:Kt&&d.memoizedState===null&&(d=d.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&pt(d))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(p(163))}function Hn(o,l){if(wt)for(var d=o;;){if(d.tag===5){var y=d.stateNode;l?es(y):vo(d.stateNode,d.memoizedProps)}else if(d.tag===6)y=d.stateNode,l?po(y):ts(y,d.memoizedProps);else if((d.tag!==23&&d.tag!==24||d.memoizedState===null||d===o)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return;d=d.return}d.sibling.return=d.return,d=d.sibling}}function fs(o,l){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount(kc,l)}catch{}switch(l.tag){case 0:case 11:case 14:case 15:case 22:if(o=l.updateQueue,o!==null&&(o=o.lastEffect,o!==null)){var d=o=o.next;do{var y=d,E=y.destroy;if(y=y.tag,E!==void 0)if(y&4)cf(l,d);else{y=l;try{E()}catch(C){fr(y,C)}}d=d.next}while(d!==o)}break;case 1:if(mh(l),o=l.stateNode,typeof o.componentWillUnmount=="function")try{o.props=l.memoizedProps,o.state=l.memoizedState,o.componentWillUnmount()}catch(C){fr(l,C)}break;case 5:mh(l);break;case 4:wt?yh(o,l):yn&&yn&&(l=l.stateNode.containerInfo,o=mo(l),$l(l,o))}}function At(o,l){for(var d=l;;)if(fs(o,d),d.child===null||wt&&d.tag===4){if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else d.child.return=d,d=d.child}function Uo(o){o.alternate=null,o.child=null,o.dependencies=null,o.firstEffect=null,o.lastEffect=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.return=null,o.updateQueue=null}function Mm(o){return o.tag===5||o.tag===3||o.tag===4}function gh(o){if(wt){e:{for(var l=o.return;l!==null;){if(Mm(l))break e;l=l.return}throw Error(p(160))}var d=l;switch(l=d.stateNode,d.tag){case 5:var y=!1;break;case 3:l=l.containerInfo,y=!0;break;case 4:l=l.containerInfo,y=!0;break;default:throw Error(p(161))}d.flags&16&&(Ri(l),d.flags&=-17);e:t:for(d=o;;){for(;d.sibling===null;){if(d.return===null||Mm(d.return)){d=null;break e}d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue t;d.child.return=d,d=d.child}if(!(d.flags&2)){d=d.stateNode;break e}}y?jo(o,d,l):Pa(o,d,l)}}function jo(o,l,d){var y=o.tag,E=y===5||y===6;if(E)o=E?o.stateNode:o.stateNode.instance,l?en(d,o,l):De(d,o);else if(y!==4&&(o=o.child,o!==null))for(jo(o,l,d),o=o.sibling;o!==null;)jo(o,l,d),o=o.sibling}function Pa(o,l,d){var y=o.tag,E=y===5||y===6;if(E)o=E?o.stateNode:o.stateNode.instance,l?ln(d,o,l):Re(d,o);else if(y!==4&&(o=o.child,o!==null))for(Pa(o,l,d),o=o.sibling;o!==null;)Pa(o,l,d),o=o.sibling}function yh(o,l){for(var d=l,y=!1,E,C;;){if(!y){y=d.return;e:for(;;){if(y===null)throw Error(p(160));switch(E=y.stateNode,y.tag){case 5:C=!1;break e;case 3:E=E.containerInfo,C=!0;break e;case 4:E=E.containerInfo,C=!0;break e}y=y.return}y=!0}if(d.tag===5||d.tag===6)At(o,d),C?sn(E,d.stateNode):Wn(E,d.stateNode);else if(d.tag===4){if(d.child!==null){E=d.stateNode.containerInfo,C=!0,d.child.return=d,d=d.child;continue}}else if(fs(o,d),d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return,d.tag===4&&(y=!1)}d.sibling.return=d.return,d=d.sibling}}function Tu(o,l){if(wt){switch(l.tag){case 0:case 11:case 14:case 15:case 22:cs(3,l);return;case 1:return;case 5:var d=l.stateNode;if(d!=null){var y=l.memoizedProps;o=o!==null?o.memoizedProps:y;var E=l.type,C=l.updateQueue;l.updateQueue=null,C!==null&&rt(d,C,E,o,y,l)}return;case 6:if(l.stateNode===null)throw Error(p(162));d=l.memoizedProps,at(l.stateNode,o!==null?o.memoizedProps:d,d);return;case 3:Kt&&(l=l.stateNode,l.hydrate&&(l.hydrate=!1,Ot(l.containerInfo)));return;case 12:return;case 13:Sh(l),Ru(l);return;case 19:Ru(l);return;case 17:return;case 23:case 24:Hn(l,l.memoizedState!==null);return}throw Error(p(163))}switch(l.tag){case 0:case 11:case 14:case 15:case 22:cs(3,l);return;case 12:return;case 13:Sh(l),Ru(l);return;case 19:Ru(l);return;case 3:Kt&&(d=l.stateNode,d.hydrate&&(d.hydrate=!1,Ot(d.containerInfo)));break;case 23:case 24:return}e:if(yn){switch(l.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:l=l.stateNode,$l(l.containerInfo,l.pendingChildren);break e}throw Error(p(163))}}function Sh(o){o.memoizedState!==null&&(Yo=Dn(),wt&&Hn(o.child,!0))}function Ru(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new Rm),l.forEach(function(y){var E=Nu.bind(null,o,y);d.has(y)||(d.add(y),y.then(E,E))})}}function Om(o,l){return o!==null&&(o=o.memoizedState,o===null||o.dehydrated!==null)?(l=l.memoizedState,l!==null&&l.dehydrated===null):!1}var Fo=0,Au=1,Mu=2,Bo=3,Ou=4;if(typeof Symbol=="function"&&Symbol.for){var Ho=Symbol.for;Fo=Ho("selector.component"),Au=Ho("selector.has_pseudo_class"),Mu=Ho("selector.role"),Bo=Ho("selector.test_id"),Ou=Ho("selector.text")}function rf(o){var l=tr(o);if(l!=null){if(typeof l.memoizedProps["data-testname"]!="string")throw Error(p(364));return l}if(o=Sn(o),o===null)throw Error(p(362));return o.stateNode.current}function sf(o,l){switch(l.$$typeof){case Fo:if(o.type===l.value)return!0;break;case Au:e:{l=l.value,o=[o,0];for(var d=0;d<o.length;){var y=o[d++],E=o[d++],C=l[E];if(y.tag!==5||!ct(y)){for(;C!=null&&sf(y,C);)E++,C=l[E];if(E===l.length){l=!0;break e}else for(y=y.child;y!==null;)o.push(y,E),y=y.sibling}}l=!1}return l;case Mu:if(o.tag===5&&pi(o.stateNode,l.value))return!0;break;case Ou:if((o.tag===5||o.tag===6)&&(o=xe(o),o!==null&&0<=o.indexOf(l.value)))return!0;break;case Bo:if(o.tag===5&&(o=o.memoizedProps["data-testname"],typeof o=="string"&&o.toLowerCase()===l.value.toLowerCase()))return!0;break;default:throw Error(p(365,l))}return!1}function Vo(o){switch(o.$$typeof){case Fo:return"<"+(be(o.value)||"Unknown")+">";case Au:return":has("+(Vo(o)||"")+")";case Mu:return'[role="'+o.value+'"]';case Ou:return'"'+o.value+'"';case Bo:return'[data-testname="'+o.value+'"]';default:throw Error(p(365,o))}}function af(o,l){var d=[];o=[o,0];for(var y=0;y<o.length;){var E=o[y++],C=o[y++],N=l[C];if(E.tag!==5||!ct(E)){for(;N!=null&&sf(E,N);)C++,N=l[C];if(C===l.length)d.push(E);else for(E=E.child;E!==null;)o.push(E,C),E=E.sibling}}return d}function of(o,l){if(!We)throw Error(p(363));o=rf(o),o=af(o,l),l=[],o=Array.from(o);for(var d=0;d<o.length;){var y=o[d++];if(y.tag===5)ct(y)||l.push(y.stateNode);else for(y=y.child;y!==null;)o.push(y),y=y.sibling}return l}var $o=null;function lf(o){if($o===null)try{var l=("require"+Math.random()).slice(0,7);$o=(t&&t[l]).call(t,"timers").setImmediate}catch{$o=function(y){var E=new MessageChannel;E.port1.onmessage=y,E.port2.postMessage(void 0)}}return $o(o)}var _m=Math.ceil,Vs=g.ReactCurrentDispatcher,_u=g.ReactCurrentOwner,Lu=g.IsSomeRendererActing,Qe=0,Xn=null,xn=null,Nt=0,Li=0,Qi=Fi(0),kn=0,Wo=null,ds=0,qo=0,Da=0,or=0,ka=null,Yo=0,Pu=1/0;function nn(){Pu=Dn()+500}var _e=null,Qo=!1,lr=null,Vn=null,hs=!1,Ia=null,Kn=90,Du=[],Yt=[],_t=null,In=0,Fr=null,Zn=-1,Br=0,ku=0,Go=null,Xo=!1;function Si(){return Qe&48?Dn():Zn!==-1?Zn:Zn=Dn()}function An(o){if(o=o.mode,!(o&2))return 1;if(!(o&4))return wa()===99?1:2;if(Br===0&&(Br=ds),Em.transition!==0){ku!==0&&(ku=ka!==null?ka.pendingLanes:0),o=Br;var l=4186112&~ku;return l&=-l,l===0&&(o=4186112&~o,l=o&-o,l===0&&(l=8192)),l}return o=wa(),Qe&4&&o===98?o=Xl(12,Br):(o=hm(o),o=Xl(o,Br)),o}function Hr(o,l,d){if(50<In)throw In=0,Fr=null,Error(p(185));if(o=$s(o,l),o===null)return null;Kl(o,l,d),o===Xn&&(Da|=l,kn===4&&Ws(o,Nt));var y=wa();l===1?Qe&8&&!(Qe&48)?Jn(o):(Pi(o,d),Qe===0&&(nn(),Hi())):(!(Qe&4)||y!==98&&y!==99||(_t===null?_t=new Set([o]):_t.add(o)),Pi(o,d)),ka=o}function $s(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}function Pi(o,l){for(var d=o.callbackNode,y=o.suspendedLanes,E=o.pingedLanes,C=o.expirationTimes,N=o.pendingLanes;0<N;){var B=31-is(N),te=1<<B,we=C[B];if(we===-1){if(!(te&y)||te&E){we=l,ir(te);var He=Wt;C[B]=10<=He?we+250:6<=He?we+5e3:-1}}else we<=l&&(o.expiredLanes|=te);N&=~te}if(y=yo(o,o===Xn?Nt:0),l=Wt,y===0)d!==null&&(d!==Zl&&zc(d),o.callbackNode=null,o.callbackPriority=0);else{if(d!==null){if(o.callbackPriority===l)return;d!==Zl&&zc(d)}l===15?(d=Jn.bind(null,o),Lr===null?(Lr=[d],Jl=Nc(bo,ah)):Lr.push(d),d=Zl):l===14?d=Ca(99,Jn.bind(null,o)):(d=pm(l),d=Ca(d,uf.bind(null,o))),o.callbackPriority=l,o.callbackNode=d}}function uf(o){if(Zn=-1,ku=Br=0,Qe&48)throw Error(p(327));var l=o.callbackNode;if(ui()&&o.callbackNode!==l)return null;var d=yo(o,o===Xn?Nt:0);if(d===0)return null;var y=d,E=Qe;Qe|=16;var C=Gi();(Xn!==o||Nt!==y)&&(nn(),li(o,y));do try{Zo();break}catch(B){xh(o,B)}while(!0);if(ru(),Vs.current=C,Qe=E,xn!==null?y=0:(Xn=null,Nt=0,y=kn),ds&Da)li(o,0);else if(y!==0){if(y===2&&(Qe|=64,o.hydrate&&(o.hydrate=!1,Ai(o.containerInfo)),d=th(o),d!==0&&(y=Ko(o,d))),y===1)throw l=Wo,li(o,0),Ws(o,d),Pi(o,Dn()),l;switch(o.finishedWork=o.current.alternate,o.finishedLanes=d,y){case 0:case 1:throw Error(p(345));case 2:ur(o);break;case 3:if(Ws(o,d),(d&62914560)===d&&(y=Yo+500-Dn(),10<y)){if(yo(o,0)!==0)break;if(E=o.suspendedLanes,(E&d)!==d){Si(),o.pingedLanes|=o.suspendedLanes&E;break}o.timeoutHandle=nt(ur.bind(null,o),y);break}ur(o);break;case 4:if(Ws(o,d),(d&4186112)===d)break;for(y=o.eventTimes,E=-1;0<d;){var N=31-is(d);C=1<<N,N=y[N],N>E&&(E=N),d&=~C}if(d=E,d=Dn()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*_m(d/1960))-d,10<d){o.timeoutHandle=nt(ur.bind(null,o),d);break}ur(o);break;case 5:ur(o);break;default:throw Error(p(329))}}return Pi(o,Dn()),o.callbackNode===l?uf.bind(null,o):null}function Ws(o,l){for(l&=~or,l&=~Da,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-is(l),y=1<<d;o[d]=-1,l&=~y}}function Jn(o){if(Qe&48)throw Error(p(327));if(ui(),o===Xn&&o.expiredLanes&Nt){var l=Nt,d=Ko(o,l);ds&Da&&(l=yo(o,l),d=Ko(o,l))}else l=yo(o,0),d=Ko(o,l);if(o.tag!==0&&d===2&&(Qe|=64,o.hydrate&&(o.hydrate=!1,Ai(o.containerInfo)),l=th(o),l!==0&&(d=Ko(o,l))),d===1)throw d=Wo,li(o,0),Ws(o,l),Pi(o,Dn()),d;return o.finishedWork=o.current.alternate,o.finishedLanes=l,ur(o),Pi(o,Dn()),null}function Na(){if(_t!==null){var o=_t;_t=null,o.forEach(function(l){l.expiredLanes|=24&l.pendingLanes,Pi(l,Dn())})}Hi()}function bh(o,l){var d=Qe;Qe|=1;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}}function Eh(o,l){var d=Qe;if(d&48)return o(l);Qe|=1;try{if(o)return Pr(99,o.bind(null,l))}finally{Qe=d,Hi()}}function $n(o,l){un(Qi,Li),Li|=l,ds|=l}function wn(){Li=Qi.current,vt(Qi)}function li(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==lt&&(o.timeoutHandle=lt,ot(d)),xn!==null)for(d=xn.return;d!==null;){var y=d;switch(y.tag){case 1:y=y.type.childContextTypes,y!=null&&Ql();break;case 3:ri(),vt(qn),vt(cn),hu();break;case 5:as(y);break;case 4:ri();break;case 13:vt(an);break;case 19:vt(an);break;case 10:su(y);break;case 23:case 24:wn()}d=d.return}Xn=o,xn=Ht(o.current,null),Nt=Li=ds=l,kn=0,Wo=null,or=Da=qo=0}function xh(o,l){do{var d=xn;try{if(ru(),Aa.current=Rt,pu){for(var y=qt.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}pu=!1}if(mi=0,Bn=Qn=qt=null,Ro=!1,_u.current=null,d===null||d.return===null){kn=1,Wo=l,xn=null;break}e:{var C=o,N=d.return,B=d,te=l;if(l=Nt,B.flags|=2048,B.firstEffect=B.lastEffect=null,te!==null&&typeof te=="object"&&typeof te.then=="function"){var we=te;if(!(B.mode&2)){var He=B.alternate;He?(B.updateQueue=He.updateQueue,B.memoizedState=He.memoizedState,B.lanes=He.lanes):(B.updateQueue=null,B.memoizedState=null)}var Je=(an.current&1)!==0,Me=N;do{var kt;if(kt=Me.tag===13){var Qt=Me.memoizedState;if(Qt!==null)kt=Qt.dehydrated!==null;else{var ki=Me.memoizedProps;kt=ki.fallback===void 0?!1:ki.unstable_avoidThisFallback!==!0?!0:!Je}}if(kt){var Q=Me.updateQueue;if(Q===null){var V=new Set;V.add(we),Me.updateQueue=V}else Q.add(we);if(!(Me.mode&2)){if(Me.flags|=64,B.flags|=16384,B.flags&=-2981,B.tag===1)if(B.alternate===null)B.tag=17;else{var ne=yr(-1,1);ne.tag=2,Sr(B,ne)}B.lanes|=1;break e}te=void 0,B=l;var Ae=C.pingCache;if(Ae===null?(Ae=C.pingCache=new Tm,te=new Set,Ae.set(we,te)):(te=Ae.get(we),te===void 0&&(te=new Set,Ae.set(we,te))),!te.has(B)){te.add(B);var Ve=nl.bind(null,C,we,B);we.then(Ve,Ve)}Me.flags|=4096,Me.lanes=l;break e}Me=Me.return}while(Me!==null);te=Error((be(B.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
208
208
 
209
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}kn!==5&&(kn=2),te=nf(te,B),Me=N;do{switch(Me.tag){case 3:C=te,Me.flags|=4096,l&=-l,Me.lanes|=l;var It=ph(Me,C,l);kr(Me,It);break e;case 1:C=te;var et=Me.type,Mt=Me.stateNode;if(!(Me.flags&64)&&(typeof et.getDerivedStateFromError=="function"||Mt!==null&&typeof Mt.componentDidCatch=="function"&&(Vn===null||!Vn.has(Mt)))){Me.flags|=4096,l&=-l,Me.lanes|=l;var Cn=vh(Me,C,l);kr(Me,Cn);break e}}Me=Me.return}while(Me!==null)}Ua(d)}catch(St){l=St,xn===d&&d!==null&&(xn=d=d.return);continue}break}while(!0)}function Gi(){var o=Vs.current;return Vs.current=Rt,o===null?Rt:o}function Ko(o,l){var d=Qe;Qe|=16;var y=Gi();Xn===o&&Nt===l||li(o,l);do try{qs();break}catch(E){xh(o,E)}while(!0);if(ru(),Qe=d,Vs.current=y,xn!==null)throw Error(p(261));return Xn=null,Nt=0,kn}function qs(){for(;xn!==null;)za(xn)}function Zo(){for(;xn!==null&&!ym();)za(xn)}function za(o){var l=Ys(o.alternate,o,Li);o.memoizedProps=o.pendingProps,l===null?Ua(o):xn=l,_u.current=null}function Ua(o){var l=o;do{var d=l.alternate;if(o=l.return,l.flags&2048){if(d=hh(l),d!==null){d.flags&=2047,xn=d;return}o!==null&&(o.firstEffect=o.lastEffect=null,o.flags|=2048)}else{if(d=dh(d,l,Li),d!==null){xn=d;return}if(d=l,d.tag!==24&&d.tag!==23||d.memoizedState===null||Li&1073741824||!(d.mode&4)){for(var y=0,E=d.child;E!==null;)y|=E.lanes|E.childLanes,E=E.sibling;d.childLanes=y}o!==null&&!(o.flags&2048)&&(o.firstEffect===null&&(o.firstEffect=l.firstEffect),l.lastEffect!==null&&(o.lastEffect!==null&&(o.lastEffect.nextEffect=l.firstEffect),o.lastEffect=l.lastEffect),1<l.flags&&(o.lastEffect!==null?o.lastEffect.nextEffect=l:o.firstEffect=l,o.lastEffect=l))}if(l=l.sibling,l!==null){xn=l;return}xn=l=o}while(l!==null);kn===0&&(kn=5)}function ur(o){var l=wa();return Pr(99,Jo.bind(null,o,l)),null}function Jo(o,l){do ui();while(Ia!==null);if(Qe&48)throw Error(p(327));var d=o.finishedWork;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(p(177));o.callbackNode=null;var y=d.lanes|d.childLanes,E=y,C=o.pendingLanes&~E;o.pendingLanes=E,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=E,o.mutableReadLanes&=E,o.entangledLanes&=E,E=o.entanglements;for(var N=o.eventTimes,B=o.expirationTimes;0<C;){var te=31-is(C),we=1<<te;E[te]=0,N[te]=-1,B[te]=-1,C&=~we}if(_t!==null&&!(y&24)&&_t.has(o)&&_t.delete(o),o===Xn&&(xn=Xn=null,Nt=0),1<d.flags?d.lastEffect!==null?(d.lastEffect.nextEffect=d,y=d.firstEffect):y=d:y=d.firstEffect,y!==null){E=Qe,Qe|=32,_u.current=null,Go=Fe(o.containerInfo),Xo=!1,_e=y;do try{el()}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Go=null,_e=y;do try{for(N=o;_e!==null;){var He=_e.flags;if(He&16&&wt&&Ri(_e.stateNode),He&128){var Je=_e.alternate;if(Je!==null){var Me=Je.ref;Me!==null&&(typeof Me=="function"?Me(null):Me.current=null)}}switch(He&1038){case 2:gh(_e),_e.flags&=-3;break;case 6:gh(_e),_e.flags&=-3,Tu(_e.alternate,_e);break;case 1024:_e.flags&=-1025;break;case 1028:_e.flags&=-1025,Tu(_e.alternate,_e);break;case 4:Tu(_e.alternate,_e);break;case 8:B=N,C=_e,wt?yh(B,C):At(B,C);var kt=C.alternate;Uo(C),kt!==null&&Uo(kt)}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Xo&&Se(),$e(o.containerInfo),o.current=d,_e=y;do try{for(He=o;_e!==null;){var Qt=_e.flags;if(Qt&36&&Am(He,_e.alternate,_e),Qt&128){Je=void 0;var ki=_e.ref;if(ki!==null){var Q=_e.stateNode;switch(_e.tag){case 5:Je=tt(Q);break;default:Je=Q}typeof ki=="function"?ki(Je):ki.current=Je}}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);_e=null,bm(),Qe=E}else o.current=d;if(hs)hs=!1,Ia=o,Kn=l;else for(_e=y;_e!==null;)l=_e.nextEffect,_e.nextEffect=null,_e.flags&8&&(Qt=_e,Qt.sibling=null,Qt.stateNode=null),_e=l;if(y=o.pendingLanes,y===0&&(Vn=null),y===1?o===Fr?In++:(In=0,Fr=o):In=0,d=d.stateNode,Bi&&typeof Bi.onCommitFiberRoot=="function")try{Bi.onCommitFiberRoot(kc,d,void 0,(d.current.flags&64)===64)}catch{}if(Pi(o,Dn()),Qo)throw Qo=!1,o=lr,lr=null,o;return Qe&8||Hi(),null}function el(){for(;_e!==null;){var o=_e.alternate;Xo||Go===null||(_e.flags&8?me(_e,Go)&&(Xo=!0,G()):_e.tag===13&&Om(o,_e)&&me(_e,Go)&&(Xo=!0,G()));var l=_e.flags;l&256&&oi(o,_e),!(l&512)||hs||(hs=!0,Ca(97,function(){return ui(),null})),_e=_e.nextEffect}}function ui(){if(Kn!==90){var o=97<Kn?97:Kn;return Kn=90,Pr(o,cr)}return!1}function Iu(o,l){Du.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cf(o,l){Yt.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cr(){if(Ia===null)return!1;var o=Ia;if(Ia=null,Qe&48)throw Error(p(331));var l=Qe;Qe|=32;var d=Yt;Yt=[];for(var y=0;y<d.length;y+=2){var E=d[y],C=d[y+1],N=E.destroy;if(E.destroy=void 0,typeof N=="function")try{N()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(d=Du,Du=[],y=0;y<d.length;y+=2){E=d[y],C=d[y+1];try{var B=E.create;E.destroy=B()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(B=o.current.firstEffect;B!==null;)o=B.nextEffect,B.nextEffect=null,B.flags&8&&(B.sibling=null,B.stateNode=null),B=o;return Qe=l,Hi(),!0}function tl(o,l,d){l=nf(d,l),l=ph(o,l,1),Sr(o,l),l=Si(),o=$s(o,1),o!==null&&(Kl(o,1,l),Pi(o,l))}function fr(o,l){if(o.tag===3)tl(o,o,l);else for(var d=o.return;d!==null;){if(d.tag===3){tl(d,o,l);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y))){o=nf(l,o);var E=vh(d,o,1);if(Sr(d,E),E=Si(),d=$s(d,1),d!==null)Kl(d,1,E),Pi(d,E);else if(typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y)))try{y.componentDidCatch(l,o)}catch{}break}}d=d.return}}function nl(o,l,d){var y=o.pingCache;y!==null&&y.delete(l),l=Si(),o.pingedLanes|=o.suspendedLanes&d,Xn===o&&(Nt&d)===d&&(kn===4||kn===3&&(Nt&62914560)===Nt&&500>Dn()-Yo?li(o,0):or|=d),Pi(o,l)}function Nu(o,l){var d=o.stateNode;d!==null&&d.delete(l),l=0,l===0&&(l=o.mode,l&2?l&4?(Br===0&&(Br=ds),l=xa(62914560&~Br),l===0&&(l=4194304)):l=wa()===99?1:2:l=1),d=Si(),o=$s(o,l),o!==null&&(Kl(o,l,d),Pi(o,d))}var Ys;Ys=function(o,l,d){var y=l.lanes;if(o!==null)if(o.memoizedProps!==l.pendingProps||qn.current)Yi=!0;else if(d&y)Yi=!!(o.flags&16384);else{switch(Yi=!1,l.tag){case 3:xu(l),Wc();break;case 5:cu(l);break;case 1:tn(l.type)&&go(l);break;case 4:ar(l,l.stateNode.containerInfo);break;case 10:Hc(l,l.memoizedProps.value);break;case 13:if(l.memoizedState!==null)return d&l.child.childLanes?on(o,l,d):(un(an,an.current&1),l=jr(o,l,d),l!==null?l.sibling:null);un(an,an.current&1);break;case 19:if(y=(d&l.childLanes)!==0,o.flags&64){if(y)return fh(o,l,d);l.flags|=64}var E=l.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),un(an,an.current),y)break;return null;case 23:case 24:return l.lanes=0,_a(o,l,d)}return jr(o,l,d)}else Yi=!1;switch(l.lanes=0,l.tag){case 2:if(y=l.type,o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,E=mr(l,cn.current),Is(l,d),E=vu(null,l,y,o,E,d),l.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0){if(l.tag=1,l.memoizedState=null,l.updateQueue=null,tn(y)){var C=!0;go(l)}else C=!1;l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,$i(l);var N=y.getDerivedStateFromProps;typeof N=="function"&&Ta(l,y,N,o),E.updater=au,l.stateNode=E,E._reactInternals=l,lu(l,y,o,d),l=Eu(null,l,y,!0,C,d)}else l.tag=0,ai(null,l,E,d),l=l.child;return l;case 16:E=l.elementType;e:{switch(o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,C=E._init,E=C(E._payload),l.type=E,C=l.tag=Fa(E),o=rr(E,o),C){case 0:l=ko(null,l,E,o,d);break e;case 1:l=Kc(null,l,E,o,d);break e;case 11:l=bu(null,l,E,o,d);break e;case 14:l=Xc(null,l,E,rr(E.type,o),y,d);break e}throw Error(p(306,E,""))}return l;case 0:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),ko(o,l,y,E,d);case 1:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),Kc(o,l,y,E,d);case 3:if(xu(l),y=l.updateQueue,o===null||y===null)throw Error(p(282));if(y=l.pendingProps,E=l.memoizedState,E=E!==null?E.element:null,sr(o,l),Ns(l,y,null,d),y=l.memoizedState.element,y===E)Wc(),l=jr(o,l,d);else{if(E=l.stateNode,(C=E.hydrate)&&(Kt?(Yn=fe(l.stateNode.containerInfo),qi=l,C=Oi=!0):C=!1),C){if(Kt&&(o=E.mutableSourceEagerHydrationData,o!=null))for(E=0;E<o.length;E+=2)C=o[E],N=o[E+1],Et?C._workInProgressVersionPrimary=N:C._workInProgressVersionSecondary=N,Us.push(C);for(d=br(l,null,y,d),l.child=d;d;)d.flags=d.flags&-3|1024,d=d.sibling}else ai(o,l,y,d),Wc();l=l.child}return l;case 5:return cu(l),o===null&&du(l),y=l.type,E=l.pendingProps,C=o!==null?o.memoizedProps:null,N=E.children,yt(y,E)?N=null:C!==null&&yt(y,C)&&(l.flags|=16),Hs(o,l),ai(o,l,N,d),l.child;case 6:return o===null&&du(l),null;case 13:return on(o,l,d);case 4:return ar(l,l.stateNode.containerInfo),y=l.pendingProps,o===null?l.child=zs(l,null,y,d):ai(o,l,y,d),l.child;case 11:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),bu(o,l,y,E,d);case 7:return ai(o,l,l.pendingProps,d),l.child;case 8:return ai(o,l,l.pendingProps.children,d),l.child;case 12:return ai(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(y=l.type._context,E=l.pendingProps,N=l.memoizedProps,C=E.value,Hc(l,C),N!==null){var B=N.value;if(C=Vi(B,C)?0:(typeof y._calculateChangedBits=="function"?y._calculateChangedBits(B,C):1073741823)|0,C===0){if(N.children===E.children&&!qn.current){l=jr(o,l,d);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var te=B.dependencies;if(te!==null){N=B.child;for(var we=te.firstContext;we!==null;){if(we.context===y&&we.observedBits&C){B.tag===1&&(we=yr(-1,d&-d),we.tag=2,Sr(B,we)),B.lanes|=d,we=B.alternate,we!==null&&(we.lanes|=d),Vc(B.return,d),te.lanes|=d;break}we=we.next}}else N=B.tag===10&&B.type===l.type?null:B.child;if(N!==null)N.return=B;else for(N=B;N!==null;){if(N===l){N=null;break}if(B=N.sibling,B!==null){B.return=N.return,N=B;break}N=N.return}B=N}}ai(o,l,E.children,d),l=l.child}return l;case 9:return E=l.type,C=l.pendingProps,y=C.children,Is(l,d),E=Mi(E,C.unstable_observedBits),y=y(E),l.flags|=1,ai(o,l,y,d),l.child;case 14:return E=l.type,C=rr(E,l.pendingProps),C=rr(E.type,C),Xc(o,l,E,C,y,d);case 15:return Bs(o,l,l.type,l.pendingProps,y,d);case 17:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,tn(y)?(o=!0,go(l)):o=!1,Is(l,d),lh(l,y,E),lu(l,y,E,d),Eu(null,l,y,!0,o,d);case 19:return fh(o,l,d);case 23:return _a(o,l,d);case 24:return _a(o,l,d)}throw Error(p(156,l.tag))};var Qs={current:!1},ja=f.unstable_flushAllWithoutAsserting,il=typeof ja=="function";function zu(){if(ja!==void 0)return ja();for(var o=!1;ui();)o=!0;return o}function ff(o){try{zu(),lf(function(){zu()?ff(o):o()})}catch(l){o(l)}}var rl=0,Uu=!1;function Lm(o,l,d,y){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(o,l,d,y){return new Lm(o,l,d,y)}function df(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fa(o){if(typeof o=="function")return df(o)?1:0;if(o!=null){if(o=o.$$typeof,o===L)return 11;if(o===j)return 14}return 2}function Ht(o,l){var d=o.alternate;return d===null?(d=Di(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null),d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function sl(o,l,d,y,E,C){var N=2;if(y=o,typeof o=="function")df(o)&&(N=1);else if(typeof o=="string")N=5;else e:switch(o){case x:return Gs(d.children,E,C,l);case H:N=8,E|=16;break;case T:N=8,E|=1;break;case _:return o=Di(12,d,l,E|8),o.elementType=_,o.type=_,o.lanes=C,o;case P:return o=Di(13,d,l,E),o.type=P,o.elementType=P,o.lanes=C,o;case O:return o=Di(19,d,l,E),o.elementType=O,o.lanes=C,o;case Z:return Ba(d,E,C,l);case ie:return o=Di(24,d,l,E),o.elementType=ie,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:N=10;break e;case k:N=9;break e;case L:N=11;break e;case j:N=14;break e;case q:N=16,y=null;break e;case ee:N=22;break e}throw Error(p(130,o==null?o:typeof o,""))}return l=Di(N,d,l,E),l.elementType=o,l.type=y,l.lanes=C,l}function Gs(o,l,d,y){return o=Di(7,o,y,l),o.lanes=d,o}function Ba(o,l,d,y){return o=Di(23,o,y,l),o.elementType=Z,o.lanes=d,o}function al(o,l,d){return o=Di(6,o,null,l),o.lanes=d,o}function Ha(o,l,d){return l=Di(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function hf(o,l,d){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.pendingContext=this.context=null,this.hydrate=d,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ic(0),this.expirationTimes=Ic(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),Kt&&(this.mutableSourceEagerHydrationData=null)}function ol(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(p(188)):Error(p(268,Object.keys(o)));return o=Xe(l),o===null?null:o.stateNode}function ju(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function ll(o,l){ju(o,l),(o=o.alternate)&&ju(o,l)}function ps(o){return o=Xe(o),o===null?null:o.stateNode}function vs(){return null}return i.IsThisRendererActing=Qs,i.act=function(o){function l(){rl--,Lu.current=d,Qs.current=y}Uu===!1&&(Uu=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),rl++;var d=Lu.current,y=Qs.current;Lu.current=!0,Qs.current=!0;try{var E=bh(o)}catch(C){throw l(),C}if(E!==null&&typeof E=="object"&&typeof E.then=="function")return{then:function(C,N){E.then(function(){1<rl||il===!0&&d===!0?(l(),C()):ff(function(B){l(),B?N(B):C()})},function(B){l(),N(B)})}};try{rl!==1||il!==!1&&d!==!1||zu(),l()}catch(C){throw l(),C}return{then:function(C){C()}}},i.attemptContinuousHydration=function(o){if(o.tag===13){var l=Si();Hr(o,67108864,l),ll(o,67108864)}},i.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var l=Si(),d=An(o);Hr(o,d,l),ll(o,d)}},i.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.hydrate){var d=ir(l.pendingLanes);l.expiredLanes|=d&l.pendingLanes,Pi(l,Dn()),!(Qe&48)&&(nn(),Hi())}break;case 13:var y=Si();Eh(function(){return Hr(o,1,y)}),ll(o,4)}},i.attemptUserBlockingHydration=function(o){if(o.tag===13){var l=Si();Hr(o,4,l),ll(o,4)}},i.batchedEventUpdates=function(o,l){var d=Qe;Qe|=2;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.batchedUpdates=bh,i.createComponentSelector=function(o){return{$$typeof:Fo,value:o}},i.createContainer=function(o,l,d){return o=new hf(o,l,d),l=Di(3,null,null,l===2?7:l===1?3:0),o.current=l,l.stateNode=o,$i(l),o},i.createHasPsuedoClassSelector=function(o){return{$$typeof:Au,value:o}},i.createPortal=function(o,l,d){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:o,containerInfo:l,implementation:d}},i.createRoleSelector=function(o){return{$$typeof:Mu,value:o}},i.createTestNameSelector=function(o){return{$$typeof:Bo,value:o}},i.createTextSelector=function(o){return{$$typeof:Ou,value:o}},i.deferredUpdates=function(o){return Pr(97,o)},i.discreteUpdates=function(o,l,d,y,E){var C=Qe;Qe|=4;try{return Pr(98,o.bind(null,l,d,y,E))}finally{Qe=C,Qe===0&&(nn(),Hi())}},i.findAllNodes=of,i.findBoundingRects=function(o,l){if(!We)throw Error(p(363));l=of(o,l),o=[];for(var d=0;d<l.length;d++)o.push(ji(l[d]));for(l=o.length-1;0<l;l--){d=o[l];for(var y=d.x,E=y+d.width,C=d.y,N=C+d.height,B=l-1;0<=B;B--)if(l!==B){var te=o[B],we=te.x,He=we+te.width,Je=te.y,Me=Je+te.height;if(y>=we&&C>=Je&&E<=He&&N<=Me){o.splice(l,1);break}else if(y!==we||d.width!==te.width||Me<C||Je>N){if(!(C!==Je||d.height!==te.height||He<y||we>E)){we>y&&(te.width+=we-y,te.x=y),He<E&&(te.width=E-we),o.splice(l,1);break}}else{Je>C&&(te.height+=Je-C,te.y=C),Me<N&&(te.height=N-Je),o.splice(l,1);break}}}return o},i.findHostInstance=ol,i.findHostInstanceWithNoPortals=function(o){return o=ce(o),o===null?null:o.tag===20?o.stateNode.instance:o.stateNode},i.findHostInstanceWithWarning=function(o){return ol(o)},i.flushControlled=function(o){var l=Qe;Qe|=1;try{Pr(99,o)}finally{Qe=l,Qe===0&&(nn(),Hi())}},i.flushDiscreteUpdates=function(){!(Qe&49)&&(Na(),ui())},i.flushPassiveEffects=ui,i.flushSync=Eh,i.focusWithin=function(o,l){if(!We)throw Error(p(363));for(o=rf(o),l=af(o,l),l=Array.from(l),o=0;o<l.length;){var d=l[o++];if(!ct(d)){if(d.tag===5&&Pt(d.stateNode))return!0;for(d=d.child;d!==null;)l.push(d),d=d.sibling}}return!1},i.getCurrentUpdateLanePriority=function(){return Gl},i.getFindAllNodesFailureDescription=function(o,l){if(!We)throw Error(p(363));var d=0,y=[];o=[rf(o),0];for(var E=0;E<o.length;){var C=o[E++],N=o[E++],B=l[N];if((C.tag!==5||!ct(C))&&(sf(C,B)&&(y.push(Vo(B)),N++,N>d&&(d=N)),N<l.length))for(C=C.child;C!==null;)o.push(C,N),C=C.sibling}if(d<l.length){for(o=[];d<l.length;d++)o.push(Vo(l[d]));return`findAllNodes was able to match part of the selector:
209
+ Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}kn!==5&&(kn=2),te=nf(te,B),Me=N;do{switch(Me.tag){case 3:C=te,Me.flags|=4096,l&=-l,Me.lanes|=l;var It=ph(Me,C,l);kr(Me,It);break e;case 1:C=te;var et=Me.type,Mt=Me.stateNode;if(!(Me.flags&64)&&(typeof et.getDerivedStateFromError=="function"||Mt!==null&&typeof Mt.componentDidCatch=="function"&&(Vn===null||!Vn.has(Mt)))){Me.flags|=4096,l&=-l,Me.lanes|=l;var Cn=vh(Me,C,l);kr(Me,Cn);break e}}Me=Me.return}while(Me!==null)}Ua(d)}catch(St){l=St,xn===d&&d!==null&&(xn=d=d.return);continue}break}while(!0)}function Gi(){var o=Vs.current;return Vs.current=Rt,o===null?Rt:o}function Ko(o,l){var d=Qe;Qe|=16;var y=Gi();Xn===o&&Nt===l||li(o,l);do try{qs();break}catch(E){xh(o,E)}while(!0);if(ru(),Qe=d,Vs.current=y,xn!==null)throw Error(p(261));return Xn=null,Nt=0,kn}function qs(){for(;xn!==null;)za(xn)}function Zo(){for(;xn!==null&&!ym();)za(xn)}function za(o){var l=Ys(o.alternate,o,Li);o.memoizedProps=o.pendingProps,l===null?Ua(o):xn=l,_u.current=null}function Ua(o){var l=o;do{var d=l.alternate;if(o=l.return,l.flags&2048){if(d=hh(l),d!==null){d.flags&=2047,xn=d;return}o!==null&&(o.firstEffect=o.lastEffect=null,o.flags|=2048)}else{if(d=dh(d,l,Li),d!==null){xn=d;return}if(d=l,d.tag!==24&&d.tag!==23||d.memoizedState===null||Li&1073741824||!(d.mode&4)){for(var y=0,E=d.child;E!==null;)y|=E.lanes|E.childLanes,E=E.sibling;d.childLanes=y}o!==null&&!(o.flags&2048)&&(o.firstEffect===null&&(o.firstEffect=l.firstEffect),l.lastEffect!==null&&(o.lastEffect!==null&&(o.lastEffect.nextEffect=l.firstEffect),o.lastEffect=l.lastEffect),1<l.flags&&(o.lastEffect!==null?o.lastEffect.nextEffect=l:o.firstEffect=l,o.lastEffect=l))}if(l=l.sibling,l!==null){xn=l;return}xn=l=o}while(l!==null);kn===0&&(kn=5)}function ur(o){var l=wa();return Pr(99,Jo.bind(null,o,l)),null}function Jo(o,l){do ui();while(Ia!==null);if(Qe&48)throw Error(p(327));var d=o.finishedWork;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(p(177));o.callbackNode=null;var y=d.lanes|d.childLanes,E=y,C=o.pendingLanes&~E;o.pendingLanes=E,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=E,o.mutableReadLanes&=E,o.entangledLanes&=E,E=o.entanglements;for(var N=o.eventTimes,B=o.expirationTimes;0<C;){var te=31-is(C),we=1<<te;E[te]=0,N[te]=-1,B[te]=-1,C&=~we}if(_t!==null&&!(y&24)&&_t.has(o)&&_t.delete(o),o===Xn&&(xn=Xn=null,Nt=0),1<d.flags?d.lastEffect!==null?(d.lastEffect.nextEffect=d,y=d.firstEffect):y=d:y=d.firstEffect,y!==null){E=Qe,Qe|=32,_u.current=null,Go=Fe(o.containerInfo),Xo=!1,_e=y;do try{el()}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Go=null,_e=y;do try{for(N=o;_e!==null;){var He=_e.flags;if(He&16&&wt&&Ri(_e.stateNode),He&128){var Je=_e.alternate;if(Je!==null){var Me=Je.ref;Me!==null&&(typeof Me=="function"?Me(null):Me.current=null)}}switch(He&1038){case 2:gh(_e),_e.flags&=-3;break;case 6:gh(_e),_e.flags&=-3,Tu(_e.alternate,_e);break;case 1024:_e.flags&=-1025;break;case 1028:_e.flags&=-1025,Tu(_e.alternate,_e);break;case 4:Tu(_e.alternate,_e);break;case 8:B=N,C=_e,wt?yh(B,C):At(B,C);var kt=C.alternate;Uo(C),kt!==null&&Uo(kt)}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);Xo&&Se(),$e(o.containerInfo),o.current=d,_e=y;do try{for(He=o;_e!==null;){var Qt=_e.flags;if(Qt&36&&Am(He,_e.alternate,_e),Qt&128){Je=void 0;var ki=_e.ref;if(ki!==null){var Q=_e.stateNode;switch(_e.tag){case 5:Je=tt(Q);break;default:Je=Q}typeof ki=="function"?ki(Je):ki.current=Je}}_e=_e.nextEffect}}catch(V){if(_e===null)throw Error(p(330));fr(_e,V),_e=_e.nextEffect}while(_e!==null);_e=null,bm(),Qe=E}else o.current=d;if(hs)hs=!1,Ia=o,Kn=l;else for(_e=y;_e!==null;)l=_e.nextEffect,_e.nextEffect=null,_e.flags&8&&(Qt=_e,Qt.sibling=null,Qt.stateNode=null),_e=l;if(y=o.pendingLanes,y===0&&(Vn=null),y===1?o===Fr?In++:(In=0,Fr=o):In=0,d=d.stateNode,Bi&&typeof Bi.onCommitFiberRoot=="function")try{Bi.onCommitFiberRoot(kc,d,void 0,(d.current.flags&64)===64)}catch{}if(Pi(o,Dn()),Qo)throw Qo=!1,o=lr,lr=null,o;return Qe&8||Hi(),null}function el(){for(;_e!==null;){var o=_e.alternate;Xo||Go===null||(_e.flags&8?me(_e,Go)&&(Xo=!0,G()):_e.tag===13&&Om(o,_e)&&me(_e,Go)&&(Xo=!0,G()));var l=_e.flags;l&256&&oi(o,_e),!(l&512)||hs||(hs=!0,Ca(97,function(){return ui(),null})),_e=_e.nextEffect}}function ui(){if(Kn!==90){var o=97<Kn?97:Kn;return Kn=90,Pr(o,cr)}return!1}function Iu(o,l){Du.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cf(o,l){Yt.push(l,o),hs||(hs=!0,Ca(97,function(){return ui(),null}))}function cr(){if(Ia===null)return!1;var o=Ia;if(Ia=null,Qe&48)throw Error(p(331));var l=Qe;Qe|=32;var d=Yt;Yt=[];for(var y=0;y<d.length;y+=2){var E=d[y],C=d[y+1],N=E.destroy;if(E.destroy=void 0,typeof N=="function")try{N()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(d=Du,Du=[],y=0;y<d.length;y+=2){E=d[y],C=d[y+1];try{var B=E.create;E.destroy=B()}catch(te){if(C===null)throw Error(p(330));fr(C,te)}}for(B=o.current.firstEffect;B!==null;)o=B.nextEffect,B.nextEffect=null,B.flags&8&&(B.sibling=null,B.stateNode=null),B=o;return Qe=l,Hi(),!0}function tl(o,l,d){l=nf(d,l),l=ph(o,l,1),Sr(o,l),l=Si(),o=$s(o,1),o!==null&&(Kl(o,1,l),Pi(o,l))}function fr(o,l){if(o.tag===3)tl(o,o,l);else for(var d=o.return;d!==null;){if(d.tag===3){tl(d,o,l);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y))){o=nf(l,o);var E=vh(d,o,1);if(Sr(d,E),E=Si(),d=$s(d,1),d!==null)Kl(d,1,E),Pi(d,E);else if(typeof y.componentDidCatch=="function"&&(Vn===null||!Vn.has(y)))try{y.componentDidCatch(l,o)}catch{}break}}d=d.return}}function nl(o,l,d){var y=o.pingCache;y!==null&&y.delete(l),l=Si(),o.pingedLanes|=o.suspendedLanes&d,Xn===o&&(Nt&d)===d&&(kn===4||kn===3&&(Nt&62914560)===Nt&&500>Dn()-Yo?li(o,0):or|=d),Pi(o,l)}function Nu(o,l){var d=o.stateNode;d!==null&&d.delete(l),l=0,l===0&&(l=o.mode,l&2?l&4?(Br===0&&(Br=ds),l=xa(62914560&~Br),l===0&&(l=4194304)):l=wa()===99?1:2:l=1),d=Si(),o=$s(o,l),o!==null&&(Kl(o,l,d),Pi(o,d))}var Ys;Ys=function(o,l,d){var y=l.lanes;if(o!==null)if(o.memoizedProps!==l.pendingProps||qn.current)Yi=!0;else if(d&y)Yi=!!(o.flags&16384);else{switch(Yi=!1,l.tag){case 3:xu(l),Wc();break;case 5:cu(l);break;case 1:tn(l.type)&&go(l);break;case 4:ar(l,l.stateNode.containerInfo);break;case 10:Hc(l,l.memoizedProps.value);break;case 13:if(l.memoizedState!==null)return d&l.child.childLanes?on(o,l,d):(un(an,an.current&1),l=jr(o,l,d),l!==null?l.sibling:null);un(an,an.current&1);break;case 19:if(y=(d&l.childLanes)!==0,o.flags&64){if(y)return fh(o,l,d);l.flags|=64}var E=l.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),un(an,an.current),y)break;return null;case 23:case 24:return l.lanes=0,_a(o,l,d)}return jr(o,l,d)}else Yi=!1;switch(l.lanes=0,l.tag){case 2:if(y=l.type,o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,E=mr(l,cn.current),Is(l,d),E=vu(null,l,y,o,E,d),l.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0){if(l.tag=1,l.memoizedState=null,l.updateQueue=null,tn(y)){var C=!0;go(l)}else C=!1;l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,$i(l);var N=y.getDerivedStateFromProps;typeof N=="function"&&Ta(l,y,N,o),E.updater=au,l.stateNode=E,E._reactInternals=l,lu(l,y,o,d),l=Eu(null,l,y,!0,C,d)}else l.tag=0,ai(null,l,E,d),l=l.child;return l;case 16:E=l.elementType;e:{switch(o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,C=E._init,E=C(E._payload),l.type=E,C=l.tag=Fa(E),o=rr(E,o),C){case 0:l=ko(null,l,E,o,d);break e;case 1:l=Kc(null,l,E,o,d);break e;case 11:l=bu(null,l,E,o,d);break e;case 14:l=Xc(null,l,E,rr(E.type,o),y,d);break e}throw Error(p(306,E,""))}return l;case 0:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),ko(o,l,y,E,d);case 1:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),Kc(o,l,y,E,d);case 3:if(xu(l),y=l.updateQueue,o===null||y===null)throw Error(p(282));if(y=l.pendingProps,E=l.memoizedState,E=E!==null?E.element:null,sr(o,l),Ns(l,y,null,d),y=l.memoizedState.element,y===E)Wc(),l=jr(o,l,d);else{if(E=l.stateNode,(C=E.hydrate)&&(Kt?(Yn=de(l.stateNode.containerInfo),qi=l,C=Oi=!0):C=!1),C){if(Kt&&(o=E.mutableSourceEagerHydrationData,o!=null))for(E=0;E<o.length;E+=2)C=o[E],N=o[E+1],Et?C._workInProgressVersionPrimary=N:C._workInProgressVersionSecondary=N,Us.push(C);for(d=br(l,null,y,d),l.child=d;d;)d.flags=d.flags&-3|1024,d=d.sibling}else ai(o,l,y,d),Wc();l=l.child}return l;case 5:return cu(l),o===null&&du(l),y=l.type,E=l.pendingProps,C=o!==null?o.memoizedProps:null,N=E.children,yt(y,E)?N=null:C!==null&&yt(y,C)&&(l.flags|=16),Hs(o,l),ai(o,l,N,d),l.child;case 6:return o===null&&du(l),null;case 13:return on(o,l,d);case 4:return ar(l,l.stateNode.containerInfo),y=l.pendingProps,o===null?l.child=zs(l,null,y,d):ai(o,l,y,d),l.child;case 11:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),bu(o,l,y,E,d);case 7:return ai(o,l,l.pendingProps,d),l.child;case 8:return ai(o,l,l.pendingProps.children,d),l.child;case 12:return ai(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(y=l.type._context,E=l.pendingProps,N=l.memoizedProps,C=E.value,Hc(l,C),N!==null){var B=N.value;if(C=Vi(B,C)?0:(typeof y._calculateChangedBits=="function"?y._calculateChangedBits(B,C):1073741823)|0,C===0){if(N.children===E.children&&!qn.current){l=jr(o,l,d);break e}}else for(B=l.child,B!==null&&(B.return=l);B!==null;){var te=B.dependencies;if(te!==null){N=B.child;for(var we=te.firstContext;we!==null;){if(we.context===y&&we.observedBits&C){B.tag===1&&(we=yr(-1,d&-d),we.tag=2,Sr(B,we)),B.lanes|=d,we=B.alternate,we!==null&&(we.lanes|=d),Vc(B.return,d),te.lanes|=d;break}we=we.next}}else N=B.tag===10&&B.type===l.type?null:B.child;if(N!==null)N.return=B;else for(N=B;N!==null;){if(N===l){N=null;break}if(B=N.sibling,B!==null){B.return=N.return,N=B;break}N=N.return}B=N}}ai(o,l,E.children,d),l=l.child}return l;case 9:return E=l.type,C=l.pendingProps,y=C.children,Is(l,d),E=Mi(E,C.unstable_observedBits),y=y(E),l.flags|=1,ai(o,l,y,d),l.child;case 14:return E=l.type,C=rr(E,l.pendingProps),C=rr(E.type,C),Xc(o,l,E,C,y,d);case 15:return Bs(o,l,l.type,l.pendingProps,y,d);case 17:return y=l.type,E=l.pendingProps,E=l.elementType===y?E:rr(y,E),o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,tn(y)?(o=!0,go(l)):o=!1,Is(l,d),lh(l,y,E),lu(l,y,E,d),Eu(null,l,y,!0,o,d);case 19:return fh(o,l,d);case 23:return _a(o,l,d);case 24:return _a(o,l,d)}throw Error(p(156,l.tag))};var Qs={current:!1},ja=f.unstable_flushAllWithoutAsserting,il=typeof ja=="function";function zu(){if(ja!==void 0)return ja();for(var o=!1;ui();)o=!0;return o}function ff(o){try{zu(),lf(function(){zu()?ff(o):o()})}catch(l){o(l)}}var rl=0,Uu=!1;function Lm(o,l,d,y){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(o,l,d,y){return new Lm(o,l,d,y)}function df(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fa(o){if(typeof o=="function")return df(o)?1:0;if(o!=null){if(o=o.$$typeof,o===L)return 11;if(o===j)return 14}return 2}function Ht(o,l){var d=o.alternate;return d===null?(d=Di(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null),d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function sl(o,l,d,y,E,C){var N=2;if(y=o,typeof o=="function")df(o)&&(N=1);else if(typeof o=="string")N=5;else e:switch(o){case x:return Gs(d.children,E,C,l);case H:N=8,E|=16;break;case R:N=8,E|=1;break;case _:return o=Di(12,d,l,E|8),o.elementType=_,o.type=_,o.lanes=C,o;case P:return o=Di(13,d,l,E),o.type=P,o.elementType=P,o.lanes=C,o;case O:return o=Di(19,d,l,E),o.elementType=O,o.lanes=C,o;case Z:return Ba(d,E,C,l);case ie:return o=Di(24,d,l,E),o.elementType=ie,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:N=10;break e;case k:N=9;break e;case L:N=11;break e;case j:N=14;break e;case q:N=16,y=null;break e;case ee:N=22;break e}throw Error(p(130,o==null?o:typeof o,""))}return l=Di(N,d,l,E),l.elementType=o,l.type=y,l.lanes=C,l}function Gs(o,l,d,y){return o=Di(7,o,y,l),o.lanes=d,o}function Ba(o,l,d,y){return o=Di(23,o,y,l),o.elementType=Z,o.lanes=d,o}function al(o,l,d){return o=Di(6,o,null,l),o.lanes=d,o}function Ha(o,l,d){return l=Di(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function hf(o,l,d){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.pendingContext=this.context=null,this.hydrate=d,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ic(0),this.expirationTimes=Ic(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),Kt&&(this.mutableSourceEagerHydrationData=null)}function ol(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(p(188)):Error(p(268,Object.keys(o)));return o=Xe(l),o===null?null:o.stateNode}function ju(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function ll(o,l){ju(o,l),(o=o.alternate)&&ju(o,l)}function ps(o){return o=Xe(o),o===null?null:o.stateNode}function vs(){return null}return i.IsThisRendererActing=Qs,i.act=function(o){function l(){rl--,Lu.current=d,Qs.current=y}Uu===!1&&(Uu=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),rl++;var d=Lu.current,y=Qs.current;Lu.current=!0,Qs.current=!0;try{var E=bh(o)}catch(C){throw l(),C}if(E!==null&&typeof E=="object"&&typeof E.then=="function")return{then:function(C,N){E.then(function(){1<rl||il===!0&&d===!0?(l(),C()):ff(function(B){l(),B?N(B):C()})},function(B){l(),N(B)})}};try{rl!==1||il!==!1&&d!==!1||zu(),l()}catch(C){throw l(),C}return{then:function(C){C()}}},i.attemptContinuousHydration=function(o){if(o.tag===13){var l=Si();Hr(o,67108864,l),ll(o,67108864)}},i.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var l=Si(),d=An(o);Hr(o,d,l),ll(o,d)}},i.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.hydrate){var d=ir(l.pendingLanes);l.expiredLanes|=d&l.pendingLanes,Pi(l,Dn()),!(Qe&48)&&(nn(),Hi())}break;case 13:var y=Si();Eh(function(){return Hr(o,1,y)}),ll(o,4)}},i.attemptUserBlockingHydration=function(o){if(o.tag===13){var l=Si();Hr(o,4,l),ll(o,4)}},i.batchedEventUpdates=function(o,l){var d=Qe;Qe|=2;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.batchedUpdates=bh,i.createComponentSelector=function(o){return{$$typeof:Fo,value:o}},i.createContainer=function(o,l,d){return o=new hf(o,l,d),l=Di(3,null,null,l===2?7:l===1?3:0),o.current=l,l.stateNode=o,$i(l),o},i.createHasPsuedoClassSelector=function(o){return{$$typeof:Au,value:o}},i.createPortal=function(o,l,d){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:o,containerInfo:l,implementation:d}},i.createRoleSelector=function(o){return{$$typeof:Mu,value:o}},i.createTestNameSelector=function(o){return{$$typeof:Bo,value:o}},i.createTextSelector=function(o){return{$$typeof:Ou,value:o}},i.deferredUpdates=function(o){return Pr(97,o)},i.discreteUpdates=function(o,l,d,y,E){var C=Qe;Qe|=4;try{return Pr(98,o.bind(null,l,d,y,E))}finally{Qe=C,Qe===0&&(nn(),Hi())}},i.findAllNodes=of,i.findBoundingRects=function(o,l){if(!We)throw Error(p(363));l=of(o,l),o=[];for(var d=0;d<l.length;d++)o.push(ji(l[d]));for(l=o.length-1;0<l;l--){d=o[l];for(var y=d.x,E=y+d.width,C=d.y,N=C+d.height,B=l-1;0<=B;B--)if(l!==B){var te=o[B],we=te.x,He=we+te.width,Je=te.y,Me=Je+te.height;if(y>=we&&C>=Je&&E<=He&&N<=Me){o.splice(l,1);break}else if(y!==we||d.width!==te.width||Me<C||Je>N){if(!(C!==Je||d.height!==te.height||He<y||we>E)){we>y&&(te.width+=we-y,te.x=y),He<E&&(te.width=E-we),o.splice(l,1);break}}else{Je>C&&(te.height+=Je-C,te.y=C),Me<N&&(te.height=N-Je),o.splice(l,1);break}}}return o},i.findHostInstance=ol,i.findHostInstanceWithNoPortals=function(o){return o=ce(o),o===null?null:o.tag===20?o.stateNode.instance:o.stateNode},i.findHostInstanceWithWarning=function(o){return ol(o)},i.flushControlled=function(o){var l=Qe;Qe|=1;try{Pr(99,o)}finally{Qe=l,Qe===0&&(nn(),Hi())}},i.flushDiscreteUpdates=function(){!(Qe&49)&&(Na(),ui())},i.flushPassiveEffects=ui,i.flushSync=Eh,i.focusWithin=function(o,l){if(!We)throw Error(p(363));for(o=rf(o),l=af(o,l),l=Array.from(l),o=0;o<l.length;){var d=l[o++];if(!ct(d)){if(d.tag===5&&Pt(d.stateNode))return!0;for(d=d.child;d!==null;)l.push(d),d=d.sibling}}return!1},i.getCurrentUpdateLanePriority=function(){return Gl},i.getFindAllNodesFailureDescription=function(o,l){if(!We)throw Error(p(363));var d=0,y=[];o=[rf(o),0];for(var E=0;E<o.length;){var C=o[E++],N=o[E++],B=l[N];if((C.tag!==5||!ct(C))&&(sf(C,B)&&(y.push(Vo(B)),N++,N>d&&(d=N)),N<l.length))for(C=C.child;C!==null;)o.push(C,N),C=C.sibling}if(d<l.length){for(o=[];d<l.length;d++)o.push(Vo(l[d]));return`findAllNodes was able to match part of the selector:
210
210
  `+(y.join(" > ")+`
211
211
 
212
212
  No matching component was found for:
213
- `)+o.join(" > ")}return null},i.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return tt(o.child.stateNode);default:return o.child.stateNode}},i.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:ps,findFiberByHostInstance:o.findFiberByHostInstance||vs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!l.isDisabled&&l.supportsFiber)try{kc=l.inject(o),Bi=l}catch{}o=!0}return o},i.observeVisibleRects=function(o,l,d,y){if(!We)throw Error(p(363));o=of(o,l);var E=it(o,d,y).disconnect;return{disconnect:function(){E()}}},i.registerMutableSourceForHydration=function(o,l){var d=l._getVersion;d=d(l._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[l,d]:o.mutableSourceEagerHydrationData.push(l,d)},i.runWithPriority=function(o,l){var d=Gl;try{return Gl=o,l()}finally{Gl=d}},i.shouldSuspend=function(){return!1},i.unbatchedUpdates=function(o,l){var d=Qe;Qe&=-2,Qe|=8;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.updateContainer=function(o,l,d,y){var E=l.current,C=Si(),N=An(E);e:if(d){d=d._reactInternals;t:{if(Ee(d)!==d||d.tag!==1)throw Error(p(170));var B=d;do{switch(B.tag){case 3:B=B.stateNode.context;break t;case 1:if(tn(B.type)){B=B.stateNode.__reactInternalMemoizedMergedChildContext;break t}}B=B.return}while(B!==null);throw Error(p(171))}if(d.tag===1){var te=d.type;if(tn(te)){d=Jd(d,te,B);break e}}d=B}else d=vr;return l.context===null?l.context=d:l.pendingContext=d,l=yr(C,N),l.payload={element:o},y=y===void 0?null:y,y!==null&&(l.callback=y),Sr(E,l),Hr(E,N,C),N},i}}(qf)),qf.exports}process.env.NODE_ENV==="production"?Op.exports=oC():Op.exports=aC();var lC=Op.exports;const uC=Zw(lC),Yf=["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 cC(){return Yf.reduce((t,e)=>(t[e]=[],t),{})}const Rl=Yf.reduce((t,e)=>(t[e.slice(2).toLowerCase()]=e,t[e]=e,t),{}),ec=(t,e,n)=>{const i=t.length,a=n||qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?t[u+1]<e[3]&&t[u+3]>e[1]&&t[u+2]<e[4]&&t[u+4]>e[2]?1:0:t[u];return a};function qe(t,e,n){return new Float32Array(t,e,n)}const fC=(t,e,n)=>{const i=t[1]<=e[3]&&t[3]>=e[1]&&t[2]<=e[4]&&t[4]>=e[2],a=n||qe(5);return i?(a[0]=1,a[1]=Math.max(t[1],e[1]),a[2]=Math.max(t[2],e[2]),a[3]=Math.min(t[3],e[3]),a[4]=Math.min(t[4],e[4]),a):(a[0]=0,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a)},dC=t=>t.length/5,xs=(t,e,n)=>{const i=n||qe(9);return i[0]=t[0]*e[0]+t[1]*e[3]+t[2]*e[6],i[1]=t[0]*e[1]+t[1]*e[4]+t[2]*e[7],i[2]=t[0]*e[2]+t[1]*e[5]+t[2]*e[8],i[3]=t[3]*e[0]+t[4]*e[3]+t[5]*e[6],i[4]=t[3]*e[1]+t[4]*e[4]+t[5]*e[7],i[5]=t[3]*e[2]+t[4]*e[5]+t[5]*e[8],i[6]=t[6]*e[0]+t[7]*e[3]+t[8]*e[6],i[7]=t[6]*e[1]+t[7]*e[4]+t[8]*e[7],i[8]=t[6]*e[2]+t[7]*e[5]+t[8]*e[8],i};class Tt{constructor(e){this.index=0,this.length=e,this.points=qe(this.length)}static grid(e=1,n=1){return new Tt(5*e*n)}static point(e,n){const i=qe(5);return i[0]=1,i[1]=e,i[2]=n,i[3]=e,i[4]=n,i}static positionPair(e){const n=qe(5);return n[0]=1,n[1]=e.x1,n[2]=e.y1,n[3]=e.x2,n[4]=e.y2,n}static projection(e){return Tt.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,n,i=0,a=0){const u=qe(5);return u[0]=1,u[1]=i,u[2]=a,u[3]=e+i,u[4]=n+a,u}row(e){return e(this)}addPoints(e,n,i,a){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=n,this.points[3+this.index]=i,this.points[4+this.index]=a,this.index+=5,this}addBox(e,n,i,a){return this.addPoints(e,n,e+i,n+a),this}build(){return this.points}}const Qr=(t,e)=>{const n=t.length;for(let i=0;i<n;i++)t[i]=i%5===0?e[6]*t[i+1]+e[7]*t[i+2]+e[8]*t[i]:i%5%2===1?e[0]*t[i]+e[1]*t[i+1]+e[2]:e[3]*t[i-1]+e[4]*t[i]+e[5];return t},ra=t=>{const e=qe(9);return e[0]=t,e[4]=t,e[8]=1,e},Ei=(t,e)=>{const n=qe(9);return n[0]=1,n[2]=t,n[4]=1,n[5]=e,n[8]=1,n},tc=(t,e,n)=>xs(Ei((1-t)*e,(1-t)*n),ra(t)),ws=(t,e,n)=>{const i=t.length,a=n&&n.length>=i?n.slice(0,i):qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?e[6]*t[u+1]+e[7]*t[u+2]+e[8]*t[u]:u%5%2===1?e[0]*t[u]+e[1]*t[u+1]+e[2]:e[3]*t[u-1]+e[4]*t[u]+e[5];return a};let Qf=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");class Gr{constructor(){this.__revision=0,this.__owner={value:void 0},this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,n,i)=>{const a=Rl[e];if(!this.eventHandlers[a])throw new Error(`Unknown event ${a}`);this.eventHandlers[a].indexOf(n)===-1&&this.eventHandlers[a].push(n)},this.removeEventListener=(e,n)=>{const i=Rl[e];if(!this.eventHandlers[i]){console.warn(`Unknown event ${i}`);return}this.eventHandlers[i].indexOf(n)!==-1&&(this.eventHandlers[i]=this.eventHandlers[i].filter(a=>a!==n))},this.id=this.__id=Qf(),this.eventHandlers=cC()}get crop(){return this._crop}set crop(e){this._crop=e}getObjectsAt(e){return[]}getAllPointsAt(e,n,i){return[]}getScheduledUpdates(e,n){return[]}dispatchEvent(e,n){const i=this.eventHandlers[e],a=i?i.length:0;let u=!1;if(a)for(let f=0;f<a;f++)try{i[f](n),u=!0}catch(p){console.error(e,p)}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,n){Qr(this.points,Ei(e,n))}atScale(e){Qr(this.points,tc(e,this.x,this.y)),this.scale*=e}transform(e){Qr(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,n){}hideInstance(){}}class Ar extends Gr{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height,e.x,e.y),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:Tt.singleBox(e.width/n,e.height/n),rotation:e==null?void 0:e.rotation}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;if(this.id=e.id||e.uri,this.uri=e.uri,this.points.set(Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.crop){this.cropData=e.crop;const a=Tt.singleBox(e.crop.width,e.crop.height,e.crop.x,e.crop.y);Qr(a,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(a):this.crop=qe(a)}e.display?(this.display.scale=i,this.display.width=e.display.width,this.display.height=e.display.height,this.display.rotation=e.display.rotation,this.display.points=Tt.singleBox(e.display.width,e.display.height)):(this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.display.points=Tt.singleBox(e.target.width/i,e.target.height/i))}getAllPointsAt(e,n,i){return[[this,this.crop||this.points,n]]}static fromSvg(e,n,i,a){return Ar.fromImage("data:image/svg+xml;base64,"+btoa(e),n,i,a)}static fromImage(e,n,i,a){const u=new Ar;return u.applyProps({uri:e,id:a,display:i,target:n}),u}getImageUrl(){return this.uri}}class kp extends Gr{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:n!==1?Tt.singleBox(e.width/n,e.height/n):this.points}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;this.id=e.id,this.points.set(Tt.singleBox(e.target.width,e.target.height)),this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.getTexture=e.getTexture,this.display.points=i!==1?Tt.singleBox(e.target.width/i,e.target.height/i):this.points}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}function hC(t,e,n=1){const i=e.length;if(i===0)throw new Error("No resources passed in.");let a=0;for(let u=0;u<i&&!(!e[u]||!e[u].display);u++)a=Math.abs(e[u].display.scale-t)*n<Math.abs(e[a].display.scale-t)?u:a;return a}function ky(t,e){return Math.abs(t-e)}function Gf(t,e){const n=ky(t.x,e.x),i=ky(t.y,e.y);return Math.sqrt(Math.pow(n,2)+Math.pow(i,2))}function pC(t){const e=t.length;return t.indexOf("/info.json")===e-10?t.slice(0,-10):t}function Iy(...t){return e=>t.forEach(n=>function(i,a){typeof i=="function"?i(a):i!=null&&(i.current=a)}(n,e))}function Xf(...t){return se.useCallback(Iy(...t),t)}function di(){return di=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},di.apply(this,arguments)}const Ny=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.Children.toArray(n).some(Uy)?se.createElement(se.Fragment,null,se.Children.map(n,a=>Uy(a)?se.createElement(Ip,di({},i,{ref:e}),a.props.children):a)):se.createElement(Ip,di({},i,{ref:e}),n)});Ny.displayName="Slot";const Ip=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.isValidElement(n)?se.cloneElement(n,{...vC(i,n.props),ref:Iy(e,n.ref)}):se.Children.count(n)>1?se.Children.only(null):null});Ip.displayName="SlotClone";const zy=({children:t})=>se.createElement(se.Fragment,null,t);function Uy(t){return se.isValidElement(t)&&t.type===zy}function vC(t,e){const n={...e};for(const i in e){const a=t[i],u=e[i];/^on[A-Z]/.test(i)?n[i]=(...f)=>{u==null||u(...f),a==null||a(...f)}:i==="style"?n[i]={...a,...u}:i==="className"&&(n[i]=[a,u].filter(Boolean).join(" "))}return{...t,...n}}const Kf=globalThis!=null&&globalThis.document?se.useLayoutEffect:()=>{};var Zf=function(e,n,i,a){this.name=e,this.fn=n,this.args=i,this.modifiers=a};Zf.prototype._test=function(e){var n=this.fn;try{Al(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return Al(this.modifiers.slice(),n,this)(e)}catch{return!1}},Zf.prototype._check=function(e){try{Al(this.modifiers.slice(),this.fn,this)(e)}catch{if(Al(this.modifiers.slice(),function(i){return i},this)(!1))return}if(!Al(this.modifiers.slice(),this.fn,this)(e))throw null},Zf.prototype._testAsync=function(e){var n=this;return new Promise(function(i,a){Fy(n.modifiers.slice(),n.fn,n)(e).then(function(u){u?i(e):a(null)}).catch(function(u){return a(u)})})};function jy(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function Al(t,e,n){if(t.length){var i=t.shift(),a=Al(t,e,n);return i.perform(a,n)}else return jy(e)}function Fy(t,e,n){if(t.length){var i=t.shift(),a=Fy(t,e,n);return i.performAsync(a,n)}else return function(u){return Promise.resolve(jy(e,"async")(u))}}var mC=function(e,n,i){this.name=e,this.perform=n,this.performAsync=i},Np=function(t){function e(n,i,a,u){for(var f=[],p=arguments.length-4;p-- >0;)f[p]=arguments[p+4];t.call(this,f),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=i,this.cause=a,this.target=u}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Xr=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};Xr.prototype._applyRule=function(e,n){var i=this;return function(){for(var a=[],u=arguments.length;u--;)a[u]=arguments[u];return i.chain.push(new Zf(n,e.apply(i,a),a,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}},Xr.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new mC(n,e.simple,e.async)),this},Xr.prototype._clone=function(){return new Xr(this.chain.slice(),this.nextRuleModifiers.slice())},Xr.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})},Xr.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(i){try{i._check(e)}catch(a){n.push(new Np(i,e,a))}}),n},Xr.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(i){throw new Np(n,e,i)}})},Xr.prototype.testAsync=function(e){var n=this;return new Promise(function(i,a){By(e,n.chain.slice(),i,a)})};function By(t,e,n,i){if(e.length){var a=e.shift();a._testAsync(t).then(function(){By(t,e,n,i)},function(u){i(new Np(a,t,u))})}else n(t)}var Hy=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function gC(t,e){return e===void 0&&(e=!1),{simple:function(n){return Hy(n,e)||t.check(n)===void 0},async:function(n){return Hy(n,e)||t.testAsync(n)}}}function sa(){return typeof Proxy<"u"?Vy(new Xr):zp(new Xr)}var nc={};sa.extend=function(t){Object.assign(nc,t)},sa.clearCustomRules=function(){nc={}};function Vy(t){return new Proxy(t,{get:function(n,i){if(i in n)return n[i];var a=Vy(t._clone());if(i in Jf)return a._applyModifier(Jf[i],i);if(i in nc)return a._applyRule(nc[i],i);if(i in Up)return a._applyRule(Up[i],i)}})}function zp(t){var e=function(a,u){return Object.keys(a).forEach(function(f){u[f]=function(){for(var p=[],g=arguments.length;g--;)p[g]=arguments[g];var S=zp(u._clone()),m=S._applyRule(a[f],f).apply(void 0,p);return m}}),u},n=e(Up,t),i=e(nc,n);return Object.keys(Jf).forEach(function(a){Object.defineProperty(i,a,{get:function(){var u=zp(i._clone());return u._applyModifier(Jf[a],a)}})}),i}var Jf={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return ed(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(ed(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&ed(e).every(t)}},async:function(t){return function(e){return Promise.all(ed(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(i){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function $y(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function ed(t){return typeof t=="string"?t.split(""):t}var Up={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||yC;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return Ml("string")},boolean:function(){return Ml("boolean")},undefined:function(){return Ml("undefined")},null:function(){return Ml("null")},array:function(){return Ml("array")},object:function(){return Ml("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return SC(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(i){return i.test(n)})}},optional:gC};function Ml(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function yC(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function SC(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(i){var a=t[i];try{a.check((e||{})[i])}catch(u){u.target=i,n.push(u)}}),n.length>0)throw n;return!0},async:function(e){var n=[],i=Object.keys(t).map(function(a){var u=t[a];return u.testAsync((e||{})[a]).catch(function(f){f.target=a,n.push(f)})});return Promise.all(i).then(function(){if(n.length>0)throw n;return!0})}}}var Vt="colors",xi="sizes",Ne="space",bC={gap:Ne,gridGap:Ne,columnGap:Ne,gridColumnGap:Ne,rowGap:Ne,gridRowGap:Ne,inset:Ne,insetBlock:Ne,insetBlockEnd:Ne,insetBlockStart:Ne,insetInline:Ne,insetInlineEnd:Ne,insetInlineStart:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockEnd:Ne,marginBlockStart:Ne,marginInline:Ne,marginInlineEnd:Ne,marginInlineStart:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockEnd:Ne,paddingBlockStart:Ne,paddingInline:Ne,paddingInlineEnd:Ne,paddingInlineStart:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,scrollMargin:Ne,scrollMarginTop:Ne,scrollMarginRight:Ne,scrollMarginBottom:Ne,scrollMarginLeft:Ne,scrollMarginX:Ne,scrollMarginY:Ne,scrollMarginBlock:Ne,scrollMarginBlockEnd:Ne,scrollMarginBlockStart:Ne,scrollMarginInline:Ne,scrollMarginInlineEnd:Ne,scrollMarginInlineStart:Ne,scrollPadding:Ne,scrollPaddingTop:Ne,scrollPaddingRight:Ne,scrollPaddingBottom:Ne,scrollPaddingLeft:Ne,scrollPaddingX:Ne,scrollPaddingY:Ne,scrollPaddingBlock:Ne,scrollPaddingBlockEnd:Ne,scrollPaddingBlockStart:Ne,scrollPaddingInline:Ne,scrollPaddingInlineEnd:Ne,scrollPaddingInlineStart:Ne,fontSize:"fontSizes",background:Vt,backgroundColor:Vt,backgroundImage:Vt,borderImage:Vt,border:Vt,borderBlock:Vt,borderBlockEnd:Vt,borderBlockStart:Vt,borderBottom:Vt,borderBottomColor:Vt,borderColor:Vt,borderInline:Vt,borderInlineEnd:Vt,borderInlineStart:Vt,borderLeft:Vt,borderLeftColor:Vt,borderRight:Vt,borderRightColor:Vt,borderTop:Vt,borderTopColor:Vt,caretColor:Vt,color:Vt,columnRuleColor:Vt,fill:Vt,outline:Vt,outlineColor:Vt,stroke:Vt,textDecorationColor:Vt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:xi,minBlockSize:xi,maxBlockSize:xi,inlineSize:xi,minInlineSize:xi,maxInlineSize:xi,width:xi,minWidth:xi,maxWidth:xi,height:xi,minHeight:xi,maxHeight:xi,flexBasis:xi,gridTemplateColumns:xi,gridTemplateRows:xi,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},EC=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,Ol=()=>{const t=Object.create(null);return(e,n,...i)=>{const a=(u=>JSON.stringify(u,EC))(e);return a in t?t[a]:t[a]=n(e,...i)}},Za=Symbol.for("sxs.internal"),jp=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),Wy=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:xC}=Object.prototype,Fp=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),wC=/\s+(?![^()]*\))/,_l=t=>e=>t(...typeof e=="string"?String(e).split(wC):[e]),qy={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:_l((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:_l((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:_l((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:_l((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:_l((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:_l((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},Bp=/([\d.]+)([^]*)/,CC=(t,e)=>t.length?t.reduce((n,i)=>(n.push(...e.map(a=>a.includes("&")?a.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(a)?`:is(${i})`:i):i+" "+a)),n),[]):e,TC=(t,e)=>t in RC&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,a,u)=>i+(a==="stretch"?`-moz-available${u};${Fp(t)}:${i}-webkit-fill-available`:`-moz-fit-content${u};${Fp(t)}:${i}fit-content`)+u):String(e),RC={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Cs=t=>t?t+"-":"",Yy=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,a,u,f,p)=>f=="$"==!!u?i:(a||f=="--"?"calc(":"")+"var(--"+(f==="$"?Cs(e)+(p.includes("$")?"":Cs(n))+p.replace(/\$/g,"-"):p)+")"+(a||f=="--"?"*"+(a||"")+(u||"1")+")":"")),AC=/\s*,\s*(?![^()]*\))/,MC=Object.prototype.toString,Ll=(t,e,n,i,a)=>{let u,f,p;const g=(S,m,x)=>{let T,_;const M=k=>{for(T in k){const O=T.charCodeAt(0)===64,j=O&&Array.isArray(k[T])?k[T]:[k[T]];for(_ of j){const q=/[A-Z]/.test(P=T)?P:P.replace(/-[^]/g,H=>H[1].toUpperCase()),ee=typeof _=="object"&&_&&_.toString===MC&&(!i.utils[q]||!m.length);if(q in i.utils&&!ee){const H=i.utils[q];if(H!==f){f=H,M(H(_)),f=null;continue}}else if(q in qy){const H=qy[q];if(H!==p){p=H,M(H(_)),p=null;continue}}if(O&&(L=T.slice(1)in i.media?"@media "+i.media[T.slice(1)]:T,T=L.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(H,Z,ie,W,re,ge)=>{const be=Bp.test(Z),Ee=.0625*(be?-1:1),[Ue,je]=be?[W,Z]:[Z,W];return"("+(ie[0]==="="?"":ie[0]===">"===be?"max-":"min-")+Ue+":"+(ie[0]!=="="&&ie.length===1?je.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(ie===">"?1:-1)+me):je)+(re?") and ("+(re[0]===">"?"min-":"max-")+Ue+":"+(re.length===1?ge.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(re===">"?-1:1)+me):ge):"")+")"})),ee){const H=O?x.concat(T):[...x],Z=O?[...m]:CC(m,T.split(AC));u!==void 0&&a(Qy(...u)),u=void 0,g(_,Z,H)}else u===void 0&&(u=[[],m,x]),T=O||T.charCodeAt(0)!==36?T:`--${Cs(i.prefix)}${T.slice(1).replace(/\$/g,"-")}`,_=ee?_:typeof _=="number"?_&&q in OC?String(_)+"px":String(_):Yy(TC(q,_??""),i.prefix,i.themeMap[q]),u[0].push(`${O?`${T} `:`${Fp(T)}:`}${_}`)}}var L,P};M(S),u!==void 0&&a(Qy(...u)),u=void 0};g(t,e,n)},Qy=(t,e,n)=>`${n.map(i=>`${i}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,OC={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Gy=t=>String.fromCharCode(t+(t>25?39:97)),Ja=t=>(e=>{let n,i="";for(n=Math.abs(e);n>52;n=n/52|0)i=Gy(n%52)+i;return Gy(n%52)+i})(((e,n)=>{let i=n.length;for(;i;)e=33*e^n.charCodeAt(--i);return e})(5381,JSON.stringify(t))>>>0),ic=["themed","global","styled","onevar","resonevar","allvar","inline"],_C=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},LC=t=>{let e;const n=()=>{const{cssRules:a}=e.sheet;return[].map.call(a,(u,f)=>{const{cssText:p}=u;let g="";if(p.startsWith("--sxs"))return"";if(a[f-1]&&(g=a[f-1].cssText).startsWith("--sxs")){if(!u.cssRules.length)return"";for(const S in e.rules)if(e.rules[S].group===u)return`--sxs{--sxs:${[...e.rules[S].cache].join(" ")}}${p}`;return u.cssRules.length?`${g}${p}`:""}return p}).join("")},i=()=>{if(e){const{rules:p,sheet:g}=e;if(!g.deleteRule){for(;Object(Object(g.cssRules)[0]).type===3;)g.cssRules.splice(0,1);g.cssRules=[]}for(const S in p)delete p[S]}const a=Object(t).styleSheets||[];for(const p of a)if(_C(p)){for(let g=0,S=p.cssRules;S[g];++g){const m=Object(S[g]);if(m.type!==1)continue;const x=Object(S[g+1]);if(x.type!==4)continue;++g;const{cssText:T}=m;if(!T.startsWith("--sxs"))continue;const _=T.slice(14,-3).trim().split(/\s+/),M=ic[_[0]];M&&(e||(e={sheet:p,reset:i,rules:{},toString:n}),e.rules[M]={group:x,index:g,cache:new Set(_)})}if(e)break}if(!e){const p=(g,S)=>({type:S,cssRules:[],insertRule(m,x){this.cssRules.splice(x,0,p(m,{import:3,undefined:1}[(m.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return g==="@media{}"?`@media{${[].map.call(this.cssRules,m=>m.cssText).join("")}}`:g}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:p("","text/css"),rules:{},reset:i,toString:n}}const{sheet:u,rules:f}=e;for(let p=ic.length-1;p>=0;--p){const g=ic[p];if(!f[g]){const S=ic[p+1],m=f[S]?f[S].index:u.cssRules.length;u.insertRule("@media{}",m),u.insertRule(`--sxs{--sxs:${p}}`,m),f[g]={group:u.cssRules[m+1],index:m,cache:new Set([p])}}PC(f[g])}};return i(),e},PC=t=>{const e=t.group;let n=e.cssRules.length;t.apply=i=>{try{e.insertRule(i,n),++n}catch{}}},rc=Symbol(),DC=Ol(),Xy=(t,e)=>DC(t,()=>(...n)=>{let i={type:null,composers:new Set};for(const a of n)if(a!=null)if(a[Za]){i.type==null&&(i.type=a[Za].type);for(const u of a[Za].composers)i.composers.add(u)}else a.constructor!==Object||a.$$typeof?i.type==null&&(i.type=a):i.composers.add(kC(a,t));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),IC(t,i,e)}),kC=({variants:t,compoundVariants:e,defaultVariants:n,...i},a)=>{const u=`${Cs(a.prefix)}c-${Ja(i)}`,f=[],p=[],g=Object.create(null),S=[];for(const T in n)g[T]=String(n[T]);if(typeof t=="object"&&t)for(const T in t){m=g,x=T,xC.call(m,x)||(g[T]="undefined");const _=t[T];for(const M in _){const k={[T]:String(M)};String(M)==="undefined"&&S.push(T);const L=_[M],P=[k,L,!Wy(L)];f.push(P)}}var m,x;if(typeof e=="object"&&e)for(const T of e){let{css:_,...M}=T;_=typeof _=="object"&&_||{};for(const L in M)M[L]=String(M[L]);const k=[M,_,!Wy(_)];p.push(k)}return[u,i,f,p,g,S]},IC=(t,e,n)=>{const[i,a,u,f]=NC(e.composers),p=typeof e.type=="function"||e.type.$$typeof?(x=>{function T(){for(let _=0;_<T[rc].length;_++){const[M,k]=T[rc][_];x.rules[M].apply(k)}return T[rc]=[],null}return T[rc]=[],T.rules={},ic.forEach(_=>T.rules[_]={apply:M=>T[rc].push([_,M])}),T})(n):null,g=(p||n).rules,S=`.${i}${a.length>1?`:where(.${a.slice(1).join(".")})`:""}`,m=x=>{x=typeof x=="object"&&x||zC;const{css:T,..._}=x,M={};for(const P in u)if(delete _[P],P in x){let O=x[P];typeof O=="object"&&O?M[P]={"@initial":u[P],...O}:(O=String(O),M[P]=O!=="undefined"||f.has(P)?O:u[P])}else M[P]=u[P];const k=new Set([...a]);for(const[P,O,j,q]of e.composers){n.rules.styled.cache.has(P)||(n.rules.styled.cache.add(P),Ll(O,[`.${P}`],[],t,Z=>{g.styled.apply(Z)}));const ee=Ky(j,M,t.media),H=Ky(q,M,t.media,!0);for(const Z of ee)if(Z!==void 0)for(const[ie,W,re]of Z){const ge=`${P}-${Ja(W)}-${ie}`;k.add(ge);const be=(re?n.rules.resonevar:n.rules.onevar).cache,Ee=re?g.resonevar:g.onevar;be.has(ge)||(be.add(ge),Ll(W,[`.${ge}`],[],t,Ue=>{Ee.apply(Ue)}))}for(const Z of H)if(Z!==void 0)for(const[ie,W]of Z){const re=`${P}-${Ja(W)}-${ie}`;k.add(re),n.rules.allvar.cache.has(re)||(n.rules.allvar.cache.add(re),Ll(W,[`.${re}`],[],t,ge=>{g.allvar.apply(ge)}))}}if(typeof T=="object"&&T){const P=`${i}-i${Ja(T)}-css`;k.add(P),n.rules.inline.cache.has(P)||(n.rules.inline.cache.add(P),Ll(T,[`.${P}`],[],t,O=>{g.inline.apply(O)}))}for(const P of String(x.className||"").trim().split(/\s+/))P&&k.add(P);const L=_.className=[...k].join(" ");return{type:e.type,className:L,selector:S,props:_,toString:()=>L,deferredInjector:p}};return jp(m,{className:i,selector:S,[Za]:e,toString:()=>(n.rules.styled.cache.has(i)||m(),i)})},NC=t=>{let e="";const n=[],i={},a=[];for(const[u,,,,f,p]of t){e===""&&(e=u),n.push(u),a.push(...p);for(const g in f){const S=f[g];(i[g]===void 0||S!=="undefined"||p.includes(S))&&(i[g]=S)}}return[e,n,i,new Set(a)]},Ky=(t,e,n,i)=>{const a=[];e:for(let[u,f,p]of t){if(p)continue;let g,S=0,m=!1;for(g in u){const x=u[g];let T=e[g];if(T!==x){if(typeof T!="object"||!T)continue e;{let _,M,k=0;for(const L in T){if(x===String(T[L])){if(L!=="@initial"){const P=L.slice(1);(M=M||[]).push(P in n?n[P]:L.replace(/^@media ?/,"")),m=!0}S+=k,_=!0}++k}if(M&&M.length&&(f={["@media "+M.join(", ")]:f}),!_)continue e}}}(a[S]=a[S]||[]).push([i?"cv":`${g}-${u[g]}`,f,m])}return a},zC={},UC=Ol(),jC=(t,e)=>UC(t,()=>(...n)=>{const i=()=>{for(let a of n){a=typeof a=="object"&&a||{};let u=Ja(a);if(!e.rules.global.cache.has(u)){if(e.rules.global.cache.add(u),"@import"in a){let f=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let p of[].concat(a["@import"]))p=p.includes('"')||p.includes("'")?p:`"${p}"`,e.sheet.insertRule(`@import ${p};`,f++);delete a["@import"]}Ll(a,[],[],t,f=>{e.rules.global.apply(f)})}}return""};return jp(i,{toString:i})}),FC=Ol(),BC=(t,e)=>FC(t,()=>n=>{const i=`${Cs(t.prefix)}k-${Ja(n)}`,a=()=>{if(!e.rules.global.cache.has(i)){e.rules.global.cache.add(i);const u=[];Ll(n,[],[],t,p=>u.push(p));const f=`@keyframes ${i}{${u.join("")}}`;e.rules.global.apply(f)}return i};return jp(a,{get name(){return a()},toString:a})}),HC=class{constructor(e,n,i,a){this.token=e==null?"":String(e),this.value=n==null?"":String(n),this.scale=i==null?"":String(i),this.prefix=a==null?"":String(a)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Cs(this.prefix)+Cs(this.scale)+this.token}toString(){return this.computedValue}},VC=Ol(),$C=(t,e)=>VC(t,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const a=`.${n=(n=typeof n=="string"?n:"")||`${Cs(t.prefix)}t-${Ja(i)}`}`,u={},f=[];for(const g in i){u[g]={};for(const S in i[g]){const m=`--${Cs(t.prefix)}${g}-${S}`,x=Yy(String(i[g][S]),t.prefix,g);u[g][S]=new HC(S,x,g,t.prefix),f.push(`${m}:${x}`)}}const p=()=>{if(f.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const g=`${i===t.theme?":root,":""}.${n}{${f.join(";")}}`;e.rules.themed.apply(g)}return n};return{...u,get className(){return p()},selector:a,toString:p}}),WC=Ol(),qC=Ol(),YC=t=>{const e=(n=>{let i=!1;const a=WC(n,u=>{i=!0;const f="prefix"in(u=typeof u=="object"&&u||{})?String(u.prefix):"",p=typeof u.media=="object"&&u.media||{},g=typeof u.root=="object"?u.root||null:globalThis.document||null,S=typeof u.theme=="object"&&u.theme||{},m={prefix:f,media:p,theme:S,themeMap:typeof u.themeMap=="object"&&u.themeMap||{...bC},utils:typeof u.utils=="object"&&u.utils||{}},x=LC(g),T={css:Xy(m,x),globalCss:jC(m,x),keyframes:BC(m,x),createTheme:$C(m,x),reset(){x.reset(),T.theme.toString()},theme:{},sheet:x,config:m,prefix:f,getCssText:x.toString,toString:x.toString};return String(T.theme=T.createTheme(S)),T});return i||a.reset(),a})(t);return e.styled=(({config:n,sheet:i})=>qC(n,()=>{const a=Xy(n,i);return(...u)=>{const f=a(...u),p=f[Za].type,g=R.forwardRef((S,m)=>{const x=S&&S.as||p,{props:T,deferredInjector:_}=f(S);return delete T.as,T.ref=m,_?R.createElement(R.Fragment,null,R.createElement(x,T),R.createElement(_,null)):R.createElement(x,T)});return g.className=f.className,g.displayName=`Styled.${p.displayName||p.name||p}`,g.selector=f.selector,g.toString=()=>f.selector,g[Za]=f[Za],g}}))(e),e};function QC(t,e,n){return Math.max(e,Math.min(t,n))}const hi={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function Zy(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function Jy(t,e,n,i=.15){return i===0?QC(t,e,n):t<e?-Zy(e-t,n-e,i)+e:t>n?+Zy(t-n,n-e,i)+n:t}function GC(t,[e,n],[i,a]){const[[u,f],[p,g]]=t;return[Jy(e,u,f,i),Jy(n,p,g,a)]}function XC(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function KC(t){var e=XC(t,"string");return typeof e=="symbol"?e:String(e)}function zi(t,e,n){return e=KC(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function vn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e0(Object(n),!0).forEach(function(i){zi(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const t0={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function n0(t){return t?t[0].toUpperCase()+t.slice(1):""}const ZC=["enter","leave"];function JC(t=!1,e){return t&&!ZC.includes(e)}function eT(t,e="",n=!1){const i=t0[t],a=i&&i[e]||e;return"on"+n0(t)+n0(a)+(JC(n,a)?"Capture":"")}const tT=["gotpointercapture","lostpointercapture"];function nT(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const i=tT.includes(e)?"capturecapture":"capture",a=!!~e.indexOf(i);return a&&(e=e.replace("capture","")),{device:e,capture:a,passive:n}}function iT(t,e=""){const n=t0[t],i=n&&n[e]||e;return t+i}function td(t){return"touches"in t}function i0(t){return td(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function rT(t){return Array.from(t.touches).filter(e=>{var n,i;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(i=n.contains)===null||i===void 0?void 0:i.call(n,e.target))})}function sT(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function r0(t){return td(t)?sT(t)[0]:t}function aT(t){return rT(t).map(e=>e.identifier)}function Hp(t){const e=r0(t);return td(t)?e.identifier:e.pointerId}function s0(t){const e=r0(t);return[e.clientX,e.clientY]}function oT(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u}=t;Object.assign(e,{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u})}return e}function nd(t,...e){return typeof t=="function"?t(...e):t}function lT(){}function uT(...t){return t.length===0?lT:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function a0(t,e){return Object.assign({},e,t||{})}const cT=32;class fT{constructor(e,n,i){this.ctrl=e,this.args=n,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:i,args:a}=this;n[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=a,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,i=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=i.from?nd(i.from,n):n.offset,n.offset=n.lastOffset),n.startTime=n.timeStamp=e.timeStamp}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:i,shared:a}=this;n.args=this.args;let u=0;if(e&&(n.event=e,i.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,a.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,a.locked=!!document.pointerLockElement,Object.assign(a,oT(e)),a.down=a.pressed=a.buttons%2===1||a.touches>0,u=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const H=n._delta.map(Math.abs);hi.addTo(n._distance,H)}this.axisIntent&&this.axisIntent(e);const[f,p]=n._movement,[g,S]=i.threshold,{_step:m,values:x}=n;if(i.hasCustomTransform?(m[0]===!1&&(m[0]=Math.abs(f)>=g&&x[0]),m[1]===!1&&(m[1]=Math.abs(p)>=S&&x[1])):(m[0]===!1&&(m[0]=Math.abs(f)>=g&&Math.sign(f)*g),m[1]===!1&&(m[1]=Math.abs(p)>=S&&Math.sign(p)*S)),n.intentional=m[0]!==!1||m[1]!==!1,!n.intentional)return;const T=[0,0];if(i.hasCustomTransform){const[H,Z]=x;T[0]=m[0]!==!1?H-m[0]:0,T[1]=m[1]!==!1?Z-m[1]:0}else T[0]=m[0]!==!1?f-m[0]:0,T[1]=m[1]!==!1?p-m[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(T);const _=n.offset,M=n._active&&!n._blocked||n.active;M&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=a[this.ingKey]=n._active,e&&(n.first&&("bounds"in i&&(n._bounds=nd(i.bounds,n)),this.setup&&this.setup()),n.movement=T,this.computeOffset()));const[k,L]=n.offset,[[P,O],[j,q]]=n._bounds;n.overflow=[k<P?-1:k>O?1:0,L<j?-1:L>q?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const ee=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=GC(n._bounds,n.offset,ee),n.delta=hi.sub(n.offset,_),this.computeMovement(),M&&(!n.last||u>cT)){n.delta=hi.sub(n.offset,_);const H=n.delta.map(Math.abs);hi.addTo(n.distance,H),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&u>0&&(n.velocity=[H[0]/u,H[1]/u])}}emit(){const e=this.state,n=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;const a=this.handler(vn(vn(vn({},n),e),{},{[this.aliasKey]:e.values}));a!==void 0&&(e.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function dT([t,e],n){const i=Math.abs(t),a=Math.abs(e);if(i>a&&i>n)return"x";if(a>i&&a>n)return"y"}class hT extends fT{constructor(...e){super(...e),zi(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=hi.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=hi.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,i=this.config;if(!n.axis&&e){const a=typeof i.axisThreshold=="object"?i.axisThreshold[i0(e)]:i.axisThreshold;n.axis=dT(n._movement,a)}n._blocked=(i.lockDirection||!!i.axis)&&!n.axis||!!i.axis&&i.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const pT=t=>t,o0=.15,l0={enabled(t=!0){return t},eventOptions(t,e,n){return vn(vn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[o0,o0];case!1:return[0,0];default:return hi.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return hi.toVector(t)},transform(t,e,n){const i=t||n.shared.transform;return this.hasCustomTransform=!!i,i||pT},threshold(t){return hi.toVector(t,0)}},vT=0,sc=vn(vn({},l0),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=vT){return t},bounds(t={}){if(typeof t=="function")return u=>sc.bounds(t(u));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:i=-1/0,bottom:a=1/0}=t;return[[e,n],[i,a]]}}),u0={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class mT extends hT{constructor(...e){super(...e),zi(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),a={left:n.left-i.left+e.offset[0],right:n.right-i.right+e.offset[0],top:n.top-i.top+e.offset[1],bottom:n.bottom-i.bottom+e.offset[1]};e._bounds=sc.bounds(a)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,i=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const a=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(a&&a.size>1&&i._pointerActive)&&(this.start(e),this.setupPointer(e),i._pointerId=Hp(e),i._pointerActive=!0,this.computeValues(s0(e)),this.computeInitial(),n.preventScrollAxis&&i0(e)!=="mouse"?(i._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,i=this.config;if(!n._pointerActive||n.type===e.type&&e.timeStamp===n.timeStamp)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;const u=s0(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=hi.sub(u,n._values),this.computeValues(u)),hi.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===i.preventScrollAxis||i.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,i=this.config;if(!n._active||!n._pointerActive)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[u,f]=n._distance;if(n.tap=u<=i.tapsThreshold&&f<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[p,g]=n.direction,[S,m]=n.velocity,[x,T]=n.movement,[_,M]=i.swipe.velocity,[k,L]=i.swipe.distance,P=i.swipe.duration;n.elapsedTime<P&&(Math.abs(S)>_&&Math.abs(x)>k&&(n.swipe[0]=p),Math.abs(m)>M&&Math.abs(T)>L&&(n.swipe[1]=g))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,i=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,gT(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=u0[e.key];if(n){const i=this.state,a=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=n(this.config.keyboardDisplacement,a),i._keyboardActive=!0,hi.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in u0&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function gT(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const ac=typeof window<"u"&&window.document&&window.document.createElement;function yT(){return ac&&"ontouchstart"in window}function c0(){return yT()||ac&&window.navigator.maxTouchPoints>1}function ST(){return ac&&"onpointerdown"in window}function bT(){return ac&&"exitPointerLock"in window.document}function ET(){try{return"constructor"in GestureEvent}catch{return!1}}const pr={isBrowser:ac,gesture:ET(),touch:c0(),touchscreen:c0(),pointer:ST(),pointerLock:bT()},xT=250,wT=180,CT=.5,TT=50,RT=250,AT=10,f0={mouse:0,touch:0,pen:8},MT=vn(vn({},sc),{},{device(t,e,{pointer:{touch:n=!1,lock:i=!1,mouse:a=!1}={}}){return this.pointerLock=i&&pr.pointerLock,pr.touch&&n?"touch":this.pointerLock?"mouse":pr.pointer&&!a?"pointer":pr.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?xT:void 0,!(!pr.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:i=1,keys:a=!0}={}}){return this.pointerButtons=i,this.keys=a,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:i=3,axis:a=void 0}){const u=hi.toVector(t,n?i:a?1:0);return this.filterTaps=n,this.tapsThreshold=i,u},swipe({velocity:t=CT,distance:e=TT,duration:n=RT}={}){return{velocity:this.transform(hi.toVector(t)),distance:this.transform(hi.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return wT;case!1:return 0;default:return t}},axisThreshold(t){return t?vn(vn({},f0),t):f0},keyboardDisplacement(t=AT){return t}});vn(vn({},l0),{},{device(t,e,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!pr.touch&&pr.gesture)return"gesture";if(pr.touch&&i)return"touch";if(pr.touchscreen){if(pr.pointer)return"pointer";if(pr.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:i={}}){const a=f=>{const p=a0(nd(n,f),{min:-1/0,max:1/0});return[p.min,p.max]},u=f=>{const p=a0(nd(i,f),{min:-1/0,max:1/0});return[p.min,p.max]};return typeof n!="function"&&typeof i!="function"?[a(),u()]:f=>[a(f),u(f)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",hi.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t});const d0=new Map,Vp=new Map;function OT(t){d0.set(t.key,t.engine),Vp.set(t.key,t.resolver)}const _T={key:"drag",engine:mT,resolver:MT};function LT(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function PT(t,e){if(t==null)return{};var n=LT(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}const DT={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=pr.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},kT=["target","eventOptions","window","enabled","transform"];function id(t={},e){const n={};for(const[i,a]of Object.entries(e))switch(typeof a){case"function":n[i]=a.call(n,t[i],i,t);break;case"object":n[i]=id(t[i],a);break;case"boolean":a&&(n[i]=t[i]);break}return n}function IT(t,e,n={}){const i=t,{target:a,eventOptions:u,window:f,enabled:p,transform:g}=i,S=PT(i,kT);if(n.shared=id({target:a,eventOptions:u,window:f,enabled:p,transform:g},DT),e){const m=Vp.get(e);n[e]=id(vn({shared:n.shared},S),m)}else for(const m in S){const x=Vp.get(m);x&&(n[m]=id(vn({shared:n.shared},S[m]),x))}return n}class h0{constructor(e,n){zi(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,i,a,u){const f=this._listeners,p=iT(n,i),g=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},S=vn(vn({},g),u);e.addEventListener(p,a,S);const m=()=>{e.removeEventListener(p,a,S),f.delete(m)};return f.add(m),m}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class NT{constructor(){zi(this,"_timeouts",new Map)}add(e,n,i=140,...a){this.remove(e),this._timeouts.set(e,window.setTimeout(n,i,...a))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class zT{constructor(e){zi(this,"gestures",new Set),zi(this,"_targetEventStore",new h0(this)),zi(this,"gestureEventStores",{}),zi(this,"gestureTimeoutStores",{}),zi(this,"handlers",{}),zi(this,"config",{}),zi(this,"pointerIds",new Set),zi(this,"touchIds",new Set),zi(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),UT(this,e)}setEventIds(e){if(td(e))return this.touchIds=new Set(aT(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=IT(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,i={};let a;if(!(n.target&&(a=n.target(),!a))){if(n.enabled){for(const f of this.gestures){const p=this.config[f],g=p0(i,p.eventOptions,!!a);if(p.enabled){const S=d0.get(f);new S(this,e,f).bind(g)}}const u=p0(i,n.eventOptions,!!a);for(const f in this.nativeHandlers)u(f,"",p=>this.nativeHandlers[f](vn(vn({},this.state.shared),{},{event:p,args:e})),void 0,!0)}for(const u in i)i[u]=uT(...i[u]);if(!a)return i;for(const u in i){const{device:f,capture:p,passive:g}=nT(u);this._targetEventStore.add(a,f,"",i[u],{capture:p,passive:g})}}}}function Pl(t,e){t.gestures.add(e),t.gestureEventStores[e]=new h0(t,e),t.gestureTimeoutStores[e]=new NT}function UT(t,e){e.drag&&Pl(t,"drag"),e.wheel&&Pl(t,"wheel"),e.scroll&&Pl(t,"scroll"),e.move&&Pl(t,"move"),e.pinch&&Pl(t,"pinch"),e.hover&&Pl(t,"hover")}const p0=(t,e,n)=>(i,a,u,f={},p=!1)=>{var g,S;const m=(g=f.capture)!==null&&g!==void 0?g:e.capture,x=(S=f.passive)!==null&&S!==void 0?S:e.passive;let T=p?i:eT(i,a,m);n&&x&&(T+="Passive"),t[T]=t[T]||[],t[T].push(u)};function jT(t,e={},n,i){const a=R.useMemo(()=>new zT(t),[]);if(a.applyHandlers(t,i),a.applyConfig(e,n),R.useEffect(a.effect.bind(a)),R.useEffect(()=>a.clean.bind(a),[]),e.target===void 0)return a.bind.bind(a)}function FT(t,e){return OT(_T),jT({drag:t},e||{},"drag")}const BT=se.useId||(()=>{});let HT=0;function VT(t){const[e,n]=se.useState(BT());return Kf(()=>{t||n(i=>i??String(HT++))},[t]),t||(e?`radix-${e}`:"")}const Dl=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((t,e)=>({...t,[e]:se.forwardRef((n,i)=>{const{asChild:a,...u}=n,f=a?Ny:e;return se.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.as&&console.error($T),se.createElement(f,di({},u,{ref:i}))})}),{}),$T="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",WT=se.forwardRef((t,e)=>se.createElement(Dl.span,di({},t,{ref:e,style:{...t.style,position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}}))),qT=se.forwardRef((t,e)=>{var n,i;const{containerRef:a,style:u,...f}=t,p=(n=a==null?void 0:a.current)!==null&&n!==void 0?n:globalThis==null||(i=globalThis.document)===null||i===void 0?void 0:i.body,[,g]=se.useState({});return Kf(()=>{g({})},[]),p?by.createPortal(se.createElement(Dl.div,di({"data-radix-portal":""},f,{ref:e,style:p===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...u}:void 0})),p):null}),YT=se.forwardRef((t,e)=>{const{children:n,width:i=10,height:a=5,...u}=t;return se.createElement(Dl.svg,di({},u,{ref:e,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:se.createElement("polygon",{points:"0,0 30,0 15,10"}))});function v0(t){const[e,n]=se.useState(void 0);return se.useEffect(()=>{if(t){const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const u=a[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,S=Array.isArray(g)?g[0]:g;f=S.inlineSize,p=S.blockSize}else{const g=t.getBoundingClientRect();f=g.width,p=g.height}n({width:f,height:p})});return i.observe(t,{box:"border-box"}),()=>{n(void 0),i.unobserve(t)}}},[t]),e}function QT(t,e){const n=eo.get(t);return n===void 0?(eo.set(t,{rect:{},callbacks:[e]}),eo.size===1&&($p=requestAnimationFrame(m0))):(n.callbacks.push(e),e(t.getBoundingClientRect())),()=>{const i=eo.get(t);if(i===void 0)return;const a=i.callbacks.indexOf(e);a>-1&&i.callbacks.splice(a,1),i.callbacks.length===0&&(eo.delete(t),eo.size===0&&cancelAnimationFrame($p))}}let $p;const eo=new Map;function m0(){const t=[];eo.forEach((e,n)=>{const i=n.getBoundingClientRect();var a,u;a=e.rect,u=i,(a.width!==u.width||a.height!==u.height||a.top!==u.top||a.right!==u.right||a.bottom!==u.bottom||a.left!==u.left)&&(e.rect=i,t.push(e))}),t.forEach(e=>{e.callbacks.forEach(n=>n(e.rect))}),$p=requestAnimationFrame(m0)}function g0(t){const[e,n]=se.useState();return se.useEffect(()=>{if(t){const i=QT(t,n);return()=>{n(void 0),i()}}},[t]),e}function y0(t,e=[]){let n=[];const i=()=>{const a=n.map(u=>se.createContext(u));return function(u){const f=(u==null?void 0:u[t])||a;return se.useMemo(()=>({[`__scope${t}`]:{...u,[t]:f}}),[u,f])}};return i.scopeName=t,[function(a,u){const f=se.createContext(u),p=n.length;function g(S){const{scope:m,children:x,...T}=S,_=(m==null?void 0:m[t][p])||f,M=se.useMemo(()=>T,Object.values(T));return se.createElement(_.Provider,{value:M},x)}return n=[...n,u],g.displayName=a+"Provider",[g,function(S,m){const x=(m==null?void 0:m[t][p])||f,T=se.useContext(x);if(T)return T;if(u!==void 0)return u;throw new Error(`\`${S}\` must be used within \`${a}\``)}]},GT(i,...e)]}function GT(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(a){const u=i.reduce((f,{useScope:p,scopeName:g})=>({...f,...p(a)[`__scope${g}`]}),{});return se.useMemo(()=>({[`__scope${e.scopeName}`]:u}),[u])}};return n.scopeName=e.scopeName,n}function XT({anchorRect:t,popperSize:e,arrowSize:n,arrowOffset:i=0,side:a,sideOffset:u=0,align:f,alignOffset:p=0,shouldAvoidCollisions:g=!0,collisionBoundariesRect:S,collisionTolerance:m=0}){if(!t||!e||!S)return{popperStyles:KT,arrowStyles:Wp};const x=function(Z,ie,W=0,re=0,ge){const be=ge?ge.height:0,Ee=S0(ie,Z,"x"),Ue=S0(ie,Z,"y"),je=Ue.before-W-be,Xe=Ue.after+W+be,ce=Ee.before-W-be,me=Ee.after+W+be;return{top:{start:{x:Ee.start+re,y:je},center:{x:Ee.center,y:je},end:{x:Ee.end-re,y:je}},right:{start:{x:me,y:Ue.start+re},center:{x:me,y:Ue.center},end:{x:me,y:Ue.end-re}},bottom:{start:{x:Ee.start+re,y:Xe},center:{x:Ee.center,y:Xe},end:{x:Ee.end-re,y:Xe}},left:{start:{x:ce,y:Ue.start+re},center:{x:ce,y:Ue.center},end:{x:ce,y:Ue.end-re}}}}(e,t,u,p,n),T=x[a][f];if(g===!1){const Z=b0(T);let ie=Wp;return n&&(ie=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:a,align:f})),{popperStyles:{...Z,"--radix-popper-transform-origin":E0(e,a,f,i,n)},arrowStyles:ie,placedSide:a,placedAlign:f}}const _=DOMRect.fromRect({...e,...T}),M=(k=S,L=m,DOMRect.fromRect({width:k.width-2*L,height:k.height-2*L,x:k.left+L,y:k.top+L}));var k,L;const P=C0(_,M),O=x[w0(a)][f],j=function(Z,ie,W){const re=w0(Z);return ie[Z]&&!W[re]?re:Z}(a,P,C0(DOMRect.fromRect({...e,...O}),M)),q=function(Z,ie,W,re,ge){const be=W==="top"||W==="bottom",Ee=be?"left":"top",Ue=be?"right":"bottom",je=be?"width":"height",Xe=ie[je]>Z[je];return(re==="start"||re==="center")&&(ge[Ee]&&Xe||ge[Ue]&&!Xe)?"end":(re==="end"||re==="center")&&(ge[Ue]&&Xe||ge[Ee]&&!Xe)?"start":re}(e,t,a,f,P),ee=b0(x[j][q]);let H=Wp;return n&&(H=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:j,align:q})),{popperStyles:{...ee,"--radix-popper-transform-origin":E0(e,j,q,i,n)},arrowStyles:H,placedSide:j,placedAlign:q}}function S0(t,e,n){const i=t[n==="x"?"left":"top"],a=n==="x"?"width":"height",u=t[a],f=e[a];return{before:i-f,start:i,center:i+(u-f)/2,end:i+u-f,after:i+u}}function b0(t){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(t.x+window.scrollX)}px, ${Math.round(t.y+window.scrollY)}px, 0)`}}function E0(t,e,n,i,a){const u=e==="top"||e==="bottom",f=a?a.width:0,p=a?a.height:0,g=f/2+i;let S="",m="";return u?(S={start:`${g}px`,center:"center",end:t.width-g+"px"}[n],m=e==="top"?`${t.height+p}px`:-p+"px"):(S=e==="left"?`${t.width+p}px`:-p+"px",m={start:`${g}px`,center:"center",end:t.height-g+"px"}[n]),`${S} ${m}`}const KT={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Wp={position:"absolute",opacity:0};function x0({popperSize:t,arrowSize:e,arrowOffset:n,side:i,align:a}){const u=(t.width-e.width)/2,f=(t.height-e.width)/2,p={top:0,right:90,bottom:180,left:-90}[i],g=Math.max(e.width,e.height),S={width:`${g}px`,height:`${g}px`,transform:`rotate(${p}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:ZT(i,a)};return i!=="top"&&i!=="bottom"||(a==="start"&&(S.left=`${n}px`),a==="center"&&(S.left=`${u}px`),a==="end"&&(S.right=`${n}px`)),i!=="left"&&i!=="right"||(a==="start"&&(S.top=`${n}px`),a==="center"&&(S.top=`${f}px`),a==="end"&&(S.bottom=`${n}px`)),S}function ZT(t,e){return(t!=="top"&&t!=="right"||e!=="end")&&(t!=="bottom"&&t!=="left"||e==="end")?"ltr":"rtl"}function w0(t){return{top:"bottom",right:"left",bottom:"top",left:"right"}[t]}function C0(t,e){return{top:t.top<e.top,right:t.right>e.right,bottom:t.bottom>e.bottom,left:t.left<e.left}}const[T0,R0]=y0("Popper"),[JT,A0]=T0("Popper"),eR=t=>{const{__scopePopper:e,children:n}=t,[i,a]=se.useState(null);return se.createElement(JT,{scope:e,anchor:i,onAnchorChange:a},n)},tR=se.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...a}=t,u=A0("PopperAnchor",n),f=se.useRef(null),p=Xf(e,f);return se.useEffect(()=>{u.onAnchorChange((i==null?void 0:i.current)||f.current)}),i?null:se.createElement(Dl.div,di({},a,{ref:p}))}),[nR,iR]=T0("PopperContent"),rR=se.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a,align:u="center",alignOffset:f,collisionTolerance:p,avoidCollisions:g=!0,...S}=t,m=A0("PopperContent",n),[x,T]=se.useState(),_=g0(m.anchor),[M,k]=se.useState(null),L=v0(M),[P,O]=se.useState(null),j=v0(P),q=Xf(e,be=>k(be)),ee=function(){const[be,Ee]=se.useState(void 0);return se.useEffect(()=>{let Ue;function je(){Ee({width:window.innerWidth,height:window.innerHeight})}function Xe(){window.clearTimeout(Ue),Ue=window.setTimeout(je,100)}return je(),window.addEventListener("resize",Xe),()=>window.removeEventListener("resize",Xe)},[]),be}(),H=ee?DOMRect.fromRect({...ee,x:0,y:0}):void 0,{popperStyles:Z,arrowStyles:ie,placedSide:W,placedAlign:re}=XT({anchorRect:_,popperSize:L,arrowSize:j,arrowOffset:x,side:i,sideOffset:a,align:u,alignOffset:f,shouldAvoidCollisions:g,collisionBoundariesRect:H,collisionTolerance:p}),ge=W!==void 0;return se.createElement("div",{style:Z,"data-radix-popper-content-wrapper":""},se.createElement(nR,{scope:n,arrowStyles:ie,onArrowChange:O,onArrowOffsetChange:T},se.createElement(Dl.div,di({"data-side":W,"data-align":re},S,{style:{...S.style,animation:ge?void 0:"none"},ref:q}))))}),sR=se.forwardRef(function(t,e){const{__scopePopper:n,offset:i,...a}=t,u=iR("PopperArrow",n),{onArrowOffsetChange:f}=u;return se.useEffect(()=>f(i),[f,i]),se.createElement("span",{style:{...u.arrowStyles,pointerEvents:"none"}},se.createElement("span",{ref:u.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},se.createElement(YT,di({},a,{ref:e,style:{...a.style,display:"block"}}))))}),aR=eR,oR=tR,lR=rR,uR=sR,M0=t=>{const{present:e,children:n}=t,i=function(f){const[p,g]=se.useState(),S=se.useRef({}),m=se.useRef(f),x=se.useRef("none"),T=f?"mounted":"unmounted",[_,M]=function(k,L){return se.useReducer((P,O)=>{const j=L[P][O];return j??P},k)}(T,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return se.useEffect(()=>{const k=rd(S.current);x.current=_==="mounted"?k:"none"},[_]),Kf(()=>{const k=S.current,L=m.current;if(L!==f){const P=x.current,O=rd(k);f?M("MOUNT"):O==="none"||(k==null?void 0:k.display)==="none"?M("UNMOUNT"):M(L&&P!==O?"ANIMATION_OUT":"UNMOUNT"),m.current=f}},[f,M]),Kf(()=>{if(p){const k=P=>{const O=rd(S.current).includes(P.animationName);P.target===p&&O&&M("ANIMATION_END")},L=P=>{P.target===p&&(x.current=rd(S.current))};return p.addEventListener("animationstart",L),p.addEventListener("animationcancel",k),p.addEventListener("animationend",k),()=>{p.removeEventListener("animationstart",L),p.removeEventListener("animationcancel",k),p.removeEventListener("animationend",k)}}},[p,M]),{isPresent:["mounted","unmountSuspended"].includes(_),ref:se.useCallback(k=>{k&&(S.current=getComputedStyle(k)),g(k)},[])}}(e),a=typeof n=="function"?n({present:i.isPresent}):se.Children.only(n),u=Xf(i.ref,a.ref);return typeof n=="function"||i.isPresent?se.cloneElement(a,{ref:u}):null};function rd(t){return(t==null?void 0:t.animationName)||"none"}M0.displayName="Presence";function O0(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t},[t]),e.current}function qp(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>{var i;return(i=e.current)===null||i===void 0?void 0:i.call(e,...n)},[])}function cR(t){const e=qp(t);se.useEffect(()=>{const n=i=>{i.key==="Escape"&&e(i)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}function fR({prop:t,defaultProp:e,onChange:n=()=>{}}){const[i,a]=function({defaultProp:g,onChange:S}){const m=se.useState(g),[x]=m,T=se.useRef(x),_=qp(S);return se.useEffect(()=>{T.current!==x&&(_(x),T.current=x)},[x,T,_]),m}({defaultProp:e,onChange:n}),u=t!==void 0,f=u?t:i,p=qp(n);return[f,se.useCallback(g=>{if(u){const S=g,m=typeof g=="function"?S(t):g;m!==t&&p(m)}else a(g)},[u,t,a,p])]}function kl(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}const[_0,UN]=y0("Tooltip",[R0]),sd=R0(),dR=700,[jN,hR]=_0("TooltipProvider",{isOpenDelayed:!0,delayDuration:dR,onOpen:()=>{},onClose:()=>{}}),[pR,ad]=_0("Tooltip"),vR=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:a=!1,onOpenChange:u,delayDuration:f}=t,p=hR("Tooltip",e),g=sd(e),[S,m]=se.useState(null),x=VT(),T=se.useRef(0),_=f??p.delayDuration,M=se.useRef(!1),{onOpen:k,onClose:L}=p,[P=!1,O]=fR({prop:i,defaultProp:a,onChange:H=>{H&&(document.dispatchEvent(new CustomEvent("tooltip.open")),k()),u==null||u(H)}}),j=se.useMemo(()=>P?M.current?"delayed-open":"instant-open":"closed",[P]),q=se.useCallback(()=>{window.clearTimeout(T.current),M.current=!1,O(!0)},[O]),ee=se.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(()=>{M.current=!0,O(!0)},_)},[_,O]);return se.useEffect(()=>()=>window.clearTimeout(T.current),[]),se.createElement(aR,g,se.createElement(pR,{scope:e,contentId:x,open:P,stateAttribute:j,trigger:S,onTriggerChange:m,onTriggerEnter:se.useCallback(()=>{p.isOpenDelayed?ee():q()},[p.isOpenDelayed,ee,q]),onOpen:se.useCallback(q,[q]),onClose:se.useCallback(()=>{window.clearTimeout(T.current),O(!1),L()},[O,L])},n))},mR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=ad("TooltipTrigger",n),u=sd(n),f=Xf(e,a.onTriggerChange),p=se.useRef(!1),g=se.useCallback(()=>p.current=!1,[]);return se.useEffect(()=>()=>document.removeEventListener("mouseup",g),[g]),se.createElement(oR,di({asChild:!0},u),se.createElement(Dl.button,di({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},i,{ref:f,onMouseEnter:kl(t.onMouseEnter,a.onTriggerEnter),onMouseLeave:kl(t.onMouseLeave,a.onClose),onMouseDown:kl(t.onMouseDown,()=>{a.onClose(),p.current=!0,document.addEventListener("mouseup",g,{once:!0})}),onFocus:kl(t.onFocus,()=>{p.current||a.onOpen()}),onBlur:kl(t.onBlur,a.onClose),onClick:kl(t.onClick,a.onClose)})))}),gR=se.forwardRef((t,e)=>{const{forceMount:n,...i}=t,a=ad("TooltipContent",t.__scopeTooltip);return se.createElement(M0,{present:n||a.open},se.createElement(yR,di({ref:e},i)))}),yR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":a,portalled:u=!0,...f}=t,p=ad("TooltipContent",n),g=sd(n),S=u?qT:se.Fragment,{onClose:m}=p;return cR(()=>m()),se.useEffect(()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m)),[m]),se.createElement(S,null,se.createElement(bR,{__scopeTooltip:n}),se.createElement(lR,di({"data-state":p.stateAttribute},g,f,{ref:e,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),se.createElement(zy,null,i),se.createElement(WT,{id:p.contentId,role:"tooltip"},a||i)))}),SR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=sd(n);return se.createElement(uR,di({},a,i,{ref:e}))});function bR(t){const{__scopeTooltip:e}=t,n=ad("CheckTriggerMoved",e),i=g0(n.trigger),a=i==null?void 0:i.left,u=O0(a),f=i==null?void 0:i.top,p=O0(f),g=n.onClose;return se.useEffect(()=>{(u!==void 0&&u!==a||p!==void 0&&p!==f)&&g()},[g,u,p,a,f]),null}const ER=vR,xR=mR,wR=gR,CR=SR;function TR(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Ts(t,e){if(t==null)return{};var n=TR(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}let wi;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(wi||(wi={}));const RR={[wi.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[wi.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[wi.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[wi.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[wi.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[wi.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[wi.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[wi.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[wi.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function L0(t,e,...n){const[i,...a]=RR[e](...n);console[t]("LEVA: "+i,...a)}const P0=L0.bind(null,"warn");L0.bind(null,"log");function FN(t){return t}function AR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function to(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D0(Object(n),!0).forEach(function(i){AR(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const aa=(t,e,n)=>t>n?n:t<e?e:t,MR=t=>{if(t===""||typeof t=="number")return t;try{const e=oa(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},OR=Math.log(10);function k0(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/OR)+1,i=Math.floor(Math.log10(Math.abs(t))),a=Math.pow(10,i-n);return Math.max(a,.001)}const _R=(t,e,n)=>n===e?0:(aa(t,e,n)-e)/(n-e),I0=(t,e,n)=>t*(n-e)+e,N0=/\(([0-9+\-*/^ .]+)\)/,z0=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,U0=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,j0=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,F0=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,B0=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function oa(t){if(isNaN(Number(t)))if(N0.test(t)){const e=t.replace(N0,(n,i)=>String(oa(i)));return oa(e)}else if(z0.test(t)){const e=t.replace(z0,(n,i,a)=>String(Math.pow(Number(i),Number(a))));return oa(e)}else if(U0.test(t)){const e=t.replace(U0,(n,i,a)=>String(Number(i)*Number(a)));return oa(e)}else if(j0.test(t)){const e=t.replace(j0,(n,i,a)=>{if(a!=0)return String(Number(i)/Number(a));throw new Error("Division by zero")});return oa(e)}else if(F0.test(t)){const e=t.replace(F0,(n,i,a)=>String(Number(i)+Number(a)));return oa(e)}else if(B0.test(t)){const e=t.replace(B0,(n,i,a)=>String(Number(i)-Number(a)));return oa(e)}else return Number(t);return Number(t)}let H0;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(H0||(H0={}));let V0;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(V0||(V0={}));const LR=t=>t.shiftKey?5:t.altKey?1/5:1,PR=["value"],DR=["min","max"],kR=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},IR=(t,{min:e=-1/0,max:n=1/0,suffix:i})=>{const a=parseFloat(t);if(t===""||isNaN(a))throw Error("Invalid number");const u=aa(a,e,n);return i?u+i:u},NR=(t,{pad:e=0,suffix:n})=>{const i=parseFloat(t).toFixed(e);return n?i+n:i},zR=t=>{let{value:e}=t,n=Ts(t,PR);const{min:i=-1/0,max:a=1/0}=n,u=Ts(n,DR);let f=parseFloat(e);const p=typeof e=="string"?e.substring((""+f).length):void 0;f=aa(f,i,a);let g=n.step;g||(Number.isFinite(i)?Number.isFinite(a)?g=+(Math.abs(a-i)/100).toPrecision(1):g=+(Math.abs(f-i)/100).toPrecision(1):Number.isFinite(a)&&(g=+(Math.abs(a-f)/100).toPrecision(1)));const S=g?k0(g)*10:k0(f);g=g||S/10;const m=Math.round(aa(Math.log10(1/S),0,2));return{value:p?f+p:f,settings:to({initialValue:f,step:g,pad:m,min:i,max:a,suffix:p},u)}},$0=(t,{step:e,initialValue:n})=>{const i=Math.round((t-n)/e);return n+i*e};var UR=Object.freeze({__proto__:null,schema:kR,sanitize:IR,format:NR,normalize:zR,sanitizeStep:$0});function er(){return er=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},er.apply(this,arguments)}const jR=R.createContext({});function Rs(){return R.useContext(jR)}const FR=R.createContext(null);R.createContext(null);const BR=R.createContext(null);function HR(){return R.useContext(BR)}const VR=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function od(t,e){const[n,i]=t.split(" "),a={};return n!=="none"&&(a.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),i&&(a.backgroundColor=i),a}const oc={$inputStyle:()=>t=>od(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>od(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>od(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>od(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:Ut,css:BN,createTheme:HN,globalCss:$R,keyframes:VN}=YC({prefix:"leva",theme:VR(),utils:to(to({},oc),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":oc.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":oc.$focusStyle()(t)}),$hover:t=>({"&:hover":oc.$hoverStyle()(t)}),$active:t=>({"&:active":oc.$activeStyle()(t)})})});$R({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function WR(t,e){const{theme:n}=R.useContext(FR);if(!(t in n)||!(e in n[t]))return P0(wi.THEME_ERROR,t,e),"";let i=e;for(;;){let a=n[t][i];if(typeof a=="string"&&a.charAt(0)==="$")i=a.substr(1);else return a}}const W0=Ut("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),q0=Ut("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${W0}`]:{paddingLeft:0}}),qR=Ut(q0,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),YR=Ut("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),QR=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],GR=["onUpdate"];function Y0(t){let{innerLabel:e,value:n,onUpdate:i,onChange:a,onKeyDown:u,type:f,id:p,inputType:g="text",rows:S=0}=t,m=Ts(t,QR);const{id:x,emitOnEditStart:T,emitOnEditEnd:_,disabled:M}=Rs(),k=p||x,L=R.useRef(null),P=S>0,O=P?"textarea":"input",j=R.useCallback(H=>Z=>{const ie=Z.currentTarget.value;H(ie)},[]);R.useEffect(()=>{const H=L.current,Z=j(ie=>{i(ie),_()});return H==null||H.addEventListener("blur",Z),()=>H==null?void 0:H.removeEventListener("blur",Z)},[j,i,_]);const q=R.useCallback(H=>{H.key==="Enter"&&j(i)(H)},[j,i]),ee=Object.assign({as:O},P?{rows:S}:{},m);return R.createElement(YR,{textArea:P},e&&typeof e=="string"?R.createElement(q0,null,e):e,R.createElement(W0,er({levaType:f,ref:L,id:k,type:g,autoComplete:"off",spellCheck:"false",value:n,onChange:j(a),onFocus:()=>T(),onKeyPress:q,onKeyDown:u,disabled:M},ee)))}function XR(t){let{onUpdate:e}=t,n=Ts(t,GR);const i=R.useCallback(u=>e(MR(u)),[e]),a=R.useCallback(u=>{const f=u.key==="ArrowUp"?1:u.key==="ArrowDown"?-1:0;if(f){u.preventDefault();const p=u.altKey?.1:u.shiftKey?10:1;e(g=>parseFloat(g)+f*p)}},[e]);return R.createElement(Y0,er({},n,{onUpdate:i,onKeyDown:a,type:"number"}))}const Yp=Ut("div",{}),Q0=Ut("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]});Ut("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & > svg`]:{opacity:1}});const KR=Ut("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${Yp}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),G0=Ut("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${KR} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),ZR=Ut(G0,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),JR=Ut("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),eA=Ut("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Qp=Ut("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}});Ut("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Qp}`]:{pointerEvents:"auto"}}}}}),Ut("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"});const tA=Ut("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),nA=Ut(CR,{fill:"$toolTipBackground"}),iA=["align"];function rA(){const{id:t,disable:e,disabled:n}=Rs();return R.createElement(R.Fragment,null,R.createElement(eA,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),R.createElement("label",{htmlFor:t+"__disable"}))}function sA(t){const{id:e,optional:n,hint:i}=Rs(),a=t.htmlFor||(e?{htmlFor:e}:null),u=!i&&typeof t.children=="string"?{title:t.children}:null;return R.createElement(R.Fragment,null,n&&R.createElement(rA,null),i!==void 0?R.createElement(ER,null,R.createElement(xR,{asChild:!0},R.createElement(Qp,er({},a,t))),R.createElement(wR,{side:"top",sideOffset:2},R.createElement(tA,null,i,R.createElement(nA,null)))):R.createElement(Qp,er({},a,u,t)))}function ld(t){let{align:e}=t,n=Ts(t,iA);const{value:i,label:a,key:u,disabled:f}=Rs(),{hideCopyButton:p}=HR(),g=!p&&u!==void 0,[S,m]=R.useState(!1),x=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[u]:i??""})),m(!0)}catch{P0(wi.CLIPBOARD_ERROR,{[u]:i})}};return R.createElement(JR,{align:e,onPointerLeave:()=>m(!1)},R.createElement(sA,n),g&&!f&&R.createElement("div",{title:`Click to copy ${typeof a=="string"?a:u} value`},S?R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},R.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),R.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):R.createElement("svg",{onClick:x,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},R.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),R.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const aA=["toggled"],oA=Ut("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function lA(t){let{toggled:e}=t,n=Ts(t,aA);return R.createElement(oA,er({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),R.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const uA=["input"];function ud(t){let{input:e}=t,n=Ts(t,uA);return e?R.createElement(ZR,n):R.createElement(G0,n)}function X0(t,e){const{emitOnEditStart:n,emitOnEditEnd:i}=Rs();return FT(a=>{a.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const u=t(a);return a.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),u},e)}const cA=Ut("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),fA=Ut("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),dA=Ut("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),hA=Ut("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),pA=Ut("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function vA({value:t,min:e,max:n,onDrag:i,step:a,initialValue:u}){const f=R.useRef(null),p=R.useRef(null),g=R.useRef(0),S=WR("sizes","scrubberWidth"),m=X0(({event:T,first:_,xy:[M],movement:[k],memo:L})=>{if(_){const{width:O,left:j}=f.current.getBoundingClientRect();g.current=O-parseFloat(S),L=(T==null?void 0:T.target)===p.current?t:I0((M-j)/O,e,n)}const P=L+I0(k/g.current,0,n-e);return i($0(P,{step:a,initialValue:u})),L}),x=_R(t,e,n);return R.createElement(hA,er({ref:f},m()),R.createElement(fA,null,R.createElement(pA,{style:{left:0,right:`${(1-x)*100}%`}})),R.createElement(dA,{ref:p,style:{left:`calc(${x} * (100% - ${S}))`}}))}const mA=R.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:i})=>{const[a,u]=R.useState(!1),f=X0(({active:p,delta:[g],event:S,memo:m=0})=>(u(p),m+=g/2,Math.abs(m)>=1&&(e(x=>parseFloat(x)+Math.floor(m)*n*LR(S)),m=0),m));return R.createElement(qR,er({dragging:a,title:t.length>1?t:""},f()),t.slice(0,i))});function gA({label:t,id:e,displayValue:n,onUpdate:i,onChange:a,settings:u,innerLabelTrim:f=1}){const p=f>0&&R.createElement(mA,{label:t,step:u.step,onUpdate:i,innerLabelTrim:f});return R.createElement(XR,{id:e,value:String(n),onUpdate:i,onChange:a,innerLabel:p})}function yA(){const t=Rs(),{label:e,value:n,onUpdate:i,settings:a,id:u}=t,{min:f,max:p}=a,g=p!==1/0&&f!==-1/0;return R.createElement(ud,{input:!0},R.createElement(ld,null,e),R.createElement(cA,{hasRange:g},g&&R.createElement(vA,er({value:parseFloat(n),onDrag:i},a)),R.createElement(gA,er({},t,{id:u,label:"value",innerLabelTrim:g?0:1}))))}const SA=Ts(UR,["sanitizeStep"]);to({component:yA},SA);var bA=Object.freeze({__proto__:null,schema:(t,e)=>sa().schema({options:sa().passesAnyOf(sa().object(),sa().array())}).test(e),sanitize:(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},format:(t,{values:e})=>e.indexOf(t),normalize:t=>{let{value:e,options:n}=t,i,a;return Array.isArray(n)?(a=n,i=n.map(u=>String(u))):(a=Object.values(n),i=Object.keys(n)),"value"in t?a.includes(e)||(i.unshift(String(e)),a.unshift(e)):e=a[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:i,values:a}}}});const EA=Ut("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Gp=Ut("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),xA=Ut("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Gp}:focus + &`]:{$focusStyle:""},[`${Gp}:hover + &`]:{$hoverStyle:""}});function wA({displayValue:t,value:e,onUpdate:n,id:i,settings:a,disabled:u}){const{keys:f,values:p}=a,g=R.useRef();return e===p[t]&&(g.current=f[t]),R.createElement(EA,null,R.createElement(Gp,{id:i,value:t,onChange:S=>n(p[Number(S.currentTarget.value)]),disabled:u},f.map((S,m)=>R.createElement("option",{key:S,value:m},S))),R.createElement(xA,null,g.current),R.createElement(lA,{toggled:!0}))}function CA(){const{label:t,value:e,displayValue:n,onUpdate:i,id:a,disabled:u,settings:f}=Rs();return R.createElement(ud,{input:!0},R.createElement(ld,null,t),R.createElement(wA,{id:a,value:e,displayValue:n,onUpdate:i,settings:f,disabled:u}))}to({component:CA},bA);var TA=Object.freeze({__proto__:null,schema:t=>sa().string().test(t),sanitize:t=>{if(typeof t!="string")throw Error("Invalid string");return t},normalize:({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}})});const RA=["displayValue","onUpdate","onChange","editable"],AA=Ut("div",{whiteSpace:"pre-wrap"});function MA(t){let{displayValue:e,onUpdate:n,onChange:i,editable:a=!0}=t,u=Ts(t,RA);return a?R.createElement(Y0,er({value:e,onUpdate:n,onChange:i},u)):R.createElement(AA,null,e)}function OA(){const{label:t,settings:e,displayValue:n,onUpdate:i,onChange:a}=Rs();return R.createElement(ud,{input:!0},R.createElement(ld,null,t),R.createElement(MA,er({displayValue:n,onUpdate:i,onChange:a},e)))}to({component:OA},TA);var _A=Object.freeze({__proto__:null,schema:t=>sa().boolean().test(t),sanitize:t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t}});const LA=Ut("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function PA({value:t,onUpdate:e,id:n,disabled:i}){return R.createElement(LA,null,R.createElement("input",{id:n,type:"checkbox",checked:t,onChange:a=>e(a.currentTarget.checked),disabled:i}),R.createElement("label",{htmlFor:n},R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},R.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function DA(){const{label:t,value:e,onUpdate:n,disabled:i,id:a}=Rs();return R.createElement(ud,{input:!0},R.createElement(ld,null,t),R.createElement(PA,{value:e,onUpdate:n,id:a,disabled:i}))}to({component:DA},_A),Ut("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});class no extends Gr{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.format="jpg",this.tileUrl=pC(e.url),this.id=e.id||`${this.tileUrl}--${e.scaleFactor}`,this.points=e.displayPoints?e.displayPoints:ws(e.points,ra(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={x:0,y:0,width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor},e.format&&(this.format=e.format)}applyProps(e){if(e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service),e.format?this.format=e.format:this.format="jpg",e.crop){this.cropData=e.crop;const n=qe([...this.points]),i=n.length/5,a=e.crop.x||0,u=e.crop.y||0,f=e.crop.x+e.crop.width,p=e.crop.y+e.crop.height;for(let g=0;g<i;g++){const S=g*5;n[S+1]<f&&n[S+3]>a&&n[S+2]<p&&n[S+4]>u?(n[S+1]=aa(n[S+1],a,f),n[S+3]=aa(n[S+3],a,f),n[S+2]=aa(n[S+2],u,p),n[S+4]=aa(n[S+4],u,p)):n[S]=0}Qr(n,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(n):this.crop=n}}static fromTile(e,n,i,a,u,f){i.height=i.height?i.height:i.width;const p=Math.ceil(n.width/a),g=Math.ceil(n.height/a),S=Math.ceil(p/i.width),m=Math.ceil(g/i.height),x=Tt.grid(S,m),T=Tt.grid(S,m);for(let M=0;M<m;M++)for(let k=0;k<S;k++){const L=k*i.width,P=M*i.height;T.addPoints(L*a,P*a,k===S-1?n.width:(L+i.width)*a,M===m-1?n.height:(P+i.height)*a),x.addPoints(L,P,k===S-1?p:L+i.width,M===m-1?g:P+i.height)}const _=new no({url:e,scaleFactor:a,points:x.build(),displayPoints:T.build(),width:n.width,height:n.height,tileWidth:i.width,format:f});return _.applyProps({service:u}),_}getImageUrl(e){const n=this.points.slice(e*5,e*5+5),i=n[3]-n[1],a=n[4]-n[2],u=Math.ceil(i/this.display.scale);return`${this.tileUrl}/${n[1]},${n[2]},${i},${a}/${u>this.tileWidth?this.tileWidth:u},/0/default.${this.format||"jpg"}`}getAllPointsAt(e,n,i){const a=ec(this.crop||this.points,e);return[[this,a,n]]}transform(e){Qr(this.points,e)}getScheduledUpdates(e,n){return[]}}class kA extends Gr{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}class IA extends kA{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=qe(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((i,a)=>a.display.width-i.display.width),this.images=[];let n=.1;for(const i of this.allImages){if(i.display.width<this.renderOptions.minSize&&i.display.height<this.renderOptions.minSize&&!i.priority||i instanceof Ar&&(i.display.width>this.renderOptions.maxImageSize||i.display.height>this.renderOptions.maxImageSize)&&!i.priority)continue;if(Math.abs(i.display.scale-n)<.25||i.priority){const u=this.images.pop();u&&(u instanceof Ar||u.priority)?(i.priority&&this.images.push(i),this.images.push(u)):i&&this.images.push(i)}else i&&this.images.push(i);n=i.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(i=>i.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const n=await this.lazyLoader();this.addImages(n)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=Tt.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={x:0,y:0,points:Tt.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions={renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.2,...e.renderOptions||{}},this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback<"u"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers<"u"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize<"u"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize<"u"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality<"u"&&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(n=>n!==e),this.sortByScales())}insertBefore(e,n){this.addImages([e])}hideInstance(){}addImages(e){for(const n of e)n.__parent=this,n.__owner=this.__owner;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,n){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:n>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,n,i){if(this.images.length===0)return[];const a=hC(1/(i||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),u=this.images.length,f=n?xs(n,Ei(this.x,this.y)):Ei(this.x,this.y);if(a!==this.images.length-1&&this.images[a+1]){let p=[];for(let m=u-1;m>=a;m--)p.push(m);const g=p[0];this.renderOptions.renderLayers&&(p=p.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&p.indexOf(g)===-1&&p.unshift(g);const S=[];for(let m=0;m<p.length;m++)S.push(...this.images[p[m]].getAllPointsAt(e,f,i));return S}return this.images[a].getAllPointsAt(e,f,i)}}function cd(t,e,n,i,a){const u=Math.PI/180*a,f=Math.cos(u),p=Math.sin(u),g=f*(n-t)+p*(i-e)+t,S=f*(i-e)-p*(n-t)+e;return[g,S]}class lc extends Gr{constructor(e,n){super(),this.type="world-object",this.intersectionBuffer=qe(5),this.aggregateBuffer=qe(9),this.invertedBuffer=qe(9),this.rotation=0,this._updatedList=[];const{x:i=0,y:a=0}=n||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=qe([1,i,a,i+e.width,a+e.height]),this.worldPoints=qe([1,i,a,i+e.width,a+e.height]),this.filteredPointsBuffer=qe(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=qe(5),this.worldPoints=qe(5),this.filteredPointsBuffer=qe(5))}static createWithProps(e){const n=new lc;return n.applyProps(e),n}applyProps(e){const n=e.x||0,i=e.y||0;this.id=e.id;const a=typeof e.scale<"u"?e.scale:this.scale;this.points[0]=1,this.points[1]=n,this.points[2]=i,this.points[3]=n+e.width,this.points[4]=i+e.height,this.rotation=e.rotation||0,this.worldPoints[3]=this.worldPoints[1]+e.width,this.worldPoints[4]=this.worldPoints[2]+e.height,e.scale&&e.scale!==1&&this.atScale(a),this.scale=a}appendChild(e){e.points[0]===0&&e.points.set(this.points),e.__owner.value=this,this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(n=>n!==e),this.filteredPointsBuffer=qe(this.layers.length*5)}insertBefore(e,n){const i=this.layers.indexOf(n);if(i===-1||this.layers.indexOf(e)!==-1)return;const a=this.layers.slice(0,i),u=this.layers.slice(i);this.layers=[...a,e,...u]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,n){if(this.rotation&&(e=this.applyRotation(e)),ec(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const a=this.layers.length,u=[];for(let f=0;f<a;f++){const p=this.layers[f];if(n&&p.isShape){const S=ws(p.points,Ei(this.x,this.y));if(!p.intersects([e[1]-S[1],e[2]-S[2]]))continue}if(ec(ws(p.points,Ei(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&u.push(p),n){const S=p;u.push(...S.getObjectsAt(e,n))}}return u}applyRotation(e){if(this.rotation){const n={x:e[1],y:e[2]},i={x:e[1],y:e[4]},a={x:e[3],y:e[2]},u={x:e[3],y:e[4]},f=this.points[1]+(this.points[3]-this.points[1])/2,p=this.points[2]+(this.points[4]-this.points[2])/2,[g,S]=cd(f,p,n.x,n.y,this.rotation),[m,x]=cd(f,p,i.x,i.y,this.rotation),[T,_]=cd(f,p,a.x,a.y,this.rotation),[M,k]=cd(f,p,u.x,u.y,this.rotation),L=Math.min(g,m,T,M),P=Math.max(g,m,T,M),O=Math.min(S,x,_,k),j=Math.max(S,x,_,k);return qe([e[0],L,O,P,j])}return e}getAllPointsAt(e,n,i){const a=xs(Ei(this.x,this.y),ra(this.scale),this.aggregateBuffer);this.rotation&&(e=this.applyRotation(e));const u=fC(e,this.points,this.intersectionBuffer),f=this.layers.length,p=[],g=ws(u,xs(ra(1/this.scale),Ei(-this.x,-this.y),this.invertedBuffer)),S=n?xs(n,a,this.aggregateBuffer):a,m=i*this.scale;for(let x=0;x<f;x++)p.push(...this.layers[x].getAllPointsAt(g,S,m));return p}addLayers(e){const n=[];for(const i of e)this.layers.indexOf(i)===-1&&(n.push(i),i.points.length===5&&(i.points[1]<this.worldPoints[1]/this.scale||i.points[2]<this.worldPoints[2]/this.scale||i.points[3]>this.worldPoints[3]/this.scale||i.points[4]>this.worldPoints[4]/this.scale)&&(i.crop=i.crop||qe([1,Math.max(this.worldPoints[1]/this.scale,i.points[1]),Math.max(this.worldPoints[2]/this.scale,i.points[2]),Math.min(this.worldPoints[3]/this.scale,i.points[3]),Math.min(this.worldPoints[4]/this.scale,i.points[4])])));this.layers=this.layers.concat(n),this.filteredPointsBuffer=qe(this.layers.length*5)}getScheduledUpdates(e,n){const i=this.layers.length;this._updatedList=[];const a=n*this.scale;for(let u=0;u<i;u++){const f=this.layers[u].getScheduledUpdates(e,a);f&&this._updatedList.push(...f)}return this._updatedList}}class Il extends Gr{constructor(e=0,n=0,i=100,a="left-to-right"){super(),this.id="world",this.aggregateBuffer=qe(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=qe(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=n,this.aspectRatio=Number.isNaN(e/n)?1:e/n,this.viewingDirection=a,this.points=qe(i*5),this.filteredPointsBuffer=qe(i*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const n=new Il;return n.applyProps(e),n}applyProps(e){typeof e.width<"u"&&typeof e.height<"u"&&(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,n,i){const a=[];for(const u of i)if(u.x&&u.y){const f=Tt.singleBox(1,1,u.x,u.y);a.push(this.getObjectsAt(f,!0).reverse())}return a.map(u=>this.propagateEvent(e,n,u,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,n,i,a,u={}){const f=Tt.singleBox(1,1,i,a),p=this.getObjectsAt(f,!0).reverse();return this.propagateEvent(e,n,p,u)}propagateEvent(e,n,i,{bubbles:a=!1,cancelable:u=!1}={}){n.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let f=!1;n.stopPropagation=()=>{f=!0};const p=i.length;for(let m=p-1;m>=0;m--){this._propagateEventTargets.unshift(i[m][0]);const x=i[m][1].length;if(x)for(let T=0;T<x;T++)this._propagateEventTargets.unshift(i[m][1][T])}const g=this._propagateEventTargets.length;let S=!1;for(let m=0;m<g&&(n.atlasTarget=this._propagateEventTargets[m],n.atlasWorld=this,S=this._propagateEventTargets[m].dispatchEvent(e,n)||S,!f);m++);return S&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const n=this.appendWorldObject(e);this.renderOrder.push(n/5)}removeChild(e){const n=this.objects.indexOf(e);if(n===-1){for(const i of this.objects)if(i&&i.id===e.id){this.removeChild(i);return}return}this.objects[n]=null,this.renderOrder=this.renderOrder.filter(i=>i!==n),this.points[n*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,n){const i=this.objects.indexOf(n);if(i===-1)return;const a=this.appendWorldObject(e);this.renderOrder.splice(i-1,0,a/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const n=this.zones.length;for(let i=0;i<n;i++)if(this.zones[i].id===e){this.selectedZone=i,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<"u"}checkResizeInternalBuffer(){if(dC(this.points)===this.objects.length){const e=this.points,n=qe(this.points.length*2);n.set(e,0),this.points=n}}appendWorldObject(e){this.checkResizeInternalBuffer();const n=this.objects.length*5,i=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=i[1],e.points[2]=i[2],e.points[3]=i[3],e.points[4]=i[4],this.objects.push(e),this.filteredPointsBuffer=qe(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),n}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const n=new Int32Array(this.objects.length),i=new Int32Array(this.objects.length),a=this.renderOrder.length;for(let p=0;p<a;p++){const g=this.renderOrder[p];this.objects[g]&&(n[p]=this.points[g*5+3],i[p]=this.points[g*5+4])}const u=Math.max(...n);u!==this._width&&(this._width=u,e=!0);const f=Math.max(...i);f!==this._height&&(this._height=f,e=!0),e&&this.trigger("recalculate-world-size",{width:u,height:f}),this.needsRecalculate=!1}return e}addObjectAt(e,n){n.width&&!n.height?n.height=n.width/e.width*e.height:n.height&&!n.width&&(n.width=n.height/e.height*e.width),(!n||!n.width||!n.height)&&(n.width=e.width,n.height=e.height);const{width:i,x:a,y:u}=n,f=i/e.width;this.checkResizeInternalBuffer(),this.points.set(Tt.singleBox(e.width,e.height,0,0),this.objects.length*5);const p=new lc(e);return p.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(p),this.scaleWorldObject(this.objects.length-1,f),this.translateWorldObject(this.objects.length-1,a,u),this.filteredPointsBuffer=qe(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,p}scaleWorldObject(e,n){Qr(this.points.subarray(e*5,e*5+5),tc(n,this.points[e*5+1],this.points[e*5+2]));const i=this.objects[e];i&&(i.atScale(n),this.triggerRepaint())}translateWorldObject(e,n,i){Qr(this.points.subarray(e*5,e*5+5),Ei(n,i));const a=this.objects[e];a&&(a.translate(n,i),this.triggerRepaint())}resize(e,n){return this._width=e,this._height=n,this.aspectRatio=e/n,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,n){const i=Tt.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(i,n,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,n){const i=ec(this.points,e,this.filteredPointsBuffer),a=this.objects.length;this._updatedList=[];for(let u=0;u<a;u++)if(i[u*5]!==0){if(!this.objects[u])continue;this._updatedList.push(...this.objects[u].getScheduledUpdates(e,n))}return this._updatedList}getObjectsAt(e,n=!1){const i=this.getActiveZone(),a=ec(this.points,e,this.filteredPointsBuffer),u=this.renderOrder.length,f=[];for(let p=0;p<u;p++){const g=this.renderOrder[p];if(a[g*5]!==0){const S=this.objects[g];if(!S||i&&i.objects.indexOf(S)===-1)continue;if(S.type!=="world-object"){f.push([S,[S]]);continue}n?f.push([S,S.getObjectsAt(e,n)]):f.push([S,this.emptyPaintables])}}return f}getPointsAt(e,n,i=1){const a=this.getObjectsAt(e),u=xs(ra(i),Ei(-e[1],-e[2]),this.translationBuffer),f=n?xs(n,u,this.aggregateBuffer):u,p=a.length,g=[];for(let S=0;S<p;S++)a[S]&&g.push(...a[S][0].getAllPointsAt(e,f,i));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let n=0;n<e;n++){if(this._alreadyFlushed.indexOf(this.triggerQueue[n][0])!==-1)continue;typeof this.triggerQueue[n][1]>"u"&&this._alreadyFlushed.push(this.triggerQueue[n][0]);const i=this.subscriptions.length;for(let a=0;a<i;a++)this.subscriptions[a].apply(null,this.triggerQueue[n])}this.triggerQueue=[]}}trigger(e,n){this.triggerQueue.push([e,n])}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,n,i){this.trigger("zoom-to",{point:n,factor:e,stream:i})}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 fd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,dd={},NA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class uc extends Gr{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(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=Qf(12),this.points=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=dd[i]||fd.exec(i)||fd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=dd[i]=a)}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 a=dd[e.style.outline]||fd.exec(e.style.outline)||fd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=dd[e.style.outline]=a)}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,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of NA)if(this.props.style[a]!==e.style[a]){n=!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)),n=!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)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!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)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!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])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.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),n&&this.__revision++}}class hd extends Gr{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={x:0,y:0,scale:1,width:100,height:100,points:qe(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=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps({id:e,target:n,text:i,color:a,backgroundColor:u,fontSize:f=18,interactive:p,fontFamily:g="Arial, sans-serif",...S}){S.font=`${f}px ${g}`,this.interactive=p||!1,typeof i<"u"&&(this.text=i||""),a&&(this.color=a),u&&(this.backgroundColor=u),e&&(this.id=e),n&&(this.points=Tt.singleBox(n.width,n.height,n.x,n.y),this.display.points=this.points,this.display.width=n.width,this.display.height=n.height),this.props={...this.props,...S},this.__revision++}}const mn=Math.pow,pd=Math.sqrt,cc=Math.sin,K0=Math.cos,fc=Math.PI,vd=1.70158,md=vd*1.525,Z0=vd+1,J0=2*fc/3,e1=2*fc/4.5,gd=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},la={linear:t=>t,easeInQuad:function(t){return t*t},easeOutQuad:function(t){return 1-(1-t)*(1-t)},easeInOutQuad:function(t){return t<.5?2*t*t:1-mn(-2*t+2,2)/2},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1-mn(1-t,3)},easeInOutCubic:function(t){return t<.5?4*t*t*t:1-mn(-2*t+2,3)/2},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1-mn(1-t,4)},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-mn(-2*t+2,4)/2},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1-mn(1-t,5)},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1-mn(-2*t+2,5)/2},easeInSine:function(t){return 1-K0(t*fc/2)},easeOutSine:function(t){return cc(t*fc/2)},easeInOutSine:function(t){return-(K0(fc*t)-1)/2},easeInExpo:function(t){return t===0?0:mn(2,10*t-10)},easeOutExpo:function(t){return t===1?1:1-mn(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?mn(2,20*t-10)/2:(2-mn(2,-20*t+10))/2},easeInCirc:function(t){return 1-pd(1-mn(t,2))},easeOutCirc:function(t){return pd(1-mn(t-1,2))},easeInOutCirc:function(t){return t<.5?(1-pd(1-mn(2*t,2)))/2:(pd(1-mn(-2*t+2,2))+1)/2},easeInBack:function(t){return Z0*t*t*t-vd*t*t},easeOutBack:function(t){return 1+Z0*mn(t-1,3)+vd*mn(t-1,2)},easeInOutBack:function(t){return t<.5?mn(2*t,2)*((md+1)*2*t-md)/2:(mn(2*t-2,2)*((md+1)*(t*2-2)+md)+2)/2},easeInElastic:function(t){return t===0?0:t===1?1:-mn(2,10*t-10)*cc((t*10-10.75)*J0)},easeOutElastic:function(t){return t===0?0:t===1?1:mn(2,-10*t)*cc((t*10-.75)*J0)+1},easeInOutElastic:function(t){return t===0?0:t===1?1:t<.5?-(mn(2,20*t-10)*cc((20*t-11.125)*e1))/2:mn(2,-20*t+10)*cc((20*t-11.125)*e1)/2+1},easeInBounce:function(t){return 1-gd(1-t)},easeOutBounce:gd,easeInOutBounce:function(t){return t<.5?(1-gd(1-2*t))/2:(1+gd(2*t-1))/2}};class zA{constructor(e){this.runtime=e,this.pendingTransition={from:qe(5),to:qe(5),elapsed_time:0,done:!0,total_time:0,timingFunction:la.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=qe(this.runtime.target),this.pendingTransition.to=qe(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,n){if(!this.pendingTransition.done){const i=this.pendingTransition,a=i.total_time===0?0:(i.elapsed_time+n)/i.total_time,u=i.total_time===0?1:a===0?0:i.timingFunction(a);e[1]=i.from[1]+(i.to[1]-i.from[1])*u,e[2]=i.from[2]+(i.to[2]-i.from[2])*u,e[3]=i.from[3]+(i.to[3]-i.from[3])*u,e[4]=i.from[4]+(i.to[4]-i.from[4])*u,this.pendingTransition.elapsed_time+=n,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:la.easeOutExpo}}))}}zoomTo(e,{origin:n,stream:i=!1,transition:a}={}){const u=this.runtime.getZoomedPosition(e,{origin:n}),f=Math.abs(1-e);this.applyTransition(u,a,{duration:2e3*f,easing:la.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:n=0}={}){const[i,a]=this.runtime.constrainBounds(this.runtime.target,{panPadding:n});i&&(this.applyTransition(a,e,{duration:500,easing:la.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,n,i,{stream:a}={}){this.pendingTransition.from=qe(this.runtime.target),this.pendingTransition.to=e,a||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(n==null?void 0:n.duration)<"u"?n.duration:typeof(i==null?void 0:i.duration)<"u"?i.duration:1e3,this.pendingTransition.constrain=typeof(n==null?void 0:n.constrain)<"u"?n.constrain:typeof(i==null?void 0:i.constrain)<"u"?i.constrain:!1,this.pendingTransition.timingFunction=(n==null?void 0:n.easing)||(i==null?void 0:i.easing)||la.easeInOutSine}goToRegion(e,{transition:n}={}){const i=this.runtime.clampRegion(e);this.applyTransition(Tt.singleBox(i.width,i.height,i.x,i.y),n,{duration:1e3,easing:la.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class yd{constructor(e,n,i,a=[],u){this.id=Qf(),this.ready=!1,this.transformBuffer=qe(500),this.lastTarget=qe(5),this.zoomBuffer=qe(5),this.logNextRender=!1,this.pendingUpdate=!0,this.isCommitting=!1,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=f=>{const p=typeof f.x>"u"?this.target[1]:f.x,g=typeof f.y>"u"?this.target[2]:f.y;f.width?this.target[3]=p+f.width:this.target[3]=this.target[3]-this.target[1]+p,f.height?this.target[4]=g+f.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-p)>.01&&(this.target[1]=p),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=f=>{const p=f-this.lastTime;if(this.isCommitting||this.fpsLimit&&p<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=f,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",p);const g=this.pendingUpdate,S=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,p),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!S&&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",p),this.renderer.beforeFrame(this.world,p,this.target);const m=this.getScaleFactor(),x=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),T=x.length;for(let k=0;k<T;k++){const L=x[k][0],P=x[k][1],O=x[k][2],j=O?ws(P,O,this.transformBuffer):P;this.renderer.prepareLayer(L,L.__parent&&O?ws(L.__parent.crop||L.__parent.points,O):j);const q=j.length/5;for(let ee=0;ee<q;ee++){const H=ee*5;j[H]!==0&&(this.renderer.paint(L,ee,j[H+1],j[H+2],j[H+3]-j[H+1],j[H+4]-j[H+2]),this.hook("useAfterPaint",L))}this.renderer.finishLayer(L,P)}this.renderer.afterFrame(this.world,p,this.target),this.hook("useAfterFrame",p),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 _=this.world.getScheduledUpdates(this.target,m),M=_.length;if(M>0)for(let k=0;k<M;k++){const L=_[M-k-1]();L?L.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=n,this.options={maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5,...u||{}},this.target=Tt.projection(i),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=Tt.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new zA(this),this.aggregate=ra(1),this.world.addLayoutSubscriber(f=>{f==="repaint"&&(this.pendingUpdate=!0),f==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=a,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(Tt.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()}setOptions(e){this.options={...this.options,...e}}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const n=this.getScaleFactor(),i=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]},a=this.width*n,u=this.height*n,f=i.width/a,p=i.height/u,g=a/u;if(e.cover?f>p:f<p){const S=g*i.height,m=(S-i.width)/2;this.target[1]=-m+i.x,this.target[2]=i.y,this.target[3]=S-m+i.x,this.target[4]=i.height+i.y}else{const S=i.width/g,m=(S-i.height)/2;this.target[1]=i.x,this.target[2]=i.y-m,this.target[3]=i.x+i.width,this.target[4]=i.y+S-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,n,i,a){this.updateFocalPosition(e-n,i-a);const u=n/e,f=a/i;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])*f,this.goHome({position:this.focalPosition}),this.renderer.resize(n,a),this.pendingUpdate=!0}updateFocalPosition(e,n){if(!this.manualFocalPosition){const i=this.width,a=this.height,u=Math.min(i,a),f=0,p=0,g=this.x+f,S=this.y+p;if(i<a){const m=this.height-this.width;this.focalPosition=Tt.projection({x:g,y:S+m/2,width:u-f*2,height:u-p*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=Tt.projection({x:g+m/2,y:S,width:u-f*2,height:u-p*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:n=0,ref:i=!1}={}){const{minX:a,maxX:u,minY:f,maxY:p}=this.getBounds({target:e,padding:n});let g=!1;const S=i?e:qe(e),m=e[3]-e[1],x=e[4]-e[2];return a>e[1]&&(g=!0,S[1]=a,S[3]=a+m),f>e[2]&&(g=!0,S[2]=f,S[4]=f+x),u<e[1]&&(g=!0,S[1]=u,S[3]=u+m),p<e[2]&&(g=!0,S[2]=p,S[4]=p+x),[g,S]}getBounds(e){const n=e.target||this.target,i=e.padding,a=this.options.visibilityRatio,u=Math.abs(1-a);if(this.world.hasActiveZone()){const O=this.world.getActiveZone();if(O){const j=n[3]-n[1]<O.points[3]-O.points[1],q=n[4]-n[2]<O.points[4]-O.points[2];return{minX:j?O.points[1]-i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxX:q?O.points[2]-i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2,minY:j?O.points[3]+i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxY:q?O.points[4]+i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2}}}const f=n[3]-n[1],p=this.world.width,g=-f*u,S=p-f-g,m=n[4]-n[2],x=this.world.height,T=-m*u,_=x-m-T,M=Math.max(g,S),k=Math.min(g,S),L=Math.max(T,_),P=Math.min(T,_);return{minX:k,maxX:M,minY:P,maxY:L}}getScaleFactor(e=!1){const n=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return n===0?this._lastGoodScale:(this._lastGoodScale=n,n)}getZoomedPosition(e,{origin:n,fromPos:i}){var a;const u=i?{width:i[3]-i[1],height:i[4]-i[2]}:void 0,f=u?this.renderer.getScale(u.width,u.height):this.getScaleFactor(),p=u?u.width:this.width,g=u?u.height:this.height,S=(a=this.getRendererScreenPosition())==null?void 0:a.width,m=this.world.width,x=S?S/m:1,T=this.options.maxUnderZoom,_=Math.max(x||1,this.options.maxOverZoom),M=1/e,k=f*M;if(M<1){const O=p*f,j=g*f,q=this.world.width/O,ee=this.world.height/j;if(q>ee){const H=this.world.width*k,ie=~~(p*f)*T;H<ie&&(e=this.world.width*f/(p*f*T))}else{const H=this.world.height*k,ie=~~(g*f)*T;H<ie&&(e=this.world.height*f/(g*f*T))}}else k>_&&(e=f/_);const P=ws(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(P,{ref:!0,panPadding:100}),P}clampRegion({x:e,y:n,width:i,height:a,padding:u=0}){const f=this.width,p=this.height,g=i/f<a/p,S=e-u,m=n-u,x=i+u*2,T=a+u*2;if(g){const M=T/p*f;return{x:S-(M-x)/2,y:m,width:M,height:T}}const _=x/f*p;return{x:S,y:m-(_-T)/2,width:x,height:_}}viewerToWorld(e,n){const i=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/i,this._viewerToWorld.y=this.target[2]+n/i,this._viewerToWorld}worldToViewer(e,n,i,a){const u=Tt.singleBox(i,a,e,n);return Qr(u,xs(ra(this.getScaleFactor()),Ei(-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,n){Qr(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const n=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=n}}stop(){return typeof this.stopId<"u"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}reset(){this.renderer.reset()}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,n){const i=this.hooks[e].length;if(i!==0)for(let a=0;a<i;a++)this.hooks[e][a](n)}registerHook(e,n){return this.hooks[e].push(n),()=>{this.hooks[e]=this.hooks[e].filter(i=>i!==n)}}updateNextFrame(){this.pendingUpdate=!0}}const dc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sd=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new t1}abort(e=new Error("This operation was aborted")){this.signal.reason=e,this.signal.dispatchEvent({type:"abort",target:this.signal})}},UA=typeof AbortSignal=="function",jA=typeof Sd.AbortSignal=="function",t1=UA?AbortSignal:jA?Sd.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(i=>i!==n))}},Xp=new Set,Kp=(t,e)=>{const n=`LRU_CACHE_OPTION_${t}`;bd(n)&&Jp(n,`${t} option`,`options.${e}`,io)},Zp=(t,e)=>{const n=`LRU_CACHE_METHOD_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} method`,`cache.${e}()`,a)}},FA=(t,e)=>{const n=`LRU_CACHE_PROPERTY_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} property`,`cache.${e}`,a)}},n1=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},bd=t=>!Xp.has(t),Jp=(t,e,n,i)=>{Xp.add(t);const a=`The ${e} is deprecated. Please use ${n} instead.`;n1(a,"DeprecationWarning",t,i)},ua=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),i1=t=>ua(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ed:null:null;class Ed extends Array{constructor(e){super(e),this.fill(0)}}class BA{constructor(e){if(e===0)return[];const n=i1(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class io{constructor(e={}){const{max:n=0,ttl:i,ttlResolution:a=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:g,dispose:S,disposeAfter:m,noDisposeOnSet:x,noUpdateTTL:T,maxSize:_=0,maxEntrySize:M=0,sizeCalculation:k,fetchMethod:L,fetchContext:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:j,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:ee,ignoreFetchAbort:H}=e,{length:Z,maxAge:ie,stale:W}=e instanceof io?{}:e;if(n!==0&&!ua(n))throw new TypeError("max option must be a nonnegative integer");const re=n?i1(n):Array;if(!re)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=_,this.maxEntrySize=M||this.maxSize,this.sizeCalculation=k||Z,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new re(n),this.prev=new re(n),this.head=0,this.tail=0,this.free=new BA(n),this.initialFill=1,this.size=0,typeof S=="function"&&(this.dispose=S),typeof m=="function"?(this.disposeAfter=m,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!x,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!q,this.allowStaleOnFetchAbort=!!ee,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.maxSize!==0&&!ua(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ua(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!g||!!W,this.noDeleteOnStaleGet=!!j,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=ua(a)||a===0?a:1,this.ttlAutopurge=!!u,this.ttl=i||ie||0,this.ttl){if(!ua(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ge="LRU_CACHE_UNBOUNDED";bd(ge)&&(Xp.add(ge),n1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ge,io))}W&&Kp("stale","allowStale"),ie&&Kp("maxAge","ttl"),Z&&Kp("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Ed(this.max),this.starts=new Ed(this.max),this.setItemTTL=(i,a,u=dc.now())=>{if(this.starts[i]=a!==0?u:0,this.ttls[i]=a,a!==0&&this.ttlAutopurge){const f=setTimeout(()=>{this.isStale(i)&&this.delete(this.keyList[i])},a+1);f.unref&&f.unref()}},this.updateItemAge=i=>{this.starts[i]=this.ttls[i]!==0?dc.now():0};let e=0;const n=()=>{const i=dc.now();if(this.ttlResolution>0){e=i;const a=setTimeout(()=>e=0,this.ttlResolution);a.unref&&a.unref()}return i};this.getRemainingTTL=i=>{const a=this.keyMap.get(i);return a===void 0?0:this.ttls[a]===0||this.starts[a]===0?1/0:this.starts[a]+this.ttls[a]-(e||n())},this.isStale=i=>this.ttls[i]!==0&&this.starts[i]!==0&&(e||n())-this.starts[i]>this.ttls[i]}updateItemAge(e){}setItemTTL(e,n,i){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Ed(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,i,a)=>{if(this.isBackgroundFetch(n))return 0;if(!ua(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,e),!ua(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.addItemSize=(e,n)=>{if(this.sizes[e]=n,this.maxSize){const i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,i,a){if(i||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*rentries(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*keys(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*rkeys(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*values(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}*rvalues(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n={}){for(const i of this.indexes())if(e(this.valList[i],this.keyList[i],this))return this.get(this.keyList[i],n)}forEach(e,n=this){for(const i of this.indexes())e.call(n,this.valList[i],this.keyList[i],this)}rforEach(e,n=this){for(const i of this.rindexes())e.call(n,this.valList[i],this.keyList[i],this)}get prune(){return Zp("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const i=this.keyList[n],a=this.valList[n],u=this.isBackgroundFetch(a)?a.__staleWhileFetching:a;if(u===void 0)continue;const f={value:u};if(this.ttls){f.ttl=this.ttls[n];const p=dc.now()-this.starts[n];f.start=Math.floor(Date.now()-p)}this.sizes&&(f.size=this.sizes[n]),e.unshift([i,f])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const a=Date.now()-i.start;i.start=dc.now()-a}this.set(n,i.value,i)}}dispose(e,n,i){}set(e,n,{ttl:i=this.ttl,start:a,noDisposeOnSet:u=this.noDisposeOnSet,size:f=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL}={}){if(f=this.requireSize(e,n,f,p),this.maxEntrySize&&f>this.maxEntrySize)return this.delete(e),this;let S=this.size===0?void 0:this.keyMap.get(e);if(S===void 0)S=this.newIndex(),this.keyList[S]=e,this.valList[S]=n,this.keyMap.set(e,S),this.next[this.tail]=S,this.prev[S]=this.tail,this.tail=S,this.size++,this.addItemSize(S,f),g=!1;else{this.moveToTail(S);const m=this.valList[S];n!==m&&(this.isBackgroundFetch(m)?m.__abortController.abort(new Error("replaced")):u||(this.dispose(m,e,"set"),this.disposeAfter&&this.disposed.push([m,e,"set"])),this.removeItemSize(S),this.valList[S]=n,this.addItemSize(S,f))}if(i!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),g||this.setItemTTL(S,i,a),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const n=this.head,i=this.keyList[n],a=this.valList[n];return this.isBackgroundFetch(a)?a.__abortController.abort(new Error("evicted")):(this.dispose(a,i,"evict"),this.disposeAfter&&this.disposed.push([a,i,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(i),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const i=this.keyMap.get(e);return i!==void 0&&!this.isStale(i)?(n&&this.updateItemAge(i),!0):!1}peek(e,{allowStale:n=this.allowStale}={}){const i=this.keyMap.get(e);if(i!==void 0&&(n||!this.isStale(i))){const a=this.valList[i];return this.isBackgroundFetch(a)?a.__staleWhileFetching:a}}backgroundFetch(e,n,i,a){const u=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(u))return u;const f=new Sd;i.signal&&i.signal.addEventListener("abort",()=>f.abort(i.signal.reason));const p={signal:f.signal,options:i,context:a},g=(T,_=!1)=>{const{aborted:M}=f.signal,k=i.ignoreFetchAbort&&T!==void 0;return M&&!k&&!_?S(f.signal.reason):(this.valList[n]===x&&(T===void 0?x.__staleWhileFetching?this.valList[n]=x.__staleWhileFetching:this.delete(e):this.set(e,T,p.options)),T)},S=T=>{const{aborted:_}=f.signal,M=_&&i.allowStaleOnFetchAbort,k=M||i.allowStaleOnFetchRejection,L=k||i.noDeleteOnFetchRejection;if(this.valList[n]===x&&(!L||x.__staleWhileFetching===void 0?this.delete(e):M||(this.valList[n]=x.__staleWhileFetching)),k)return x.__staleWhileFetching;if(x.__returned===x)throw T},m=(T,_)=>{this.fetchMethod(e,u,p).then(M=>T(M),_),f.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(T(),i.allowStaleOnFetchAbort&&(T=M=>g(M,!0)))})},x=new Promise(m).then(g,S);return x.__abortController=f,x.__staleWhileFetching=u,x.__returned=null,n===void 0?(this.set(e,x,p.options),n=this.keyMap.get(e)):this.valList[n]=x,x}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:u=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:p=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:S=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,fetchContext:M=this.fetchContext,forceRefresh:k=!1,signal:L}={}){if(!this.fetchMethod)return this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a});const P={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:u,noDisposeOnSet:f,size:p,sizeCalculation:g,noUpdateTTL:S,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:T,signal:L};let O=this.keyMap.get(e);if(O===void 0){const j=this.backgroundFetch(e,O,P,M);return j.__returned=j}else{const j=this.valList[O];if(this.isBackgroundFetch(j))return n&&j.__staleWhileFetching!==void 0?j.__staleWhileFetching:j.__returned=j;if(!k&&!this.isStale(O))return this.moveToTail(O),i&&this.updateItemAge(O),j;const q=this.backgroundFetch(e,O,P,M);return n&&q.__staleWhileFetching!==void 0?q.__staleWhileFetching:q.__returned=q}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet}={}){const u=this.keyMap.get(e);if(u!==void 0){const f=this.valList[u],p=this.isBackgroundFetch(f);return this.isStale(u)?p?n?f.__staleWhileFetching:void 0:(a||this.delete(e),n?f:void 0):p?void 0:(this.moveToTail(u),i&&this.updateItemAge(u),f)}}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Zp("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){const i=this.keyMap.get(e);if(i!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(i);const a=this.valList[i];this.isBackgroundFetch(a)?a.__abortController.abort(new Error("deleted")):(this.dispose(a,e,"delete"),this.disposeAfter&&this.disposed.push([a,e,"delete"])),this.keyMap.delete(e),this.keyList[i]=null,this.valList[i]=null,i===this.tail?this.tail=this.prev[i]:i===this.head?this.head=this.next[i]:(this.next[this.prev[i]]=this.next[i],this.prev[this.next[i]]=this.prev[i]),this.size--,this.free.push(i)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const e of this.rindexes({allowStale:!0})){const n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{const i=this.keyList[e];this.dispose(n,i,"delete"),this.disposeAfter&&this.disposed.push([n,i,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Zp("reset","clear"),this.clear}get length(){return FA("length","size"),this.size}static get AbortController(){return Sd}static get AbortSignal(){return t1}}var HA=io;const xd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,wd={},VA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class r1 extends Gr{constructor(){super(),this.type="spacial-content",this.isShape=!0,this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(5)},this.boundingBox=null,this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.shape={type:"none"},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=Qf(12),this.points=qe(5),this.shape={type:"none"}}updateBoundingBox(){if(this.shape.type==="none")return;const e=this.shape.points;if(this.shape.points.length>2){const n=Math.min(...e.map(f=>f[0])),i=Math.min(...e.map(f=>f[1])),a=Math.max(0,...e.map(f=>f[0])),u=Math.max(0,...e.map(f=>f[1]));this.boundingBox={x:n,y:i,width:a-n,height:u-i};return}this.boundingBox=null}intersects(e){if(!e||this.shape.type==="none")return!1;const[n,i]=e,a=this.shape.points;let u=this.boundingBox;if(u||(this.updateBoundingBox(),u=this.boundingBox),!u||n<u.x||n>u.x+u.width||i<u.y||i>u.height+u.y)return!1;let f=!1;for(let p=0,g=a.length-1;p<a.length;g=p++)a[p][1]>i!=a[g][1]>i&&n<(a[g][0]-a[p][0])*(i-a[p][1])/(a[g][1]-a[p][1])+a[p][0]&&(f=!f);return f}getAllPointsAt(e,n){return e[3]-e[1]===1&&e[4]-e[2]===1?this.intersects([e[1],e[2]])?[[this,this.points,n]]:[]:[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.points)if(this.shape.type!=="polygon"||this.shape.points.length!==e.points.length)this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox();else{let i=!1;const a=e.points.length;for(let u=0;u<a;u++)if(e.points[u][0]!==this.shape.points[u][0]||e.points[u][1]!==this.shape.points[u][1]){i=!0;break}i&&(this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox())}if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),(e.open||e.open===!1)&&(n=!0,this.shape.open=e.open),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=wd[i]||xd.exec(i)||xd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=wd[i]=a)}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 a=wd[e.style.outline]||xd.exec(e.style.outline)||xd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=wd[e.style.outline]=a)}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,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of VA)if(this.props.style[a]!==e.style[a]){n=!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)),n=!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)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!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)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!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])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.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),n&&this.__revision++}}const s1=/(-?[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,a1={},Cd={};class $A{constructor(e,n){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=0,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.invalidated=[],this._worker=()=>{if(this.loadingQueue.length){const i=this.loadingQueue.pop();i&&(this.tasksRunning++,this.frameTasks++,this.currentTask=i.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{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:!0}),this.ctx.imageSmoothingEnabled=!0,this.options=n||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(n==null?void 0:n.dpi)||1,this.hostCache=n!=null&&n.lruCache?new HA({maxSize:1024*512*512,dispose:(i,a,u)=>{this.invalidated.push(a),i.width=0,i.height=0},sizeCalculation:(i,a)=>i.width*i.height}):{store:{},get(i){return this.store[i]},set(i,a){this.store[i]=a}}}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.clearTransform(),this.lastPaintedObject=void 0,this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((n,i)=>n.network&&n.scale===i.scale?i.distance-n.distance:n.scale<i.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall)for(let n=0;n<this.drawCalls.length;n++){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._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,n,i){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const a=this.getCanvasDims(),u=a.width/e,f=a.height/n,p=(u<f?f:u)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}beforeFrame(e,n,i){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(n);const a=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,a.width,a.height)}applyTransform(e,n,i,a,u){const f=e.__owner.value;if(f&&f.rotation){this.ctx.save();const p=n+a/2,g=i+u/2;this.ctx.translate(p,g),this.ctx.rotate(f.rotation*Math.PI/180),this.ctx.translate(-p,-g),this.lastPaintedObject=f}}clearTransform(){this.lastPaintedObject&&(this.lastPaintedObject.rotation&&this.ctx.restore(),this.lastPaintedObject=void 0)}paint(e,n,i,a,u,f){const p=this.ctx.globalAlpha;if(e instanceof Ar||e instanceof no){if(e.display.rotation){this.ctx.save();let m=i+u/2,x=a+f/2;e.crop&&(m-=e.crop[n*5+1],x-=e.crop[n*5+2]),this.ctx.translate(m,x),this.ctx.rotate(e.display.rotation*Math.PI/180),this.ctx.translate(-m,-x)}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 m=e.__host.canvas,x=this.getCanvasDims();if((m.indices.indexOf(n)===-1||this.invalidated.indexOf(m.canvases[n])!==-1)&&this.schedulePaintToCanvas(m,e,n,Gf({x:i+u/2,y:a+u/2},{x:x.width/2,y:x.height/2})),!this.firstMeaningfulPaint)return;const T=this.hostCache.get(m.canvases[n]);if(T)if(e.crop&&e.cropData){if(e.crop[n*5]){const _=[e.crop[n*5+1]/e.display.scale-e.display.points[n*5+1],e.crop[n*5+2]/e.display.scale-e.display.points[n*5+2],1+(e.crop[n*5+3]-e.crop[n*5+1])/e.display.scale,1+(e.crop[n*5+4]-e.crop[n*5+2])/e.display.scale];_[0]+=e.cropData.x/e.display.scale,_[1]+=e.cropData.y/e.display.scale;const M=e.x*this.lastKnownScale,k=e.y*this.lastKnownScale,L=[i+M,a+k,u,f];L[0]+=M,L[1]+=k,this.ctx.drawImage(T,_[0],_[1],_[2],_[3],L[0],L[1],L[2]+1,L[3]+1)}}else this.ctx.drawImage(T,0,0,e.display.points[n*5+3]-e.display.points[n*5+1],e.display.points[n*5+4]-e.display.points[n*5+2],i,a,u+Number.MIN_VALUE,f+Number.MIN_VALUE)}catch{}e.display.rotation&&this.ctx.restore()}const g=e instanceof uc&&this.options.box,S=e instanceof r1&&this.options.polygon;if((g||S)&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const m=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),x=e.props.relativeStyle?1:u/e.width;typeof m.opacity<"u"&&(this.ctx.globalAlpha=m.opacity);let T=0;typeof m.borderWidth<"u"&&(T=parseInt(m.borderWidth,10)*x);let _=0;typeof m.outlineWidth<"u"&&(_=parseInt(m.outlineWidth,10)*x);let M=0;if(typeof m.outlineOffset<"u"&&(M=parseInt(m.outlineOffset,10)*x),m.borderColor&&(this.ctx.strokeStyle=m.borderColor),m.boxShadow){const k=m.boxShadow.split(/,(?![^(]*\))/);for(const L of k){const P=a1[L]||s1.exec(L)||s1.exec(L);a1[L]=P,P&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(P[1])*this.dpi*x,this.ctx.shadowOffsetY=parseInt(P[3])*this.dpi*x,this.ctx.shadowBlur=parseInt(P[5])*this.dpi*x,this.ctx.shadowColor=P[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(i+T,a+T,u,f),this.ctx.restore())}}if(this.ctx.fillStyle=m.backgroundColor||"transparent",this.ctx.lineWidth=T,S){const k=e.shape,L=k.points||[],P=L.length;this.ctx.beginPath();for(let O=0;O<P;O++)this.ctx.lineTo(i+L[O][0]*this.lastKnownScale,a+L[O][1]*this.lastKnownScale);k.open||this.ctx.closePath(),T&&this.ctx.stroke(),k.open||this.ctx.fill()}else T&&this.ctx.strokeRect(i+T/2,a+T/2,u+T,f+T),this.ctx.fillRect(i+T,a+T,u,f);_&&(m.outlineColor&&(this.ctx.strokeStyle=m.outlineColor),this.ctx.lineWidth=_,this.ctx.strokeRect(i-_/2-M,a-_/2-M,u+T*2+_+M*2,f+T*2+_+M*2))}this.ctx.globalAlpha=p}}loadImage(e,n,i,a=!1){if(Cd[e]&&Cd[e].naturalWidth>0){n(Cd[e]);return}try{let u=!1;a||setTimeout(()=>{u||this.loadImage(e,n,i,!0)},3e3);const f=document.createElement("img");f.decoding="auto",f.onload=function(){u=!0,n(f),Cd[e]=f,f.onload=null},this.options.crossOrigin&&(f.crossOrigin="anonymous"),f.src=e,f.complete&&f.onload({}),f.width}catch(u){console.log("image error",u),i(u)}}schedulePaintToCanvas(e,n,i,a){this.imagesPending++,e.indices.push(i);const u=`${n.id}--${n.display.scale}-${i}`,f=this.invalidated.indexOf(u);f!==-1&&this.invalidated.splice(f,1),e.canvases[i]=u,n.__host.canvas.loading=!0,this.loadingQueueOrdered=!1,this.loadingQueue.push({id:u,scale:n.display.scale,network:!0,distance:a,task:()=>new Promise(p=>{if(this.visible.indexOf(n)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p();return}const g=n.getImageUrl(i);this.loadImage(g,S=>{this.loadingQueue.push({id:u,scale:n.display.scale,distance:a,task:()=>new Promise(m=>{this.imagesLoaded++,e.loaded.push(i),e.loaded.length===e.indices.length&&(e.loading=!1);const x=n.display.points.slice(i*5,i*5+5),T=document.createElement("canvas"),_=T.getContext("2d");T.width=x[3]-x[1],T.height=x[4]-x[2],this.hostCache.set(e.canvases[i],T),this.drawCalls.push(()=>{_.drawImage(S,0,0,x[3]-x[1],x[4]-x[2]),m()})})}),p()},S=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p()})})})}afterPaintLayer(e,n){}prepareLayer(e,n){e.__owner.value&&(e.cropData?(this.lastKnownScale*(1/e.display.scale),this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])):this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])),(!e.__host||!e.__host.canvas)&&(e instanceof Ar||e instanceof no)&&this.createImageHost(e)}finishLayer(){this.lastPaintedObject&&this.clearTransform()}createImageHost(e){e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:void 0,canvases:[],indices:[],loaded:[],loading:!1}}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getViewportBounds(e,n,i){const a=e.getActiveZone();if(a){const u=n[3]-n[1]<a.points[3]-a.points[1],f=n[4]-n[2]<a.points[4]-a.points[2];return{x1:u?a.points[1]-i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y1:f?a.points[2]-i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[2])/2,x2:u?a.points[3]+i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y2:f?a.points[4]+i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[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}reset(){this.loadingQueue=[],this.drawCalls=[]}}class o1{constructor(e){this.renderers=[];for(const n of e)n&&this.renderers.push(n);this.length=this.renderers.length}afterFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].afterFrame(e,n,i)}afterPaintLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].afterPaintLayer(e,n)}beforeFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].beforeFrame(e,n,i)}triggerResize(){for(let e=0;e<this.length;e++){const n=this.renderers[e];n.triggerResize&&n.triggerResize()}}getPointsAt(e,n,i,a){return this.renderers[0].getPointsAt(e,n,i,a)}getScale(e,n){return this.renderers[0].getScale(e,n)}getViewportBounds(e,n,i){return this.renderers[0].getViewportBounds(e,n,i)}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,n,i,a,u,f){for(let p=0;p<this.length;p++)this.renderers[p].paint(e,n,i,a,u,f)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].prepareLayer(e,n)}finishLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].finishLayer(e,n)}resize(e,n){for(let i=0;i<this.length;i++)this.renderers[i].resize(e,n)}reset(){for(let e=0;e<this.length;e++)this.renderers[e].reset()}}class WA{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=ra(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,n,i){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const a=this.initialWidth/e.width,u=this.initialHeight/e.height,f=this.widthRatio>this.heightRatio?a:u;if(this.target=i,this.bounds){const p=e.getPointsAt(this.bounds,this.aggregate,f);for(const[g,S]of p)if(g instanceof Ar&&g.__host.canvas){const m=S.length/5;for(let x=0;x<m;x++)g.__host.canvas.canvases[x]&&(S[x+1]*f,S[x+2]*f,(S[x+3]-S[x+1])*f,(S[x+4]-S[x+2])*f)}}e.getPoints().forEach((p,g,S)=>{if(g%5===0&&p){const m={x1:S[g+1]*f,y1:S[g+2]*f,x2:S[g+3]*f,y2:S[g+4]*f,width:(S[g+3]-S[g+1])*f,height:(S[g+4]-S[g+2])*f};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),i&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(i[1]*f,i[2]*f,(i[3]-i[1])*f,(i[4]-i[2])*f))}}getActiveZone(e){return null}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){return 1}beforeFrame(e,n){this.bounds=Tt.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,n){}paint(e,n,i,a,u,f){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,n,i){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}finishLayer(){}reset(){}}var l1=!1,ro,ev,tv,Td,Rd,u1,Ad,nv,iv,rv,c1,sv,av,f1,d1;function Ui(){if(!l1){l1=!0;var t=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(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(sv=/\b(iPhone|iP[ao]d)/.exec(t),av=/\b(iP[ao]d)/.exec(t),rv=/Android/i.exec(t),f1=/FBAN\/\w+;/i.exec(t),d1=/Mobile/i.exec(t),c1=!!/Win64/.exec(t),e){ro=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,ro&&document&&document.documentMode&&(ro=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(t);u1=i?parseFloat(i[1])+4:ro,ev=e[2]?parseFloat(e[2]):NaN,tv=e[3]?parseFloat(e[3]):NaN,Td=e[4]?parseFloat(e[4]):NaN,Td?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Rd=e&&e[1]?parseFloat(e[1]):NaN):Rd=NaN}else ro=ev=tv=Rd=Td=NaN;if(n){if(n[1]){var a=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Ad=a?parseFloat(a[1].replace("_",".")):!0}else Ad=!1;nv=!!n[2],iv=!!n[3]}else Ad=nv=iv=!1}}var ov={ie:function(){return Ui()||ro},ieCompatibilityMode:function(){return Ui()||u1>ro},ie64:function(){return ov.ie()&&c1},firefox:function(){return Ui()||ev},opera:function(){return Ui()||tv},webkit:function(){return Ui()||Td},safari:function(){return ov.webkit()},chrome:function(){return Ui()||Rd},windows:function(){return Ui()||nv},osx:function(){return Ui()||Ad},linux:function(){return Ui()||iv},iphone:function(){return Ui()||sv},mobile:function(){return Ui()||sv||av||rv||d1},nativeApp:function(){return Ui()||f1},android:function(){return Ui()||rv},ipad:function(){return Ui()||av}},qA=ov,Md=!!(typeof window<"u"&&window.document&&window.document.createElement),YA={canUseDOM:Md,canUseWorkers:typeof Worker<"u",canUseEventListeners:Md&&!!(window.addEventListener||window.attachEvent),canUseViewport:Md&&!!window.screen,isInWorker:!Md},QA=YA,h1=QA,p1;h1.canUseDOM&&(p1=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
213
+ `)+o.join(" > ")}return null},i.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return tt(o.child.stateNode);default:return o.child.stateNode}},i.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:g.ReactCurrentDispatcher,findHostInstanceByFiber:ps,findFiberByHostInstance:o.findFiberByHostInstance||vs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!l.isDisabled&&l.supportsFiber)try{kc=l.inject(o),Bi=l}catch{}o=!0}return o},i.observeVisibleRects=function(o,l,d,y){if(!We)throw Error(p(363));o=of(o,l);var E=it(o,d,y).disconnect;return{disconnect:function(){E()}}},i.registerMutableSourceForHydration=function(o,l){var d=l._getVersion;d=d(l._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[l,d]:o.mutableSourceEagerHydrationData.push(l,d)},i.runWithPriority=function(o,l){var d=Gl;try{return Gl=o,l()}finally{Gl=d}},i.shouldSuspend=function(){return!1},i.unbatchedUpdates=function(o,l){var d=Qe;Qe&=-2,Qe|=8;try{return o(l)}finally{Qe=d,Qe===0&&(nn(),Hi())}},i.updateContainer=function(o,l,d,y){var E=l.current,C=Si(),N=An(E);e:if(d){d=d._reactInternals;t:{if(Ee(d)!==d||d.tag!==1)throw Error(p(170));var B=d;do{switch(B.tag){case 3:B=B.stateNode.context;break t;case 1:if(tn(B.type)){B=B.stateNode.__reactInternalMemoizedMergedChildContext;break t}}B=B.return}while(B!==null);throw Error(p(171))}if(d.tag===1){var te=d.type;if(tn(te)){d=Jd(d,te,B);break e}}d=B}else d=vr;return l.context===null?l.context=d:l.pendingContext=d,l=yr(C,N),l.payload={element:o},y=y===void 0?null:y,y!==null&&(l.callback=y),Sr(E,l),Hr(E,N,C),N},i}}(qf)),qf.exports}process.env.NODE_ENV==="production"?Op.exports=fC():Op.exports=cC();var dC=Op.exports;const hC=nC(dC),Yf=["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 pC(){return Yf.reduce((t,e)=>(t[e]=[],t),{})}const Rl=Yf.reduce((t,e)=>(t[e.slice(2).toLowerCase()]=e,t[e]=e,t),{}),ec=(t,e,n)=>{const i=t.length,a=n||qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?t[u+1]<e[3]&&t[u+3]>e[1]&&t[u+2]<e[4]&&t[u+4]>e[2]?1:0:t[u];return a};function qe(t,e,n){return new Float32Array(t,e,n)}const vC=(t,e,n)=>{const i=t[1]<=e[3]&&t[3]>=e[1]&&t[2]<=e[4]&&t[4]>=e[2],a=n||qe(5);return i?(a[0]=1,a[1]=Math.max(t[1],e[1]),a[2]=Math.max(t[2],e[2]),a[3]=Math.min(t[3],e[3]),a[4]=Math.min(t[4],e[4]),a):(a[0]=0,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a)},mC=t=>t.length/5,xs=(t,e,n)=>{const i=n||qe(9);return i[0]=t[0]*e[0]+t[1]*e[3]+t[2]*e[6],i[1]=t[0]*e[1]+t[1]*e[4]+t[2]*e[7],i[2]=t[0]*e[2]+t[1]*e[5]+t[2]*e[8],i[3]=t[3]*e[0]+t[4]*e[3]+t[5]*e[6],i[4]=t[3]*e[1]+t[4]*e[4]+t[5]*e[7],i[5]=t[3]*e[2]+t[4]*e[5]+t[5]*e[8],i[6]=t[6]*e[0]+t[7]*e[3]+t[8]*e[6],i[7]=t[6]*e[1]+t[7]*e[4]+t[8]*e[7],i[8]=t[6]*e[2]+t[7]*e[5]+t[8]*e[8],i};class Tt{constructor(e){this.index=0,this.length=e,this.points=qe(this.length)}static grid(e=1,n=1){return new Tt(5*e*n)}static point(e,n){const i=qe(5);return i[0]=1,i[1]=e,i[2]=n,i[3]=e,i[4]=n,i}static positionPair(e){const n=qe(5);return n[0]=1,n[1]=e.x1,n[2]=e.y1,n[3]=e.x2,n[4]=e.y2,n}static projection(e){return Tt.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,n,i=0,a=0){const u=qe(5);return u[0]=1,u[1]=i,u[2]=a,u[3]=e+i,u[4]=n+a,u}row(e){return e(this)}addPoints(e,n,i,a){return this.points[this.index]=1,this.points[1+this.index]=e,this.points[2+this.index]=n,this.points[3+this.index]=i,this.points[4+this.index]=a,this.index+=5,this}addBox(e,n,i,a){return this.addPoints(e,n,e+i,n+a),this}build(){return this.points}}const Qr=(t,e)=>{const n=t.length;for(let i=0;i<n;i++)t[i]=i%5===0?e[6]*t[i+1]+e[7]*t[i+2]+e[8]*t[i]:i%5%2===1?e[0]*t[i]+e[1]*t[i+1]+e[2]:e[3]*t[i-1]+e[4]*t[i]+e[5];return t},ra=t=>{const e=qe(9);return e[0]=t,e[4]=t,e[8]=1,e},Ei=(t,e)=>{const n=qe(9);return n[0]=1,n[2]=t,n[4]=1,n[5]=e,n[8]=1,n},tc=(t,e,n)=>xs(Ei((1-t)*e,(1-t)*n),ra(t)),ws=(t,e,n)=>{const i=t.length,a=n&&n.length>=i?n.slice(0,i):qe(i);for(let u=0;u<i;u++)a[u]=u%5===0?e[6]*t[u+1]+e[7]*t[u+2]+e[8]*t[u]:u%5%2===1?e[0]*t[u]+e[1]*t[u+1]+e[2]:e[3]*t[u-1]+e[4]*t[u]+e[5];return a};let Qf=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");class Gr{constructor(){this.__revision=0,this.__owner={value:void 0},this.__state={},this.scale=1,this.layers=[],this.time=[],this.addEventListener=(e,n,i)=>{const a=Rl[e];if(!this.eventHandlers[a])throw new Error(`Unknown event ${a}`);this.eventHandlers[a].indexOf(n)===-1&&this.eventHandlers[a].push(n)},this.removeEventListener=(e,n)=>{const i=Rl[e];if(!this.eventHandlers[i]){console.warn(`Unknown event ${i}`);return}this.eventHandlers[i].indexOf(n)!==-1&&(this.eventHandlers[i]=this.eventHandlers[i].filter(a=>a!==n))},this.id=this.__id=Qf(),this.eventHandlers=pC()}get crop(){return this._crop}set crop(e){this._crop=e}getObjectsAt(e){return[]}getAllPointsAt(e,n,i){return[]}getScheduledUpdates(e,n){return[]}dispatchEvent(e,n){const i=this.eventHandlers[e],a=i?i.length:0;let u=!1;if(a)for(let f=0;f<a;f++)try{i[f](n),u=!0}catch(p){console.error(e,p)}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,n){Qr(this.points,Ei(e,n))}atScale(e){Qr(this.points,tc(e,this.x,this.y)),this.scale*=e}transform(e){Qr(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,n){}hideInstance(){}}class Ar extends Gr{constructor(e){if(super(),this.type="spacial-content",this.style={opacity:1},!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height,e.x,e.y),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:Tt.singleBox(e.width/n,e.height/n),rotation:e==null?void 0:e.rotation}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;if(this.id=e.id||e.uri,this.uri=e.uri,this.points.set(Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y)),e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.crop){this.cropData=e.crop;const a=Tt.singleBox(e.crop.width,e.crop.height,e.crop.x,e.crop.y);Qr(a,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(a):this.crop=qe(a)}e.display?(this.display.scale=i,this.display.width=e.display.width,this.display.height=e.display.height,this.display.rotation=e.display.rotation,this.display.points=Tt.singleBox(e.display.width,e.display.height)):(this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.display.points=Tt.singleBox(e.target.width/i,e.target.height/i))}getAllPointsAt(e,n,i){return[[this,this.crop||this.points,n]]}static fromSvg(e,n,i,a){return Ar.fromImage("data:image/svg+xml;base64,"+btoa(e),n,i,a)}static fromImage(e,n,i,a){const u=new Ar;return u.applyProps({uri:e,id:a,display:i,target:n}),u}getImageUrl(){return this.uri}}class kp extends Gr{constructor(e){if(super(),this.type="spacial-content",this.getTexture=()=>({source:void 0,hash:-1}),!e)this.id="",this.uri="",this.display={x:0,y:0,scale:1,width:0,height:0,points:qe(5)},this.points=qe(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=Tt.singleBox(e.width,e.height),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:n!==1?Tt.singleBox(e.width/n,e.height/n):this.points}}}applyProps(e){const n=e.display?e.display.width:e.target.width,i=e.target.width/n;this.id=e.id,this.points.set(Tt.singleBox(e.target.width,e.target.height)),this.display.scale=i,this.display.width=e.target.width/i,this.display.height=e.target.height/i,this.getTexture=e.getTexture,this.display.points=i!==1?Tt.singleBox(e.target.width/i,e.target.height/i):this.points}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}function gC(t,e,n=1){const i=e.length;if(i===0)throw new Error("No resources passed in.");let a=0;for(let u=0;u<i&&!(!e[u]||!e[u].display);u++)a=Math.abs(e[u].display.scale-t)*n<Math.abs(e[a].display.scale-t)?u:a;return a}function ky(t,e){return Math.abs(t-e)}function Gf(t,e){const n=ky(t.x,e.x),i=ky(t.y,e.y);return Math.sqrt(Math.pow(n,2)+Math.pow(i,2))}function yC(t){const e=t.length;return t.indexOf("/info.json")===e-10?t.slice(0,-10):t}function Iy(...t){return e=>t.forEach(n=>function(i,a){typeof i=="function"?i(a):i!=null&&(i.current=a)}(n,e))}function Xf(...t){return se.useCallback(Iy(...t),t)}function di(){return di=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},di.apply(this,arguments)}const Ny=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.Children.toArray(n).some(Uy)?se.createElement(se.Fragment,null,se.Children.map(n,a=>Uy(a)?se.createElement(Ip,di({},i,{ref:e}),a.props.children):a)):se.createElement(Ip,di({},i,{ref:e}),n)});Ny.displayName="Slot";const Ip=se.forwardRef((t,e)=>{const{children:n,...i}=t;return se.isValidElement(n)?se.cloneElement(n,{...SC(i,n.props),ref:Iy(e,n.ref)}):se.Children.count(n)>1?se.Children.only(null):null});Ip.displayName="SlotClone";const zy=({children:t})=>se.createElement(se.Fragment,null,t);function Uy(t){return se.isValidElement(t)&&t.type===zy}function SC(t,e){const n={...e};for(const i in e){const a=t[i],u=e[i];/^on[A-Z]/.test(i)?n[i]=(...f)=>{u==null||u(...f),a==null||a(...f)}:i==="style"?n[i]={...a,...u}:i==="className"&&(n[i]=[a,u].filter(Boolean).join(" "))}return{...t,...n}}const Kf=globalThis!=null&&globalThis.document?se.useLayoutEffect:()=>{};var Zf=function(e,n,i,a){this.name=e,this.fn=n,this.args=i,this.modifiers=a};Zf.prototype._test=function(e){var n=this.fn;try{Al(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return Al(this.modifiers.slice(),n,this)(e)}catch{return!1}},Zf.prototype._check=function(e){try{Al(this.modifiers.slice(),this.fn,this)(e)}catch{if(Al(this.modifiers.slice(),function(i){return i},this)(!1))return}if(!Al(this.modifiers.slice(),this.fn,this)(e))throw null},Zf.prototype._testAsync=function(e){var n=this;return new Promise(function(i,a){Fy(n.modifiers.slice(),n.fn,n)(e).then(function(u){u?i(e):a(null)}).catch(function(u){return a(u)})})};function jy(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function Al(t,e,n){if(t.length){var i=t.shift(),a=Al(t,e,n);return i.perform(a,n)}else return jy(e)}function Fy(t,e,n){if(t.length){var i=t.shift(),a=Fy(t,e,n);return i.performAsync(a,n)}else return function(u){return Promise.resolve(jy(e,"async")(u))}}var bC=function(e,n,i){this.name=e,this.perform=n,this.performAsync=i},Np=function(t){function e(n,i,a,u){for(var f=[],p=arguments.length-4;p-- >0;)f[p]=arguments[p+4];t.call(this,f),t.captureStackTrace&&t.captureStackTrace(this,e),this.rule=n,this.value=i,this.cause=a,this.target=u}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Xr=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};Xr.prototype._applyRule=function(e,n){var i=this;return function(){for(var a=[],u=arguments.length;u--;)a[u]=arguments[u];return i.chain.push(new Zf(n,e.apply(i,a),a,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}},Xr.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new bC(n,e.simple,e.async)),this},Xr.prototype._clone=function(){return new Xr(this.chain.slice(),this.nextRuleModifiers.slice())},Xr.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})},Xr.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(i){try{i._check(e)}catch(a){n.push(new Np(i,e,a))}}),n},Xr.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(i){throw new Np(n,e,i)}})},Xr.prototype.testAsync=function(e){var n=this;return new Promise(function(i,a){By(e,n.chain.slice(),i,a)})};function By(t,e,n,i){if(e.length){var a=e.shift();a._testAsync(t).then(function(){By(t,e,n,i)},function(u){i(new Np(a,t,u))})}else n(t)}var Hy=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function EC(t,e){return e===void 0&&(e=!1),{simple:function(n){return Hy(n,e)||t.check(n)===void 0},async:function(n){return Hy(n,e)||t.testAsync(n)}}}function sa(){return typeof Proxy<"u"?Vy(new Xr):zp(new Xr)}var nc={};sa.extend=function(t){Object.assign(nc,t)},sa.clearCustomRules=function(){nc={}};function Vy(t){return new Proxy(t,{get:function(n,i){if(i in n)return n[i];var a=Vy(t._clone());if(i in Jf)return a._applyModifier(Jf[i],i);if(i in nc)return a._applyRule(nc[i],i);if(i in Up)return a._applyRule(Up[i],i)}})}function zp(t){var e=function(a,u){return Object.keys(a).forEach(function(f){u[f]=function(){for(var p=[],g=arguments.length;g--;)p[g]=arguments[g];var S=zp(u._clone()),m=S._applyRule(a[f],f).apply(void 0,p);return m}}),u},n=e(Up,t),i=e(nc,n);return Object.keys(Jf).forEach(function(a){Object.defineProperty(i,a,{get:function(){var u=zp(i._clone());return u._applyModifier(Jf[a],a)}})}),i}var Jf={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(t){return function(e){return ed(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(ed(e).map(function(n){try{return t(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(t){return function(e){return e!==!1&&ed(e).every(t)}},async:function(t){return function(e){return Promise.all(ed(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&t(n):t(n)}},async:function(t,e){return function(n){return Promise.resolve(t(n)).then(function(i){return $y(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function $y(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function ed(t){return typeof t=="string"?t.split(""):t}var Up={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(t){return t===void 0&&(t=!0),function(e){return typeof e=="number"&&(t||isFinite(e))}},integer:function(){return function(t){var e=Number.isInteger||xC;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return Ml("string")},boolean:function(){return Ml("boolean")},undefined:function(){return Ml("undefined")},null:function(){return Ml("null")},array:function(){return Ml("array")},object:function(){return Ml("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return typeof t=="boolean"||t===t.toLowerCase()&&t.trim()!==""}},uppercase:function(){return function(t){return t===t.toUpperCase()&&t.trim()!==""}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return t.length===0}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2===0}},odd:function(){return function(t){return t%2!==0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return wC(t)},passesAnyOf:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(n){return t.some(function(i){return i.test(n)})}},optional:EC};function Ml(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function xC(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function wC(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(i){var a=t[i];try{a.check((e||{})[i])}catch(u){u.target=i,n.push(u)}}),n.length>0)throw n;return!0},async:function(e){var n=[],i=Object.keys(t).map(function(a){var u=t[a];return u.testAsync((e||{})[a]).catch(function(f){f.target=a,n.push(f)})});return Promise.all(i).then(function(){if(n.length>0)throw n;return!0})}}}var Vt="colors",xi="sizes",Ne="space",CC={gap:Ne,gridGap:Ne,columnGap:Ne,gridColumnGap:Ne,rowGap:Ne,gridRowGap:Ne,inset:Ne,insetBlock:Ne,insetBlockEnd:Ne,insetBlockStart:Ne,insetInline:Ne,insetInlineEnd:Ne,insetInlineStart:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockEnd:Ne,marginBlockStart:Ne,marginInline:Ne,marginInlineEnd:Ne,marginInlineStart:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockEnd:Ne,paddingBlockStart:Ne,paddingInline:Ne,paddingInlineEnd:Ne,paddingInlineStart:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,scrollMargin:Ne,scrollMarginTop:Ne,scrollMarginRight:Ne,scrollMarginBottom:Ne,scrollMarginLeft:Ne,scrollMarginX:Ne,scrollMarginY:Ne,scrollMarginBlock:Ne,scrollMarginBlockEnd:Ne,scrollMarginBlockStart:Ne,scrollMarginInline:Ne,scrollMarginInlineEnd:Ne,scrollMarginInlineStart:Ne,scrollPadding:Ne,scrollPaddingTop:Ne,scrollPaddingRight:Ne,scrollPaddingBottom:Ne,scrollPaddingLeft:Ne,scrollPaddingX:Ne,scrollPaddingY:Ne,scrollPaddingBlock:Ne,scrollPaddingBlockEnd:Ne,scrollPaddingBlockStart:Ne,scrollPaddingInline:Ne,scrollPaddingInlineEnd:Ne,scrollPaddingInlineStart:Ne,fontSize:"fontSizes",background:Vt,backgroundColor:Vt,backgroundImage:Vt,borderImage:Vt,border:Vt,borderBlock:Vt,borderBlockEnd:Vt,borderBlockStart:Vt,borderBottom:Vt,borderBottomColor:Vt,borderColor:Vt,borderInline:Vt,borderInlineEnd:Vt,borderInlineStart:Vt,borderLeft:Vt,borderLeftColor:Vt,borderRight:Vt,borderRightColor:Vt,borderTop:Vt,borderTopColor:Vt,caretColor:Vt,color:Vt,columnRuleColor:Vt,fill:Vt,outline:Vt,outlineColor:Vt,stroke:Vt,textDecorationColor:Vt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:xi,minBlockSize:xi,maxBlockSize:xi,inlineSize:xi,minInlineSize:xi,maxInlineSize:xi,width:xi,minWidth:xi,maxWidth:xi,height:xi,minHeight:xi,maxHeight:xi,flexBasis:xi,gridTemplateColumns:xi,gridTemplateRows:xi,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},TC=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,Ol=()=>{const t=Object.create(null);return(e,n,...i)=>{const a=(u=>JSON.stringify(u,TC))(e);return a in t?t[a]:t[a]=n(e,...i)}},Za=Symbol.for("sxs.internal"),jp=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),Wy=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:RC}=Object.prototype,Fp=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),AC=/\s+(?![^()]*\))/,_l=t=>e=>t(...typeof e=="string"?String(e).split(AC):[e]),qy={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:_l((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:_l((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:_l((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:_l((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:_l((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:_l((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},Bp=/([\d.]+)([^]*)/,MC=(t,e)=>t.length?t.reduce((n,i)=>(n.push(...e.map(a=>a.includes("&")?a.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(a)?`:is(${i})`:i):i+" "+a)),n),[]):e,OC=(t,e)=>t in _C&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,a,u)=>i+(a==="stretch"?`-moz-available${u};${Fp(t)}:${i}-webkit-fill-available`:`-moz-fit-content${u};${Fp(t)}:${i}fit-content`)+u):String(e),_C={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Cs=t=>t?t+"-":"",Yy=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,a,u,f,p)=>f=="$"==!!u?i:(a||f=="--"?"calc(":"")+"var(--"+(f==="$"?Cs(e)+(p.includes("$")?"":Cs(n))+p.replace(/\$/g,"-"):p)+")"+(a||f=="--"?"*"+(a||"")+(u||"1")+")":"")),LC=/\s*,\s*(?![^()]*\))/,PC=Object.prototype.toString,Ll=(t,e,n,i,a)=>{let u,f,p;const g=(S,m,x)=>{let R,_;const M=k=>{for(R in k){const O=R.charCodeAt(0)===64,j=O&&Array.isArray(k[R])?k[R]:[k[R]];for(_ of j){const q=/[A-Z]/.test(P=R)?P:P.replace(/-[^]/g,H=>H[1].toUpperCase()),ee=typeof _=="object"&&_&&_.toString===PC&&(!i.utils[q]||!m.length);if(q in i.utils&&!ee){const H=i.utils[q];if(H!==f){f=H,M(H(_)),f=null;continue}}else if(q in qy){const H=qy[q];if(H!==p){p=H,M(H(_)),p=null;continue}}if(O&&(L=R.slice(1)in i.media?"@media "+i.media[R.slice(1)]:R,R=L.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(H,Z,ie,W,re,ge)=>{const be=Bp.test(Z),Ee=.0625*(be?-1:1),[Ue,je]=be?[W,Z]:[Z,W];return"("+(ie[0]==="="?"":ie[0]===">"===be?"max-":"min-")+Ue+":"+(ie[0]!=="="&&ie.length===1?je.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(ie===">"?1:-1)+me):je)+(re?") and ("+(re[0]===">"?"min-":"max-")+Ue+":"+(re.length===1?ge.replace(Bp,(Xe,ce,me)=>Number(ce)+Ee*(re===">"?-1:1)+me):ge):"")+")"})),ee){const H=O?x.concat(R):[...x],Z=O?[...m]:MC(m,R.split(LC));u!==void 0&&a(Qy(...u)),u=void 0,g(_,Z,H)}else u===void 0&&(u=[[],m,x]),R=O||R.charCodeAt(0)!==36?R:`--${Cs(i.prefix)}${R.slice(1).replace(/\$/g,"-")}`,_=ee?_:typeof _=="number"?_&&q in DC?String(_)+"px":String(_):Yy(OC(q,_??""),i.prefix,i.themeMap[q]),u[0].push(`${O?`${R} `:`${Fp(R)}:`}${_}`)}}var L,P};M(S),u!==void 0&&a(Qy(...u)),u=void 0};g(t,e,n)},Qy=(t,e,n)=>`${n.map(i=>`${i}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,DC={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Gy=t=>String.fromCharCode(t+(t>25?39:97)),Ja=t=>(e=>{let n,i="";for(n=Math.abs(e);n>52;n=n/52|0)i=Gy(n%52)+i;return Gy(n%52)+i})(((e,n)=>{let i=n.length;for(;i;)e=33*e^n.charCodeAt(--i);return e})(5381,JSON.stringify(t))>>>0),ic=["themed","global","styled","onevar","resonevar","allvar","inline"],kC=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},IC=t=>{let e;const n=()=>{const{cssRules:a}=e.sheet;return[].map.call(a,(u,f)=>{const{cssText:p}=u;let g="";if(p.startsWith("--sxs"))return"";if(a[f-1]&&(g=a[f-1].cssText).startsWith("--sxs")){if(!u.cssRules.length)return"";for(const S in e.rules)if(e.rules[S].group===u)return`--sxs{--sxs:${[...e.rules[S].cache].join(" ")}}${p}`;return u.cssRules.length?`${g}${p}`:""}return p}).join("")},i=()=>{if(e){const{rules:p,sheet:g}=e;if(!g.deleteRule){for(;Object(Object(g.cssRules)[0]).type===3;)g.cssRules.splice(0,1);g.cssRules=[]}for(const S in p)delete p[S]}const a=Object(t).styleSheets||[];for(const p of a)if(kC(p)){for(let g=0,S=p.cssRules;S[g];++g){const m=Object(S[g]);if(m.type!==1)continue;const x=Object(S[g+1]);if(x.type!==4)continue;++g;const{cssText:R}=m;if(!R.startsWith("--sxs"))continue;const _=R.slice(14,-3).trim().split(/\s+/),M=ic[_[0]];M&&(e||(e={sheet:p,reset:i,rules:{},toString:n}),e.rules[M]={group:x,index:g,cache:new Set(_)})}if(e)break}if(!e){const p=(g,S)=>({type:S,cssRules:[],insertRule(m,x){this.cssRules.splice(x,0,p(m,{import:3,undefined:1}[(m.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return g==="@media{}"?`@media{${[].map.call(this.cssRules,m=>m.cssText).join("")}}`:g}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:p("","text/css"),rules:{},reset:i,toString:n}}const{sheet:u,rules:f}=e;for(let p=ic.length-1;p>=0;--p){const g=ic[p];if(!f[g]){const S=ic[p+1],m=f[S]?f[S].index:u.cssRules.length;u.insertRule("@media{}",m),u.insertRule(`--sxs{--sxs:${p}}`,m),f[g]={group:u.cssRules[m+1],index:m,cache:new Set([p])}}NC(f[g])}};return i(),e},NC=t=>{const e=t.group;let n=e.cssRules.length;t.apply=i=>{try{e.insertRule(i,n),++n}catch{}}},rc=Symbol(),zC=Ol(),Xy=(t,e)=>zC(t,()=>(...n)=>{let i={type:null,composers:new Set};for(const a of n)if(a!=null)if(a[Za]){i.type==null&&(i.type=a[Za].type);for(const u of a[Za].composers)i.composers.add(u)}else a.constructor!==Object||a.$$typeof?i.type==null&&(i.type=a):i.composers.add(UC(a,t));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),jC(t,i,e)}),UC=({variants:t,compoundVariants:e,defaultVariants:n,...i},a)=>{const u=`${Cs(a.prefix)}c-${Ja(i)}`,f=[],p=[],g=Object.create(null),S=[];for(const R in n)g[R]=String(n[R]);if(typeof t=="object"&&t)for(const R in t){m=g,x=R,RC.call(m,x)||(g[R]="undefined");const _=t[R];for(const M in _){const k={[R]:String(M)};String(M)==="undefined"&&S.push(R);const L=_[M],P=[k,L,!Wy(L)];f.push(P)}}var m,x;if(typeof e=="object"&&e)for(const R of e){let{css:_,...M}=R;_=typeof _=="object"&&_||{};for(const L in M)M[L]=String(M[L]);const k=[M,_,!Wy(_)];p.push(k)}return[u,i,f,p,g,S]},jC=(t,e,n)=>{const[i,a,u,f]=FC(e.composers),p=typeof e.type=="function"||e.type.$$typeof?(x=>{function R(){for(let _=0;_<R[rc].length;_++){const[M,k]=R[rc][_];x.rules[M].apply(k)}return R[rc]=[],null}return R[rc]=[],R.rules={},ic.forEach(_=>R.rules[_]={apply:M=>R[rc].push([_,M])}),R})(n):null,g=(p||n).rules,S=`.${i}${a.length>1?`:where(.${a.slice(1).join(".")})`:""}`,m=x=>{x=typeof x=="object"&&x||BC;const{css:R,..._}=x,M={};for(const P in u)if(delete _[P],P in x){let O=x[P];typeof O=="object"&&O?M[P]={"@initial":u[P],...O}:(O=String(O),M[P]=O!=="undefined"||f.has(P)?O:u[P])}else M[P]=u[P];const k=new Set([...a]);for(const[P,O,j,q]of e.composers){n.rules.styled.cache.has(P)||(n.rules.styled.cache.add(P),Ll(O,[`.${P}`],[],t,Z=>{g.styled.apply(Z)}));const ee=Ky(j,M,t.media),H=Ky(q,M,t.media,!0);for(const Z of ee)if(Z!==void 0)for(const[ie,W,re]of Z){const ge=`${P}-${Ja(W)}-${ie}`;k.add(ge);const be=(re?n.rules.resonevar:n.rules.onevar).cache,Ee=re?g.resonevar:g.onevar;be.has(ge)||(be.add(ge),Ll(W,[`.${ge}`],[],t,Ue=>{Ee.apply(Ue)}))}for(const Z of H)if(Z!==void 0)for(const[ie,W]of Z){const re=`${P}-${Ja(W)}-${ie}`;k.add(re),n.rules.allvar.cache.has(re)||(n.rules.allvar.cache.add(re),Ll(W,[`.${re}`],[],t,ge=>{g.allvar.apply(ge)}))}}if(typeof R=="object"&&R){const P=`${i}-i${Ja(R)}-css`;k.add(P),n.rules.inline.cache.has(P)||(n.rules.inline.cache.add(P),Ll(R,[`.${P}`],[],t,O=>{g.inline.apply(O)}))}for(const P of String(x.className||"").trim().split(/\s+/))P&&k.add(P);const L=_.className=[...k].join(" ");return{type:e.type,className:L,selector:S,props:_,toString:()=>L,deferredInjector:p}};return jp(m,{className:i,selector:S,[Za]:e,toString:()=>(n.rules.styled.cache.has(i)||m(),i)})},FC=t=>{let e="";const n=[],i={},a=[];for(const[u,,,,f,p]of t){e===""&&(e=u),n.push(u),a.push(...p);for(const g in f){const S=f[g];(i[g]===void 0||S!=="undefined"||p.includes(S))&&(i[g]=S)}}return[e,n,i,new Set(a)]},Ky=(t,e,n,i)=>{const a=[];e:for(let[u,f,p]of t){if(p)continue;let g,S=0,m=!1;for(g in u){const x=u[g];let R=e[g];if(R!==x){if(typeof R!="object"||!R)continue e;{let _,M,k=0;for(const L in R){if(x===String(R[L])){if(L!=="@initial"){const P=L.slice(1);(M=M||[]).push(P in n?n[P]:L.replace(/^@media ?/,"")),m=!0}S+=k,_=!0}++k}if(M&&M.length&&(f={["@media "+M.join(", ")]:f}),!_)continue e}}}(a[S]=a[S]||[]).push([i?"cv":`${g}-${u[g]}`,f,m])}return a},BC={},HC=Ol(),VC=(t,e)=>HC(t,()=>(...n)=>{const i=()=>{for(let a of n){a=typeof a=="object"&&a||{};let u=Ja(a);if(!e.rules.global.cache.has(u)){if(e.rules.global.cache.add(u),"@import"in a){let f=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let p of[].concat(a["@import"]))p=p.includes('"')||p.includes("'")?p:`"${p}"`,e.sheet.insertRule(`@import ${p};`,f++);delete a["@import"]}Ll(a,[],[],t,f=>{e.rules.global.apply(f)})}}return""};return jp(i,{toString:i})}),$C=Ol(),WC=(t,e)=>$C(t,()=>n=>{const i=`${Cs(t.prefix)}k-${Ja(n)}`,a=()=>{if(!e.rules.global.cache.has(i)){e.rules.global.cache.add(i);const u=[];Ll(n,[],[],t,p=>u.push(p));const f=`@keyframes ${i}{${u.join("")}}`;e.rules.global.apply(f)}return i};return jp(a,{get name(){return a()},toString:a})}),qC=class{constructor(e,n,i,a){this.token=e==null?"":String(e),this.value=n==null?"":String(n),this.scale=i==null?"":String(i),this.prefix=a==null?"":String(a)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Cs(this.prefix)+Cs(this.scale)+this.token}toString(){return this.computedValue}},YC=Ol(),QC=(t,e)=>YC(t,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const a=`.${n=(n=typeof n=="string"?n:"")||`${Cs(t.prefix)}t-${Ja(i)}`}`,u={},f=[];for(const g in i){u[g]={};for(const S in i[g]){const m=`--${Cs(t.prefix)}${g}-${S}`,x=Yy(String(i[g][S]),t.prefix,g);u[g][S]=new qC(S,x,g,t.prefix),f.push(`${m}:${x}`)}}const p=()=>{if(f.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const g=`${i===t.theme?":root,":""}.${n}{${f.join(";")}}`;e.rules.themed.apply(g)}return n};return{...u,get className(){return p()},selector:a,toString:p}}),GC=Ol(),XC=Ol(),KC=t=>{const e=(n=>{let i=!1;const a=GC(n,u=>{i=!0;const f="prefix"in(u=typeof u=="object"&&u||{})?String(u.prefix):"",p=typeof u.media=="object"&&u.media||{},g=typeof u.root=="object"?u.root||null:globalThis.document||null,S=typeof u.theme=="object"&&u.theme||{},m={prefix:f,media:p,theme:S,themeMap:typeof u.themeMap=="object"&&u.themeMap||{...CC},utils:typeof u.utils=="object"&&u.utils||{}},x=IC(g),R={css:Xy(m,x),globalCss:VC(m,x),keyframes:WC(m,x),createTheme:QC(m,x),reset(){x.reset(),R.theme.toString()},theme:{},sheet:x,config:m,prefix:f,getCssText:x.toString,toString:x.toString};return String(R.theme=R.createTheme(S)),R});return i||a.reset(),a})(t);return e.styled=(({config:n,sheet:i})=>XC(n,()=>{const a=Xy(n,i);return(...u)=>{const f=a(...u),p=f[Za].type,g=T.forwardRef((S,m)=>{const x=S&&S.as||p,{props:R,deferredInjector:_}=f(S);return delete R.as,R.ref=m,_?T.createElement(T.Fragment,null,T.createElement(x,R),T.createElement(_,null)):T.createElement(x,R)});return g.className=f.className,g.displayName=`Styled.${p.displayName||p.name||p}`,g.selector=f.selector,g.toString=()=>f.selector,g[Za]=f[Za],g}}))(e),e};function ZC(t,e,n){return Math.max(e,Math.min(t,n))}const hi={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function Zy(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function Jy(t,e,n,i=.15){return i===0?ZC(t,e,n):t<e?-Zy(e-t,n-e,i)+e:t>n?+Zy(t-n,n-e,i)+n:t}function JC(t,[e,n],[i,a]){const[[u,f],[p,g]]=t;return[Jy(e,u,f,i),Jy(n,p,g,a)]}function eT(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tT(t){var e=eT(t,"string");return typeof e=="symbol"?e:String(e)}function zi(t,e,n){return e=tT(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function vn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e0(Object(n),!0).forEach(function(i){zi(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const t0={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function n0(t){return t?t[0].toUpperCase()+t.slice(1):""}const nT=["enter","leave"];function iT(t=!1,e){return t&&!nT.includes(e)}function rT(t,e="",n=!1){const i=t0[t],a=i&&i[e]||e;return"on"+n0(t)+n0(a)+(iT(n,a)?"Capture":"")}const sT=["gotpointercapture","lostpointercapture"];function aT(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const i=sT.includes(e)?"capturecapture":"capture",a=!!~e.indexOf(i);return a&&(e=e.replace("capture","")),{device:e,capture:a,passive:n}}function oT(t,e=""){const n=t0[t],i=n&&n[e]||e;return t+i}function td(t){return"touches"in t}function i0(t){return td(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function lT(t){return Array.from(t.touches).filter(e=>{var n,i;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(i=n.contains)===null||i===void 0?void 0:i.call(n,e.target))})}function uT(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function r0(t){return td(t)?uT(t)[0]:t}function cT(t){return lT(t).map(e=>e.identifier)}function Hp(t){const e=r0(t);return td(t)?e.identifier:e.pointerId}function s0(t){const e=r0(t);return[e.clientX,e.clientY]}function fT(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u}=t;Object.assign(e,{shiftKey:n,altKey:i,metaKey:a,ctrlKey:u})}return e}function nd(t,...e){return typeof t=="function"?t(...e):t}function dT(){}function hT(...t){return t.length===0?dT:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function a0(t,e){return Object.assign({},e,t||{})}const pT=32;class vT{constructor(e,n,i){this.ctrl=e,this.args=n,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:i,args:a}=this;n[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=a,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,i=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=i.from?nd(i.from,n):n.offset,n.offset=n.lastOffset),n.startTime=n.timeStamp=e.timeStamp}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:i,shared:a}=this;n.args=this.args;let u=0;if(e&&(n.event=e,i.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,a.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,a.locked=!!document.pointerLockElement,Object.assign(a,fT(e)),a.down=a.pressed=a.buttons%2===1||a.touches>0,u=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const H=n._delta.map(Math.abs);hi.addTo(n._distance,H)}this.axisIntent&&this.axisIntent(e);const[f,p]=n._movement,[g,S]=i.threshold,{_step:m,values:x}=n;if(i.hasCustomTransform?(m[0]===!1&&(m[0]=Math.abs(f)>=g&&x[0]),m[1]===!1&&(m[1]=Math.abs(p)>=S&&x[1])):(m[0]===!1&&(m[0]=Math.abs(f)>=g&&Math.sign(f)*g),m[1]===!1&&(m[1]=Math.abs(p)>=S&&Math.sign(p)*S)),n.intentional=m[0]!==!1||m[1]!==!1,!n.intentional)return;const R=[0,0];if(i.hasCustomTransform){const[H,Z]=x;R[0]=m[0]!==!1?H-m[0]:0,R[1]=m[1]!==!1?Z-m[1]:0}else R[0]=m[0]!==!1?f-m[0]:0,R[1]=m[1]!==!1?p-m[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(R);const _=n.offset,M=n._active&&!n._blocked||n.active;M&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=a[this.ingKey]=n._active,e&&(n.first&&("bounds"in i&&(n._bounds=nd(i.bounds,n)),this.setup&&this.setup()),n.movement=R,this.computeOffset()));const[k,L]=n.offset,[[P,O],[j,q]]=n._bounds;n.overflow=[k<P?-1:k>O?1:0,L<j?-1:L>q?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const ee=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=JC(n._bounds,n.offset,ee),n.delta=hi.sub(n.offset,_),this.computeMovement(),M&&(!n.last||u>pT)){n.delta=hi.sub(n.offset,_);const H=n.delta.map(Math.abs);hi.addTo(n.distance,H),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&u>0&&(n.velocity=[H[0]/u,H[1]/u])}}emit(){const e=this.state,n=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;const a=this.handler(vn(vn(vn({},n),e),{},{[this.aliasKey]:e.values}));a!==void 0&&(e.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function mT([t,e],n){const i=Math.abs(t),a=Math.abs(e);if(i>a&&i>n)return"x";if(a>i&&a>n)return"y"}class gT extends vT{constructor(...e){super(...e),zi(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=hi.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=hi.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,i=this.config;if(!n.axis&&e){const a=typeof i.axisThreshold=="object"?i.axisThreshold[i0(e)]:i.axisThreshold;n.axis=mT(n._movement,a)}n._blocked=(i.lockDirection||!!i.axis)&&!n.axis||!!i.axis&&i.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const yT=t=>t,o0=.15,l0={enabled(t=!0){return t},eventOptions(t,e,n){return vn(vn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[o0,o0];case!1:return[0,0];default:return hi.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return hi.toVector(t)},transform(t,e,n){const i=t||n.shared.transform;return this.hasCustomTransform=!!i,i||yT},threshold(t){return hi.toVector(t,0)}},ST=0,sc=vn(vn({},l0),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=ST){return t},bounds(t={}){if(typeof t=="function")return u=>sc.bounds(t(u));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:i=-1/0,bottom:a=1/0}=t;return[[e,n],[i,a]]}}),u0={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class bT extends gT{constructor(...e){super(...e),zi(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const n=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),a={left:n.left-i.left+e.offset[0],right:n.right-i.right+e.offset[0],top:n.top-i.top+e.offset[1],bottom:n.bottom-i.bottom+e.offset[1]};e._bounds=sc.bounds(a)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const n=this.config,i=this.state;if(e.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(e.buttons):n.pointerButtons!==-1&&n.pointerButtons!==e.buttons))return;const a=this.ctrl.setEventIds(e);n.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(a&&a.size>1&&i._pointerActive)&&(this.start(e),this.setupPointer(e),i._pointerId=Hp(e),i._pointerActive=!0,this.computeValues(s0(e)),this.computeInitial(),n.preventScrollAxis&&i0(e)!=="mouse"?(i._active=!1,this.setupScrollPrevention(e)):n.delay>0?(this.setupDelayTrigger(e),n.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const n=this.state,i=this.config;if(!n._pointerActive||n.type===e.type&&e.timeStamp===n.timeStamp)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;const u=s0(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=hi.sub(u,n._values),this.computeValues(u)),hi.addTo(n._movement,n._delta),this.compute(e),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===i.preventScrollAxis||i.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const n=this.state,i=this.config;if(!n._active||!n._pointerActive)return;const a=Hp(e);if(n._pointerId!==void 0&&a!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[u,f]=n._distance;if(n.tap=u<=i.tapsThreshold&&f<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[p,g]=n.direction,[S,m]=n.velocity,[x,R]=n.movement,[_,M]=i.swipe.velocity,[k,L]=i.swipe.distance,P=i.swipe.duration;n.elapsedTime<P&&(Math.abs(S)>_&&Math.abs(x)>k&&(n.swipe[0]=p),Math.abs(m)>M&&Math.abs(R)>L&&(n.swipe[1]=g))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const n=this.config,i=n.device;n.pointerLock&&e.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,ET(e);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const n=u0[e.key];if(n){const i=this.state,a=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=n(this.config.keyboardDisplacement,a),i._keyboardActive=!0,hi.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in u0&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const n=this.config.device;e(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(n,"change",this.pointerMove.bind(this)),e(n,"end",this.pointerUp.bind(this)),e(n,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function ET(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const ac=typeof window<"u"&&window.document&&window.document.createElement;function xT(){return ac&&"ontouchstart"in window}function c0(){return xT()||ac&&window.navigator.maxTouchPoints>1}function wT(){return ac&&"onpointerdown"in window}function CT(){return ac&&"exitPointerLock"in window.document}function TT(){try{return"constructor"in GestureEvent}catch{return!1}}const pr={isBrowser:ac,gesture:TT(),touch:c0(),touchscreen:c0(),pointer:wT(),pointerLock:CT()},RT=250,AT=180,MT=.5,OT=50,_T=250,LT=10,f0={mouse:0,touch:0,pen:8},PT=vn(vn({},sc),{},{device(t,e,{pointer:{touch:n=!1,lock:i=!1,mouse:a=!1}={}}){return this.pointerLock=i&&pr.pointerLock,pr.touch&&n?"touch":this.pointerLock?"mouse":pr.pointer&&!a?"pointer":pr.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?RT:void 0,!(!pr.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:i=1,keys:a=!0}={}}){return this.pointerButtons=i,this.keys=a,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:i=3,axis:a=void 0}){const u=hi.toVector(t,n?i:a?1:0);return this.filterTaps=n,this.tapsThreshold=i,u},swipe({velocity:t=MT,distance:e=OT,duration:n=_T}={}){return{velocity:this.transform(hi.toVector(t)),distance:this.transform(hi.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return AT;case!1:return 0;default:return t}},axisThreshold(t){return t?vn(vn({},f0),t):f0},keyboardDisplacement(t=LT){return t}});vn(vn({},l0),{},{device(t,e,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!pr.touch&&pr.gesture)return"gesture";if(pr.touch&&i)return"touch";if(pr.touchscreen){if(pr.pointer)return"pointer";if(pr.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:i={}}){const a=f=>{const p=a0(nd(n,f),{min:-1/0,max:1/0});return[p.min,p.max]},u=f=>{const p=a0(nd(i,f),{min:-1/0,max:1/0});return[p.min,p.max]};return typeof n!="function"&&typeof i!="function"?[a(),u()]:f=>[a(f),u(f)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",hi.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t}),vn(vn({},sc),{},{mouseOnly:(t=!0)=>t});const d0=new Map,Vp=new Map;function DT(t){d0.set(t.key,t.engine),Vp.set(t.key,t.resolver)}const kT={key:"drag",engine:bT,resolver:PT};function IT(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function NT(t,e){if(t==null)return{};var n=IT(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}const zT={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=pr.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},UT=["target","eventOptions","window","enabled","transform"];function id(t={},e){const n={};for(const[i,a]of Object.entries(e))switch(typeof a){case"function":n[i]=a.call(n,t[i],i,t);break;case"object":n[i]=id(t[i],a);break;case"boolean":a&&(n[i]=t[i]);break}return n}function jT(t,e,n={}){const i=t,{target:a,eventOptions:u,window:f,enabled:p,transform:g}=i,S=NT(i,UT);if(n.shared=id({target:a,eventOptions:u,window:f,enabled:p,transform:g},zT),e){const m=Vp.get(e);n[e]=id(vn({shared:n.shared},S),m)}else for(const m in S){const x=Vp.get(m);x&&(n[m]=id(vn({shared:n.shared},S[m]),x))}return n}class h0{constructor(e,n){zi(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,i,a,u){const f=this._listeners,p=oT(n,i),g=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},S=vn(vn({},g),u);e.addEventListener(p,a,S);const m=()=>{e.removeEventListener(p,a,S),f.delete(m)};return f.add(m),m}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class FT{constructor(){zi(this,"_timeouts",new Map)}add(e,n,i=140,...a){this.remove(e),this._timeouts.set(e,window.setTimeout(n,i,...a))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class BT{constructor(e){zi(this,"gestures",new Set),zi(this,"_targetEventStore",new h0(this)),zi(this,"gestureEventStores",{}),zi(this,"gestureTimeoutStores",{}),zi(this,"handlers",{}),zi(this,"config",{}),zi(this,"pointerIds",new Set),zi(this,"touchIds",new Set),zi(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),HT(this,e)}setEventIds(e){if(td(e))return this.touchIds=new Set(cT(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=jT(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,i={};let a;if(!(n.target&&(a=n.target(),!a))){if(n.enabled){for(const f of this.gestures){const p=this.config[f],g=p0(i,p.eventOptions,!!a);if(p.enabled){const S=d0.get(f);new S(this,e,f).bind(g)}}const u=p0(i,n.eventOptions,!!a);for(const f in this.nativeHandlers)u(f,"",p=>this.nativeHandlers[f](vn(vn({},this.state.shared),{},{event:p,args:e})),void 0,!0)}for(const u in i)i[u]=hT(...i[u]);if(!a)return i;for(const u in i){const{device:f,capture:p,passive:g}=aT(u);this._targetEventStore.add(a,f,"",i[u],{capture:p,passive:g})}}}}function Pl(t,e){t.gestures.add(e),t.gestureEventStores[e]=new h0(t,e),t.gestureTimeoutStores[e]=new FT}function HT(t,e){e.drag&&Pl(t,"drag"),e.wheel&&Pl(t,"wheel"),e.scroll&&Pl(t,"scroll"),e.move&&Pl(t,"move"),e.pinch&&Pl(t,"pinch"),e.hover&&Pl(t,"hover")}const p0=(t,e,n)=>(i,a,u,f={},p=!1)=>{var g,S;const m=(g=f.capture)!==null&&g!==void 0?g:e.capture,x=(S=f.passive)!==null&&S!==void 0?S:e.passive;let R=p?i:rT(i,a,m);n&&x&&(R+="Passive"),t[R]=t[R]||[],t[R].push(u)};function VT(t,e={},n,i){const a=T.useMemo(()=>new BT(t),[]);if(a.applyHandlers(t,i),a.applyConfig(e,n),T.useEffect(a.effect.bind(a)),T.useEffect(()=>a.clean.bind(a),[]),e.target===void 0)return a.bind.bind(a)}function $T(t,e){return DT(kT),VT({drag:t},e||{},"drag")}const WT=se.useId||(()=>{});let qT=0;function YT(t){const[e,n]=se.useState(WT());return Kf(()=>{t||n(i=>i??String(qT++))},[t]),t||(e?`radix-${e}`:"")}const Dl=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((t,e)=>({...t,[e]:se.forwardRef((n,i)=>{const{asChild:a,...u}=n,f=a?Ny:e;return se.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.as&&console.error(QT),se.createElement(f,di({},u,{ref:i}))})}),{}),QT="Warning: The `as` prop has been removed in favour of `asChild`. For details, see https://radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element",GT=se.forwardRef((t,e)=>se.createElement(Dl.span,di({},t,{ref:e,style:{...t.style,position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}}))),XT=se.forwardRef((t,e)=>{var n,i;const{containerRef:a,style:u,...f}=t,p=(n=a==null?void 0:a.current)!==null&&n!==void 0?n:globalThis==null||(i=globalThis.document)===null||i===void 0?void 0:i.body,[,g]=se.useState({});return Kf(()=>{g({})},[]),p?by.createPortal(se.createElement(Dl.div,di({"data-radix-portal":""},f,{ref:e,style:p===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...u}:void 0})),p):null}),KT=se.forwardRef((t,e)=>{const{children:n,width:i=10,height:a=5,...u}=t;return se.createElement(Dl.svg,di({},u,{ref:e,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:se.createElement("polygon",{points:"0,0 30,0 15,10"}))});function v0(t){const[e,n]=se.useState(void 0);return se.useEffect(()=>{if(t){const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const u=a[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,S=Array.isArray(g)?g[0]:g;f=S.inlineSize,p=S.blockSize}else{const g=t.getBoundingClientRect();f=g.width,p=g.height}n({width:f,height:p})});return i.observe(t,{box:"border-box"}),()=>{n(void 0),i.unobserve(t)}}},[t]),e}function ZT(t,e){const n=eo.get(t);return n===void 0?(eo.set(t,{rect:{},callbacks:[e]}),eo.size===1&&($p=requestAnimationFrame(m0))):(n.callbacks.push(e),e(t.getBoundingClientRect())),()=>{const i=eo.get(t);if(i===void 0)return;const a=i.callbacks.indexOf(e);a>-1&&i.callbacks.splice(a,1),i.callbacks.length===0&&(eo.delete(t),eo.size===0&&cancelAnimationFrame($p))}}let $p;const eo=new Map;function m0(){const t=[];eo.forEach((e,n)=>{const i=n.getBoundingClientRect();var a,u;a=e.rect,u=i,(a.width!==u.width||a.height!==u.height||a.top!==u.top||a.right!==u.right||a.bottom!==u.bottom||a.left!==u.left)&&(e.rect=i,t.push(e))}),t.forEach(e=>{e.callbacks.forEach(n=>n(e.rect))}),$p=requestAnimationFrame(m0)}function g0(t){const[e,n]=se.useState();return se.useEffect(()=>{if(t){const i=ZT(t,n);return()=>{n(void 0),i()}}},[t]),e}function y0(t,e=[]){let n=[];const i=()=>{const a=n.map(u=>se.createContext(u));return function(u){const f=(u==null?void 0:u[t])||a;return se.useMemo(()=>({[`__scope${t}`]:{...u,[t]:f}}),[u,f])}};return i.scopeName=t,[function(a,u){const f=se.createContext(u),p=n.length;function g(S){const{scope:m,children:x,...R}=S,_=(m==null?void 0:m[t][p])||f,M=se.useMemo(()=>R,Object.values(R));return se.createElement(_.Provider,{value:M},x)}return n=[...n,u],g.displayName=a+"Provider",[g,function(S,m){const x=(m==null?void 0:m[t][p])||f,R=se.useContext(x);if(R)return R;if(u!==void 0)return u;throw new Error(`\`${S}\` must be used within \`${a}\``)}]},JT(i,...e)]}function JT(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(a){const u=i.reduce((f,{useScope:p,scopeName:g})=>({...f,...p(a)[`__scope${g}`]}),{});return se.useMemo(()=>({[`__scope${e.scopeName}`]:u}),[u])}};return n.scopeName=e.scopeName,n}function eR({anchorRect:t,popperSize:e,arrowSize:n,arrowOffset:i=0,side:a,sideOffset:u=0,align:f,alignOffset:p=0,shouldAvoidCollisions:g=!0,collisionBoundariesRect:S,collisionTolerance:m=0}){if(!t||!e||!S)return{popperStyles:tR,arrowStyles:Wp};const x=function(Z,ie,W=0,re=0,ge){const be=ge?ge.height:0,Ee=S0(ie,Z,"x"),Ue=S0(ie,Z,"y"),je=Ue.before-W-be,Xe=Ue.after+W+be,ce=Ee.before-W-be,me=Ee.after+W+be;return{top:{start:{x:Ee.start+re,y:je},center:{x:Ee.center,y:je},end:{x:Ee.end-re,y:je}},right:{start:{x:me,y:Ue.start+re},center:{x:me,y:Ue.center},end:{x:me,y:Ue.end-re}},bottom:{start:{x:Ee.start+re,y:Xe},center:{x:Ee.center,y:Xe},end:{x:Ee.end-re,y:Xe}},left:{start:{x:ce,y:Ue.start+re},center:{x:ce,y:Ue.center},end:{x:ce,y:Ue.end-re}}}}(e,t,u,p,n),R=x[a][f];if(g===!1){const Z=b0(R);let ie=Wp;return n&&(ie=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:a,align:f})),{popperStyles:{...Z,"--radix-popper-transform-origin":E0(e,a,f,i,n)},arrowStyles:ie,placedSide:a,placedAlign:f}}const _=DOMRect.fromRect({...e,...R}),M=(k=S,L=m,DOMRect.fromRect({width:k.width-2*L,height:k.height-2*L,x:k.left+L,y:k.top+L}));var k,L;const P=C0(_,M),O=x[w0(a)][f],j=function(Z,ie,W){const re=w0(Z);return ie[Z]&&!W[re]?re:Z}(a,P,C0(DOMRect.fromRect({...e,...O}),M)),q=function(Z,ie,W,re,ge){const be=W==="top"||W==="bottom",Ee=be?"left":"top",Ue=be?"right":"bottom",je=be?"width":"height",Xe=ie[je]>Z[je];return(re==="start"||re==="center")&&(ge[Ee]&&Xe||ge[Ue]&&!Xe)?"end":(re==="end"||re==="center")&&(ge[Ue]&&Xe||ge[Ee]&&!Xe)?"start":re}(e,t,a,f,P),ee=b0(x[j][q]);let H=Wp;return n&&(H=x0({popperSize:e,arrowSize:n,arrowOffset:i,side:j,align:q})),{popperStyles:{...ee,"--radix-popper-transform-origin":E0(e,j,q,i,n)},arrowStyles:H,placedSide:j,placedAlign:q}}function S0(t,e,n){const i=t[n==="x"?"left":"top"],a=n==="x"?"width":"height",u=t[a],f=e[a];return{before:i-f,start:i,center:i+(u-f)/2,end:i+u-f,after:i+u}}function b0(t){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(t.x+window.scrollX)}px, ${Math.round(t.y+window.scrollY)}px, 0)`}}function E0(t,e,n,i,a){const u=e==="top"||e==="bottom",f=a?a.width:0,p=a?a.height:0,g=f/2+i;let S="",m="";return u?(S={start:`${g}px`,center:"center",end:t.width-g+"px"}[n],m=e==="top"?`${t.height+p}px`:-p+"px"):(S=e==="left"?`${t.width+p}px`:-p+"px",m={start:`${g}px`,center:"center",end:t.height-g+"px"}[n]),`${S} ${m}`}const tR={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Wp={position:"absolute",opacity:0};function x0({popperSize:t,arrowSize:e,arrowOffset:n,side:i,align:a}){const u=(t.width-e.width)/2,f=(t.height-e.width)/2,p={top:0,right:90,bottom:180,left:-90}[i],g=Math.max(e.width,e.height),S={width:`${g}px`,height:`${g}px`,transform:`rotate(${p}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:nR(i,a)};return i!=="top"&&i!=="bottom"||(a==="start"&&(S.left=`${n}px`),a==="center"&&(S.left=`${u}px`),a==="end"&&(S.right=`${n}px`)),i!=="left"&&i!=="right"||(a==="start"&&(S.top=`${n}px`),a==="center"&&(S.top=`${f}px`),a==="end"&&(S.bottom=`${n}px`)),S}function nR(t,e){return(t!=="top"&&t!=="right"||e!=="end")&&(t!=="bottom"&&t!=="left"||e==="end")?"ltr":"rtl"}function w0(t){return{top:"bottom",right:"left",bottom:"top",left:"right"}[t]}function C0(t,e){return{top:t.top<e.top,right:t.right>e.right,bottom:t.bottom>e.bottom,left:t.left<e.left}}const[T0,R0]=y0("Popper"),[iR,A0]=T0("Popper"),rR=t=>{const{__scopePopper:e,children:n}=t,[i,a]=se.useState(null);return se.createElement(iR,{scope:e,anchor:i,onAnchorChange:a},n)},sR=se.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...a}=t,u=A0("PopperAnchor",n),f=se.useRef(null),p=Xf(e,f);return se.useEffect(()=>{u.onAnchorChange((i==null?void 0:i.current)||f.current)}),i?null:se.createElement(Dl.div,di({},a,{ref:p}))}),[aR,oR]=T0("PopperContent"),lR=se.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a,align:u="center",alignOffset:f,collisionTolerance:p,avoidCollisions:g=!0,...S}=t,m=A0("PopperContent",n),[x,R]=se.useState(),_=g0(m.anchor),[M,k]=se.useState(null),L=v0(M),[P,O]=se.useState(null),j=v0(P),q=Xf(e,be=>k(be)),ee=function(){const[be,Ee]=se.useState(void 0);return se.useEffect(()=>{let Ue;function je(){Ee({width:window.innerWidth,height:window.innerHeight})}function Xe(){window.clearTimeout(Ue),Ue=window.setTimeout(je,100)}return je(),window.addEventListener("resize",Xe),()=>window.removeEventListener("resize",Xe)},[]),be}(),H=ee?DOMRect.fromRect({...ee,x:0,y:0}):void 0,{popperStyles:Z,arrowStyles:ie,placedSide:W,placedAlign:re}=eR({anchorRect:_,popperSize:L,arrowSize:j,arrowOffset:x,side:i,sideOffset:a,align:u,alignOffset:f,shouldAvoidCollisions:g,collisionBoundariesRect:H,collisionTolerance:p}),ge=W!==void 0;return se.createElement("div",{style:Z,"data-radix-popper-content-wrapper":""},se.createElement(aR,{scope:n,arrowStyles:ie,onArrowChange:O,onArrowOffsetChange:R},se.createElement(Dl.div,di({"data-side":W,"data-align":re},S,{style:{...S.style,animation:ge?void 0:"none"},ref:q}))))}),uR=se.forwardRef(function(t,e){const{__scopePopper:n,offset:i,...a}=t,u=oR("PopperArrow",n),{onArrowOffsetChange:f}=u;return se.useEffect(()=>f(i),[f,i]),se.createElement("span",{style:{...u.arrowStyles,pointerEvents:"none"}},se.createElement("span",{ref:u.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},se.createElement(KT,di({},a,{ref:e,style:{...a.style,display:"block"}}))))}),cR=rR,fR=sR,dR=lR,hR=uR,M0=t=>{const{present:e,children:n}=t,i=function(f){const[p,g]=se.useState(),S=se.useRef({}),m=se.useRef(f),x=se.useRef("none"),R=f?"mounted":"unmounted",[_,M]=function(k,L){return se.useReducer((P,O)=>{const j=L[P][O];return j??P},k)}(R,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return se.useEffect(()=>{const k=rd(S.current);x.current=_==="mounted"?k:"none"},[_]),Kf(()=>{const k=S.current,L=m.current;if(L!==f){const P=x.current,O=rd(k);f?M("MOUNT"):O==="none"||(k==null?void 0:k.display)==="none"?M("UNMOUNT"):M(L&&P!==O?"ANIMATION_OUT":"UNMOUNT"),m.current=f}},[f,M]),Kf(()=>{if(p){const k=P=>{const O=rd(S.current).includes(P.animationName);P.target===p&&O&&M("ANIMATION_END")},L=P=>{P.target===p&&(x.current=rd(S.current))};return p.addEventListener("animationstart",L),p.addEventListener("animationcancel",k),p.addEventListener("animationend",k),()=>{p.removeEventListener("animationstart",L),p.removeEventListener("animationcancel",k),p.removeEventListener("animationend",k)}}},[p,M]),{isPresent:["mounted","unmountSuspended"].includes(_),ref:se.useCallback(k=>{k&&(S.current=getComputedStyle(k)),g(k)},[])}}(e),a=typeof n=="function"?n({present:i.isPresent}):se.Children.only(n),u=Xf(i.ref,a.ref);return typeof n=="function"||i.isPresent?se.cloneElement(a,{ref:u}):null};function rd(t){return(t==null?void 0:t.animationName)||"none"}M0.displayName="Presence";function O0(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t},[t]),e.current}function qp(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>{var i;return(i=e.current)===null||i===void 0?void 0:i.call(e,...n)},[])}function pR(t){const e=qp(t);se.useEffect(()=>{const n=i=>{i.key==="Escape"&&e(i)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}function vR({prop:t,defaultProp:e,onChange:n=()=>{}}){const[i,a]=function({defaultProp:g,onChange:S}){const m=se.useState(g),[x]=m,R=se.useRef(x),_=qp(S);return se.useEffect(()=>{R.current!==x&&(_(x),R.current=x)},[x,R,_]),m}({defaultProp:e,onChange:n}),u=t!==void 0,f=u?t:i,p=qp(n);return[f,se.useCallback(g=>{if(u){const S=g,m=typeof g=="function"?S(t):g;m!==t&&p(m)}else a(g)},[u,t,a,p])]}function kl(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}const[_0,jN]=y0("Tooltip",[R0]),sd=R0(),mR=700,[FN,gR]=_0("TooltipProvider",{isOpenDelayed:!0,delayDuration:mR,onOpen:()=>{},onClose:()=>{}}),[yR,ad]=_0("Tooltip"),SR=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:a=!1,onOpenChange:u,delayDuration:f}=t,p=gR("Tooltip",e),g=sd(e),[S,m]=se.useState(null),x=YT(),R=se.useRef(0),_=f??p.delayDuration,M=se.useRef(!1),{onOpen:k,onClose:L}=p,[P=!1,O]=vR({prop:i,defaultProp:a,onChange:H=>{H&&(document.dispatchEvent(new CustomEvent("tooltip.open")),k()),u==null||u(H)}}),j=se.useMemo(()=>P?M.current?"delayed-open":"instant-open":"closed",[P]),q=se.useCallback(()=>{window.clearTimeout(R.current),M.current=!1,O(!0)},[O]),ee=se.useCallback(()=>{window.clearTimeout(R.current),R.current=window.setTimeout(()=>{M.current=!0,O(!0)},_)},[_,O]);return se.useEffect(()=>()=>window.clearTimeout(R.current),[]),se.createElement(cR,g,se.createElement(yR,{scope:e,contentId:x,open:P,stateAttribute:j,trigger:S,onTriggerChange:m,onTriggerEnter:se.useCallback(()=>{p.isOpenDelayed?ee():q()},[p.isOpenDelayed,ee,q]),onOpen:se.useCallback(q,[q]),onClose:se.useCallback(()=>{window.clearTimeout(R.current),O(!1),L()},[O,L])},n))},bR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=ad("TooltipTrigger",n),u=sd(n),f=Xf(e,a.onTriggerChange),p=se.useRef(!1),g=se.useCallback(()=>p.current=!1,[]);return se.useEffect(()=>()=>document.removeEventListener("mouseup",g),[g]),se.createElement(fR,di({asChild:!0},u),se.createElement(Dl.button,di({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},i,{ref:f,onMouseEnter:kl(t.onMouseEnter,a.onTriggerEnter),onMouseLeave:kl(t.onMouseLeave,a.onClose),onMouseDown:kl(t.onMouseDown,()=>{a.onClose(),p.current=!0,document.addEventListener("mouseup",g,{once:!0})}),onFocus:kl(t.onFocus,()=>{p.current||a.onOpen()}),onBlur:kl(t.onBlur,a.onClose),onClick:kl(t.onClick,a.onClose)})))}),ER=se.forwardRef((t,e)=>{const{forceMount:n,...i}=t,a=ad("TooltipContent",t.__scopeTooltip);return se.createElement(M0,{present:n||a.open},se.createElement(xR,di({ref:e},i)))}),xR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":a,portalled:u=!0,...f}=t,p=ad("TooltipContent",n),g=sd(n),S=u?XT:se.Fragment,{onClose:m}=p;return pR(()=>m()),se.useEffect(()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m)),[m]),se.createElement(S,null,se.createElement(CR,{__scopeTooltip:n}),se.createElement(dR,di({"data-state":p.stateAttribute},g,f,{ref:e,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),se.createElement(zy,null,i),se.createElement(GT,{id:p.contentId,role:"tooltip"},a||i)))}),wR=se.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=sd(n);return se.createElement(hR,di({},a,i,{ref:e}))});function CR(t){const{__scopeTooltip:e}=t,n=ad("CheckTriggerMoved",e),i=g0(n.trigger),a=i==null?void 0:i.left,u=O0(a),f=i==null?void 0:i.top,p=O0(f),g=n.onClose;return se.useEffect(()=>{(u!==void 0&&u!==a||p!==void 0&&p!==f)&&g()},[g,u,p,a,f]),null}const TR=SR,RR=bR,AR=ER,MR=wR;function OR(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,u;for(u=0;u<i.length;u++)a=i[u],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Ts(t,e){if(t==null)return{};var n=OR(t,e),i,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(a=0;a<u.length;a++)i=u[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}let wi;(function(t){t[t.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",t[t.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",t[t.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",t[t.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",t[t.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",t[t.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",t[t.THEME_ERROR=6]="THEME_ERROR",t[t.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",t[t.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",t[t.EMPTY_KEY=9]="EMPTY_KEY"})(wi||(wi={}));const _R={[wi.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[wi.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[wi.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[wi.DUPLICATE_KEYS]:(t,e,n)=>[`Key \`${t}\` of path \`${e}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[wi.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[wi.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[wi.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[wi.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[wi.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[wi.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function L0(t,e,...n){const[i,...a]=_R[e](...n);console[t]("LEVA: "+i,...a)}const P0=L0.bind(null,"warn");L0.bind(null,"log");function BN(t){return t}function LR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function to(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?D0(Object(n),!0).forEach(function(i){LR(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D0(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const aa=(t,e,n)=>t>n?n:t<e?e:t,PR=t=>{if(t===""||typeof t=="number")return t;try{const e=oa(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},DR=Math.log(10);function k0(t){let e=Math.abs(+String(t).replace(".",""));if(e===0)return .01;for(;e!==0&&e%10===0;)e/=10;const n=Math.floor(Math.log(e)/DR)+1,i=Math.floor(Math.log10(Math.abs(t))),a=Math.pow(10,i-n);return Math.max(a,.001)}const kR=(t,e,n)=>n===e?0:(aa(t,e,n)-e)/(n-e),I0=(t,e,n)=>t*(n-e)+e,N0=/\(([0-9+\-*/^ .]+)\)/,z0=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,U0=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,j0=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,F0=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,B0=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function oa(t){if(isNaN(Number(t)))if(N0.test(t)){const e=t.replace(N0,(n,i)=>String(oa(i)));return oa(e)}else if(z0.test(t)){const e=t.replace(z0,(n,i,a)=>String(Math.pow(Number(i),Number(a))));return oa(e)}else if(U0.test(t)){const e=t.replace(U0,(n,i,a)=>String(Number(i)*Number(a)));return oa(e)}else if(j0.test(t)){const e=t.replace(j0,(n,i,a)=>{if(a!=0)return String(Number(i)/Number(a));throw new Error("Division by zero")});return oa(e)}else if(F0.test(t)){const e=t.replace(F0,(n,i,a)=>String(Number(i)+Number(a)));return oa(e)}else if(B0.test(t)){const e=t.replace(B0,(n,i,a)=>String(Number(i)-Number(a)));return oa(e)}else return Number(t);return Number(t)}let H0;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})(H0||(H0={}));let V0;(function(t){t.SELECT="SELECT",t.IMAGE="IMAGE",t.NUMBER="NUMBER",t.COLOR="COLOR",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.INTERVAL="INTERVAL",t.VECTOR3D="VECTOR3D",t.VECTOR2D="VECTOR2D"})(V0||(V0={}));const IR=t=>t.shiftKey?5:t.altKey?1/5:1,NR=["value"],zR=["min","max"],UR=t=>{if(typeof t=="number")return!0;if(typeof t=="string"){const e=parseFloat(t);return isNaN(e)?!1:t.substring((""+e).length).trim().length<4}return!1},jR=(t,{min:e=-1/0,max:n=1/0,suffix:i})=>{const a=parseFloat(t);if(t===""||isNaN(a))throw Error("Invalid number");const u=aa(a,e,n);return i?u+i:u},FR=(t,{pad:e=0,suffix:n})=>{const i=parseFloat(t).toFixed(e);return n?i+n:i},BR=t=>{let{value:e}=t,n=Ts(t,NR);const{min:i=-1/0,max:a=1/0}=n,u=Ts(n,zR);let f=parseFloat(e);const p=typeof e=="string"?e.substring((""+f).length):void 0;f=aa(f,i,a);let g=n.step;g||(Number.isFinite(i)?Number.isFinite(a)?g=+(Math.abs(a-i)/100).toPrecision(1):g=+(Math.abs(f-i)/100).toPrecision(1):Number.isFinite(a)&&(g=+(Math.abs(a-f)/100).toPrecision(1)));const S=g?k0(g)*10:k0(f);g=g||S/10;const m=Math.round(aa(Math.log10(1/S),0,2));return{value:p?f+p:f,settings:to({initialValue:f,step:g,pad:m,min:i,max:a,suffix:p},u)}},$0=(t,{step:e,initialValue:n})=>{const i=Math.round((t-n)/e);return n+i*e};var HR=Object.freeze({__proto__:null,schema:UR,sanitize:jR,format:FR,normalize:BR,sanitizeStep:$0});function er(){return er=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},er.apply(this,arguments)}const VR=T.createContext({});function Rs(){return T.useContext(VR)}const $R=T.createContext(null);T.createContext(null);const WR=T.createContext(null);function qR(){return T.useContext(WR)}const YR=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function od(t,e){const[n,i]=t.split(" "),a={};return n!=="none"&&(a.boxShadow=`${e.inset?"inset ":""}0 0 0 $borderWidths${[e.key]} $colors${n!=="default"&&n||e.borderColor}`),i&&(a.backgroundColor=i),a}const oc={$inputStyle:()=>t=>od(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>od(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>od(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>od(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:Ut,css:HN,createTheme:VN,globalCss:QR,keyframes:$N}=KC({prefix:"leva",theme:YR(),utils:to(to({},oc),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:t=>({"&:focus":oc.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":oc.$focusStyle()(t)}),$hover:t=>({"&:hover":oc.$hoverStyle()(t)}),$active:t=>({"&:active":oc.$activeStyle()(t)})})});QR({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function GR(t,e){const{theme:n}=T.useContext($R);if(!(t in n)||!(e in n[t]))return P0(wi.THEME_ERROR,t,e),"";let i=e;for(;;){let a=n[t][i];if(typeof a=="string"&&a.charAt(0)==="$")i=a.substr(1);else return a}}const W0=Ut("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),q0=Ut("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${W0}`]:{paddingLeft:0}}),XR=Ut(q0,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),KR=Ut("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),ZR=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],JR=["onUpdate"];function Y0(t){let{innerLabel:e,value:n,onUpdate:i,onChange:a,onKeyDown:u,type:f,id:p,inputType:g="text",rows:S=0}=t,m=Ts(t,ZR);const{id:x,emitOnEditStart:R,emitOnEditEnd:_,disabled:M}=Rs(),k=p||x,L=T.useRef(null),P=S>0,O=P?"textarea":"input",j=T.useCallback(H=>Z=>{const ie=Z.currentTarget.value;H(ie)},[]);T.useEffect(()=>{const H=L.current,Z=j(ie=>{i(ie),_()});return H==null||H.addEventListener("blur",Z),()=>H==null?void 0:H.removeEventListener("blur",Z)},[j,i,_]);const q=T.useCallback(H=>{H.key==="Enter"&&j(i)(H)},[j,i]),ee=Object.assign({as:O},P?{rows:S}:{},m);return T.createElement(KR,{textArea:P},e&&typeof e=="string"?T.createElement(q0,null,e):e,T.createElement(W0,er({levaType:f,ref:L,id:k,type:g,autoComplete:"off",spellCheck:"false",value:n,onChange:j(a),onFocus:()=>R(),onKeyPress:q,onKeyDown:u,disabled:M},ee)))}function eA(t){let{onUpdate:e}=t,n=Ts(t,JR);const i=T.useCallback(u=>e(PR(u)),[e]),a=T.useCallback(u=>{const f=u.key==="ArrowUp"?1:u.key==="ArrowDown"?-1:0;if(f){u.preventDefault();const p=u.altKey?.1:u.shiftKey?10:1;e(g=>parseFloat(g)+f*p)}},[e]);return T.createElement(Y0,er({},n,{onUpdate:i,onKeyDown:a,type:"number"}))}const Yp=Ut("div",{}),Q0=Ut("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]});Ut("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & + ${Q0}::after`]:{opacity:.6},[`${Yp}:hover > & > svg`]:{opacity:1}});const tA=Ut("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${Yp}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),G0=Ut("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${tA} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),nA=Ut(G0,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),iA=Ut("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),rA=Ut("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Qp=Ut("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}});Ut("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Qp}`]:{pointerEvents:"auto"}}}}}),Ut("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"});const sA=Ut("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),aA=Ut(MR,{fill:"$toolTipBackground"}),oA=["align"];function lA(){const{id:t,disable:e,disabled:n}=Rs();return T.createElement(T.Fragment,null,T.createElement(rA,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),T.createElement("label",{htmlFor:t+"__disable"}))}function uA(t){const{id:e,optional:n,hint:i}=Rs(),a=t.htmlFor||(e?{htmlFor:e}:null),u=!i&&typeof t.children=="string"?{title:t.children}:null;return T.createElement(T.Fragment,null,n&&T.createElement(lA,null),i!==void 0?T.createElement(TR,null,T.createElement(RR,{asChild:!0},T.createElement(Qp,er({},a,t))),T.createElement(AR,{side:"top",sideOffset:2},T.createElement(sA,null,i,T.createElement(aA,null)))):T.createElement(Qp,er({},a,u,t)))}function ld(t){let{align:e}=t,n=Ts(t,oA);const{value:i,label:a,key:u,disabled:f}=Rs(),{hideCopyButton:p}=qR(),g=!p&&u!==void 0,[S,m]=T.useState(!1),x=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[u]:i??""})),m(!0)}catch{P0(wi.CLIPBOARD_ERROR,{[u]:i})}};return T.createElement(iA,{align:e,onPointerLeave:()=>m(!1)},T.createElement(uA,n),g&&!f&&T.createElement("div",{title:`Click to copy ${typeof a=="string"?a:u} value`},S?T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},T.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),T.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):T.createElement("svg",{onClick:x,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},T.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),T.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const cA=["toggled"],fA=Ut("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function dA(t){let{toggled:e}=t,n=Ts(t,cA);return T.createElement(fA,er({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e?0:-90}deg)`}},n),T.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const hA=["input"];function ud(t){let{input:e}=t,n=Ts(t,hA);return e?T.createElement(nA,n):T.createElement(G0,n)}function X0(t,e){const{emitOnEditStart:n,emitOnEditEnd:i}=Rs();return $T(a=>{a.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const u=t(a);return a.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),u},e)}const pA=Ut("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),vA=Ut("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),mA=Ut("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),gA=Ut("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),yA=Ut("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function SA({value:t,min:e,max:n,onDrag:i,step:a,initialValue:u}){const f=T.useRef(null),p=T.useRef(null),g=T.useRef(0),S=GR("sizes","scrubberWidth"),m=X0(({event:R,first:_,xy:[M],movement:[k],memo:L})=>{if(_){const{width:O,left:j}=f.current.getBoundingClientRect();g.current=O-parseFloat(S),L=(R==null?void 0:R.target)===p.current?t:I0((M-j)/O,e,n)}const P=L+I0(k/g.current,0,n-e);return i($0(P,{step:a,initialValue:u})),L}),x=kR(t,e,n);return T.createElement(gA,er({ref:f},m()),T.createElement(vA,null,T.createElement(yA,{style:{left:0,right:`${(1-x)*100}%`}})),T.createElement(mA,{ref:p,style:{left:`calc(${x} * (100% - ${S}))`}}))}const bA=T.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:i})=>{const[a,u]=T.useState(!1),f=X0(({active:p,delta:[g],event:S,memo:m=0})=>(u(p),m+=g/2,Math.abs(m)>=1&&(e(x=>parseFloat(x)+Math.floor(m)*n*IR(S)),m=0),m));return T.createElement(XR,er({dragging:a,title:t.length>1?t:""},f()),t.slice(0,i))});function EA({label:t,id:e,displayValue:n,onUpdate:i,onChange:a,settings:u,innerLabelTrim:f=1}){const p=f>0&&T.createElement(bA,{label:t,step:u.step,onUpdate:i,innerLabelTrim:f});return T.createElement(eA,{id:e,value:String(n),onUpdate:i,onChange:a,innerLabel:p})}function xA(){const t=Rs(),{label:e,value:n,onUpdate:i,settings:a,id:u}=t,{min:f,max:p}=a,g=p!==1/0&&f!==-1/0;return T.createElement(ud,{input:!0},T.createElement(ld,null,e),T.createElement(pA,{hasRange:g},g&&T.createElement(SA,er({value:parseFloat(n),onDrag:i},a)),T.createElement(EA,er({},t,{id:u,label:"value",innerLabelTrim:g?0:1}))))}const wA=Ts(HR,["sanitizeStep"]);to({component:xA},wA);var CA=Object.freeze({__proto__:null,schema:(t,e)=>sa().schema({options:sa().passesAnyOf(sa().object(),sa().array())}).test(e),sanitize:(t,{values:e})=>{if(e.indexOf(t)<0)throw Error("Selected value doesn't match Select options");return t},format:(t,{values:e})=>e.indexOf(t),normalize:t=>{let{value:e,options:n}=t,i,a;return Array.isArray(n)?(a=n,i=n.map(u=>String(u))):(a=Object.values(n),i=Object.keys(n)),"value"in t?a.includes(e)||(i.unshift(String(e)),a.unshift(e)):e=a[0],Object.values(n).includes(e)||(n[String(e)]=e),{value:e,settings:{keys:i,values:a}}}});const TA=Ut("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Gp=Ut("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),RA=Ut("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Gp}:focus + &`]:{$focusStyle:""},[`${Gp}:hover + &`]:{$hoverStyle:""}});function AA({displayValue:t,value:e,onUpdate:n,id:i,settings:a,disabled:u}){const{keys:f,values:p}=a,g=T.useRef();return e===p[t]&&(g.current=f[t]),T.createElement(TA,null,T.createElement(Gp,{id:i,value:t,onChange:S=>n(p[Number(S.currentTarget.value)]),disabled:u},f.map((S,m)=>T.createElement("option",{key:S,value:m},S))),T.createElement(RA,null,g.current),T.createElement(dA,{toggled:!0}))}function MA(){const{label:t,value:e,displayValue:n,onUpdate:i,id:a,disabled:u,settings:f}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(AA,{id:a,value:e,displayValue:n,onUpdate:i,settings:f,disabled:u}))}to({component:MA},CA);var OA=Object.freeze({__proto__:null,schema:t=>sa().string().test(t),sanitize:t=>{if(typeof t!="string")throw Error("Invalid string");return t},normalize:({value:t,editable:e=!0,rows:n=!1})=>({value:t,settings:{editable:e,rows:typeof n=="number"?n:n?5:0}})});const _A=["displayValue","onUpdate","onChange","editable"],LA=Ut("div",{whiteSpace:"pre-wrap"});function PA(t){let{displayValue:e,onUpdate:n,onChange:i,editable:a=!0}=t,u=Ts(t,_A);return a?T.createElement(Y0,er({value:e,onUpdate:n,onChange:i},u)):T.createElement(LA,null,e)}function DA(){const{label:t,settings:e,displayValue:n,onUpdate:i,onChange:a}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(PA,er({displayValue:n,onUpdate:i,onChange:a},e)))}to({component:DA},OA);var kA=Object.freeze({__proto__:null,schema:t=>sa().boolean().test(t),sanitize:t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t}});const IA=Ut("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function NA({value:t,onUpdate:e,id:n,disabled:i}){return T.createElement(IA,null,T.createElement("input",{id:n,type:"checkbox",checked:t,onChange:a=>e(a.currentTarget.checked),disabled:i}),T.createElement("label",{htmlFor:n},T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function zA(){const{label:t,value:e,onUpdate:n,disabled:i,id:a}=Rs();return T.createElement(ud,{input:!0},T.createElement(ld,null,t),T.createElement(NA,{value:e,onUpdate:n,id:a,disabled:i}))}to({component:zA},kA),Ut("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});class no extends Gr{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.format="jpg",this.tileUrl=yC(e.url),this.id=e.id||`${this.tileUrl}--${e.scaleFactor}`,this.points=e.displayPoints?e.displayPoints:ws(e.points,ra(e.scaleFactor)),this.tileWidth=e.tileWidth,this.display={x:0,y:0,width:e.width/e.scaleFactor,height:e.height/e.scaleFactor,points:e.points,scale:e.scaleFactor},e.format&&(this.format=e.format)}applyProps(e){if(e.style&&typeof e.style.opacity<"u"&&(this.style.opacity=e.style.opacity),e.service!==this.service&&(this.service=e.service),e.format?this.format=e.format:this.format="jpg",e.crop){this.cropData=e.crop;const n=qe([...this.points]),i=n.length/5,a=e.crop.x||0,u=e.crop.y||0,f=e.crop.x+e.crop.width,p=e.crop.y+e.crop.height;for(let g=0;g<i;g++){const S=g*5;n[S+1]<f&&n[S+3]>a&&n[S+2]<p&&n[S+4]>u?(n[S+1]=aa(n[S+1],a,f),n[S+3]=aa(n[S+3],a,f),n[S+2]=aa(n[S+2],u,p),n[S+4]=aa(n[S+4],u,p)):n[S]=0}Qr(n,Ei(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(n):this.crop=n}}static fromTile(e,n,i,a,u,f){i.height=i.height?i.height:i.width;const p=Math.ceil(n.width/a),g=Math.ceil(n.height/a),S=Math.ceil(p/i.width),m=Math.ceil(g/i.height),x=Tt.grid(S,m),R=Tt.grid(S,m);for(let M=0;M<m;M++)for(let k=0;k<S;k++){const L=k*i.width,P=M*i.height;R.addPoints(L*a,P*a,k===S-1?n.width:(L+i.width)*a,M===m-1?n.height:(P+i.height)*a),x.addPoints(L,P,k===S-1?p:L+i.width,M===m-1?g:P+i.height)}const _=new no({url:e,scaleFactor:a,points:x.build(),displayPoints:R.build(),width:n.width,height:n.height,tileWidth:i.width,format:f});return _.applyProps({service:u}),_}getImageUrl(e){const n=this.points.slice(e*5,e*5+5),i=n[3]-n[1],a=n[4]-n[2],u=Math.ceil(i/this.display.scale);return`${this.tileUrl}/${n[1]},${n[2]},${i},${a}/${u>this.tileWidth?this.tileWidth:u},/0/default.${this.format||"jpg"}`}getAllPointsAt(e,n,i){const a=ec(this.crop||this.points,e);return[[this,a,n]]}transform(e){Qr(this.points,e)}getScheduledUpdates(e,n){return[]}}class UA extends Gr{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}class jA extends UA{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=qe(9),this.isFullyLoaded=!1,this.maxScaleFactor=0,this._scheduleSortByScales=!1,this._sortByScales=()=>{this._scheduleSortByScales=!1,this.allImages.sort((i,a)=>a.display.width-i.display.width),this.images=[];let n=.1;for(const i of this.allImages){if(i.display.width<this.renderOptions.minSize&&i.display.height<this.renderOptions.minSize&&!i.priority||i instanceof Ar&&(i.display.width>this.renderOptions.maxImageSize||i.display.height>this.renderOptions.maxImageSize)&&!i.priority)continue;if(Math.abs(i.display.scale-n)<.25||i.priority){const u=this.images.pop();u&&(u instanceof Ar||u.priority)?(i.priority&&this.images.push(i),this.images.push(u)):i&&this.images.push(i)}else i&&this.images.push(i);n=i.display.scale}this.images.length===0&&(this.images=[...this.allImages]),this.scaleFactors=this.images.map(i=>i.display.scale),this.maxScaleFactor=Math.max(...this.scaleFactors)},this.loadFullResource=async()=>{if(!this.isFullyLoaded&&this.lazyLoader){this.isFullyLoaded=!0;const n=await this.lazyLoader();this.addImages(n)}},this.fallback=[this.loadFullResource],this.id=e.id,this.points=Tt.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={x:0,y:0,points:Tt.singleBox(e.width,e.height),height:e.height,width:e.width,scale:1},this.renderOptions={renderSmallestFallback:!0,renderLayers:3,minSize:255,maxImageSize:1024,quality:1.2,...e.renderOptions||{}},this.addImages(e.images)}applyProps(e){typeof e.renderSmallestFallback<"u"&&e.renderSmallestFallback!==this.renderOptions.renderSmallestFallback&&(this.renderOptions.renderSmallestFallback=e.renderSmallestFallback),typeof e.renderLayers<"u"&&e.renderLayers!==this.renderOptions.renderLayers&&(this.renderOptions.renderLayers=e.renderLayers),typeof e.minSize<"u"&&e.minSize!==this.renderOptions.minSize&&(this.renderOptions.minSize=e.minSize),typeof e.maxImageSize<"u"&&e.maxImageSize!==this.renderOptions.maxImageSize&&(this.renderOptions.maxImageSize=e.maxImageSize),typeof e.quality<"u"&&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(n=>n!==e),this.sortByScales())}insertBefore(e,n){this.addImages([e])}hideInstance(){}addImages(e){for(const n of e)n.__parent=this,n.__owner=this.__owner;this.allImages.push(...e.filter(Boolean)),this.sortByScales()}sortByScales(){this._scheduleSortByScales=!0}getScheduledUpdates(e,n){return this._scheduleSortByScales?[this._sortByScales]:this.isFullyLoaded?[]:n>1/this.maxScaleFactor?this.fallback:[]}getAllPointsAt(e,n,i){if(this.images.length===0)return[];const a=gC(1/(i||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),u=this.images.length,f=n?xs(n,Ei(this.x,this.y)):Ei(this.x,this.y);if(a!==this.images.length-1&&this.images[a+1]){let p=[];for(let m=u-1;m>=a;m--)p.push(m);const g=p[0];this.renderOptions.renderLayers&&(p=p.slice(-this.renderOptions.renderLayers)),this.renderOptions.renderSmallestFallback&&p.indexOf(g)===-1&&p.unshift(g);const S=[];for(let m=0;m<p.length;m++)S.push(...this.images[p[m]].getAllPointsAt(e,f,i));return S}return this.images[a].getAllPointsAt(e,f,i)}}function cd(t,e,n,i,a){const u=Math.PI/180*a,f=Math.cos(u),p=Math.sin(u),g=f*(n-t)+p*(i-e)+t,S=f*(i-e)-p*(n-t)+e;return[g,S]}class lc extends Gr{constructor(e,n){super(),this.type="world-object",this.intersectionBuffer=qe(5),this.aggregateBuffer=qe(9),this.invertedBuffer=qe(9),this.rotation=0,this._updatedList=[];const{x:i=0,y:a=0}=n||{};e?(this.id=e.id||"",this.scale=1,this.layers=e.layers,this.points=qe([1,i,a,i+e.width,a+e.height]),this.worldPoints=qe([1,i,a,i+e.width,a+e.height]),this.filteredPointsBuffer=qe(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=qe(5),this.worldPoints=qe(5),this.filteredPointsBuffer=qe(5))}static createWithProps(e){const n=new lc;return n.applyProps(e),n}applyProps(e){const n=e.x||0,i=e.y||0;this.id=e.id;const a=typeof e.scale<"u"?e.scale:this.scale;this.points[0]=1,this.points[1]=n,this.points[2]=i,this.points[3]=n+e.width,this.points[4]=i+e.height,this.rotation=e.rotation||0,this.worldPoints[3]=this.worldPoints[1]+e.width,this.worldPoints[4]=this.worldPoints[2]+e.height,e.scale&&e.scale!==1&&this.atScale(a),this.scale=a}appendChild(e){e.points[0]===0&&e.points.set(this.points),e.__owner.value=this,this.addLayers([e])}removeChild(e){this.layers=this.layers.filter(n=>n!==e),this.filteredPointsBuffer=qe(this.layers.length*5)}insertBefore(e,n){const i=this.layers.indexOf(n);if(i===-1||this.layers.indexOf(e)!==-1)return;const a=this.layers.slice(0,i),u=this.layers.slice(i);this.layers=[...a,e,...u]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,n){if(this.rotation&&(e=this.applyRotation(e)),ec(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const a=this.layers.length,u=[];for(let f=0;f<a;f++){const p=this.layers[f];if(n&&p.isShape){const S=ws(p.points,Ei(this.x,this.y));if(!p.intersects([e[1]-S[1],e[2]-S[2]]))continue}if(ec(ws(p.points,Ei(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&u.push(p),n){const S=p;u.push(...S.getObjectsAt(e,n))}}return u}applyRotation(e){if(this.rotation){const n={x:e[1],y:e[2]},i={x:e[1],y:e[4]},a={x:e[3],y:e[2]},u={x:e[3],y:e[4]},f=this.points[1]+(this.points[3]-this.points[1])/2,p=this.points[2]+(this.points[4]-this.points[2])/2,[g,S]=cd(f,p,n.x,n.y,this.rotation),[m,x]=cd(f,p,i.x,i.y,this.rotation),[R,_]=cd(f,p,a.x,a.y,this.rotation),[M,k]=cd(f,p,u.x,u.y,this.rotation),L=Math.min(g,m,R,M),P=Math.max(g,m,R,M),O=Math.min(S,x,_,k),j=Math.max(S,x,_,k);return qe([e[0],L,O,P,j])}return e}getAllPointsAt(e,n,i){const a=xs(Ei(this.x,this.y),ra(this.scale),this.aggregateBuffer);this.rotation&&(e=this.applyRotation(e));const u=vC(e,this.points,this.intersectionBuffer),f=this.layers.length,p=[],g=ws(u,xs(ra(1/this.scale),Ei(-this.x,-this.y),this.invertedBuffer)),S=n?xs(n,a,this.aggregateBuffer):a,m=i*this.scale;for(let x=0;x<f;x++)p.push(...this.layers[x].getAllPointsAt(g,S,m));return p}addLayers(e){const n=[];for(const i of e)this.layers.indexOf(i)===-1&&(n.push(i),i.points.length===5&&(i.points[1]<this.worldPoints[1]/this.scale||i.points[2]<this.worldPoints[2]/this.scale||i.points[3]>this.worldPoints[3]/this.scale||i.points[4]>this.worldPoints[4]/this.scale)&&(i.crop=i.crop||qe([1,Math.max(this.worldPoints[1]/this.scale,i.points[1]),Math.max(this.worldPoints[2]/this.scale,i.points[2]),Math.min(this.worldPoints[3]/this.scale,i.points[3]),Math.min(this.worldPoints[4]/this.scale,i.points[4])])));this.layers=this.layers.concat(n),this.filteredPointsBuffer=qe(this.layers.length*5)}getScheduledUpdates(e,n){const i=this.layers.length;this._updatedList=[];const a=n*this.scale;for(let u=0;u<i;u++){const f=this.layers[u].getScheduledUpdates(e,a);f&&this._updatedList.push(...f)}return this._updatedList}}class Il extends Gr{constructor(e=0,n=0,i=100,a="left-to-right"){super(),this.id="world",this.aggregateBuffer=qe(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=qe(9),this.needsRecalculate=!0,this.emptyPaintables=[],this.renderOrder=[],this.objects=[],this.subscriptions=[],this._propagateEventTargets=[],this._alreadyFlushed=[],this._width=e,this._height=n,this.aspectRatio=Number.isNaN(e/n)?1:e/n,this.viewingDirection=a,this.points=qe(i*5),this.filteredPointsBuffer=qe(i*5)}get x(){return 0}get y(){return 0}get width(){return this._width}get height(){return this._height}static withProps(e){const n=new Il;return n.applyProps(e),n}applyProps(e){typeof e.width<"u"&&typeof e.height<"u"&&(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,n,i){const a=[];for(const u of i)if(u.x&&u.y){const f=Tt.singleBox(1,1,u.x,u.y);a.push(this.getObjectsAt(f,!0).reverse())}return a.map(u=>this.propagateEvent(e,n,u,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,n,i,a,u={}){const f=Tt.singleBox(1,1,i,a),p=this.getObjectsAt(f,!0).reverse();return this.propagateEvent(e,n,p,u)}propagateEvent(e,n,i,{bubbles:a=!1,cancelable:u=!1}={}){n.atlasTarget=this,this._propagateEventTargets.length=1,this._propagateEventTargets[0]=this;let f=!1;n.stopPropagation=()=>{f=!0};const p=i.length;for(let m=p-1;m>=0;m--){this._propagateEventTargets.unshift(i[m][0]);const x=i[m][1].length;if(x)for(let R=0;R<x;R++)this._propagateEventTargets.unshift(i[m][1][R])}const g=this._propagateEventTargets.length;let S=!1;for(let m=0;m<g&&(n.atlasTarget=this._propagateEventTargets[m],n.atlasWorld=this,S=this._propagateEventTargets[m].dispatchEvent(e,n)||S,!f);m++);return S&&this.triggerRepaint(),this._propagateEventTargets}appendChild(e){const n=this.appendWorldObject(e);this.renderOrder.push(n/5)}removeChild(e){const n=this.objects.indexOf(e);if(n===-1){for(const i of this.objects)if(i&&i.id===e.id){this.removeChild(i);return}return}this.objects[n]=null,this.renderOrder=this.renderOrder.filter(i=>i!==n),this.points[n*5]=0,this.triggerRepaint(),this.needsRecalculate=!0}insertBefore(e,n){const i=this.objects.indexOf(n);if(i===-1)return;const a=this.appendWorldObject(e);this.renderOrder.splice(i-1,0,a/5)}hideInstance(){}asWorldObject(){return null}addZone(e){this.zones.push(e)}selectZone(e){if(typeof e=="string"){const n=this.zones.length;for(let i=0;i<n;i++)if(this.zones[i].id===e){this.selectedZone=i,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<"u"}checkResizeInternalBuffer(){if(mC(this.points)===this.objects.length){const e=this.points,n=qe(this.points.length*2);n.set(e,0),this.points=n}}appendWorldObject(e){this.checkResizeInternalBuffer();const n=this.objects.length*5,i=e.points;return e.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),e.points[1]=i[1],e.points[2]=i[2],e.points[3]=i[3],e.points[4]=i[4],this.objects.push(e),this.filteredPointsBuffer=qe(this.objects.length*5),this.needsRecalculate=!0,this.triggerRepaint(),n}recalculateWorldSize(){let e=!1;if(this.needsRecalculate){const n=new Int32Array(this.objects.length),i=new Int32Array(this.objects.length),a=this.renderOrder.length;for(let p=0;p<a;p++){const g=this.renderOrder[p];this.objects[g]&&(n[p]=this.points[g*5+3],i[p]=this.points[g*5+4])}const u=Math.max(...n);u!==this._width&&(this._width=u,e=!0);const f=Math.max(...i);f!==this._height&&(this._height=f,e=!0),e&&this.trigger("recalculate-world-size",{width:u,height:f}),this.needsRecalculate=!1}return e}addObjectAt(e,n){n.width&&!n.height?n.height=n.width/e.width*e.height:n.height&&!n.width&&(n.width=n.height/e.height*e.width),(!n||!n.width||!n.height)&&(n.width=e.width,n.height=e.height);const{width:i,x:a,y:u}=n,f=i/e.width;this.checkResizeInternalBuffer(),this.points.set(Tt.singleBox(e.width,e.height,0,0),this.objects.length*5);const p=new lc(e);return p.points=this.points.subarray(this.objects.length*5,this.objects.length*5+5),this.objects.push(p),this.scaleWorldObject(this.objects.length-1,f),this.translateWorldObject(this.objects.length-1,a,u),this.filteredPointsBuffer=qe(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,p}scaleWorldObject(e,n){Qr(this.points.subarray(e*5,e*5+5),tc(n,this.points[e*5+1],this.points[e*5+2]));const i=this.objects[e];i&&(i.atScale(n),this.triggerRepaint())}translateWorldObject(e,n,i){Qr(this.points.subarray(e*5,e*5+5),Ei(n,i));const a=this.objects[e];a&&(a.translate(n,i),this.triggerRepaint())}resize(e,n){return this._width=e,this._height=n,this.aspectRatio=e/n,this.triggerRepaint(),this}getObjects(){return this.objects}getPoints(){return this.points}getPointsFromViewer(e,n){const i=Tt.singleBox(e.width,e.height,e.x,e.y);return this.getPointsAt(i,n,e.scale)}addLayoutSubscriber(e){return this.subscriptions.push(e),()=>{this.subscriptions.splice(this.subscriptions.indexOf(e),1)}}getScheduledUpdates(e,n){const i=ec(this.points,e,this.filteredPointsBuffer),a=this.objects.length;this._updatedList=[];for(let u=0;u<a;u++)if(i[u*5]!==0){if(!this.objects[u])continue;this._updatedList.push(...this.objects[u].getScheduledUpdates(e,n))}return this._updatedList}getObjectsAt(e,n=!1){const i=this.getActiveZone(),a=ec(this.points,e,this.filteredPointsBuffer),u=this.renderOrder.length,f=[];for(let p=0;p<u;p++){const g=this.renderOrder[p];if(a[g*5]!==0){const S=this.objects[g];if(!S||i&&i.objects.indexOf(S)===-1)continue;if(S.type!=="world-object"){f.push([S,[S]]);continue}n?f.push([S,S.getObjectsAt(e,n)]):f.push([S,this.emptyPaintables])}}return f}getPointsAt(e,n,i=1){const a=this.getObjectsAt(e),u=xs(ra(i),Ei(-e[1],-e[2]),this.translationBuffer),f=n?xs(n,u,this.aggregateBuffer):u,p=a.length,g=[];for(let S=0;S<p;S++)a[S]&&g.push(...a[S][0].getAllPointsAt(e,f,i));return g}flushSubscriptions(){if(this.triggerQueue.length){this._alreadyFlushed=[];const e=this.triggerQueue.length;for(let n=0;n<e;n++){if(this._alreadyFlushed.indexOf(this.triggerQueue[n][0])!==-1)continue;typeof this.triggerQueue[n][1]>"u"&&this._alreadyFlushed.push(this.triggerQueue[n][0]);const i=this.subscriptions.length;for(let a=0;a<i;a++)this.subscriptions[a].apply(null,this.triggerQueue[n])}this.triggerQueue=[]}}trigger(e,n){this.triggerQueue.push([e,n])}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,n,i){this.trigger("zoom-to",{point:n,factor:e,stream:i})}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 fd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,dd={},FA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class uc extends Gr{constructor(){super(),this.type="spacial-content",this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(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=Qf(12),this.points=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=dd[i]||fd.exec(i)||fd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=dd[i]=a)}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 a=dd[e.style.outline]||fd.exec(e.style.outline)||fd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=dd[e.style.outline]=a)}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,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of FA)if(this.props.style[a]!==e.style[a]){n=!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)),n=!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)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!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)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!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])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.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),n&&this.__revision++}}class hd extends Gr{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={x:0,y:0,scale:1,width:100,height:100,points:qe(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=qe(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps({id:e,target:n,text:i,color:a,backgroundColor:u,fontSize:f=18,interactive:p,fontFamily:g="Arial, sans-serif",...S}){S.font=`${f}px ${g}`,this.interactive=p||!1,typeof i<"u"&&(this.text=i||""),a&&(this.color=a),u&&(this.backgroundColor=u),e&&(this.id=e),n&&(this.points=Tt.singleBox(n.width,n.height,n.x,n.y),this.display.points=this.points,this.display.width=n.width,this.display.height=n.height),this.props={...this.props,...S},this.__revision++}}const mn=Math.pow,pd=Math.sqrt,cc=Math.sin,K0=Math.cos,fc=Math.PI,vd=1.70158,md=vd*1.525,Z0=vd+1,J0=2*fc/3,e1=2*fc/4.5,gd=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},la={linear:t=>t,easeInQuad:function(t){return t*t},easeOutQuad:function(t){return 1-(1-t)*(1-t)},easeInOutQuad:function(t){return t<.5?2*t*t:1-mn(-2*t+2,2)/2},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1-mn(1-t,3)},easeInOutCubic:function(t){return t<.5?4*t*t*t:1-mn(-2*t+2,3)/2},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1-mn(1-t,4)},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-mn(-2*t+2,4)/2},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1-mn(1-t,5)},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1-mn(-2*t+2,5)/2},easeInSine:function(t){return 1-K0(t*fc/2)},easeOutSine:function(t){return cc(t*fc/2)},easeInOutSine:function(t){return-(K0(fc*t)-1)/2},easeInExpo:function(t){return t===0?0:mn(2,10*t-10)},easeOutExpo:function(t){return t===1?1:1-mn(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?mn(2,20*t-10)/2:(2-mn(2,-20*t+10))/2},easeInCirc:function(t){return 1-pd(1-mn(t,2))},easeOutCirc:function(t){return pd(1-mn(t-1,2))},easeInOutCirc:function(t){return t<.5?(1-pd(1-mn(2*t,2)))/2:(pd(1-mn(-2*t+2,2))+1)/2},easeInBack:function(t){return Z0*t*t*t-vd*t*t},easeOutBack:function(t){return 1+Z0*mn(t-1,3)+vd*mn(t-1,2)},easeInOutBack:function(t){return t<.5?mn(2*t,2)*((md+1)*2*t-md)/2:(mn(2*t-2,2)*((md+1)*(t*2-2)+md)+2)/2},easeInElastic:function(t){return t===0?0:t===1?1:-mn(2,10*t-10)*cc((t*10-10.75)*J0)},easeOutElastic:function(t){return t===0?0:t===1?1:mn(2,-10*t)*cc((t*10-.75)*J0)+1},easeInOutElastic:function(t){return t===0?0:t===1?1:t<.5?-(mn(2,20*t-10)*cc((20*t-11.125)*e1))/2:mn(2,-20*t+10)*cc((20*t-11.125)*e1)/2+1},easeInBounce:function(t){return 1-gd(1-t)},easeOutBounce:gd,easeInOutBounce:function(t){return t<.5?(1-gd(1-2*t))/2:(1+gd(2*t-1))/2}};class BA{constructor(e){this.runtime=e,this.pendingTransition={from:qe(5),to:qe(5),elapsed_time:0,done:!0,total_time:0,timingFunction:la.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=qe(this.runtime.target),this.pendingTransition.to=qe(this.runtime.target),this.pendingTransition.done=!0,this.pendingTransition.elapsed_time=0,this.pendingTransition.total_time=0}runTransition(e,n){if(!this.pendingTransition.done){const i=this.pendingTransition,a=i.total_time===0?0:(i.elapsed_time+n)/i.total_time,u=i.total_time===0?1:a===0?0:i.timingFunction(a);e[1]=i.from[1]+(i.to[1]-i.from[1])*u,e[2]=i.from[2]+(i.to[2]-i.from[2])*u,e[3]=i.from[3]+(i.to[3]-i.from[3])*u,e[4]=i.from[4]+(i.to[4]-i.from[4])*u,this.pendingTransition.elapsed_time+=n,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:la.easeOutExpo}}))}}zoomTo(e,{origin:n,stream:i=!1,transition:a}={}){const u=this.runtime.getZoomedPosition(e,{origin:n}),f=Math.abs(1-e);this.applyTransition(u,a,{duration:2e3*f,easing:la.easeOutExpo,constrain:!0},{stream:!1})}constrainBounds({transition:e,panPadding:n=0}={}){const[i,a]=this.runtime.constrainBounds(this.runtime.target,{panPadding:n});i&&(this.applyTransition(a,e,{duration:500,easing:la.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,n,i,{stream:a}={}){this.pendingTransition.from=qe(this.runtime.target),this.pendingTransition.to=e,a||(this.pendingTransition.elapsed_time=0),this.pendingTransition.done=!1,this.pendingTransition.total_time=typeof(n==null?void 0:n.duration)<"u"?n.duration:typeof(i==null?void 0:i.duration)<"u"?i.duration:1e3,this.pendingTransition.constrain=typeof(n==null?void 0:n.constrain)<"u"?n.constrain:typeof(i==null?void 0:i.constrain)<"u"?i.constrain:!1,this.pendingTransition.timingFunction=(n==null?void 0:n.easing)||(i==null?void 0:i.easing)||la.easeInOutSine}goToRegion(e,{transition:n}={}){const i=this.runtime.clampRegion(e);this.applyTransition(Tt.singleBox(i.width,i.height,i.x,i.y),n,{duration:1e3,easing:la.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class yd{constructor(e,n,i,a=[],u){this.id=Qf(),this.ready=!1,this.transformBuffer=qe(500),this.lastTarget=qe(5),this.zoomBuffer=qe(5),this.logNextRender=!1,this.pendingUpdate=!0,this.isCommitting=!1,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=f=>{const p=typeof f.x>"u"?this.target[1]:f.x,g=typeof f.y>"u"?this.target[2]:f.y;f.width?this.target[3]=p+f.width:this.target[3]=this.target[3]-this.target[1]+p,f.height?this.target[4]=g+f.height:this.target[4]=this.target[4]-this.target[2]+g,Math.abs(this.target[1]-p)>.01&&(this.target[1]=p),Math.abs(this.target[2]-g)>.01&&(this.target[2]=g),this.pendingUpdate=!0},this.render=f=>{const p=f-this.lastTime;if(this.isCommitting||this.fpsLimit&&p<1e3/this.fpsLimit){this.stopId=window.requestAnimationFrame(this.render);return}this.lastTime=f,this.world.flushSubscriptions(),this.stopId=window.requestAnimationFrame(this.render),this.hook("useFrame",p);const g=this.pendingUpdate,S=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,p),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!S&&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",p),this.renderer.beforeFrame(this.world,p,this.target);const m=this.getScaleFactor(),x=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),R=x.length;for(let k=0;k<R;k++){const L=x[k][0],P=x[k][1],O=x[k][2],j=O?ws(P,O,this.transformBuffer):P;this.renderer.prepareLayer(L,L.__parent&&O?ws(L.__parent.crop||L.__parent.points,O):j);const q=j.length/5;for(let ee=0;ee<q;ee++){const H=ee*5;j[H]!==0&&(this.renderer.paint(L,ee,j[H+1],j[H+2],j[H+3]-j[H+1],j[H+4]-j[H+2]),this.hook("useAfterPaint",L))}this.renderer.finishLayer(L,P)}this.renderer.afterFrame(this.world,p,this.target),this.hook("useAfterFrame",p),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 _=this.world.getScheduledUpdates(this.target,m),M=_.length;if(M>0)for(let k=0;k<M;k++){const L=_[M-k-1]();L?L.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=n,this.options={maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5,...u||{}},this.target=Tt.projection(i),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=Tt.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new BA(this),this.aggregate=ra(1),this.world.addLayoutSubscriber(f=>{f==="repaint"&&(this.pendingUpdate=!0),f==="recalculate-world-size"&&(this.manualHomePosition||(this.setHomePosition(),this.goHome()),this.updateFocalPosition())}),this.lastTime=performance.now(),this.controllers=a,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(Tt.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()}setOptions(e){this.options={...this.options,...e}}goHome(e={}){if(this.world.width<=0||this.world.height<=0)return;const n=this.getScaleFactor(),i=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]},a=this.width*n,u=this.height*n,f=i.width/a,p=i.height/u,g=a/u;if(e.cover?f>p:f<p){const S=g*i.height,m=(S-i.width)/2;this.target[1]=-m+i.x,this.target[2]=i.y,this.target[3]=S-m+i.x,this.target[4]=i.height+i.y}else{const S=i.width/g,m=(S-i.height)/2;this.target[1]=i.x,this.target[2]=i.y-m,this.target[3]=i.x+i.width,this.target[4]=i.y+S-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,n,i,a){this.updateFocalPosition(e-n,i-a);const u=n/e,f=a/i;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])*f,this.goHome({position:this.focalPosition}),this.renderer.resize(n,a),this.pendingUpdate=!0}updateFocalPosition(e,n){if(!this.manualFocalPosition){const i=this.width,a=this.height,u=Math.min(i,a),f=0,p=0,g=this.x+f,S=this.y+p;if(i<a){const m=this.height-this.width;this.focalPosition=Tt.projection({x:g,y:S+m/2,width:u-f*2,height:u-p*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=Tt.projection({x:g+m/2,y:S,width:u-f*2,height:u-p*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:n=0,ref:i=!1}={}){const{minX:a,maxX:u,minY:f,maxY:p}=this.getBounds({target:e,padding:n});let g=!1;const S=i?e:qe(e),m=e[3]-e[1],x=e[4]-e[2];return a>e[1]&&(g=!0,S[1]=a,S[3]=a+m),f>e[2]&&(g=!0,S[2]=f,S[4]=f+x),u<e[1]&&(g=!0,S[1]=u,S[3]=u+m),p<e[2]&&(g=!0,S[2]=p,S[4]=p+x),[g,S]}getBounds(e){const n=e.target||this.target,i=e.padding,a=this.options.visibilityRatio,u=Math.abs(1-a);if(this.world.hasActiveZone()){const O=this.world.getActiveZone();if(O){const j=n[3]-n[1]<O.points[3]-O.points[1],q=n[4]-n[2]<O.points[4]-O.points[2];return{minX:j?O.points[1]-i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxX:q?O.points[2]-i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2,minY:j?O.points[3]+i:O.points[1]+(O.points[3]-O.points[1])/2-(n[3]-n[1])/2,maxY:q?O.points[4]+i:O.points[2]+(O.points[4]-O.points[2])/2-(n[4]-n[2])/2}}}const f=n[3]-n[1],p=this.world.width,g=-f*u,S=p-f-g,m=n[4]-n[2],x=this.world.height,R=-m*u,_=x-m-R,M=Math.max(g,S),k=Math.min(g,S),L=Math.max(R,_),P=Math.min(R,_);return{minX:k,maxX:M,minY:P,maxY:L}}getScaleFactor(e=!1){const n=this.renderer.getScale(this.target[3]-this.target[1],this.target[4]-this.target[2],e);return n===0?this._lastGoodScale:(this._lastGoodScale=n,n)}getZoomedPosition(e,{origin:n,fromPos:i}){var a;const u=i?{width:i[3]-i[1],height:i[4]-i[2]}:void 0,f=u?this.renderer.getScale(u.width,u.height):this.getScaleFactor(),p=u?u.width:this.width,g=u?u.height:this.height,S=(a=this.getRendererScreenPosition())==null?void 0:a.width,m=this.world.width,x=S?S/m:1,R=this.options.maxUnderZoom,_=Math.max(x||1,this.options.maxOverZoom),M=1/e,k=f*M;if(M<1){const O=p*f,j=g*f,q=this.world.width/O,ee=this.world.height/j;if(q>ee){const H=this.world.width*k,ie=~~(p*f)*R;H<ie&&(e=this.world.width*f/(p*f*R))}else{const H=this.world.height*k,ie=~~(g*f)*R;H<ie&&(e=this.world.height*f/(g*f*R))}}else k>_&&(e=f/_);const P=ws(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2),this.zoomBuffer);return this.constrainBounds(P,{ref:!0,panPadding:100}),P}clampRegion({x:e,y:n,width:i,height:a,padding:u=0}){const f=this.width,p=this.height,g=i/f<a/p,S=e-u,m=n-u,x=i+u*2,R=a+u*2;if(g){const M=R/p*f;return{x:S-(M-x)/2,y:m,width:M,height:R}}const _=x/f*p;return{x:S,y:m-(_-R)/2,width:x,height:_}}viewerToWorld(e,n){const i=this.getScaleFactor();return this._viewerToWorld.x=this.target[1]+e/i,this._viewerToWorld.y=this.target[2]+n/i,this._viewerToWorld}worldToViewer(e,n,i,a){const u=Tt.singleBox(i,a,e,n);return Qr(u,xs(ra(this.getScaleFactor()),Ei(-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,n){Qr(this.target,tc(e,n?n.x:this.target[1]+(this.target[3]-this.target[1])/2,n?n.y:this.target[2]+(this.target[4]-this.target[2])/2)),this.pendingUpdate=!0}syncTo(e){const n=this.target;return this.target=e.target,this.pendingUpdate=!0,()=>{this.target=n}}stop(){return typeof this.stopId<"u"&&(window.cancelAnimationFrame(this.stopId),this.stopId=void 0),()=>{this.render(performance.now())}}reset(){this.renderer.reset()}selectZone(e){this.world.selectZone(e),this.pendingUpdate=!0}deselectZone(){this.world.deselectZone(),this.pendingUpdate=!0}hook(e,n){const i=this.hooks[e].length;if(i!==0)for(let a=0;a<i;a++)this.hooks[e][a](n)}registerHook(e,n){return this.hooks[e].push(n),()=>{this.hooks[e]=this.hooks[e].filter(i=>i!==n)}}updateNextFrame(){this.pendingUpdate=!0}}const dc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sd=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new t1}abort(e=new Error("This operation was aborted")){this.signal.reason=e,this.signal.dispatchEvent({type:"abort",target:this.signal})}},HA=typeof AbortSignal=="function",VA=typeof Sd.AbortSignal=="function",t1=HA?AbortSignal:VA?Sd.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(i=>i!==n))}},Xp=new Set,Kp=(t,e)=>{const n=`LRU_CACHE_OPTION_${t}`;bd(n)&&Jp(n,`${t} option`,`options.${e}`,io)},Zp=(t,e)=>{const n=`LRU_CACHE_METHOD_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} method`,`cache.${e}()`,a)}},$A=(t,e)=>{const n=`LRU_CACHE_PROPERTY_${t}`;if(bd(n)){const{prototype:i}=io,{get:a}=Object.getOwnPropertyDescriptor(i,t);Jp(n,`${t} property`,`cache.${e}`,a)}},n1=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},bd=t=>!Xp.has(t),Jp=(t,e,n,i)=>{Xp.add(t);const a=`The ${e} is deprecated. Please use ${n} instead.`;n1(a,"DeprecationWarning",t,i)},ua=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),i1=t=>ua(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ed:null:null;class Ed extends Array{constructor(e){super(e),this.fill(0)}}class WA{constructor(e){if(e===0)return[];const n=i1(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class io{constructor(e={}){const{max:n=0,ttl:i,ttlResolution:a=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:g,dispose:S,disposeAfter:m,noDisposeOnSet:x,noUpdateTTL:R,maxSize:_=0,maxEntrySize:M=0,sizeCalculation:k,fetchMethod:L,fetchContext:P,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:j,allowStaleOnFetchRejection:q,allowStaleOnFetchAbort:ee,ignoreFetchAbort:H}=e,{length:Z,maxAge:ie,stale:W}=e instanceof io?{}:e;if(n!==0&&!ua(n))throw new TypeError("max option must be a nonnegative integer");const re=n?i1(n):Array;if(!re)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=_,this.maxEntrySize=M||this.maxSize,this.sizeCalculation=k||Z,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=L||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new re(n),this.prev=new re(n),this.head=0,this.tail=0,this.free=new WA(n),this.initialFill=1,this.size=0,typeof S=="function"&&(this.dispose=S),typeof m=="function"?(this.disposeAfter=m,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!x,this.noUpdateTTL=!!R,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!q,this.allowStaleOnFetchAbort=!!ee,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(this.maxSize!==0&&!ua(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ua(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!g||!!W,this.noDeleteOnStaleGet=!!j,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=ua(a)||a===0?a:1,this.ttlAutopurge=!!u,this.ttl=i||ie||0,this.ttl){if(!ua(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ge="LRU_CACHE_UNBOUNDED";bd(ge)&&(Xp.add(ge),n1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ge,io))}W&&Kp("stale","allowStale"),ie&&Kp("maxAge","ttl"),Z&&Kp("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Ed(this.max),this.starts=new Ed(this.max),this.setItemTTL=(i,a,u=dc.now())=>{if(this.starts[i]=a!==0?u:0,this.ttls[i]=a,a!==0&&this.ttlAutopurge){const f=setTimeout(()=>{this.isStale(i)&&this.delete(this.keyList[i])},a+1);f.unref&&f.unref()}},this.updateItemAge=i=>{this.starts[i]=this.ttls[i]!==0?dc.now():0};let e=0;const n=()=>{const i=dc.now();if(this.ttlResolution>0){e=i;const a=setTimeout(()=>e=0,this.ttlResolution);a.unref&&a.unref()}return i};this.getRemainingTTL=i=>{const a=this.keyMap.get(i);return a===void 0?0:this.ttls[a]===0||this.starts[a]===0?1/0:this.starts[a]+this.ttls[a]-(e||n())},this.isStale=i=>this.ttls[i]!==0&&this.starts[i]!==0&&(e||n())-this.starts[i]>this.ttls[i]}updateItemAge(e){}setItemTTL(e,n,i){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Ed(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,i,a)=>{if(this.isBackgroundFetch(n))return 0;if(!ua(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,e),!ua(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.addItemSize=(e,n)=>{if(this.sizes[e]=n,this.maxSize){const i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,i,a){if(i||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*rentries(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield[this.keyList[e],this.valList[e]])}*keys(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*rkeys(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.keyList[e])}*values(){for(const e of this.indexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}*rvalues(){for(const e of this.rindexes())this.isBackgroundFetch(this.valList[e])||(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n={}){for(const i of this.indexes())if(e(this.valList[i],this.keyList[i],this))return this.get(this.keyList[i],n)}forEach(e,n=this){for(const i of this.indexes())e.call(n,this.valList[i],this.keyList[i],this)}rforEach(e,n=this){for(const i of this.rindexes())e.call(n,this.valList[i],this.keyList[i],this)}get prune(){return Zp("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){const e=[];for(const n of this.indexes({allowStale:!0})){const i=this.keyList[n],a=this.valList[n],u=this.isBackgroundFetch(a)?a.__staleWhileFetching:a;if(u===void 0)continue;const f={value:u};if(this.ttls){f.ttl=this.ttls[n];const p=dc.now()-this.starts[n];f.start=Math.floor(Date.now()-p)}this.sizes&&(f.size=this.sizes[n]),e.unshift([i,f])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const a=Date.now()-i.start;i.start=dc.now()-a}this.set(n,i.value,i)}}dispose(e,n,i){}set(e,n,{ttl:i=this.ttl,start:a,noDisposeOnSet:u=this.noDisposeOnSet,size:f=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL}={}){if(f=this.requireSize(e,n,f,p),this.maxEntrySize&&f>this.maxEntrySize)return this.delete(e),this;let S=this.size===0?void 0:this.keyMap.get(e);if(S===void 0)S=this.newIndex(),this.keyList[S]=e,this.valList[S]=n,this.keyMap.set(e,S),this.next[this.tail]=S,this.prev[S]=this.tail,this.tail=S,this.size++,this.addItemSize(S,f),g=!1;else{this.moveToTail(S);const m=this.valList[S];n!==m&&(this.isBackgroundFetch(m)?m.__abortController.abort(new Error("replaced")):u||(this.dispose(m,e,"set"),this.disposeAfter&&this.disposed.push([m,e,"set"])),this.removeItemSize(S),this.valList[S]=n,this.addItemSize(S,f))}if(i!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),g||this.setItemTTL(S,i,a),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const e=this.valList[this.head];return this.evict(!0),e}}evict(e){const n=this.head,i=this.keyList[n],a=this.valList[n];return this.isBackgroundFetch(a)?a.__abortController.abort(new Error("evicted")):(this.dispose(a,i,"evict"),this.disposeAfter&&this.disposed.push([a,i,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(i),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const i=this.keyMap.get(e);return i!==void 0&&!this.isStale(i)?(n&&this.updateItemAge(i),!0):!1}peek(e,{allowStale:n=this.allowStale}={}){const i=this.keyMap.get(e);if(i!==void 0&&(n||!this.isStale(i))){const a=this.valList[i];return this.isBackgroundFetch(a)?a.__staleWhileFetching:a}}backgroundFetch(e,n,i,a){const u=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(u))return u;const f=new Sd;i.signal&&i.signal.addEventListener("abort",()=>f.abort(i.signal.reason));const p={signal:f.signal,options:i,context:a},g=(R,_=!1)=>{const{aborted:M}=f.signal,k=i.ignoreFetchAbort&&R!==void 0;return M&&!k&&!_?S(f.signal.reason):(this.valList[n]===x&&(R===void 0?x.__staleWhileFetching?this.valList[n]=x.__staleWhileFetching:this.delete(e):this.set(e,R,p.options)),R)},S=R=>{const{aborted:_}=f.signal,M=_&&i.allowStaleOnFetchAbort,k=M||i.allowStaleOnFetchRejection,L=k||i.noDeleteOnFetchRejection;if(this.valList[n]===x&&(!L||x.__staleWhileFetching===void 0?this.delete(e):M||(this.valList[n]=x.__staleWhileFetching)),k)return x.__staleWhileFetching;if(x.__returned===x)throw R},m=(R,_)=>{this.fetchMethod(e,u,p).then(M=>R(M),_),f.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(R(),i.allowStaleOnFetchAbort&&(R=M=>g(M,!0)))})},x=new Promise(m).then(g,S);return x.__abortController=f,x.__staleWhileFetching=u,x.__returned=null,n===void 0?(this.set(e,x,p.options),n=this.keyMap.get(e)):this.valList[n]=x,x}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:u=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:p=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:S=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:x=this.allowStaleOnFetchRejection,ignoreFetchAbort:R=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,fetchContext:M=this.fetchContext,forceRefresh:k=!1,signal:L}={}){if(!this.fetchMethod)return this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a});const P={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:u,noDisposeOnSet:f,size:p,sizeCalculation:g,noUpdateTTL:S,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:R,signal:L};let O=this.keyMap.get(e);if(O===void 0){const j=this.backgroundFetch(e,O,P,M);return j.__returned=j}else{const j=this.valList[O];if(this.isBackgroundFetch(j))return n&&j.__staleWhileFetching!==void 0?j.__staleWhileFetching:j.__returned=j;if(!k&&!this.isStale(O))return this.moveToTail(O),i&&this.updateItemAge(O),j;const q=this.backgroundFetch(e,O,P,M);return n&&q.__staleWhileFetching!==void 0?q.__staleWhileFetching:q.__returned=q}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet}={}){const u=this.keyMap.get(e);if(u!==void 0){const f=this.valList[u],p=this.isBackgroundFetch(f);return this.isStale(u)?p?n?f.__staleWhileFetching:void 0:(a||this.delete(e),n?f:void 0):p?void 0:(this.moveToTail(u),i&&this.updateItemAge(u),f)}}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Zp("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){const i=this.keyMap.get(e);if(i!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(i);const a=this.valList[i];this.isBackgroundFetch(a)?a.__abortController.abort(new Error("deleted")):(this.dispose(a,e,"delete"),this.disposeAfter&&this.disposed.push([a,e,"delete"])),this.keyMap.delete(e),this.keyList[i]=null,this.valList[i]=null,i===this.tail?this.tail=this.prev[i]:i===this.head?this.head=this.next[i]:(this.next[this.prev[i]]=this.next[i],this.prev[this.next[i]]=this.prev[i]),this.size--,this.free.push(i)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const e of this.rindexes({allowStale:!0})){const n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{const i=this.keyList[e];this.dispose(n,i,"delete"),this.disposeAfter&&this.disposed.push([n,i,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Zp("reset","clear"),this.clear}get length(){return $A("length","size"),this.size}static get AbortController(){return Sd}static get AbortSignal(){return t1}}var qA=io;const xd=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,wd={},YA=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class r1 extends Gr{constructor(){super(),this.type="spacial-content",this.isShape=!0,this.hoverEvents=!1,this.activeEvents=!1,this.display={x:0,y:0,scale:1,width:-1,height:-1,points:qe(5)},this.boundingBox=null,this._parsed={border:{id:null,match:[]},outline:{id:null,match:[]}},this.props={},this.shape={type:"none"},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=Qf(12),this.points=qe(5),this.shape={type:"none"}}updateBoundingBox(){if(this.shape.type==="none")return;const e=this.shape.points;if(this.shape.points.length>2){const n=Math.min(...e.map(f=>f[0])),i=Math.min(...e.map(f=>f[1])),a=Math.max(0,...e.map(f=>f[0])),u=Math.max(0,...e.map(f=>f[1]));this.boundingBox={x:n,y:i,width:a-n,height:u-i};return}this.boundingBox=null}intersects(e){if(!e||this.shape.type==="none")return!1;const[n,i]=e,a=this.shape.points;let u=this.boundingBox;if(u||(this.updateBoundingBox(),u=this.boundingBox),!u||n<u.x||n>u.x+u.width||i<u.y||i>u.height+u.y)return!1;let f=!1;for(let p=0,g=a.length-1;p<a.length;g=p++)a[p][1]>i!=a[g][1]>i&&n<(a[g][0]-a[p][0])*(i-a[p][1])/(a[g][1]-a[p][1])+a[p][0]&&(f=!f);return f}getAllPointsAt(e,n){return e[3]-e[1]===1&&e[4]-e[2]===1?this.intersects([e[1],e[2]])?[[this,this.points,n]]:[]:[[this,this.points,n]]}applyProps(e={}){let n=!1;if(e.points)if(this.shape.type!=="polygon"||this.shape.points.length!==e.points.length)this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox();else{let i=!1;const a=e.points.length;for(let u=0;u<a;u++)if(e.points[u][0]!==this.shape.points[u][0]||e.points[u][1]!==this.shape.points[u][1]){i=!0;break}i&&(this.shape={type:"polygon",points:e.points,open:e.open},this.updateBoundingBox())}if(e.interactive!==this.props.interactive&&(n=!0,this.props.interactive=e.interactive),(e.open||e.open===!1)&&(n=!0,this.shape.open=e.open),e.style){const i=e.border||e.style.border;if(i!==this._parsed.border.id)if(!i)this._parsed.border.id=null,this._parsed.border.match=[];else{const a=wd[i]||xd.exec(i)||xd.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=wd[i]=a)}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 a=wd[e.style.outline]||xd.exec(e.style.outline)||xd.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=wd[e.style.outline]=a)}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,n=!0),e.style.background&&!this.props.style.backgroundColor&&(this.props.style.backgroundColor=e.style.background,n=!0);for(const a of YA)if(this.props.style[a]!==e.style[a]){n=!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)),n=!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)),n=!0)}e.href!==this.props.href&&(this.props.href=e.href,n=!0),e.hrefTarget!==this.props.hrefTarget&&(this.props.hrefTarget=e.hrefTarget,n=!0),e.title!==this.props.title&&(this.props.title=e.title,n=!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)),n=!0),e.relativeSize!==this.props.relativeSize&&(this.props.relativeSize=e.relativeSize,n=!0),e.relativeStyle!==this.props.relativeStyle&&(this.props.relativeStyle=e.relativeStyle,n=!0),e.html!==this.props.html&&(this.props.html=e.html,n=!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])&&(n=!0,this.points=Tt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=Tt.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),n&&this.__revision++}}const s1=/(-?[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,a1={},Cd={};class QA{constructor(e,n){this.imagesPending=0,this.imagesLoaded=0,this.frameIsRendering=!1,this.pendingDrawCall=!1,this.firstMeaningfulPaint=!1,this.parallelTasks=8,this.frameTasks=0,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.invalidated=[],this._worker=()=>{if(this.loadingQueue.length){const i=this.loadingQueue.pop();i&&(this.tasksRunning++,this.frameTasks++,this.currentTask=i.task().then(()=>{this.tasksRunning--}).catch(()=>{this.tasksRunning--}))}},this._scheduled=0,this._doWork=()=>{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:!0}),this.ctx.imageSmoothingEnabled=!0,this.options=n||{},this.canvas.style.opacity="0",this.canvas.style.transition="opacity .3s",this.dpi=(n==null?void 0:n.dpi)||1,this.hostCache=n!=null&&n.lruCache?new qA({maxSize:1024*512*512,dispose:(i,a,u)=>{this.invalidated.push(a),i.width=0,i.height=0},sizeCalculation:(i,a)=>i.width*i.height}):{store:{},get(i){return this.store[i]},set(i,a){this.store[i]=a}}}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.clearTransform(),this.lastPaintedObject=void 0,this.frameIsRendering=!1,this.imagesPending=this.imagesPending-this.imagesLoaded,this.imagesLoaded=0,this.loadingQueueOrdered||(this.loadingQueue=this.loadingQueue.sort((n,i)=>n.network&&n.scale===i.scale?i.distance-n.distance:n.scale<i.scale?-1:1),this.loadingQueueOrdered=!0),this.previousVisible=this.visible,this.pendingDrawCall=!!this.drawCalls.length,this.pendingDrawCall)for(let n=0;n<this.drawCalls.length;n++){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._scheduled||(this._scheduled=setInterval(this._doWork,0))))}getScale(e,n,i){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const a=this.getCanvasDims(),u=a.width/e,f=a.height/n,p=(u<f?f:u)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}beforeFrame(e,n,i){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(n);const a=this.getCanvasDims();this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,a.width,a.height)}applyTransform(e,n,i,a,u){const f=e.__owner.value;if(f&&f.rotation){this.ctx.save();const p=n+a/2,g=i+u/2;this.ctx.translate(p,g),this.ctx.rotate(f.rotation*Math.PI/180),this.ctx.translate(-p,-g),this.lastPaintedObject=f}}clearTransform(){this.lastPaintedObject&&(this.lastPaintedObject.rotation&&this.ctx.restore(),this.lastPaintedObject=void 0)}paint(e,n,i,a,u,f){const p=this.ctx.globalAlpha;if(e instanceof Ar||e instanceof no){if(e.display.rotation){this.ctx.save();let m=i+u/2,x=a+f/2;e.crop&&(m-=e.crop[n*5+1],x-=e.crop[n*5+2]),this.ctx.translate(m,x),this.ctx.rotate(e.display.rotation*Math.PI/180),this.ctx.translate(-m,-x)}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 m=e.__host.canvas,x=this.getCanvasDims();if((m.indices.indexOf(n)===-1||this.invalidated.indexOf(m.canvases[n])!==-1)&&this.schedulePaintToCanvas(m,e,n,Gf({x:i+u/2,y:a+u/2},{x:x.width/2,y:x.height/2})),!this.firstMeaningfulPaint)return;const R=this.hostCache.get(m.canvases[n]);if(R)if(e.crop&&e.cropData){if(e.crop[n*5]){const _=[e.crop[n*5+1]/e.display.scale-e.display.points[n*5+1],e.crop[n*5+2]/e.display.scale-e.display.points[n*5+2],1+(e.crop[n*5+3]-e.crop[n*5+1])/e.display.scale,1+(e.crop[n*5+4]-e.crop[n*5+2])/e.display.scale];_[0]+=e.cropData.x/e.display.scale,_[1]+=e.cropData.y/e.display.scale;const M=e.x*this.lastKnownScale,k=e.y*this.lastKnownScale,L=[i+M,a+k,u,f];L[0]+=M,L[1]+=k,this.ctx.drawImage(R,_[0],_[1],_[2],_[3],L[0],L[1],L[2]+1,L[3]+1)}}else this.ctx.drawImage(R,0,0,e.display.points[n*5+3]-e.display.points[n*5+1],e.display.points[n*5+4]-e.display.points[n*5+2],i,a,u+Number.MIN_VALUE,f+Number.MIN_VALUE)}catch{}e.display.rotation&&this.ctx.restore()}const g=e instanceof uc&&this.options.box,S=e instanceof r1&&this.options.polygon;if((g||S)&&!e.props.className&&!e.props.html&&!e.props.href){if(e.props.style){const m=Object.assign({},e.props.style||{},e.hovering?e.props.hoverStyles:{},e.pressing?e.props.pressStyles:{}),x=e.props.relativeStyle?1:u/e.width;typeof m.opacity<"u"&&(this.ctx.globalAlpha=m.opacity);let R=0;typeof m.borderWidth<"u"&&(R=parseInt(m.borderWidth,10)*x);let _=0;typeof m.outlineWidth<"u"&&(_=parseInt(m.outlineWidth,10)*x);let M=0;if(typeof m.outlineOffset<"u"&&(M=parseInt(m.outlineOffset,10)*x),m.borderColor&&(this.ctx.strokeStyle=m.borderColor),m.boxShadow){const k=m.boxShadow.split(/,(?![^(]*\))/);for(const L of k){const P=a1[L]||s1.exec(L)||s1.exec(L);a1[L]=P,P&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(P[1])*this.dpi*x,this.ctx.shadowOffsetY=parseInt(P[3])*this.dpi*x,this.ctx.shadowBlur=parseInt(P[5])*this.dpi*x,this.ctx.shadowColor=P[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(i+R,a+R,u,f),this.ctx.restore())}}if(this.ctx.fillStyle=m.backgroundColor||"transparent",this.ctx.lineWidth=R,S){const k=e.shape,L=k.points||[],P=L.length;this.ctx.beginPath();for(let O=0;O<P;O++)this.ctx.lineTo(i+L[O][0]*this.lastKnownScale,a+L[O][1]*this.lastKnownScale);k.open||this.ctx.closePath(),R&&this.ctx.stroke(),k.open||this.ctx.fill()}else R&&this.ctx.strokeRect(i+R/2,a+R/2,u+R,f+R),this.ctx.fillRect(i+R,a+R,u,f);_&&(m.outlineColor&&(this.ctx.strokeStyle=m.outlineColor),this.ctx.lineWidth=_,this.ctx.strokeRect(i-_/2-M,a-_/2-M,u+R*2+_+M*2,f+R*2+_+M*2))}this.ctx.globalAlpha=p}}loadImage(e,n,i,a=!1){if(Cd[e]&&Cd[e].naturalWidth>0){n(Cd[e]);return}try{let u=!1;a||setTimeout(()=>{u||this.loadImage(e,n,i,!0)},3e3);const f=document.createElement("img");f.decoding="auto",f.onload=function(){u=!0,n(f),Cd[e]=f,f.onload=null},this.options.crossOrigin&&(f.crossOrigin="anonymous"),f.src=e,f.complete&&f.onload({}),f.width}catch(u){console.log("image error",u),i(u)}}schedulePaintToCanvas(e,n,i,a){this.imagesPending++,e.indices.push(i);const u=`${n.id}--${n.display.scale}-${i}`,f=this.invalidated.indexOf(u);f!==-1&&this.invalidated.splice(f,1),e.canvases[i]=u,n.__host.canvas.loading=!0,this.loadingQueueOrdered=!1,this.loadingQueue.push({id:u,scale:n.display.scale,network:!0,distance:a,task:()=>new Promise(p=>{if(this.visible.indexOf(n)===-1){this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p();return}const g=n.getImageUrl(i);this.loadImage(g,S=>{this.loadingQueue.push({id:u,scale:n.display.scale,distance:a,task:()=>new Promise(m=>{this.imagesLoaded++,e.loaded.push(i),e.loaded.length===e.indices.length&&(e.loading=!1);const x=n.display.points.slice(i*5,i*5+5),R=document.createElement("canvas"),_=R.getContext("2d");R.width=x[3]-x[1],R.height=x[4]-x[2],this.hostCache.set(e.canvases[i],R),this.drawCalls.push(()=>{_.drawImage(S,0,0,x[3]-x[1],x[4]-x[2]),m()})})}),p()},S=>{this.imagesPending--,e.indices.splice(e.indices.indexOf(i),1),p()})})})}afterPaintLayer(e,n){}prepareLayer(e,n){e.__owner.value&&(e.cropData?(this.lastKnownScale*(1/e.display.scale),this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])):this.applyTransform(e,n[1],n[2],n[3]-n[1],n[4]-n[2])),(!e.__host||!e.__host.canvas)&&(e instanceof Ar||e instanceof no)&&this.createImageHost(e)}finishLayer(){this.lastPaintedObject&&this.clearTransform()}createImageHost(e){e.__host=e.__host?e.__host:{},e.__host.canvas={canvas:void 0,canvases:[],indices:[],loaded:[],loading:!1}}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getViewportBounds(e,n,i){const a=e.getActiveZone();if(a){const u=n[3]-n[1]<a.points[3]-a.points[1],f=n[4]-n[2]<a.points[4]-a.points[2];return{x1:u?a.points[1]-i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y1:f?a.points[2]-i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[2])/2,x2:u?a.points[3]+i:a.points[1]+(a.points[3]-a.points[1])/2-(n[3]-n[1])/2,y2:f?a.points[4]+i:a.points[2]+(a.points[4]-a.points[2])/2-(n[4]-n[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}reset(){this.loadingQueue=[],this.drawCalls=[]}}class o1{constructor(e){this.renderers=[];for(const n of e)n&&this.renderers.push(n);this.length=this.renderers.length}afterFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].afterFrame(e,n,i)}afterPaintLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].afterPaintLayer(e,n)}beforeFrame(e,n,i){for(let a=0;a<this.length;a++)this.renderers[a].beforeFrame(e,n,i)}triggerResize(){for(let e=0;e<this.length;e++){const n=this.renderers[e];n.triggerResize&&n.triggerResize()}}getPointsAt(e,n,i,a){return this.renderers[0].getPointsAt(e,n,i,a)}getScale(e,n){return this.renderers[0].getScale(e,n)}getViewportBounds(e,n,i){return this.renderers[0].getViewportBounds(e,n,i)}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,n,i,a,u,f){for(let p=0;p<this.length;p++)this.renderers[p].paint(e,n,i,a,u,f)}pendingUpdate(){for(let e=0;e<this.length;e++)if(this.renderers[e].pendingUpdate())return!0;return!1}prepareLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].prepareLayer(e,n)}finishLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].finishLayer(e,n)}resize(e,n){for(let i=0;i<this.length;i++)this.renderers[i].resize(e,n)}reset(){for(let e=0;e<this.length;e++)this.renderers[e].reset()}}class GA{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=ra(1)}isReady(){return!0}resize(){this.initialWidth=this.canvas.width,this.initialHeight=this.canvas.height,this.renderNextFrame=!0}afterFrame(e,n,i){if(this.renderNextFrame){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);const a=this.initialWidth/e.width,u=this.initialHeight/e.height,f=this.widthRatio>this.heightRatio?a:u;if(this.target=i,this.bounds){const p=e.getPointsAt(this.bounds,this.aggregate,f);for(const[g,S]of p)if(g instanceof Ar&&g.__host.canvas){const m=S.length/5;for(let x=0;x<m;x++)g.__host.canvas.canvases[x]&&(S[x+1]*f,S[x+2]*f,(S[x+3]-S[x+1])*f,(S[x+4]-S[x+2])*f)}}e.getPoints().forEach((p,g,S)=>{if(g%5===0&&p){const m={x1:S[g+1]*f,y1:S[g+2]*f,x2:S[g+3]*f,y2:S[g+4]*f,width:(S[g+3]-S[g+1])*f,height:(S[g+4]-S[g+2])*f};this.context.strokeStyle="red",this.context.strokeRect(m.x1,m.y1,m.width,m.height)}}),i&&(this.context.strokeStyle="red",this.context.lineWidth=window.devicePixelRatio||1,this.context.strokeRect(i[1]*f,i[2]*f,(i[3]-i[1])*f,(i[4]-i[2])*f))}}getActiveZone(e){return null}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){return 1}beforeFrame(e,n){this.bounds=Tt.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,n){}paint(e,n,i,a,u,f){this.renderNextFrame=!0}prepareLayer(e){}pendingUpdate(){return!1}hasActiveZone(){return!1}getViewportBounds(e,n,i){return null}getRendererScreenPosition(){return this.canvas.getBoundingClientRect()}finishLayer(){}reset(){}}var l1=!1,ro,ev,tv,Td,Rd,u1,Ad,nv,iv,rv,c1,sv,av,f1,d1;function Ui(){if(!l1){l1=!0;var t=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(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(sv=/\b(iPhone|iP[ao]d)/.exec(t),av=/\b(iP[ao]d)/.exec(t),rv=/Android/i.exec(t),f1=/FBAN\/\w+;/i.exec(t),d1=/Mobile/i.exec(t),c1=!!/Win64/.exec(t),e){ro=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,ro&&document&&document.documentMode&&(ro=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(t);u1=i?parseFloat(i[1])+4:ro,ev=e[2]?parseFloat(e[2]):NaN,tv=e[3]?parseFloat(e[3]):NaN,Td=e[4]?parseFloat(e[4]):NaN,Td?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Rd=e&&e[1]?parseFloat(e[1]):NaN):Rd=NaN}else ro=ev=tv=Rd=Td=NaN;if(n){if(n[1]){var a=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Ad=a?parseFloat(a[1].replace("_",".")):!0}else Ad=!1;nv=!!n[2],iv=!!n[3]}else Ad=nv=iv=!1}}var ov={ie:function(){return Ui()||ro},ieCompatibilityMode:function(){return Ui()||u1>ro},ie64:function(){return ov.ie()&&c1},firefox:function(){return Ui()||ev},opera:function(){return Ui()||tv},webkit:function(){return Ui()||Td},safari:function(){return ov.webkit()},chrome:function(){return Ui()||Rd},windows:function(){return Ui()||nv},osx:function(){return Ui()||Ad},linux:function(){return Ui()||iv},iphone:function(){return Ui()||sv},mobile:function(){return Ui()||sv||av||rv||d1},nativeApp:function(){return Ui()||f1},android:function(){return Ui()||rv},ipad:function(){return Ui()||av}},XA=ov,Md=!!(typeof window<"u"&&window.document&&window.document.createElement),KA={canUseDOM:Md,canUseWorkers:typeof Worker<"u",canUseEventListeners:Md&&!!(window.addEventListener||window.attachEvent),canUseViewport:Md&&!!window.screen,isInWorker:!Md},ZA=KA,h1=ZA,p1;h1.canUseDOM&&(p1=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
214
214
  * Checks if an event is supported in the current execution environment.
215
215
  *
216
216
  * NOTE: This will not work correctly for non-generic events such as `change`,
@@ -223,7 +223,7 @@ No matching component was found for:
223
223
  * @return {boolean} True if the event is supported.
224
224
  * @internal
225
225
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
226
- */function GA(t,e){if(!h1.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i=typeof a[n]=="function"}return!i&&p1&&t==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var XA=GA,KA=qA,ZA=XA,v1=10,m1=40,g1=800;function y1(t){var e=0,n=0,i=0,a=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),i=e*v1,a=n*v1,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||a)&&t.deltaMode&&(t.deltaMode==1?(i*=m1,a*=m1):(i*=g1,a*=g1)),i&&!e&&(e=i<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:a}}y1.getEventType=function(){return KA.firefox()?"DOMMouseScroll":ZA("wheel")?"wheel":"mousewheel"};var JA=y1,eM=JA;function tM(t){return{x:t[1],y:t[2],width:t[3]-t[1],height:t[4]-t[2]}}const nM={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:()=>{}},S1=(t={})=>({start:function(e){const{zoomWheelConstant:n,enableWheel:i,enableClickToZoom:a}={...nM,...t},u={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:qe(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function f(){e.world.constraintBounds(),S=0}function p(L){if(L.which>1){u.isPressing=!1;return}e.mode==="explore"&&(L.preventDefault(),u.pointerStart.x=L.atlas.x,u.pointerStart.y=L.atlas.y,e.transitionManager.stopTransition(),u.isPressing=!0)}function g(){u.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),u.isPressing=!1)}let S=0;function m(L){if(e.mode==="explore"){if(L.atlasTouches.length===1&&(L.preventDefault(),u.pointerStart.x=L.atlasTouches[0].x,u.pointerStart.y=L.atlasTouches[0].y),L.atlasTouches.length===2){L.preventDefault();const P=L.atlasTouches[0].x,O=L.atlasTouches[1].x;u.pointerStart.x=(P+O)/2;const j=L.atlasTouches[0].y,q=L.atlasTouches[1].y;u.pointerStart.y=(j+q)/2,S=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}e.transitionManager.stopTransition(),u.isPressing=!0}}function x(L){let P=null,O=null,j=0;if(u.isPressing&&L.touches.length===2){const q=L.touches[0].clientX,ee=L.touches[1].clientX;P=(q+ee)/2;const H=L.touches[0].clientY,Z=L.touches[1].clientY;O=(H+Z)/2,j=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}if(u.isPressing&&L.touches.length===1){const q=L.touches[0];P=q.clientX,O=q.clientY}if(P!==null&&O!==null){const q=e.getRendererScreenPosition();if(q){const{x:ee,y:H}=e.viewerToWorld(P-q.x,O-q.y),Z=j&&S?j/S:1;e.transitionManager.customTransition(ie=>{ie.from=qe(e.target),ie.to=ws(ie.from,xs(Ei(u.pointerStart.x-ee,u.pointerStart.y-H),tc(1/Z,ee,H)),u.mousemoveBuffer),ie.elapsed_time=0,ie.total_time=0,ie.timingFunction=la.easeInOutExpo,ie.done=!1})}S=j}}function T(L){if(u.isPressing){const P=e.getRendererScreenPosition();if(P){const{x:O,y:j}=e.viewerToWorld(L.clientX-P.x,L.clientY-P.y);e.transitionManager.customTransition(q=>{q.from=qe(e.target),q.to=ws(q.from,Ei(u.pointerStart.x-O,u.pointerStart.y-j),u.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=la.easeInOutExpo,q.done=!1})}}}function _(L){e.mode==="explore"&&e.world.zoomIn(L.atlas)}function M(L){const O=1+eM(L).spinY/n;e.world.zoomTo(O,L.atlas,!0)}e.world.addEventListener("mouseup",f),e.world.addEventListener("touchend",f),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",p),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",T),window.addEventListener("touchmove",x),a&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",_)),i&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",M));const k=e.world.addLayoutSubscriber((L,P)=>{if(L==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),L==="zoom-to"&&P&&e.transitionManager.zoomTo(P.factor,{origin:P.point,stream:P.stream}),L==="go-home"){const O=P.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(tM(e.homePosition),{transition:O})}if(L==="goto-region"&&P){const O=P.immediate?{duration:0}:{};e.transitionManager.goToRegion(P,{transition:O})}L==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:P!=null&&P.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",f),e.world.removeEventListener("touchend",f),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",p),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",T),e.world.removeEventListener("touchmove",T),a&&e.world.removeEventListener("click",_),i&&e.world.removeEventListener("wheel",M),k()}},updatePosition(){}}),Od=R.createContext("explore"),iM=()=>R.useContext(Od);function lv(t,e,n){var i,a,u,f,p;e==null&&(e=100);function g(){var m=Date.now()-f;m<e&&m>=0?i=setTimeout(g,e-m):(i=null,n||(p=t.apply(u,a),u=a=null))}var S=function(){u=this,a=arguments,f=Date.now();var m=n&&!i;return i||(i=setTimeout(g,e)),m&&(p=t.apply(u,a),u=a=null),p};return S.clear=function(){i&&(clearTimeout(i),i=null)},S.flush=function(){i&&(p=t.apply(u,a),u=a=null,clearTimeout(i),i=null)},S}lv.debounce=lv;var b1=lv;function E1(t){let{debounce:e,scroll:n,polyfill:i,offsetSize:a}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const u=i||(typeof window>"u"?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[f,p]=R.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=R.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:f}),S=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,x=R.useRef(!1);R.useEffect(()=>(x.current=!0,()=>void(x.current=!1)));const[T,_,M]=R.useMemo(()=>{const O=()=>{if(!g.current.element)return;const{left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re}=g.current.element.getBoundingClientRect(),ge={left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re};g.current.element instanceof HTMLElement&&a&&(ge.height=g.current.element.offsetHeight,ge.width=g.current.element.offsetWidth),Object.freeze(ge),x.current&&!oM(g.current.lastBounds,ge)&&p(g.current.lastBounds=ge)};return[O,m?b1(O,m):O,S?b1(O,S):O]},[p,a,S,m]);function k(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(O=>O.removeEventListener("scroll",M,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function L(){g.current.element&&(g.current.resizeObserver=new u(M),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach(O=>O.addEventListener("scroll",M,{capture:!0,passive:!0})))}const P=O=>{!O||O===g.current.element||(k(),g.current.element=O,g.current.scrollContainers=x1(O),L())};return sM(M,!!n),rM(_),R.useEffect(()=>{k(),L()},[n,M,_]),R.useEffect(()=>k,[]),[P,f,T]}function rM(t){R.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function sM(t,e){R.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function x1(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(u=>u==="auto"||u==="scroll")&&e.push(t),[...e,...x1(t.parentElement)]}const aM=["x","y","top","bottom","left","right","width","height"],oM=(t,e)=>aM.every(n=>t[n]===e[n]),uv=R.createContext(null),cv=R.createContext(null);let _d;if(typeof performance=="object"&&typeof performance.now=="function"){const t=performance;_d=()=>t.now()}else{const t=Date,e=t.now();_d=()=>t.now()-e}function w1(t,e){t&&t.appendChild&&e&&t.appendChild(e)}function C1(t,e){t&&t.removeChild&&e&&t.removeChild(e)}function lM(t,e){return C1(t.world,e)}function uM(t,e,n){return T1(t.world,e,n)}function T1(t,e,n){t&&t instanceof yd&&(t=t.world),t&&t.insertBefore&&t.insertBefore(e,n)}function R1(t,e,n){if(n&&(t.applyProps&&t.applyProps(n),t instanceof Gr))for(const i of Yf){const a=i.slice(2).toLowerCase();n[i]!==e[i]&&(e[i]&&t.removeEventListener(a,e[i]),t.addEventListener(a,n[i]))}}function A1(t,e){const n=Object.keys(e);let i=!1;for(const a of n)if(Yf.indexOf(a)!==-1){const u=Rl[a];if(u){if(t.activatedEvents.indexOf(u)!==-1)continue;i=!0,t.activatedEvents.push(u)}}i&&t.triggerEventActivation()}const Ld=new Map,M1={};function cM(t,{args:e=[],...n},i,a,u){if(!(i instanceof yd)&&u){const g=S=>S.return?g(S.return):S.stateNode&&S.stateNode.containerInfo;i=g(u)}let f,p=i.world;switch(t){case"world":f=Il.withProps({width:n.width,height:n.height,viewingDirection:"left-to-right"}),f.activatedEvents=p.activatedEvents,f.eventHandlers=p.eventHandlers,f.subscriptions=p.subscriptions,f.triggerEventActivation(),p=f;break;case"box":f=new uc;break;case"shape":f=new r1;break;case"worldObject":case"world-object":f=new lc;break;case"worldImage":case"world-image":f=new Ar;break;case"texture":f=new kp;break;case"compositeImage":case"composite-image":f=new IA({id:n.id,width:n.width,height:n.height,images:[]});break;case"tiledImage":case"tiled-image":f=no.fromTile(n.uri,n.display,n.tile,n.scaleFactor,void 0,n.format);break;case"paragraph":f=new hd,f.text=n.children;break;default:return}return A1(p,n),R1(f,{},n),f}function fM(t,e){if(e instanceof Il)t.world=e;else if(e instanceof lc)t.world.appendChild(e);else if(e)throw new Error("Invalid root")}const hc=uC({unstable_now:_d,now:_d,createInstance:cM,removeChild:C1,appendChild:w1,appendInitialChild:w1,insertBefore:T1,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout<"u"?setTimeout:void 0,cancelTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,setTimeout:typeof setTimeout<"u"?setTimeout:void 0,clearTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:fM,removeChildFromContainer:lM,createTextInstance(){},insertInContainerBefore:uM,prepareUpdate(t,e,n,i,a){return A1(a.world,i),i},commitUpdate(t,e,n,i,a,u){t.applyProps&&e&&R1(t,i,e)},finalizeInitialChildren(t){return t==null?void 0:t.__handlers},getChildHostContext(){return M1},getRootHostContext(){return M1},prepareForCommit(t){return t.isCommitting=!0,null},preparePortalMount(){},hideInstance(t){t&&t.points&&(t.points[0]=0)},unhideInstance(t,e){t&&t.points&&(t.points[0]=1)},getPublicInstance(t){return t},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(t){t.isCommitting=!1,t.pendingUpdate=!0,t.world&&t.world.needsRecalculate&&(t.world.recalculateWorldSize(),t.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});hc.injectIntoDevTools({bundleType:0,version:R.version,rendererPackageName:"@atlas-viewer/atlas"});function O1(t,e){const n=Ld.get(t);n&&hc.updateContainer(null,n,null,()=>{Ld.delete(t),e&&e(t)})}const dM={render(t,e){const n=Ld.get(e);if(n)hc.updateContainer(t,n,null,()=>{});else{const i=hc.createContainer(e,0,null,!1,null,"",()=>{},null);hc.updateContainer(t,i,null,null),Ld.set(e,i)}}},hM=R.memo(({children:t,setIsReady:e,onCreated:n,bounds:i,preset:a,mode:u="explore"})=>{const f=R.useCallback(function(g){const S=()=>{e(!0)};return R.useEffect(()=>{if(a){a.runtime.goHome();const m=n&&n(a);return void(m&&m.then?m.then(S):S())}return()=>{}},[]),g.children},[a]);return R.useLayoutEffect(()=>{if(a){const p=a.runtime;u!==p.mode&&(p.mode=u),dM.render(R.createElement(R.StrictMode,null,R.createElement(f,null,R.createElement(cv.Provider,{value:i},R.createElement(Od.Provider,{value:u},R.createElement(uv.Provider,{value:a},t))))),p)}},[a,u,t]),null});class pM{constructor(e,n){this.fragmentShaderSource=`
226
+ */function JA(t,e){if(!h1.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i=typeof a[n]=="function"}return!i&&p1&&t==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var eM=JA,tM=XA,nM=eM,v1=10,m1=40,g1=800;function y1(t){var e=0,n=0,i=0,a=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),i=e*v1,a=n*v1,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||a)&&t.deltaMode&&(t.deltaMode==1?(i*=m1,a*=m1):(i*=g1,a*=g1)),i&&!e&&(e=i<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:a}}y1.getEventType=function(){return tM.firefox()?"DOMMouseScroll":nM("wheel")?"wheel":"mousewheel"};var iM=y1,rM=iM;function sM(t){return{x:t[1],y:t[2],width:t[3]-t[1],height:t[4]-t[2]}}const aM={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:()=>{}},S1=(t={})=>({start:function(e){const{zoomWheelConstant:n,enableWheel:i,enableClickToZoom:a}={...aM,...t},u={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:qe(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function f(){e.world.constraintBounds(),S=0}function p(L){if(L.which>1){u.isPressing=!1;return}e.mode==="explore"&&(L.preventDefault(),u.pointerStart.x=L.atlas.x,u.pointerStart.y=L.atlas.y,e.transitionManager.stopTransition(),u.isPressing=!0)}function g(){u.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),u.isPressing=!1)}let S=0;function m(L){if(e.mode==="explore"){if(L.atlasTouches.length===1&&(L.preventDefault(),u.pointerStart.x=L.atlasTouches[0].x,u.pointerStart.y=L.atlasTouches[0].y),L.atlasTouches.length===2){L.preventDefault();const P=L.atlasTouches[0].x,O=L.atlasTouches[1].x;u.pointerStart.x=(P+O)/2;const j=L.atlasTouches[0].y,q=L.atlasTouches[1].y;u.pointerStart.y=(j+q)/2,S=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}e.transitionManager.stopTransition(),u.isPressing=!0}}function x(L){let P=null,O=null,j=0;if(u.isPressing&&L.touches.length===2){const q=L.touches[0].clientX,ee=L.touches[1].clientX;P=(q+ee)/2;const H=L.touches[0].clientY,Z=L.touches[1].clientY;O=(H+Z)/2,j=Gf({x:L.touches[0].clientX,y:L.touches[0].clientY},{x:L.touches[1].clientX,y:L.touches[1].clientY})}if(u.isPressing&&L.touches.length===1){const q=L.touches[0];P=q.clientX,O=q.clientY}if(P!==null&&O!==null){const q=e.getRendererScreenPosition();if(q){const{x:ee,y:H}=e.viewerToWorld(P-q.x,O-q.y),Z=j&&S?j/S:1;e.transitionManager.customTransition(ie=>{ie.from=qe(e.target),ie.to=ws(ie.from,xs(Ei(u.pointerStart.x-ee,u.pointerStart.y-H),tc(1/Z,ee,H)),u.mousemoveBuffer),ie.elapsed_time=0,ie.total_time=0,ie.timingFunction=la.easeInOutExpo,ie.done=!1})}S=j}}function R(L){if(u.isPressing){const P=e.getRendererScreenPosition();if(P){const{x:O,y:j}=e.viewerToWorld(L.clientX-P.x,L.clientY-P.y);e.transitionManager.customTransition(q=>{q.from=qe(e.target),q.to=ws(q.from,Ei(u.pointerStart.x-O,u.pointerStart.y-j),u.mousemoveBuffer),q.elapsed_time=0,q.total_time=0,q.timingFunction=la.easeInOutExpo,q.done=!1})}}}function _(L){e.mode==="explore"&&e.world.zoomIn(L.atlas)}function M(L){const O=1+rM(L).spinY/n;e.world.zoomTo(O,L.atlas,!0)}e.world.addEventListener("mouseup",f),e.world.addEventListener("touchend",f),e.world.addEventListener("touchstart",m),e.world.addEventListener("mousedown",p),window.addEventListener("touchend",g),window.addEventListener("mouseup",g),window.addEventListener("mousemove",R),window.addEventListener("touchmove",x),a&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",_)),i&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",M));const k=e.world.addLayoutSubscriber((L,P)=>{if(L==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),L==="zoom-to"&&P&&e.transitionManager.zoomTo(P.factor,{origin:P.point,stream:P.stream}),L==="go-home"){const O=P.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(sM(e.homePosition),{transition:O})}if(L==="goto-region"&&P){const O=P.immediate?{duration:0}:{};e.transitionManager.goToRegion(P,{transition:O})}L==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:P!=null&&P.immediate?{duration:0}:void 0})});return()=>{e.world.removeEventListener("mouseup",f),e.world.removeEventListener("touchend",f),e.world.removeEventListener("touchstart",m),e.world.removeEventListener("mousedown",p),window.removeEventListener("touchend",g),window.removeEventListener("mouseup",g),e.world.removeEventListener("mousemove",R),e.world.removeEventListener("touchmove",R),a&&e.world.removeEventListener("click",_),i&&e.world.removeEventListener("wheel",M),k()}},updatePosition(){}}),Od=T.createContext("explore"),oM=()=>T.useContext(Od);function lv(t,e,n){var i,a,u,f,p;e==null&&(e=100);function g(){var m=Date.now()-f;m<e&&m>=0?i=setTimeout(g,e-m):(i=null,n||(p=t.apply(u,a),u=a=null))}var S=function(){u=this,a=arguments,f=Date.now();var m=n&&!i;return i||(i=setTimeout(g,e)),m&&(p=t.apply(u,a),u=a=null),p};return S.clear=function(){i&&(clearTimeout(i),i=null)},S.flush=function(){i&&(p=t.apply(u,a),u=a=null,clearTimeout(i),i=null)},S}lv.debounce=lv;var b1=lv;function E1(t){let{debounce:e,scroll:n,polyfill:i,offsetSize:a}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const u=i||(typeof window>"u"?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[f,p]=T.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),g=T.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:f}),S=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,x=T.useRef(!1);T.useEffect(()=>(x.current=!0,()=>void(x.current=!1)));const[R,_,M]=T.useMemo(()=>{const O=()=>{if(!g.current.element)return;const{left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re}=g.current.element.getBoundingClientRect(),ge={left:j,top:q,width:ee,height:H,bottom:Z,right:ie,x:W,y:re};g.current.element instanceof HTMLElement&&a&&(ge.height=g.current.element.offsetHeight,ge.width=g.current.element.offsetWidth),Object.freeze(ge),x.current&&!fM(g.current.lastBounds,ge)&&p(g.current.lastBounds=ge)};return[O,m?b1(O,m):O,S?b1(O,S):O]},[p,a,S,m]);function k(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(O=>O.removeEventListener("scroll",M,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function L(){g.current.element&&(g.current.resizeObserver=new u(M),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach(O=>O.addEventListener("scroll",M,{capture:!0,passive:!0})))}const P=O=>{!O||O===g.current.element||(k(),g.current.element=O,g.current.scrollContainers=x1(O),L())};return uM(M,!!n),lM(_),T.useEffect(()=>{k(),L()},[n,M,_]),T.useEffect(()=>k,[]),[P,f,R]}function lM(t){T.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function uM(t,e){T.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function x1(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(u=>u==="auto"||u==="scroll")&&e.push(t),[...e,...x1(t.parentElement)]}const cM=["x","y","top","bottom","left","right","width","height"],fM=(t,e)=>cM.every(n=>t[n]===e[n]),uv=T.createContext(null),cv=T.createContext(null);let _d;if(typeof performance=="object"&&typeof performance.now=="function"){const t=performance;_d=()=>t.now()}else{const t=Date,e=t.now();_d=()=>t.now()-e}function w1(t,e){t&&t.appendChild&&e&&t.appendChild(e)}function C1(t,e){t&&t.removeChild&&e&&t.removeChild(e)}function dM(t,e){return C1(t.world,e)}function hM(t,e,n){return T1(t.world,e,n)}function T1(t,e,n){t&&t instanceof yd&&(t=t.world),t&&t.insertBefore&&t.insertBefore(e,n)}function R1(t,e,n){if(n&&(t.applyProps&&t.applyProps(n),t instanceof Gr))for(const i of Yf){const a=i.slice(2).toLowerCase();n[i]!==e[i]&&(e[i]&&t.removeEventListener(a,e[i]),t.addEventListener(a,n[i]))}}function A1(t,e){const n=Object.keys(e);let i=!1;for(const a of n)if(Yf.indexOf(a)!==-1){const u=Rl[a];if(u){if(t.activatedEvents.indexOf(u)!==-1)continue;i=!0,t.activatedEvents.push(u)}}i&&t.triggerEventActivation()}const Ld=new Map,M1={};function pM(t,{args:e=[],...n},i,a,u){if(!(i instanceof yd)&&u){const g=S=>S.return?g(S.return):S.stateNode&&S.stateNode.containerInfo;i=g(u)}let f,p=i.world;switch(t){case"world":f=Il.withProps({width:n.width,height:n.height,viewingDirection:"left-to-right"}),f.activatedEvents=p.activatedEvents,f.eventHandlers=p.eventHandlers,f.subscriptions=p.subscriptions,f.triggerEventActivation(),p=f;break;case"box":f=new uc;break;case"shape":f=new r1;break;case"worldObject":case"world-object":f=new lc;break;case"worldImage":case"world-image":f=new Ar;break;case"texture":f=new kp;break;case"compositeImage":case"composite-image":f=new jA({id:n.id,width:n.width,height:n.height,images:[]});break;case"tiledImage":case"tiled-image":f=no.fromTile(n.uri,n.display,n.tile,n.scaleFactor,void 0,n.format);break;case"paragraph":f=new hd,f.text=n.children;break;default:return}return A1(p,n),R1(f,{},n),f}function vM(t,e){if(e instanceof Il)t.world=e;else if(e instanceof lc)t.world.appendChild(e);else if(e)throw new Error("Invalid root")}const hc=hC({unstable_now:_d,now:_d,createInstance:pM,removeChild:C1,appendChild:w1,appendInitialChild:w1,insertBefore:T1,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:typeof setTimeout<"u"?setTimeout:void 0,cancelTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,setTimeout:typeof setTimeout<"u"?setTimeout:void 0,clearTimeout:typeof clearTimeout<"u"?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:vM,removeChildFromContainer:dM,createTextInstance(){},insertInContainerBefore:hM,prepareUpdate(t,e,n,i,a){return A1(a.world,i),i},commitUpdate(t,e,n,i,a,u){t.applyProps&&e&&R1(t,i,e)},finalizeInitialChildren(t){return t==null?void 0:t.__handlers},getChildHostContext(){return M1},getRootHostContext(){return M1},prepareForCommit(t){return t.isCommitting=!0,null},preparePortalMount(){},hideInstance(t){t&&t.points&&(t.points[0]=0)},unhideInstance(t,e){t&&t.points&&(t.points[0]=1)},getPublicInstance(t){return t},hideTextInstance(){throw new Error("Text is not allowed in the react-three-fibre tree. You may have extraneous whitespace between components.")},resetAfterCommit(t){t.isCommitting=!1,t.pendingUpdate=!0,t.world&&t.world.needsRecalculate&&(t.world.recalculateWorldSize(),t.world.triggerRepaint())},shouldSetTextContent(){return!1},clearContainer(){return!1}});hc.injectIntoDevTools({bundleType:0,version:T.version,rendererPackageName:"@atlas-viewer/atlas"});function O1(t,e){const n=Ld.get(t);n&&hc.updateContainer(null,n,null,()=>{Ld.delete(t),e&&e(t)})}const mM={render(t,e){const n=Ld.get(e);if(n)hc.updateContainer(t,n,null,()=>{});else{const i=hc.createContainer(e,0,null,!1,null,"",()=>{},null);hc.updateContainer(t,i,null,null),Ld.set(e,i)}}},gM=T.memo(({children:t,setIsReady:e,onCreated:n,bounds:i,preset:a,mode:u="explore"})=>{const f=T.useCallback(function(g){const S=()=>{e(!0)};return T.useEffect(()=>{if(a){a.runtime.goHome();const m=n&&n(a);return void(m&&m.then?m.then(S):S())}return()=>{}},[]),g.children},[a]);return T.useLayoutEffect(()=>{if(a){const p=a.runtime;u!==p.mode&&(p.mode=u),mM.render(T.createElement(T.StrictMode,null,T.createElement(f,null,T.createElement(cv.Provider,{value:i},T.createElement(Od.Provider,{value:u},T.createElement(uv.Provider,{value:a},t))))),p)}},[a,u,t]),null});class yM{constructor(e,n){this.fragmentShaderSource=`
227
227
  precision mediump float;
228
228
 
229
229
  uniform sampler2D u_image;
@@ -256,14 +256,14 @@ No matching component was found for:
256
256
 
257
257
  v_texCoord = a_texCoord;
258
258
  }
259
- `,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=(n==null?void 0:n.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,n,i){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+=n}prepareLayer(e){(!e.__host||!e.__host.webgl)&&((e instanceof Ar||e instanceof no)&&this.createImageHost(e),e instanceof kp&&this.createTextureHost(e))}createTextureHost(e){e.__host=e.__host?e.__host:{};const n=this.gl,i=this.gl.createTexture();n.bindTexture(n.TEXTURE_2D,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);let a;if(e instanceof kp){const u=e.getTexture();u.source&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u.source),a=u}n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),e.__host.webgl={height:e.height,width:e.width,texture:i,lastImage:a}}createImageHost(e){const n=[...new Array(e.points.length/5)];e.__host=e.__host?e.__host:{},e.__host.webgl={height:e.height,width:e.width,textures:n,loading:[],loaded:[],lastLevelRendered:-1,onLoad:(i,a)=>{const u=this.gl,f=this.gl.createTexture();u.bindTexture(u.TEXTURE_2D,f),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,a),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[i]=f,e.__host.webgl.loaded.push(i)}}}paint(e,n,i,a,u,f){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,x=this.gl.RGBA,T=this.gl.UNSIGNED_BYTE;this.gl.bindTexture(this.gl.TEXTURE_2D,e.__host.webgl.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,m,x,T,g.source),e.__host.webgl.lastImage=g.hash}catch(S){e.__host.webgl.error=S}}if(e.__host.webgl.loading&&e.__host.webgl.loading.indexOf(n)===-1&&e.getImageUrl){e.__host.webgl.loading.push(n);const g=document.createElement("img");g.decoding="async",g.crossOrigin="anonymous",g.src=e.getImageUrl(n),g.onload=()=>(g.onload=null,e.__host.webgl.onLoad(n,g))}const p=e.__host.webgl.texture?e.__host.webgl.texture:e.__host.webgl.textures[n];p&&(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,p),this.gl.uniform1i(this.uniforms.texture,0),this.setRectangle(i,a,u,f),this.gl.drawArrays(this.gl.TRIANGLES,0,6))}}afterPaintLayer(e,n){}pendingUpdate(){return!0}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}afterFrame(){}getScale(e,n,i){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const a=this.getCanvasDims(),u=a.width/e,f=a.height/n,p=(u<f?f:u)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}getViewportBounds(e,n,i){return null}createShader(e,n){const i=this.gl.createShader(e);if(i){if(this.gl.shaderSource(i,n),this.gl.compileShader(i),this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS))return i;const u=this.gl.getShaderInfoLog(i);if(this.gl.deleteShader(i),u)throw new Error(u)}throw new Error("Invalid shader")}createProgram(e,n){const i=this.gl.createProgram();if(i){if(this.gl.attachShader(i,e),this.gl.attachShader(i,n),this.gl.linkProgram(i),this.gl.getProgramParameter(i,this.gl.LINK_STATUS))return i;const u=this.gl.getProgramInfoLog(i);if(this.gl.deleteProgram(i),u)throw new Error(u)}throw new Error("Invalid program")}resizeCanvasToDisplaySize(){const e=this.gl.canvas,n=e.clientWidth,i=e.clientHeight,a=e.width!==n||e.height!==i;return a&&(e.width=n,e.height=i),a}createArrayBuffer(e){const n=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),e&&this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),!n)throw new Error("Cannot create buffer");return n}setRectangle(e,n,i,a){this.gl.bufferData(this.gl.ARRAY_BUFFER,this.getRectangle(e,n,i,a),this.gl.STATIC_DRAW)}getRectangle(e,n,i,a){const u=e,f=e+i,p=n,g=n+a;return this.rectBuffer.set([u,p,f,p,u,g,u,g,f,p,f,g]),this.rectBuffer}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}function fv(t,e){const n=e?t:JSON.stringify(t);let i=5381,a=n.length;for(;a;)i=i*33^n.charCodeAt(--a);const f=(i>>>0).toString(16);return f.length%2?"0"+f:f}class _1{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 n=e.replace(/\s\s+/g," ").replace(/: /g,":").replace(/; /g,";").trim(),i=this.sheetPrefix+fv(n,!0);return this.stylesheetClasses.indexOf(i)!==-1||(this.stylesheetClasses.push(i),this.activeStylesheetClasses.push(i),this.stylesheetEntries[i]=n,this.sheetsDidUpdate=!0),i}removeStylesheet(e){const n=this.sheetPrefix+fv(e,!0);this.stylesheetClasses.indexOf(n)&&(this.stylesheetClasses=this.stylesheetClasses.filter(i=>i!==n)),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 L1{constructor(e,n){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={triggerResize:()=>{},box:!1,text:!1,sheetPrefix:"",inlineStyles:!1,background:"",...n||{}},this.stylesheet=new _1({sheetPrefix:this.options.sheetPrefix}),this.options.inlineStyles||this.htmlContainer.appendChild(this.stylesheet.getElement()),this.options.background&&this.htmlContainer.classList.add(this.stylesheet.addStylesheet(`
259
+ `,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=(n==null?void 0:n.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,n,i){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+=n}prepareLayer(e){(!e.__host||!e.__host.webgl)&&((e instanceof Ar||e instanceof no)&&this.createImageHost(e),e instanceof kp&&this.createTextureHost(e))}createTextureHost(e){e.__host=e.__host?e.__host:{};const n=this.gl,i=this.gl.createTexture();n.bindTexture(n.TEXTURE_2D,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);let a;if(e instanceof kp){const u=e.getTexture();u.source&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u.source),a=u}n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),e.__host.webgl={height:e.height,width:e.width,texture:i,lastImage:a}}createImageHost(e){const n=[...new Array(e.points.length/5)];e.__host=e.__host?e.__host:{},e.__host.webgl={height:e.height,width:e.width,textures:n,loading:[],loaded:[],lastLevelRendered:-1,onLoad:(i,a)=>{const u=this.gl,f=this.gl.createTexture();u.bindTexture(u.TEXTURE_2D,f),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,a),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[i]=f,e.__host.webgl.loaded.push(i)}}}paint(e,n,i,a,u,f){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,x=this.gl.RGBA,R=this.gl.UNSIGNED_BYTE;this.gl.bindTexture(this.gl.TEXTURE_2D,e.__host.webgl.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,m,x,R,g.source),e.__host.webgl.lastImage=g.hash}catch(S){e.__host.webgl.error=S}}if(e.__host.webgl.loading&&e.__host.webgl.loading.indexOf(n)===-1&&e.getImageUrl){e.__host.webgl.loading.push(n);const g=document.createElement("img");g.decoding="async",g.crossOrigin="anonymous",g.src=e.getImageUrl(n),g.onload=()=>(g.onload=null,e.__host.webgl.onLoad(n,g))}const p=e.__host.webgl.texture?e.__host.webgl.texture:e.__host.webgl.textures[n];p&&(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,p),this.gl.uniform1i(this.uniforms.texture,0),this.setRectangle(i,a,u,f),this.gl.drawArrays(this.gl.TRIANGLES,0,6))}}afterPaintLayer(e,n){}pendingUpdate(){return!0}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}afterFrame(){}getScale(e,n,i){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const a=this.getCanvasDims(),u=a.width/e,f=a.height/n,p=(u<f?f:u)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}getCanvasDims(){return{width:this.canvas.width/this.dpi,height:this.canvas.height/this.dpi}}getViewportBounds(e,n,i){return null}createShader(e,n){const i=this.gl.createShader(e);if(i){if(this.gl.shaderSource(i,n),this.gl.compileShader(i),this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS))return i;const u=this.gl.getShaderInfoLog(i);if(this.gl.deleteShader(i),u)throw new Error(u)}throw new Error("Invalid shader")}createProgram(e,n){const i=this.gl.createProgram();if(i){if(this.gl.attachShader(i,e),this.gl.attachShader(i,n),this.gl.linkProgram(i),this.gl.getProgramParameter(i,this.gl.LINK_STATUS))return i;const u=this.gl.getProgramInfoLog(i);if(this.gl.deleteProgram(i),u)throw new Error(u)}throw new Error("Invalid program")}resizeCanvasToDisplaySize(){const e=this.gl.canvas,n=e.clientWidth,i=e.clientHeight,a=e.width!==n||e.height!==i;return a&&(e.width=n,e.height=i),a}createArrayBuffer(e){const n=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),e&&this.gl.bufferData(this.gl.ARRAY_BUFFER,e,this.gl.STATIC_DRAW),!n)throw new Error("Cannot create buffer");return n}setRectangle(e,n,i,a){this.gl.bufferData(this.gl.ARRAY_BUFFER,this.getRectangle(e,n,i,a),this.gl.STATIC_DRAW)}getRectangle(e,n,i,a){const u=e,f=e+i,p=n,g=n+a;return this.rectBuffer.set([u,p,f,p,u,g,u,g,f,p,f,g]),this.rectBuffer}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}function fv(t,e){const n=e?t:JSON.stringify(t);let i=5381,a=n.length;for(;a;)i=i*33^n.charCodeAt(--a);const f=(i>>>0).toString(16);return f.length%2?"0"+f:f}class _1{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 n=e.replace(/\s\s+/g," ").replace(/: /g,":").replace(/; /g,";").trim(),i=this.sheetPrefix+fv(n,!0);return this.stylesheetClasses.indexOf(i)!==-1||(this.stylesheetClasses.push(i),this.activeStylesheetClasses.push(i),this.stylesheetEntries[i]=n,this.sheetsDidUpdate=!0),i}removeStylesheet(e){const n=this.sheetPrefix+fv(e,!0);this.stylesheetClasses.indexOf(n)&&(this.stylesheetClasses=this.stylesheetClasses.filter(i=>i!==n)),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 L1{constructor(e,n){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={triggerResize:()=>{},box:!1,text:!1,sheetPrefix:"",inlineStyles:!1,background:"",...n||{}},this.stylesheet=new _1({sheetPrefix:this.options.sheetPrefix}),this.options.inlineStyles||this.htmlContainer.appendChild(this.stylesheet.getElement()),this.options.background&&this.htmlContainer.classList.add(this.stylesheet.addStylesheet(`
260
260
  background: ${this.options.background};
261
261
  `)),this.classes={hostClassName:this.stylesheet.addStylesheet(`
262
262
  position: absolute;
263
263
  transform-origin: 0px 0px;
264
- `),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 n=document.createElement(e.props.href?"a":"div");if(e.props.href){n.style.display="block",n.href=e.props.href;const i=e.props.hrefTarget||"_blank";n.target=i,i!=="_self"&&(n.rel="noopener noreferrer")}n.title=e.props.title||"",this.options.inlineStyles?(n.style.display="block",n.style.position="absolute",n.style.overflow="hidden",n.style.transformOrigin="0px 0px"):n.classList.add(this.classes.hostClassName),e.__host={element:n,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,n,i){if(e.__revision!==e.__host.revision){const a=e.__host.element,u=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?a.style.pointerEvents="all":u.push(this.classes.interactive):this.options.inlineStyles?a.style.pointerEvents="none":u.push(this.classes.nonInteractive),e.props.href){a.style.display="block",a.href=e.props.href;const g=e.props.hrefTarget||"_blank";a.target=g,g!=="_self"?a.rel="noopener noreferrer":a.rel=""}else a.href&&a.removeAttribute("href");if(e.props.title&&(a.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?(a.style.width=`${n||e.width}px`,a.style.height=`${i||e.height}px`):(a.style.width=`${e.width}px`,a.style.height=`${e.height}px`),e.props.style){Object.assign(a.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof hd){e.text&&(a.innerText=e.text),e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor),e.color&&(a.style.color=e.color),e.props.font&&(a.style.font=e.props.font),e.props.textAlign&&(a.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=u.join(" ");a.className=g,a.part=g}e instanceof uc&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(a.style.backgroundColor=e.props.backgroundColor),e.props.border!==a.style.border&&(a.style.border=e.props.border));const p=u.join(" ");a.className=p,a.part=p}}afterFrame(e,n,i){this.stylesheet.updateSheet();for(const a of this.previousVisible)this.visible.indexOf(a)===-1&&this.htmlContainer&&a.__id&&this.htmlIds.indexOf(a.__id)!==-1&&this.htmlContainer.removeChild(a.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,n){}beforeFrame(e,n,i){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){const i=this.rendererPosition.width/e,a=this.rendererPosition.height/n;return i<a?a:i}getViewportBounds(e,n,i){return null}isReady(){return!1}paint(e,n,i,a,u,f){if(this.zIndex++,(this.options.text&&e instanceof hd||e instanceof uc&&(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,f);const p=u/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px)`:g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px) scale(${p})`,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 hd||e instanceof uc)&&this.createHtmlHost(e)}resize(e,n){typeof e<"u"&&typeof n<"u"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${n}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}const Pd=class{constructor(t,e,n){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=a=>{this.pointerMoveEvent=a},this.onWheelEvent=a=>{a.preventDefault(),this.onPointerEvent(a)},this.onTouchEvent=a=>{const u=Rl[a.type],f=[],p=a.touches.length;for(let g=0;g<p;g++){const S=a.touches.item(g);if(!S)continue;const{x:m,y:x}=this.runtime.viewerToWorld(S.clientX-this.bounds.left,S.clientY-this.bounds.top),T={id:S.identifier,x:m,y:x};f.push(T)}f.length&&this.assignToEvent(a,f[0].x,f[0].y),u!=="onTouchEnd"?(this.pointerEventState.lastTouches=f,a.atlasTouches=f,this.runtime.world.propagateTouchEvent(u,a,f)):(a.atlasTouches=[],this.runtime.world.propagateTouchEvent(u,a,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=a=>{const u=Rl[a.type];if(u&&this.runtime.world.activatedEvents.indexOf(u)!==-1){const{x:f,y:p}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,f,p),this.runtime.world.propagatePointerEvent(u,a,f,p)}},this.onPointerDown=a=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=a.clientX,this.pointerEventState.mouseDownStart.y=a.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",a,u.x,u.y)}},800),this.onPointerEvent(a)},this.onPointerUp=a=>{if(this.pointerEventState.isClicking){const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onClick",a,u,f)}if(this.pointerEventState.isDragging){for(const u of this.pointerEventState.itemsBeingDragged)u.dispatchEvent("onDragEnd",a);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(a)},this.onPointerMove=a=>{this.pointerMoveEvent=void 0;const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);if(Number.isNaN(u)||Number.isNaN(f))return;this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onPointerMove",a,u,f);const p=this.runtime.world.propagatePointerEvent("onMouseMove",a,u,f),g=[],S=[];for(const m of p)g.push(m.id),S.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",a),m.dispatchEvent("onPointerEnter",a),m.dispatchEvent("onMouseOver",a),m.dispatchEvent("onPointerOver",a));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",a),m.dispatchEvent("onPointerLeave",a),m.dispatchEvent("onMouseOut",a),m.dispatchEvent("onPointerOut",a));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",a);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&Gf(this.pointerEventState.mouseDownStart,{x:a.clientX,y:a.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",{...a,atlas:{x:m.x,y:m.y}},m.x,m.y)}this.pointerEventState.mousedOver=S},this.element=t,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=t.getBoundingClientRect(),this.options={simulationRate:0,...n||{}};let i=0;e.registerHook("useFrame",a=>{i+=a,i>this.options.simulationRate&&this.pointerMoveEvent&&(i=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(t){t==="event-activation"&&this.activateEvents()}assignToEvent(t,e,n){Pd.eventPool.atlas.x=e,Pd.eventPool.atlas.y=n,t.atlas=Pd.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(t){return t.startsWith("on")?t.slice(2).toLowerCase():t.toLowerCase()}stop(){this.unsubscribe();for(const[t,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(t),e)}};let dv=Pd;dv.eventPool={atlas:{x:0,y:0}};function P1({interactive:t=!0,viewport:e,forceRefresh:n,canvasElement:i,overlayElement:a,controllerConfig:u,unstable_webglRenderer:f,dpi:p,debug:g,canvasBox:S=!0,polygon:m=!0,navigatorElement:x,background:T,runtimeOptions:_}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const M=t?S1({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...u||{}}):void 0,k=new o1([f?new pM(i,{dpi:p}):new $A(i,{dpi:p,debug:g,box:S,polygon:m,background:T}),a?new L1(a,{box:f||!S,text:!0,triggerResize:n}):void 0,x?new WA(x):void 0]),L=new yd(k,new Il(1024,1024),e,M?[M]:[],_),P=new dv(i,L);return{name:"default-preset",em:P,runtime:L,renderer:k,controller:M,canvas:i,navigator:x,unmount(){O1(L),L.stopControllers(),L.stop(),L.reset(),P&&P.stop()}}}class vM{constructor(e,n){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:i,height:a}=this.rendererPosition;this.width=i,this.height=a,this.options={addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000",...n||{}},this.stylesheet=new _1({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
264
+ `),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 n=document.createElement(e.props.href?"a":"div");if(e.props.href){n.style.display="block",n.href=e.props.href;const i=e.props.hrefTarget||"_blank";n.target=i,i!=="_self"&&(n.rel="noopener noreferrer")}n.title=e.props.title||"",this.options.inlineStyles?(n.style.display="block",n.style.position="absolute",n.style.overflow="hidden",n.style.transformOrigin="0px 0px"):n.classList.add(this.classes.hostClassName),e.__host={element:n,revision:null,relative:!1},this.updateHtmlHost(e,e.width,e.height),e.__onCreate&&e.__onCreate()}}triggerResize(){this.options.triggerResize()}updateHtmlHost(e,n,i){if(e.__revision!==e.__host.revision){const a=e.__host.element,u=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?a.style.pointerEvents="all":u.push(this.classes.interactive):this.options.inlineStyles?a.style.pointerEvents="none":u.push(this.classes.nonInteractive),e.props.href){a.style.display="block",a.href=e.props.href;const g=e.props.hrefTarget||"_blank";a.target=g,g!=="_self"?a.rel="noopener noreferrer":a.rel=""}else a.href&&a.removeAttribute("href");if(e.props.title&&(a.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?(a.style.width=`${n||e.width}px`,a.style.height=`${i||e.height}px`):(a.style.width=`${e.width}px`,a.style.height=`${e.height}px`),e.props.style){Object.assign(a.style,e.props.style||{},e.hovering?e.props.hoverStyles||{}:{},e.pressing?e.props.pressStyles||{}:{});return}if(this.options.text&&e instanceof hd){e.text&&(a.innerText=e.text),e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor),e.color&&(a.style.color=e.color),e.props.font&&(a.style.font=e.props.font),e.props.textAlign&&(a.style.textAlign=e.props.textAlign),e.__host.revision=e.__revision;const g=u.join(" ");a.className=g,a.part=g}e instanceof uc&&(this.options.box||e.props.className||e.props.html)&&(e.props.backgroundColor&&(a.style.backgroundColor=e.props.backgroundColor),e.props.border!==a.style.border&&(a.style.border=e.props.border));const p=u.join(" ");a.className=p,a.part=p}}afterFrame(e,n,i){this.stylesheet.updateSheet();for(const a of this.previousVisible)this.visible.indexOf(a)===-1&&this.htmlContainer&&a.__id&&this.htmlIds.indexOf(a.__id)!==-1&&this.htmlContainer.removeChild(a.__host.element);this.previousVisible=this.visible}afterPaintLayer(e,n){}beforeFrame(e,n,i){this.stylesheet.clearClasses(),this.paintTx++,this.zIndex=0,this.visible=[]}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){const i=this.rendererPosition.width/e,a=this.rendererPosition.height/n;return i<a?a:i}getViewportBounds(e,n,i){return null}isReady(){return!1}paint(e,n,i,a,u,f){if(this.zIndex++,(this.options.text&&e instanceof hd||e instanceof uc&&(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,f);const p=u/e.width,g=e.__host.element;g.style.zIndex=`${this.zIndex}`,e.props.relativeStyle?g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px)`:g.style.transform=`translate(${Math.round(i)}px, ${Math.round(a)}px) scale(${p})`,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 hd||e instanceof uc)&&this.createHtmlHost(e)}resize(e,n){typeof e<"u"&&typeof n<"u"&&(this.htmlContainer.style.width=`${e}px`,this.htmlContainer.style.height=`${n}px`),this.rendererPosition=this.htmlContainer.getBoundingClientRect()}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}const Pd=class{constructor(t,e,n){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=a=>{this.pointerMoveEvent=a},this.onWheelEvent=a=>{a.preventDefault(),this.onPointerEvent(a)},this.onTouchEvent=a=>{const u=Rl[a.type],f=[],p=a.touches.length;for(let g=0;g<p;g++){const S=a.touches.item(g);if(!S)continue;const{x:m,y:x}=this.runtime.viewerToWorld(S.clientX-this.bounds.left,S.clientY-this.bounds.top),R={id:S.identifier,x:m,y:x};f.push(R)}f.length&&this.assignToEvent(a,f[0].x,f[0].y),u!=="onTouchEnd"?(this.pointerEventState.lastTouches=f,a.atlasTouches=f,this.runtime.world.propagateTouchEvent(u,a,f)):(a.atlasTouches=[],this.runtime.world.propagateTouchEvent(u,a,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=a=>{const u=Rl[a.type];if(u&&this.runtime.world.activatedEvents.indexOf(u)!==-1){const{x:f,y:p}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,f,p),this.runtime.world.propagatePointerEvent(u,a,f,p)}},this.onPointerDown=a=>{this.pointerEventState.isPressed=!0,this.pointerEventState.isClicking=!0,this.pointerEventState.mouseDownStart.x=a.clientX,this.pointerEventState.mouseDownStart.y=a.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",a,u.x,u.y)}},800),this.onPointerEvent(a)},this.onPointerUp=a=>{if(this.pointerEventState.isClicking){const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onClick",a,u,f)}if(this.pointerEventState.isDragging){for(const u of this.pointerEventState.itemsBeingDragged)u.dispatchEvent("onDragEnd",a);this.pointerEventState.isDragging=!1}this.pointerEventState.isClicking=!1,this.pointerEventState.isPressed=!1,this.pointerEventState.itemsBeingDragged=[],this.onPointerEvent(a)},this.onPointerMove=a=>{this.pointerMoveEvent=void 0;const{x:u,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);if(Number.isNaN(u)||Number.isNaN(f))return;this.assignToEvent(a,u,f),this.runtime.world.propagatePointerEvent("onPointerMove",a,u,f);const p=this.runtime.world.propagatePointerEvent("onMouseMove",a,u,f),g=[],S=[];for(const m of p)g.push(m.id),S.push(m),this.pointerEventState.mousedOver.indexOf(m)===-1&&(m.dispatchEvent("onMouseEnter",a),m.dispatchEvent("onPointerEnter",a),m.dispatchEvent("onMouseOver",a),m.dispatchEvent("onPointerOver",a));for(const m of this.pointerEventState.mousedOver)g.indexOf(m.id)===-1&&(m.dispatchEvent("onMouseLeave",a),m.dispatchEvent("onPointerLeave",a),m.dispatchEvent("onMouseOut",a),m.dispatchEvent("onPointerOut",a));if(this.pointerEventState.isDragging)for(const m of this.pointerEventState.itemsBeingDragged)m.dispatchEvent("onDrag",a);if(this.pointerEventState.isPressed&&!this.pointerEventState.isDragging&&Gf(this.pointerEventState.mouseDownStart,{x:a.clientX,y:a.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",{...a,atlas:{x:m.x,y:m.y}},m.x,m.y)}this.pointerEventState.mousedOver=S},this.element=t,this.runtime=e,this.unsubscribe=e.world.addLayoutSubscriber(this.layoutSubscriber.bind(this)),this.bounds=t.getBoundingClientRect(),this.options={simulationRate:0,...n||{}};let i=0;e.registerHook("useFrame",a=>{i+=a,i>this.options.simulationRate&&this.pointerMoveEvent&&(i=0,e.updateNextFrame())}),e.registerHook("useBeforeFrame",()=>{this.pointerMoveEvent&&this.onPointerMove(this.pointerMoveEvent)}),this.activateEvents()}updateBounds(){this.bounds=this.element.getBoundingClientRect(),this.runtime.updateRendererScreenPosition()}layoutSubscriber(t){t==="event-activation"&&this.activateEvents()}assignToEvent(t,e,n){Pd.eventPool.atlas.x=e,Pd.eventPool.atlas.y=n,t.atlas=Pd.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(t){return t.startsWith("on")?t.slice(2).toLowerCase():t.toLowerCase()}stop(){this.unsubscribe();for(const[t,e]of this.eventHandlers)this.element.removeEventListener(this.normalizeEventName(t),e)}};let dv=Pd;dv.eventPool={atlas:{x:0,y:0}};function P1({interactive:t=!0,viewport:e,forceRefresh:n,canvasElement:i,overlayElement:a,controllerConfig:u,unstable_webglRenderer:f,dpi:p,debug:g,canvasBox:S=!0,polygon:m=!0,navigatorElement:x,background:R,runtimeOptions:_}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const M=t?S1({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...u||{}}):void 0,k=new o1([f?new yM(i,{dpi:p}):new QA(i,{dpi:p,debug:g,box:S,polygon:m,background:R}),a?new L1(a,{box:f||!S,text:!0,triggerResize:n}):void 0,x?new GA(x):void 0]),L=new yd(k,new Il(1024,1024),e,M?[M]:[],_),P=new dv(i,L);return{name:"default-preset",em:P,runtime:L,renderer:k,controller:M,canvas:i,navigator:x,unmount(){O1(L),L.stopControllers(),L.stop(),L.reset(),P&&P.stop()}}}class SM{constructor(e,n){this.pending=!0,this.zIndex=0,this.lastKnownScale=1,this.currentlyVisible=[],this.previouslyVisible=[],this.container=e,this.rendererPosition=e.getBoundingClientRect();const{width:i,height:a}=this.rendererPosition;this.width=i,this.height=a,this.options={addPart:!1,setDraggableFalse:!1,imageClass:"",widthStylesheet:!1,sheetPrefix:"position-",background:"#000",...n||{}},this.stylesheet=new _1({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
265
265
  background: ${this.options.background};
266
- `)),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,n,i){this.stylesheet.updateSheet();for(const a of this.previouslyVisible)this.currentlyVisible.indexOf(a)===-1&&this.container.removeChild(a);for(const a of this.currentlyVisible)this.previouslyVisible.indexOf(a)===-1&&this.container.appendChild(a);this.previouslyVisible=this.currentlyVisible,this.currentlyVisible=[]}afterPaintLayer(e,n){}beforeFrame(e,n,i){this.stylesheet.clearClasses(),this.zIndex=0}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const i=this.width/e,a=this.height/n,u=i<a?a:i;return Number.isNaN(u)||(this.lastKnownScale=u),this.lastKnownScale}getViewportBounds(e,n,i){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,n,i,a,u,f){if(this.pending=!1,this.zIndex++,e instanceof Ar){if(!e.__host){const g=this.createImage();g.src=e.uri,e.__host=g,this.container.appendChild(e.__host)}const p=e.__host;this.currentlyVisible.push(p),p.style.zIndex=`${this.zIndex}`,p.style.opacity=`${e.style.opacity}`,this.options.widthStylesheet?p.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${u+Number.MIN_VALUE}px`,p.style.height=`${f+Number.MIN_VALUE}px`),p.style.transform=`translate(${i}px, ${a}px)`}if(e instanceof no){if(e.__host||(e.__host={images:[]}),!e.__host.images[n]){const g=e.getImageUrl(n),S=this.createImage();S.src=g,e.__host.images[n]=S,this.container.appendChild(S)}const p=e.__host.images[n];p.style.zIndex=`${this.zIndex}`,p.style.opacity=`${e.style.opacity}`,this.currentlyVisible.push(p),this.options.widthStylesheet?p.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${u+Number.MIN_VALUE}px`,p.style.height=`${f+Number.MIN_VALUE}px`),p.style.transform=`translate(${i}px, ${a}px)`}}pendingUpdate(){return this.pending}prepareLayer(e){}finishLayer(e){}reset(){}}function mM({interactive:t,viewport:e,forceRefresh:n,containerElement:i,overlayElement:a,controllerConfig:u,background:f}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const p=t?S1({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...u||{}}):void 0,g=new vM(i,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:f}),S=a?new o1([g,new L1(a,{box:!0,text:!0,triggerResize:n})]):g,m=new yd(S,new Il(1024,1024),e,p?[p]:[]),x=new dv(i,m);return{name:"static-preset",em:x,runtime:m,renderer:S,controller:p,container:i,overlay:a,unmount(){O1(m),m.stopControllers(),m.stop(),x&&x.stop()}}}const gM={"default-preset":P1,"static-preset":mM},yM={};function SM(t,e){const n=R.useRef(),i=R.useRef(),a=R.useRef(),u=R.useRef(),f=R.useRef({width:e.width,height:e.height,didUpdate:!0}),[p="default-preset",g=yM]=Array.isArray(t)?t||[]:[t],[S,m]=R.useState(null);R.useLayoutEffect(()=>{const T=i.current,_=u.current,M=n.current,k=a.current,P=(gM[p]||P1)({containerElement:_,canvasElement:T,overlayElement:M,navigatorElement:k,viewport:f.current,dpi:window.devicePixelRatio||1,forceRefresh:e.forceRefresh,unstable_webglRenderer:e.unstable_webglRenderer,...g||{}});return m(P),()=>{P&&(P.unmount(),T&&(T.height=0,T.width=0),M&&(M.innerHTML=""),k&&(k.height=0,k.width=0))}},[p,g]);const x=R.useMemo(()=>({canvas:i,overlay:n,container:u,navigator:a}),[]);return[p,S,f,x]}function bM(t){return R.useMemo(()=>fv(t),t)}const pc=R.forwardRef((t,e)=>R.createElement("div",{...t,ref:e,part:t.className})),EM=({htmlChildren:t,renderPreset:e,onCreated:n,mode:i="explore",resetWorldOnChange:a=!0,unstable_webglRenderer:u=!1,unstable_noReconciler:f=!1,hideInlineStyle:p=!1,controllerConfig:g,children:S,overlayStyle:m,containerStyle:x,enableNavigator:T,className:_,containerProps:M={},homePosition:k,background:L,runtimeOptions:P,debug:O,...j})=>{const[q,ee]=R.useState(L),[H,Z]=R.useState(i),[ie,W]=R.useState(!1),re=R.useMemo(()=>(typeof e=="string"&&(e=[e,{}]),q||O?e?[e[0],{debug:O,background:q,...e[1]||{}}]:["default-preset",{background:q,debug:O}]:e||"default-preset"),[e,q,O]),[ge,be,Ee]=E1({scroll:!0}),Ue=R.useRef(),je=Be=>{Ue.current=Be,ge(Be)},[Xe,ce,me,tt]=SM(re,{width:j.width,height:j.height,forceRefresh:Ee,unstable_webglRenderer:u}),[mt,he]=R.useState("");R.useEffect(()=>{Z(i)},[i]),R.useEffect(()=>{ce&&ce.em&&ce.em.updateBounds()},[ce,be]),R.useEffect(()=>{ce==null||ce.runtime.setOptions(P||{})},[P]),R.useEffect(()=>{ce&&ce.runtime&&(ce.runtime.mode=H),ie&&ce&&(ce.ready=!0)},[ce,ie,H]),R.useEffect(()=>{ce&&(ce.runtime.manualHomePosition=!!k,ce.runtime.setHomePosition(k))},[ce,k]),R.useEffect(()=>{if(ce){const Be=ce.runtime;Be.resize(me.current.width,j.width,me.current.height,j.height),me.current.width=j.width,me.current.height=j.height,Be.updateNextFrame(),me.current.didUpdate=!0}},[ce,j.width,j.height]),R.useLayoutEffect(()=>{ce&&(ce.overlay&&(ce.overlay.style.width=`${be.width}px`,ce.overlay.style.height=`${be.height}px`),ce.container&&(ce.container.style.width=`${be.width}px`,ce.container.style.height=`${be.height}px`))},[ce,be.height,be.width]),R.useLayoutEffect(()=>{const Be=()=>{if(ce){const nt=ce.runtime;me.current.width!==j.width&&me.current.height!==j.height&&(nt.resize(me.current.width,j.width,me.current.height,j.height),me.current.width=j.width,me.current.height=j.height,nt.updateNextFrame(),me.current.didUpdate=!0)}};return window.addEventListener("resize",Be),()=>window.removeEventListener("resize",Be)},[ce,j.height,j.width]);const Fe={width:120},$e=()=>{if(ce&&ce.navigator){const Be=ce.runtime.world.height,nt=ce.runtime.world.width,ot=window.devicePixelRatio||1,lt=Fe.width,Et=Fe.width/nt*Be;ce.navigator.width=lt*ot,ce.navigator.height=Et*ot,ce.navigator.style.width=lt+"px",ce.navigator.style.height=Et+"px"}};R.useLayoutEffect(()=>{if(ce){$e();const Be=ce.runtime;return Be.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&($e(),Be.resize(me.current.width,j.width,me.current.height,j.height))})}return()=>{}},[ce]);const ht=R.useCallback(function(nt){const ot=()=>{W(!0)};return R.useEffect(()=>{if(ce){ce.runtime.goHome();const lt=n&&n(ce);return void(lt&&lt.then?lt.then(ot):ot())}else throw new Error("Invalid configuration - no runtime found")},[]),nt.children},[ce]);R.useEffect(()=>{if(ce){const Be=ce.runtime;if(a)return Be.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&Be.goHome()})}return()=>{}},[ce,a]),R.useEffect(()=>ce?ce.runtime.registerHook("useBeforeFrame",()=>{var nt;if(me.current.didUpdate&&ce.canvas){const ot=window.devicePixelRatio||1,lt=me.current.width,Et=me.current.height;ce.canvas.width=lt*ot,ce.canvas.height=Et*ot,ce.canvas.style.width=lt+"px",ce.canvas.style.height=Et+"px",(nt=ce.canvas.getContext("2d"))==null||nt.scale(ot,ot),ce&&ce.em&&ce.em.updateBounds(),me.current.didUpdate=!1}}):()=>{},[ce,a]),R.useEffect(()=>{const Be=()=>{ce&&(Z("sketch"),he("mode-sketch")),window.removeEventListener("keyup",Be)},nt=ot=>{if(ot.code==="Space"&&ce&&ce.runtime.mode==="sketch"){if(ot.target&&ot.target.tagName&&ot.target.tagName.toLowerCase()==="input")return;ot.preventDefault(),Z("explore"),he("mode-explore"),window.addEventListener("keyup",Be)}};return window.addEventListener("keydown",nt),()=>{window.removeEventListener("keydown",nt),window.removeEventListener("keyup",Be)}},[ce]),R.useLayoutEffect(()=>{if(Ue.current&&!q){const nt=getComputedStyle(Ue.current).getPropertyValue("--atlas-background");nt&&ee(nt)}},[q]);const{height:gt,width:gn,...Xt}=j,yt=bM([j.width,j.height]);return R.createElement(pc,{ref:je,className:["atlas",p?"":`atlas-width-${yt}`,mt,_].filter(Boolean).join(" ").trim(),style:{...x,...p?{}:{width:j.width,height:j.height}}},Xe==="static-preset"?R.createElement(pc,{className:"atlas-static-container",style:ce&&ce.controller?void 0:{pointerEvents:"none"},ref:tt.container,tabIndex:0,...M}):R.createElement("canvas",{className:"atlas-canvas",part:"atlas-canvas",tabIndex:0,...Xt,...M,ref:tt.canvas}),R.createElement(pc,{className:"atlas-overlay",style:{...m||{}},ref:tt.overlay},f?R.createElement(ht,null,R.createElement(cv.Provider,{value:be},R.createElement(Od.Provider,{value:H},R.createElement(uv.Provider,{value:ce},S)))):R.createElement(hM,{bounds:be,preset:ce,mode:H,setIsReady:W,onCreated:n},S)),T?R.createElement(pc,{className:"atlas-navigator"},R.createElement("canvas",{className:"atlas-navigator-canvas",part:"atlas-navigator-canvas",ref:tt.navigator})):null,p?R.createElement("style",null,`.atlas-width-${yt} { width: ${j.width}px; height: ${j.height}px; }`):R.createElement("style",null,`
266
+ `)),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,n,i){this.stylesheet.updateSheet();for(const a of this.previouslyVisible)this.currentlyVisible.indexOf(a)===-1&&this.container.removeChild(a);for(const a of this.currentlyVisible)this.previouslyVisible.indexOf(a)===-1&&this.container.appendChild(a);this.previouslyVisible=this.currentlyVisible,this.currentlyVisible=[]}afterPaintLayer(e,n){}beforeFrame(e,n,i){this.stylesheet.clearClasses(),this.zIndex=0}getPointsAt(e,n,i,a){return e.getPointsAt(n,i,a)}getScale(e,n){if(Number.isNaN(e)||Number.isNaN(n))return this.lastKnownScale;const i=this.width/e,a=this.height/n,u=i<a?a:i;return Number.isNaN(u)||(this.lastKnownScale=u),this.lastKnownScale}getViewportBounds(e,n,i){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,n,i,a,u,f){if(this.pending=!1,this.zIndex++,e instanceof Ar){if(!e.__host){const g=this.createImage();g.src=e.uri,e.__host=g,this.container.appendChild(e.__host)}const p=e.__host;this.currentlyVisible.push(p),p.style.zIndex=`${this.zIndex}`,p.style.opacity=`${e.style.opacity}`,this.options.widthStylesheet?p.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${u+Number.MIN_VALUE}px`,p.style.height=`${f+Number.MIN_VALUE}px`),p.style.transform=`translate(${i}px, ${a}px)`}if(e instanceof no){if(e.__host||(e.__host={images:[]}),!e.__host.images[n]){const g=e.getImageUrl(n),S=this.createImage();S.src=g,e.__host.images[n]=S,this.container.appendChild(S)}const p=e.__host.images[n];p.style.zIndex=`${this.zIndex}`,p.style.opacity=`${e.style.opacity}`,this.currentlyVisible.push(p),this.options.widthStylesheet?p.className=this.options.imageClass+" "+this.stylesheet.addStylesheet(`width:${(u+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${u+Number.MIN_VALUE}px`,p.style.height=`${f+Number.MIN_VALUE}px`),p.style.transform=`translate(${i}px, ${a}px)`}}pendingUpdate(){return this.pending}prepareLayer(e){}finishLayer(e){}reset(){}}function bM({interactive:t,viewport:e,forceRefresh:n,containerElement:i,overlayElement:a,controllerConfig:u,background:f}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const p=t?S1({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...u||{}}):void 0,g=new SM(i,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:f}),S=a?new o1([g,new L1(a,{box:!0,text:!0,triggerResize:n})]):g,m=new yd(S,new Il(1024,1024),e,p?[p]:[]),x=new dv(i,m);return{name:"static-preset",em:x,runtime:m,renderer:S,controller:p,container:i,overlay:a,unmount(){O1(m),m.stopControllers(),m.stop(),x&&x.stop()}}}const EM={"default-preset":P1,"static-preset":bM},xM={};function wM(t,e){const n=T.useRef(),i=T.useRef(),a=T.useRef(),u=T.useRef(),f=T.useRef({width:e.width,height:e.height,didUpdate:!0}),[p="default-preset",g=xM]=Array.isArray(t)?t||[]:[t],[S,m]=T.useState(null);T.useLayoutEffect(()=>{const R=i.current,_=u.current,M=n.current,k=a.current,P=(EM[p]||P1)({containerElement:_,canvasElement:R,overlayElement:M,navigatorElement:k,viewport:f.current,dpi:window.devicePixelRatio||1,forceRefresh:e.forceRefresh,unstable_webglRenderer:e.unstable_webglRenderer,...g||{}});return m(P),()=>{P&&(P.unmount(),R&&(R.height=0,R.width=0),M&&(M.innerHTML=""),k&&(k.height=0,k.width=0))}},[p,g]);const x=T.useMemo(()=>({canvas:i,overlay:n,container:u,navigator:a}),[]);return[p,S,f,x]}function CM(t){return T.useMemo(()=>fv(t),t)}const pc=T.forwardRef((t,e)=>T.createElement("div",{...t,ref:e,part:t.className})),TM=({htmlChildren:t,renderPreset:e,onCreated:n,mode:i="explore",resetWorldOnChange:a=!0,unstable_webglRenderer:u=!1,unstable_noReconciler:f=!1,hideInlineStyle:p=!1,controllerConfig:g,children:S,overlayStyle:m,containerStyle:x,enableNavigator:R,className:_,containerProps:M={},homePosition:k,background:L,runtimeOptions:P,debug:O,...j})=>{const[q,ee]=T.useState(L),[H,Z]=T.useState(i),[ie,W]=T.useState(!1),re=T.useMemo(()=>(typeof e=="string"&&(e=[e,{}]),q||O?e?[e[0],{debug:O,background:q,...e[1]||{}}]:["default-preset",{background:q,debug:O}]:e||"default-preset"),[e,q,O]),[ge,be,Ee]=E1({scroll:!0}),Ue=T.useRef(),je=Be=>{Ue.current=Be,ge(Be)},[Xe,ce,me,tt]=wM(re,{width:j.width,height:j.height,forceRefresh:Ee,unstable_webglRenderer:u}),[mt,he]=T.useState("");T.useEffect(()=>{Z(i)},[i]),T.useEffect(()=>{ce&&ce.em&&ce.em.updateBounds()},[ce,be]),T.useEffect(()=>{ce==null||ce.runtime.setOptions(P||{})},[P]),T.useEffect(()=>{ce&&ce.runtime&&(ce.runtime.mode=H),ie&&ce&&(ce.ready=!0)},[ce,ie,H]),T.useEffect(()=>{ce&&(ce.runtime.manualHomePosition=!!k,ce.runtime.setHomePosition(k))},[ce,k]),T.useEffect(()=>{if(ce){const Be=ce.runtime;Be.resize(me.current.width,j.width,me.current.height,j.height),me.current.width=j.width,me.current.height=j.height,Be.updateNextFrame(),me.current.didUpdate=!0}},[ce,j.width,j.height]),T.useLayoutEffect(()=>{ce&&(ce.overlay&&(ce.overlay.style.width=`${be.width}px`,ce.overlay.style.height=`${be.height}px`),ce.container&&(ce.container.style.width=`${be.width}px`,ce.container.style.height=`${be.height}px`))},[ce,be.height,be.width]),T.useLayoutEffect(()=>{const Be=()=>{if(ce){const nt=ce.runtime;me.current.width!==j.width&&me.current.height!==j.height&&(nt.resize(me.current.width,j.width,me.current.height,j.height),me.current.width=j.width,me.current.height=j.height,nt.updateNextFrame(),me.current.didUpdate=!0)}};return window.addEventListener("resize",Be),()=>window.removeEventListener("resize",Be)},[ce,j.height,j.width]);const Fe={width:120},$e=()=>{if(ce&&ce.navigator){const Be=ce.runtime.world.height,nt=ce.runtime.world.width,ot=window.devicePixelRatio||1,lt=Fe.width,Et=Fe.width/nt*Be;ce.navigator.width=lt*ot,ce.navigator.height=Et*ot,ce.navigator.style.width=lt+"px",ce.navigator.style.height=Et+"px"}};T.useLayoutEffect(()=>{if(ce){$e();const Be=ce.runtime;return Be.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&($e(),Be.resize(me.current.width,j.width,me.current.height,j.height))})}return()=>{}},[ce]);const ht=T.useCallback(function(nt){const ot=()=>{W(!0)};return T.useEffect(()=>{if(ce){ce.runtime.goHome();const lt=n&&n(ce);return void(lt&&lt.then?lt.then(ot):ot())}else throw new Error("Invalid configuration - no runtime found")},[]),nt.children},[ce]);T.useEffect(()=>{if(ce){const Be=ce.runtime;if(a)return Be.world.addLayoutSubscriber(nt=>{nt==="recalculate-world-size"&&Be.goHome()})}return()=>{}},[ce,a]),T.useEffect(()=>ce?ce.runtime.registerHook("useBeforeFrame",()=>{var nt;if(me.current.didUpdate&&ce.canvas){const ot=window.devicePixelRatio||1,lt=me.current.width,Et=me.current.height;ce.canvas.width=lt*ot,ce.canvas.height=Et*ot,ce.canvas.style.width=lt+"px",ce.canvas.style.height=Et+"px",(nt=ce.canvas.getContext("2d"))==null||nt.scale(ot,ot),ce&&ce.em&&ce.em.updateBounds(),me.current.didUpdate=!1}}):()=>{},[ce,a]),T.useEffect(()=>{const Be=()=>{ce&&(Z("sketch"),he("mode-sketch")),window.removeEventListener("keyup",Be)},nt=ot=>{if(ot.code==="Space"&&ce&&ce.runtime.mode==="sketch"){if(ot.target&&ot.target.tagName&&ot.target.tagName.toLowerCase()==="input")return;ot.preventDefault(),Z("explore"),he("mode-explore"),window.addEventListener("keyup",Be)}};return window.addEventListener("keydown",nt),()=>{window.removeEventListener("keydown",nt),window.removeEventListener("keyup",Be)}},[ce]),T.useLayoutEffect(()=>{if(Ue.current&&!q){const nt=getComputedStyle(Ue.current).getPropertyValue("--atlas-background");nt&&ee(nt)}},[q]);const{height:gt,width:gn,...Xt}=j,yt=CM([j.width,j.height]);return T.createElement(pc,{ref:je,className:["atlas",p?"":`atlas-width-${yt}`,mt,_].filter(Boolean).join(" ").trim(),style:{...x,...p?{}:{width:j.width,height:j.height}}},Xe==="static-preset"?T.createElement(pc,{className:"atlas-static-container",style:ce&&ce.controller?void 0:{pointerEvents:"none"},ref:tt.container,tabIndex:0,...M}):T.createElement("canvas",{className:"atlas-canvas",part:"atlas-canvas",tabIndex:0,...Xt,...M,ref:tt.canvas}),T.createElement(pc,{className:"atlas-overlay",style:{...m||{}},ref:tt.overlay},f?T.createElement(ht,null,T.createElement(cv.Provider,{value:be},T.createElement(Od.Provider,{value:H},T.createElement(uv.Provider,{value:ce},S)))):T.createElement(gM,{bounds:be,preset:ce,mode:H,setIsReady:W,onCreated:n},S)),R?T.createElement(pc,{className:"atlas-navigator"},T.createElement("canvas",{className:"atlas-navigator-canvas",part:"atlas-navigator-canvas",ref:tt.navigator})):null,p?T.createElement("style",null,`.atlas-width-${yt} { width: ${j.width}px; height: ${j.height}px; }`):T.createElement("style",null,`
267
267
  .atlas { position: relative; user-select: none; display: flex; background: var(--atlas-background, #000); z-index: var(--atlas-z-index, 10); touch-action: none; }
268
268
  .atlas-width-${yt} { width: ${j.width}px; height: ${j.height}px; }
269
269
  .atlas-canvas { flex: 1 1 0px; }
@@ -274,18 +274,18 @@ No matching component was found for:
274
274
  .atlas-static-image { position: absolute; pointer-events: none; user-select: none; transform-origin: 0px 0px; }
275
275
  .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 }
276
276
  .atlas-navigator-canvas { width: 100%; }
277
- `),t)};function xM(t){return Number(t)==t?`${t}px`:t}const wM=({resizeHash:t,aspectRatio:e,containerProps:n={},...i})=>{const[a,u,f]=E1(),{height:p,width:g,...S}=i;R.useEffect(()=>{f()},[g,p,t,f]);const m=R.useMemo(()=>e?{width:u.width,height:u.width*(1/e)}:u,[u,e]);return R.createElement(pc,{ref:a,className:"atlas-container",...n},m.width?R.createElement(EM,{width:m.width||100,height:m.height||100,...S},i.children):null,i.hideInlineStyle?null:R.createElement("style",null,`
277
+ `),t)};function RM(t){return Number(t)==t?`${t}px`:t}const AM=({resizeHash:t,aspectRatio:e,containerProps:n={},...i})=>{const[a,u,f]=E1(),{height:p,width:g,...S}=i;T.useEffect(()=>{f()},[g,p,t,f]);const m=T.useMemo(()=>e?{width:u.width,height:u.width*(1/e)}:u,[u,e]);return T.createElement(pc,{ref:a,className:"atlas-container",...n},m.width?T.createElement(TM,{width:m.width||100,height:m.height||100,...S},i.children):null,i.hideInlineStyle?null:T.createElement("style",null,`
278
278
  .atlas-container {
279
279
  display: var(--atlas-container-display, block);
280
280
  flex: var(--atlas-container-flex, none);
281
281
  width: var(--atlas-container-width, ${g?`${g}px`:"100%"});
282
- height: var(--atlas-container-height, ${xM(p||(e?m.height:512))})
282
+ height: var(--atlas-container-height, ${RM(p||(e?m.height:512))})
283
283
  }
284
- `),i.htmlChildren)},CM=()=>R.useContext(uv),Dd=()=>{const t=CM();return t?t.runtime:void 0},D1=(t,e=[])=>{const n=Dd();R.useEffect(()=>n?n.registerHook("useFrame",t):()=>{},e)};function TM(){return R.useContext(cv)}async function RM(t,e,n){if(R.version.startsWith("18.")){const i=await Promise.resolve().then(()=>PD),a=i.default?i.default.createRoot:i.createRoot;n.current||(n.current=a(t)),n.current.render(e)}else if(typeof ReactDOM<"u"){const{render:i,unmountComponentAtNode:a}=ReactDOM;i(e,t),n.current={unmount(){a(t)}}}else{const i=await import("react-dom"),a=i.default?i.default.render:i.render,u=i.default?i.default.unmountComponentAtNode:i.unmountComponentAtNode;a(e,t),n.current={unmount(){u(t)}}}}const hv=R.forwardRef(({children:t,...e},n)=>{const i=R.useRef(),a=Dd(),u=R.useRef(0),f=R.useRef(),p=R.useRef();return D1(()=>{var g,S,m,x;if(e.relative){const T=i.current;if(T&&a){const _=a.getScaleFactor();u.current!==_&&(u.current=_,T.style.transformOrigin="0 0",T.style.transform=`scale(${1/u.current})`,T.style.width=`${u.current*100}%`,T.style.height=`${u.current*100}%`,i.current&&((S=(g=f.current)==null?void 0:g.__owner.value)!=null&&S.rotation)&&(T.style.transform=`scale(${1/u.current}) translate(50%, 50%) rotate(${((x=(m=f.current)==null?void 0:m.__owner.value)==null?void 0:x.rotation)||0}deg) translate(-50%, -50%)`))}}},[e.relative]),R.useLayoutEffect(()=>{const g=f.current;n&&g&&(typeof n=="function"?n(g):n.current=g);async function S(){if(g&&g.__host){const m=e.relative?R.createElement("div",{ref:i},t):t;await RM(g.__host.element,m,p)}}g&&g.__host?S():g&&(g.__onCreate=S)},[n,t,f,e.relative]),R.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),R.createElement("box",{html:!0,...e,ref:f})});hv.displayName="HTMLPortal";const k1=(t,e,n=[])=>{const i=Dd(),a=i?i.world:void 0;R.useEffect(()=>{if(i){const u=e,f=Rl[t];i.world.activatedEvents.push(f);const p=f.slice(2).toLowerCase();return i.world.addEventListener(p,u),()=>{i.world.removeEventListener(p,u)}}return()=>{}},[a,t,...n])};function I1(t,e){if(t===0)return[0,1];if(e===0)return[1,0];const n=Math.abs(t)/Math.abs(e);return[n,1-n]}function AM(){const t=R.useRef({ctrl:!1,shift:!1,alt:!1});return R.useLayoutEffect(()=>{function e(i){i.key==="Shift"&&(t.current.shift=!0),i.key==="Control"&&(t.current.ctrl=!0),i.key==="Alt"&&(t.current.alt=!0)}function n(i){i.key==="Shift"&&(t.current.shift=!1),i.key==="Control"&&(t.current.ctrl=!1),i.key==="Alt"&&(t.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)}},[]),t}const MM=(t,e)=>{const n=iM(),i=Dd(),a=TM(),u=R.useRef(),f=R.useRef(null),p=R.useRef(),[g,S]=R.useState(!1),m=R.useRef(!1),x=R.useRef({north:0,south:0,east:0,west:0}),T=AM(),_=R.useCallback(O=>j=>{if(m.current=!0,S(!0),a&&i){const{top:q,left:ee}=a,H=i.viewerToWorld(j.pageX-ee,j.pageY-q);p.current={x:H.x,y:H.y},u.current=O}},[a,i]),M=R.useMemo(()=>t.width/t.height,[t.width,t.height]),k=R.useCallback(O=>{if(!Math.abs(O.north-O.south+(O.east-O.west)))return;const q=-O.west+O.east,ee=-O.north+O.south,H=t.width+q,Z=t.height+ee;if(H/Z>=M){const W=Z*M,re=H-W,[ge,be]=I1(O.east,O.west);O.west=O.west+re*be,O.east=O.east-re*ge}else{const W=H/M,re=Z-W,[ge,be]=I1(O.north,O.south);O.north=O.north+re*ge,O.south=O.south-re*be}},[t.width,t.height,M]);D1(()=>{p&&i&&i.updateNextFrame()}),R.useEffect(()=>{i&&i.updateNextFrame()},[i,g]);const L=R.useCallback(O=>{var j;if(!i||!a||i.mode!=="sketch")return;const{top:q,left:ee}=a,H=i.viewerToWorld(O.pageX-ee,O.pageY-q),Z=f.current,ie=!t.maintainAspectRatio&&T.current.alt,W=!ie&&T.current.shift&&((j=u.current)==null?void 0:j.indexOf("-"))!==-1;if((u.current==="translate"||u.current==="east"||u.current==="north-east"||u.current==="south-east")&&(x.current.east=H.x-(p.current?p.current.x:0),ie&&(x.current.west=-x.current.east)),(u.current==="translate"||u.current==="west"||u.current==="north-west"||u.current==="south-west")&&(x.current.west=H.x-(p.current?p.current.x:0),ie&&(x.current.east=-x.current.west)),(u.current==="translate"||u.current==="north"||u.current==="north-east"||u.current==="north-west")&&(x.current.north=H.y-(p.current?p.current.y:0),ie&&(x.current.south=-x.current.north)),(u.current==="translate"||u.current==="south"||u.current==="south-west"||u.current==="south-east")&&(x.current.south=H.y-(p.current?p.current.y:0),ie&&(x.current.north=-x.current.south)),(t.maintainAspectRatio||W)&&k(x.current),Z){const re=x.current.west,ge=x.current.north,be=t.width+x.current.east,Ee=t.height+x.current.south;Z.points[1]=Math.min(re,be),Z.points[2]=Math.min(ge,Ee),Z.points[3]=Math.max(re,be),Z.points[4]=Math.max(ge,Ee),i.updateNextFrame()}},[i,t.width,t.height,t.maintainAspectRatio,a]);k1("mousemove",L,[t.width,t.height,a]),k1("pointermove",L,[t.width,t.height,a]);const P=R.useRef();return R.useEffect(()=>{P.current=()=>{if(m.current){const O=x.current.west,j=x.current.north,q=t.width+x.current.east,ee=t.height+x.current.south,H=Math.min(O,q),Z=Math.min(j,ee),ie=Math.max(O,q),W=Math.max(j,ee),re={x:(t.x||0)+H,y:(t.y||0)+Z,width:ie-H||1,height:W-Z||1};t.maintainAspectRatio,e(re),u.current=void 0,p.current=void 0,x.current.east=0,x.current.west=0,x.current.north=0,x.current.south=0,m.current=!1,S(!1)}}},[e,t.height,t.width,t.x,t.y]),R.useEffect(()=>{const O=()=>{P.current&&P.current()};return window.addEventListener("pointerup",O),window.addEventListener("touchend",O),()=>{window.removeEventListener("pointerup",O),window.removeEventListener("touchend",O)}},[]),{portalRef:f,mode:n,mouseEvent:_,onPointerMoveCallback:L,isEditing:g}};function OM({handleSize:t,resizable:e,onSave:n,children:i,maintainAspectRatio:a,disableCardinalControls:u,...f}){const p=typeof t>"u"?a?10:8:t,{portalRef:g,mode:S,mouseEvent:m,isEditing:x}=MM({x:f.x||0,y:f.y||0,width:f.width,height:f.height,maintainAspectRatio:a},n),T=R.useMemo(()=>m("translate"),[m]),_=R.useMemo(()=>m("east"),[m]),M=R.useMemo(()=>m("west"),[m]),k=R.useMemo(()=>m("south"),[m]),L=R.useMemo(()=>m("north"),[m]),P=R.useMemo(()=>m("south-east"),[m]),O=R.useMemo(()=>m("south-west"),[m]),j=R.useMemo(()=>m("north-east"),[m]),q=R.useMemo(()=>m("north-west"),[m]),ee=S==="sketch",H={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:a||u?"50%":2,position:"absolute",background:"#fff",pointerEvents:x?"none":ee?"initial":"none"};return R.createElement(R.Fragment,null,R.createElement("world-object",{...f},i,ee&&e?R.createElement(hv,{ref:g,target:{x:0,y:0,height:f.height,width:f.width},relative:!0,interactive:!1},ee&&e?R.createElement(R.Fragment,null,R.createElement("div",{onMouseDown:T,onTouchStart:T,style:{display:"block",width:"100%",height:"100%",position:"relative",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:x?"none":ee?"initial":"none"}}),a?null:R.createElement(R.Fragment,null,R.createElement("div",{title:"east",onTouchStart:_,onMouseDown:_,style:{...H,cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:u?0:1,transform:`translate(${p/2}px, -${p}px)`}}),R.createElement("div",{title:"west",onMouseDown:M,style:{...H,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)`}}),R.createElement("div",{title:"north",onMouseDown:L,style:{...H,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)`}}),R.createElement("div",{title:"south",onMouseDown:k,style:{...H,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)`}})),R.createElement("div",{title:"north-east",onMouseDown:j,style:{...H,cursor:"ne-resize",position:"absolute",height:p,width:p,right:0,top:0,transform:`translate(${p/2}px, -${p/2}px)`}}),R.createElement("div",{title:"south-east",onMouseDown:P,style:{...H,cursor:"se-resize",position:"absolute",height:p,width:p,bottom:0,right:0,transform:`translate(${p/2}px, ${p/2}px)`}}),R.createElement("div",{title:"south-west",onMouseDown:O,style:{...H,cursor:"sw-resize",position:"absolute",height:p,width:p,bottom:0,left:0,transform:`translate(-${p/2}px, ${p/2}px)`}}),R.createElement("div",{title:"north-west",onMouseDown:q,style:{...H,cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`}})):null):null))}function _M({interactive:t,region:e,onClick:n,onSave:i,maintainAspectRatio:a,disableCardinalControls:u,isEditing:f,rotation:p,style:g={backgroundColor:"rgba(0,0,0,.5)"}}){const S=R.useCallback(m=>{i({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width,...m})},[i,e.id,e.x,e.y,e.height,e.width]);return R.createElement(OM,{x:e.x,y:e.y,rotation:p,width:e.width,height:e.height,resizable:f,onSave:S,maintainAspectRatio:a,disableCardinalControls:u},R.createElement("box",{interactive:t,onClick:m=>{m.preventDefault(),m.stopPropagation(),n(e)},target:{x:0,y:0,width:e.width,height:e.height},style:g}))}const LM=t=>{var e,n,i,a,u;const f=t.width/(((e=t.crop)==null?void 0:e.width)||t.tiles.width),p=t.tiles.imageService.tiles||[],g=t.tiles.imageService.sizes||[],S=t.enableThumbnail,m=t.enableSizes,x=R.useMemo(()=>{const T=t.tiles.imageService.id||t.tiles.imageService["@id"];return T&&T.endsWith("/info.json")?T.slice(0,-1*10):T},[t.tiles.imageService.id]);return R.createElement("world-object",{rotation:t.rotation,key:t.tiles.imageService.id,scale:f,height:((n=t.crop)==null?void 0:n.height)||t.tiles.height,width:((i=t.crop)==null?void 0:i.width)||t.tiles.width,x:t.x,y:t.y,onClick:t.onClick},R.createElement("composite-image",{key:t.tiles.imageService.id,id:t.tiles.imageService.id,width:((a=t.crop)==null?void 0:a.width)||t.tiles.width,height:((u=t.crop)==null?void 0:u.height)||t.tiles.height,crop:t.crop},S&&t.tiles.thumbnail?R.createElement("world-image",{priority:!0,uri:t.tiles.thumbnail.id,target:{width:t.tiles.width,height:t.tiles.height},display:{width:t.tiles.thumbnail.width,height:t.tiles.thumbnail.height},crop:t.crop}):null,m&&g.map((T,_)=>R.createElement("world-image",{key:_,uri:`${x}/full/${T.width},${T.height}/0/default.jpg`,target:{width:t.tiles.width,height:t.tiles.height},display:{width:T.width,height:T.height},crop:t.crop})),p.map(T=>(T.scaleFactors||[]).map(_=>R.createElement("tiled-image",{key:`${t.tiles.imageService.id}-tile-${_}`,uri:t.tiles.imageService.id,display:{width:t.tiles.width,height:t.tiles.height},tile:T,scaleFactor:_,crop:t.crop})))))};function PM(t,e){return t?e?{...t,...e||{},":hover":t[":hover"]?Object.assign(t[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":t[":active"]?Object.assign(t[":active"]||{},e[":active"]||{}):e[":hover"]}:t:e}function pv(t,e){return pv=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},pv(t,e)}function DM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pv(t,e)}var kM=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),e.length!==n.length||e.some(function(i,a){return!Object.is(i,n[a])})},N1={error:null},IM=function(t){DM(e,t);function e(){for(var i,a=arguments.length,u=new Array(a),f=0;f<a;f++)u[f]=arguments[f];return i=t.call.apply(t,[this].concat(u))||this,i.state=N1,i.resetErrorBoundary=function(){for(var p,g=arguments.length,S=new Array(g),m=0;m<g;m++)S[m]=arguments[m];i.props.onReset==null||(p=i.props).onReset.apply(p,S),i.reset()},i}e.getDerivedStateFromError=function(a){return{error:a}};var n=e.prototype;return n.reset=function(){this.setState(N1)},n.componentDidCatch=function(a,u){var f,p;(f=(p=this.props).onError)==null||f.call(p,a,u)},n.componentDidUpdate=function(a,u){var f=this.state.error,p=this.props.resetKeys;if(f!==null&&u.error!==null&&kM(a.resetKeys,p)){var g,S;(g=(S=this.props).onResetKeysChange)==null||g.call(S,a.resetKeys,p),this.reset()}},n.render=function(){var a=this.state.error,u=this.props,f=u.fallbackRender,p=u.FallbackComponent,g=u.fallback;if(a!==null){var S={error:a,resetErrorBoundary:this.resetErrorBoundary};if(se.isValidElement(g))return g;if(typeof f=="function")return f(S);if(p)return se.createElement(p,S);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(se.Component);const NM={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},kd=R.createContext(NM),As=()=>R.useContext(kd);function ca({value:t,children:e}){const n=As(),i=R.useMemo(()=>({...n,...t}),[t,n]);return oe.jsx(kd.Provider,{value:i,children:e})}var zM=Object.defineProperty,UM=(t,e,n)=>e in t?zM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fa=(t,e,n)=>(UM(t,typeof e!="symbol"?e+"":e,n),n);function da(t){return typeof t=="string"?!1:!!t&&t.type==="SpecificResource"}function z1(t,e){const n=e||"unknown";if(!t)return;if(typeof t=="string")return{id:t,type:n};if(da(t))return z1(t.source,e);let i=n&&n!=="unknown"?n:t.type||t["@type"];const a=t.id||t["@id"];if(i.indexOf(":")!==-1&&(i=i.split(":").pop()),a&&i)return{id:a,type:i}}const vc={},zn="iiif-parser:hasPart",Kr="iiif-parser:partOf",mc="iiif-parser:isExternal",Mr="__$UNSET$__",U1="__$UNWRAP$__",ze=[];Object.freeze(ze),Object.freeze(vc);function jM(t){if(t===vc||Object.keys(t).length===0)return!0;for(const e in t)return!1;return!0}function vv(t,e){if(e&&e["@explicit"]){const n={},i=Object.keys(e);for(const a of i)a===Kr||a==="@explicit"||(jM(e[a])?n[a]=t[a]:n[a]=e[a]);return n}return t}function j1(t,e,n){const i=z1(e);if(!i)return[void 0,void 0];const a=t.requests[i.id],u=i.type||t.mapping[i.id];if(!u||a&&a.resourceUri&&!t.entities[u][a.resourceUri])return[void 0,void 0];const f=t.entities[u][a?a.resourceUri:i.id];if(i.type&&!f)return j1(t,{id:i.id},n);if(f&&f[zn]){const p=f[zn].find(S=>n?S[Kr]===n.id:S[Kr]===f.id);return[vv(f,p),f]}return[f,f]}const FM={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:ze,label:null,thumbnail:ze,summary:null,requiredStatement:null,metadata:ze,rights:null,provider:ze,items:ze,seeAlso:ze,homepage:ze,rendering:ze,service:ze},BM={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,duration:0,height:0,width:0},HM={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,services:ze},VM={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:ze,behavior:ze,homepage:ze,items:ze,label:null,metadata:ze,navDate:null,provider:ze,partOf:ze,accompanyingCanvas:null,placeholderCanvas:null,rendering:ze,requiredStatement:null,rights:null,seeAlso:ze,service:ze,services:ze,start:null,structures:ze,summary:null,thumbnail:ze,viewingDirection:"left-to-right"},$M={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,start:null,supplementary:null,viewingDirection:"left-to-right"},WM={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:ze,seeAlso:ze,homepage:ze},qM={id:"https://iiif-parser/empty-service",type:"UnknownService"};function Nl(t){return Array.isArray(t)?t:t?[t]:[]}function Id(...t){return e=>t.reduce((n,i)=>i(n),e)}const F1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function YM(t,e){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object"){if(e)return e;throw new Error(`${typeof t} is not a valid entity`)}if(typeof t.type=="string"){const n=F1.indexOf(t.type);if(n!==-1)return F1[n]}if(t.profile)return"Service";throw new Error("Resource type is not known")}class mv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),fa(this,"_traverseManifest",Id(this.traverseManifestItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseManifestStructures.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseCanvas",Id(this.traverseCanvasItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseAnnotationPage",Id(this.traverseAnnotationPageItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this))),fa(this,"_traverseRange",Id(this.traverseRangeRanges.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this))),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],specificResource:[],geoJson:[],...e},this.options={allowUndefinedReturn:!1,...n}}static all(e){return new mv({collection:[e],manifest:[e],canvas:[e],annotationCollection:[e],annotationPage:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],geoJson:[e],specificResource:[e],agent:[e]})}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=Nl(e.thumbnail).map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.provider&&(e.provider=e.provider.map(n=>this.traverseAgent(n,e))),e}traverseLinking(e){return e.seeAlso&&(e.seeAlso=e.seeAlso.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.service&&(e.service=Nl(e.service).map(n=>this.traverseService(n))),e.services&&(e.services=Nl(e.services).map(n=>this.traverseService(n,e))),e.logo&&(e.logo=e.logo.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.homepage&&(e.homepage=e.homepage.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.partOf&&(e.partOf=e.partOf.map(n=>typeof n=="string"||!n.type?this.traverseType(n,{parent:e},this.traversals.contentResource):n.type==="Canvas"?this.traverseType(n,{parent:e},this.traversals.canvas):n.type==="AnnotationCollection"?this.traverseType(n,{parent:e},this.traversals.annotationCollection):n.type==="Collection"?this.traverseType(n,{parent:e},this.traversals.collection):this.traverseType(n,{parent:e},this.traversals.contentResource))),e.start&&(da(e.start)?e.start=this.traverseSpecificResource(e.start,"Canvas",e):e.start=this.traverseType(e.start,{parent:e},this.traversals.canvas)),e.rendering&&(e.rendering=e.rendering.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.supplementary&&(e.supplementary=e.supplementary.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e}traverseCollectionItems(e){return e.items&&e.items.map(n=>n.type==="Collection"?this.traverseCollection(n):this.traverseManifest(n)),e}traverseCollection(e,n){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traverseLinkedCanvases(this.traverseCollectionItems(e))))),{parent:n},this.traversals.collection)}traverseGeoJson(e,n){return this.traverseType(e,{parent:n},this.traversals.geoJson)}traverseNavPlace(e){return e.navPlace&&(e.navPlace=this.traverseGeoJson(e.navPlace,e)),e}traverseManifestItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseCanvas(n))),e}traverseManifestStructures(e){return e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseManifest(e,n){return this.traverseType(this._traverseManifest(e),{parent:n},this.traversals.manifest)}traverseCanvasItems(e){return e.items=(e.items||[]).map(n=>this.traverseAnnotationPage(n,e)),e}traverseInlineAnnotationPages(e){return typeof e=="string"||!e||e.annotations&&(e.annotations=e.annotations.map(n=>this.traverseAnnotationPage(n,e))),e}traverseCanvas(e,n){return this.traverseType(this._traverseCanvas(e),{parent:n},this.traversals.canvas)}traverseAnnotationPageItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseAnnotation(n,e))),e}traverseAnnotationPage(e,n){return this.traverseType(this._traverseAnnotationPage(e),{parent:n},this.traversals.annotationPage)}traverseAnnotationBody(e){return Array.isArray(e.body)?e.body=e.body.map(n=>this.traverseContentResource(n,e)):e.body&&(e.body=this.traverseContentResource(e.body,e)),e}traverseLinkedCanvases(e){return e.placeholderCanvas&&(e.placeholderCanvas=this.traverseCanvas(e.placeholderCanvas)),e.accompanyingCanvas&&(e.accompanyingCanvas=this.traverseCanvas(e.accompanyingCanvas)),e}traverseAnnotation(e,n){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(this.traverseDescriptive(e))),{parent:n},this.traversals.annotation)}traverseContentResourceLinking(e){return typeof e=="string"||!e||e&&e.service&&(e.service=Nl(e.service||[]).map(n=>this.traverseService(n,e))),e}traverseContentResource(e,n){return e.type==="Choice"&&(e.items=e.items.map(i=>this.traverseContentResource(i,e))),da(e)?this.traverseSpecificResource(e,"ContentResource"):this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(e)),{parent:n},this.traversals.contentResource)}traverseSpecificResource(e,n,i){let a=e.source;return typeof e.source=="string"&&(a={id:e.source,type:n||"unknown"}),this.traverseType({...e,source:n==="Canvas"||a.type==="Canvas"?this.traverseType(a,{parent:i},this.traversals.canvas):n==="ContentResource"?this.traverseContentResource(a,{parent:i}):this.traverseUnknown(a,{parent:i,typeHint:n})},{parent:i},this.traversals.specificResource)}traverseRangeRanges(e){return e.items&&(e.items=e.items.map(n=>typeof n=="string"?this.traverseCanvas({id:n,type:"Canvas"},e):da(n)?this.traverseSpecificResource(n,"Canvas",e):n.type==="Manifest"?this.traverseManifest(n,e):this.traverseRange(n,e))),e}traverseRange(e,n){return this.traverseType(this._traverseRange(e),{parent:n},this.traversals.range)}traverseAgent(e,n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),{parent:n},this.traversals.agent)}traverseType(e,n,i){return i.reduce((a,u)=>{const f=u(a,n);return typeof f>"u"&&!this.options.allowUndefinedReturn?a:f},e)}traverseService(e,n){const i=Object.assign({},e);return i&&i.service&&(i.service=Nl(i.service).map(a=>this.traverseService(a))),this.traverseType(i,{parent:n},this.traversals.service)}traverseUnknown(e,{parent:n,typeHint:i}={}){const a=YM(e,i);switch(a){case"Collection":return this.traverseCollection(e,n);case"Manifest":return this.traverseManifest(e,n);case"Canvas":return this.traverseCanvas(e,n);case"AnnotationPage":return this.traverseAnnotationPage(e,n);case"Annotation":return this.traverseAnnotation(e,n);case"ContentResource":return this.traverseContentResource(e,n);case"Range":return this.traverseRange(e,n);case"Service":return this.traverseService(e,n);case"Agent":return this.traverseAgent(e,n);default:{if(i)return i;throw new Error(`Unknown or unsupported resource type of ${a}`)}}}}const B1=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function QM(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=B1.indexOf(t["@type"]);if(e!==-1)return B1[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class gv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new gv({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(QM(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const GM="http://library.stanford.edu/iiif/image-api/compliance.html#level0",H1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",V1="http://library.stanford.edu/iiif/image-api/compliance.html#level2",XM="http://library.stanford.edu/iiif/image-api/conformance.html#level0",$1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",W1="http://library.stanford.edu/iiif/image-api/conformance.html#level2",KM="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",q1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Y1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",ZM="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Q1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",G1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",JM="http://iiif.io/api/image/1/level0.json",eO="http://iiif.io/api/image/1/profiles/level0.json",X1="http://iiif.io/api/image/1/level1.json",K1="http://iiif.io/api/image/1/profiles/level1.json",Z1="http://iiif.io/api/image/1/level2.json",J1="http://iiif.io/api/image/1/profiles/level2.json",tO="http://iiif.io/api/image/2/level0.json",nO="http://iiif.io/api/image/2/profiles/level0.json",eS="http://iiif.io/api/image/2/level1.json",tS="http://iiif.io/api/image/2/profiles/level1.json",nS="http://iiif.io/api/image/2/level2.json",iS="http://iiif.io/api/image/2/profiles/level2.json",iO="level0",rS="level1",sS="level2",rO="http://iiif.io/api/image/2/level0",aS="http://iiif.io/api/image/2/level1",oS="http://iiif.io/api/image/2/level2",sO=[aS,oS,H1,V1,$1,W1,q1,Y1,Q1,G1,X1,K1,Z1,J1,eS,tS,nS,iS,rS,sS],aO=[rO,aS,oS,GM,H1,V1,XM,$1,W1,KM,q1,Y1,ZM,Q1,G1,JM,eO,X1,K1,Z1,J1,tO,nO,eS,tS,nS,iS,iO,rS,sS];function Ms(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const yv={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function so(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function lS(t){if(Array.isArray(t))return lS(t.find(e=>typeof e=="string"));if(aO.indexOf(t)!==-1)return"level2";if(sO.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function oO(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function lO(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function uS(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const uO=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Sv(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=lO(i);if(u)return u}if(a){const u=oO(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&uO.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const cO=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function fO(t){const e=t.match(cO);return e?e[0]:t}function dO(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?fO(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const hO=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function pO(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),hO.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function vO(t){return t?t.map(e=>({label:so(e.label),value:so(e.value)})):[]}let cS=0;function fS(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(cS++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${cS}`)}function Os(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(uS):t.motivation&&(n=uS(t.motivation)),{"@context":t["@context"]?pO(t["@context"]):void 0,id:(t["@id"]||fS(t)).trim(),type:Sv(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function _s(t){const[e,n]=dO(t.license),i=[...t.metadata?vO(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?so(t.label):void 0,requiredStatement:t.attribution?{label:so(yv.attributionLabel),value:so(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?so(t.description):void 0,thumbnail:mO(t.thumbnail)}}function mO(t){return t&&(Array.isArray(t)?t:[t]).map(n=>typeof n=="string"?{id:n,type:"Image"}:(n.type==="unknown"&&(n.type="Image"),n))}function gO(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:Sv(i)});return n.length?n:void 0}function ha(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:yv.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:so(yv.providerName)}]:void 0,partOf:gO(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?Nl(t.service):void 0,supplementary:n?[n]:void 0}}function yO(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function SO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function bO(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Os(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ms({...a,..._s(t),...ha(t),start:i,items:e,structures:t.structures})}function EO(t){return Ms({...Os(t),..._s(t),...ha(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:fS(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function xO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.resources&&t.resources.length?t.resources:void 0})}function wO(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function CO(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:Ev(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ms({...Os(t),..._s(t),...ha(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(bv):bv(t.resource)})}function bv(t){const e=t;return Ms({...Os(e),..._s(e),...ha(e),...yO(e)})}function TO(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Os(t),..._s(t),items:e}}function RO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function AO(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=Sv(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=lS(a)),Ms({...f,...u})}function MO(t){return Ms({...Os(t),..._s(t),...ha(t)})}const OO=new gv({collection:[SO],manifest:[bO],canvas:[EO],annotationList:[xO],sequence:[wO],annotation:[CO],contentResource:[bv],choice:[TO],range:[RO],service:[AO],layer:[MO]});function _O(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?OO.traverseUnknown(t):t}function Ev(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[Ev(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(Ev)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}function xv(t,e={}){if(Array.isArray(t))return xv(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?{type:"SpecificResource",source:{id:n,type:e.typeHint||"Unknown"},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||e.typeHint||"Unknown"}}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return xv(t.items[0]);if(t.type==="SpecificResource")return t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]),t.selector?{type:"SpecificResource",source:t.source,selector:t.selector}:{type:"SpecificResource",source:t.source};if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?{type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{...t,id:n}}}return{type:"SpecificResource",source:t}}function LO(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function dS(t,e){if(typeof t=="string")return{id:t,type:e};if(!t.id)throw new Error(`Invalid resource does not have an ID (${JSON.stringify(t)}, ${e})`);return t}function PO(t,e){return(n,i)=>{const a=t[n]?t[n]:{};return(u,f)=>{const p=dS(u,i||n);return p&&p.id&&n?(a[p.id]=a[p.id]?Cv(a[p.id],p,{parent:f.parent,isTopLevel:e.id===p.id}):Cv({id:p.id,type:p.type},p,{parent:f.parent,isTopLevel:e.id===p.id}),{id:p.id,type:n==="ContentResource"?n:p.type}):p}}}function wv(t,e,n){if(!e)return t;if(Array.isArray(t)){if(!Array.isArray(e))throw new Error("Cannot merge array with non-array");const i=[...t];for(const a of e)if(a["@id"]&&!a.id&&(a.id=a["@id"]),a["@type"]&&!a.type&&(a.type=a["@type"]),a!=null)if(Array.isArray(a))i.push(a);else if(typeof a=="object"&&a.id&&a.type){const u=i.findIndex(f=>f.id===a.id&&f.type===a.type);u>=0&&(i[u]=wv(i[u],a))}else t.indexOf(a)===-1&&i.push(a);return i}else if(typeof t=="object"){if(Array.isArray(e)||typeof e!="object")throw new Error("Cannot merge object with non-object");const i={...t},a=[],u=[],f=Object.keys(t).filter(S=>S!==zn&&S!=="id"&&S!=="type"),p={},g={};for(const[S,m]of Object.entries(e)){if(S===zn||S==="id"||S==="type")continue;const x=i[S];x===m?u.push(S):x===ze||!x?(a.push(S),i[S]=m):(x&&m&&(p[S]=x,g[S]=m),i[S]=wv(x,m),i[S]===p[S]&&(u.push(S),delete p[S]))}if(n&&(n.parent&&n.parent.id||n.isTopLevel)){const S=[],m={};if(n.parent?m[Kr]=n.parent.id:n.isTopLevel&&(m[Kr]=t.id),i[zn]&&i[zn].length){const x=!(i[zn]||[]).find(_=>_["@explicit"]),T=a.length>0||u.length!==f.length;if(x&&T)for(const _ of i[zn]){const M={..._},k=Object.keys(p);if(M){M["@explicit"]=!0;for(const L of f)L!==zn&&(M[L]=vc);for(const L of k)M[L]=p[L]}S.push(M)}else S.push(...i[zn]);if(T){const _=Object.keys(g);m["@explicit"]=!0;for(const M of a)m[M]=vc;for(const M of u)m[M]=vc;for(const M of _)m[M]=g[M]}}m.id=i.id,m.type=i.type,S.push(m),i[zn]=S}return i}else if(t)return t;return e}function Cv(t,e,n){if(typeof t=="string")return t;if(e.id!==t.id||e.type!==t.type){if(e.type==="ImageService3")return e;if(t.type==="ImageService3")return t;throw new Error(`Can only merge entities with identical identifiers and type! ${e.type}(${e.id}) => ${t.type}(${t.id})`)}return wv({...t},e,n)}function DO(t){return(e,n)=>i=>{const{id:a,type:u}=dS(i,n||e);if(typeof a>"u")throw new Error("Found invalid entity without an ID.");return e==="ContentResource"||e==="Service"?t[a]=e:t[a]=u,i}}function kO(t){const e=Object.assign({},t);if(e["@id"]&&(e.id=e["@id"]),e["@type"]&&(e.type=e["@type"]),e.service){const n=[];e.service=Array.isArray(e.service)?e.service:[e.service];for(const i of e.service)n.push({id:i["@id"]||i.id,type:i["@type"]||i.type});e.service=n}return Object.assign({},qM,e)}function IO(t){return e=>{t.Service=t.Service?t.Service:{};const n=e.id||e["@id"],i=kO(e);return i&&i.id&&(t.Service[i.id]?t.Service[n]=Cv(t.Service[n],i):t.Service[n]=i),e}}function NO(t){const e=JSON.stringify(t);let n=5381,i=e.length;for(;i;)n=n*33^e.charCodeAt(--i);const u=(n>>>0).toString(16);return u.length%2?"0"+u:u}function Tv(t){return e=>typeof e=="string"?{id:e,type:t}:e.id?e.type?e:{type:t,...e}:{id:`vault://${NO(e)}`,type:t,...e}}function zl(t){return e=>({...t,...e})}function gc(t){return Array.isArray(t)?t:[t]}function zO(t){return t.body&&(t.body=gc(t.body)),t.seeAlso&&(t.seeAlso=gc(t.seeAlso)),t.audience&&(t.audience=gc(t.audience)),t.accessibility&&(t.accessibility=gc(t.accessibility)),t.motivation&&(t.motivation=gc(t.motivation)),t}function hS(t,{typeHint:e,partOfTypeHint:n}={}){if(typeof t=="string"&&(t={id:t,type:e||"unknown"}),da(t))return typeof t.source=="string"&&(t.source={id:t.source,type:e||"unknown"}),t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:n||"Manifest"}]),t;let i;if((t.id||"").indexOf("#")!==-1){const[a,u]=(t.id||"").split("#");t.id=a,u&&(i={type:"FragmentSelector",value:u})}return{type:"SpecificResource",source:t,selector:i}}function UO(t){const e=Object.assign({},t);return t&&t.items&&(e.items=t.items.map(n=>typeof n=="string"||n.type==="Canvas"?hS(n):n)),e}function jO(t){const e=Object.assign({},t);return e.start?(e.start=hS(e.start,{typeHint:"Canvas"}),e):t}function FO(t){const e=Object.assign({},t);return e.target?(e.target=xv(e.target,{typeHint:"Canvas"}),e):t}function BO(t){return t}function Rv(t){return typeof t.items>"u"&&(t[mc]=!0),t}function HO(t){const e=_O(t),n=LO(),i={},a=PO(n,e),u=DO(i),p=new mv({collection:[Rv,zl(HM),u("Collection"),a("Collection")],manifest:[Rv,zl(VM),jO,u("Manifest"),a("Manifest")],canvas:[zl(BM),u("Canvas"),a("Canvas")],annotationPage:[Rv,Tv("AnnotationPage"),zl(FM),u("AnnotationPage"),a("AnnotationPage")],annotation:[Tv("Annotation"),zO,FO,u("Annotation"),a("Annotation")],contentResource:[Tv("ContentResource"),u("ContentResource"),a("ContentResource")],range:[zl($M),UO,u("Range","Canvas"),a("Range","Canvas")],agent:[zl(WM),u("Agent"),a("Agent")],specificResource:[BO],service:[IO(n)]}).traverseUnknown(e);return{entities:n,resource:p,mapping:i}}function VO(t){const e={};for(const[n,i]of t){if(n===U1&&i!==Mr)return i;i!==Mr&&typeof i<"u"&&i!==null&&(e[n]=i)}return e}function $O(t,e,n){if(!e.type||!e.id)throw new Error("Unknown entity");if(!n[e.type])throw new Error(`Serializer not found for ${e.type}`);function i(a,u,f=0){const p=n[a.type];if(!p)return Mr;if(f>20)throw new Error("Circular reference: "+a.id+" "+a.type);const[g,S]=j1(t,a.type?a:a.id,u)||(a.id&&a.type?a:null);if(!g)return Mr;const m=p(g,t,{parent:u,isTopLevel:e.id===a.id,fullResource:S});let x=m.next();for(;!x.done;){const T=x.value;let _=Mr;if(T)if(Array.isArray(T)){const M=[];for(const k of T)M.push(i(k,a,f+1));_=M}else _=i(T,a,f+1);x=m.next(_)}return x.value===Mr?Mr:VO(x.value)}return i(e)}function yc(t,{allowSourceString:e=!0,allowString:n=!1,allowedStringType:i}={}){const a=u=>{if(e&&u&&u.source&&typeof u.source!="string"){const f=Object.keys(u.source);if(u.source.id&&u.source.type&&f.length===2)return{...u,source:u.source.id}}return u};if(t){if(t.source&&t.source.partOf)return a(t);const u=Object.keys(t);if(u.length===2&&t.type&&t.source||u.length===3&&t.type&&t.source&&u.indexOf("selector")!==-1&&!t.selector)return n&&(!i||i===t.source.type)?t.source.id:t.source.type==="ContentResource"?{type:"SpecificResource",source:t.source.id}:t.source;if(t.selector&&!Array.isArray(t.selector)&&typeof t.selector!="string"&&t.selector.type==="FragmentSelector"){const f=`${t.source.id}#${t.selector.value}`;return n?f:{id:f,type:t.source.type}}}return a(t)}function Ul(t){if(!t)return;const e=Object.keys(t);if(e.length!==0){if(e.length===1){const n=e[0];if(!n)return"";const i=(t[n]||[]).join("");return n==="@none"||n==="none"||n==="en"?i:{"@language":n,"@value":i}}return e.map(n=>({"@language":n,"@value":(t[n]||[]).join("")}))}}function pS(t){return Array.isArray(t)?t.map(e=>pS(e)):typeof t=="string"?t:t.type&&t.type==="Canvas"?t.id:t}function pa(t,e=!1){if(t)return t.length>1&&!e?t:t[0]||void 0}function WO(t){if(t){if(typeof t=="string")return{"@id":t};if("@id"in t){const e={...t};return delete e["@type"],e}return{"@context":"http://iiif.io/api/image/2/context.json","@id":t.id,profile:`http://iiif.io/api/image/2/profiles/${t.profile}.json`}}}function ao(t,e){return[["@id",t.id],["@type",e],["format",t.format],["height",t.height],["width",t.width],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["license",t.license?t.license:void 0]]}function*oo(t){const e=t.provider?yield t.provider[0]:void 0;return[["label",Ul(t.label)],["metadata",t.metadata&&t.metadata.length?t.metadata.map(n=>({label:Ul(n.label)||"",value:Ul(n.value)||""})):void 0],["description",Ul(t.summary)],["thumbnail",pa(yield t.thumbnail)],["navDate",t.navDate],["logo",e?pa(e.logo):void 0],["homepage",e?e.homepage:void 0],["attribution",t.requiredStatement?Ul(t.requiredStatement.value):void 0]]}function*Sc(t){const e=t.start&&t.start.type&&t.start.type==="SpecificResource"?yc(t.start):t.start;return[["seeAlso",pa(yield t.seeAlso)],["service",pa((t.service||[]).map(WO))],["rendering",pa(yield t.rendering)],["startCanvas",e?e.id:void 0]]}function qO(t){return t.type==="SpecificResource"}function YO(t){return t&&t.type==="FragmentSelector"}function QO(t){if(t&&qO(t)){let e=t.id;const n=t.selector?Array.isArray(t.selector)?t.selector[0]:t.selector:void 0;return YO(n)&&(e+="#"+n.value),e}return t==null?void 0:t.id}const GO={Manifest:function*(t,e,{isTopLevel:n}){return[...n?[["@context","http://iiif.io/api/presentation/2/context.json"]]:[],...ao(t,"sc:Manifest"),...yield*oo(t),...yield*Sc(t),["sequences",[{"@id":`${t.id}/sequence0`,"@type":"sc:Sequence",canvases:yield t.items}]],["structures",yield t.structures]]},Canvas:function*(t){const n=(yield t.items)[0];return[...ao(t,"sc:Canvas"),...yield*oo(t),...yield*Sc(t),["images",n?[n.resources]:void 0],["annotations",t.annotations&&t.annotations.length?pa(yield t.annotations):void 0]]},AnnotationPage:function*(t){return[...ao(t,"sc:AnnotationList"),...yield*oo(t),["resources",t.items&&t.items.length?pa(yield t.items):void 0]]},Annotation:function*(t){return[["@id",t.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",pS(t.target)],["resource",pa(yield t.body,!0)]]},ContentResource:function*(t){switch(t.type){case"Image":return[...ao(t,"dctypes:Image"),...yield*oo(t),...yield*Sc(t)];case"Text":case"Dataset":default:return[...ao(t,void 0),...yield*oo(t)]}},AnnotationCollection:function*(t){return[["@id",t.id],["@type","sc:Layer"],["label",Ul(t.label)]]},Collection:function*(t){return[...ao(t,"sc:Collection"),...yield*oo(t),...yield*Sc(t),["members",yield*t.items]]},Range:function*(t){const e=[],n=[];if(t.items)for(const i of t.items){const a=i.type==="SpecificResource"?i.source:i;if(a){const u=yield a;e.push({"@id":QO(i),"@type":a.type,label:u?u.label:void 0,within:t.id}),a.type==="Canvas"&&n.push(a.id)}}return[...ao(t,"sc:Range"),...yield*oo(t),...yield*Sc(t),["canvases",n.length===e.length?n:void 0],["members",n.length!==e.length?e:void 0]]}};function lo(t){var e;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],["type",t.type],["format",t.format],["profile",t.profile],["height",t.height||void 0],["width",t.width||void 0],["duration",t.duration||void 0],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["behavior",t.behavior&&t.behavior.length?t.behavior:void 0],["timeMode",t.timeMode],["motivation",Array.isArray(t.motivation)?t.motivation[0]:t.motivation],[zn,Mr]]}function _n(t){if(t===Mr||!t||t.length===0)return;const e=t.filter(n=>n!==Mr);if(e.length!==0)return e}function vS(t){if(t&&t.type&&t.type==="ImageService2"){const{id:e,type:n,profile:i,...a}=t,u=typeof i=="string"?i:Array.isArray(i)?i.find(f=>typeof f=="string"):"";return{"@id":e,"@type":n,profile:u?u.startsWith("http")?u:`http://iiif.io/api/image/2/${u}.json`:"http://iiif.io/api/image/2/level0.json",...a}}return t}function mS(t){if(Array.isArray(t)||(t=t?[t]:[]),!(!t||t.length===0))return t.map(vS)}function*va(t){return[["label",t.label],["metadata",_n(t.metadata)],["summary",t.summary],["requiredStatement",t.requiredStatement],["rights",Array.isArray(t.rights)?t.rights[0]||void 0:t.rights||void 0],["navDate",t.navDate],["language",t.language],["thumbnail",_n(yield t.thumbnail)],["placeholderCanvas",yield t.placeholderCanvas],["accompanyingCanvas",yield t.accompanyingCanvas],["provider",_n(yield t.provider)]]}function*ma(t){return[["seeAlso",_n(yield t.seeAlso)],["service",_n(mS(t.service))],["services",_n(mS(t.services))],["rendering",_n(yield t.rendering)],["supplementary",_n(yield t.supplementary)],["homepage",_n(yield t.homepage)],["logo",_n(yield t.logo)],["partOf",_n(yield t.partOf)],["start",t.start?yc(t.start):t.start]]}const XO={Manifest:function*(t,e,{isTopLevel:n}){return n?[["@context",t["@context"]?t["@context"]:"http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["structures",_n(yield t.structures)],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Canvas:function*(t){return[...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]},Agent:function*(t){return[["id",t.id],["type","Agent"],["label",t.label],...yield*ma(t)]},AnnotationPage:function*(t){var e;const n=Object.entries(t).map(([a,u])=>[a,Array.isArray(u)?_n(u):u]).filter(([a,u])=>a!=="items"&&a!=="id"&&a!==zn&&a!==Kr&&a!==mc),i=yield t.items;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],...n,...yield*ma(t),["items",i.length||t[mc]===!1?i:Mr]]},Service:function*(t){return[[U1,vS(t)]]},Annotation:function*(t){const e=Object.entries(t).map(([i,a])=>i==="motivation"?[i,Array.isArray(a)?a[0]:a]:i==="target"?[i,yc(a,{allowString:!0,allowSourceString:!0,allowedStringType:"Canvas"})]:[i,Array.isArray(a)?_n(a):a]).filter(([i])=>i!=="body"&&i!==zn&&i!==mc);let n;if(Array.isArray(t.body)){const i=[];for(const a of t.body)if(a&&da(a)){const u={...a};u.source=yield a.source,i.push(yc(u,{allowSourceString:!0}))}else i.push(yield a);n=i}else t.body&&da(t.body)?(n={...t.body},n.source=yield t.body.source):n=yield t.body;return[...e,...yield*va(t),...yield*ma(t),["body",n.length===1?n[0]:n]]},ContentResource:function*(t){return KO([...lo(t),...yield*va(t),...yield*ma(t),["annotations",_n(yield t.annotations)],["items",_n(yield t.items)]],t)},AnnotationCollection:function*(t){return[["id",t.id],["type","AnnotationCollection"],["label",t.label]]},Collection:function*(t,e,{isTopLevel:n}){return n?[["@context","http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",_n(yield t.items)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Range:function*(t){const e=[];for(const n of t.items)n.type==="Range"?e.push(yield n):n&&n.type==="SpecificResource"?e.push(yc(n)):e.push(n);return[...lo(t),...yield*va(t),...yield*ma(t),["items",e],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]}};function KO(t,e){const n=Object.keys(e),i=t.map(([a])=>a);for(const a of n)a===zn||a===mc||i.indexOf(a)===-1&&typeof e[a]<"u"&&t.push([a,e[a]]);return t}var ZO=Object.defineProperty,JO=(t,e,n)=>e in t?ZO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=(t,e,n)=>(JO(t,typeof e!="symbol"?e+"":e,n),n);const Ln=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},gS="@iiif/IMPORT_ENTITIES",yS="@iiif/MODIFY_ENTITY_FIELD",SS="@iiif/REORDER_ENTITY_FIELD",bS="@iiif/ADD_REFERENCE",Av="@iiif/UPDATE_REFERENCE",ES="@iiif/REMOVE_REFERENCE",xS="@iiif/ADD_METADATA",wS="@iiif/REMOVE_METADATA",Mv="@iiif/UPDATE_METADATA",CS="@iiif/REORDER_METADATA",TS=Ln(gS)(),e_=Ln(yS)(),t_=Ln(SS)(),n_=Ln(bS)(),i_=Ln(ES)(),r_=Ln(Av)(),s_=Ln(xS)(),a_=Ln(Mv)(),o_=Ln(wS)(),l_=Ln(CS)(),u_={importEntities:TS,modifyEntityField:e_,reorderEntityField:t_,addReference:n_,removeReference:i_,updateReference:r_,addMetadata:s_,removeMetadata:o_,updateMetadata:a_,reorderMetadata:l_},RS="@iiif/ADD_MAPPING",AS="@iiif/ADD_MAPPINGS",c_=Ln(RS)(),f_=Ln(AS)(),MS="@iiif/SET_META_VALUE",OS="@iiif/SET_META_VALUE_DYNAMIC",_S="@iiif/UNSET_META_VALUE",d_=Ln(MS)(),h_=Ln(OS)(),p_=Ln(_S)(),LS={setMetaValue:d_,setMetaValueDynamic:h_,unsetMetaValue:p_},Ov="RESOURCE_ERROR",PS="RESOURCE_LOADING",_v="RESOURCE_READY",DS="@iiif/REQUEST_RESOURCE",kS="@iiif/REQUEST_ERROR",IS="@iiif/REQUEST_MISMATCH",NS="@iiif/REQUEST_COMPLETE",v_="@iiif/REQUEST_OFFLINE_RESOURCE",m_=Ln(DS)(),Lv=Ln(kS)(),g_=Ln(IS)(),y_=Ln(NS)(),Pv="@iiif/BATCH",S_="@iiif/BATCH_IMPORT",Dv=Ln(Pv)(),b_=(t,e)=>{const{entities:n,resource:i,mapping:a}=HO(e);if(i.id===void 0)return[Lv({id:t,message:"ID is not defined in resource."})];const u=[TS({entities:n}),f_({mapping:a})];return i.id!==t&&(u.push(c_({id:t,type:i.type})),u.push(g_({requestId:t,actualId:i.id}))),u.push(y_({id:t})),u},zS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function E_(t,e){return!!(t===e||zS(t)&&zS(e))}function US(t,e){if(!Array.isArray(t)||!Array.isArray(e))return t===e;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!E_(t[n],e[n]))return!1;return!0}function kv(t,e,n){const i=t.iiif.requests[e],a=t.iiif.mapping[e];if(!a||!t.iiif.entities[a][i.resourceUri])return;const u=t.iiif.entities[a][i.resourceUri];if(u&&u[zn]){const f=u[zn].find(p=>n?p[Kr]===n.id:p[Kr]===u.id);return vv(u,f)}return u}function x_(t){return t&&typeof t.then=="function"}function jS(t,e,{waitTimeout:n=30}={}){return(i,a)=>{const u=t.getStore(),f=u.getState(),p=f.iiif.requests[i];if(p){if(p.loadingState===_v){const S=kv(f,i);if(S)return S}switch(p.loadingState){case Ov:break;case PS:return(async()=>{let S,m=!1;try{const x=await Promise.race([new Promise((T,_)=>{m||(S=u.subscribe(()=>{const M=u.getState();if(M.iiif.requests[i].loadingState===Ov){_();return}if(M.iiif.requests[i].loadingState===_v){const k=kv(M,i);k?T(k):_()}}))}),new Promise((T,_)=>setTimeout(()=>{m=!0,_()},n*60*1e3))]);if(S&&S(),x)return x}catch{S&&S()}})()}}t.dispatch(m_({id:i}));const g=S=>{if(!S)return;!S.id&&!S["@id"]&&(S["@type"]&&(S["@id"]=i),S.id=i);const m=b_(i,S);return t.dispatch(Dv({actions:m})),kv(u.getState(),i)};try{const S=e(i,a);return x_(S)?(async()=>{try{return g(await S)}catch(m){throw t.dispatch(Lv({id:i,message:m.toString()})),m}})():g(S)}catch(S){throw t.dispatch(Lv({id:i,message:S.toString()})),S}}}function FS(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const BS=t=>{let e;const n=new Set,i=(f,p)=>{const g=typeof f=="function"?f(e):f;if(!Object.is(g,e)){const S=e;e=p??typeof g!="object"?g:Object.assign({},e,g),n.forEach(m=>m(e,S))}},a=()=>e,u={setState:i,getState:a,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{n.clear()}};return e=t(i,a,u),u},w_=t=>t?BS(t):BS,C_=(t,e)=>(n,i,a)=>(a.dispatch=u=>(n(f=>t(f,u),!1,u),u),a.dispatchFromDevtools=!0,{dispatch:(...u)=>a.dispatch(...u),...e}),T_=C_,Iv=new Map,Nd=t=>{const e=Iv.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,i])=>[n,i.getState()])):{}},R_=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const i=Iv.get(n.name);if(i)return{type:"tracked",store:t,...i};const a={connection:e.connect(n),stores:{}};return Iv.set(n.name,a),{type:"tracked",store:t,...a}},A_=(t,e={})=>(n,i,a)=>{const{enabled:u,anonymousActionType:f,store:p,...g}=e;let S;try{S=(u??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!S)return t(n,i,a);const{connection:m,...x}=R_(p,S,g);let T=!0;a.setState=(k,L,P)=>{const O=n(k,L);if(!T)return O;const j=P===void 0?{type:f||"anonymous"}:typeof P=="string"?{type:P}:P;return p===void 0?(m==null||m.send(j,i()),O):(m==null||m.send({...j,type:`${p}/${j.type}`},{...Nd(g.name),[p]:a.getState()}),O)};const _=(...k)=>{const L=T;T=!1,n(...k),T=L},M=t(a.setState,i,a);if(x.type==="untracked"?m==null||m.init(M):(x.stores[x.store]=a,m==null||m.init(Object.fromEntries(Object.entries(x.stores).map(([k,L])=>[k,k===x.store?M:L.getState()])))),a.dispatchFromDevtools&&typeof a.dispatch=="function"){const k=a.dispatch;a.dispatch=(...L)=>{k(...L)}}return m.subscribe(k=>{var L;switch(k.type){case"ACTION":if(typeof k.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Nv(k.payload,P=>{if(P.type==="__setState"){if(p===void 0){_(P.state);return}Object.keys(P.state).length!==1&&console.error(`
284
+ `),i.htmlChildren)},MM=()=>T.useContext(uv),Dd=()=>{const t=MM();return t?t.runtime:void 0},D1=(t,e=[])=>{const n=Dd();T.useEffect(()=>n?n.registerHook("useFrame",t):()=>{},e)};function OM(){return T.useContext(cv)}async function _M(t,e,n){if(T.version.startsWith("18.")){const i=await Promise.resolve().then(()=>DD),a=i.default?i.default.createRoot:i.createRoot;n.current||(n.current=a(t)),n.current.render(e)}else if(typeof ReactDOM<"u"){const{render:i,unmountComponentAtNode:a}=ReactDOM;i(e,t),n.current={unmount(){a(t)}}}else{const i=await import("react-dom"),a=i.default?i.default.render:i.render,u=i.default?i.default.unmountComponentAtNode:i.unmountComponentAtNode;a(e,t),n.current={unmount(){u(t)}}}}const hv=T.forwardRef(({children:t,...e},n)=>{const i=T.useRef(),a=Dd(),u=T.useRef(0),f=T.useRef(),p=T.useRef();return D1(()=>{var g,S,m,x;if(e.relative){const R=i.current;if(R&&a){const _=a.getScaleFactor();u.current!==_&&(u.current=_,R.style.transformOrigin="0 0",R.style.transform=`scale(${1/u.current})`,R.style.width=`${u.current*100}%`,R.style.height=`${u.current*100}%`,i.current&&((S=(g=f.current)==null?void 0:g.__owner.value)!=null&&S.rotation)&&(R.style.transform=`scale(${1/u.current}) translate(50%, 50%) rotate(${((x=(m=f.current)==null?void 0:m.__owner.value)==null?void 0:x.rotation)||0}deg) translate(-50%, -50%)`))}}},[e.relative]),T.useLayoutEffect(()=>{const g=f.current;n&&g&&(typeof n=="function"?n(g):n.current=g);async function S(){if(g&&g.__host){const m=e.relative?T.createElement("div",{ref:i},t):t;await _M(g.__host.element,m,p)}}g&&g.__host?S():g&&(g.__onCreate=S)},[n,t,f,e.relative]),T.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),T.createElement("box",{html:!0,...e,ref:f})});hv.displayName="HTMLPortal";const k1=(t,e,n=[])=>{const i=Dd(),a=i?i.world:void 0;T.useEffect(()=>{if(i){const u=e,f=Rl[t];i.world.activatedEvents.push(f);const p=f.slice(2).toLowerCase();return i.world.addEventListener(p,u),()=>{i.world.removeEventListener(p,u)}}return()=>{}},[a,t,...n])};function I1(t,e){if(t===0)return[0,1];if(e===0)return[1,0];const n=Math.abs(t)/Math.abs(e);return[n,1-n]}function LM(){const t=T.useRef({ctrl:!1,shift:!1,alt:!1});return T.useLayoutEffect(()=>{function e(i){i.key==="Shift"&&(t.current.shift=!0),i.key==="Control"&&(t.current.ctrl=!0),i.key==="Alt"&&(t.current.alt=!0)}function n(i){i.key==="Shift"&&(t.current.shift=!1),i.key==="Control"&&(t.current.ctrl=!1),i.key==="Alt"&&(t.current.alt=!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)}},[]),t}const PM=(t,e)=>{const n=oM(),i=Dd(),a=OM(),u=T.useRef(),f=T.useRef(null),p=T.useRef(),[g,S]=T.useState(!1),m=T.useRef(!1),x=T.useRef({north:0,south:0,east:0,west:0}),R=LM(),_=T.useCallback(O=>j=>{if(m.current=!0,S(!0),a&&i){const{top:q,left:ee}=a,H=i.viewerToWorld(j.pageX-ee,j.pageY-q);p.current={x:H.x,y:H.y},u.current=O}},[a,i]),M=T.useMemo(()=>t.width/t.height,[t.width,t.height]),k=T.useCallback(O=>{if(!Math.abs(O.north-O.south+(O.east-O.west)))return;const q=-O.west+O.east,ee=-O.north+O.south,H=t.width+q,Z=t.height+ee;if(H/Z>=M){const W=Z*M,re=H-W,[ge,be]=I1(O.east,O.west);O.west=O.west+re*be,O.east=O.east-re*ge}else{const W=H/M,re=Z-W,[ge,be]=I1(O.north,O.south);O.north=O.north+re*ge,O.south=O.south-re*be}},[t.width,t.height,M]);D1(()=>{p&&i&&i.updateNextFrame()}),T.useEffect(()=>{i&&i.updateNextFrame()},[i,g]);const L=T.useCallback(O=>{var j;if(!i||!a||i.mode!=="sketch")return;const{top:q,left:ee}=a,H=i.viewerToWorld(O.pageX-ee,O.pageY-q),Z=f.current,ie=!t.maintainAspectRatio&&R.current.alt,W=!ie&&R.current.shift&&((j=u.current)==null?void 0:j.indexOf("-"))!==-1;if((u.current==="translate"||u.current==="east"||u.current==="north-east"||u.current==="south-east")&&(x.current.east=H.x-(p.current?p.current.x:0),ie&&(x.current.west=-x.current.east)),(u.current==="translate"||u.current==="west"||u.current==="north-west"||u.current==="south-west")&&(x.current.west=H.x-(p.current?p.current.x:0),ie&&(x.current.east=-x.current.west)),(u.current==="translate"||u.current==="north"||u.current==="north-east"||u.current==="north-west")&&(x.current.north=H.y-(p.current?p.current.y:0),ie&&(x.current.south=-x.current.north)),(u.current==="translate"||u.current==="south"||u.current==="south-west"||u.current==="south-east")&&(x.current.south=H.y-(p.current?p.current.y:0),ie&&(x.current.north=-x.current.south)),(t.maintainAspectRatio||W)&&k(x.current),Z){const re=x.current.west,ge=x.current.north,be=t.width+x.current.east,Ee=t.height+x.current.south;Z.points[1]=Math.min(re,be),Z.points[2]=Math.min(ge,Ee),Z.points[3]=Math.max(re,be),Z.points[4]=Math.max(ge,Ee),i.updateNextFrame()}},[i,t.width,t.height,t.maintainAspectRatio,a]);k1("mousemove",L,[t.width,t.height,a]),k1("pointermove",L,[t.width,t.height,a]);const P=T.useRef();return T.useEffect(()=>{P.current=()=>{if(m.current){const O=x.current.west,j=x.current.north,q=t.width+x.current.east,ee=t.height+x.current.south,H=Math.min(O,q),Z=Math.min(j,ee),ie=Math.max(O,q),W=Math.max(j,ee),re={x:(t.x||0)+H,y:(t.y||0)+Z,width:ie-H||1,height:W-Z||1};t.maintainAspectRatio,e(re),u.current=void 0,p.current=void 0,x.current.east=0,x.current.west=0,x.current.north=0,x.current.south=0,m.current=!1,S(!1)}}},[e,t.height,t.width,t.x,t.y]),T.useEffect(()=>{const O=()=>{P.current&&P.current()};return window.addEventListener("pointerup",O),window.addEventListener("touchend",O),()=>{window.removeEventListener("pointerup",O),window.removeEventListener("touchend",O)}},[]),{portalRef:f,mode:n,mouseEvent:_,onPointerMoveCallback:L,isEditing:g}};function DM({handleSize:t,resizable:e,onSave:n,children:i,maintainAspectRatio:a,disableCardinalControls:u,...f}){const p=typeof t>"u"?a?10:8:t,{portalRef:g,mode:S,mouseEvent:m,isEditing:x}=PM({x:f.x||0,y:f.y||0,width:f.width,height:f.height,maintainAspectRatio:a},n),R=T.useMemo(()=>m("translate"),[m]),_=T.useMemo(()=>m("east"),[m]),M=T.useMemo(()=>m("west"),[m]),k=T.useMemo(()=>m("south"),[m]),L=T.useMemo(()=>m("north"),[m]),P=T.useMemo(()=>m("south-east"),[m]),O=T.useMemo(()=>m("south-west"),[m]),j=T.useMemo(()=>m("north-east"),[m]),q=T.useMemo(()=>m("north-west"),[m]),ee=S==="sketch",H={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:a||u?"50%":2,position:"absolute",background:"#fff",pointerEvents:x?"none":ee?"initial":"none"};return T.createElement(T.Fragment,null,T.createElement("world-object",{...f},i,ee&&e?T.createElement(hv,{ref:g,target:{x:0,y:0,height:f.height,width:f.width},relative:!0,interactive:!1},ee&&e?T.createElement(T.Fragment,null,T.createElement("div",{onMouseDown:R,onTouchStart:R,style:{display:"block",width:"100%",height:"100%",position:"relative",border:"1px solid rgba(155,155,155, .7)",boxSizing:"border-box",pointerEvents:x?"none":ee?"initial":"none"}}),a?null:T.createElement(T.Fragment,null,T.createElement("div",{title:"east",onTouchStart:_,onMouseDown:_,style:{...H,cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:u?0:1,transform:`translate(${p/2}px, -${p}px)`}}),T.createElement("div",{title:"west",onMouseDown:M,style:{...H,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)`}}),T.createElement("div",{title:"north",onMouseDown:L,style:{...H,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)`}}),T.createElement("div",{title:"south",onMouseDown:k,style:{...H,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)`}})),T.createElement("div",{title:"north-east",onMouseDown:j,style:{...H,cursor:"ne-resize",position:"absolute",height:p,width:p,right:0,top:0,transform:`translate(${p/2}px, -${p/2}px)`}}),T.createElement("div",{title:"south-east",onMouseDown:P,style:{...H,cursor:"se-resize",position:"absolute",height:p,width:p,bottom:0,right:0,transform:`translate(${p/2}px, ${p/2}px)`}}),T.createElement("div",{title:"south-west",onMouseDown:O,style:{...H,cursor:"sw-resize",position:"absolute",height:p,width:p,bottom:0,left:0,transform:`translate(-${p/2}px, ${p/2}px)`}}),T.createElement("div",{title:"north-west",onMouseDown:q,style:{...H,cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`}})):null):null))}function kM({interactive:t,region:e,onClick:n,onSave:i,maintainAspectRatio:a,disableCardinalControls:u,isEditing:f,rotation:p,style:g={backgroundColor:"rgba(0,0,0,.5)"}}){const S=T.useCallback(m=>{i({id:e.id,x:e.x,y:e.y,height:e.height,width:e.width,...m})},[i,e.id,e.x,e.y,e.height,e.width]);return T.createElement(DM,{x:e.x,y:e.y,rotation:p,width:e.width,height:e.height,resizable:f,onSave:S,maintainAspectRatio:a,disableCardinalControls:u},T.createElement("box",{interactive:t,onClick:m=>{m.preventDefault(),m.stopPropagation(),n(e)},target:{x:0,y:0,width:e.width,height:e.height},style:g}))}const IM=t=>{var e,n,i,a,u;const f=t.width/(((e=t.crop)==null?void 0:e.width)||t.tiles.width),p=t.tiles.imageService.tiles||[],g=t.tiles.imageService.sizes||[],S=t.enableThumbnail,m=t.enableSizes,x=T.useMemo(()=>{const R=t.tiles.imageService.id||t.tiles.imageService["@id"];return R&&R.endsWith("/info.json")?R.slice(0,-1*10):R},[t.tiles.imageService.id]);return T.createElement("world-object",{rotation:t.rotation,key:t.tiles.imageService.id,scale:f,height:((n=t.crop)==null?void 0:n.height)||t.tiles.height,width:((i=t.crop)==null?void 0:i.width)||t.tiles.width,x:t.x,y:t.y,onClick:t.onClick},T.createElement("composite-image",{key:t.tiles.imageService.id,id:t.tiles.imageService.id,width:((a=t.crop)==null?void 0:a.width)||t.tiles.width,height:((u=t.crop)==null?void 0:u.height)||t.tiles.height,crop:t.crop},S&&t.tiles.thumbnail?T.createElement("world-image",{priority:!0,uri:t.tiles.thumbnail.id,target:{width:t.tiles.width,height:t.tiles.height},display:{width:t.tiles.thumbnail.width,height:t.tiles.thumbnail.height},crop:t.crop}):null,m&&g.map((R,_)=>T.createElement("world-image",{key:_,uri:`${x}/full/${R.width},${R.height}/0/default.jpg`,target:{width:t.tiles.width,height:t.tiles.height},display:{width:R.width,height:R.height},crop:t.crop})),p.map(R=>(R.scaleFactors||[]).map(_=>T.createElement("tiled-image",{key:`${t.tiles.imageService.id}-tile-${_}`,uri:t.tiles.imageService.id,display:{width:t.tiles.width,height:t.tiles.height},tile:R,scaleFactor:_,crop:t.crop})))))};function NM(t,e){return t?e?{...t,...e||{},":hover":t[":hover"]?Object.assign(t[":hover"]||{},e[":hover"]||{}):e[":hover"],":active":t[":active"]?Object.assign(t[":active"]||{},e[":active"]||{}):e[":hover"]}:t:e}function pv(t,e){return pv=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},pv(t,e)}function zM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pv(t,e)}var UM=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),e.length!==n.length||e.some(function(i,a){return!Object.is(i,n[a])})},N1={error:null},jM=function(t){zM(e,t);function e(){for(var i,a=arguments.length,u=new Array(a),f=0;f<a;f++)u[f]=arguments[f];return i=t.call.apply(t,[this].concat(u))||this,i.state=N1,i.resetErrorBoundary=function(){for(var p,g=arguments.length,S=new Array(g),m=0;m<g;m++)S[m]=arguments[m];i.props.onReset==null||(p=i.props).onReset.apply(p,S),i.reset()},i}e.getDerivedStateFromError=function(a){return{error:a}};var n=e.prototype;return n.reset=function(){this.setState(N1)},n.componentDidCatch=function(a,u){var f,p;(f=(p=this.props).onError)==null||f.call(p,a,u)},n.componentDidUpdate=function(a,u){var f=this.state.error,p=this.props.resetKeys;if(f!==null&&u.error!==null&&UM(a.resetKeys,p)){var g,S;(g=(S=this.props).onResetKeysChange)==null||g.call(S,a.resetKeys,p),this.reset()}},n.render=function(){var a=this.state.error,u=this.props,f=u.fallbackRender,p=u.FallbackComponent,g=u.fallback;if(a!==null){var S={error:a,resetErrorBoundary:this.resetErrorBoundary};if(se.isValidElement(g))return g;if(typeof f=="function")return f(S);if(p)return se.createElement(p,S);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(se.Component);const FM={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},kd=T.createContext(FM),As=()=>T.useContext(kd);function ca({value:t,children:e}){const n=As(),i=T.useMemo(()=>({...n,...t}),[t,n]);return oe.jsx(kd.Provider,{value:i,children:e})}var BM=Object.defineProperty,HM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fa=(t,e,n)=>(HM(t,typeof e!="symbol"?e+"":e,n),n);function da(t){return typeof t=="string"?!1:!!t&&t.type==="SpecificResource"}function z1(t,e){const n=e||"unknown";if(!t)return;if(typeof t=="string")return{id:t,type:n};if(da(t))return z1(t.source,e);let i=n&&n!=="unknown"?n:t.type||t["@type"];const a=t.id||t["@id"];if(i.indexOf(":")!==-1&&(i=i.split(":").pop()),a&&i)return{id:a,type:i}}const vc={},zn="iiif-parser:hasPart",Kr="iiif-parser:partOf",mc="iiif-parser:isExternal",Mr="__$UNSET$__",U1="__$UNWRAP$__",ze=[];Object.freeze(ze),Object.freeze(vc);function VM(t){if(t===vc||Object.keys(t).length===0)return!0;for(const e in t)return!1;return!0}function vv(t,e){if(e&&e["@explicit"]){const n={},i=Object.keys(e);for(const a of i)a===Kr||a==="@explicit"||(VM(e[a])?n[a]=t[a]:n[a]=e[a]);return n}return t}function j1(t,e,n){const i=z1(e);if(!i)return[void 0,void 0];const a=t.requests[i.id],u=i.type||t.mapping[i.id];if(!u||a&&a.resourceUri&&!t.entities[u][a.resourceUri])return[void 0,void 0];const f=t.entities[u][a?a.resourceUri:i.id];if(i.type&&!f)return j1(t,{id:i.id},n);if(f&&f[zn]){const p=f[zn].find(S=>n?S[Kr]===n.id:S[Kr]===f.id);return[vv(f,p),f]}return[f,f]}const $M={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:ze,label:null,thumbnail:ze,summary:null,requiredStatement:null,metadata:ze,rights:null,provider:ze,items:ze,seeAlso:ze,homepage:ze,rendering:ze,service:ze},WM={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,duration:0,height:0,width:0},qM={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,services:ze},YM={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:ze,behavior:ze,homepage:ze,items:ze,label:null,metadata:ze,navDate:null,provider:ze,partOf:ze,accompanyingCanvas:null,placeholderCanvas:null,rendering:ze,requiredStatement:null,rights:null,seeAlso:ze,service:ze,services:ze,start:null,structures:ze,summary:null,thumbnail:ze,viewingDirection:"left-to-right"},QM={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:ze,thumbnail:ze,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:ze,rights:null,navDate:null,provider:ze,items:ze,annotations:ze,seeAlso:ze,homepage:ze,partOf:ze,rendering:ze,service:ze,start:null,supplementary:null,viewingDirection:"left-to-right"},GM={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:ze,seeAlso:ze,homepage:ze},XM={id:"https://iiif-parser/empty-service",type:"UnknownService"};function Nl(t){return Array.isArray(t)?t:t?[t]:[]}function Id(...t){return e=>t.reduce((n,i)=>i(n),e)}const F1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function KM(t,e){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object"){if(e)return e;throw new Error(`${typeof t} is not a valid entity`)}if(typeof t.type=="string"){const n=F1.indexOf(t.type);if(n!==-1)return F1[n]}if(t.profile)return"Service";throw new Error("Resource type is not known")}class mv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),fa(this,"_traverseManifest",Id(this.traverseManifestItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseManifestStructures.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseCanvas",Id(this.traverseCanvasItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this),this.traverseInlineAnnotationPages.bind(this))),fa(this,"_traverseAnnotationPage",Id(this.traverseAnnotationPageItems.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this))),fa(this,"_traverseRange",Id(this.traverseRangeRanges.bind(this),this.traverseLinking.bind(this),this.traverseDescriptive.bind(this),this.traverseLinkedCanvases.bind(this))),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],specificResource:[],geoJson:[],...e},this.options={allowUndefinedReturn:!1,...n}}static all(e){return new mv({collection:[e],manifest:[e],canvas:[e],annotationCollection:[e],annotationPage:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],geoJson:[e],specificResource:[e],agent:[e]})}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=Nl(e.thumbnail).map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.provider&&(e.provider=e.provider.map(n=>this.traverseAgent(n,e))),e}traverseLinking(e){return e.seeAlso&&(e.seeAlso=e.seeAlso.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.service&&(e.service=Nl(e.service).map(n=>this.traverseService(n))),e.services&&(e.services=Nl(e.services).map(n=>this.traverseService(n,e))),e.logo&&(e.logo=e.logo.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.homepage&&(e.homepage=e.homepage.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.partOf&&(e.partOf=e.partOf.map(n=>typeof n=="string"||!n.type?this.traverseType(n,{parent:e},this.traversals.contentResource):n.type==="Canvas"?this.traverseType(n,{parent:e},this.traversals.canvas):n.type==="AnnotationCollection"?this.traverseType(n,{parent:e},this.traversals.annotationCollection):n.type==="Collection"?this.traverseType(n,{parent:e},this.traversals.collection):this.traverseType(n,{parent:e},this.traversals.contentResource))),e.start&&(da(e.start)?e.start=this.traverseSpecificResource(e.start,"Canvas",e):e.start=this.traverseType(e.start,{parent:e},this.traversals.canvas)),e.rendering&&(e.rendering=e.rendering.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e.supplementary&&(e.supplementary=e.supplementary.map(n=>this.traverseType(n,{parent:e},this.traversals.contentResource))),e}traverseCollectionItems(e){return e.items&&e.items.map(n=>n.type==="Collection"?this.traverseCollection(n):this.traverseManifest(n)),e}traverseCollection(e,n){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traverseLinkedCanvases(this.traverseCollectionItems(e))))),{parent:n},this.traversals.collection)}traverseGeoJson(e,n){return this.traverseType(e,{parent:n},this.traversals.geoJson)}traverseNavPlace(e){return e.navPlace&&(e.navPlace=this.traverseGeoJson(e.navPlace,e)),e}traverseManifestItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseCanvas(n))),e}traverseManifestStructures(e){return e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseManifest(e,n){return this.traverseType(this._traverseManifest(e),{parent:n},this.traversals.manifest)}traverseCanvasItems(e){return e.items=(e.items||[]).map(n=>this.traverseAnnotationPage(n,e)),e}traverseInlineAnnotationPages(e){return typeof e=="string"||!e||e.annotations&&(e.annotations=e.annotations.map(n=>this.traverseAnnotationPage(n,e))),e}traverseCanvas(e,n){return this.traverseType(this._traverseCanvas(e),{parent:n},this.traversals.canvas)}traverseAnnotationPageItems(e){return e.items&&(e.items=e.items.map(n=>this.traverseAnnotation(n,e))),e}traverseAnnotationPage(e,n){return this.traverseType(this._traverseAnnotationPage(e),{parent:n},this.traversals.annotationPage)}traverseAnnotationBody(e){return Array.isArray(e.body)?e.body=e.body.map(n=>this.traverseContentResource(n,e)):e.body&&(e.body=this.traverseContentResource(e.body,e)),e}traverseLinkedCanvases(e){return e.placeholderCanvas&&(e.placeholderCanvas=this.traverseCanvas(e.placeholderCanvas)),e.accompanyingCanvas&&(e.accompanyingCanvas=this.traverseCanvas(e.accompanyingCanvas)),e}traverseAnnotation(e,n){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(this.traverseDescriptive(e))),{parent:n},this.traversals.annotation)}traverseContentResourceLinking(e){return typeof e=="string"||!e||e&&e.service&&(e.service=Nl(e.service||[]).map(n=>this.traverseService(n,e))),e}traverseContentResource(e,n){return e.type==="Choice"&&(e.items=e.items.map(i=>this.traverseContentResource(i,e))),da(e)?this.traverseSpecificResource(e,"ContentResource"):this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(e)),{parent:n},this.traversals.contentResource)}traverseSpecificResource(e,n,i){let a=e.source;return typeof e.source=="string"&&(a={id:e.source,type:n||"unknown"}),this.traverseType({...e,source:n==="Canvas"||a.type==="Canvas"?this.traverseType(a,{parent:i},this.traversals.canvas):n==="ContentResource"?this.traverseContentResource(a,{parent:i}):this.traverseUnknown(a,{parent:i,typeHint:n})},{parent:i},this.traversals.specificResource)}traverseRangeRanges(e){return e.items&&(e.items=e.items.map(n=>typeof n=="string"?this.traverseCanvas({id:n,type:"Canvas"},e):da(n)?this.traverseSpecificResource(n,"Canvas",e):n.type==="Manifest"?this.traverseManifest(n,e):this.traverseRange(n,e))),e}traverseRange(e,n){return this.traverseType(this._traverseRange(e),{parent:n},this.traversals.range)}traverseAgent(e,n){return this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),{parent:n},this.traversals.agent)}traverseType(e,n,i){return i.reduce((a,u)=>{const f=u(a,n);return typeof f>"u"&&!this.options.allowUndefinedReturn?a:f},e)}traverseService(e,n){const i=Object.assign({},e);return i&&i.service&&(i.service=Nl(i.service).map(a=>this.traverseService(a))),this.traverseType(i,{parent:n},this.traversals.service)}traverseUnknown(e,{parent:n,typeHint:i}={}){const a=KM(e,i);switch(a){case"Collection":return this.traverseCollection(e,n);case"Manifest":return this.traverseManifest(e,n);case"Canvas":return this.traverseCanvas(e,n);case"AnnotationPage":return this.traverseAnnotationPage(e,n);case"Annotation":return this.traverseAnnotation(e,n);case"ContentResource":return this.traverseContentResource(e,n);case"Range":return this.traverseRange(e,n);case"Service":return this.traverseService(e,n);case"Agent":return this.traverseAgent(e,n);default:{if(i)return i;throw new Error(`Unknown or unsupported resource type of ${a}`)}}}}const B1=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function ZM(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=B1.indexOf(t["@type"]);if(e!==-1)return B1[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class gv{constructor(e,n={}){fa(this,"traversals"),fa(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new gv({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(ZM(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const JM="http://library.stanford.edu/iiif/image-api/compliance.html#level0",H1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",V1="http://library.stanford.edu/iiif/image-api/compliance.html#level2",eO="http://library.stanford.edu/iiif/image-api/conformance.html#level0",$1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",W1="http://library.stanford.edu/iiif/image-api/conformance.html#level2",tO="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",q1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Y1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",nO="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Q1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",G1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",iO="http://iiif.io/api/image/1/level0.json",rO="http://iiif.io/api/image/1/profiles/level0.json",X1="http://iiif.io/api/image/1/level1.json",K1="http://iiif.io/api/image/1/profiles/level1.json",Z1="http://iiif.io/api/image/1/level2.json",J1="http://iiif.io/api/image/1/profiles/level2.json",sO="http://iiif.io/api/image/2/level0.json",aO="http://iiif.io/api/image/2/profiles/level0.json",eS="http://iiif.io/api/image/2/level1.json",tS="http://iiif.io/api/image/2/profiles/level1.json",nS="http://iiif.io/api/image/2/level2.json",iS="http://iiif.io/api/image/2/profiles/level2.json",oO="level0",rS="level1",sS="level2",lO="http://iiif.io/api/image/2/level0",aS="http://iiif.io/api/image/2/level1",oS="http://iiif.io/api/image/2/level2",uO=[aS,oS,H1,V1,$1,W1,q1,Y1,Q1,G1,X1,K1,Z1,J1,eS,tS,nS,iS,rS,sS],cO=[lO,aS,oS,JM,H1,V1,eO,$1,W1,tO,q1,Y1,nO,Q1,G1,iO,rO,X1,K1,Z1,J1,sO,aO,eS,tS,nS,iS,oO,rS,sS];function Ms(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const yv={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function so(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function lS(t){if(Array.isArray(t))return lS(t.find(e=>typeof e=="string"));if(cO.indexOf(t)!==-1)return"level2";if(uO.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function fO(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function dO(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function uS(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const hO=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Sv(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=dO(i);if(u)return u}if(a){const u=fO(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&hO.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const pO=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function vO(t){const e=t.match(pO);return e?e[0]:t}function mO(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?vO(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const gO=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function yO(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),gO.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function SO(t){return t?t.map(e=>({label:so(e.label),value:so(e.value)})):[]}let cS=0;function fS(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(cS++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${cS}`)}function Os(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(uS):t.motivation&&(n=uS(t.motivation)),{"@context":t["@context"]?yO(t["@context"]):void 0,id:(t["@id"]||fS(t)).trim(),type:Sv(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function _s(t){const[e,n]=mO(t.license),i=[...t.metadata?SO(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?so(t.label):void 0,requiredStatement:t.attribution?{label:so(yv.attributionLabel),value:so(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?so(t.description):void 0,thumbnail:bO(t.thumbnail)}}function bO(t){return t&&(Array.isArray(t)?t:[t]).map(n=>typeof n=="string"?{id:n,type:"Image"}:(n.type==="unknown"&&(n.type="Image"),n))}function EO(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:Sv(i)});return n.length?n:void 0}function ha(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:yv.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:so(yv.providerName)}]:void 0,partOf:EO(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?Nl(t.service):void 0,supplementary:n?[n]:void 0}}function xO(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function wO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function CO(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Os(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ms({...a,..._s(t),...ha(t),start:i,items:e,structures:t.structures})}function TO(t){return Ms({...Os(t),..._s(t),...ha(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:fS(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function RO(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.resources&&t.resources.length?t.resources:void 0})}function AO(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function MO(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:Ev(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ms({...Os(t),..._s(t),...ha(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(bv):bv(t.resource)})}function bv(t){const e=t;return Ms({...Os(e),..._s(e),...ha(e),...xO(e)})}function OO(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Os(t),..._s(t),items:e}}function _O(t){return Ms({...Os(t),..._s(t),...ha(t),items:t.members})}function LO(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=Sv(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=lS(a)),Ms({...f,...u})}function PO(t){return Ms({...Os(t),..._s(t),...ha(t)})}const DO=new gv({collection:[wO],manifest:[CO],canvas:[TO],annotationList:[RO],sequence:[AO],annotation:[MO],contentResource:[bv],choice:[OO],range:[_O],service:[LO],layer:[PO]});function kO(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?DO.traverseUnknown(t):t}function Ev(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[Ev(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(Ev)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}function xv(t,e={}){if(Array.isArray(t))return xv(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?{type:"SpecificResource",source:{id:n,type:e.typeHint||"Unknown"},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||e.typeHint||"Unknown"}}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return xv(t.items[0]);if(t.type==="SpecificResource")return t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]),t.selector?{type:"SpecificResource",source:t.source,selector:t.selector}:{type:"SpecificResource",source:t.source};if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?{type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}:{type:"SpecificResource",source:{...t,id:n}}}return{type:"SpecificResource",source:t}}function IO(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function dS(t,e){if(typeof t=="string")return{id:t,type:e};if(!t.id)throw new Error(`Invalid resource does not have an ID (${JSON.stringify(t)}, ${e})`);return t}function NO(t,e){return(n,i)=>{const a=t[n]?t[n]:{};return(u,f)=>{const p=dS(u,i||n);return p&&p.id&&n?(a[p.id]=a[p.id]?Cv(a[p.id],p,{parent:f.parent,isTopLevel:e.id===p.id}):Cv({id:p.id,type:p.type},p,{parent:f.parent,isTopLevel:e.id===p.id}),{id:p.id,type:n==="ContentResource"?n:p.type}):p}}}function wv(t,e,n){if(!e)return t;if(Array.isArray(t)){if(!Array.isArray(e))throw new Error("Cannot merge array with non-array");const i=[...t];for(const a of e)if(a["@id"]&&!a.id&&(a.id=a["@id"]),a["@type"]&&!a.type&&(a.type=a["@type"]),a!=null)if(Array.isArray(a))i.push(a);else if(typeof a=="object"&&a.id&&a.type){const u=i.findIndex(f=>f.id===a.id&&f.type===a.type);u>=0&&(i[u]=wv(i[u],a))}else t.indexOf(a)===-1&&i.push(a);return i}else if(typeof t=="object"){if(Array.isArray(e)||typeof e!="object")throw new Error("Cannot merge object with non-object");const i={...t},a=[],u=[],f=Object.keys(t).filter(S=>S!==zn&&S!=="id"&&S!=="type"),p={},g={};for(const[S,m]of Object.entries(e)){if(S===zn||S==="id"||S==="type")continue;const x=i[S];x===m?u.push(S):x===ze||!x?(a.push(S),i[S]=m):(x&&m&&(p[S]=x,g[S]=m),i[S]=wv(x,m),i[S]===p[S]&&(u.push(S),delete p[S]))}if(n&&(n.parent&&n.parent.id||n.isTopLevel)){const S=[],m={};if(n.parent?m[Kr]=n.parent.id:n.isTopLevel&&(m[Kr]=t.id),i[zn]&&i[zn].length){const x=!(i[zn]||[]).find(_=>_["@explicit"]),R=a.length>0||u.length!==f.length;if(x&&R)for(const _ of i[zn]){const M={..._},k=Object.keys(p);if(M){M["@explicit"]=!0;for(const L of f)L!==zn&&(M[L]=vc);for(const L of k)M[L]=p[L]}S.push(M)}else S.push(...i[zn]);if(R){const _=Object.keys(g);m["@explicit"]=!0;for(const M of a)m[M]=vc;for(const M of u)m[M]=vc;for(const M of _)m[M]=g[M]}}m.id=i.id,m.type=i.type,S.push(m),i[zn]=S}return i}else if(t)return t;return e}function Cv(t,e,n){if(typeof t=="string")return t;if(e.id!==t.id||e.type!==t.type){if(e.type==="ImageService3")return e;if(t.type==="ImageService3")return t;throw new Error(`Can only merge entities with identical identifiers and type! ${e.type}(${e.id}) => ${t.type}(${t.id})`)}return wv({...t},e,n)}function zO(t){return(e,n)=>i=>{const{id:a,type:u}=dS(i,n||e);if(typeof a>"u")throw new Error("Found invalid entity without an ID.");return e==="ContentResource"||e==="Service"?t[a]=e:t[a]=u,i}}function UO(t){const e=Object.assign({},t);if(e["@id"]&&(e.id=e["@id"]),e["@type"]&&(e.type=e["@type"]),e.service){const n=[];e.service=Array.isArray(e.service)?e.service:[e.service];for(const i of e.service)n.push({id:i["@id"]||i.id,type:i["@type"]||i.type});e.service=n}return Object.assign({},XM,e)}function jO(t){return e=>{t.Service=t.Service?t.Service:{};const n=e.id||e["@id"],i=UO(e);return i&&i.id&&(t.Service[i.id]?t.Service[n]=Cv(t.Service[n],i):t.Service[n]=i),e}}function FO(t){const e=JSON.stringify(t);let n=5381,i=e.length;for(;i;)n=n*33^e.charCodeAt(--i);const u=(n>>>0).toString(16);return u.length%2?"0"+u:u}function Tv(t){return e=>typeof e=="string"?{id:e,type:t}:e.id?e.type?e:{type:t,...e}:{id:`vault://${FO(e)}`,type:t,...e}}function zl(t){return e=>({...t,...e})}function gc(t){return Array.isArray(t)?t:[t]}function BO(t){return t.body&&(t.body=gc(t.body)),t.seeAlso&&(t.seeAlso=gc(t.seeAlso)),t.audience&&(t.audience=gc(t.audience)),t.accessibility&&(t.accessibility=gc(t.accessibility)),t.motivation&&(t.motivation=gc(t.motivation)),t}function hS(t,{typeHint:e,partOfTypeHint:n}={}){if(typeof t=="string"&&(t={id:t,type:e||"unknown"}),da(t))return typeof t.source=="string"&&(t.source={id:t.source,type:e||"unknown"}),t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:n||"Manifest"}]),t;let i;if((t.id||"").indexOf("#")!==-1){const[a,u]=(t.id||"").split("#");t.id=a,u&&(i={type:"FragmentSelector",value:u})}return{type:"SpecificResource",source:t,selector:i}}function HO(t){const e=Object.assign({},t);return t&&t.items&&(e.items=t.items.map(n=>typeof n=="string"||n.type==="Canvas"?hS(n):n)),e}function VO(t){const e=Object.assign({},t);return e.start?(e.start=hS(e.start,{typeHint:"Canvas"}),e):t}function $O(t){const e=Object.assign({},t);return e.target?(e.target=xv(e.target,{typeHint:"Canvas"}),e):t}function WO(t){return t}function Rv(t){return typeof t.items>"u"&&(t[mc]=!0),t}function qO(t){const e=kO(t),n=IO(),i={},a=NO(n,e),u=zO(i),p=new mv({collection:[Rv,zl(qM),u("Collection"),a("Collection")],manifest:[Rv,zl(YM),VO,u("Manifest"),a("Manifest")],canvas:[zl(WM),u("Canvas"),a("Canvas")],annotationPage:[Rv,Tv("AnnotationPage"),zl($M),u("AnnotationPage"),a("AnnotationPage")],annotation:[Tv("Annotation"),BO,$O,u("Annotation"),a("Annotation")],contentResource:[Tv("ContentResource"),u("ContentResource"),a("ContentResource")],range:[zl(QM),HO,u("Range","Canvas"),a("Range","Canvas")],agent:[zl(GM),u("Agent"),a("Agent")],specificResource:[WO],service:[jO(n)]}).traverseUnknown(e);return{entities:n,resource:p,mapping:i}}function YO(t){const e={};for(const[n,i]of t){if(n===U1&&i!==Mr)return i;i!==Mr&&typeof i<"u"&&i!==null&&(e[n]=i)}return e}function QO(t,e,n){if(!e.type||!e.id)throw new Error("Unknown entity");if(!n[e.type])throw new Error(`Serializer not found for ${e.type}`);function i(a,u,f=0){const p=n[a.type];if(!p)return Mr;if(f>20)throw new Error("Circular reference: "+a.id+" "+a.type);const[g,S]=j1(t,a.type?a:a.id,u)||(a.id&&a.type?a:null);if(!g)return Mr;const m=p(g,t,{parent:u,isTopLevel:e.id===a.id,fullResource:S});let x=m.next();for(;!x.done;){const R=x.value;let _=Mr;if(R)if(Array.isArray(R)){const M=[];for(const k of R)M.push(i(k,a,f+1));_=M}else _=i(R,a,f+1);x=m.next(_)}return x.value===Mr?Mr:YO(x.value)}return i(e)}function yc(t,{allowSourceString:e=!0,allowString:n=!1,allowedStringType:i}={}){const a=u=>{if(e&&u&&u.source&&typeof u.source!="string"){const f=Object.keys(u.source);if(u.source.id&&u.source.type&&f.length===2)return{...u,source:u.source.id}}return u};if(t){if(t.source&&t.source.partOf)return a(t);const u=Object.keys(t);if(u.length===2&&t.type&&t.source||u.length===3&&t.type&&t.source&&u.indexOf("selector")!==-1&&!t.selector)return n&&(!i||i===t.source.type)?t.source.id:t.source.type==="ContentResource"?{type:"SpecificResource",source:t.source.id}:t.source;if(t.selector&&!Array.isArray(t.selector)&&typeof t.selector!="string"&&t.selector.type==="FragmentSelector"){const f=`${t.source.id}#${t.selector.value}`;return n?f:{id:f,type:t.source.type}}}return a(t)}function Ul(t){if(!t)return;const e=Object.keys(t);if(e.length!==0){if(e.length===1){const n=e[0];if(!n)return"";const i=(t[n]||[]).join("");return n==="@none"||n==="none"||n==="en"?i:{"@language":n,"@value":i}}return e.map(n=>({"@language":n,"@value":(t[n]||[]).join("")}))}}function pS(t){return Array.isArray(t)?t.map(e=>pS(e)):typeof t=="string"?t:t.type&&t.type==="Canvas"?t.id:t}function pa(t,e=!1){if(t)return t.length>1&&!e?t:t[0]||void 0}function GO(t){if(t){if(typeof t=="string")return{"@id":t};if("@id"in t){const e={...t};return delete e["@type"],e}return{"@context":"http://iiif.io/api/image/2/context.json","@id":t.id,profile:`http://iiif.io/api/image/2/profiles/${t.profile}.json`}}}function ao(t,e){return[["@id",t.id],["@type",e],["format",t.format],["height",t.height],["width",t.width],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["license",t.license?t.license:void 0]]}function*oo(t){const e=t.provider?yield t.provider[0]:void 0;return[["label",Ul(t.label)],["metadata",t.metadata&&t.metadata.length?t.metadata.map(n=>({label:Ul(n.label)||"",value:Ul(n.value)||""})):void 0],["description",Ul(t.summary)],["thumbnail",pa(yield t.thumbnail)],["navDate",t.navDate],["logo",e?pa(e.logo):void 0],["homepage",e?e.homepage:void 0],["attribution",t.requiredStatement?Ul(t.requiredStatement.value):void 0]]}function*Sc(t){const e=t.start&&t.start.type&&t.start.type==="SpecificResource"?yc(t.start):t.start;return[["seeAlso",pa(yield t.seeAlso)],["service",pa((t.service||[]).map(GO))],["rendering",pa(yield t.rendering)],["startCanvas",e?e.id:void 0]]}function XO(t){return t.type==="SpecificResource"}function KO(t){return t&&t.type==="FragmentSelector"}function ZO(t){if(t&&XO(t)){let e=t.id;const n=t.selector?Array.isArray(t.selector)?t.selector[0]:t.selector:void 0;return KO(n)&&(e+="#"+n.value),e}return t==null?void 0:t.id}const JO={Manifest:function*(t,e,{isTopLevel:n}){return[...n?[["@context","http://iiif.io/api/presentation/2/context.json"]]:[],...ao(t,"sc:Manifest"),...yield*oo(t),...yield*Sc(t),["sequences",[{"@id":`${t.id}/sequence0`,"@type":"sc:Sequence",canvases:yield t.items}]],["structures",yield t.structures]]},Canvas:function*(t){const n=(yield t.items)[0];return[...ao(t,"sc:Canvas"),...yield*oo(t),...yield*Sc(t),["images",n?[n.resources]:void 0],["annotations",t.annotations&&t.annotations.length?pa(yield t.annotations):void 0]]},AnnotationPage:function*(t){return[...ao(t,"sc:AnnotationList"),...yield*oo(t),["resources",t.items&&t.items.length?pa(yield t.items):void 0]]},Annotation:function*(t){return[["@id",t.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",pS(t.target)],["resource",pa(yield t.body,!0)]]},ContentResource:function*(t){switch(t.type){case"Image":return[...ao(t,"dctypes:Image"),...yield*oo(t),...yield*Sc(t)];case"Text":case"Dataset":default:return[...ao(t,void 0),...yield*oo(t)]}},AnnotationCollection:function*(t){return[["@id",t.id],["@type","sc:Layer"],["label",Ul(t.label)]]},Collection:function*(t){return[...ao(t,"sc:Collection"),...yield*oo(t),...yield*Sc(t),["members",yield*t.items]]},Range:function*(t){const e=[],n=[];if(t.items)for(const i of t.items){const a=i.type==="SpecificResource"?i.source:i;if(a){const u=yield a;e.push({"@id":ZO(i),"@type":a.type,label:u?u.label:void 0,within:t.id}),a.type==="Canvas"&&n.push(a.id)}}return[...ao(t,"sc:Range"),...yield*oo(t),...yield*Sc(t),["canvases",n.length===e.length?n:void 0],["members",n.length!==e.length?e:void 0]]}};function lo(t){var e;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],["type",t.type],["format",t.format],["profile",t.profile],["height",t.height||void 0],["width",t.width||void 0],["duration",t.duration||void 0],["viewingDirection",t.viewingDirection!=="left-to-right"?t.viewingDirection:void 0],["behavior",t.behavior&&t.behavior.length?t.behavior:void 0],["timeMode",t.timeMode],["motivation",Array.isArray(t.motivation)?t.motivation[0]:t.motivation],[zn,Mr]]}function _n(t){if(t===Mr||!t||t.length===0)return;const e=t.filter(n=>n!==Mr);if(e.length!==0)return e}function vS(t){if(t&&t.type&&t.type==="ImageService2"){const{id:e,type:n,profile:i,...a}=t,u=typeof i=="string"?i:Array.isArray(i)?i.find(f=>typeof f=="string"):"";return{"@id":e,"@type":n,profile:u?u.startsWith("http")?u:`http://iiif.io/api/image/2/${u}.json`:"http://iiif.io/api/image/2/level0.json",...a}}return t}function mS(t){if(Array.isArray(t)||(t=t?[t]:[]),!(!t||t.length===0))return t.map(vS)}function*va(t){return[["label",t.label],["metadata",_n(t.metadata)],["summary",t.summary],["requiredStatement",t.requiredStatement],["rights",Array.isArray(t.rights)?t.rights[0]||void 0:t.rights||void 0],["navDate",t.navDate],["language",t.language],["thumbnail",_n(yield t.thumbnail)],["placeholderCanvas",yield t.placeholderCanvas],["accompanyingCanvas",yield t.accompanyingCanvas],["provider",_n(yield t.provider)]]}function*ma(t){return[["seeAlso",_n(yield t.seeAlso)],["service",_n(mS(t.service))],["services",_n(mS(t.services))],["rendering",_n(yield t.rendering)],["supplementary",_n(yield t.supplementary)],["homepage",_n(yield t.homepage)],["logo",_n(yield t.logo)],["partOf",_n(yield t.partOf)],["start",t.start?yc(t.start):t.start]]}const e_={Manifest:function*(t,e,{isTopLevel:n}){return n?[["@context",t["@context"]?t["@context"]:"http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["structures",_n(yield t.structures)],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Canvas:function*(t){return[...lo(t),...yield*va(t),...yield*ma(t),["items",yield t.items],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]},Agent:function*(t){return[["id",t.id],["type","Agent"],["label",t.label],...yield*ma(t)]},AnnotationPage:function*(t){var e;const n=Object.entries(t).map(([a,u])=>[a,Array.isArray(u)?_n(u):u]).filter(([a,u])=>a!=="items"&&a!=="id"&&a!==zn&&a!==Kr&&a!==mc),i=yield t.items;return[["id",(e=t.id)!=null&&e.startsWith("vault://")?void 0:t.id],...n,...yield*ma(t),["items",i.length||t[mc]===!1?i:Mr]]},Service:function*(t){return[[U1,vS(t)]]},Annotation:function*(t){const e=Object.entries(t).map(([i,a])=>i==="motivation"?[i,Array.isArray(a)?a[0]:a]:i==="target"?[i,yc(a,{allowString:!0,allowSourceString:!0,allowedStringType:"Canvas"})]:[i,Array.isArray(a)?_n(a):a]).filter(([i])=>i!=="body"&&i!==zn&&i!==mc);let n;if(Array.isArray(t.body)){const i=[];for(const a of t.body)if(a&&da(a)){const u={...a};u.source=yield a.source,i.push(yc(u,{allowSourceString:!0}))}else i.push(yield a);n=i}else t.body&&da(t.body)?(n={...t.body},n.source=yield t.body.source):n=yield t.body;return[...e,...yield*va(t),...yield*ma(t),["body",n.length===1?n[0]:n]]},ContentResource:function*(t){return t_([...lo(t),...yield*va(t),...yield*ma(t),["annotations",_n(yield t.annotations)],["items",_n(yield t.items)]],t)},AnnotationCollection:function*(t){return[["id",t.id],["type","AnnotationCollection"],["label",t.label]]},Collection:function*(t,e,{isTopLevel:n}){return n?[["@context","http://iiif.io/api/presentation/3/context.json"],...lo(t),...yield*va(t),...yield*ma(t),["items",_n(yield t.items)],["navPlace",t.navPlace]]:[...lo(t),...yield*va(t)]},Range:function*(t){const e=[];for(const n of t.items)n.type==="Range"?e.push(yield n):n&&n.type==="SpecificResource"?e.push(yc(n)):e.push(n);return[...lo(t),...yield*va(t),...yield*ma(t),["items",e],["annotations",_n(yield t.annotations)],["navPlace",t.navPlace]]}};function t_(t,e){const n=Object.keys(e),i=t.map(([a])=>a);for(const a of n)a===zn||a===mc||i.indexOf(a)===-1&&typeof e[a]<"u"&&t.push([a,e[a]]);return t}var n_=Object.defineProperty,i_=(t,e,n)=>e in t?n_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ga=(t,e,n)=>(i_(t,typeof e!="symbol"?e+"":e,n),n);const Ln=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},gS="@iiif/IMPORT_ENTITIES",yS="@iiif/MODIFY_ENTITY_FIELD",SS="@iiif/REORDER_ENTITY_FIELD",bS="@iiif/ADD_REFERENCE",Av="@iiif/UPDATE_REFERENCE",ES="@iiif/REMOVE_REFERENCE",xS="@iiif/ADD_METADATA",wS="@iiif/REMOVE_METADATA",Mv="@iiif/UPDATE_METADATA",CS="@iiif/REORDER_METADATA",TS=Ln(gS)(),r_=Ln(yS)(),s_=Ln(SS)(),a_=Ln(bS)(),o_=Ln(ES)(),l_=Ln(Av)(),u_=Ln(xS)(),c_=Ln(Mv)(),f_=Ln(wS)(),d_=Ln(CS)(),h_={importEntities:TS,modifyEntityField:r_,reorderEntityField:s_,addReference:a_,removeReference:o_,updateReference:l_,addMetadata:u_,removeMetadata:f_,updateMetadata:c_,reorderMetadata:d_},RS="@iiif/ADD_MAPPING",AS="@iiif/ADD_MAPPINGS",p_=Ln(RS)(),v_=Ln(AS)(),MS="@iiif/SET_META_VALUE",OS="@iiif/SET_META_VALUE_DYNAMIC",_S="@iiif/UNSET_META_VALUE",m_=Ln(MS)(),g_=Ln(OS)(),y_=Ln(_S)(),LS={setMetaValue:m_,setMetaValueDynamic:g_,unsetMetaValue:y_},Ov="RESOURCE_ERROR",PS="RESOURCE_LOADING",_v="RESOURCE_READY",DS="@iiif/REQUEST_RESOURCE",kS="@iiif/REQUEST_ERROR",IS="@iiif/REQUEST_MISMATCH",NS="@iiif/REQUEST_COMPLETE",S_="@iiif/REQUEST_OFFLINE_RESOURCE",b_=Ln(DS)(),Lv=Ln(kS)(),E_=Ln(IS)(),x_=Ln(NS)(),Pv="@iiif/BATCH",w_="@iiif/BATCH_IMPORT",Dv=Ln(Pv)(),C_=(t,e)=>{const{entities:n,resource:i,mapping:a}=qO(e);if(i.id===void 0)return[Lv({id:t,message:"ID is not defined in resource."})];const u=[TS({entities:n}),v_({mapping:a})];return i.id!==t&&(u.push(p_({id:t,type:i.type})),u.push(E_({requestId:t,actualId:i.id}))),u.push(x_({id:t})),u},zS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function T_(t,e){return!!(t===e||zS(t)&&zS(e))}function US(t,e){if(!Array.isArray(t)||!Array.isArray(e))return t===e;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!T_(t[n],e[n]))return!1;return!0}function kv(t,e,n){const i=t.iiif.requests[e],a=t.iiif.mapping[e];if(!a||!t.iiif.entities[a][i.resourceUri])return;const u=t.iiif.entities[a][i.resourceUri];if(u&&u[zn]){const f=u[zn].find(p=>n?p[Kr]===n.id:p[Kr]===u.id);return vv(u,f)}return u}function R_(t){return t&&typeof t.then=="function"}function jS(t,e,{waitTimeout:n=30}={}){return(i,a)=>{const u=t.getStore(),f=u.getState(),p=f.iiif.requests[i];if(p){if(p.loadingState===_v){const S=kv(f,i);if(S)return S}switch(p.loadingState){case Ov:break;case PS:return(async()=>{let S,m=!1;try{const x=await Promise.race([new Promise((R,_)=>{m||(S=u.subscribe(()=>{const M=u.getState();if(M.iiif.requests[i].loadingState===Ov){_();return}if(M.iiif.requests[i].loadingState===_v){const k=kv(M,i);k?R(k):_()}}))}),new Promise((R,_)=>setTimeout(()=>{m=!0,_()},n*60*1e3))]);if(S&&S(),x)return x}catch{S&&S()}})()}}t.dispatch(b_({id:i}));const g=S=>{if(!S)return;!S.id&&!S["@id"]&&(S["@type"]&&(S["@id"]=i),S.id=i);const m=C_(i,S);return t.dispatch(Dv({actions:m})),kv(u.getState(),i)};try{const S=e(i,a);return R_(S)?(async()=>{try{return g(await S)}catch(m){throw t.dispatch(Lv({id:i,message:m.toString()})),m}})():g(S)}catch(S){throw t.dispatch(Lv({id:i,message:S.toString()})),S}}}function FS(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const BS=t=>{let e;const n=new Set,i=(f,p)=>{const g=typeof f=="function"?f(e):f;if(!Object.is(g,e)){const S=e;e=p??typeof g!="object"?g:Object.assign({},e,g),n.forEach(m=>m(e,S))}},a=()=>e,u={setState:i,getState:a,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{n.clear()}};return e=t(i,a,u),u},A_=t=>t?BS(t):BS,M_=(t,e)=>(n,i,a)=>(a.dispatch=u=>(n(f=>t(f,u),!1,u),u),a.dispatchFromDevtools=!0,{dispatch:(...u)=>a.dispatch(...u),...e}),O_=M_,Iv=new Map,Nd=t=>{const e=Iv.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,i])=>[n,i.getState()])):{}},__=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const i=Iv.get(n.name);if(i)return{type:"tracked",store:t,...i};const a={connection:e.connect(n),stores:{}};return Iv.set(n.name,a),{type:"tracked",store:t,...a}},L_=(t,e={})=>(n,i,a)=>{const{enabled:u,anonymousActionType:f,store:p,...g}=e;let S;try{S=(u??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!S)return t(n,i,a);const{connection:m,...x}=__(p,S,g);let R=!0;a.setState=(k,L,P)=>{const O=n(k,L);if(!R)return O;const j=P===void 0?{type:f||"anonymous"}:typeof P=="string"?{type:P}:P;return p===void 0?(m==null||m.send(j,i()),O):(m==null||m.send({...j,type:`${p}/${j.type}`},{...Nd(g.name),[p]:a.getState()}),O)};const _=(...k)=>{const L=R;R=!1,n(...k),R=L},M=t(a.setState,i,a);if(x.type==="untracked"?m==null||m.init(M):(x.stores[x.store]=a,m==null||m.init(Object.fromEntries(Object.entries(x.stores).map(([k,L])=>[k,k===x.store?M:L.getState()])))),a.dispatchFromDevtools&&typeof a.dispatch=="function"){const k=a.dispatch;a.dispatch=(...L)=>{k(...L)}}return m.subscribe(k=>{var L;switch(k.type){case"ACTION":if(typeof k.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Nv(k.payload,P=>{if(P.type==="__setState"){if(p===void 0){_(P.state);return}Object.keys(P.state).length!==1&&console.error(`
285
285
  [zustand devtools middleware] Unsupported __setState action format.
286
286
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
287
287
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
288
- `);const O=P.state[p];if(O==null)return;JSON.stringify(a.getState())!==JSON.stringify(O)&&_(O);return}a.dispatchFromDevtools&&typeof a.dispatch=="function"&&a.dispatch(P)});case"DISPATCH":switch(k.payload.type){case"RESET":return _(M),p===void 0?m==null?void 0:m.init(a.getState()):m==null?void 0:m.init(Nd(g.name));case"COMMIT":if(p===void 0){m==null||m.init(a.getState());return}return m==null?void 0:m.init(Nd(g.name));case"ROLLBACK":return Nv(k.state,P=>{if(p===void 0){_(P),m==null||m.init(a.getState());return}_(P[p]),m==null||m.init(Nd(g.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Nv(k.state,P=>{if(p===void 0){_(P);return}JSON.stringify(a.getState())!==JSON.stringify(P[p])&&_(P[p])});case"IMPORT_STATE":{const{nextLiftedState:P}=k.payload,O=(L=P.computedStates.slice(-1)[0])==null?void 0:L.state;if(!O)return;_(p===void 0?O:O[p]),m==null||m.send(null,P);return}case"PAUSE_RECORDING":return T=!T}return}}),M},M_=A_,Nv=(t,e)=>{let n;try{n=JSON.parse(t)}catch(i){console.error("[zustand devtools middleware] Could not parse the received json",i)}n!==void 0&&e(n)},O_=t=>(e,n,i)=>{const a=i.subscribe;return i.subscribe=(u,f,p)=>{let g=u;if(f){const S=(p==null?void 0:p.equalityFn)||Object.is;let m=u(i.getState());g=x=>{const T=u(x);if(!S(m,T)){const _=m;f(m=T,_)}},p!=null&&p.fireImmediately&&f(m,m)}return a(g)},t(e,n,i)},__=O_,L_=(t={},e)=>{switch(e.type){case RS:return{...t,[e.payload.id]:e.payload.type};case AS:return{...t,...e.payload.mapping};default:return t}};function zv(t,e,n,i){return!(!t[n]||!t[n][e]||!t[n][e][i]||!Array.isArray(t[n][e][i]))}function P_(t,e){const n={},i=[];for(const[a,u]of Object.entries(t||{})){i.push(a);const f=(e||{})[a];if(!f||f.length===0){n[a]=u;continue}n[a]=f}for(const[a,u]of Object.entries(e||{}))i.indexOf(a)===-1&&(n[a]=u);return n}function Ge(t){return t.payload}function Uv(t,e){return typeof t>"u"?e:t}const D_=(t=FS(),e)=>{var n;const i=(a,u)=>({...t,[Ge(e).type]:{...t[Ge(e).type],[Ge(e).id]:{...a,...u}}});switch(e.type){case yS:{if(!t[Ge(e).type]||!t[Ge(e).type][Ge(e).id])return t;const a=t[Ge(e).type][Ge(e).id];return typeof a=="string"?t:i(a,{[Ge(e).key]:Ge(e).value})}case SS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string")return t;const u=Array.from(a[Ge(e).key]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{[Ge(e).key]:u})}case gS:{const a=Object.keys(Ge(e).entities),u={...t};for(const f of a){const p=Ge(e).entities[f],g={...t[f]||{}};let S=!1;const m=Object.keys(p||{})||[];if(p&&m){for(const x of m)S=!0,g[x]=t[f][x]?P_(t[f][x],p[x]):p[x];S&&(u[f]=g)}}return u}case bS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]);return u.splice(Uv(Ge(e).index,u.length+1),0,Ge(e).reference),i(a,{[Ge(e).key]:u})}case Av:case ES:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]),f=Uv(Ge(e).index,u.findIndex(p=>p&&p.id===Ge(e).reference.id));return f===-1||((n=u[f])==null?void 0:n.id)!==Ge(e).reference.id?t:(e.type===Av?u.splice(f,1,Ge(e).reference):u.splice(f,1),i(a,{[Ge(e).key]:u}))}case xS:{const a=t[Ge(e).type][Ge(e).id];if(!a)return t;const u=Array.from(a.metadata||[]),f=Ge(e);return u.splice(Uv(e.payload.beforeIndex,u.length+1),0,{label:f.label,value:f.label}),i(a,{metadata:u})}case CS:{const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string"||!a)return t;const u=Array.from(a.metadata||[]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{metadata:u})}case Mv:case wS:{const a=t[Ge(e).type][Ge(e).id],u=Array.from(a.metadata||[]),f=Ge(e).atIndex;return typeof f>"u"||f===-1||!u[f]?t:(e.type===Mv?u.splice(f,1,{label:Ge(e).label,value:Ge(e).value}):u.splice(f,1),i(a,{metadata:u}))}default:return t}},k_=(t={},e)=>{switch(e.type){case DS:case v_:return{...t,[e.payload.id]:{requestUri:e.payload.id,loadingState:PS,uriMismatch:!1,resourceUri:e.payload.id}};case IS:return{...t,[e.payload.requestId]:{...t[e.payload.requestId]||{},uriMismatch:!0,resourceUri:e.payload.actualId},[e.payload.actualId]:{requestUri:e.payload.requestId,loadingState:t[e.payload.requestId].loadingState,uriMismatch:!0,resourceUri:e.payload.actualId}};case kS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:Ov,error:e.payload.message}};case NS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:_v,error:void 0}}}return t},I_=(t={},e)=>{const{id:n,updateValue:i,value:a,meta:u,key:f}=e&&e.payload||{};switch(e.type){case MS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:a}}};case OS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:t[n]&&t[n][u]?i(t[n][u][f]):i(void 0)}}};case _S:return t[n]&&t[n][u]&&t[n][u][f]?{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:void 0}}}:t;default:return t}};function HS(t={}){const e=Object.keys(t);return function(n={},i){let a=!1;const u={};for(let f=0;f<e.length;f++){const p=e[f];u[p]=t[p](n[p],i),a=a||u[p]!==n[p]}return a?u:n}}function N_(t){return(e,n)=>n&&n.type===Pv?n.payload.actions.reduce(t,e):n&&n.type===S_?{...e,iiif:{...e.iiif,...n.payload.state}}:t(e,n)}const z_=HS({mapping:L_,entities:D_,requests:k_,meta:I_});function U_(){return{iiif:{entities:FS(),meta:{},mapping:{},requests:{}}}}function j_(t={}){const{enableDevtools:e=!1,iiifStoreName:n="iiif",defaultState:i=U_(),customReducers:a={}}=t,u=N_(HS({[n]:z_,...a}));return w_(__(M_(T_(u,i),{enabled:e})))}function F_(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(a){a(n)}),(i=t.get("*"))&&i.slice().map(function(a){a(e,n)})}}}function Ci(t,e,n,i=!0){e[jl]=e[jl]||[],e[jl].push(t);const a=new Map;Object.defineProperty(e,t,{enumerable:i,get(){if(typeof e[uo][t]>"u")return;const u=e[uo][t];if(!u)return u;const f=n.get(e[uo][t],{parent:this.id?{id:this.id,type:this.type}:void 0});return a.has(f)||(a.clear(),a.set(f,fo(f,n))),a.get(f)},set(u){e[uo][t]!==u&&(this[co]?n.modifyEntityField({id:this.id,type:this.type},t,$S(u)):this[uo][t]=u)}})}const uo=Symbol.for("_refs_"),co=Symbol.for("_reactive_"),jl=Symbol.for("_defined_"),VS=Symbol.for("_parent_");function B_(t,e=!1,n){const i={id:"",type:"unknown",[jl]:[],[uo]:{},[VS]:n||null,[co]:null,is(a){return typeof a=="string"?this.id===a:a.id?a.id===this.id:!1},reactive(){if(!this[co])return this[co]=this.subscribe(()=>this.refresh(),!0),()=>{this.unreactive()}},refresh(){if(this.id){const a=this.unwrap();for(const u of Object.keys(a||{}))this[jl].includes(u)?this[uo][u]=a[u]:this[u]=a[u]}},unreactive(){this[co]&&(this[co](),this[co]=null)},unwrap(){if(!this.id)throw new Error("Invalid object");const a=this[VS];return t.get(this.id,{parent:a?{id:a,type:"unknown"}:void 0})},toPresentation3(){return t.toPresentation3(this.unwrap())},toPresentation2(){return t.toPresentation2(this.unwrap())},valueOf(){return this.unwrap()},toJSON(){const a=this;return{...a,items:a.items,annotations:a.annotations,structures:a.structures,seeAlso:a.seeAlso,service:a.service,services:a.services,rendering:a.rendering,partOf:a.partOf,start:a.start,supplementary:a.supplementary,homepage:a.homepage,thumbnail:a.thumbnail,placeholderCanvas:a.placeholderCanvas,accompanyingCanvas:a.accompanyingCanvas,provider:a.provider}},subscribe(a,u=!0){return t.subscribe(()=>this.id?t.get(this.id):null,a,u)}};return Ci("items",i,t),Ci("annotations",i,t),Ci("structures",i,t),Ci("seeAlso",i,t),Ci("rendering",i,t),Ci("partOf",i,t),Ci("start",i,t,!1),Ci("supplementary",i,t),Ci("homepage",i,t),Ci("thumbnail",i,t),Ci("placeholderCanvas",i,t,!1),Ci("accompanyingCanvas",i,t,!1),Ci("provider",i,t),Ci("body",i,t),Ci("logo",i,t),i}function H_(t){return!!t[jl]}function $S(t){return Array.isArray(t)?t.map(e=>$S(e)):!t||!t.type?t:{id:t.id,type:t.type}}function fo(t,e,n=!1,i){if(Array.isArray(t))return t.map(p=>fo(p,e,n));if(!t||!t.type||!t.id)return t;const a=B_(e,n),u=Object.create(a),f=Object.assign(u,t);return n&&f.reactive(),f}function WS(t){switch(t){case"Image":case"Video":case"Sound":case"Dataset":case"Text":case"Composite":case"List":case"Independents":case"Audience":return"ContentResource";case"ImageService1":case"ImageService2":case"ImageService3":return"Service"}return t}let jv=class{constructor(e,n){ga(this,"options"),ga(this,"store"),ga(this,"emitter"),ga(this,"isBatching",!1),ga(this,"batchQueue",[]),ga(this,"remoteFetcher"),ga(this,"staticFetcher"),ga(this,"defaultFetcher",i=>fetch(i).then(a=>a.json())),this.options=Object.assign({reducers:{},customFetcher:this.defaultFetcher,enableDevtools:!0},e||{}),this.store=n||j_({customReducers:this.options.reducers,defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=F_(),this.remoteFetcher=jS(this,this.options.customFetcher),this.staticFetcher=jS(this,(i,a)=>a)}batch(e){this.isBatching=!0;try{e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}async asyncBatch(e){this.isBatching=!0;try{await e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}modifyEntityField(e,n,i){this.dispatch(u_.modifyEntityField({id:e.id,type:e.type,key:n,value:i}))}dispatch(e){if(this.isBatching)this.batchQueue.push(e);else{if(e.type===Pv){for(const a of e.payload.actions)this.emitter.emit(a.type,{action:a,state:this.store.getState()});this.store.dispatch(e);const i=this.getState();for(const a of e.payload.actions)this.emitter.emit(`after:${a.type}`,{action:a,state:i});return}this.emitter.emit(e.type,{action:e,state:this.store.getState()}),this.store.dispatch(e);const n=this.store.getState();this.emitter.emit(`after:${e.type}`,{action:e,state:n});return}}on(e,n){return this.emitter.on(e,n),()=>{this.emitter.off(e,n)}}serialize(e,n){return $O(this.getState().iiif,e,n)}toPresentation2(e){return this.serialize(e,GO)}toPresentation3(e){return this.serialize(e,XO)}hydrate(e,n,i={}){return this.get(e,n,{...i,skipSelfReturn:!1})}get(e,n,i={}){typeof n!="string"&&(i=n||{},n=void 0);const{skipSelfReturn:a=!0}=i||{};let u=i.parent?typeof i.parent=="string"?i.parent:i.parent.id:void 0;if(Array.isArray(e))return e.map(x=>this.get(x,i));const f=this.getState();if(da(e)&&!i.preserveSpecificResources&&(e=e.source),typeof e=="string"){const x=WS(n||f.iiif.mapping[e]);if(!x)return a?null:{id:e,type:"unknown"};e={id:e,type:x}}if(e&&e.partOf&&!u&&!i.skipPartOfCheck){const x=Array.isArray(e.partOf)?e.partOf[0]:e.partOf;x&&(typeof x=="string"&&(u=x),typeof x.id=="string"&&(u=x.id))}const p=WS(n||(e==null?void 0:e.type)),g=e==null?void 0:e.id,S=f.iiif.entities[p];if(!S){const x=f.iiif.requests[g];return x&&x.resourceUri!==g?this.get(x.resourceUri,i):a?null:e}const m=S[e.id];if(m&&m[zn]){const x=m[zn].find(T=>u?T[Kr]===u:T[Kr]===m.id);return vv(m,x)}return S[e.id]||(a?null:e)}select(e){return e(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}deep(e,n){if(typeof e>"u")return this.get(n,{skipSelfReturn:!1});if(typeof e=="function")try{const a=e(this.get(n,{skipSelfReturn:!1})),u=f=>this.deep(f,a);return u.size=Array.isArray(a)?a.length:1,u}catch{const a=u=>this.deep(u,void 0);return a.size=0,a}const i=a=>this.deep(a,e);return i.size=Array.isArray(e)?e.length:1,i}loadManifest(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}loadCollection(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}load(e,n){const i=typeof e=="string"?e:e.id;return n?Promise.resolve(this.staticFetcher(i,n)):Promise.resolve(this.remoteFetcher(i))}loadSync(e,n){const i=typeof e=="string"?e:e.id;return this.staticFetcher(i,n)}loadManifestSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}loadCollectionSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}areInputsEqual(e,n){return US(e,n)}subscribe(e,n,i){return typeof i>"u"&&(typeof n>"u"||n===!1||n===!0)&&(i=n,n=e,e=a=>a),this.store.subscribe(e,a=>n(a,this),{equalityFn:US,fireImmediately:!i})}async ensureLoaded(e){const n=typeof e=="string"?e:e.id;this.requestStatus(n)||await this.load(n)}requestStatus(e){return this.select(n=>n.iiif.requests[e])}getResourceMeta(e,n){const i=this.getState().iiif.meta[e];if(i)return n?i[n]:i}getObject(e,n,i={}){const{reactive:a,...u}=i;return fo(this.get(e,n,u),this,a)}async loadObject(e,n){return fo(await this.load(e,n),this)}async loadManifestObject(e,n){return fo(await this.loadManifest(e,n),this)}async loadCollectionObject(e,n){return fo(await this.loadCollection(e,n),this)}wrapObject(e){return fo(this.get(e,{skipSelfReturn:!1}),this)}isWrapped(e){return H_(e)}setMetaValue([e,n,i],a){this.dispatch(typeof a=="function"?LS.setMetaValueDynamic({id:e,meta:n,key:i,updateValue:a}):LS.setMetaValue({id:e,meta:n,key:i,value:a}))}};function V_(){return typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}function qS(t){const e=V_();try{const i=e.IIIF_VAULT;if(i)return i}catch{}const n=new jv(t);try{e.IIIF_VAULT=n}catch{}return n}const bc=R.createContext({vault:null,setVaultInstance:t=>{}});function Fv({vault:t,vaultOptions:e,useGlobal:n,resources:i,children:a}){const[u,f]=R.useState(()=>t||(n?qS(e):e?new jv(e):new jv));return oe.jsx(bc.Provider,{value:{vault:u,setVaultInstance:f},children:oe.jsx(ca,{value:i||{},children:a})})}const Un=()=>{const{vault:t}=R.useContext(bc);if(t===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return t};function Bv(t,{noCache:e=!1}={}){const n=typeof t=="string"?t:t.id,i=Un(),[a,u]=R.useState(n),[f,p]=R.useState(void 0),g=R.useMemo(()=>i.get(n,{skipSelfReturn:!0})||void 0,[n,i]),[S,m]=R.useState(g);return R.useEffect(()=>{(async()=>{try{const x=g&&!e?g:await i.load(n),T=x?x.id||x["@id"]:null;x&&a!==T&&u(T),m(x)}catch(x){p(x)}})()},[n,e]),{isLoaded:!!S,id:a,requestId:n,error:f,resource:S,cached:!!(S&&S===g)}}function YS(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function QS({manifest:t,children:e}){return oe.jsx(ca,{value:{manifest:t},children:e})}function zd({canvas:t,children:e}){return oe.jsx(ca,{value:{canvas:t},children:e})}function ni(t,e=[]){const n=Un(),[i,a]=R.useState(()=>t(n.getState(),n));return R.useEffect(()=>n.subscribe(u=>t(u,n),u=>{a(u)},!1),e),i}const Ec=R.createContext([]);function Hv(){const t=R.useContext(Ec);return ni(e=>t.map(n=>e.iiif.entities.Canvas[n]).filter(Boolean),[t])}function ya(t={},e=[]){const{id:n,selector:i}=t,a=As();Un();const u=n||a.manifest,f=ni(p=>u?p.iiif.entities.Manifest[u]:void 0,[u]);return R.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function GS({range:t,children:e}){return oe.jsx(ca,{value:{range:t},children:e})}function XS(t,e){for(const n of e.items){if(n.type==="Canvas")return n;if(n.type==="SpecificResource")return n.source;if(n.type==="Range"){const i=XS(t,t.get(n));if(i)return i}}return null}function Vv(t,e){var i;const n=[];for(const a of e.items)if(a.type==="SpecificResource"&&((i=a.source)==null?void 0:i.type)==="Canvas"&&(a.source.id.indexOf("#")!==-1?n.push({id:a.source.id.split("#")[0],type:"Canvas"}):n.push(a.source)),a.type==="Range"&&n.push(...Vv(t,t.get(a))),a.type==="SpecificResource"){const u=typeof a.source=="string"?a.source:a.source.id;n.push({id:u,type:"Canvas"})}return n}function $_(t,e,n){for(const i of e.structures){const a=$v(t,t.get(i),n);if(a)return a}return null}function $v(t,e,n){var i,a,u;for(const f of e.items){const p=(a=(i=f==null?void 0:f.source)==null?void 0:i.id)==null?void 0:a.split("#")[0];if(f.type==="SpecificResource"&&f.source===n||f.type==="SpecificResource"&&((u=f.source)==null?void 0:u.type)==="Canvas"&&n===p)return e;if(f.type==="Range"){const g=$v(t,t.get(f),n);if(g)return g}}return null}function W_(t,e,n,i=!1){const a=e.behavior,u=n?t.get(n):null;if(!u)return[];const f=u.behavior,p=i?!1:a.includes("paged"),g=p?!1:a.includes("continuous"),S=p||g?!1:a.includes("individuals"),m=f.includes("facing-pages"),x=f.includes("non-paged");if(m||x||S||i)return[{id:u.id,type:"Canvas"}];const[T,_]=Wv(t,e);if(g)return T;const M=T.findIndex(k=>k.id===n);if(M===-1)return[];for(const k of _)if(k.includes(M))return k.map(L=>T[L]);return[{id:u.id,type:"Canvas"}]}function Wv(t,e,{disablePaging:n,skipNonPaged:i}={}){const a=e.behavior,u=a.includes("paged"),f=u?!1:a.includes("continuous"),p=u||f?!1:a.includes("individuals"),g=e.type==="Manifest"?e.items:Vv(t,e);if(f)return[g,[g.map((M,k)=>k)]];if(p||!u||n)return[g,g.map((M,k)=>[k])];const S=[];let m=[];const x=()=>{m.length&&(S.push([...m]),m=[])};let T=0,_=!1;for(let M=0;M<g.length;M++){const k=t.get(g[M]);if(k.behavior.includes("non-paged")){M===T&&T++,i||(x(),S.push([M]),x());continue}if(M===T||k.behavior.includes("facing-pages")){m.length&&(_=!0),x(),S.push([M]),x();continue}if(m.push(M),_){x(),_=!1;continue}m.length>1&&x()}return m.length&&x(),[g,S]}function KS(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.range,f=ni(p=>u?p.iiif.entities.Range[u]:void 0,[u]);return R.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function ZS({startCanvas:t,disablePaging:e}){var M;const n=Un(),i=ya(),a=KS(),[u,f]=R.useState(void 0),p=a||i;if(!p)throw new Error("Nothing selected");const[g,S]=R.useMemo(()=>Wv(n,p,{disablePaging:e}),[n,p]),m=R.useCallback(k=>{const L=S.findIndex(P=>P.includes(k));f(L===-1?0:L)},[g,S]),x=R.useCallback(k=>{const L=g.findIndex(P=>P.id===k);L!==-1?m(L):f(0)},[g,S]),T=R.useCallback(()=>{f(k=>k>=S.length?k:k+1)},[S]),_=R.useCallback(()=>{f(k=>k<=0?0:k-1)},[S]);return typeof u>"u"&&(t?x(t):f(0)),{visibleItems:((M=S[u])==null?void 0:M.map(k=>g[k].id))||[],cursor:u,items:g,sequence:S,setSequenceIndex:f,setCanvasIndex:m,setCanvasId:x,next:T,previous:_}}const xc=()=>{},wc=R.createContext({setCurrentCanvasId:xc,setCurrentCanvasIndex:xc,nextCanvas:xc,previousCanvas:xc,items:[],sequence:[],setSequenceIndex:xc,currentSequenceIndex:0});function JS(t){const e=ya(),{cursor:n,visibleItems:i,next:a,sequence:u,items:f,setCanvasIndex:p,setCanvasId:g,previous:S,setSequenceIndex:m}=ZS({startCanvas:t.startCanvas,disablePaging:t.pagingEnabled===!1}),x=R.useMemo(()=>({sequence:u,items:f,setCurrentCanvasId:g,nextCanvas:a,previousCanvas:S,totalCanvases:f.length,setCurrentCanvasIndex:p,setSequenceIndex:m,currentSequenceIndex:n}),[u,f,g,a,S,f,p,m,n]);return e?oe.jsx(wc.Provider,{value:x,children:oe.jsx(Ec.Provider,{value:i,children:oe.jsx(zd,{canvas:i[0],children:t.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."}))}function eb(t){const e=YS(t.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."});if(e.error)return oe.jsx("div",{children:e.error.toString()});if(!e.isLoaded)return oe.jsx("div",{children:"Loading..."});const n=oe.jsx(JS,{...t,children:t.children});return oe.jsx(QS,{manifest:e.id,children:t.rangeId?oe.jsx(GS,{range:t.rangeId,children:n}):n})}function tb(){return R.useContext(wc)}function nb(){return{VaultContext:R.useContext(bc),ResourceContext:R.useContext(kd),SimpleViewerReactContext:R.useContext(wc),VisibleCanvasReactContext:R.useContext(Ec)}}function ib(t){return oe.jsx(Fv,{vault:t.bridge.VaultContext.vault||void 0,resources:t.bridge.ResourceContext,children:oe.jsx(Ec.Provider,{value:t.bridge.VisibleCanvasReactContext,children:oe.jsx(wc.Provider,{value:t.bridge.SimpleViewerReactContext,children:t.children})})})}const Zr=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},q_="@iiif/IMPORT_ENTITIES",Y_="@iiif/MODIFY_ENTITY_FIELD",Q_="@iiif/REORDER_ENTITY_FIELD",G_="@iiif/ADD_REFERENCE",X_="@iiif/UPDATE_REFERENCE",K_="@iiif/REMOVE_REFERENCE",Z_="@iiif/ADD_METADATA",J_="@iiif/REMOVE_METADATA",eL="@iiif/UPDATE_METADATA",tL="@iiif/REORDER_METADATA",nL=Zr(q_)(),iL=Zr(Y_)(),rL=Zr(Q_)(),sL=Zr(G_)(),aL=Zr(K_)(),oL=Zr(X_)(),lL=Zr(Z_)(),uL=Zr(eL)(),cL=Zr(J_)(),fL=Zr(tL)(),qv={importEntities:nL,modifyEntityField:iL,reorderEntityField:rL,addReference:sL,removeReference:aL,updateReference:oL,addMetadata:lL,removeMetadata:cL,updateMetadata:uL,reorderMetadata:fL};function rb(){const e=Un().getStore();return R.useMemo(()=>n=>e.dispatch(n),[e])}function sb(t){return typeof t!="string"&&t&&t.bindToVault}function ab(){const t=Un(),e=R.useRef([]),n=rb(),i=R.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);R.useLayoutEffect(()=>{const p={id:i,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};n(qv.importEntities({entities:{AnnotationPage:{[p.id]:p}}}))},[i]);const a=ni(p=>i?p.iiif.entities.AnnotationPage[i]:null,[i]),u=R.useCallback((p,g)=>{if(i){if(sb(p)){const x=p;x.__vault||x.bindToVault(t),p=typeof x.source=="string"?x.source:x.source.id,e.current[p]=x}else typeof p!="string"&&(p=p.id);const S=t.get({id:i,type:"AnnotationPage"}),m=t.get({id:p,type:"Annotation"});S&&m&&(S.items.find(x=>x.id===m.id)||n(qv.addReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"},index:g})))}},[i]),f=R.useCallback(p=>{i&&(sb(p)?p=typeof p.source=="string"?p.source:p.source.id:typeof p!="string"&&(p=p.id),e.current[p]&&e.current[p].beforeRemove(),t.get({id:i,type:"AnnotationPage"})&&n(qv.removeReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"}})))},[i]);return[a,{addAnnotation:u,removeAnnotation:f}]}const ob=R.createContext(null);function lb(){const t=R.useContext(ob);return[t.fullPage,{addAnnotation:t.addAnnotation,removeAnnotation:t.removeAnnotation}]}function ub({children:t}){const[e,{addAnnotation:n,removeAnnotation:i}]=ab();return oe.jsx(ob.Provider,{value:R.useMemo(()=>({fullPage:e,addAnnotation:n,removeAnnotation:i}),[e]),children:t})}function dL({width:t,style:e,height:n,error:i,resetErrorBoundary:a}){return oe.jsxs("div",{style:{width:t,height:n,minHeight:500,...e||{},background:"#f9f9f9"},children:[oe.jsx("h3",{children:"Error occurred"}),oe.jsx("p",{children:i.message}),oe.jsx("button",{onClick:a,children:"Reset"})]})}const Ud=R.createContext(null);function cb(){return R.useContext(Ud)}const fb=R.createContext(()=>{}),db=R.createContext(()=>{});function Fl(t,e,n,i,a=[]){const u=R.useContext(t==="portal"?db:fb);R.useEffect(()=>(t!=="none"&&u(e,n,i),()=>{u(e,null)}),[e,t,u,...a])}function Jr(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.canvas,f=ni(p=>u?p.iiif.entities.Canvas[u]:void 0,[u]);return R.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}const hb=R.createContext(()=>{});function hL(t){const e=Jr(),n=R.useContext(hb);R.useEffect(()=>e&&e.id?(n(e.id,t),()=>n(e.id,-1)):()=>{},[e,t])}function pL({children:t,errorFallback:e,outerContainerProps:n={},worldScale:i,...a}){const[u,f]=R.useState(),p=nb(),g=e||dL,[S,m]=R.useState({}),x=Object.entries(S),[T,_]=R.useState({}),M=Object.entries(T),[k,L]=R.useState({}),P=R.useMemo(()=>i||Math.max(...Object.values(k)),[k]),O=R.useMemo(()=>({maxOverZoom:P||1,...a.runtimeOptions||{}}),[P,a.runtimeOptions]),j=R.useCallback((H,Z)=>{L(ie=>{if(Z===-1){const{[H]:W,...re}=ie;return re}return{...ie,[H]:Z}})},[]),q=R.useCallback((H,Z,ie)=>{m(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]),ee=R.useCallback((H,Z,ie)=>{_(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]);return oe.jsxs(IM,{resetKeys:[],fallbackRender:H=>oe.jsx(g,{...a,...H}),children:[oe.jsx(wM,{...a,containerProps:{style:{position:"relative"},...a.containerProps||{}},htmlChildren:oe.jsx(oe.Fragment,{children:x.map(([H,{element:Z,props:ie}])=>oe.jsx(R.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))}),onCreated:H=>{f(H),a.onCreated&&a.onCreated(H)},runtimeOptions:O,children:oe.jsx(Ud.Provider,{value:u,children:oe.jsx(hb.Provider,{value:j,children:oe.jsx(fb.Provider,{value:q,children:oe.jsx(db.Provider,{value:ee,children:oe.jsx(ib,{bridge:p,children:oe.jsx(Od.Provider,{value:a.mode||"explore",children:oe.jsx(ub,{children:t})})})})})})})}),oe.jsx("div",{children:M.map(([H,{element:Z,props:ie}])=>oe.jsx(R.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))})]})}const jd={},pb={get(t){return t},setMetaValue([t,e,n],i){const a=pb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;jd[t]={...jd[t]||{},[e]:{...(jd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=jd[t];if(n)return e?n[e]:n}};function vb(t=pb){return{addEventListener(e,n,i,a){if(e)return t.setMetaValue([e.id,"eventManager",n],u=>{const f=u||[];for(const p of f)if(p.callback===i)return f;return[...f,{callback:i,scope:a}]}),i},removeEventListener(e,n,i){e&&t.setMetaValue([e.id,"eventManager",n],a=>(a||[]).filter(u=>u.callback!==i))},getListenersAsProps(e,n){const i=typeof e=="string"?{id:e}:e;if(!i||!i.id)return{};const a=t.getResourceMeta(i.id,"eventManager"),u={};if(a&&i)for(const f of Object.keys(a))u[f]=p=>{const g=t.get(i);for(const{callback:S,scope:m}of a[f]||[])(!m||n&&m.indexOf(n)!==-1)&&S(p,g)};return u}}}function Yv(t,e){const n=Un(),i=R.useMemo(()=>vb(n),[n]),a=ni(()=>t&&t.id?n.getResourceMeta(t.id,"eventManager"):null,[t]);return R.useMemo(()=>t?i.getListenersAsProps(t,e):{},[a,t,n,e])}const Fd={},mb={get(t){return t},setMetaValue([t,e,n],i){const a=mb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Fd[t]={...Fd[t]||{},[e]:{...(Fd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Fd[t];if(n)return e?n[e]:n}};function Qv(t=mb){return{applyStyles(e,n,i){const a=typeof e=="string"?e:e.id;return t.setMetaValue([a,"styles",n],i)},getAppliedStyles(e){const n=typeof e=="string"?e:e.id;return t.getResourceMeta(n,"styles")}}}function Cc(t,e){const n=Un(),i=R.useMemo(()=>Qv(n),[n]);return ni(()=>{if(!t)return null;const a=i.getAppliedStyles(t.id);return a?e?a[e]:a:void 0},[t,e])}var vL=Object.defineProperty,mL=(t,e,n)=>e in t?vL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bd=(t,e,n)=>(mL(t,typeof e!="symbol"?e+"":e,n),n),gL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Tc=Math.PI*2,Gv=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},yL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},gb=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},SL=function(t,e,n,i,a,u,f,p,g,S,m,x){var T=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=T*_-T*k-_*M;L<0&&(L=0),L/=T*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=gb(1,0,ee,H),re=gb(ee,H,Z,ie);return p===0&&re>0&&(re-=Tc),p===1&&re<0&&(re+=Tc),[j,q,W,re]},bL=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,T=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Tc/360),k=Math.cos(g*Tc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=SL(e,n,i,a,u,f,m,T,M,k,L,P),q=gL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Tc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(yL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=Gv(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=Gv(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=Gv(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})};function yb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var EL=wL,Xv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},xL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function wL(t){var e=[];return t.replace(xL,function(n,i,a){var u=i.toLowerCase();for(a=TL(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==Xv[u])return a.unshift(i),e.push(a);if(a.length<Xv[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,Xv[u])))}}),e}var CL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function TL(t){var e=t.match(CL);return e?e.map(Number):[]}const RL=yb(EL);var AL=ML;function ML(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const OL=yb(AL);function _L(t){const e=RL(t),n=OL(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const T=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=bL({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&T.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),T.push(M)}return T}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
288
+ `);const O=P.state[p];if(O==null)return;JSON.stringify(a.getState())!==JSON.stringify(O)&&_(O);return}a.dispatchFromDevtools&&typeof a.dispatch=="function"&&a.dispatch(P)});case"DISPATCH":switch(k.payload.type){case"RESET":return _(M),p===void 0?m==null?void 0:m.init(a.getState()):m==null?void 0:m.init(Nd(g.name));case"COMMIT":if(p===void 0){m==null||m.init(a.getState());return}return m==null?void 0:m.init(Nd(g.name));case"ROLLBACK":return Nv(k.state,P=>{if(p===void 0){_(P),m==null||m.init(a.getState());return}_(P[p]),m==null||m.init(Nd(g.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Nv(k.state,P=>{if(p===void 0){_(P);return}JSON.stringify(a.getState())!==JSON.stringify(P[p])&&_(P[p])});case"IMPORT_STATE":{const{nextLiftedState:P}=k.payload,O=(L=P.computedStates.slice(-1)[0])==null?void 0:L.state;if(!O)return;_(p===void 0?O:O[p]),m==null||m.send(null,P);return}case"PAUSE_RECORDING":return R=!R}return}}),M},P_=L_,Nv=(t,e)=>{let n;try{n=JSON.parse(t)}catch(i){console.error("[zustand devtools middleware] Could not parse the received json",i)}n!==void 0&&e(n)},D_=t=>(e,n,i)=>{const a=i.subscribe;return i.subscribe=(u,f,p)=>{let g=u;if(f){const S=(p==null?void 0:p.equalityFn)||Object.is;let m=u(i.getState());g=x=>{const R=u(x);if(!S(m,R)){const _=m;f(m=R,_)}},p!=null&&p.fireImmediately&&f(m,m)}return a(g)},t(e,n,i)},k_=D_,I_=(t={},e)=>{switch(e.type){case RS:return{...t,[e.payload.id]:e.payload.type};case AS:return{...t,...e.payload.mapping};default:return t}};function zv(t,e,n,i){return!(!t[n]||!t[n][e]||!t[n][e][i]||!Array.isArray(t[n][e][i]))}function N_(t,e){const n={},i=[];for(const[a,u]of Object.entries(t||{})){i.push(a);const f=(e||{})[a];if(!f||f.length===0){n[a]=u;continue}n[a]=f}for(const[a,u]of Object.entries(e||{}))i.indexOf(a)===-1&&(n[a]=u);return n}function Ge(t){return t.payload}function Uv(t,e){return typeof t>"u"?e:t}const z_=(t=FS(),e)=>{var n;const i=(a,u)=>({...t,[Ge(e).type]:{...t[Ge(e).type],[Ge(e).id]:{...a,...u}}});switch(e.type){case yS:{if(!t[Ge(e).type]||!t[Ge(e).type][Ge(e).id])return t;const a=t[Ge(e).type][Ge(e).id];return typeof a=="string"?t:i(a,{[Ge(e).key]:Ge(e).value})}case SS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string")return t;const u=Array.from(a[Ge(e).key]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{[Ge(e).key]:u})}case gS:{const a=Object.keys(Ge(e).entities),u={...t};for(const f of a){const p=Ge(e).entities[f],g={...t[f]||{}};let S=!1;const m=Object.keys(p||{})||[];if(p&&m){for(const x of m)S=!0,g[x]=t[f][x]?N_(t[f][x],p[x]):p[x];S&&(u[f]=g)}}return u}case bS:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]);return u.splice(Uv(Ge(e).index,u.length+1),0,Ge(e).reference),i(a,{[Ge(e).key]:u})}case Av:case ES:{if(!zv(t,Ge(e).id,Ge(e).type,Ge(e).key))return t;const a=t[Ge(e).type][Ge(e).id],u=Array.from(a[Ge(e).key]),f=Uv(Ge(e).index,u.findIndex(p=>p&&p.id===Ge(e).reference.id));return f===-1||((n=u[f])==null?void 0:n.id)!==Ge(e).reference.id?t:(e.type===Av?u.splice(f,1,Ge(e).reference):u.splice(f,1),i(a,{[Ge(e).key]:u}))}case xS:{const a=t[Ge(e).type][Ge(e).id];if(!a)return t;const u=Array.from(a.metadata||[]),f=Ge(e);return u.splice(Uv(e.payload.beforeIndex,u.length+1),0,{label:f.label,value:f.label}),i(a,{metadata:u})}case CS:{const a=t[Ge(e).type][Ge(e).id];if(typeof a=="string"||!a)return t;const u=Array.from(a.metadata||[]),[f]=u.splice(Ge(e).startIndex,1);return u.splice(Ge(e).endIndex,0,f),i(a,{metadata:u})}case Mv:case wS:{const a=t[Ge(e).type][Ge(e).id],u=Array.from(a.metadata||[]),f=Ge(e).atIndex;return typeof f>"u"||f===-1||!u[f]?t:(e.type===Mv?u.splice(f,1,{label:Ge(e).label,value:Ge(e).value}):u.splice(f,1),i(a,{metadata:u}))}default:return t}},U_=(t={},e)=>{switch(e.type){case DS:case S_:return{...t,[e.payload.id]:{requestUri:e.payload.id,loadingState:PS,uriMismatch:!1,resourceUri:e.payload.id}};case IS:return{...t,[e.payload.requestId]:{...t[e.payload.requestId]||{},uriMismatch:!0,resourceUri:e.payload.actualId},[e.payload.actualId]:{requestUri:e.payload.requestId,loadingState:t[e.payload.requestId].loadingState,uriMismatch:!0,resourceUri:e.payload.actualId}};case kS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:Ov,error:e.payload.message}};case NS:return{...t,[e.payload.id]:{...t[e.payload.id]||{},loadingState:_v,error:void 0}}}return t},j_=(t={},e)=>{const{id:n,updateValue:i,value:a,meta:u,key:f}=e&&e.payload||{};switch(e.type){case MS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:a}}};case OS:return{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:t[n]&&t[n][u]?i(t[n][u][f]):i(void 0)}}};case _S:return t[n]&&t[n][u]&&t[n][u][f]?{...t,[n]:{...t[n]||{},[u]:{...t[n]?t[n][u]||{}:{},[f]:void 0}}}:t;default:return t}};function HS(t={}){const e=Object.keys(t);return function(n={},i){let a=!1;const u={};for(let f=0;f<e.length;f++){const p=e[f];u[p]=t[p](n[p],i),a=a||u[p]!==n[p]}return a?u:n}}function F_(t){return(e,n)=>n&&n.type===Pv?n.payload.actions.reduce(t,e):n&&n.type===w_?{...e,iiif:{...e.iiif,...n.payload.state}}:t(e,n)}const B_=HS({mapping:I_,entities:z_,requests:U_,meta:j_});function H_(){return{iiif:{entities:FS(),meta:{},mapping:{},requests:{}}}}function V_(t={}){const{enableDevtools:e=!1,iiifStoreName:n="iiif",defaultState:i=H_(),customReducers:a={}}=t,u=F_(HS({[n]:B_,...a}));return A_(k_(P_(O_(u,i),{enabled:e})))}function $_(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(a){a(n)}),(i=t.get("*"))&&i.slice().map(function(a){a(e,n)})}}}function Ci(t,e,n,i=!0){e[jl]=e[jl]||[],e[jl].push(t);const a=new Map;Object.defineProperty(e,t,{enumerable:i,get(){if(typeof e[uo][t]>"u")return;const u=e[uo][t];if(!u)return u;const f=n.get(e[uo][t],{parent:this.id?{id:this.id,type:this.type}:void 0});return a.has(f)||(a.clear(),a.set(f,fo(f,n))),a.get(f)},set(u){e[uo][t]!==u&&(this[co]?n.modifyEntityField({id:this.id,type:this.type},t,$S(u)):this[uo][t]=u)}})}const uo=Symbol.for("_refs_"),co=Symbol.for("_reactive_"),jl=Symbol.for("_defined_"),VS=Symbol.for("_parent_");function W_(t,e=!1,n){const i={id:"",type:"unknown",[jl]:[],[uo]:{},[VS]:n||null,[co]:null,is(a){return typeof a=="string"?this.id===a:a.id?a.id===this.id:!1},reactive(){if(!this[co])return this[co]=this.subscribe(()=>this.refresh(),!0),()=>{this.unreactive()}},refresh(){if(this.id){const a=this.unwrap();for(const u of Object.keys(a||{}))this[jl].includes(u)?this[uo][u]=a[u]:this[u]=a[u]}},unreactive(){this[co]&&(this[co](),this[co]=null)},unwrap(){if(!this.id)throw new Error("Invalid object");const a=this[VS];return t.get(this.id,{parent:a?{id:a,type:"unknown"}:void 0})},toPresentation3(){return t.toPresentation3(this.unwrap())},toPresentation2(){return t.toPresentation2(this.unwrap())},valueOf(){return this.unwrap()},toJSON(){const a=this;return{...a,items:a.items,annotations:a.annotations,structures:a.structures,seeAlso:a.seeAlso,service:a.service,services:a.services,rendering:a.rendering,partOf:a.partOf,start:a.start,supplementary:a.supplementary,homepage:a.homepage,thumbnail:a.thumbnail,placeholderCanvas:a.placeholderCanvas,accompanyingCanvas:a.accompanyingCanvas,provider:a.provider}},subscribe(a,u=!0){return t.subscribe(()=>this.id?t.get(this.id):null,a,u)}};return Ci("items",i,t),Ci("annotations",i,t),Ci("structures",i,t),Ci("seeAlso",i,t),Ci("rendering",i,t),Ci("partOf",i,t),Ci("start",i,t,!1),Ci("supplementary",i,t),Ci("homepage",i,t),Ci("thumbnail",i,t),Ci("placeholderCanvas",i,t,!1),Ci("accompanyingCanvas",i,t,!1),Ci("provider",i,t),Ci("body",i,t),Ci("logo",i,t),i}function q_(t){return!!t[jl]}function $S(t){return Array.isArray(t)?t.map(e=>$S(e)):!t||!t.type?t:{id:t.id,type:t.type}}function fo(t,e,n=!1,i){if(Array.isArray(t))return t.map(p=>fo(p,e,n));if(!t||!t.type||!t.id)return t;const a=W_(e,n),u=Object.create(a),f=Object.assign(u,t);return n&&f.reactive(),f}function WS(t){switch(t){case"Image":case"Video":case"Sound":case"Dataset":case"Text":case"Composite":case"List":case"Independents":case"Audience":return"ContentResource";case"ImageService1":case"ImageService2":case"ImageService3":return"Service"}return t}let jv=class{constructor(e,n){ga(this,"options"),ga(this,"store"),ga(this,"emitter"),ga(this,"isBatching",!1),ga(this,"batchQueue",[]),ga(this,"remoteFetcher"),ga(this,"staticFetcher"),ga(this,"defaultFetcher",i=>fetch(i).then(a=>a.json())),this.options=Object.assign({reducers:{},customFetcher:this.defaultFetcher,enableDevtools:!0},e||{}),this.store=n||V_({customReducers:this.options.reducers,defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=$_(),this.remoteFetcher=jS(this,this.options.customFetcher),this.staticFetcher=jS(this,(i,a)=>a)}batch(e){this.isBatching=!0;try{e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}async asyncBatch(e){this.isBatching=!0;try{await e(this),this.isBatching=!1,this.dispatch(Dv({actions:this.batchQueue}))}catch(n){throw this.batchQueue=[],this.isBatching=!1,n}this.batchQueue=[]}modifyEntityField(e,n,i){this.dispatch(h_.modifyEntityField({id:e.id,type:e.type,key:n,value:i}))}dispatch(e){if(this.isBatching)this.batchQueue.push(e);else{if(e.type===Pv){for(const a of e.payload.actions)this.emitter.emit(a.type,{action:a,state:this.store.getState()});this.store.dispatch(e);const i=this.getState();for(const a of e.payload.actions)this.emitter.emit(`after:${a.type}`,{action:a,state:i});return}this.emitter.emit(e.type,{action:e,state:this.store.getState()}),this.store.dispatch(e);const n=this.store.getState();this.emitter.emit(`after:${e.type}`,{action:e,state:n});return}}on(e,n){return this.emitter.on(e,n),()=>{this.emitter.off(e,n)}}serialize(e,n){return QO(this.getState().iiif,e,n)}toPresentation2(e){return this.serialize(e,JO)}toPresentation3(e){return this.serialize(e,e_)}hydrate(e,n,i={}){return this.get(e,n,{...i,skipSelfReturn:!1})}get(e,n,i={}){typeof n!="string"&&(i=n||{},n=void 0);const{skipSelfReturn:a=!0}=i||{};let u=i.parent?typeof i.parent=="string"?i.parent:i.parent.id:void 0;if(Array.isArray(e))return e.map(x=>this.get(x,i));const f=this.getState();if(da(e)&&!i.preserveSpecificResources&&(e=e.source),typeof e=="string"){const x=WS(n||f.iiif.mapping[e]);if(!x)return a?null:{id:e,type:"unknown"};e={id:e,type:x}}if(e&&e.partOf&&!u&&!i.skipPartOfCheck){const x=Array.isArray(e.partOf)?e.partOf[0]:e.partOf;x&&(typeof x=="string"&&(u=x),typeof x.id=="string"&&(u=x.id))}const p=WS(n||(e==null?void 0:e.type)),g=e==null?void 0:e.id,S=f.iiif.entities[p];if(!S){const x=f.iiif.requests[g];return x&&x.resourceUri!==g?this.get(x.resourceUri,i):a?null:e}const m=S[e.id];if(m&&m[zn]){const x=m[zn].find(R=>u?R[Kr]===u:R[Kr]===m.id);return vv(m,x)}return S[e.id]||(a?null:e)}select(e){return e(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}deep(e,n){if(typeof e>"u")return this.get(n,{skipSelfReturn:!1});if(typeof e=="function")try{const a=e(this.get(n,{skipSelfReturn:!1})),u=f=>this.deep(f,a);return u.size=Array.isArray(a)?a.length:1,u}catch{const a=u=>this.deep(u,void 0);return a.size=0,a}const i=a=>this.deep(a,e);return i.size=Array.isArray(e)?e.length:1,i}loadManifest(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}loadCollection(e,n){const i=typeof e=="string"?e:e.id;return this.load(i,n)}load(e,n){const i=typeof e=="string"?e:e.id;return n?Promise.resolve(this.staticFetcher(i,n)):Promise.resolve(this.remoteFetcher(i))}loadSync(e,n){const i=typeof e=="string"?e:e.id;return this.staticFetcher(i,n)}loadManifestSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}loadCollectionSync(e,n){const i=typeof e=="string"?e:e.id;return this.loadSync(i,n)}areInputsEqual(e,n){return US(e,n)}subscribe(e,n,i){return typeof i>"u"&&(typeof n>"u"||n===!1||n===!0)&&(i=n,n=e,e=a=>a),this.store.subscribe(e,a=>n(a,this),{equalityFn:US,fireImmediately:!i})}async ensureLoaded(e){const n=typeof e=="string"?e:e.id;this.requestStatus(n)||await this.load(n)}requestStatus(e){return this.select(n=>n.iiif.requests[e])}getResourceMeta(e,n){const i=this.getState().iiif.meta[e];if(i)return n?i[n]:i}getObject(e,n,i={}){const{reactive:a,...u}=i;return fo(this.get(e,n,u),this,a)}async loadObject(e,n){return fo(await this.load(e,n),this)}async loadManifestObject(e,n){return fo(await this.loadManifest(e,n),this)}async loadCollectionObject(e,n){return fo(await this.loadCollection(e,n),this)}wrapObject(e){return fo(this.get(e,{skipSelfReturn:!1}),this)}isWrapped(e){return q_(e)}setMetaValue([e,n,i],a){this.dispatch(typeof a=="function"?LS.setMetaValueDynamic({id:e,meta:n,key:i,updateValue:a}):LS.setMetaValue({id:e,meta:n,key:i,value:a}))}};function Y_(){return typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}function qS(t){const e=Y_();try{const i=e.IIIF_VAULT;if(i)return i}catch{}const n=new jv(t);try{e.IIIF_VAULT=n}catch{}return n}const bc=T.createContext({vault:null,setVaultInstance:t=>{}});function Fv({vault:t,vaultOptions:e,useGlobal:n,resources:i,children:a}){const[u,f]=T.useState(()=>t||(n?qS(e):e?new jv(e):new jv));return oe.jsx(bc.Provider,{value:{vault:u,setVaultInstance:f},children:oe.jsx(ca,{value:i||{},children:a})})}const Un=()=>{const{vault:t}=T.useContext(bc);if(t===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return t};function Bv(t,{noCache:e=!1}={}){const n=typeof t=="string"?t:t.id,i=Un(),[a,u]=T.useState(n),[f,p]=T.useState(void 0),g=T.useMemo(()=>i.get(n,{skipSelfReturn:!0})||void 0,[n,i]),[S,m]=T.useState(g);return T.useEffect(()=>{(async()=>{try{const x=g&&!e?g:await i.load(n),R=x?x.id||x["@id"]:null;x&&a!==R&&u(R),m(x)}catch(x){p(x)}})()},[n,e]),{isLoaded:!!S,id:a,requestId:n,error:f,resource:S,cached:!!(S&&S===g)}}function YS(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function QS({manifest:t,children:e}){return oe.jsx(ca,{value:{manifest:t},children:e})}function zd({canvas:t,children:e}){return oe.jsx(ca,{value:{canvas:t},children:e})}function ni(t,e=[]){const n=Un(),[i,a]=T.useState(()=>t(n.getState(),n));return T.useEffect(()=>n.subscribe(u=>t(u,n),u=>{a(u)},!1),e),i}const Ec=T.createContext([]);function Hv(){const t=T.useContext(Ec);return ni(e=>t.map(n=>e.iiif.entities.Canvas[n]).filter(Boolean),[t])}function ya(t={},e=[]){const{id:n,selector:i}=t,a=As();Un();const u=n||a.manifest,f=ni(p=>u?p.iiif.entities.Manifest[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function GS({range:t,children:e}){return oe.jsx(ca,{value:{range:t},children:e})}function XS(t,e){for(const n of e.items){if(n.type==="Canvas")return n;if(n.type==="SpecificResource")return n.source;if(n.type==="Range"){const i=XS(t,t.get(n));if(i)return i}}return null}function Vv(t,e){var i;const n=[];for(const a of e.items)if(a.type==="SpecificResource"&&((i=a.source)==null?void 0:i.type)==="Canvas"&&(a.source.id.indexOf("#")!==-1?n.push({id:a.source.id.split("#")[0],type:"Canvas"}):n.push(a.source)),a.type==="Range"&&n.push(...Vv(t,t.get(a))),a.type==="SpecificResource"){const u=typeof a.source=="string"?a.source:a.source.id;n.push({id:u,type:"Canvas"})}return n}function Q_(t,e,n){for(const i of e.structures){const a=$v(t,t.get(i),n);if(a)return a}return null}function $v(t,e,n){var i,a,u;for(const f of e.items){const p=(a=(i=f==null?void 0:f.source)==null?void 0:i.id)==null?void 0:a.split("#")[0];if(f.type==="SpecificResource"&&f.source===n||f.type==="SpecificResource"&&((u=f.source)==null?void 0:u.type)==="Canvas"&&n===p)return e;if(f.type==="Range"){const g=$v(t,t.get(f),n);if(g)return g}}return null}function G_(t,e,n,i=!1){const a=e.behavior,u=n?t.get(n):null;if(!u)return[];const f=u.behavior,p=i?!1:a.includes("paged"),g=p?!1:a.includes("continuous"),S=p||g?!1:a.includes("individuals"),m=f.includes("facing-pages"),x=f.includes("non-paged");if(m||x||S||i)return[{id:u.id,type:"Canvas"}];const[R,_]=Wv(t,e);if(g)return R;const M=R.findIndex(k=>k.id===n);if(M===-1)return[];for(const k of _)if(k.includes(M))return k.map(L=>R[L]);return[{id:u.id,type:"Canvas"}]}function Wv(t,e,{disablePaging:n,skipNonPaged:i}={}){const a=e.behavior,u=a.includes("paged"),f=u?!1:a.includes("continuous"),p=u||f?!1:a.includes("individuals"),g=e.type==="Manifest"?e.items:Vv(t,e);if(f)return[g,[g.map((M,k)=>k)]];if(p||!u||n)return[g,g.map((M,k)=>[k])];const S=[];let m=[];const x=()=>{m.length&&(S.push([...m]),m=[])};let R=0,_=!1;for(let M=0;M<g.length;M++){const k=t.get(g[M]);if(k.behavior.includes("non-paged")){M===R&&R++,i||(x(),S.push([M]),x());continue}if(M===R||k.behavior.includes("facing-pages")){m.length&&(_=!0),x(),S.push([M]),x();continue}if(m.push(M),_){x(),_=!1;continue}m.length>1&&x()}return m.length&&x(),[g,S]}function KS(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.range,f=ni(p=>u?p.iiif.entities.Range[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function ZS({startCanvas:t,disablePaging:e}){var M;const n=Un(),i=ya(),a=KS(),[u,f]=T.useState(void 0),p=a||i;if(!p)throw new Error("Nothing selected");const[g,S]=T.useMemo(()=>Wv(n,p,{disablePaging:e}),[n,p]),m=T.useCallback(k=>{const L=S.findIndex(P=>P.includes(k));f(L===-1?0:L)},[g,S]),x=T.useCallback(k=>{const L=g.findIndex(P=>P.id===k);L!==-1?m(L):f(0)},[g,S]),R=T.useCallback(()=>{f(k=>k>=S.length?k:k+1)},[S]),_=T.useCallback(()=>{f(k=>k<=0?0:k-1)},[S]);return typeof u>"u"&&(t?x(t):f(0)),{visibleItems:((M=S[u])==null?void 0:M.map(k=>g[k].id))||[],cursor:u,items:g,sequence:S,setSequenceIndex:f,setCanvasIndex:m,setCanvasId:x,next:R,previous:_}}const xc=()=>{},wc=T.createContext({setCurrentCanvasId:xc,setCurrentCanvasIndex:xc,nextCanvas:xc,previousCanvas:xc,items:[],sequence:[],setSequenceIndex:xc,currentSequenceIndex:0});function JS(t){const e=ya(),{cursor:n,visibleItems:i,next:a,sequence:u,items:f,setCanvasIndex:p,setCanvasId:g,previous:S,setSequenceIndex:m}=ZS({startCanvas:t.startCanvas,disablePaging:t.pagingEnabled===!1}),x=T.useMemo(()=>({sequence:u,items:f,setCurrentCanvasId:g,nextCanvas:a,previousCanvas:S,totalCanvases:f.length,setCurrentCanvasIndex:p,setSequenceIndex:m,currentSequenceIndex:n}),[u,f,g,a,S,f,p,m,n]);return e?i.length===0?null:oe.jsx(wc.Provider,{value:x,children:oe.jsx(Ec.Provider,{value:i,children:oe.jsx(zd,{canvas:i[0],children:t.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."}))}function eb(t){const e=YS(t.manifest);if(!e)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),oe.jsx("div",{children:"Sorry, something went wrong."});if(e.error)return oe.jsx("div",{children:e.error.toString()});if(!e.isLoaded)return oe.jsx("div",{children:"Loading..."});const n=oe.jsx(JS,{...t,children:t.children});return oe.jsx(QS,{manifest:e.id,children:t.rangeId?oe.jsx(GS,{range:t.rangeId,children:n}):n})}function tb(){return T.useContext(wc)}function nb(){return{VaultContext:T.useContext(bc),ResourceContext:T.useContext(kd),SimpleViewerReactContext:T.useContext(wc),VisibleCanvasReactContext:T.useContext(Ec)}}function ib(t){return oe.jsx(Fv,{vault:t.bridge.VaultContext.vault||void 0,resources:t.bridge.ResourceContext,children:oe.jsx(Ec.Provider,{value:t.bridge.VisibleCanvasReactContext,children:oe.jsx(wc.Provider,{value:t.bridge.SimpleViewerReactContext,children:t.children})})})}const Zr=function(t){return function(){const e={type:t,getType:()=>t,toString:()=>t};return(n,i)=>({...e,...n!==void 0&&{payload:n},...i!==void 0&&{meta:i}})}},X_="@iiif/IMPORT_ENTITIES",K_="@iiif/MODIFY_ENTITY_FIELD",Z_="@iiif/REORDER_ENTITY_FIELD",J_="@iiif/ADD_REFERENCE",eL="@iiif/UPDATE_REFERENCE",tL="@iiif/REMOVE_REFERENCE",nL="@iiif/ADD_METADATA",iL="@iiif/REMOVE_METADATA",rL="@iiif/UPDATE_METADATA",sL="@iiif/REORDER_METADATA",aL=Zr(X_)(),oL=Zr(K_)(),lL=Zr(Z_)(),uL=Zr(J_)(),cL=Zr(tL)(),fL=Zr(eL)(),dL=Zr(nL)(),hL=Zr(rL)(),pL=Zr(iL)(),vL=Zr(sL)(),qv={importEntities:aL,modifyEntityField:oL,reorderEntityField:lL,addReference:uL,removeReference:cL,updateReference:fL,addMetadata:dL,removeMetadata:pL,updateMetadata:hL,reorderMetadata:vL};function rb(){const e=Un().getStore();return T.useMemo(()=>n=>e.dispatch(n),[e])}function sb(t){return typeof t!="string"&&t&&t.bindToVault}function ab(){const t=Un(),e=T.useRef([]),n=rb(),i=T.useMemo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);T.useLayoutEffect(()=>{const p={id:i,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};n(qv.importEntities({entities:{AnnotationPage:{[p.id]:p}}}))},[i]);const a=ni(p=>i?p.iiif.entities.AnnotationPage[i]:null,[i]),u=T.useCallback((p,g)=>{if(i){if(sb(p)){const x=p;x.__vault||x.bindToVault(t),p=typeof x.source=="string"?x.source:x.source.id,e.current[p]=x}else typeof p!="string"&&(p=p.id);const S=t.get({id:i,type:"AnnotationPage"}),m=t.get({id:p,type:"Annotation"});S&&m&&(S.items.find(x=>x.id===m.id)||n(qv.addReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"},index:g})))}},[i]),f=T.useCallback(p=>{i&&(sb(p)?p=typeof p.source=="string"?p.source:p.source.id:typeof p!="string"&&(p=p.id),e.current[p]&&e.current[p].beforeRemove(),t.get({id:i,type:"AnnotationPage"})&&n(qv.removeReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"}})))},[i]);return[a,{addAnnotation:u,removeAnnotation:f}]}const ob=T.createContext(null);function lb(){const t=T.useContext(ob);return[t.fullPage,{addAnnotation:t.addAnnotation,removeAnnotation:t.removeAnnotation}]}function ub({children:t}){const[e,{addAnnotation:n,removeAnnotation:i}]=ab();return oe.jsx(ob.Provider,{value:T.useMemo(()=>({fullPage:e,addAnnotation:n,removeAnnotation:i}),[e]),children:t})}function mL({width:t,style:e,height:n,error:i,resetErrorBoundary:a}){return oe.jsxs("div",{style:{width:t,height:n,minHeight:500,...e||{},background:"#f9f9f9"},children:[oe.jsx("h3",{children:"Error occurred"}),oe.jsx("p",{children:i.message}),oe.jsx("button",{onClick:a,children:"Reset"})]})}const Ud=T.createContext(null);function cb(){return T.useContext(Ud)}const fb=T.createContext(()=>{}),db=T.createContext(()=>{});function Fl(t,e,n,i,a=[]){const u=T.useContext(t==="portal"?db:fb);T.useEffect(()=>(t!=="none"&&u(e,n,i),()=>{u(e,null)}),[e,t,u,...a])}function Jr(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.canvas,f=ni(p=>u?p.iiif.entities.Canvas[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}const hb=T.createContext(()=>{});function gL(t){const e=Jr(),n=T.useContext(hb);T.useEffect(()=>e&&e.id?(n(e.id,t),()=>n(e.id,-1)):()=>{},[e,t])}function yL({children:t,errorFallback:e,outerContainerProps:n={},worldScale:i,...a}){const[u,f]=T.useState(),p=nb(),g=e||mL,[S,m]=T.useState({}),x=Object.entries(S),[R,_]=T.useState({}),M=Object.entries(R),[k,L]=T.useState({}),P=T.useMemo(()=>i||Math.max(...Object.values(k)),[k]),O=T.useMemo(()=>({maxOverZoom:P||1,...a.runtimeOptions||{}}),[P,a.runtimeOptions]),j=T.useCallback((H,Z)=>{L(ie=>{if(Z===-1){const{[H]:W,...re}=ie;return re}return{...ie,[H]:Z}})},[]),q=T.useCallback((H,Z,ie)=>{m(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]),ee=T.useCallback((H,Z,ie)=>{_(({[H]:W,...re})=>Z?{...re,[H]:{element:Z,props:ie}}:re)},[]);return oe.jsxs(jM,{resetKeys:[],fallbackRender:H=>oe.jsx(g,{...a,...H}),children:[oe.jsx(AM,{...a,containerProps:{style:{position:"relative"},...a.containerProps||{}},htmlChildren:oe.jsx(oe.Fragment,{children:x.map(([H,{element:Z,props:ie}])=>oe.jsx(T.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))}),onCreated:H=>{f(H),a.onCreated&&a.onCreated(H)},runtimeOptions:O,children:oe.jsx(Ud.Provider,{value:u,children:oe.jsx(hb.Provider,{value:j,children:oe.jsx(fb.Provider,{value:q,children:oe.jsx(db.Provider,{value:ee,children:oe.jsx(ib,{bridge:p,children:oe.jsx(Od.Provider,{value:a.mode||"explore",children:oe.jsx(ub,{children:t})})})})})})})}),oe.jsx("div",{children:M.map(([H,{element:Z,props:ie}])=>oe.jsx(T.Fragment,{children:oe.jsx(Z,{...ie||{}})},H))})]})}const jd={},pb={get(t){return t},setMetaValue([t,e,n],i){const a=pb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;jd[t]={...jd[t]||{},[e]:{...(jd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=jd[t];if(n)return e?n[e]:n}};function vb(t=pb){return{addEventListener(e,n,i,a){if(e)return t.setMetaValue([e.id,"eventManager",n],u=>{const f=u||[];for(const p of f)if(p.callback===i)return f;return[...f,{callback:i,scope:a}]}),i},removeEventListener(e,n,i){e&&t.setMetaValue([e.id,"eventManager",n],a=>(a||[]).filter(u=>u.callback!==i))},getListenersAsProps(e,n){const i=typeof e=="string"?{id:e}:e;if(!i||!i.id)return{};const a=t.getResourceMeta(i.id,"eventManager"),u={};if(a&&i)for(const f of Object.keys(a))u[f]=p=>{const g=t.get(i);for(const{callback:S,scope:m}of a[f]||[])(!m||n&&m.indexOf(n)!==-1)&&S(p,g)};return u}}}function Yv(t,e){const n=Un(),i=T.useMemo(()=>vb(n),[n]),a=ni(()=>t&&t.id?n.getResourceMeta(t.id,"eventManager"):null,[t]);return T.useMemo(()=>t?i.getListenersAsProps(t,e):{},[a,t,n,e])}const Fd={},mb={get(t){return t},setMetaValue([t,e,n],i){const a=mb.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Fd[t]={...Fd[t]||{},[e]:{...(Fd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Fd[t];if(n)return e?n[e]:n}};function Qv(t=mb){return{applyStyles(e,n,i){const a=typeof e=="string"?e:e.id;return t.setMetaValue([a,"styles",n],i)},getAppliedStyles(e){const n=typeof e=="string"?e:e.id;return t.getResourceMeta(n,"styles")}}}function Cc(t,e){const n=Un(),i=T.useMemo(()=>Qv(n),[n]);return ni(()=>{if(!t)return null;const a=i.getAppliedStyles(t.id);return a?e?a[e]:a:void 0},[t,e])}var SL=Object.defineProperty,bL=(t,e,n)=>e in t?SL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bd=(t,e,n)=>(bL(t,typeof e!="symbol"?e+"":e,n),n),EL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Tc=Math.PI*2,Gv=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},xL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},gb=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},wL=function(t,e,n,i,a,u,f,p,g,S,m,x){var R=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=R*_-R*k-_*M;L<0&&(L=0),L/=R*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=gb(1,0,ee,H),re=gb(ee,H,Z,ie);return p===0&&re>0&&(re-=Tc),p===1&&re<0&&(re+=Tc),[j,q,W,re]},CL=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,R=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Tc/360),k=Math.cos(g*Tc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=wL(e,n,i,a,u,f,m,R,M,k,L,P),q=EL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Tc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(xL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=Gv(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=Gv(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=Gv(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})};function yb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var TL=AL,Xv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},RL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function AL(t){var e=[];return t.replace(RL,function(n,i,a){var u=i.toLowerCase();for(a=OL(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==Xv[u])return a.unshift(i),e.push(a);if(a.length<Xv[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,Xv[u])))}}),e}var ML=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function OL(t){var e=t.match(ML);return e?e.map(Number):[]}const _L=yb(TL);var LL=PL;function PL(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const DL=yb(LL);function kL(t){const e=_L(t),n=DL(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const R=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=CL({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
289
289
  *
290
290
  * All code in this module is based on JavaScript code by Raph Levien, published on his blog at
291
291
  * https://raphlinus.github.io/.
@@ -315,7 +315,7 @@ No matching component was found for:
315
315
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
316
  * See the License for the specific language governing permissions and
317
317
  * limitations under the License.
318
- */function LL(t,e,n,i=1){return new Sb(t,e,n).subdivide(i)}function PL(t,e,n,i,a=1){return new Kv(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function DL(t){return t.x*t.x+t.y*t.y}function Rc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Bl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Sb{constructor(e,n,i){Bd(this,"start"),Bd(this,"control"),Bd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,T=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-T));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Rc(n.x0),a=Rc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Bl(i),g=Bl(a),S=[0];for(let m=1;m<f;m++){const x=(Bl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class Kv{constructor(e){Bd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Sb({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new Kv(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=DL(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Rc(O.x0),q=Rc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Rc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let T=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;T+p[_].val<k;)T+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Bl(L),j=Bl(P),q=L+(P-L)*(k-T)/p[_].val,ee=(Bl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const kL=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,IL=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,bb=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Ac(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return Or(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Ac(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return Or({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Ac({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return Or({selector:a,selectors:[a],iiifRenderingHints:i})}if(xb(t)){const a=[];if(t.region){const u=Ac({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return Or({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=kL.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(IL);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),Or({selector:null,selectors:[],iiifRenderingHints:i});const x=Eb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(T=>T[0])),Math.min(...a.map(T=>T[1])),Math.max(...a.map(T=>T[0])),Math.max(...a.map(T=>T[1]))],{style:f,svg:p}=UL(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return Or({selector:S,selectors:[S],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}function NL(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Eb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Eb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=_L(i);return{element:n,points:zL(a),shapeType:NL(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function zL(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...PL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...LL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function UL(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=bb.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=bb.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function xb(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Or(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=wb(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function wb(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function Sa(t,e={}){if(Array.isArray(t))return Sa(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?Sa({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return Sa(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Ac(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?Sa({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}function Zv(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=Un(),f=n||a.annotation,p=ni(S=>f?S.iiif.entities.Annotation[f]:void 0,[f]),g=ni(S=>p&&p.body?p.body.map(m=>m?m.type==="SpecificResource"?{...m,source:u.get(m)}:m?S.iiif.entities[m.type][m.id]:null:null).filter(Boolean):[],[p]);return R.useMemo(()=>{if(!p)return;const S={...p,body:g,target:Sa(p.target,{typeMap:u.getState().iiif.mapping})};return i?i(S):S},[p,i,g,...e])}const Cb=({id:t,style:e,className:n,interactive:i})=>{const a=Zv({id:t}),u=Cc(a,"atlas"),f=Cc(a,"html"),p=Yv(a,["atlas"]),g=Jr(),S=R.useMemo(()=>PM(e,u),[e,u]);return g&&a&&a.target&&a.target.selector&&a.target.selector.type==="BoxSelector"&&a.target.source&&(a.target.source.id===g.id||a.target.source===g.id)?oe.jsx(_M,{id:a.id,isEditing:!0,region:a.target.selector.spatial,style:S,className:(f==null?void 0:f.className)||n,interactive:!!(f!=null&&f.href||i),href:(f==null?void 0:f.href)||null,title:(f==null?void 0:f.title)||null,hrefTarget:(f==null?void 0:f.target)||null,onClick:()=>{},...p}):null};function Tb(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.annotationPage,f=ni(p=>u?p.iiif.entities.AnnotationPage[u]:void 0,[u]);return R.useMemo(()=>{if(f)return i?i(f):f},[f,...e])}const Jv=({className:t,page:e})=>{var u;const n=Tb({id:e.id})||e,i=Cc(n,"atlas"),a=Cc(n,"html");return ni(f=>n.id?f.iiif.entities.AnnotationPage[n.id]:null,[]),oe.jsx(R.Fragment,{children:(u=n.items)==null?void 0:u.map(f=>oe.jsx(Cb,{id:f.id,style:i,className:(a==null?void 0:a.className)||t},f.id))})};function Rb({id:t,image:e,thumbnail:n,isStatic:i,x:a=0,y:u=0,children:f,selector:p,onClick:g,enableSizes:S}){var x,T;const m=R.useMemo(()=>{if(!(!p||p.spatial.x===0&&p.spatial.y===0))return p.spatial},[p]);return oe.jsx("world-object",{x:a+e.target.spatial.x,y:u+e.target.spatial.y,width:e.target.spatial.width,height:e.target.spatial.height,onClick:g,children:e.service?oe.jsxs(R.Fragment,{children:[oe.jsx(LM,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:n&&n.type==="fixed"?n:void 0},enableSizes:S,x:0,y:0,width:(x=e.target)==null?void 0:x.spatial.width,height:(T=e.target)==null?void 0:T.spatial.height,crop:m}),f]},"service"):oe.jsxs(R.Fragment,{children:[oe.jsx("world-image",{onClick:g,uri:e.id,target:{x:0,y:0,width:e.target.spatial.width,height:e.target.spatial.height},display:e.width&&e.height?{width:e.width,height:e.height}:void 0,crop:m}),f]},"no-service")},t+(e.service?"server":"no-service"))}var jL=Object.defineProperty,FL=(t,e,n)=>e in t?jL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hd=(t,e,n)=>(FL(t,typeof e!="symbol"?e+"":e,n),n),BL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Mc=Math.PI*2,em=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},HL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},Ab=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},VL=function(t,e,n,i,a,u,f,p,g,S,m,x){var T=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=T*_-T*k-_*M;L<0&&(L=0),L/=T*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=Ab(1,0,ee,H),re=Ab(ee,H,Z,ie);return p===0&&re>0&&(re-=Mc),p===1&&re<0&&(re+=Mc),[j,q,W,re]},$L=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,T=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Mc/360),k=Math.cos(g*Mc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=VL(e,n,i,a,u,f,m,T,M,k,L,P),q=BL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Mc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(HL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=em(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=em(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=em(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})},WL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qL=QL,tm={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},YL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function QL(t){var e=[];return t.replace(YL,function(n,i,a){var u=i.toLowerCase();for(a=XL(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==tm[u])return a.unshift(i),e.push(a);if(a.length<tm[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,tm[u])))}}),e}var GL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function XL(t){var e=t.match(GL);return e?e.map(Number):[]}const KL=Mb(qL);var ZL=JL;function JL(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const eP=Mb(ZL);function tP(t){const e=KL(t),n=eP(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const T=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=$L({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&T.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),T.push(M)}return T}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
318
+ */function IL(t,e,n,i=1){return new Sb(t,e,n).subdivide(i)}function NL(t,e,n,i,a=1){return new Kv(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function zL(t){return t.x*t.x+t.y*t.y}function Rc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Bl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Sb{constructor(e,n,i){Bd(this,"start"),Bd(this,"control"),Bd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,R=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-R));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Rc(n.x0),a=Rc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Bl(i),g=Bl(a),S=[0];for(let m=1;m<f;m++){const x=(Bl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class Kv{constructor(e){Bd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Sb({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new Kv(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=zL(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Rc(O.x0),q=Rc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Rc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let R=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;R+p[_].val<k;)R+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Bl(L),j=Bl(P),q=L+(P-L)*(k-R)/p[_].val,ee=(Bl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const UL=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,jL=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,bb=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Ac(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return Or(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Ac(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return Or({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Ac({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return Or({selector:a,selectors:[a],iiifRenderingHints:i})}if(xb(t)){const a=[];if(t.region){const u=Ac({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return Or({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=UL.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(jL);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return Or({selector:f,selectors:[f],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),Or({selector:null,selectors:[],iiifRenderingHints:i});const x=Eb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(R=>R[0])),Math.min(...a.map(R=>R[1])),Math.max(...a.map(R=>R[0])),Math.max(...a.map(R=>R[1]))],{style:f,svg:p}=HL(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return Or({selector:S,selectors:[S],iiifRenderingHints:i})}return Or({selector:null,selectors:[],iiifRenderingHints:i})}function FL(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Eb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Eb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=kL(i);return{element:n,points:BL(a),shapeType:FL(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function BL(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...NL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...IL({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function HL(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=bb.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=bb.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function xb(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Or(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=wb(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function wb(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function Sa(t,e={}){if(Array.isArray(t))return Sa(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?Sa({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return Sa(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Ac(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?Sa({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}function Zv(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=Un(),f=n||a.annotation,p=ni(S=>f?S.iiif.entities.Annotation[f]:void 0,[f]),g=ni(S=>p&&p.body?p.body.map(m=>m?m.type==="SpecificResource"?{...m,source:u.get(m)}:m?S.iiif.entities[m.type][m.id]:null:null).filter(Boolean):[],[p]);return T.useMemo(()=>{if(!p)return;const S={...p,body:g,target:Sa(p.target,{typeMap:u.getState().iiif.mapping})};return i?i(S):S},[p,i,g,...e])}const Cb=({id:t,style:e,className:n,interactive:i})=>{const a=Zv({id:t}),u=Cc(a,"atlas"),f=Cc(a,"html"),p=Yv(a,["atlas"]),g=Jr(),S=T.useMemo(()=>NM(e,u),[e,u]);return g&&a&&a.target&&a.target.selector&&a.target.selector.type==="BoxSelector"&&a.target.source&&(a.target.source.id===g.id||a.target.source===g.id)?oe.jsx(kM,{id:a.id,isEditing:!0,region:a.target.selector.spatial,style:S,className:(f==null?void 0:f.className)||n,interactive:!!(f!=null&&f.href||i),href:(f==null?void 0:f.href)||null,title:(f==null?void 0:f.title)||null,hrefTarget:(f==null?void 0:f.target)||null,onClick:()=>{},...p}):null};function Tb(t={},e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.annotationPage,f=ni(p=>u?p.iiif.entities.AnnotationPage[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,...e])}const Jv=({className:t,page:e})=>{var u;const n=Tb({id:e.id})||e,i=Cc(n,"atlas"),a=Cc(n,"html");return ni(f=>n.id?f.iiif.entities.AnnotationPage[n.id]:null,[]),oe.jsx(T.Fragment,{children:(u=n.items)==null?void 0:u.map(f=>oe.jsx(Cb,{id:f.id,style:i,className:(a==null?void 0:a.className)||t},f.id))})};function Rb({id:t,image:e,thumbnail:n,isStatic:i,x:a=0,y:u=0,children:f,selector:p,onClick:g,enableSizes:S}){var x,R;const m=T.useMemo(()=>{if(!(!p||p.spatial.x===0&&p.spatial.y===0))return p.spatial},[p]);return oe.jsx("world-object",{x:a+e.target.spatial.x,y:u+e.target.spatial.y,width:e.target.spatial.width,height:e.target.spatial.height,onClick:g,children:e.service?oe.jsxs(T.Fragment,{children:[oe.jsx(IM,{tiles:{id:e.service.id||e.service["@id"]||"unknown",height:e.height,width:e.width,imageService:e.service,thumbnail:n&&n.type==="fixed"?n:void 0},enableSizes:S,x:0,y:0,width:(x=e.target)==null?void 0:x.spatial.width,height:(R=e.target)==null?void 0:R.spatial.height,crop:m}),f]},"service"):oe.jsxs(T.Fragment,{children:[oe.jsx("world-image",{onClick:g,uri:e.id,target:{x:0,y:0,width:e.target.spatial.width,height:e.target.spatial.height},display:e.width&&e.height?{width:e.width,height:e.height}:void 0,crop:m}),f]},"no-service")},t+(e.service?"server":"no-service"))}var VL=Object.defineProperty,$L=(t,e,n)=>e in t?VL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hd=(t,e,n)=>($L(t,typeof e!="symbol"?e+"":e,n),n),WL=function(){function t(e,n){var i=[],a=!0,u=!1,f=void 0;try{for(var p=e[Symbol.iterator](),g;!(a=(g=p.next()).done)&&(i.push(g.value),!(n&&i.length===n));a=!0);}catch(S){u=!0,f=S}finally{try{!a&&p.return&&p.return()}finally{if(u)throw f}}return i}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Mc=Math.PI*2,em=function(t,e,n,i,a,u,f){var p=t.x,g=t.y;p*=e,g*=n;var S=i*p-a*g,m=a*p+i*g;return{x:S+u,y:m+f}},qL=function(t,e){var n=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(t),a=Math.sin(t),u=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:u+f*n,y:f-u*n},{x:u,y:f}]},Ab=function(t,e,n,i){var a=t*i-e*n<0?-1:1,u=t*n+e*i;return u>1&&(u=1),u<-1&&(u=-1),a*Math.acos(u)},YL=function(t,e,n,i,a,u,f,p,g,S,m,x){var R=Math.pow(a,2),_=Math.pow(u,2),M=Math.pow(m,2),k=Math.pow(x,2),L=R*_-R*k-_*M;L<0&&(L=0),L/=R*k+_*M,L=Math.sqrt(L)*(f===p?-1:1);var P=L*a/u*x,O=L*-u/a*m,j=S*P-g*O+(t+n)/2,q=g*P+S*O+(e+i)/2,ee=(m-P)/a,H=(x-O)/u,Z=(-m-P)/a,ie=(-x-O)/u,W=Ab(1,0,ee,H),re=Ab(ee,H,Z,ie);return p===0&&re>0&&(re-=Mc),p===1&&re<0&&(re+=Mc),[j,q,W,re]},QL=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,S=t.largeArcFlag,m=S===void 0?0:S,x=t.sweepFlag,R=x===void 0?0:x,_=[];if(u===0||f===0)return[];var M=Math.sin(g*Mc/360),k=Math.cos(g*Mc/360),L=k*(e-i)/2+M*(n-a)/2,P=-M*(e-i)/2+k*(n-a)/2;if(L===0&&P===0)return[];u=Math.abs(u),f=Math.abs(f);var O=Math.pow(L,2)/Math.pow(u,2)+Math.pow(P,2)/Math.pow(f,2);O>1&&(u*=Math.sqrt(O),f*=Math.sqrt(O));var j=YL(e,n,i,a,u,f,m,R,M,k,L,P),q=WL(j,4),ee=q[0],H=q[1],Z=q[2],ie=q[3],W=Math.abs(ie)/(Mc/4);Math.abs(1-W)<1e-7&&(W=1);var re=Math.max(Math.ceil(W),1);ie/=re;for(var ge=0;ge<re;ge++)_.push(qL(Z,ie)),Z+=ie;return _.map(function(be){var Ee=em(be[0],u,f,k,M,ee,H),Ue=Ee.x,je=Ee.y,Xe=em(be[1],u,f,k,M,ee,H),ce=Xe.x,me=Xe.y,tt=em(be[2],u,f,k,M,ee,H),mt=tt.x,he=tt.y;return{x1:Ue,y1:je,x2:ce,y2:me,x:mt,y:he}})},GL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var XL=ZL,tm={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},KL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function ZL(t){var e=[];return t.replace(KL,function(n,i,a){var u=i.toLowerCase();for(a=eP(a),u=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),u="l",i=i=="m"?"l":"L");;){if(a.length==tm[u])return a.unshift(i),e.push(a);if(a.length<tm[u])throw new Error("malformed path data");e.push([i].concat(a.splice(0,tm[u])))}}),e}var JL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function eP(t){var e=t.match(JL);return e?e.map(Number):[]}const tP=Mb(XL);var nP=iP;function iP(t){var e=0,n=0,i=0,a=0;return t.map(function(u){u=u.slice();var f=u[0],p=f.toUpperCase();if(f!=p)switch(u[0]=p,f){case"a":u[6]+=i,u[7]+=a;break;case"v":u[1]+=a;break;case"h":u[1]+=i;break;default:for(var g=1;g<u.length;)u[g++]+=i,u[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=u[1];break;case"V":a=u[1];break;case"M":i=e=u[1],a=n=u[2];break;default:i=u[u.length-2],a=u[u.length-1]}return u})}const rP=Mb(nP);function sP(t){const e=tP(t),n=rP(e);let i,a=0,u=0,f=0,p=0,g,S,m=0,x=0;const R=[];for(let _=0;_<n.length;_++){let M=n[_];const k=M[0];switch(k){case"M":a=M[1],u=M[2];break;case"H":M=["L",M[1],u];break;case"V":M=["L",a,M[1]];break;case"S":{let L=m,P=x;(i==="C"||i=="S")&&(L+=L-f,P+=P-p),M=["C",L,P,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,S=x*2-S):(g=m,S=x),M=["Q",g,S,M[1],M[2]];break;case"Q":g=M[1],S=M[2];break;case"A":{const L=QL({px:m,py:x,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!L.length)continue;for(const[P,O]of L.entries())M=["C",O.x1,O.y1,O.x2,O.y2,O.x,O.y],P<L.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,u];break}i=k,m=M[M.length-2],x=M[M.length-1],["C","Q","A"].indexOf(k)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=x),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
319
319
  *
320
320
  * All code in this module is based on JavaScript code by Raph Levien, published on his blog at
321
321
  * https://raphlinus.github.io/.
@@ -345,7 +345,7 @@ No matching component was found for:
345
345
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
346
346
  * See the License for the specific language governing permissions and
347
347
  * limitations under the License.
348
- */function nP(t,e,n,i=1){return new Ob(t,e,n).subdivide(i)}function iP(t,e,n,i,a=1){return new nm(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function rP(t){return t.x*t.x+t.y*t.y}function Oc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Hl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Ob{constructor(e,n,i){Hd(this,"start"),Hd(this,"control"),Hd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,T=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-T));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Oc(n.x0),a=Oc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Hl(i),g=Hl(a),S=[0];for(let m=1;m<f;m++){const x=(Hl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class nm{constructor(e){Hd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Ob({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new nm(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=rP(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Oc(O.x0),q=Oc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Oc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let T=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;T+p[_].val<k;)T+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Hl(L),j=Hl(P),q=L+(P-L)*(k-T)/p[_].val,ee=(Hl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const sP=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,aP=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,_b=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Vd(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return _r(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Vd(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return _r({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Vd({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):_r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return _r({selector:a,selectors:[a],iiifRenderingHints:i})}if(cP(t)){const a=[];if(t.region){const u=Vd({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return _r({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=sP.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(aP);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),_r({selector:null,selectors:[],iiifRenderingHints:i});const x=Lb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(T=>T[0])),Math.min(...a.map(T=>T[1])),Math.max(...a.map(T=>T[0])),Math.max(...a.map(T=>T[1]))],{style:f,svg:p}=uP(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return _r({selector:S,selectors:[S],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}function oP(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Lb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Lb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=tP(i);return{element:n,points:lP(a),shapeType:oP(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function lP(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...iP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...nP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function uP(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=_b.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=_b.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function cP(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function _r(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=fP(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function fP(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function _c(t,e={}){if(Array.isArray(t))return _c(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?_c({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return _c(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Vd(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?_c({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}var dP=Object.defineProperty,hP=(t,e,n)=>e in t?dP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Pb=(t,e,n)=>(hP(t,typeof e!="symbol"?e+"":e,n),n);function pP(t){return Array.isArray(t)?t:t?[t]:[]}const Db=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function vP(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=Db.indexOf(t["@type"]);if(e!==-1)return Db[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class im{constructor(e,n={}){Pb(this,"traversals"),Pb(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new im({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(vP(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const mP="http://library.stanford.edu/iiif/image-api/compliance.html#level0",kb="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Ib="http://library.stanford.edu/iiif/image-api/compliance.html#level2",gP="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Nb="http://library.stanford.edu/iiif/image-api/conformance.html#level1",zb="http://library.stanford.edu/iiif/image-api/conformance.html#level2",yP="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Ub="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",jb="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",SP="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Fb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Bb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",bP="http://iiif.io/api/image/1/level0.json",EP="http://iiif.io/api/image/1/profiles/level0.json",Hb="http://iiif.io/api/image/1/level1.json",Vb="http://iiif.io/api/image/1/profiles/level1.json",$b="http://iiif.io/api/image/1/level2.json",Wb="http://iiif.io/api/image/1/profiles/level2.json",xP="http://iiif.io/api/image/2/level0.json",wP="http://iiif.io/api/image/2/profiles/level0.json",qb="http://iiif.io/api/image/2/level1.json",Yb="http://iiif.io/api/image/2/profiles/level1.json",Qb="http://iiif.io/api/image/2/level2.json",Gb="http://iiif.io/api/image/2/profiles/level2.json",CP="level0",Xb="level1",Kb="level2",TP="http://iiif.io/api/image/2/level0",Zb="http://iiif.io/api/image/2/level1",Jb="http://iiif.io/api/image/2/level2",RP=[Zb,Jb,kb,Ib,Nb,zb,Ub,jb,Fb,Bb,Hb,Vb,$b,Wb,qb,Yb,Qb,Gb,Xb,Kb],AP=[TP,Zb,Jb,mP,kb,Ib,gP,Nb,zb,yP,Ub,jb,SP,Fb,Bb,bP,EP,Hb,Vb,$b,Wb,xP,wP,qb,Yb,Qb,Gb,CP,Xb,Kb];function Ls(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const rm={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function ho(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function eE(t){if(Array.isArray(t))return eE(t.find(e=>typeof e=="string"));if(AP.indexOf(t)!==-1)return"level2";if(RP.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function MP(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function OP(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function tE(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const _P=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function sm(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=OP(i);if(u)return u}if(a){const u=MP(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&_P.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const LP=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function PP(t){const e=t.match(LP);return e?e[0]:t}function DP(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?PP(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const kP=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function IP(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),kP.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function NP(t){return t?t.map(e=>({label:ho(e.label),value:ho(e.value)})):[]}let nE=0;function iE(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(nE++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${nE}`)}function Ps(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(tE):t.motivation&&(n=tE(t.motivation)),{"@context":t["@context"]?IP(t["@context"]):void 0,id:(t["@id"]||iE(t)).trim(),type:sm(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function Ds(t){const[e,n]=DP(t.license),i=[...t.metadata?NP(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?ho(t.label):void 0,requiredStatement:t.attribution?{label:ho(rm.attributionLabel),value:ho(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?ho(t.description):void 0,thumbnail:zP(t.thumbnail)}}function zP(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function UP(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:sm(i)});return n.length?n:void 0}function ba(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:rm.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:ho(rm.providerName)}]:void 0,partOf:UP(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?pP(t.service):void 0,supplementary:n?[n]:void 0}}function jP(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function FP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function BP(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Ps(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ls({...a,...Ds(t),...ba(t),start:i,items:e,structures:t.structures})}function HP(t){return Ls({...Ps(t),...Ds(t),...ba(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:iE(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function VP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.resources&&t.resources.length?t.resources:void 0})}function $P(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function WP(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:om(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ls({...Ps(t),...Ds(t),...ba(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(am):am(t.resource)})}function am(t){const e=t;return Ls({...Ps(e),...Ds(e),...ba(e),...jP(e)})}function qP(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Ps(t),...Ds(t),items:e}}function YP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function QP(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=sm(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=eE(a)),Ls({...f,...u})}function GP(t){return Ls({...Ps(t),...Ds(t),...ba(t)})}new im({collection:[FP],manifest:[BP],canvas:[HP],annotationList:[VP],sequence:[$P],annotation:[WP],contentResource:[am],choice:[qP],range:[YP],service:[QP],layer:[GP]});function om(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[om(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(om)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var rE={exports:{}};(function(t,e){var n=Object.defineProperty,i=(u,f,p)=>f in u?n(u,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[f]=p,a=(u,f,p)=>(i(u,typeof f!="symbol"?f+"":f,p),p);(function(u,f){f(e)})(WL,function(u){const f="http://library.stanford.edu/iiif/image-api/compliance.html#level1",p="http://library.stanford.edu/iiif/image-api/compliance.html#level2",g="http://library.stanford.edu/iiif/image-api/conformance.html#level1",S="http://library.stanford.edu/iiif/image-api/conformance.html#level2",m="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",x="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",T="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",_="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",M="http://iiif.io/api/image/1/level1.json",k="http://iiif.io/api/image/1/profiles/level1.json",L="http://iiif.io/api/image/1/level2.json",P="http://iiif.io/api/image/1/profiles/level2.json",O="http://iiif.io/api/image/2/level1.json",j="http://iiif.io/api/image/2/profiles/level1.json",q="http://iiif.io/api/image/2/level2.json",ee="http://iiif.io/api/image/2/profiles/level2.json",H="level1",Z="level2",ie="http://iiif.io/api/image/2/level1",W="http://iiif.io/api/image/2/level2",re=[ie,W,f,p,g,S,m,x,T,_,M,k,L,P,O,j,q,ee,H,Z],ge=["http://iiif.io/api/image/2/level0",ie,W,"http://library.stanford.edu/iiif/image-api/compliance.html#level0",f,p,"http://library.stanford.edu/iiif/image-api/conformance.html#level0",g,S,"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",m,x,"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",T,_,"http://iiif.io/api/image/1/level0.json","http://iiif.io/api/image/1/profiles/level0.json",M,k,L,P,"http://iiif.io/api/image/2/level0.json","http://iiif.io/api/image/2/profiles/level0.json",O,j,q,ee,"level0",H,Z],be=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];class Ee{constructor(I,G={}){a(this,"traversals"),a(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...I},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...G}}static all(I){return new Ee({collection:[I],manifest:[I],canvas:[I],annotationList:[I],sequence:[I],annotation:[I],contentResource:[I],choice:[I],range:[I],service:[I],layer:[I]})}traverseCollection(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(I))),this.traversals.collection)}traverseCollectionItems(I){if(this.options.mergeMemberProperties){const G=[...(I.manifests||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Manifest"}:Se),...(I.collections||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Collection"}:Se),...I.members||[]];delete I.collections,delete I.manifests,I.members=G}return I.manifests&&(I.manifests=I.manifests.map(G=>this.traverseManifest(typeof G=="string"?{"@id":G,"@type":"sc:Manifest"}:G))),I.collections&&(I.collections=I.collections.map(G=>this.traverseCollection(typeof G=="string"?{"@id":G,"@type":"sc:Collection"}:G))),I.members&&(I.members=I.members.map(G=>typeof G=="string"?G:this.traverseUnknown(G))),I}traverseManifest(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(I))),this.traversals.manifest)}traverseManifestItems(I){return I.sequences&&(I.sequences=I.sequences.map(G=>this.traverseSequence(G))),I.structures&&(I.structures=I.structures.map(G=>this.traverseRange(G))),I}traverseSequence(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(I))),this.traversals.sequence)}traverseSequenceItems(I){return I.canvases&&(I.canvases=I.canvases.map(G=>this.traverseCanvas(G))),I}traverseCanvas(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(I))),this.traversals.canvas)}traverseCanvasItems(I){return I.images&&(I.images=I.images.map(G=>this.traverseAnnotation(G))),I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseRange(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(I))),this.traversals.range)}traverseRangeItems(I){if(this.options.mergeMemberProperties){const G=[...(I.ranges||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Range"}:Se),...(I.canvases||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Canvas"}:Se),...I.members||[]];delete I.ranges,delete I.canvases,I.members=G.length?G.map(Se=>this.traverseUnknown(Se)):void 0}return I}traverseAnnotationList(I){const G=typeof I=="string"?{"@id":I,"@type":"sc:AnnotationList"}:I;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(G)),this.traversals.annotationList)}traverseAnnotationListItems(I){return I.resources&&(I.resources=I.resources.map(G=>this.traverseAnnotation(G))),I}traverseAnnotation(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(I))),this.traversals.annotation)}traverseAnnotationItems(I){return I.resource&&(Array.isArray(I.resource)?I.resource=I.resource.map(G=>this.traverseContentResource(G)):I.resource=this.traverseContentResource(I.resource)),I.on,I}traverseLayer(I){return this.traverseType(this.traverseLinking(this.traverseLayerItems(I)),this.traversals.layer)}traverseLayerItems(I){return I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseChoice(I){return this.traverseType(this.traverseChoiceItems(I),this.traversals.choice)}traverseChoiceItems(I){return I.default&&I.default!=="rdf:nil"&&(I.default=this.traverseContentResource(I.default)),I.item&&I.item!=="rdf:nil"&&(I.item=I.item.map(G=>this.traverseContentResource(G))),I}traverseService(I){return this.traverseType(this.traverseLinking(I),this.traversals.service)}traverseContentResource(I){return I["@type"]==="oa:Choice"?this.traverseChoice(I):this.traverseType(this.traverseDescriptive(this.traverseLinking(I)),this.traversals.contentResource)}traverseUnknown(I){if(!I["@type"]||typeof I=="string")return I;switch(function(G){if(G==null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(G))throw new Error("Array is not a valid entity");if(typeof G!="object")throw new Error(typeof G+" is not a valid entity");if(typeof G["@type"]=="string"){const Se=be.indexOf(G["@type"]);if(Se!==-1)return be[Se]}if(G.profile)return"Service";if(G.format||G["@type"])return"ContentResource";throw new Error("Resource type is not known")}(I)){case"sc:Collection":return this.traverseCollection(I);case"sc:Manifest":return this.traverseManifest(I);case"sc:Canvas":return this.traverseCanvas(I);case"sc:Sequence":return this.traverseSequence(I);case"sc:Range":return this.traverseRange(I);case"oa:Annotation":return this.traverseAnnotation(I);case"sc:AnnotationList":return this.traverseAnnotationList(I);case"sc:Layer":return this.traverseLayer(I);case"Service":return this.traverseService(I);case"oa:Choice":return this.traverseChoice(I);case"ContentResource":return this.traverseContentResource(I)}return I.profile?this.traverseService(I):I}traverseImageResource(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)typeof We=="string"?ut.push(this.traverseContentResource({"@id":We,"@type":"dctypes:Image"})):ut.push(this.traverseContentResource(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseDescriptive(I){return I.thumbnail&&(I.thumbnail=this.traverseImageResource(I.thumbnail)),I.logo&&(I.logo=this.traverseImageResource(I.logo)),I}traverseOneOrMoreServices(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)ut.push(this.traverseService(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseLinking(I){return I.related&&(I.related=this.traverseOneOrManyType(I.related,this.traversals.contentResource)),I.rendering&&(I.rendering=this.traverseOneOrManyType(I.rendering,this.traversals.contentResource)),I.service&&(I.service=this.traverseOneOrMoreServices(I.service)),I.seeAlso&&(I.seeAlso=this.traverseOneOrManyType(I.seeAlso,this.traversals.contentResource)),I.within&&(typeof I.within=="string"||(I.within=this.traverseOneOrManyType(I.within,this.traversals.contentResource))),I.startCanvas&&(typeof I.startCanvas=="string"?I.startCanvas=this.traverseType({"@id":I.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):I.startCanvas&&this.traverseType(I.startCanvas,this.traversals.canvas)),I.contentLayer&&(typeof I.contentLayer=="string"?I.contentLayer=this.traverseLayer({"@id":I.contentLayer,"@type":"sc:Layer"}):I.contentLayer=this.traverseLayer(I.contentLayer)),I}traverseOneOrManyType(I,G){if(!Array.isArray(I)){if(!this.options.convertPropsToArray)return this.traverseType(I,G);I=[I]}return I.map(Se=>this.traverseType(Se,G))}traverseType(I,G){return G.reduce((Se,ut)=>{const We=ut(Se);return We!==void 0||this.options.allowUndefinedReturn?We:Se},I)}}function Ue(U){for(const I in U)U[I]!==void 0&&U[I]!==null||delete U[I];return U}const je="Attribution",Xe="http://example.org/provider",ce="Unknown";function me(U,I="none"){if(!U)return{};const G=Array.isArray(U)?U:[U],Se={};for(const ut of G){if(typeof ut=="string"){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut||"");continue}if(!ut["@language"]){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut["@value"]||"");continue}const We=ut["@language"];Se[We]=Se[We]?Se[We]:[],Se[We].push(ut["@value"]||"")}return Se}function tt(U){return Array.isArray(U)?tt(U.find(I=>typeof I=="string")):ge.indexOf(U)!==-1?"level2":re.indexOf(U)!==-1?"level1":typeof U=="string"?U:void 0}function mt(U){for(const I of["sc","oa","dcterms","dctypes","iiif"])if(U.startsWith(`${I}:`))return U.slice(I.length+1);return U}const he=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Fe(U){const I=U["@id"]||U.id;let G=U["@type"]||U.type;const Se=U.profile||void 0,ut=U["@context"]||void 0;if(Se){const We=function(Sn){switch(Sn){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}(Se);if(We)return We}if(ut){const We=function(Sn){const ji=Array.isArray(Sn)?Sn:[Sn];for(const xe of ji)switch(xe){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}(ut);if(We)return We}if(G){if(Array.isArray(G)){if(G.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(G.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";G=G[0]}for(const We of["sc","oa","dcterms","dctypes","iiif"])if(G.startsWith(`${We}:`)){G=G.slice(We.length+1);break}switch(G){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(G&&he.indexOf(G)!==-1)return G;if(U.format){if(U.format.startsWith("image/"))return"Image";if(U.format.startsWith("text/")||U.format==="application/pdf")return"Text";if(U.format.startsWith("application/"))return"Dataset"}return I&&(I.endsWith(".jpg")||I.endsWith(".png")||I.endsWith(".jpeg"))?"Image":G||"unknown"}const $e=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function ht(U){const I=U.match($e);return I?I[0]:U}const gt=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function gn(U){if(U){const I=Array.isArray(U)?U:[U],G=[];for(const Se of I)Se==="http://iiif.io/api/presentation/2/context.json"&&G.push("http://iiif.io/api/presentation/3/context.json"),gt.indexOf(Se)===-1&&G.push(Se);if(I.length)return G.length===1?G[0]:G}}let Xt=0;function yt(U,I){const G=encodeURI(U.id||U["@id"]||"").trim();return G&&I?`${G}/${I}`:G||(Xt++,`http://example.org/${U["@type"]}${I?`/${I}`:""}/${Xt}`)}function Be(U){const I=[...U.behavior||[]];let G;return U.viewingHint&&I.push(U.viewingHint),Array.isArray(U.motivation)?G=U.motivation.map(mt):U.motivation&&(G=mt(U.motivation)),{"@context":U["@context"]?gn(U["@context"]):void 0,id:(U["@id"]||yt(U)).trim(),type:Fe(U),behavior:I.length?I:void 0,height:U.height?U.height:void 0,width:U.width?U.width:void 0,motivation:G,viewingDirection:U.viewingDirection,profile:U.profile,format:U.format?U.format:void 0,duration:void 0,timeMode:void 0}}function nt(U){const[I,G]=function(We,Sn="Rights/License",ji="none"){let xe=null;const ct=[],pi=Array.isArray(We)?We:[We];for(const Pt of pi){const it=Pt?ht(Pt):void 0;!it||it.indexOf("creativecommons.org")===-1&&it.indexOf("rightsstatements.org")===-1?it&&ct.push({label:{[ji]:[Sn]},value:{[ji]:[it]}}):xe=it.startsWith("https://")?`http://${it.slice(8)}`:it}return[xe,ct]}(U.license),Se=[...U.metadata?(ut=U.metadata,ut?ut.map(We=>({label:me(We.label),value:me(We.value)})):[]):[],...G];var ut;return{rights:I,metadata:Se.length?Se:void 0,label:U.label?me(U.label):void 0,requiredStatement:U.attribution?{label:me(je),value:me(U.attribution)}:void 0,navDate:U.navDate,summary:U.description?me(U.description):void 0,thumbnail:ot(U.thumbnail)}}function ot(U){return U&&(Array.isArray(U)?U:[U]).map(I=>typeof I=="string"?{id:I,type:"Image"}:(I.type==="unknown"&&(I.type="Image"),I))}function lt(U){if(!U.within)return;const I=Array.isArray(U.within)?U.within:[U.within],G=[];for(const Se of I)typeof Se=="string"?Se&&U["@type"]==="sc:Manifest"&&G.push({id:Se,type:"Collection"}):Se["@id"]&&G.push({id:Se["@id"],type:Fe(Se)});return G.length?G:void 0}function Et(U){const I=U.related?Array.isArray(U.related)?U.related:[U.related]:[],G=U.contentLayer;return{provider:U.logo||I.length?[{id:Xe,type:"Agent",homepage:I.length?[I[0]]:void 0,logo:U.logo?Array.isArray(U.logo)?U.logo:[U.logo]:void 0,label:me(ce)}]:void 0,partOf:lt(U),rendering:U.rendering,seeAlso:U.seeAlso,start:U.startCanvas,service:U.service?(Se=U.service,Array.isArray(Se)?Se:Se?[Se]:[]):void 0,supplementary:G?[G]:void 0};var Se}function wt(U){const I=U;return Ue({...Be(I),...nt(I),...Et(I),...(G=I,{chars:G.chars,format:G.format?G.format:void 0,language:G.language})});var G}const yn=new Ee({collection:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],manifest:[function(U){const I=[],G=[];let Se;for(const We of U.sequences||[])We.canvases.length&&I.push(...We.canvases),We.behavior&&G.push(...We.behavior),We.startCanvas&&(Se=We.startCanvas);const ut=Be(U);return G.length&&(ut.behavior?ut.behavior.push(...G):ut.behavior=G),Ue({...ut,...nt(U),...Et(U),start:Se,items:I,structures:U.structures})}],canvas:[function(U){return Ue({...Be(U),...nt(U),...Et(U),annotations:U.otherContent&&U.otherContent.length?U.otherContent:void 0,items:U.images&&U.images.length?[{id:yt(U,"annotation-page"),type:"AnnotationPage",items:U.images}]:void 0})}],annotationList:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.resources&&U.resources.length?U.resources:void 0})}],sequence:[function(U){return U.canvases&&U.canvases.length!==0?{canvases:U.canvases,behavior:U.viewingHint?[U.viewingHint]:[],startCanvas:U.startCanvas}:{canvases:[],behavior:[]}}],annotation:[function(U){return Ue({...Be(U),...nt(U),...Et(U),target:function I(G){if(Array.isArray(G)){if(G.length>1)return{type:"List",items:G.map(I)};G=G[0]}if(typeof G=="string")return encodeURI(G).trim();if("@type"in G){let Se;if(typeof G.full=="string")Se=G.full;else if(G.full["@type"]==="dctypes:Image")Se={id:G.full["@id"],type:"Image"};else{if(G.full["@type"]!=="sc:Canvas")throw new Error(`Unsupported source type on annotation: ${G.full["@type"]}`);Se={id:G.full["@id"],type:"Canvas"}}return{type:"SpecificResource",source:Se,selector:Kt(G.selector)}}return encodeURI(G["@id"]).trim()}(U.on),body:Array.isArray(U.resource)?U.resource.map(wt):wt(U.resource)})}],contentResource:[wt],choice:[function(U){const I=[];return U.default&&U.default!=="rdf:nil"&&I.push(U.default),U.item&&U.item!=="rdf:nil"&&I.push(...U.item),{...Be(U),...nt(U),items:I}}],range:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],service:[function(U){const{"@id":I,"@type":G,"@context":Se,profile:ut,...We}=U,Sn={};return I&&(Sn["@id"]=I),Sn["@type"]=Fe(U),Sn["@type"]==="unknown"&&(Se&&Se.length&&(Sn["@context"]=Se),Sn["@type"]="Service"),ut&&(Sn.profile=tt(ut)),Ue({...Sn,...We})}],layer:[function(U){return Ue({...Be(U),...nt(U),...Et(U)})}]});function Kt(U){if((Array.isArray(U["@type"])&&U["@type"].includes("oa:SvgSelector")||U["@type"]=="oa:SvgSelector")&&("chars"in U||"value"in U))return{type:"SvgSelector",value:"chars"in U?U.chars:U.value};if(U["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:U.value};if(U["@type"]==="oa:Choice")return[Kt(U.default),...(Array.isArray(U.item)?U.item:[U.item]).map(Kt)];if(U["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in U?U.region:void 0,rotation:"rotation"in U?U.rotation:void 0};throw new Error(`Unsupported selector type: ${U["@type"]}`)}const tr=function(U){return U&&U["@context"]&&(U["@context"]==="http://iiif.io/api/presentation/2/context.json"||U["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||U["@context"]==="http://www.shared-canvas.org/ns/context.json")||U["@context"]==="http://iiif.io/api/image/2/context.json"?yn.traverseUnknown(U):U};u.upgrade=tr,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})})(rE,rE.exports);function XP(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}function lm(t,e){const{selector:n,source:i}=_c(e);if(i.id!==t.id)return[null,i];const a={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}};return[n?n.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:n.temporal,spatial:a.spatial}:n:null,i]}const sE={makeChoice:()=>{}},$d={type:"unknown"},Pn=t=>({type:"unknown",reason:t,annotations:{pages:[]}}),aE=(t,e)=>({type:"empty",width:t,height:e,annotations:{pages:[]},image:null,images:[]});function KP(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function ZP(t,e){return ni(n=>{const i=[];if(!t)return i;const a=Object.keys(n.iiif.entities.AnnotationPage);for(const u of a)if(!e||e.indexOf(u)!==-1){const f=KP(n,u);f&&f.views&&f.views[t]&&i.push(u)}return i},[t,e])}function oE({canvas:t,manifest:e,all:n,canvases:i}){const a=[];if(e)for(const u of e.annotations)a.indexOf(u.id)===-1&&a.push(u.id);if(n){if(i&&i.length)for(const u of i)for(const f of u.annotations)a.indexOf(f.id)===-1&&a.push(f.id)}else if(t)for(const u of t.annotations)a.indexOf(u.id)===-1&&a.push(u.id);return a}function JP(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function lE(t,e={}){const n=Un(),i=ya(),a=Jr(),u=Hv(),f=R.useMemo(()=>oE({all:e.all,manifest:i,canvas:a,canvases:u}),[e.all,a,u,i]),p=ZP(t,e.all?void 0:f),g=R.useCallback(m=>{t&&n.setMetaValue([m,"annotationPageManager","views"],x=>x&&!x[t]?x:{...x||{},[t]:!1})},[t,n]),S=R.useCallback((m,x={})=>{if(!t)return;const T=n.getState(),_=[];if(x!=null&&x.deselectOthers){const M=Object.keys(T.iiif.entities.AnnotationPage);for(const k of M){const L=JP(T,k);L&&L.views&&L.views[t]&&_.push(k)}}for(const M of _)g(M);n.setMetaValue([m,"annotationPageManager","views"],M=>M&&M[t]?M:{...M||{},[t]:!0})},[t,g,n]);return{availablePageIds:f,enabledPageIds:p,setPageEnabled:S,setPageDisabled:g}}function uE(t,e){return ni((n,i)=>i.get(t.map(a=>({id:a,type:e}))),[t,e])}const cE=R.createContext(new Ka.ImageServiceLoader);function Wd(){return R.useContext(cE)}function fE(){const t=Wd(),[e,n]=R.useState({}),i=R.useRef(!1);return R.useEffect(()=>()=>{i.current=!0},[]),[R.useCallback((u,{height:f,width:p})=>{if(u){const g=u.id||u["@id"],S=t.loadServiceSync({id:g,width:u.width||p,height:u.height||f,source:u});S?u=S:e[g]||(i.current||n(m=>({...m,[g]:"loading"})),t.loadService({id:g,width:u.width||p,height:u.height||f}).then(()=>{i.current||n(m=>({...m,[g]:"done"}))}))}return u},[t,e]),e]}function qd(t={}){const e=Zv(),n=Jr(t.canvasId?{id:t.canvasId}:void 0);return ni((i,a)=>{if(!n)return[];if(e&&t.enableSingleAnnotation)return[e];const u=a.get(n.items),f=[];for(const p of u)f.push(...a.get(p.items));return f},[n])}function eD(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}const Yd={},dE={get(t){return t},setMetaValue([t,e,n],i){const a=dE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Yd[t]={...Yd[t]||{},[e]:{...(Yd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Yd[t];if(n)return e?n[e]:n}};function tD(t=dE){function e(a){const u=a?typeof a=="string"?t.get(a):a:null;if(!u)return[];const f=t.get(u.items,{parent:u}),p=[];for(const g of f)p.push(...t.get(g.items,{parent:g}));return p}function n(a,u=[]){const f=Array.isArray(a)?a:e(a),p=[];let g=null;const S=[];for(const m of f){if(m.type!=="Annotation")throw new Error("getPaintables() accept either a canvas or list of annotations");const x=Array.from(Array.isArray(m.body)?m.body:[m.body]);for(const T of x){const[_,{selector:M}]=eD(T),k=t.get(_),L=(k.type||"unknown").toLowerCase();if(L==="choice"){const P=t.get(k.items,{parent:k.id}),O=u.length?u.map(j=>P.find(q=>q.id===j)).filter(Boolean):[P[0]];O.length===0&&O.push(P[0]),g={type:"single-choice",items:P.map(j=>({id:j.id,label:j.label,selected:O.indexOf(j)!==-1})),label:_.label},x.push(...O);continue}p.indexOf(L)===-1&&p.push(L),S.push({type:L,annotationId:m.id,resource:k,target:m.target,selector:M})}}return{types:p,items:S,choice:g}}function i(a){const{choice:u}=n(a);return u}return{getAllPaintingAnnotations:e,getPaintables:n,extractChoices:i}}function hE(t,e=[]){const n=Un(),i=R.useMemo(()=>tD(n),[]),a=qd({enableSingleAnnotation:t==null?void 0:t.enableSingleAnnotation}),[u,f]=R.useState((t==null?void 0:t.defaultChoices)||[]),p=R.useMemo(()=>i.getPaintables(a,u),[n,a,u,...e]),S={makeChoice:R.useCallback((m,{deselectOthers:x=!0,deselect:T=!1}={})=>{if(p.choice){if(p.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");f(_=>{if(T){const k=_.filter(L=>L!==m);if(k.length===0){const L=p.items[0].resource.id;return L?[L]:[]}return k}if(x)return[m];const M=[..._];if(M.length===0&&p.items.length){const k=p.items[0].resource.id;k&&M.push(k)}return _.indexOf(m)!==-1?_:[..._,m]})}},[p.choice])};return[p,S]}function pE(t,e,n){const i=[];for(const a of e.items){const u=a.resource&&a.resource.type==="SpecificResource"?a.resource.source:a.resource;if(!u.id)return Pn("No resource Identifier");let f;if(u.service){const _=Ka.getImageServices(u);_[0]&&(f=n(_[0],t))}const p={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}},[g,S]=lm(t,a.target);if(S.id!==t.id)continue;a.resource.width&&a.resource.height&&(a.resource.width,a.resource.height);let m=a.resource.type==="SpecificResource"?Sa(a.resource):null;if(a.selector){const _=Sa({type:"SpecificResource",source:a.resource,selector:a.selector});_&&(m=_)}const x=m&&m.selector&&(m.selector.type==="BoxSelector"||m.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:m.selector.spatial.x,y:m.selector.spatial.y,width:m.selector.spatial.width,height:m.selector.spatial.height}}:void 0;f&&!f.id&&(f.id=f["@id"]);const T={id:u.id,type:"Image",annotationId:a.annotationId,width:Number(g||x?u.width:t.width),height:Number(g||x?u.height:t.height),service:f,sizes:f&&f.sizes?f.sizes:u.width&&u.height?[{width:u.width,height:u.height}]:[],target:g&&g.type!=="PointSelector"?g:p,selector:x};i.push(T)}return{type:"images",image:i[0],images:i,choice:e.choice}}const nD=["model/gltf-binary"];function iD(t,e){const i=e.items[0].resource;return i.format?nD.indexOf(i.format)===-1?Pn(`3D format: ${i.format} is unsupported`):{type:"3d-model",model:i}:Pn("Unknown format")}function rD(t,e){var i;if(!t.duration)return Pn("No duration on canvas");if(e.items.length>1)return Pn("Only one audio source supported");const n=(i=e.items[0])==null?void 0:i.resource;return n?n.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:t.duration,url:n.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:n.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}},annotations:{pages:[]}}:Pn("Audio does not have format"):Pn("Unknown audio")}const sD=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;function aD(t,e){var f;const n=e.items.filter(p=>p.type==="video");if(!t.duration)return Pn("No duration on canvas");if(n.length>1)return Pn("Only one video source supported");const i=(f=n[0])==null?void 0:f.resource,a=!!(i.service||[]).find(p=>(p.profile||"").includes("youtube.com"));if(!i)return Pn("Unknown video");if((!i.format||i.format==="text/html")&&!a)return Pn("Video does not have format");const u={annotationId:e.items[0].annotationId,duration:t.duration,url:i.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:i.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}};if(a){u.type="VideoYouTube";const p=i.id.match(sD);if(!p[1])return Pn("Video is not known youtube video");u.youTubeId=p[1]}return{type:"media",media:u,annotations:{pages:[]}}}function vE(t,e={},n){const i=t.language||n||"none";switch(t.type){case"TextualBody":{typeof t.value<"u"&&(e[i]=t.value);break}case"List":case"Composite":case"Choice":t.items&&t.items.forEach(a=>vE(a,e,i))}return e}function oD(t,e){const n=[];return e.items.forEach(i=>{if(i.resource){const[a]=lm(t,i.target);n.push({annotationId:i.annotationId,text:vE(i.resource),target:a})}}),{type:"textual-content",items:n}}function mE(t){const e=ya(),n=Jr(),i=Un(),[a,u]=fE(),{enabledPageIds:f}=lE((t==null?void 0:t.annotationPageManagerId)||(e==null?void 0:e.id)||(n==null?void 0:n.id),{all:!1}),p=uE(f,"AnnotationPage"),g=(t==null?void 0:t.strategies)||["empty","images","media","textual-content","complex-timeline"],[S,m]=hE(t,[u]),x=R.useMemo(()=>{if(!n)return console.log("No canvas"),$d;if(S.types.length===0)return g.indexOf("empty")!==-1?aE(n.width,n.height):(console.log("No paintables"),$d);if(S.types.length!==1)if(S.types.length===2&&S.types.indexOf("text")!==-1)S.types=S.types.filter(_=>_!=="text");else return g.indexOf("complex-timeline")===-1?Pn("Complex timeline not supported"):Pn("ComplexTimelineStrategy not yet supported");const T=S.types[0];return T==="image"?g.indexOf("images")===-1?Pn("Image not supported"):pE(n,S,a):T==="Model"||T==="model"?g.indexOf("3d-model")===-1?Pn("3D not supported"):iD(n,S):T==="textualbody"?g.indexOf("textual-content")===-1?Pn("Textual content not supported"):oD(n,S):T==="sound"||T==="audio"?g.indexOf("media")===-1?Pn("Media not supported"):rD(n,S):T==="video"?g.indexOf("media")===-1?Pn("Media not supported"):aD(n,S):(console.log("No idea"),$d)},[n,S,i,m.makeChoice]);return R.useMemo(()=>x.type==="unknown"?[x,sE]:[{...x,annotations:{pages:p}},m],[x,p])}const gE=(t,e=[])=>{const n=Un();R.useEffect(()=>{t(n)},[n,...e])},Qd={},yE={get(t){return t},setMetaValue([t,e,n],i){const a=yE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Qd[t]={...Qd[t]||{},[e]:{...(Qd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Qd[t];if(n)return e?n[e]:n}},lD=new Ka.ImageServiceLoader;function uD(t=yE,e={}){const n=e.imageServiceLoader||lD;async function i(a,u,f=!1,p=[],g){const S=()=>n.getThumbnailFromResource(void 0,u,f,p);if(!a)return await n.getThumbnailFromResource(void 0,u,f,p);if(typeof a=="string"){const x=Ka.getFixedSizeFromImage(a);return x&&p.push(x),await n.getThumbnailFromResource(void 0,u,f,p)}const m=t.get(a,{skipSelfReturn:!1});if(typeof m=="string")return{best:Ka.getFixedSizeFromImage(m),fallback:[],log:[]};if(!m)return await S();switch(await(async x=>{if(x&&x.thumbnail&&x.thumbnail.length){const T=t.get(x.thumbnail[0]),_=await n.getImageCandidates(T,f);_&&_.length&&p.push(..._)}})(m),m.type){case"Annotation":{const x=Array.isArray(m.body)?m.body:[m.body],T=t.get(x[0]);return g&&!T.width&&(T.width=g.width,T.height=g.height),await n.getThumbnailFromResource(T,u,f,p)}case"Canvas":{const x=m;return i(x.items[0],u,f,p,{width:x.width,height:x.height})}case"AnnotationPage":return i(m.items[0],u,f,p,g);case"Choice":{const x=m;return!x.items||x.items[0]?await S():i(x.items[0],u,f,p,g)}case"Collection":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"Manifest":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!m.width&&(m.width=g.width,m.height=g.height),n.getThumbnailFromResource(m,u,f,p)}return await S()}return{getBestThumbnailAtSize:i}}function SE(t,e,{canvasId:n,manifestId:i}={}){const a=Un(),u=Wd(),f=R.useMemo(()=>uD(a,{imageServiceLoader:u}),[a,u]),[p,g]=R.useState(),S=ya(i?{id:i}:void 0),m=Jr(n?{id:n}:void 0),x=m||S,T=R.useRef(!1);if(R.useEffect(()=>(T.current=!1,()=>{T.current=!0}),[]),!x)throw new Error("Must be called under a manifest or canvas context.");return gE(_=>{f.getBestThumbnailAtSize(x,t,e).then(M=>{M.best&&!T.current&&g(M.best)})},[x]),p}function cD(t){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:t}}function fD(t,e){switch(e.type){case"FINISHED":return{...t,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...t,isFinished:!1,isPlaying:!t.isPlaying};case"PLAY_REQUESTED":return{...t,isFinished:!1,playRequested:!0};case"PAUSE":return{...t,isPlaying:!1};case"PLAY":return{...t,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...t,isMuted:!0};case"SET_VOLUME":return{...t,volume:e.volume,isMuted:e.volume===0};case"TOGGLE_MUTE":return{...t,isMuted:!t.isMuted};case"UNMUTE":return{...t,isMuted:!1}}return t}function bE(t){const e=Math.round(t);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function Gd(t){const[e,n]=R.useReducer(fD,cD(t.duration)),i=R.useRef(null),a=R.useRef(null),u=R.useRef(null),f=R.useRef(!1),p=R.useCallback(()=>{a.current&&i.current&&(a.current.innerHTML=bE(i.current.currentTime),u.current&&(u.current.style.width=`${i.current.currentTime/t.duration*100}%`),f.current!==i.current.muted&&(f.current=i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[t.duration]),g=R.useCallback(()=>{i.current&&(n({type:"PLAY_REQUESTED"}),i.current.play().then(()=>{n({type:"PLAY"})}),p())},[p]),S=R.useCallback(()=>{i.current&&(i.current.duration>0&&i.current.paused?g():m())},[p]),m=R.useCallback(()=>{i.current&&(i.current.pause(),n({type:"PAUSE"}),p())},[p]),x=R.useCallback(()=>{i.current&&(i.current.muted=!i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),T=R.useCallback(()=>{i.current&&(i.current.muted=!0,n({type:"MUTE"}))},[]),_=R.useCallback(()=>{i.current&&(i.current.muted=!1,n({type:"UNMUTE"}))},[]),M=R.useCallback(P=>{i.current&&(i.current.muted=!1,i.current.volume=P/100,n({type:"SET_VOLUME",volume:P}))},[]),k=R.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P*t.duration,t.duration)),p())},[]),L=R.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P,t.duration)),p())},[]);return R.useEffect(()=>{const P=setInterval(()=>{p()},350);return()=>clearInterval(P)},[p,t.duration]),R.useEffect(()=>{const P=()=>{n({type:"FINISHED"})},O=i.current;return O==null||O.addEventListener("ended",P),()=>O==null?void 0:O.removeEventListener("ended",P)},[]),[{element:i,currentTime:a,progress:u},e,{play:g,pause:m,playPause:S,mute:T,unmute:_,toggleMute:x,setVolume:M,setDurationPercent:k,setTime:L}]}const EE=R.createContext(null),xE=R.createContext(null),wE=R.createContext(null);function dD(){const t=R.useContext(EE);if(!t)throw new Error("Ctx not found");return t}function hD(){const t=R.useContext(xE);if(!t)throw new Error("Ctx not found");return t}function pD(){const t=R.useContext(wE);if(!t)throw new Error("Ctx not found");return t}function um({actions:t,state:e,children:n,currentTime:i,progress:a,element:u}){return oe.jsx(wE.Provider,{value:{currentTime:i,progress:a,element:u},children:oe.jsx(xE.Provider,{value:t,children:oe.jsx(EE.Provider,{value:e,children:n})})})}function CE({media:t,children:e}){const[{element:n,currentTime:i,progress:a},u,f]=Gd({duration:t.duration});return oe.jsxs(um,{state:u,actions:f,currentTime:i,progress:a,element:n,children:[oe.jsx("audio",{ref:n,src:t.url}),e]})}function TE({media:t,mediaControlsDeps:e,children:n}){return Fl("portal","audio",CE,{media:t,children:n},[t,...e||[]]),null}function RE({element:t,media:e,playPause:n}){return oe.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[oe.jsx("style",{children:`
348
+ */function aP(t,e,n,i=1){return new Ob(t,e,n).subdivide(i)}function oP(t,e,n,i,a=1){return new nm(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function lP(t){return t.x*t.x+t.y*t.y}function Oc(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function Hl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class Ob{constructor(e,n,i){Hd(this,"start"),Hd(this,"control"),Hd(this,"end"),this.start=e,this.control=n,this.end=i}eval(e){const n=1-e;return{x:this.start.x*n*n+2*this.control.x*n*e+this.end.x*e*e,y:this.start.y*n*n+2*this.control.y*n*e+this.end.y*e*e}}mapToBasic(){const{x:e,y:n}=this.start,{x:i,y:a}=this.control,{x:u,y:f}=this.end,p=2*i-e-u,g=2*a-n-f,S=(i-e)*p+(a-n)*g,m=(u-i)*p+(f-a)*g,x=(u-e)*g-(f-n)*p,R=S/x,_=m/x,M=Math.abs(x)/(Math.hypot(p,g)*Math.abs(_-R));return{x0:e,x2:u,scale:M,cross:x}}subdivide(e){const n=this.mapToBasic(),i=Oc(n.x0),a=Oc(n.x2),u=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(u),p=Hl(i),g=Hl(a),S=[0];for(let m=1;m<f;m++){const x=(Hl(i+(a-i)*m/f)-p)/(g-p);S.push(x)}return S.push(1),S.map(m=>this.eval(m))}}class nm{constructor(e){Hd(this,"c"),this.c=e}weightsum(e,n,i,a){const u=e*this.c[0]+n*this.c[2]+i*this.c[4]+a*this.c[6],f=e*this.c[1]+n*this.c[3]+i*this.c[5]+a*this.c[7];return{x:u,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,u=3*n*e*e,f=e*e*e;return this.weightsum(i,a,u,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,u=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,u,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new Ob({x:this.c[0],y:this.c[1]},e,{x:this.c[6],y:this.c[7]})}subsegment(e,n){const i=new Float64Array(8),a=this.eval(e),u=this.eval(n);i[0]=a.x,i[1]=a.y;const f=(n-e)/3,p=this.deriv(e);i[2]=a.x+f*p.x,i[3]=a.y+f*p.y;const g=this.deriv(n);return i[4]=u.x-f*g.x,i[5]=u.y-f*g.y,i[6]=u.x,i[7]=u.y,new nm(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),u=lP(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(u/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const k=M/f,L=(M+1)/f,P=this.subsegment(k,L).midpoint_quadbez(),O=P.mapToBasic(),j=Oc(O.x0),q=Oc(O.x2),ee=Math.sqrt(O.scale);let H=Math.abs(q-j)*ee;if(Math.sign(O.x0)!=Math.sign(O.x2)){const Z=a/ee,ie=a*Math.abs(q-j)/Oc(Z);H=Math.max(H,ie)}p.push({quad:P,a0:j,a2:q,val:H}),g+=H}const S=.5*g/a,m=Math.ceil(S),x=[{x:this.c[0],y:this.c[1]}];let R=0,_=0;for(let M=1;M<m;M++){const k=g*M/m;for(;R+p[_].val<k;)R+=p[_].val,_++;const L=p[_].a0,P=p[_].a2,O=Hl(L),j=Hl(P),q=L+(P-L)*(k-R)/p[_].val,ee=(Hl(q)-O)/(j-O);x.push(p[_].quad.eval(ee))}return x.push({x:this.c[6],y:this.c[7]}),x}}const uP=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,cP=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,_b=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Vd(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return _r(t.reduce((a,u)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Vd(u,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});return f&&(a.selector||(a.selector=f),a.selectors.push(...p)),g&&(a.iiifRenderingHints=a.iiifRenderingHints||{type:"ImageApiSelector"},Object.assign(a.iiifRenderingHints,g)),a},{selector:null,selectors:[],iiifRenderingHints:i}));if(!t)return _r({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,u]=t.split("#");return u?Vd({type:"FragmentSelector",value:u},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):_r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type&&t.type==="PointSelector"&&(t.t||t.t===0)){const a={type:"TemporalSelector",temporal:{startTime:t.t}};return _r({selector:a,selectors:[a],iiifRenderingHints:i})}if(pP(t)){const a=[];if(t.region){const u=Vd({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...u.selectors)}return _r({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=uP.exec(t.value);if(a){const f={type:"BoxSelector",spatial:{unit:a[2]==="percent:"||a[2]==="pct:"?"percent":"pixel",x:parseFloat(a[3]),y:parseFloat(a[4]),width:parseFloat(a[5]),height:parseFloat(a[6])}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}const u=t.value.match(cP);if(u){const f={type:"TemporalSelector",temporal:{startTime:u[4]?parseFloat(u[4]):0,endTime:u[7]?parseFloat(u[7]):void 0}};return _r({selector:f,selectors:[f],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}if(t.type==="SvgSelector"&&"value"in t){e||(typeof window<"u"?e=new window.DOMParser:console.warn("No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."));let a=[],u,f,p=(n==null?void 0:n(t.value))??t.value,g;if(e){const m=e.parseFromString(t.value,"image/svg+xml").querySelector("svg");if(!m)return console.warn(`Illegal SVG selector: ${t.value}`),_r({selector:null,selectors:[],iiifRenderingHints:i});const x=Lb(m);x&&(a=x.points,g=x.shapeType,u=[Math.min(...a.map(R=>R[0])),Math.min(...a.map(R=>R[1])),Math.max(...a.map(R=>R[0])),Math.max(...a.map(R=>R[1]))],{style:f,svg:p}=hP(x.element)??{svg:p})}const S={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:u?{unit:"pixel",x:u[0],y:u[1],width:u[2]-u[0],height:u[3]-u[1]}:void 0};return _r({selector:S,selectors:[S],iiifRenderingHints:i})}return _r({selector:null,selectors:[],iiifRenderingHints:i})}function fP(t){const e=t.map(i=>i[0]).reduce((i,a)=>(i[a]+=1,i),{C:0,Q:0,L:0,M:0}),n=new Set(t.map(i=>i[0]));if(e.C>0||e.Q>0)return"path";if(e.L>0&&(n.size===1||n.size===2&&n.has("M"))){if(e.L===4)return"rect";const i=t.slice(-1)[0];return t[0][0]==="M"&&i[0]==="L"&&i[1]==t[0][1]&&i[2]===t[0][2]||i[1]===0&&i[2]===0?"polygon":"polyline"}return"path"}function Lb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=Lb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=sP(i);return{element:n,points:dP(a),shapeType:fP(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("r")??"0");if(!u)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+u*Math.cos(g),a+u*Math.sin(g)])}return{element:n,points:f,shapeType:"circle"}}case"ellipse":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),u=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!u&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const S=Math.tan(g/360*Math.PI),m=u*(1-S**2)/(1+S**2),x=f*2*S/(1+S**2);p.push([i+m,a+x])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),u=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===u&&a===f)continue;return{element:n,points:[[i,a],[u,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(u=>u.split(",").map(parseFloat)))??[];if(!i.length)continue;let a="polyline";return n.tagName.toLowerCase()==="polygon"&&(i.push(i[0]),a="polygon"),{element:n,points:i,shapeType:a}}case"rect":{const i=parseFloat(n.getAttribute("x")??"0"),a=parseFloat(n.getAttribute("y")??"0"),u=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!u||!f)continue;return{element:n,points:[[i,a],[i+u,a],[i+u,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function dP(t){const e=[];for(let n=0;n<t.length;n++){const i=e[e.length-1]??[0,0],a=t[n];switch(a[0]){case"M":case"L":e.push([a[1],a[2]]);continue;case"C":e.push(...oP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]},{x:a[5],y:a[6]}).map(u=>[u.x,u.y]).slice(1));continue;case"Q":e.push(...aP({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(u=>[u.x,u.y]).slice(1));continue}}return e}function hP(t){const e={};if(t.hasAttribute("fill")?(e.fill=t.getAttribute("fill"),t.removeAttribute("fill")):t.style.fill&&(e.fill=t.style.fill),e.fill){const i=_b.exec(e.fill);i&&(e.fillOpacity=parseFloat(i[4]),e.fill=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}if(t.hasAttribute("fill-opacity")?(e.fillOpacity=parseFloat(t.getAttribute("fill-opacity")),t.removeAttribute("fill-opacity")):t.style.fillOpacity&&(e.fillOpacity=parseFloat(t.style.fillOpacity)),t.hasAttribute("stroke")?(e.stroke=t.getAttribute("stroke"),t.removeAttribute("stroke")):t.style.stroke&&(e.stroke=t.style.stroke),e.stroke){const i=_b.exec(e.stroke);i&&(e.strokeOpacity=parseFloat(i[4]),e.stroke=`rgb(${i[1]}, ${i[2]}, ${i[3]})`)}t.hasAttribute("stroke-opacity")?(e.strokeOpacity=parseFloat(t.getAttribute("stroke-opacity")),t.removeAttribute("stroke-opacity")):t.style.strokeOpacity&&(e.strokeOpacity=parseFloat(t.style.strokeOpacity)),t.hasAttribute("stroke-width")?(e.strokeWidth=t.getAttribute("stroke-width"),t.removeAttribute("stroke-width")):t.style.strokeWidth&&(e.strokeWidth=t.style.strokeWidth),t.hasAttribute("stroke-dasharray")?(e.strokeDasharray=t.getAttribute("stroke-dasharray"),t.removeAttribute("stroke-dasharray")):t.style.strokeDasharray&&(e.strokeDasharray=t.style.strokeDasharray);let n=t;for(;n.tagName.toLowerCase()!=="svg";)if(n=n.parentElement,n===null)throw new Error("Could not find root SVG element");return{svg:n.outerHTML,style:Object.keys(e).length>0?e:void 0}}function pP(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function _r(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=vP(e.rotation);if(n)if(t.selectors.length)for(const i of t.selectors)i.rotation=n;else t.selectors.push({type:"RotationSelector",rotation:n})}}else delete t.iiifRenderingHints;return t}function vP(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function _c(t,e={}){if(Array.isArray(t))return _c(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?_c({type:"SpecificResource",source:{id:n,type:"Unknown"},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{id:n,type:e.typeMap&&e.typeMap[n]||"Unknown"},selector:null,selectors:[]}}if(t.type==="Choice"||t.type==="List"||t.type==="Composite"||t.type==="Independents")return _c(t.items[0]);if(t.type==="SpecificResource"){t.source.type==="Canvas"&&t.source.partOf&&typeof t.source.partOf=="string"&&(t.source.partOf=[{id:t.source.partOf,type:"Manifest"}]);const{selector:n,selectors:i}=t.selector?Vd(t.selector,e):{selector:null,selectors:[]};return{type:"SpecificResource",source:t.source,selector:n,selectors:i}}if(t.id){t.type==="Canvas"&&t.partOf&&typeof t.partOf=="string"&&(t.partOf=[{id:t.partOf,type:"Manifest"}]);const[n,i]=t.id.split("#");return i?_c({type:"SpecificResource",source:{...t,id:n},selector:{type:"FragmentSelector",value:i}}):{type:"SpecificResource",source:{...t,id:n},selector:null,selectors:[]}}return{type:"SpecificResource",source:t,selector:null,selectors:[]}}var mP=Object.defineProperty,gP=(t,e,n)=>e in t?mP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Pb=(t,e,n)=>(gP(t,typeof e!="symbol"?e+"":e,n),n);function yP(t){return Array.isArray(t)?t:t?[t]:[]}const Db=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function SP(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){const e=Db.indexOf(t["@type"]);if(e!==-1)return Db[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class im{constructor(e,n={}){Pb(this,"traversals"),Pb(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...n}}static all(e){return new im({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){const n=[...(e.manifests||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i),...(e.collections||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i),...e.members||[]];delete e.collections,delete e.manifests,e.members=n}return e.manifests&&(e.manifests=e.manifests.map(n=>this.traverseManifest(typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n))),e.collections&&(e.collections=e.collections.map(n=>this.traverseCollection(typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n))),e.members&&(e.members=e.members.map(n=>typeof n=="string"?n:this.traverseUnknown(n))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(n=>this.traverseSequence(n))),e.structures&&(e.structures=e.structures.map(n=>this.traverseRange(n))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(n=>this.traverseCanvas(n))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(n=>this.traverseAnnotation(n))),e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){const n=[...(e.ranges||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Range"}:i),...(e.canvases||[]).map(i=>typeof i=="string"?{"@id":i,"@type":"sc:Canvas"}:i),...e.members||[]];delete e.ranges,delete e.canvases,e.members=n.length?n.map(i=>this.traverseUnknown(i)):void 0}return e}traverseAnnotationList(e){const n=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(n)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(n=>this.traverseAnnotation(n))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(n=>this.traverseContentResource(n)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(n=>this.traverseAnnotationList(n))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(n=>this.traverseContentResource(n))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(SP(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)typeof u=="string"?a.push(this.traverseContentResource({"@id":u,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){const n=Array.isArray(e),i=Array.isArray(e)?e:[e],a=[];for(const u of i)a.push(this.traverseService(u));return!n&&!this.options.convertPropsToArray?a[0]:a}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,n){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,n);return e.map(i=>this.traverseType(i,n))}traverseType(e,n){return n.reduce((i,a)=>{const u=a(i);return typeof u>"u"&&!this.options.allowUndefinedReturn?i:u},e)}}const bP="http://library.stanford.edu/iiif/image-api/compliance.html#level0",kb="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Ib="http://library.stanford.edu/iiif/image-api/compliance.html#level2",EP="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Nb="http://library.stanford.edu/iiif/image-api/conformance.html#level1",zb="http://library.stanford.edu/iiif/image-api/conformance.html#level2",xP="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Ub="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",jb="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",wP="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Fb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",Bb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",CP="http://iiif.io/api/image/1/level0.json",TP="http://iiif.io/api/image/1/profiles/level0.json",Hb="http://iiif.io/api/image/1/level1.json",Vb="http://iiif.io/api/image/1/profiles/level1.json",$b="http://iiif.io/api/image/1/level2.json",Wb="http://iiif.io/api/image/1/profiles/level2.json",RP="http://iiif.io/api/image/2/level0.json",AP="http://iiif.io/api/image/2/profiles/level0.json",qb="http://iiif.io/api/image/2/level1.json",Yb="http://iiif.io/api/image/2/profiles/level1.json",Qb="http://iiif.io/api/image/2/level2.json",Gb="http://iiif.io/api/image/2/profiles/level2.json",MP="level0",Xb="level1",Kb="level2",OP="http://iiif.io/api/image/2/level0",Zb="http://iiif.io/api/image/2/level1",Jb="http://iiif.io/api/image/2/level2",_P=[Zb,Jb,kb,Ib,Nb,zb,Ub,jb,Fb,Bb,Hb,Vb,$b,Wb,qb,Yb,Qb,Gb,Xb,Kb],LP=[OP,Zb,Jb,bP,kb,Ib,EP,Nb,zb,xP,Ub,jb,wP,Fb,Bb,CP,TP,Hb,Vb,$b,Wb,RP,AP,qb,Yb,Qb,Gb,MP,Xb,Kb];function Ls(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const rm={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function ho(t,e="none"){if(!t)return{};const n=Array.isArray(t)?t:[t],i={};for(const a of n){if(typeof a=="string"){i[e]=i[e]?i[e]:[],i[e].push(a||"");continue}if(!a["@language"]){i[e]=i[e]?i[e]:[],i[e].push(a["@value"]||"");continue}const u=a["@language"];i[u]=i[u]?i[u]:[],i[u].push(a["@value"]||"")}return i}function eE(t){if(Array.isArray(t))return eE(t.find(e=>typeof e=="string"));if(LP.indexOf(t)!==-1)return"level2";if(_P.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function PP(t){const e=Array.isArray(t)?t:[t];for(const n of e)switch(n){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function DP(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function tE(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const kP=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function sm(t){const e=t["@id"]||t.id;let n=t["@type"]||t.type;const i=t.profile||void 0,a=t["@context"]||void 0;if(i){const u=DP(i);if(u)return u}if(a){const u=PP(a);if(u)return u}if(n){if(Array.isArray(n)){if(n.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(n.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";n=n[0]}for(const u of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${u}:`)){n=n.slice(u.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&kP.indexOf(n)!==-1)return n;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":n||"unknown"}const IP=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function NP(t){const e=t.match(IP);return e?e[0]:t}function zP(t,e="Rights/License",n="none"){let i=null;const a=[],u=Array.isArray(t)?t:[t];for(const f of u){const p=f?NP(f):void 0;if(p&&(p.indexOf("creativecommons.org")!==-1||p.indexOf("rightsstatements.org")!==-1)){p.startsWith("https://")?i=`http://${p.slice(8)}`:i=p;continue}p&&a.push({label:{[n]:[e]},value:{[n]:[p]}})}return[i,a]}const UP=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function jP(t){if(t){const e=Array.isArray(t)?t:[t],n=[];for(const i of e)i==="http://iiif.io/api/presentation/2/context.json"&&n.push("http://iiif.io/api/presentation/3/context.json"),UP.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function FP(t){return t?t.map(e=>({label:ho(e.label),value:ho(e.value)})):[]}let nE=0;function iE(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(nE++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${nE}`)}function Ps(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(tE):t.motivation&&(n=tE(t.motivation)),{"@context":t["@context"]?jP(t["@context"]):void 0,id:(t["@id"]||iE(t)).trim(),type:sm(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:n,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function Ds(t){const[e,n]=zP(t.license),i=[...t.metadata?FP(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?ho(t.label):void 0,requiredStatement:t.attribution?{label:ho(rm.attributionLabel),value:ho(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?ho(t.description):void 0,thumbnail:BP(t.thumbnail)}}function BP(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function HP(t){if(!t.within)return;const e=Array.isArray(t.within)?t.within:[t.within],n=[];for(const i of e)if(typeof i=="string"){if(i)switch(t["@type"]){case"sc:Manifest":n.push({id:i,type:"Collection"});break}}else i["@id"]&&n.push({id:i["@id"],type:sm(i)});return n.length?n:void 0}function ba(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:rm.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:ho(rm.providerName)}]:void 0,partOf:HP(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?yP(t.service):void 0,supplementary:n?[n]:void 0}}function VP(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function $P(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function WP(t){const e=[],n=[];let i;for(const u of t.sequences||[])u.canvases.length&&e.push(...u.canvases),u.behavior&&n.push(...u.behavior),u.startCanvas&&(i=u.startCanvas);const a=Ps(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Ls({...a,...Ds(t),...ba(t),start:i,items:e,structures:t.structures})}function qP(t){return Ls({...Ps(t),...Ds(t),...ba(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:iE(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function YP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.resources&&t.resources.length?t.resources:void 0})}function QP(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function GP(t){function e(n){if(Array.isArray(n)){if(n.length>1)return{type:"List",items:n.map(e)};n=n[0]}if(typeof n=="string")return encodeURI(n).trim();if("@type"in n){let i;if(typeof n.full=="string")i=n.full;else if(n.full["@type"]==="dctypes:Image")i={id:n.full["@id"],type:"Image"};else if(n.full["@type"]==="sc:Canvas")i={id:n.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${n.full["@type"]}`);return{type:"SpecificResource",source:i,selector:om(n.selector)}}else return encodeURI(n["@id"]).trim()}return Ls({...Ps(t),...Ds(t),...ba(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(am):am(t.resource)})}function am(t){const e=t;return Ls({...Ps(e),...Ds(e),...ba(e),...VP(e)})}function XP(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...Ps(t),...Ds(t),items:e}}function KP(t){return Ls({...Ps(t),...Ds(t),...ba(t),items:t.members})}function ZP(t){const{"@id":e,"@type":n,"@context":i,profile:a,...u}=t,f={};return e&&(f["@id"]=e),f["@type"]=sm(t),f["@type"]==="unknown"&&(i&&i.length&&(f["@context"]=i),f["@type"]="Service"),a&&(f.profile=eE(a)),Ls({...f,...u})}function JP(t){return Ls({...Ps(t),...Ds(t),...ba(t)})}new im({collection:[$P],manifest:[WP],canvas:[qP],annotationList:[YP],sequence:[QP],annotation:[GP],contentResource:[am],choice:[XP],range:[KP],service:[ZP],layer:[JP]});function om(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[om(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(om)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}var rE={exports:{}};(function(t,e){var n=Object.defineProperty,i=(u,f,p)=>f in u?n(u,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[f]=p,a=(u,f,p)=>(i(u,typeof f!="symbol"?f+"":f,p),p);(function(u,f){f(e)})(GL,function(u){const f="http://library.stanford.edu/iiif/image-api/compliance.html#level1",p="http://library.stanford.edu/iiif/image-api/compliance.html#level2",g="http://library.stanford.edu/iiif/image-api/conformance.html#level1",S="http://library.stanford.edu/iiif/image-api/conformance.html#level2",m="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",x="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",R="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",_="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",M="http://iiif.io/api/image/1/level1.json",k="http://iiif.io/api/image/1/profiles/level1.json",L="http://iiif.io/api/image/1/level2.json",P="http://iiif.io/api/image/1/profiles/level2.json",O="http://iiif.io/api/image/2/level1.json",j="http://iiif.io/api/image/2/profiles/level1.json",q="http://iiif.io/api/image/2/level2.json",ee="http://iiif.io/api/image/2/profiles/level2.json",H="level1",Z="level2",ie="http://iiif.io/api/image/2/level1",W="http://iiif.io/api/image/2/level2",re=[ie,W,f,p,g,S,m,x,R,_,M,k,L,P,O,j,q,ee,H,Z],ge=["http://iiif.io/api/image/2/level0",ie,W,"http://library.stanford.edu/iiif/image-api/compliance.html#level0",f,p,"http://library.stanford.edu/iiif/image-api/conformance.html#level0",g,S,"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",m,x,"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",R,_,"http://iiif.io/api/image/1/level0.json","http://iiif.io/api/image/1/profiles/level0.json",M,k,L,P,"http://iiif.io/api/image/2/level0.json","http://iiif.io/api/image/2/profiles/level0.json",O,j,q,ee,"level0",H,Z],be=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];class Ee{constructor(I,G={}){a(this,"traversals"),a(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...I},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...G}}static all(I){return new Ee({collection:[I],manifest:[I],canvas:[I],annotationList:[I],sequence:[I],annotation:[I],contentResource:[I],choice:[I],range:[I],service:[I],layer:[I]})}traverseCollection(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(I))),this.traversals.collection)}traverseCollectionItems(I){if(this.options.mergeMemberProperties){const G=[...(I.manifests||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Manifest"}:Se),...(I.collections||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Collection"}:Se),...I.members||[]];delete I.collections,delete I.manifests,I.members=G}return I.manifests&&(I.manifests=I.manifests.map(G=>this.traverseManifest(typeof G=="string"?{"@id":G,"@type":"sc:Manifest"}:G))),I.collections&&(I.collections=I.collections.map(G=>this.traverseCollection(typeof G=="string"?{"@id":G,"@type":"sc:Collection"}:G))),I.members&&(I.members=I.members.map(G=>typeof G=="string"?G:this.traverseUnknown(G))),I}traverseManifest(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(I))),this.traversals.manifest)}traverseManifestItems(I){return I.sequences&&(I.sequences=I.sequences.map(G=>this.traverseSequence(G))),I.structures&&(I.structures=I.structures.map(G=>this.traverseRange(G))),I}traverseSequence(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(I))),this.traversals.sequence)}traverseSequenceItems(I){return I.canvases&&(I.canvases=I.canvases.map(G=>this.traverseCanvas(G))),I}traverseCanvas(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(I))),this.traversals.canvas)}traverseCanvasItems(I){return I.images&&(I.images=I.images.map(G=>this.traverseAnnotation(G))),I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseRange(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(I))),this.traversals.range)}traverseRangeItems(I){if(this.options.mergeMemberProperties){const G=[...(I.ranges||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Range"}:Se),...(I.canvases||[]).map(Se=>typeof Se=="string"?{"@id":Se,"@type":"sc:Canvas"}:Se),...I.members||[]];delete I.ranges,delete I.canvases,I.members=G.length?G.map(Se=>this.traverseUnknown(Se)):void 0}return I}traverseAnnotationList(I){const G=typeof I=="string"?{"@id":I,"@type":"sc:AnnotationList"}:I;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(G)),this.traversals.annotationList)}traverseAnnotationListItems(I){return I.resources&&(I.resources=I.resources.map(G=>this.traverseAnnotation(G))),I}traverseAnnotation(I){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(I))),this.traversals.annotation)}traverseAnnotationItems(I){return I.resource&&(Array.isArray(I.resource)?I.resource=I.resource.map(G=>this.traverseContentResource(G)):I.resource=this.traverseContentResource(I.resource)),I.on,I}traverseLayer(I){return this.traverseType(this.traverseLinking(this.traverseLayerItems(I)),this.traversals.layer)}traverseLayerItems(I){return I.otherContent&&(I.otherContent=I.otherContent.map(G=>this.traverseAnnotationList(G))),I}traverseChoice(I){return this.traverseType(this.traverseChoiceItems(I),this.traversals.choice)}traverseChoiceItems(I){return I.default&&I.default!=="rdf:nil"&&(I.default=this.traverseContentResource(I.default)),I.item&&I.item!=="rdf:nil"&&(I.item=I.item.map(G=>this.traverseContentResource(G))),I}traverseService(I){return this.traverseType(this.traverseLinking(I),this.traversals.service)}traverseContentResource(I){return I["@type"]==="oa:Choice"?this.traverseChoice(I):this.traverseType(this.traverseDescriptive(this.traverseLinking(I)),this.traversals.contentResource)}traverseUnknown(I){if(!I["@type"]||typeof I=="string")return I;switch(function(G){if(G==null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(G))throw new Error("Array is not a valid entity");if(typeof G!="object")throw new Error(typeof G+" is not a valid entity");if(typeof G["@type"]=="string"){const Se=be.indexOf(G["@type"]);if(Se!==-1)return be[Se]}if(G.profile)return"Service";if(G.format||G["@type"])return"ContentResource";throw new Error("Resource type is not known")}(I)){case"sc:Collection":return this.traverseCollection(I);case"sc:Manifest":return this.traverseManifest(I);case"sc:Canvas":return this.traverseCanvas(I);case"sc:Sequence":return this.traverseSequence(I);case"sc:Range":return this.traverseRange(I);case"oa:Annotation":return this.traverseAnnotation(I);case"sc:AnnotationList":return this.traverseAnnotationList(I);case"sc:Layer":return this.traverseLayer(I);case"Service":return this.traverseService(I);case"oa:Choice":return this.traverseChoice(I);case"ContentResource":return this.traverseContentResource(I)}return I.profile?this.traverseService(I):I}traverseImageResource(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)typeof We=="string"?ut.push(this.traverseContentResource({"@id":We,"@type":"dctypes:Image"})):ut.push(this.traverseContentResource(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseDescriptive(I){return I.thumbnail&&(I.thumbnail=this.traverseImageResource(I.thumbnail)),I.logo&&(I.logo=this.traverseImageResource(I.logo)),I}traverseOneOrMoreServices(I){const G=Array.isArray(I),Se=Array.isArray(I)?I:[I],ut=[];for(const We of Se)ut.push(this.traverseService(We));return G||this.options.convertPropsToArray?ut:ut[0]}traverseLinking(I){return I.related&&(I.related=this.traverseOneOrManyType(I.related,this.traversals.contentResource)),I.rendering&&(I.rendering=this.traverseOneOrManyType(I.rendering,this.traversals.contentResource)),I.service&&(I.service=this.traverseOneOrMoreServices(I.service)),I.seeAlso&&(I.seeAlso=this.traverseOneOrManyType(I.seeAlso,this.traversals.contentResource)),I.within&&(typeof I.within=="string"||(I.within=this.traverseOneOrManyType(I.within,this.traversals.contentResource))),I.startCanvas&&(typeof I.startCanvas=="string"?I.startCanvas=this.traverseType({"@id":I.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):I.startCanvas&&this.traverseType(I.startCanvas,this.traversals.canvas)),I.contentLayer&&(typeof I.contentLayer=="string"?I.contentLayer=this.traverseLayer({"@id":I.contentLayer,"@type":"sc:Layer"}):I.contentLayer=this.traverseLayer(I.contentLayer)),I}traverseOneOrManyType(I,G){if(!Array.isArray(I)){if(!this.options.convertPropsToArray)return this.traverseType(I,G);I=[I]}return I.map(Se=>this.traverseType(Se,G))}traverseType(I,G){return G.reduce((Se,ut)=>{const We=ut(Se);return We!==void 0||this.options.allowUndefinedReturn?We:Se},I)}}function Ue(U){for(const I in U)U[I]!==void 0&&U[I]!==null||delete U[I];return U}const je="Attribution",Xe="http://example.org/provider",ce="Unknown";function me(U,I="none"){if(!U)return{};const G=Array.isArray(U)?U:[U],Se={};for(const ut of G){if(typeof ut=="string"){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut||"");continue}if(!ut["@language"]){Se[I]=Se[I]?Se[I]:[],Se[I].push(ut["@value"]||"");continue}const We=ut["@language"];Se[We]=Se[We]?Se[We]:[],Se[We].push(ut["@value"]||"")}return Se}function tt(U){return Array.isArray(U)?tt(U.find(I=>typeof I=="string")):ge.indexOf(U)!==-1?"level2":re.indexOf(U)!==-1?"level1":typeof U=="string"?U:void 0}function mt(U){for(const I of["sc","oa","dcterms","dctypes","iiif"])if(U.startsWith(`${I}:`))return U.slice(I.length+1);return U}const he=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Fe(U){const I=U["@id"]||U.id;let G=U["@type"]||U.type;const Se=U.profile||void 0,ut=U["@context"]||void 0;if(Se){const We=function(Sn){switch(Sn){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}(Se);if(We)return We}if(ut){const We=function(Sn){const ji=Array.isArray(Sn)?Sn:[Sn];for(const xe of ji)switch(xe){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}(ut);if(We)return We}if(G){if(Array.isArray(G)){if(G.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(G.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";G=G[0]}for(const We of["sc","oa","dcterms","dctypes","iiif"])if(G.startsWith(`${We}:`)){G=G.slice(We.length+1);break}switch(G){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(G&&he.indexOf(G)!==-1)return G;if(U.format){if(U.format.startsWith("image/"))return"Image";if(U.format.startsWith("text/")||U.format==="application/pdf")return"Text";if(U.format.startsWith("application/"))return"Dataset"}return I&&(I.endsWith(".jpg")||I.endsWith(".png")||I.endsWith(".jpeg"))?"Image":G||"unknown"}const $e=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function ht(U){const I=U.match($e);return I?I[0]:U}const gt=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function gn(U){if(U){const I=Array.isArray(U)?U:[U],G=[];for(const Se of I)Se==="http://iiif.io/api/presentation/2/context.json"&&G.push("http://iiif.io/api/presentation/3/context.json"),gt.indexOf(Se)===-1&&G.push(Se);if(I.length)return G.length===1?G[0]:G}}let Xt=0;function yt(U,I){const G=encodeURI(U.id||U["@id"]||"").trim();return G&&I?`${G}/${I}`:G||(Xt++,`http://example.org/${U["@type"]}${I?`/${I}`:""}/${Xt}`)}function Be(U){const I=[...U.behavior||[]];let G;return U.viewingHint&&I.push(U.viewingHint),Array.isArray(U.motivation)?G=U.motivation.map(mt):U.motivation&&(G=mt(U.motivation)),{"@context":U["@context"]?gn(U["@context"]):void 0,id:(U["@id"]||yt(U)).trim(),type:Fe(U),behavior:I.length?I:void 0,height:U.height?U.height:void 0,width:U.width?U.width:void 0,motivation:G,viewingDirection:U.viewingDirection,profile:U.profile,format:U.format?U.format:void 0,duration:void 0,timeMode:void 0}}function nt(U){const[I,G]=function(We,Sn="Rights/License",ji="none"){let xe=null;const ct=[],pi=Array.isArray(We)?We:[We];for(const Pt of pi){const it=Pt?ht(Pt):void 0;!it||it.indexOf("creativecommons.org")===-1&&it.indexOf("rightsstatements.org")===-1?it&&ct.push({label:{[ji]:[Sn]},value:{[ji]:[it]}}):xe=it.startsWith("https://")?`http://${it.slice(8)}`:it}return[xe,ct]}(U.license),Se=[...U.metadata?(ut=U.metadata,ut?ut.map(We=>({label:me(We.label),value:me(We.value)})):[]):[],...G];var ut;return{rights:I,metadata:Se.length?Se:void 0,label:U.label?me(U.label):void 0,requiredStatement:U.attribution?{label:me(je),value:me(U.attribution)}:void 0,navDate:U.navDate,summary:U.description?me(U.description):void 0,thumbnail:ot(U.thumbnail)}}function ot(U){return U&&(Array.isArray(U)?U:[U]).map(I=>typeof I=="string"?{id:I,type:"Image"}:(I.type==="unknown"&&(I.type="Image"),I))}function lt(U){if(!U.within)return;const I=Array.isArray(U.within)?U.within:[U.within],G=[];for(const Se of I)typeof Se=="string"?Se&&U["@type"]==="sc:Manifest"&&G.push({id:Se,type:"Collection"}):Se["@id"]&&G.push({id:Se["@id"],type:Fe(Se)});return G.length?G:void 0}function Et(U){const I=U.related?Array.isArray(U.related)?U.related:[U.related]:[],G=U.contentLayer;return{provider:U.logo||I.length?[{id:Xe,type:"Agent",homepage:I.length?[I[0]]:void 0,logo:U.logo?Array.isArray(U.logo)?U.logo:[U.logo]:void 0,label:me(ce)}]:void 0,partOf:lt(U),rendering:U.rendering,seeAlso:U.seeAlso,start:U.startCanvas,service:U.service?(Se=U.service,Array.isArray(Se)?Se:Se?[Se]:[]):void 0,supplementary:G?[G]:void 0};var Se}function wt(U){const I=U;return Ue({...Be(I),...nt(I),...Et(I),...(G=I,{chars:G.chars,format:G.format?G.format:void 0,language:G.language})});var G}const yn=new Ee({collection:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],manifest:[function(U){const I=[],G=[];let Se;for(const We of U.sequences||[])We.canvases.length&&I.push(...We.canvases),We.behavior&&G.push(...We.behavior),We.startCanvas&&(Se=We.startCanvas);const ut=Be(U);return G.length&&(ut.behavior?ut.behavior.push(...G):ut.behavior=G),Ue({...ut,...nt(U),...Et(U),start:Se,items:I,structures:U.structures})}],canvas:[function(U){return Ue({...Be(U),...nt(U),...Et(U),annotations:U.otherContent&&U.otherContent.length?U.otherContent:void 0,items:U.images&&U.images.length?[{id:yt(U,"annotation-page"),type:"AnnotationPage",items:U.images}]:void 0})}],annotationList:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.resources&&U.resources.length?U.resources:void 0})}],sequence:[function(U){return U.canvases&&U.canvases.length!==0?{canvases:U.canvases,behavior:U.viewingHint?[U.viewingHint]:[],startCanvas:U.startCanvas}:{canvases:[],behavior:[]}}],annotation:[function(U){return Ue({...Be(U),...nt(U),...Et(U),target:function I(G){if(Array.isArray(G)){if(G.length>1)return{type:"List",items:G.map(I)};G=G[0]}if(typeof G=="string")return encodeURI(G).trim();if("@type"in G){let Se;if(typeof G.full=="string")Se=G.full;else if(G.full["@type"]==="dctypes:Image")Se={id:G.full["@id"],type:"Image"};else{if(G.full["@type"]!=="sc:Canvas")throw new Error(`Unsupported source type on annotation: ${G.full["@type"]}`);Se={id:G.full["@id"],type:"Canvas"}}return{type:"SpecificResource",source:Se,selector:Kt(G.selector)}}return encodeURI(G["@id"]).trim()}(U.on),body:Array.isArray(U.resource)?U.resource.map(wt):wt(U.resource)})}],contentResource:[wt],choice:[function(U){const I=[];return U.default&&U.default!=="rdf:nil"&&I.push(U.default),U.item&&U.item!=="rdf:nil"&&I.push(...U.item),{...Be(U),...nt(U),items:I}}],range:[function(U){return Ue({...Be(U),...nt(U),...Et(U),items:U.members})}],service:[function(U){const{"@id":I,"@type":G,"@context":Se,profile:ut,...We}=U,Sn={};return I&&(Sn["@id"]=I),Sn["@type"]=Fe(U),Sn["@type"]==="unknown"&&(Se&&Se.length&&(Sn["@context"]=Se),Sn["@type"]="Service"),ut&&(Sn.profile=tt(ut)),Ue({...Sn,...We})}],layer:[function(U){return Ue({...Be(U),...nt(U),...Et(U)})}]});function Kt(U){if((Array.isArray(U["@type"])&&U["@type"].includes("oa:SvgSelector")||U["@type"]=="oa:SvgSelector")&&("chars"in U||"value"in U))return{type:"SvgSelector",value:"chars"in U?U.chars:U.value};if(U["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:U.value};if(U["@type"]==="oa:Choice")return[Kt(U.default),...(Array.isArray(U.item)?U.item:[U.item]).map(Kt)];if(U["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in U?U.region:void 0,rotation:"rotation"in U?U.rotation:void 0};throw new Error(`Unsupported selector type: ${U["@type"]}`)}const tr=function(U){return U&&U["@context"]&&(U["@context"]==="http://iiif.io/api/presentation/2/context.json"||U["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||U["@context"]==="http://www.shared-canvas.org/ns/context.json")||U["@context"]==="http://iiif.io/api/image/2/context.json"?yn.traverseUnknown(U):U};u.upgrade=tr,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})})(rE,rE.exports);function eD(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}function lm(t,e){const{selector:n,source:i}=_c(e);if(i.id!==t.id)return[null,i];const a={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}};return[n?n.type==="TemporalSelector"?{type:"TemporalBoxSelector",temporal:n.temporal,spatial:a.spatial}:n:null,i]}const sE={makeChoice:()=>{}},$d={type:"unknown"},Pn=t=>({type:"unknown",reason:t,annotations:{pages:[]}}),aE=(t,e)=>({type:"empty",width:t,height:e,annotations:{pages:[]},image:null,images:[]});function tD(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function nD(t,e){return ni(n=>{const i=[];if(!t)return i;const a=Object.keys(n.iiif.entities.AnnotationPage);for(const u of a)if(!e||e.indexOf(u)!==-1){const f=tD(n,u);f&&f.views&&f.views[t]&&i.push(u)}return i},[t,e])}function oE({canvas:t,manifest:e,all:n,canvases:i}){const a=[];if(e)for(const u of e.annotations)a.indexOf(u.id)===-1&&a.push(u.id);if(n){if(i&&i.length)for(const u of i)for(const f of u.annotations)a.indexOf(f.id)===-1&&a.push(f.id)}else if(t)for(const u of t.annotations)a.indexOf(u.id)===-1&&a.push(u.id);return a}function iD(t,e){var i;const n=(i=t==null?void 0:t.iiif)==null?void 0:i.meta[e];return n?n.annotationPageManager:null}function lE(t,e={}){const n=Un(),i=ya(),a=Jr(),u=Hv(),f=T.useMemo(()=>oE({all:e.all,manifest:i,canvas:a,canvases:u}),[e.all,a,u,i]),p=nD(t,e.all?void 0:f),g=T.useCallback(m=>{t&&n.setMetaValue([m,"annotationPageManager","views"],x=>x&&!x[t]?x:{...x||{},[t]:!1})},[t,n]),S=T.useCallback((m,x={})=>{if(!t)return;const R=n.getState(),_=[];if(x!=null&&x.deselectOthers){const M=Object.keys(R.iiif.entities.AnnotationPage);for(const k of M){const L=iD(R,k);L&&L.views&&L.views[t]&&_.push(k)}}for(const M of _)g(M);n.setMetaValue([m,"annotationPageManager","views"],M=>M&&M[t]?M:{...M||{},[t]:!0})},[t,g,n]);return{availablePageIds:f,enabledPageIds:p,setPageEnabled:S,setPageDisabled:g}}function uE(t,e){return ni((n,i)=>i.get(t.map(a=>({id:a,type:e}))),[t,e])}const cE=T.createContext(new Ka.ImageServiceLoader);function Wd(){return T.useContext(cE)}function fE(){const t=Wd(),[e,n]=T.useState({}),i=T.useRef(!1);return T.useEffect(()=>()=>{i.current=!0},[]),[T.useCallback((u,{height:f,width:p})=>{if(u){const g=u.id||u["@id"],S=t.loadServiceSync({id:g,width:u.width||p,height:u.height||f,source:u});S?u=S:e[g]||(i.current||n(m=>({...m,[g]:"loading"})),t.loadService({id:g,width:u.width||p,height:u.height||f}).then(()=>{i.current||n(m=>({...m,[g]:"done"}))}))}return u},[t,e]),e]}function qd(t={}){const e=Zv(),n=Jr(t.canvasId?{id:t.canvasId}:void 0);return ni((i,a)=>{if(!n)return[];if(e&&t.enableSingleAnnotation)return[e];const u=a.get(n.items),f=[];for(const p of u)f.push(...a.get(p.items));return f},[n])}function rD(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}const Yd={},dE={get(t){return t},setMetaValue([t,e,n],i){const a=dE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Yd[t]={...Yd[t]||{},[e]:{...(Yd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Yd[t];if(n)return e?n[e]:n}};function sD(t=dE){function e(a){const u=a?typeof a=="string"?t.get(a):a:null;if(!u)return[];const f=t.get(u.items,{parent:u}),p=[];for(const g of f)p.push(...t.get(g.items,{parent:g}));return p}function n(a,u=[]){const f=Array.isArray(a)?a:e(a),p=[];let g=null;const S=[];for(const m of f){if(m.type!=="Annotation")throw new Error("getPaintables() accept either a canvas or list of annotations");const x=Array.from(Array.isArray(m.body)?m.body:[m.body]);for(const R of x){const[_,{selector:M}]=rD(R),k=t.get(_),L=(k.type||"unknown").toLowerCase();if(L==="choice"){const P=t.get(k.items,{parent:k.id}),O=u.length?u.map(j=>P.find(q=>q.id===j)).filter(Boolean):[P[0]];O.length===0&&O.push(P[0]),g={type:"single-choice",items:P.map(j=>({id:j.id,label:j.label,selected:O.indexOf(j)!==-1})),label:_.label},x.push(...O);continue}p.indexOf(L)===-1&&p.push(L),S.push({type:L,annotationId:m.id,resource:k,target:m.target,selector:M})}}return{types:p,items:S,choice:g}}function i(a){const{choice:u}=n(a);return u}return{getAllPaintingAnnotations:e,getPaintables:n,extractChoices:i}}function hE(t,e=[]){const n=Un(),i=T.useMemo(()=>sD(n),[]),a=qd({enableSingleAnnotation:t==null?void 0:t.enableSingleAnnotation}),[u,f]=T.useState((t==null?void 0:t.defaultChoices)||[]),p=T.useMemo(()=>i.getPaintables(a,u),[n,a,u,...e]),S={makeChoice:T.useCallback((m,{deselectOthers:x=!0,deselect:R=!1}={})=>{if(p.choice){if(p.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");f(_=>{if(R){const k=_.filter(L=>L!==m);if(k.length===0){const L=p.items[0].resource.id;return L?[L]:[]}return k}if(x)return[m];const M=[..._];if(M.length===0&&p.items.length){const k=p.items[0].resource.id;k&&M.push(k)}return _.indexOf(m)!==-1?_:[..._,m]})}},[p.choice])};return[p,S]}const aD=["model/gltf-binary"];function pE(t,e){const i=e.items[0].resource;return i.format?aD.indexOf(i.format)===-1?Pn(`3D format: ${i.format} is unsupported`):{type:"3d-model",model:i}:Pn("Unknown format")}function oD(t,e){var i;if(!t.duration)return Pn("No duration on canvas");if(e.items.length>1)return Pn("Only one audio source supported");const n=(i=e.items[0])==null?void 0:i.resource;return n?n.format?{type:"media",media:{annotationId:e.items[0].annotationId,duration:t.duration,url:n.id,type:"Sound",target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:n.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}},annotations:{pages:[]}}:Pn("Audio does not have format"):Pn("Unknown audio")}function vE(t,e,n){const i=[];for(const a of e.items){const u=a.resource&&a.resource.type==="SpecificResource"?a.resource.source:a.resource;if(!u.id)return Pn("No resource Identifier");let f;if(u.service){const _=Ka.getImageServices(u);_[0]&&(f=n(_[0],t))}const p={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}},[g,S]=lm(t,a.target);if(S.id!==t.id)continue;a.resource.width&&a.resource.height&&(a.resource.width,a.resource.height);let m=a.resource.type==="SpecificResource"?Sa(a.resource):null;if(a.selector){const _=Sa({type:"SpecificResource",source:a.resource,selector:a.selector});_&&(m=_)}const x=m&&m.selector&&(m.selector.type==="BoxSelector"||m.selector.type==="TemporalBoxSelector")?{type:"BoxSelector",spatial:{x:m.selector.spatial.x,y:m.selector.spatial.y,width:m.selector.spatial.width,height:m.selector.spatial.height}}:void 0;f&&!f.id&&(f.id=f["@id"]);const R={id:u.id,type:"Image",annotationId:a.annotationId,width:Number(g||x?u.width:t.width),height:Number(g||x?u.height:t.height),service:f,sizes:f&&f.sizes?f.sizes:u.width&&u.height?[{width:u.width,height:u.height}]:[],target:g&&g.type!=="PointSelector"?g:p,selector:x};i.push(R)}return{type:"images",image:i[0],images:i,choice:e.choice}}function mE(t,e={},n){const i=t.language||n||"none";switch(t.type){case"TextualBody":{typeof t.value<"u"&&(e[i]=t.value);break}case"List":case"Composite":case"Choice":t.items&&t.items.forEach(a=>mE(a,e,i))}return e}function gE(t,e){const n=[];return e.items.forEach(i=>{if(i.resource){const[a]=lm(t,i.target);n.push({annotationId:i.annotationId,text:mE(i.resource),target:a})}}),{type:"textual-content",items:n}}const lD=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;function yE(t,e){var f;const n=e.items.filter(p=>p.type==="video");if(!t.duration)return Pn("No duration on canvas");if(n.length>1)return Pn("Only one video source supported");const i=(f=n[0])==null?void 0:f.resource,a=!!(i.service||[]).find(p=>(p.profile||"").includes("youtube.com"));if(!i)return Pn("Unknown video");if((!i.format||i.format==="text/html")&&!a)return Pn("Video does not have format");const u={annotationId:e.items[0].annotationId,duration:t.duration,url:i.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:i.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}};if(a){u.type="VideoYouTube";const p=i.id.match(lD);if(!p[1])return Pn("Video is not known youtube video");u.youTubeId=p[1]}return{type:"media",media:u,annotations:{pages:[]}}}function SE({canvas:t,paintables:e,supports:n,loadImageService:i}){if(!t)return console.log("No canvas"),$d;if(e.types.length===0)return n.indexOf("empty")!==-1?aE(t.width,t.height):(console.log("No paintables"),$d);if(e.types.length!==1)if(e.types.length===2&&e.types.indexOf("text")!==-1)e.types=e.types.filter(u=>u!=="text");else return n.indexOf("complex-timeline")===-1?Pn("Complex timeline not supported"):Pn("ComplexTimelineStrategy not yet supported");const a=e.types[0];return a==="image"?n.indexOf("images")===-1?Pn("Image not supported"):vE(t,e,i):a==="Model"||a==="model"?n.indexOf("3d-model")===-1?Pn("3D not supported"):pE(t,e):a==="textualbody"?n.indexOf("textual-content")===-1?Pn("Textual content not supported"):gE(t,e):a==="sound"||a==="audio"?n.indexOf("media")===-1?Pn("Media not supported"):oD(t,e):a==="video"?n.indexOf("media")===-1?Pn("Media not supported"):yE(t,e):$d}function bE(t){const e=ya(),n=Jr(),i=Un(),[a,u]=fE(),{enabledPageIds:f}=lE((t==null?void 0:t.annotationPageManagerId)||(e==null?void 0:e.id)||(n==null?void 0:n.id),{all:!1}),p=uE(f,"AnnotationPage"),g=(t==null?void 0:t.strategies)||["empty","images","media","textual-content","complex-timeline"],[S,m]=hE(t,[u]),x=T.useMemo(()=>SE({canvas:n,paintables:S,supports:g,loadImageService:a}),[n,S,i,m.makeChoice]);return T.useMemo(()=>x.type==="unknown"?[x,sE]:[{...x,annotations:{pages:p}},m],[x,p])}const EE=(t,e=[])=>{const n=Un();T.useEffect(()=>{t(n)},[n,...e])},Qd={},xE={get(t){return t},setMetaValue([t,e,n],i){const a=xE.getResourceMeta(t,e),u=a?a[n]:void 0,f=typeof i=="function"?i(u):i;Qd[t]={...Qd[t]||{},[e]:{...(Qd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=Qd[t];if(n)return e?n[e]:n}},uD=new Ka.ImageServiceLoader;function cD(t=xE,e={}){const n=e.imageServiceLoader||uD;async function i(a,u,f=!1,p=[],g){const S=()=>n.getThumbnailFromResource(void 0,u,f,p);if(!a)return await n.getThumbnailFromResource(void 0,u,f,p);if(typeof a=="string"){const x=Ka.getFixedSizeFromImage(a);return x&&p.push(x),await n.getThumbnailFromResource(void 0,u,f,p)}const m=t.get(a,{skipSelfReturn:!1});if(typeof m=="string")return{best:Ka.getFixedSizeFromImage(m),fallback:[],log:[]};if(!m)return await S();switch(await(async x=>{if(x&&x.thumbnail&&x.thumbnail.length){const R=t.get(x.thumbnail[0]),_=await n.getImageCandidates(R,f);_&&_.length&&p.push(..._)}})(m),m.type){case"Annotation":{const x=Array.isArray(m.body)?m.body:[m.body],R=t.get(x[0]);return g&&!R.width&&(R.width=g.width,R.height=g.height),await n.getThumbnailFromResource(R,u,f,p)}case"Canvas":{const x=m;return i(x.items[0],u,f,p,{width:x.width,height:x.height})}case"AnnotationPage":return i(m.items[0],u,f,p,g);case"Choice":{const x=m;return!x.items||x.items[0]?await S():i(x.items[0],u,f,p,g)}case"Collection":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"Manifest":{const x=m.items[0];return x?i(x,u,f,p,g):await S()}case"SpecificResource":case"Image":case"Dataset":case"Sound":case"Text":case"TextualBody":case"Video":return g&&!m.width&&(m.width=g.width,m.height=g.height),n.getThumbnailFromResource(m,u,f,p)}return await S()}return{getBestThumbnailAtSize:i}}function wE(t,e,{canvasId:n,manifestId:i}={}){const a=Un(),u=Wd(),f=T.useMemo(()=>cD(a,{imageServiceLoader:u}),[a,u]),[p,g]=T.useState(),S=ya(i?{id:i}:void 0),m=Jr(n?{id:n}:void 0),x=m||S,R=T.useRef(!1);if(T.useEffect(()=>(R.current=!1,()=>{R.current=!0}),[]),!x)throw new Error("Must be called under a manifest or canvas context.");return EE(_=>{f.getBestThumbnailAtSize(x,t,e).then(M=>{M.best&&!R.current&&g(M.best)})},[x]),p}function fD(t){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:t}}function dD(t,e){switch(e.type){case"FINISHED":return{...t,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...t,isFinished:!1,isPlaying:!t.isPlaying};case"PLAY_REQUESTED":return{...t,isFinished:!1,playRequested:!0};case"PAUSE":return{...t,isPlaying:!1};case"PLAY":return{...t,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...t,isMuted:!0};case"SET_VOLUME":return{...t,volume:e.volume,isMuted:e.volume===0};case"TOGGLE_MUTE":return{...t,isMuted:!t.isMuted};case"UNMUTE":return{...t,isMuted:!1}}return t}function CE(t){const e=Math.round(t);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function Gd(t){const[e,n]=T.useReducer(dD,fD(t.duration)),i=T.useRef(null),a=T.useRef(null),u=T.useRef(null),f=T.useRef(!1),p=T.useCallback(()=>{a.current&&i.current&&(a.current.innerHTML=CE(i.current.currentTime),u.current&&(u.current.style.width=`${i.current.currentTime/t.duration*100}%`),f.current!==i.current.muted&&(f.current=i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[t.duration]),g=T.useCallback(()=>{i.current&&(n({type:"PLAY_REQUESTED"}),i.current.play().then(()=>{n({type:"PLAY"})}),p())},[p]),S=T.useCallback(()=>{i.current&&(i.current.duration>0&&i.current.paused?g():m())},[p]),m=T.useCallback(()=>{i.current&&(i.current.pause(),n({type:"PAUSE"}),p())},[p]),x=T.useCallback(()=>{i.current&&(i.current.muted=!i.current.muted,n(i.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),R=T.useCallback(()=>{i.current&&(i.current.muted=!0,n({type:"MUTE"}))},[]),_=T.useCallback(()=>{i.current&&(i.current.muted=!1,n({type:"UNMUTE"}))},[]),M=T.useCallback(P=>{i.current&&(i.current.muted=!1,i.current.volume=P/100,n({type:"SET_VOLUME",volume:P}))},[]),k=T.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P*t.duration,t.duration)),p())},[]),L=T.useCallback(P=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(P,t.duration)),p())},[]);return T.useEffect(()=>{const P=setInterval(()=>{p()},350);return()=>clearInterval(P)},[p,t.duration]),T.useEffect(()=>{const P=()=>{n({type:"FINISHED"})},O=i.current;return O==null||O.addEventListener("ended",P),()=>O==null?void 0:O.removeEventListener("ended",P)},[]),[{element:i,currentTime:a,progress:u},e,{play:g,pause:m,playPause:S,mute:R,unmute:_,toggleMute:x,setVolume:M,setDurationPercent:k,setTime:L}]}const TE=T.createContext(null),RE=T.createContext(null),AE=T.createContext(null);function hD(){const t=T.useContext(TE);if(!t)throw new Error("Ctx not found");return t}function pD(){const t=T.useContext(RE);if(!t)throw new Error("Ctx not found");return t}function vD(){const t=T.useContext(AE);if(!t)throw new Error("Ctx not found");return t}function um({actions:t,state:e,children:n,currentTime:i,progress:a,element:u}){return oe.jsx(AE.Provider,{value:{currentTime:i,progress:a,element:u},children:oe.jsx(RE.Provider,{value:t,children:oe.jsx(TE.Provider,{value:e,children:n})})})}function ME({media:t,children:e}){const[{element:n,currentTime:i,progress:a},u,f]=Gd({duration:t.duration});return oe.jsxs(um,{state:u,actions:f,currentTime:i,progress:a,element:n,children:[oe.jsx("audio",{ref:n,src:t.url}),e]})}function OE({media:t,mediaControlsDeps:e,children:n}){return Fl("portal","audio",ME,{media:t,children:n},[t,...e||[]]),null}function _E({element:t,media:e,playPause:n}){return oe.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[oe.jsx("style",{children:`
349
349
  .video-container {
350
350
  position: absolute;
351
351
  top: 0;
@@ -358,7 +358,7 @@ No matching component was found for:
358
358
  justify-content: center;
359
359
  pointer-events: visible;
360
360
  }
361
- `}),oe.jsx("video",{ref:t,src:e.url,style:{width:"100%",objectFit:"contain"}})]})}function AE({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:u},f,p]=Gd({duration:t.duration});return Fl("overlay","video-element",RE,{element:i,media:t,playPause:p.playPause}),Fl("portal","custom-controls",um,{state:f,actions:p,currentTime:a,progress:u,element:i,children:n},[a,f,t,...e||[]]),null}function ME({model:t}){return oe.jsxs(oe.Fragment,{children:[oe.jsx("style",{children:`
361
+ `}),oe.jsx("video",{ref:t,src:e.url,style:{width:"100%",objectFit:"contain"}})]})}function LE({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:u},f,p]=Gd({duration:t.duration});return Fl("overlay","video-element",_E,{element:i,media:t,playPause:p.playPause}),Fl("portal","custom-controls",um,{state:f,actions:p,currentTime:a,progress:u,element:i,children:n},[a,f,t,...e||[]]),null}function PE({model:t}){return oe.jsxs(oe.Fragment,{children:[oe.jsx("style",{children:`
362
362
  .model-container {
363
363
  position: absolute;
364
364
  top: 0;
@@ -371,9 +371,9 @@ No matching component was found for:
371
371
  justify-content: center;
372
372
  pointer-events: visible;
373
373
  }
374
- `}),oe.jsx("div",{className:"model-container",children:oe.jsx("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:t.id})})]})}function OE({model:t,name:e}){return Fl("overlay",`model-${e}`,ME,{model:t},[t]),null}function _E({style:t}){const e=Jr();return!e||!e.height||!e.width?null:oe.jsx("box",{interactive:!1,target:{x:0,y:0,width:Number(e.width),height:Number(e.height)},style:t})}const LE=R.createContext("en");function vD(t){return oe.jsx(LE.Provider,{value:t.language,children:t.children})}function Xd(){return R.useContext(LE)}function PE(t){return t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):t}function DE({as:t,language:e,children:n,viewingDirection:i,...a}){const u=Xd();return R.useMemo(()=>PE(u)===PE(e),[u,e])?t?oe.jsx(t,{...a,children:n}):oe.jsx("span",{...a,children:n}):t?oe.jsx(t,{...a,lang:e,dir:i,children:n}):oe.jsx("span",{...a,lang:e,dir:i,children:n})}function kE(t,e,n){if(e.length===0)return;if(e.length===1)return e[0];if(e.indexOf(t)!==-1)return t;const i=t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):null;if(i&&e.indexOf(i)!==-1)return i;for(const a of n)if(e.indexOf(a)!==-1)return a;return e.indexOf("none")!==-1?"none":e.indexOf("@none")!==-1?"@none":e[0]}const IE=(t,e=[])=>{const n=Xd();return R.useMemo(()=>{const i=t();return kE(n,i,[])},[n,...e])};function NE(t,e){const n=IE(()=>Object.keys(t||{}),[t]);return[R.useMemo(()=>{if(!t)return e||"";if(typeof t=="string")return t;const i=n?t[n]:void 0;return i?typeof i=="string"?i:i.join(`
375
- `):""},[n,e,t]),n]}function mD(){const t=Xd();return function(n,i,a){const u=Object.keys(n||{}),f=kE(t,u,[]);if(!n)return i||"";if(typeof n=="string")return n;const p=f?n[f]:void 0;return p?typeof p=="string"?p:p.join(typeof a<"u"?a:`
376
- `):""}}const zE=({as:t,defaultText:e,enableDangerouslySetInnerHTML:n,children:i,...a})=>{const[u,f]=NE(i,e);return f?oe.jsx(DE,{...a,as:t,language:f,title:n?void 0:u,dangerouslySetInnerHTML:n?{__html:u}:void 0,children:n?void 0:u}):t?oe.jsx(t,{...a,children:u}):oe.jsx("span",{...a,title:n?void 0:u,dangerouslySetInnerHTML:n?{__html:u}:void 0,children:n?void 0:u})};function gD({element:t,media:e,playPause:n}){const i=R.useRef(null);return e.youTubeId?oe.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[oe.jsx("style",{children:`
374
+ `}),oe.jsx("div",{className:"model-container",children:oe.jsx("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:t.id})})]})}function DE({model:t,name:e}){return Fl("overlay",`model-${e}`,PE,{model:t},[t]),null}function kE({style:t}){const e=Jr();return!e||!e.height||!e.width?null:oe.jsx("box",{interactive:!1,target:{x:0,y:0,width:Number(e.width),height:Number(e.height)},style:t})}const IE=T.createContext("en");function mD(t){return oe.jsx(IE.Provider,{value:t.language,children:t.children})}function Xd(){return T.useContext(IE)}function NE(t){return t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):t}function zE({as:t,language:e,children:n,viewingDirection:i,...a}){const u=Xd();return T.useMemo(()=>NE(u)===NE(e),[u,e])?t?oe.jsx(t,{...a,children:n}):oe.jsx("span",{...a,children:n}):t?oe.jsx(t,{...a,lang:e,dir:i,children:n}):oe.jsx("span",{...a,lang:e,dir:i,children:n})}function UE(t,e,n){if(e.length===0)return;if(e.length===1)return e[0];if(e.indexOf(t)!==-1)return t;const i=t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):null;if(i&&e.indexOf(i)!==-1)return i;for(const a of n)if(e.indexOf(a)!==-1)return a;return e.indexOf("none")!==-1?"none":e.indexOf("@none")!==-1?"@none":e[0]}const jE=(t,e=[])=>{const n=Xd();return T.useMemo(()=>{const i=t();return UE(n,i,[])},[n,...e])};function FE(t,e){const n=jE(()=>Object.keys(t||{}),[t]);return[T.useMemo(()=>{if(!t)return e||"";if(typeof t=="string")return t;const i=n?t[n]:void 0;return i?typeof i=="string"?i:i.join(`
375
+ `):""},[n,e,t]),n]}function gD(){const t=Xd();return function(n,i,a){const u=Object.keys(n||{}),f=UE(t,u,[]);if(!n)return i||"";if(typeof n=="string")return n;const p=f?n[f]:void 0;return p?typeof p=="string"?p:p.join(typeof a<"u"?a:`
376
+ `):""}}const BE=({as:t,defaultText:e,enableDangerouslySetInnerHTML:n,children:i,...a})=>{const[u,f]=FE(i,e);return f?oe.jsx(zE,{...a,as:t,language:f,title:n?void 0:u,dangerouslySetInnerHTML:n?{__html:u}:void 0,children:n?void 0:u}):t?oe.jsx(t,{...a,children:u}):oe.jsx("span",{...a,title:n?void 0:u,dangerouslySetInnerHTML:n?{__html:u}:void 0,children:n?void 0:u})};function yD({element:t,media:e,playPause:n}){const i=T.useRef(null);return e.youTubeId?oe.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[oe.jsx("style",{children:`
377
377
  .video-container {
378
378
  position: absolute;
379
379
  top: 0;
@@ -391,5 +391,5 @@ No matching component was found for:
391
391
  width: 100%;
392
392
  object-fit: contain;
393
393
  }
394
- `}),oe.jsx("iframe",{className:"video-yt",ref:i,src:`https://www.youtube.com/embed/${e.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function yD({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:u},f,p]=Gd({duration:t.duration});return Fl("overlay","video-element",gD,{element:i,media:t,playPause:p.playPause}),null}function UE({x:t,y:e,onChoiceChange:n,registerActions:i,defaultChoices:a,isStatic:u,renderViewerControls:f,renderMediaControls:p,viewControlsDeps:g,mediaControlsDeps:S,strategies:m,throwOnUnknown:x,backgroundStyle:T,alwaysShowBackground:_,keepCanvasScale:M=!1,enableSizes:k=!1,enableYouTube:L=!0,onClickPaintingAnnotation:P,children:O}){const j=Jr(),q=Yv(j,["deep-zoom"]),[ee]=lb(),H=cb(),Z=Un(),ie=R.useMemo(()=>Qv(Z),[Z]),[W,re]=mE({strategies:m||["images"],defaultChoices:a==null?void 0:a.map(({id:me})=>me)}),ge=W.type==="images"?W.choice:void 0,be=R.useMemo(()=>M?1:Math.max(1,...W.type==="images"?W.images.map(me=>{var tt;return(me.width||0)/((tt=me.target)==null?void 0:tt.spatial.width)}):[]),[M,W]);hL(be),R.useEffect(()=>{i&&i(re)},[W.annotations]),R.useEffect(()=>{if(a)for(const me of a)typeof me.opacity<"u"&&ie.applyStyles({id:me.id},"atlas",{opacity:me.opacity})},[a]),R.useLayoutEffect(()=>{n&&n(ge)},[ge]),Fl(H&&(W.type==="images"||W.type==="empty"||W.type==="textual-content"&&f)?"overlay":"none",`canvas-portal-controls-${j==null?void 0:j.id}`,Ud.Provider,f?{value:H||null,children:f(W)}:{},[j,H,W,...g||[]]);const Ee=SE({maxWidth:256,maxHeight:256});if(!j)return null;const Ue=j.accompanyingCanvas,je=Ee&&Ee.type==="fixed"?oe.jsx("world-object",{height:j.height,width:j.width,x:t,y:e,children:oe.jsx("world-image",{uri:Ee.id,target:{x:0,y:0,width:j.width,height:j.height},display:Ee.width&&Ee.height?{width:Ee.width,height:Ee.height}:void 0,crop:void 0})}):null;if(W.type==="unknown"){if(je)return je;if(x)throw new Error(W.reason||"Unknown image strategy");return null}const Xe=oe.jsxs(R.Fragment,{children:[ee?oe.jsx(Jv,{page:ee}):null,W.annotations&&W.annotations.pages?W.annotations.pages.map(me=>oe.jsx(Jv,{page:me},me.id)):null,O]}),ce=W.type==="images"?W.images.length:0;return oe.jsxs(oe.Fragment,{children:[oe.jsxs("world-object",{height:j.height,width:j.width,x:t,y:e,...q,children:[W.type==="empty"||_?oe.jsx(_E,{style:T}):null,W.type==="textual-content"?W.items.map((me,tt)=>{var mt;return oe.jsxs(oe.Fragment,{children:[oe.jsx(hv,{onClick:P?he=>{he.stopPropagation(),P(me.annotationId,me,he)}:void 0,target:((mt=me.target)==null?void 0:mt.spatial)||void 0,children:oe.jsx("div",{"data-textual-content":!0,children:oe.jsx(zE,{enableDangerouslySetInnerHTML:!0,children:me.text})})},tt),Xe]})}):null,W.type==="images"?oe.jsxs(oe.Fragment,{children:[W.images.map((me,tt)=>oe.jsx(Rb,{isStatic:u,image:me,id:me.id,thumbnail:tt===0?Ee:void 0,selector:me.selector,enableSizes:k,onClick:P?mt=>{mt.stopPropagation(),P(me.annotationId,me,mt)}:void 0},me.id+tt)),Xe]}):null,W.type==="3d-model"?oe.jsx(OE,{model:W.model}):null,W.type==="media"?oe.jsx(oe.Fragment,{children:W.media.type==="Sound"?oe.jsxs(TE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="Video"?oe.jsxs(AE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="VideoYouTube"&&L?oe.jsxs(yD,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):null}):null]},`${j.id}/${W.type}/${ce}`),W.type==="media"&&W.media.type==="Sound"&&Ue?oe.jsx(zd,{canvas:Ue.id,children:oe.jsx(UE,{renderViewerControls:f})}):null]})}function jE(){const t=R.useContext(bc);return t&&t.vault?t.vault:qS()}const SD=R.forwardRef(function(e,n){const i=ya(),a=Hv(),u=tb(),{ViewerControls:f,MediaControls:p}=e.components||{};if(R.useImperativeHandle(n,()=>u,[u]),!i)return oe.jsx("div",{});let g=0;return oe.jsxs(oe.Fragment,{children:[e.header,oe.jsx(Ti.Viewer,{height:e.height,mode:e.mode,children:a.map((S,m)=>{const x=g;return g+=S.width+(e.spacing||0),oe.jsx(zd,{canvas:S.id,children:oe.jsx(Ti.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content"],renderViewerControls:m===0&&f?()=>oe.jsx(f,{}):void 0,renderMediaControls:m===0&&p?()=>oe.jsx(p,{}):void 0,x,...e.canvasProps||{},children:e.annotations},S.id)},S.id)})},e.reuseAtlas?"":u.currentSequenceIndex),e.children]})}),Ti=R.forwardRef(function({children:e,height:n,annotations:i,canvasProps:a,spacing:u,header:f,components:p,mode:g,...S},m){const x=jE();return oe.jsx(Fv,{vault:x,children:oe.jsx(eb,{...S,children:oe.jsx(SD,{ref:m,height:n,components:p,spacing:u,canvasProps:a,annotations:i,header:f,mode:g,children:e})})})});Ti.RenderImage=Rb,Ti.RenderCanvas=UE,Ti.RenderAnnotationPage=Jv,Ti.RenderAnnotation=Cb,Ti.Viewer=pL,Ti.CanvasBackground=_E,Ti.Audio=TE,Ti.Video=AE,Ti.Model=OE,Ti.AudioHTML=CE,Ti.VideoHTML=RE,Ti.ModelHTML=ME;function bD({annotation:t,children:e}){return oe.jsx(ca,{value:{annotation:t},children:e})}function ED({annotationPage:t,children:e}){return oe.jsx(ca,{value:{annotationPage:t},children:e})}function xD({collection:t,children:e}){return oe.jsx(ca,{value:{collection:t},children:e})}function wD(t,e={}){return qd(e)}function CD(t,e=!1){}function TD(t){const n=As().manifest,i=t?t.map(a=>typeof a=="string"?a:a==null?void 0:a.id):[];return ni(a=>{const u=n?a.iiif.entities.Manifest[n]:void 0,f=(u==null?void 0:u.items)||[];if(typeof t>"u")return f;const p=[];for(const g of(u==null?void 0:u.items)||[])i.indexOf(g.id)!==-1&&p.push(g);return p},[i.join("/")])}function RD(t,e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.collection,f=ni(p=>u?p.iiif.entities.Collection[u]:void 0,[u]);return R.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function AD(t,e,n,i,a=[]){const u=Un(),f=R.useMemo(()=>vb(u),[u]);R.useEffect(()=>{const p=t;return p?(f.addEventListener(p,e,n,i),()=>{f.removeEventListener(p,e,n)}):()=>{}},[f,t,e,...a])}function MD(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function FE({cacheKey:t}={}){const e=Jr(),n=qd(),i=Un(),a=Wd(),[u,f]=R.useState(void 0),[p,g]=R.useState(!1),[S,m]=R.useState("idle"),[x,T]=R.useState(void 0),_=e?e.id:"undefined",M=R.useMemo(()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];return j&&a.loadServiceSync({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0}}catch(L){console.error(L)}},[_,t,e]),k=S==="success"&&u?u:M;return R.useEffect(()=>{(async()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];if(!j)return;g(!0),m("loading");try{const q=await a.loadService({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0;f(q),m("success"),g(!1)}catch(q){m("error"),T(q)}}}catch(L){m("error"),T(L)}})()},[_,t]),R.useMemo(()=>({data:k,isFetching:p,status:S,error:x}),[k,p,S,x])}function OD(){const t=FE();return{isLoading:t.isFetching,tile:t.data?{id:t.data.id||t.data["@id"],width:t.data.width,height:t.data.height,imageService:t.data,thumbnail:void 0}:null}}function _D(){const t=ya();return t?t.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function LD(){const t=Un();return R.useMemo(()=>Qv(t),[t])}var Vl={},cm,fm,Lc=by;if(process.env.NODE_ENV==="production")fm=Vl.createRoot=Lc.createRoot,cm=Vl.hydrateRoot=Lc.hydrateRoot;else{var Kd=Lc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;fm=Vl.createRoot=function(t,e){Kd.usingClientEntryPoint=!0;try{return Lc.createRoot(t,e)}finally{Kd.usingClientEntryPoint=!1}},cm=Vl.hydrateRoot=function(t,e,n){Kd.usingClientEntryPoint=!0;try{return Lc.hydrateRoot(t,e,n)}finally{Kd.usingClientEntryPoint=!1}}}const PD=Kw({__proto__:null,get createRoot(){return fm},default:Vl,get hydrateRoot(){return cm}},[Vl]);de.AnnotationContext=bD,de.AnnotationPageContext=ED,de.CanvasContext=zd,de.CanvasPanel=Ti,de.CollectionContext=xD,de.ContextBridge=ib,de.ImageServiceLoaderContext=cE,de.InnerViewerProvider=JS,de.LanguageProvider=vD,de.LanguageString=DE,de.LocaleString=zE,de.ManifestContext=QS,de.MediaPlayerProvider=um,de.RangeContext=GS,de.ReactVaultContext=bc,de.ResourceProvider=ca,de.ResourceReactContext=kd,de.SimpleViewerProvider=eb,de.SimpleViewerReactContext=wc,de.VaultProvider=Fv,de.ViewerPresetContext=Ud,de.VirtualAnnotationProvider=ub,de.VisibleCanvasReactContext=Ec,de.emptyActions=sE,de.emptyStrategy=aE,de.expandTarget=Sa,de.findAllCanvasesInRange=Vv,de.findFirstCanvasFromRange=XS,de.findManifestSelectedRange=$_,de.findSelectedRange=$v,de.flattenAnnotationPageIds=oE,de.formatTime=bE,de.getImageStrategy=pE,de.getManifestSequence=Wv,de.getParsedTargetSelector=lm,de.getVisibleCanvasesFromCanvasId=W_,de.isImageApiSelector=xb,de.parseRotation=wb,de.parseSelector=Ac,de.parseSpecificResource=XP,de.unknownResponse=$d,de.unsupportedStrategy=Pn,de.useAnnotation=Zv,de.useAnnotationPage=Tb,de.useAnnotationPageManager=lE,de.useAnnotationsAtTime=wD,de.useCanvas=Jr,de.useCanvasClock=CD,de.useCanvasSequence=ZS,de.useCanvasSubset=TD,de.useClosestLanguage=IE,de.useCollection=RD,de.useContextBridge=nb,de.useCreateLocaleString=mD,de.useDispatch=rb,de.useEventListener=AD,de.useExistingVault=jE,de.useExternalCollection=MD,de.useExternalManifest=YS,de.useExternalResource=Bv,de.useIIIFLanguage=Xd,de.useImageService=FE,de.useImageServiceLoader=Wd,de.useImageTile=OD,de.useLoadImageService=fE,de.useLocaleString=NE,de.useManifest=ya,de.useMediaActions=hD,de.useMediaElements=pD,de.useMediaState=dD,de.usePaintables=hE,de.usePaintingAnnotations=qd,de.useRange=KS,de.useRenderingStrategy=mE,de.useResourceContext=As,de.useResourceEvents=Yv,de.useResources=uE,de.useSearchService=_D,de.useSimpleMediaPlayer=Gd,de.useSimpleViewer=tb,de.useStyleHelper=LD,de.useStyles=Cc,de.useThumbnail=SE,de.useVault=Un,de.useVaultEffect=gE,de.useVaultSelector=ni,de.useViewerPreset=cb,de.useVirtualAnnotationPage=ab,de.useVirtualAnnotationPageContext=lb,de.useVisibleCanvases=Hv,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
394
+ `}),oe.jsx("iframe",{className:"video-yt",ref:i,src:`https://www.youtube.com/embed/${e.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function SD({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:u},f,p]=Gd({duration:t.duration});return Fl("overlay","video-element",yD,{element:i,media:t,playPause:p.playPause}),null}function HE({x:t,y:e,onChoiceChange:n,registerActions:i,defaultChoices:a,isStatic:u,renderViewerControls:f,renderMediaControls:p,viewControlsDeps:g,mediaControlsDeps:S,strategies:m,throwOnUnknown:x,backgroundStyle:R,alwaysShowBackground:_,keepCanvasScale:M=!1,enableSizes:k=!1,enableYouTube:L=!0,onClickPaintingAnnotation:P,children:O}){const j=Jr(),q=Yv(j,["deep-zoom"]),[ee]=lb(),H=cb(),Z=Un(),ie=T.useMemo(()=>Qv(Z),[Z]),[W,re]=bE({strategies:m||["images"],defaultChoices:a==null?void 0:a.map(({id:me})=>me)}),ge=W.type==="images"?W.choice:void 0,be=T.useMemo(()=>M?1:Math.max(1,...W.type==="images"?W.images.map(me=>{var tt;return(me.width||0)/((tt=me.target)==null?void 0:tt.spatial.width)}):[]),[M,W]);gL(be),T.useEffect(()=>{i&&i(re)},[W.annotations]),T.useEffect(()=>{if(a)for(const me of a)typeof me.opacity<"u"&&ie.applyStyles({id:me.id},"atlas",{opacity:me.opacity})},[a]),T.useLayoutEffect(()=>{n&&n(ge)},[ge]),Fl(H&&(W.type==="images"||W.type==="empty"||W.type==="textual-content"&&f)?"overlay":"none",`canvas-portal-controls-${j==null?void 0:j.id}`,Ud.Provider,f?{value:H||null,children:f(W)}:{},[j,H,W,...g||[]]);const Ee=wE({maxWidth:256,maxHeight:256});if(!j)return null;const Ue=j.accompanyingCanvas,je=Ee&&Ee.type==="fixed"?oe.jsx("world-object",{height:j.height,width:j.width,x:t,y:e,children:oe.jsx("world-image",{uri:Ee.id,target:{x:0,y:0,width:j.width,height:j.height},display:Ee.width&&Ee.height?{width:Ee.width,height:Ee.height}:void 0,crop:void 0})}):null;if(W.type==="unknown"){if(je)return je;if(x)throw new Error(W.reason||"Unknown image strategy");return null}const Xe=oe.jsxs(T.Fragment,{children:[ee?oe.jsx(Jv,{page:ee}):null,W.annotations&&W.annotations.pages?W.annotations.pages.map(me=>oe.jsx(Jv,{page:me},me.id)):null,O]}),ce=W.type==="images"?W.images.length:0;return oe.jsxs(oe.Fragment,{children:[oe.jsxs("world-object",{height:j.height,width:j.width,x:t,y:e,...q,children:[W.type==="empty"||_?oe.jsx(kE,{style:R}):null,W.type==="textual-content"?W.items.map((me,tt)=>{var mt;return oe.jsxs(oe.Fragment,{children:[oe.jsx(hv,{onClick:P?he=>{he.stopPropagation(),P(me.annotationId,me,he)}:void 0,target:((mt=me.target)==null?void 0:mt.spatial)||void 0,children:oe.jsx("div",{"data-textual-content":!0,children:oe.jsx(BE,{enableDangerouslySetInnerHTML:!0,children:me.text})})},tt),Xe]})}):null,W.type==="images"?oe.jsxs(oe.Fragment,{children:[W.images.map((me,tt)=>oe.jsx(Rb,{isStatic:u,image:me,id:me.id,thumbnail:tt===0?Ee:void 0,selector:me.selector,enableSizes:k,onClick:P?mt=>{mt.stopPropagation(),P(me.annotationId,me,mt)}:void 0},me.id+tt)),Xe]}):null,W.type==="3d-model"?oe.jsx(DE,{model:W.model}):null,W.type==="media"?oe.jsx(oe.Fragment,{children:W.media.type==="Sound"?oe.jsxs(OE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="Video"?oe.jsxs(LE,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):W.media.type==="VideoYouTube"&&L?oe.jsxs(SD,{media:W.media,mediaControlsDeps:S,children:[je,p?p(W):null]}):null}):null]},`${j.id}/${W.type}/${ce}`),W.type==="media"&&W.media.type==="Sound"&&Ue?oe.jsx(zd,{canvas:Ue.id,children:oe.jsx(HE,{renderViewerControls:f})}):null]})}function VE(){const t=T.useContext(bc);return t&&t.vault?t.vault:qS()}const bD=T.forwardRef(function(e,n){const i=ya(),a=Hv(),u=tb(),{ViewerControls:f,MediaControls:p}=e.components||{};if(T.useImperativeHandle(n,()=>u,[u]),!i)return oe.jsx("div",{});let g=0;return oe.jsxs(oe.Fragment,{children:[e.header,oe.jsx(Ti.Viewer,{height:e.height,mode:e.mode,children:a.map((S,m)=>{const x=g;return g+=S.width+(e.spacing||0),oe.jsx(zd,{canvas:S.id,children:oe.jsx(Ti.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content"],renderViewerControls:m===0&&f?()=>oe.jsx(f,{}):void 0,renderMediaControls:m===0&&p?()=>oe.jsx(p,{}):void 0,x,...e.canvasProps||{},children:e.annotations},S.id)},S.id)})},e.reuseAtlas?"":u.currentSequenceIndex),e.children]})}),Ti=T.forwardRef(function({children:e,height:n,annotations:i,canvasProps:a,spacing:u,header:f,components:p,mode:g,...S},m){const x=VE();return oe.jsx(Fv,{vault:x,children:oe.jsx(eb,{...S,children:oe.jsx(bD,{ref:m,height:n,components:p,spacing:u,canvasProps:a,annotations:i,header:f,mode:g,children:e})})})});Ti.RenderImage=Rb,Ti.RenderCanvas=HE,Ti.RenderAnnotationPage=Jv,Ti.RenderAnnotation=Cb,Ti.Viewer=yL,Ti.CanvasBackground=kE,Ti.Audio=OE,Ti.Video=LE,Ti.Model=DE,Ti.AudioHTML=ME,Ti.VideoHTML=_E,Ti.ModelHTML=PE;function ED({annotation:t,children:e}){return oe.jsx(ca,{value:{annotation:t},children:e})}function xD({annotationPage:t,children:e}){return oe.jsx(ca,{value:{annotationPage:t},children:e})}function wD({collection:t,children:e}){return oe.jsx(ca,{value:{collection:t},children:e})}function CD(t,e={}){return qd(e)}function TD(t,e=!1){}function RD(t){const n=As().manifest,i=t?t.map(a=>typeof a=="string"?a:a==null?void 0:a.id):[];return ni(a=>{const u=n?a.iiif.entities.Manifest[n]:void 0,f=(u==null?void 0:u.items)||[];if(typeof t>"u")return f;const p=[];for(const g of(u==null?void 0:u.items)||[])i.indexOf(g.id)!==-1&&p.push(g);return p},[i.join("/")])}function AD(t,e=[]){const{id:n,selector:i}=t,a=As(),u=n||a.collection,f=ni(p=>u?p.iiif.entities.Collection[u]:void 0,[u]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function MD(t,e,n,i,a=[]){const u=Un(),f=T.useMemo(()=>vb(u),[u]);T.useEffect(()=>{const p=t;return p?(f.addEventListener(p,e,n,i),()=>{f.removeEventListener(p,e,n)}):()=>{}},[f,t,e,...a])}function OD(t,e){const{id:n,isLoaded:i,error:a,resource:u,requestId:f,cached:p}=Bv(t,e);return{id:n,isLoaded:i,error:a,manifest:u,requestId:f,cached:p}}function $E({cacheKey:t}={}){const e=Jr(),n=qd(),i=Un(),a=Wd(),[u,f]=T.useState(void 0),[p,g]=T.useState(!1),[S,m]=T.useState("idle"),[x,R]=T.useState(void 0),_=e?e.id:"undefined",M=T.useMemo(()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];return j&&a.loadServiceSync({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0}}catch(L){console.error(L)}},[_,t,e]),k=S==="success"&&u?u:M;return T.useEffect(()=>{(async()=>{try{if(e&&n.length){const L=n[0],P=i.get(L.body[0]),j=Ka.getImageServices(P)[0];if(!j)return;g(!0),m("loading");try{const q=await a.loadService({id:j.id||j["@id"],width:j.width||e.width,height:j.height||e.height})||void 0;f(q),m("success"),g(!1)}catch(q){m("error"),R(q)}}}catch(L){m("error"),R(L)}})()},[_,t]),T.useMemo(()=>({data:k,isFetching:p,status:S,error:x}),[k,p,S,x])}function _D(){const t=$E();return{isLoading:t.isFetching,tile:t.data?{id:t.data.id||t.data["@id"],width:t.data.width,height:t.data.height,imageService:t.data,thumbnail:void 0}:null}}function LD(){const t=ya();return t?t.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function PD(){const t=Un();return T.useMemo(()=>Qv(t),[t])}var Vl={},cm,fm,Lc=by;if(process.env.NODE_ENV==="production")fm=Vl.createRoot=Lc.createRoot,cm=Vl.hydrateRoot=Lc.hydrateRoot;else{var Kd=Lc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;fm=Vl.createRoot=function(t,e){Kd.usingClientEntryPoint=!0;try{return Lc.createRoot(t,e)}finally{Kd.usingClientEntryPoint=!1}},cm=Vl.hydrateRoot=function(t,e,n){Kd.usingClientEntryPoint=!0;try{return Lc.hydrateRoot(t,e,n)}finally{Kd.usingClientEntryPoint=!1}}}const DD=tC({__proto__:null,get createRoot(){return fm},default:Vl,get hydrateRoot(){return cm}},[Vl]);fe.AnnotationContext=ED,fe.AnnotationPageContext=xD,fe.CanvasContext=zd,fe.CanvasPanel=Ti,fe.CollectionContext=wD,fe.ContextBridge=ib,fe.ImageServiceLoaderContext=cE,fe.InnerViewerProvider=JS,fe.LanguageProvider=mD,fe.LanguageString=zE,fe.LocaleString=BE,fe.ManifestContext=QS,fe.MediaPlayerProvider=um,fe.RangeContext=GS,fe.ReactVaultContext=bc,fe.ResourceProvider=ca,fe.ResourceReactContext=kd,fe.SimpleViewerProvider=eb,fe.SimpleViewerReactContext=wc,fe.VaultProvider=Fv,fe.ViewerPresetContext=Ud,fe.VirtualAnnotationProvider=ub,fe.VisibleCanvasReactContext=Ec,fe.emptyActions=sE,fe.emptyStrategy=aE,fe.expandTarget=Sa,fe.findAllCanvasesInRange=Vv,fe.findFirstCanvasFromRange=XS,fe.findManifestSelectedRange=Q_,fe.findSelectedRange=$v,fe.flattenAnnotationPageIds=oE,fe.formatTime=CE,fe.get3dStrategy=pE,fe.getImageStrategy=vE,fe.getManifestSequence=Wv,fe.getParsedTargetSelector=lm,fe.getRenderingStrategy=SE,fe.getTextualContentStrategy=gE,fe.getVideoStrategy=yE,fe.getVisibleCanvasesFromCanvasId=G_,fe.isImageApiSelector=xb,fe.parseRotation=wb,fe.parseSelector=Ac,fe.parseSpecificResource=eD,fe.unknownResponse=$d,fe.unsupportedStrategy=Pn,fe.useAnnotation=Zv,fe.useAnnotationPage=Tb,fe.useAnnotationPageManager=lE,fe.useAnnotationsAtTime=CD,fe.useCanvas=Jr,fe.useCanvasClock=TD,fe.useCanvasSequence=ZS,fe.useCanvasSubset=RD,fe.useClosestLanguage=jE,fe.useCollection=AD,fe.useContextBridge=nb,fe.useCreateLocaleString=gD,fe.useDispatch=rb,fe.useEventListener=MD,fe.useExistingVault=VE,fe.useExternalCollection=OD,fe.useExternalManifest=YS,fe.useExternalResource=Bv,fe.useIIIFLanguage=Xd,fe.useImageService=$E,fe.useImageServiceLoader=Wd,fe.useImageTile=_D,fe.useLoadImageService=fE,fe.useLocaleString=FE,fe.useManifest=ya,fe.useMediaActions=pD,fe.useMediaElements=vD,fe.useMediaState=hD,fe.usePaintables=hE,fe.usePaintingAnnotations=qd,fe.useRange=KS,fe.useRenderingStrategy=bE,fe.useResourceContext=As,fe.useResourceEvents=Yv,fe.useResources=uE,fe.useSearchService=LD,fe.useSimpleMediaPlayer=Gd,fe.useSimpleViewer=tb,fe.useStyleHelper=PD,fe.useStyles=Cc,fe.useThumbnail=wE,fe.useVault=Un,fe.useVaultEffect=EE,fe.useVaultSelector=ni,fe.useViewerPreset=cb,fe.useVirtualAnnotationPage=ab,fe.useVirtualAnnotationPageContext=lb,fe.useVisibleCanvases=Hv,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
395
395
  //# sourceMappingURL=index.umd.js.map