react-iiif-vault 1.0.11 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/bundle.d.ts +1059 -0
  2. package/dist/bundle.global.js +227 -0
  3. package/dist/canvas-panel.cjs +46 -0
  4. package/dist/canvas-panel.d.cts +11 -0
  5. package/dist/canvas-panel.d.ts +11 -0
  6. package/dist/canvas-panel.js +1 -0
  7. package/dist/chunk-DXFXJCXN.js +1 -0
  8. package/dist/chunk-VPKD2BBH.js +47 -0
  9. package/dist/index-BZirmhnp.d.cts +188 -0
  10. package/dist/index-Cxs6aAuK.d.ts +188 -0
  11. package/dist/index.cjs +47 -0
  12. package/dist/index.d.cts +722 -0
  13. package/dist/index.d.ts +722 -0
  14. package/dist/index.js +1 -0
  15. package/dist/useRenderingStrategy-Xj9yQm4y.d.cts +145 -0
  16. package/dist/useRenderingStrategy-Xj9yQm4y.d.ts +145 -0
  17. package/dist/utils.cjs +1 -0
  18. package/dist/utils.d.cts +32 -0
  19. package/dist/utils.d.ts +32 -0
  20. package/dist/utils.js +1 -0
  21. package/package.json +67 -70
  22. package/.build/types/canvas-panel/Viewer.d.ts +0 -14
  23. package/.build/types/canvas-panel/context/overlays.d.ts +0 -3
  24. package/.build/types/canvas-panel/context/world-size.d.ts +0 -2
  25. package/.build/types/canvas-panel/index.d.ts +0 -46
  26. package/.build/types/canvas-panel/render/Annotation.d.ts +0 -8
  27. package/.build/types/canvas-panel/render/AnnotationPage.d.ts +0 -7
  28. package/.build/types/canvas-panel/render/Audio.d.ts +0 -11
  29. package/.build/types/canvas-panel/render/Canvas.d.ts +0 -34
  30. package/.build/types/canvas-panel/render/CanvasBackground.d.ts +0 -4
  31. package/.build/types/canvas-panel/render/DefaultCanvasFallback.d.ts +0 -6
  32. package/.build/types/canvas-panel/render/Image.d.ts +0 -16
  33. package/.build/types/canvas-panel/render/Model.d.ts +0 -7
  34. package/.build/types/canvas-panel/render/Video.d.ts +0 -12
  35. package/.build/types/canvas-panel/render/VideoYouTube.d.ts +0 -12
  36. package/.build/types/components/CanvasAnnotations.d.ts +0 -10
  37. package/.build/types/components/CombinedMetadata.d.ts +0 -4
  38. package/.build/types/components/Image.d.ts +0 -15
  39. package/.build/types/components/ManifestMetadata.d.ts +0 -4
  40. package/.build/types/components/Metadata.d.ts +0 -39
  41. package/.build/types/components/SequenceThumbnails.d.ts +0 -29
  42. package/.build/types/components/SingleCanvasThumbnail.d.ts +0 -20
  43. package/.build/types/context/AnnotationContext.d.ts +0 -5
  44. package/.build/types/context/AnnotationPageContext.d.ts +0 -5
  45. package/.build/types/context/CanvasContext.d.ts +0 -5
  46. package/.build/types/context/CollectionContext.d.ts +0 -5
  47. package/.build/types/context/ContextBridge.d.ts +0 -14
  48. package/.build/types/context/ImageServiceLoaderContext.d.ts +0 -4
  49. package/.build/types/context/ManifestContext.d.ts +0 -5
  50. package/.build/types/context/MediaContext.d.ts +0 -17
  51. package/.build/types/context/RangeContext.d.ts +0 -5
  52. package/.build/types/context/ResourceContext.d.ts +0 -15
  53. package/.build/types/context/VaultContext.d.ts +0 -14
  54. package/.build/types/context/ViewerPresetContext.d.ts +0 -3
  55. package/.build/types/context/VisibleCanvasContext.d.ts +0 -4
  56. package/.build/types/demo/demo.d.ts +0 -1
  57. package/.build/types/demo/media-controls.d.ts +0 -1
  58. package/.build/types/demo/viewer-controls.d.ts +0 -1
  59. package/.build/types/features/rendering-strategy/3d-strategy.d.ts +0 -12
  60. package/.build/types/features/rendering-strategy/audio-strategy.d.ts +0 -3
  61. package/.build/types/features/rendering-strategy/get-rendering-strategy.d.ts +0 -11
  62. package/.build/types/features/rendering-strategy/image-strategy.d.ts +0 -12
  63. package/.build/types/features/rendering-strategy/rendering-utils.d.ts +0 -12
  64. package/.build/types/features/rendering-strategy/resource-types.d.ts +0 -55
  65. package/.build/types/features/rendering-strategy/strategies.d.ts +0 -31
  66. package/.build/types/features/rendering-strategy/textual-content-strategy.d.ts +0 -16
  67. package/.build/types/features/rendering-strategy/video-strategy.d.ts +0 -3
  68. package/.build/types/future-helpers/ranges.d.ts +0 -7
  69. package/.build/types/future-helpers/sequences.d.ts +0 -8
  70. package/.build/types/hooks/useAnnotation.d.ts +0 -8
  71. package/.build/types/hooks/useAnnotationPage.d.ts +0 -8
  72. package/.build/types/hooks/useAnnotationPageManager.d.ts +0 -10
  73. package/.build/types/hooks/useAnnotationsAtTime.d.ts +0 -4
  74. package/.build/types/hooks/useCanvas.d.ts +0 -8
  75. package/.build/types/hooks/useCanvasClock.d.ts +0 -1
  76. package/.build/types/hooks/useCanvasSelector.d.ts +0 -0
  77. package/.build/types/hooks/useCanvasSubset.d.ts +0 -2
  78. package/.build/types/hooks/useCanvasTimeline.d.ts +0 -0
  79. package/.build/types/hooks/useCollection.d.ts +0 -8
  80. package/.build/types/hooks/useDispatch.d.ts +0 -2
  81. package/.build/types/hooks/useEnabledAnnotationPageIds.d.ts +0 -1
  82. package/.build/types/hooks/useEventListener.d.ts +0 -4
  83. package/.build/types/hooks/useExistingVault.d.ts +0 -2
  84. package/.build/types/hooks/useExternalCollection.d.ts +0 -13
  85. package/.build/types/hooks/useExternalManifest.d.ts +0 -13
  86. package/.build/types/hooks/useExternalResource.d.ts +0 -16
  87. package/.build/types/hooks/useImage.d.ts +0 -10
  88. package/.build/types/hooks/useImageService.d.ts +0 -9
  89. package/.build/types/hooks/useImageTile.d.ts +0 -11
  90. package/.build/types/hooks/useLoadImageService.d.ts +0 -6
  91. package/.build/types/hooks/useManifest.d.ts +0 -8
  92. package/.build/types/hooks/usePaintables.d.ts +0 -9
  93. package/.build/types/hooks/usePaintingAnnotations.d.ts +0 -5
  94. package/.build/types/hooks/useRange.d.ts +0 -8
  95. package/.build/types/hooks/useRenderingStrategy.d.ts +0 -15
  96. package/.build/types/hooks/useResourceEvents.d.ts +0 -3
  97. package/.build/types/hooks/useResources.d.ts +0 -1
  98. package/.build/types/hooks/useSearchService.d.ts +0 -2
  99. package/.build/types/hooks/useSimpleMediaPlayer.d.ts +0 -32
  100. package/.build/types/hooks/useStyleHelper.d.ts +0 -1
  101. package/.build/types/hooks/useStyles.d.ts +0 -3
  102. package/.build/types/hooks/useThumbnail.d.ts +0 -5
  103. package/.build/types/hooks/useVault.d.ts +0 -2
  104. package/.build/types/hooks/useVaultEffect.d.ts +0 -2
  105. package/.build/types/hooks/useVaultSelector.d.ts +0 -2
  106. package/.build/types/hooks/useVirtualAnnotationPage.d.ts +0 -14
  107. package/.build/types/hooks/useVirtualAnnotationPageContext.d.ts +0 -671
  108. package/.build/types/hooks/useVirtualCanvas.d.ts +0 -0
  109. package/.build/types/index.d.ts +0 -72
  110. package/.build/types/utility/flatten-annotation-page-ids.d.ts +0 -7
  111. package/.build/types/utility/i18n-utils.d.ts +0 -30
  112. package/.build/types/utils.d.ts +0 -2
  113. package/.build/types/viewers/SimpleViewerContext.d.ts +0 -6
  114. package/.build/types/viewers/SimpleViewerContext.hooks.d.ts +0 -19
  115. package/.build/types/viewers/SimpleViewerContext.types.d.ts +0 -46
  116. package/.build/types/viewers/SingleCanvasContext.d.ts +0 -1
  117. package/dist/bundle/cjs/index.js +0 -49
  118. package/dist/bundle/cjs/index.js.map +0 -1
  119. package/dist/bundle/esm/index.mjs +0 -3319
  120. package/dist/bundle/esm/index.mjs.map +0 -1
  121. package/dist/canvas-panel/cjs/canvas-panel.js +0 -47
  122. package/dist/canvas-panel/cjs/canvas-panel.js.map +0 -1
  123. package/dist/canvas-panel/esm/canvas-panel.mjs +0 -1858
  124. package/dist/canvas-panel/esm/canvas-panel.mjs.map +0 -1
  125. package/dist/index.umd.js +0 -393
  126. package/dist/index.umd.js.map +0 -1
  127. package/dist/react17/cjs/index.js +0 -49
  128. package/dist/react17/cjs/index.js.map +0 -1
  129. package/dist/react17/esm/index.mjs +0 -3319
  130. package/dist/react17/esm/index.mjs.map +0 -1
  131. package/dist/utils/cjs/utils.js +0 -2
  132. package/dist/utils/cjs/utils.js.map +0 -1
  133. package/dist/utils/esm/utils.mjs +0 -238
  134. package/dist/utils/esm/utils.mjs.map +0 -1
package/dist/index.umd.js DELETED
@@ -1,393 +0,0 @@
1
- (function(me,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react"),require("react-dom"),require("@iiif/helpers/vault"),require("@atlas-viewer/iiif-image-api")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@iiif/helpers/vault","@atlas-viewer/iiif-image-api"],T):(me=typeof globalThis<"u"?globalThis:me||self,T(me.ReactIIIFVault={},me.React,me.ReactDOM,me.IIIFVault,me.IIIFImageApi))})(this,function(me,T,Zh,hf,Ss){"use strict";function qx(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 Yx(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 c=Object.getOwnPropertyDescriptor(i,a);c&&Object.defineProperty(t,a,c.get?c:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ve=qx(T);function Qx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jh={exports:{}},Tu={};/**
2
- * @license React
3
- * react-jsx-runtime.development.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Tg;function Gx(){return Tg||(Tg=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"),c=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),M=Symbol.iterator,z="@@iterator";function P(U){if(U===null||typeof U!="object")return null;var xe=M&&U[M]||U[z];return typeof xe=="function"?xe:null}var L=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(U){{for(var xe=arguments.length,_e=new Array(xe>1?xe-1:0),dt=1;dt<xe;dt++)_e[dt-1]=arguments[dt];F("error",U,_e)}}function F(U,xe,_e){{var dt=L.ReactDebugCurrentFrame,Dt=dt.getStackAddendum();Dt!==""&&(xe+="%s",_e=_e.concat([Dt]));var Ht=_e.map(function(Rt){return String(Rt)});Ht.unshift("Warning: "+xe),Function.prototype.apply.call(console[U],console,Ht)}}var $=!1,Q=!1,_=!1,K=!1,ee=!1,V;V=Symbol.for("react.module.reference");function ae(U){return!!(typeof U=="string"||typeof U=="function"||U===i||U===c||ee||U===a||U===x||U===m||K||U===D||$||Q||_||typeof U=="object"&&U!==null&&(U.$$typeof===R||U.$$typeof===w||U.$$typeof===f||U.$$typeof===p||U.$$typeof===g||U.$$typeof===V||U.getModuleId!==void 0))}function ge(U,xe,_e){var dt=U.displayName;if(dt)return dt;var Dt=xe.displayName||xe.name||"";return Dt!==""?_e+"("+Dt+")":_e}function we(U){return U.displayName||"Context"}function Ee(U){if(U==null)return null;if(typeof U.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof U=="function")return U.displayName||U.name||null;if(typeof U=="string")return U;switch(U){case i:return"Fragment";case n:return"Portal";case c:return"Profiler";case a:return"StrictMode";case x:return"Suspense";case m:return"SuspenseList"}if(typeof U=="object")switch(U.$$typeof){case p:var xe=U;return we(xe)+".Consumer";case f:var _e=U;return we(_e._context)+".Provider";case g:return ge(U,U.render,"ForwardRef");case w:var dt=U.displayName||null;return dt!==null?dt:Ee(U.type)||"Memo";case R:{var Dt=U,Ht=Dt._payload,Rt=Dt._init;try{return Ee(Rt(Ht))}catch{return null}}}return null}var Ue=Object.assign,Fe=0,Be,vt,Oe,it,nt,W,Re;function Ie(){}Ie.__reactDisabledLog=!0;function tt(){{if(Fe===0){Be=console.log,vt=console.info,Oe=console.warn,it=console.error,nt=console.group,W=console.groupCollapsed,Re=console.groupEnd;var U={configurable:!0,enumerable:!0,value:Ie,writable:!0};Object.defineProperties(console,{info:U,log:U,warn:U,error:U,group:U,groupCollapsed:U,groupEnd:U})}Fe++}}function at(){{if(Fe--,Fe===0){var U={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ue({},U,{value:Be}),info:Ue({},U,{value:vt}),warn:Ue({},U,{value:Oe}),error:Ue({},U,{value:it}),group:Ue({},U,{value:nt}),groupCollapsed:Ue({},U,{value:W}),groupEnd:Ue({},U,{value:Re})})}Fe<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $t=L.ReactCurrentDispatcher,jt;function yt(U,xe,_e){{if(jt===void 0)try{throw Error()}catch(Dt){var dt=Dt.stack.trim().match(/\n( *(at )?)/);jt=dt&&dt[1]||""}return`
10
- `+jt+U}}var xt=!1,Pt;{var St=typeof WeakMap=="function"?WeakMap:Map;Pt=new St}function ht(U,xe){if(!U||xt)return"";{var _e=Pt.get(U);if(_e!==void 0)return _e}var dt;xt=!0;var Dt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ht;Ht=$t.current,$t.current=null,tt();try{if(xe){var Rt=function(){throw Error()};if(Object.defineProperty(Rt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Rt,[])}catch(Ot){dt=Ot}Reflect.construct(U,[],Rt)}else{try{Rt.call()}catch(Ot){dt=Ot}U.call(Rt.prototype)}}else{try{throw Error()}catch(Ot){dt=Ot}U()}}catch(Ot){if(Ot&&dt&&typeof Ot.stack=="string"){for(var Et=Ot.stack.split(`
11
- `),An=dt.stack.split(`
12
- `),Zt=Et.length-1,rn=An.length-1;Zt>=1&&rn>=0&&Et[Zt]!==An[rn];)rn--;for(;Zt>=1&&rn>=0;Zt--,rn--)if(Et[Zt]!==An[rn]){if(Zt!==1||rn!==1)do if(Zt--,rn--,rn<0||Et[Zt]!==An[rn]){var Wn=`
13
- `+Et[Zt].replace(" at new "," at ");return U.displayName&&Wn.includes("<anonymous>")&&(Wn=Wn.replace("<anonymous>",U.displayName)),typeof U=="function"&&Pt.set(U,Wn),Wn}while(Zt>=1&&rn>=0);break}}}finally{xt=!1,$t.current=Ht,at(),Error.prepareStackTrace=Dt}var ar=U?U.displayName||U.name:"",Vr=ar?yt(ar):"";return typeof U=="function"&&Pt.set(U,Vr),Vr}function ke(U,xe,_e){return ht(U,!1)}function qe(U){var xe=U.prototype;return!!(xe&&xe.isReactComponent)}function st(U,xe,_e){if(U==null)return"";if(typeof U=="function")return ht(U,qe(U));if(typeof U=="string")return yt(U);switch(U){case x:return yt("Suspense");case m:return yt("SuspenseList")}if(typeof U=="object")switch(U.$$typeof){case g:return ke(U.render);case w:return st(U.type,xe,_e);case R:{var dt=U,Dt=dt._payload,Ht=dt._init;try{return st(Ht(Dt),xe,_e)}catch{}}}return""}var wt=Object.prototype.hasOwnProperty,vn={},I=L.ReactDebugCurrentFrame;function N(U){if(U){var xe=U._owner,_e=st(U.type,U._source,xe?xe.type:null);I.setExtraStackFrame(_e)}else I.setExtraStackFrame(null)}function Z(U,xe,_e,dt,Dt){{var Ht=Function.call.bind(wt);for(var Rt in U)if(Ht(U,Rt)){var Et=void 0;try{if(typeof U[Rt]!="function"){var An=Error((dt||"React class")+": "+_e+" type `"+Rt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof U[Rt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw An.name="Invariant Violation",An}Et=U[Rt](xe,Rt,dt,_e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Zt){Et=Zt}Et&&!(Et instanceof Error)&&(N(Dt),A("%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).",dt||"React class",_e,Rt,typeof Et),N(null)),Et instanceof Error&&!(Et.message in vn)&&(vn[Et.message]=!0,N(Dt),A("Failed %s type: %s",_e,Et.message),N(null))}}}var Me=Array.isArray;function ft(U){return Me(U)}function et(U){{var xe=typeof Symbol=="function"&&Symbol.toStringTag,_e=xe&&U[Symbol.toStringTag]||U.constructor.name||"Object";return _e}}function Ft(U){try{return mn(U),!1}catch{return!0}}function mn(U){return""+U}function Le(U){if(Ft(U))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",et(U)),mn(U)}var oe=L.ReactCurrentOwner,X={key:!0,ref:!0,__self:!0,__source:!0},de,le,he;he={};function be(U){if(wt.call(U,"ref")){var xe=Object.getOwnPropertyDescriptor(U,"ref").get;if(xe&&xe.isReactWarning)return!1}return U.ref!==void 0}function Ve(U){if(wt.call(U,"key")){var xe=Object.getOwnPropertyDescriptor(U,"key").get;if(xe&&xe.isReactWarning)return!1}return U.key!==void 0}function J(U,xe){if(typeof U.ref=="string"&&oe.current&&xe&&oe.current.stateNode!==xe){var _e=Ee(oe.current.type);he[_e]||(A('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(oe.current.type),U.ref),he[_e]=!0)}}function re(U,xe){{var _e=function(){de||(de=!0,A("%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)",xe))};_e.isReactWarning=!0,Object.defineProperty(U,"key",{get:_e,configurable:!0})}}function De(U,xe){{var _e=function(){le||(le=!0,A("%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)",xe))};_e.isReactWarning=!0,Object.defineProperty(U,"ref",{get:_e,configurable:!0})}}var Ae=function(U,xe,_e,dt,Dt,Ht,Rt){var Et={$$typeof:e,type:U,key:xe,ref:_e,props:Rt,_owner:Ht};return Et._store={},Object.defineProperty(Et._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Et,"_self",{configurable:!1,enumerable:!1,writable:!1,value:dt}),Object.defineProperty(Et,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Dt}),Object.freeze&&(Object.freeze(Et.props),Object.freeze(Et)),Et};function Ne(U,xe,_e,dt,Dt){{var Ht,Rt={},Et=null,An=null;_e!==void 0&&(Le(_e),Et=""+_e),Ve(xe)&&(Le(xe.key),Et=""+xe.key),be(xe)&&(An=xe.ref,J(xe,Dt));for(Ht in xe)wt.call(xe,Ht)&&!X.hasOwnProperty(Ht)&&(Rt[Ht]=xe[Ht]);if(U&&U.defaultProps){var Zt=U.defaultProps;for(Ht in Zt)Rt[Ht]===void 0&&(Rt[Ht]=Zt[Ht])}if(Et||An){var rn=typeof U=="function"?U.displayName||U.name||"Unknown":U;Et&&re(Rt,rn),An&&De(Rt,rn)}return Ae(U,Et,An,Dt,dt,oe.current,Rt)}}var Je=L.ReactCurrentOwner,Ct=L.ReactDebugCurrentFrame;function Nt(U){if(U){var xe=U._owner,_e=st(U.type,U._source,xe?xe.type:null);Ct.setExtraStackFrame(_e)}else Ct.setExtraStackFrame(null)}var _t;_t=!1;function gn(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function qt(){{if(Je.current){var U=Ee(Je.current.type);if(U)return`
14
-
15
- Check the render method of \``+U+"`."}return""}}function Bt(U){{if(U!==void 0){var xe=U.fileName.replace(/^.*[\\\/]/,""),_e=U.lineNumber;return`
16
-
17
- Check your code at `+xe+":"+_e+"."}return""}}var Mr={};function Pr(U){{var xe=qt();if(!xe){var _e=typeof U=="string"?U:U.displayName||U.name;_e&&(xe=`
18
-
19
- Check the top-level render call using <`+_e+">.")}return xe}}function Hr(U,xe){{if(!U._store||U._store.validated||U.key!=null)return;U._store.validated=!0;var _e=Pr(xe);if(Mr[_e])return;Mr[_e]=!0;var dt="";U&&U._owner&&U._owner!==Je.current&&(dt=" It was passed a child from "+Ee(U._owner.type)+"."),Nt(U),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',_e,dt),Nt(null)}}function br(U,xe){{if(typeof U!="object")return;if(ft(U))for(var _e=0;_e<U.length;_e++){var dt=U[_e];gn(dt)&&Hr(dt,xe)}else if(gn(U))U._store&&(U._store.validated=!0);else if(U){var Dt=P(U);if(typeof Dt=="function"&&Dt!==U.entries)for(var Ht=Dt.call(U),Rt;!(Rt=Ht.next()).done;)gn(Rt.value)&&Hr(Rt.value,xe)}}}function Ps(U){{var xe=U.type;if(xe==null||typeof xe=="string")return;var _e;if(typeof xe=="function")_e=xe.propTypes;else if(typeof xe=="object"&&(xe.$$typeof===g||xe.$$typeof===w))_e=xe.propTypes;else return;if(_e){var dt=Ee(xe);Z(_e,U.props,"prop",dt,U)}else if(xe.PropTypes!==void 0&&!_t){_t=!0;var Dt=Ee(xe);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Dt||"Unknown")}typeof xe.getDefaultProps=="function"&&!xe.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gl(U){{for(var xe=Object.keys(U.props),_e=0;_e<xe.length;_e++){var dt=xe[_e];if(dt!=="children"&&dt!=="key"){Nt(U),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",dt),Nt(null);break}}U.ref!==null&&(Nt(U),A("Invalid attribute `ref` supplied to `React.Fragment`."),Nt(null))}}function es(U,xe,_e,dt,Dt,Ht){{var Rt=ae(U);if(!Rt){var Et="";(U===void 0||typeof U=="object"&&U!==null&&Object.keys(U).length===0)&&(Et+=" 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 An=Bt(Dt);An?Et+=An:Et+=qt();var Zt;U===null?Zt="null":ft(U)?Zt="array":U!==void 0&&U.$$typeof===e?(Zt="<"+(Ee(U.type)||"Unknown")+" />",Et=" Did you accidentally export a JSX literal instead of a component?"):Zt=typeof U,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Zt,Et)}var rn=Ne(U,xe,_e,Dt,Ht);if(rn==null)return rn;if(Rt){var Wn=xe.children;if(Wn!==void 0)if(dt)if(ft(Wn)){for(var ar=0;ar<Wn.length;ar++)br(Wn[ar],U);Object.freeze&&Object.freeze(Wn)}else A("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 br(Wn,U)}return U===i?gl(rn):Ps(rn),rn}}function nc(U,xe,_e){return es(U,xe,_e,!0)}function rc(U,xe,_e){return es(U,xe,_e,!1)}var yl=rc,bl=nc;Tu.Fragment=i,Tu.jsx=yl,Tu.jsxs=bl}()),Tu}var Cu={};/**
20
- * @license React
21
- * react-jsx-runtime.production.min.js
22
- *
23
- * Copyright (c) Facebook, Inc. and its affiliates.
24
- *
25
- * This source code is licensed under the MIT license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */var Cg;function Xx(){if(Cg)return Cu;Cg=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,c={key:!0,ref:!0,__self:!0,__source:!0};function f(p,g,x){var m,w={},R=null,D=null;x!==void 0&&(R=""+x),g.key!==void 0&&(R=""+g.key),g.ref!==void 0&&(D=g.ref);for(m in g)i.call(g,m)&&!c.hasOwnProperty(m)&&(w[m]=g[m]);if(p&&p.defaultProps)for(m in g=p.defaultProps,g)w[m]===void 0&&(w[m]=g[m]);return{$$typeof:e,type:p,key:R,ref:D,props:w,_owner:a.current}}return Cu.Fragment=n,Cu.jsx=f,Cu.jsxs=f,Cu}process.env.NODE_ENV==="production"?Jh.exports=Xx():Jh.exports=Gx();var ne=Jh.exports,ep={exports:{}},pf={exports:{}};/*
28
- object-assign
29
- (c) Sindre Sorhus
30
- @license MIT
31
- */var tp,Rg;function Og(){if(Rg)return tp;Rg=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(c){if(c==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function a(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de",Object.getOwnPropertyNames(c)[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 x={};return"abcdefghijklmnopqrst".split("").forEach(function(m){x[m]=m}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return tp=a()?Object.assign:function(c,f){for(var p,g=i(c),x,m=1;m<arguments.length;m++){p=Object(arguments[m]);for(var w in p)e.call(p,w)&&(g[w]=p[w]);if(t){x=t(p);for(var R=0;R<x.length;R++)n.call(p,x[R])&&(g[x[R]]=p[x[R]])}}return g},tp}var vf={exports:{}},np={};/** @license React v0.20.2
32
- * scheduler.development.js
33
- *
34
- * Copyright (c) Facebook, Inc. and its affiliates.
35
- *
36
- * This source code is licensed under the MIT license found in the
37
- * LICENSE file in the root directory of this source tree.
38
- */var Ag;function Kx(){return Ag||(Ag=1,function(t){process.env.NODE_ENV!=="production"&&function(){var e=!1,n=!1,i,a,c,f,p=typeof performance=="object"&&typeof performance.now=="function";if(p){var g=performance;t.unstable_now=function(){return g.now()}}else{var x=Date,m=x.now();t.unstable_now=function(){return x.now()-m}}if(typeof window>"u"||typeof MessageChannel!="function"){var w=null,R=null,D=function(){if(w!==null)try{var he=t.unstable_now(),be=!0;w(be,he),w=null}catch(Ve){throw setTimeout(D,0),Ve}};i=function(he){w!==null?setTimeout(i,0,he):(w=he,setTimeout(D,0))},a=function(he,be){R=setTimeout(he,be)},c=function(){clearTimeout(R)},t.unstable_shouldYield=function(){return!1},f=t.unstable_forceFrameRate=function(){}}else{var M=window.setTimeout,z=window.clearTimeout;if(typeof console<"u"){var P=window.requestAnimationFrame,L=window.cancelAnimationFrame;typeof P!="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 L!="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 A=!1,F=null,$=-1,Q=5,_=0;t.unstable_shouldYield=function(){return t.unstable_now()>=_},f=function(){},t.unstable_forceFrameRate=function(he){if(he<0||he>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}he>0?Q=Math.floor(1e3/he):Q=5};var K=function(){if(F!==null){var he=t.unstable_now();_=he+Q;var be=!0;try{var Ve=F(be,he);Ve?V.postMessage(null):(A=!1,F=null)}catch(J){throw V.postMessage(null),J}}else A=!1},ee=new MessageChannel,V=ee.port2;ee.port1.onmessage=K,i=function(he){F=he,A||(A=!0,V.postMessage(null))},a=function(he,be){$=M(function(){he(t.unstable_now())},be)},c=function(){z($),$=-1}}function ae(he,be){var Ve=he.length;he.push(be),Ee(he,be,Ve)}function ge(he){var be=he[0];return be===void 0?null:be}function we(he){var be=he[0];if(be!==void 0){var Ve=he.pop();return Ve!==be&&(he[0]=Ve,Ue(he,Ve,0)),be}else return null}function Ee(he,be,Ve){for(var J=Ve;;){var re=J-1>>>1,De=he[re];if(De!==void 0&&Fe(De,be)>0)he[re]=be,he[J]=De,J=re;else return}}function Ue(he,be,Ve){for(var J=Ve,re=he.length;J<re;){var De=(J+1)*2-1,Ae=he[De],Ne=De+1,Je=he[Ne];if(Ae!==void 0&&Fe(Ae,be)<0)Je!==void 0&&Fe(Je,Ae)<0?(he[J]=Je,he[Ne]=be,J=Ne):(he[J]=Ae,he[De]=be,J=De);else if(Je!==void 0&&Fe(Je,be)<0)he[J]=Je,he[Ne]=be,J=Ne;else return}}function Fe(he,be){var Ve=he.sortIndex-be.sortIndex;return Ve!==0?Ve:he.id-be.id}var Be=1,vt=2,Oe=3,it=4,nt=5;function W(he,be){}var Re=1073741823,Ie=-1,tt=250,at=5e3,$t=1e4,jt=Re,yt=[],xt=[],Pt=1,St=null,ht=Oe,ke=!1,qe=!1,st=!1;function wt(he){for(var be=ge(xt);be!==null;){if(be.callback===null)we(xt);else if(be.startTime<=he)we(xt),be.sortIndex=be.expirationTime,ae(yt,be);else return;be=ge(xt)}}function vn(he){if(st=!1,wt(he),!qe)if(ge(yt)!==null)qe=!0,i(I);else{var be=ge(xt);be!==null&&a(vn,be.startTime-he)}}function I(he,be){qe=!1,st&&(st=!1,c()),ke=!0;var Ve=ht;try{var J;if(!n)return N(he,be)}finally{St=null,ht=Ve,ke=!1}}function N(he,be){var Ve=be;for(wt(Ve),St=ge(yt);St!==null&&!e&&!(St.expirationTime>Ve&&(!he||t.unstable_shouldYield()));){var J=St.callback;if(typeof J=="function"){St.callback=null,ht=St.priorityLevel;var re=St.expirationTime<=Ve,De=J(re);Ve=t.unstable_now(),typeof De=="function"?St.callback=De:St===ge(yt)&&we(yt),wt(Ve)}else we(yt);St=ge(yt)}if(St!==null)return!0;var Ae=ge(xt);return Ae!==null&&a(vn,Ae.startTime-Ve),!1}function Z(he,be){switch(he){case Be:case vt:case Oe:case it:case nt:break;default:he=Oe}var Ve=ht;ht=he;try{return be()}finally{ht=Ve}}function Me(he){var be;switch(ht){case Be:case vt:case Oe:be=Oe;break;default:be=ht;break}var Ve=ht;ht=be;try{return he()}finally{ht=Ve}}function ft(he){var be=ht;return function(){var Ve=ht;ht=be;try{return he.apply(this,arguments)}finally{ht=Ve}}}function et(he,be,Ve){var J=t.unstable_now(),re;if(typeof Ve=="object"&&Ve!==null){var De=Ve.delay;typeof De=="number"&&De>0?re=J+De:re=J}else re=J;var Ae;switch(he){case Be:Ae=Ie;break;case vt:Ae=tt;break;case nt:Ae=jt;break;case it:Ae=$t;break;case Oe:default:Ae=at;break}var Ne=re+Ae,Je={id:Pt++,callback:be,priorityLevel:he,startTime:re,expirationTime:Ne,sortIndex:-1};return re>J?(Je.sortIndex=re,ae(xt,Je),ge(yt)===null&&Je===ge(xt)&&(st?c():st=!0,a(vn,re-J))):(Je.sortIndex=Ne,ae(yt,Je),!qe&&!ke&&(qe=!0,i(I))),Je}function Ft(){}function mn(){!qe&&!ke&&(qe=!0,i(I))}function Le(){return ge(yt)}function oe(he){he.callback=null}function X(){return ht}var de=f,le=null;t.unstable_IdlePriority=nt,t.unstable_ImmediatePriority=Be,t.unstable_LowPriority=it,t.unstable_NormalPriority=Oe,t.unstable_Profiling=le,t.unstable_UserBlockingPriority=vt,t.unstable_cancelCallback=oe,t.unstable_continueExecution=mn,t.unstable_getCurrentPriorityLevel=X,t.unstable_getFirstCallbackNode=Le,t.unstable_next=Me,t.unstable_pauseExecution=Ft,t.unstable_requestPaint=de,t.unstable_runWithPriority=Z,t.unstable_scheduleCallback=et,t.unstable_wrapCallback=ft}()}(np)),np}var rp={};/** @license React v0.20.2
39
- * scheduler.production.min.js
40
- *
41
- * Copyright (c) Facebook, Inc. and its affiliates.
42
- *
43
- * This source code is licensed under the MIT license found in the
44
- * LICENSE file in the root directory of this source tree.
45
- */var Mg;function Zx(){return Mg||(Mg=1,function(t){var e,n,i,a;if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.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,x=null,m=function(){if(g!==null)try{var W=t.unstable_now();g(!0,W),g=null}catch(Re){throw setTimeout(m,0),Re}};e=function(W){g!==null?setTimeout(e,0,W):(g=W,setTimeout(m,0))},n=function(W,Re){x=setTimeout(W,Re)},i=function(){clearTimeout(x)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var w=window.setTimeout,R=window.clearTimeout;if(typeof console<"u"){var D=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 D!="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,z=null,P=-1,L=5,A=0;t.unstable_shouldYield=function(){return t.unstable_now()>=A},a=function(){},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<W?Math.floor(1e3/W):5};var F=new MessageChannel,$=F.port2;F.port1.onmessage=function(){if(z!==null){var W=t.unstable_now();A=W+L;try{z(!0,W)?$.postMessage(null):(M=!1,z=null)}catch(Re){throw $.postMessage(null),Re}}else M=!1},e=function(W){z=W,M||(M=!0,$.postMessage(null))},n=function(W,Re){P=w(function(){W(t.unstable_now())},Re)},i=function(){R(P),P=-1}}function Q(W,Re){var Ie=W.length;W.push(Re);e:for(;;){var tt=Ie-1>>>1,at=W[tt];if(at!==void 0&&0<ee(at,Re))W[tt]=Re,W[Ie]=at,Ie=tt;else break e}}function _(W){return W=W[0],W===void 0?null:W}function K(W){var Re=W[0];if(Re!==void 0){var Ie=W.pop();if(Ie!==Re){W[0]=Ie;e:for(var tt=0,at=W.length;tt<at;){var $t=2*(tt+1)-1,jt=W[$t],yt=$t+1,xt=W[yt];if(jt!==void 0&&0>ee(jt,Ie))xt!==void 0&&0>ee(xt,jt)?(W[tt]=xt,W[yt]=Ie,tt=yt):(W[tt]=jt,W[$t]=Ie,tt=$t);else if(xt!==void 0&&0>ee(xt,Ie))W[tt]=xt,W[yt]=Ie,tt=yt;else break e}}return Re}return null}function ee(W,Re){var Ie=W.sortIndex-Re.sortIndex;return Ie!==0?Ie:W.id-Re.id}var V=[],ae=[],ge=1,we=null,Ee=3,Ue=!1,Fe=!1,Be=!1;function vt(W){for(var Re=_(ae);Re!==null;){if(Re.callback===null)K(ae);else if(Re.startTime<=W)K(ae),Re.sortIndex=Re.expirationTime,Q(V,Re);else break;Re=_(ae)}}function Oe(W){if(Be=!1,vt(W),!Fe)if(_(V)!==null)Fe=!0,e(it);else{var Re=_(ae);Re!==null&&n(Oe,Re.startTime-W)}}function it(W,Re){Fe=!1,Be&&(Be=!1,i()),Ue=!0;var Ie=Ee;try{for(vt(Re),we=_(V);we!==null&&(!(we.expirationTime>Re)||W&&!t.unstable_shouldYield());){var tt=we.callback;if(typeof tt=="function"){we.callback=null,Ee=we.priorityLevel;var at=tt(we.expirationTime<=Re);Re=t.unstable_now(),typeof at=="function"?we.callback=at:we===_(V)&&K(V),vt(Re)}else K(V);we=_(V)}if(we!==null)var $t=!0;else{var jt=_(ae);jt!==null&&n(Oe,jt.startTime-Re),$t=!1}return $t}finally{we=null,Ee=Ie,Ue=!1}}var nt=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(W){W.callback=null},t.unstable_continueExecution=function(){Fe||Ue||(Fe=!0,e(it))},t.unstable_getCurrentPriorityLevel=function(){return Ee},t.unstable_getFirstCallbackNode=function(){return _(V)},t.unstable_next=function(W){switch(Ee){case 1:case 2:case 3:var Re=3;break;default:Re=Ee}var Ie=Ee;Ee=Re;try{return W()}finally{Ee=Ie}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=nt,t.unstable_runWithPriority=function(W,Re){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Ie=Ee;Ee=W;try{return Re()}finally{Ee=Ie}},t.unstable_scheduleCallback=function(W,Re,Ie){var tt=t.unstable_now();switch(typeof Ie=="object"&&Ie!==null?(Ie=Ie.delay,Ie=typeof Ie=="number"&&0<Ie?tt+Ie:tt):Ie=tt,W){case 1:var at=-1;break;case 2:at=250;break;case 5:at=1073741823;break;case 4:at=1e4;break;default:at=5e3}return at=Ie+at,W={id:ge++,callback:Re,priorityLevel:W,startTime:Ie,expirationTime:at,sortIndex:-1},Ie>tt?(W.sortIndex=Ie,Q(ae,W),_(V)===null&&W===_(ae)&&(Be?i():Be=!0,n(Oe,Ie-tt))):(W.sortIndex=at,Q(V,W),Fe||Ue||(Fe=!0,e(it))),W},t.unstable_wrapCallback=function(W){var Re=Ee;return function(){var Ie=Ee;Ee=Re;try{return W.apply(this,arguments)}finally{Ee=Ie}}}}(rp)),rp}var Pg;function Lg(){return Pg||(Pg=1,process.env.NODE_ENV==="production"?vf.exports=Zx():vf.exports=Kx()),vf.exports}var mf={exports:{}},ip={};/** @license React v0.20.2
46
- * scheduler-tracing.development.js
47
- *
48
- * Copyright (c) Facebook, Inc. and its affiliates.
49
- *
50
- * This source code is licensed under the MIT license found in the
51
- * LICENSE file in the root directory of this source tree.
52
- */var Dg;function Jx(){return Dg||(Dg=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(A){var F=t.__interactionsRef.current;t.__interactionsRef.current=new Set;try{return A()}finally{t.__interactionsRef.current=F}}function c(){return t.__interactionsRef.current}function f(){return++i}function p(A,F,$){var Q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,_={__count:1,id:n++,name:A,timestamp:F},K=t.__interactionsRef.current,ee=new Set(K);ee.add(_),t.__interactionsRef.current=ee;var V=t.__subscriberRef.current,ae;try{V!==null&&V.onInteractionTraced(_)}finally{try{V!==null&&V.onWorkStarted(ee,Q)}finally{try{ae=$()}finally{t.__interactionsRef.current=K;try{V!==null&&V.onWorkStopped(ee,Q)}finally{_.__count--,V!==null&&_.__count===0&&V.onInteractionScheduledWorkCompleted(_)}}}}return ae}function g(A){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,$=t.__interactionsRef.current,Q=t.__subscriberRef.current;Q!==null&&Q.onWorkScheduled($,F),$.forEach(function(ee){ee.__count++});var _=!1;function K(){var ee=t.__interactionsRef.current;t.__interactionsRef.current=$,Q=t.__subscriberRef.current;try{var V;try{Q!==null&&Q.onWorkStarted($,F)}finally{try{V=A.apply(void 0,arguments)}finally{t.__interactionsRef.current=ee,Q!==null&&Q.onWorkStopped($,F)}}return V}finally{_||(_=!0,$.forEach(function(ae){ae.__count--,Q!==null&&ae.__count===0&&Q.onInteractionScheduledWorkCompleted(ae)}))}}return K.cancel=function(){Q=t.__subscriberRef.current;try{Q!==null&&Q.onWorkCanceled($,F)}finally{$.forEach(function(V){V.__count--,Q&&V.__count===0&&Q.onInteractionScheduledWorkCompleted(V)})}},K}var x=null;x=new Set;function m(A){x.add(A),x.size===1&&(t.__subscriberRef.current={onInteractionScheduledWorkCompleted:D,onInteractionTraced:R,onWorkCanceled:L,onWorkScheduled:M,onWorkStarted:z,onWorkStopped:P})}function w(A){x.delete(A),x.size===0&&(t.__subscriberRef.current=null)}function R(A){var F=!1,$=null;if(x.forEach(function(Q){try{Q.onInteractionTraced(A)}catch(_){F||(F=!0,$=_)}}),F)throw $}function D(A){var F=!1,$=null;if(x.forEach(function(Q){try{Q.onInteractionScheduledWorkCompleted(A)}catch(_){F||(F=!0,$=_)}}),F)throw $}function M(A,F){var $=!1,Q=null;if(x.forEach(function(_){try{_.onWorkScheduled(A,F)}catch(K){$||($=!0,Q=K)}}),$)throw Q}function z(A,F){var $=!1,Q=null;if(x.forEach(function(_){try{_.onWorkStarted(A,F)}catch(K){$||($=!0,Q=K)}}),$)throw Q}function P(A,F){var $=!1,Q=null;if(x.forEach(function(_){try{_.onWorkStopped(A,F)}catch(K){$||($=!0,Q=K)}}),$)throw Q}function L(A,F){var $=!1,Q=null;if(x.forEach(function(_){try{_.onWorkCanceled(A,F)}catch(K){$||($=!0,Q=K)}}),$)throw Q}t.unstable_clear=a,t.unstable_getCurrent=c,t.unstable_getThreadID=f,t.unstable_subscribe=m,t.unstable_trace=p,t.unstable_unsubscribe=w,t.unstable_wrap=g}()}(ip)),ip}var Ai={};/** @license React v0.20.2
53
- * scheduler-tracing.production.min.js
54
- *
55
- * Copyright (c) Facebook, Inc. and its affiliates.
56
- *
57
- * This source code is licensed under the MIT license found in the
58
- * LICENSE file in the root directory of this source tree.
59
- */var kg;function ew(){if(kg)return Ai;kg=1;var t=0;return Ai.__interactionsRef=null,Ai.__subscriberRef=null,Ai.unstable_clear=function(e){return e()},Ai.unstable_getCurrent=function(){return null},Ai.unstable_getThreadID=function(){return++t},Ai.unstable_subscribe=function(){},Ai.unstable_trace=function(e,n,i){return i()},Ai.unstable_unsubscribe=function(){},Ai.unstable_wrap=function(e){return e},Ai}var Ng;function tw(){return Ng||(Ng=1,process.env.NODE_ENV==="production"?mf.exports=ew():mf.exports=Jx()),mf.exports}/** @license React v0.26.2
60
- * react-reconciler.development.js
61
- *
62
- * Copyright (c) Facebook, Inc. and its affiliates.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE file in the root directory of this source tree.
66
- */pf.exports;var zg;function nw(){return zg||(zg=1,function(t){process.env.NODE_ENV!=="production"&&(t.exports=function(n){var i={},a=T,c=Og(),f=Lg(),p=tw(),g=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(r){{for(var s=arguments.length,u=new Array(s>1?s-1:0),h=1;h<s;h++)u[h-1]=arguments[h];w("warn",r,u)}}function m(r){{for(var s=arguments.length,u=new Array(s>1?s-1:0),h=1;h<s;h++)u[h-1]=arguments[h];w("error",r,u)}}function w(r,s,u){{var h=g.ReactDebugCurrentFrame,v=h.getStackAddendum();v!==""&&(s+="%s",u=u.concat([v]));var b=u.map(function(E){return""+E});b.unshift("Warning: "+s),Function.prototype.apply.call(console[r],console,b)}}var R=0,D=1,M=2,z=3,P=4,L=5,A=6,F=7,$=8,Q=9,_=10,K=11,ee=12,V=13,ae=14,ge=15,we=16,Ee=17,Ue=18,Fe=19,Be=20,vt=21,Oe=22,it=23,nt=24;function W(r){return r._reactInternals}function Re(r,s){r._reactInternals=s}var Ie=60103,tt=60106,at=60107,$t=60108,jt=60114,yt=60109,xt=60110,Pt=60112,St=60113,ht=60120,ke=60115,qe=60116,st=60121,wt=60119,vn=60129,I=60130,N=60131;if(typeof Symbol=="function"&&Symbol.for){var Z=Symbol.for;Ie=Z("react.element"),tt=Z("react.portal"),at=Z("react.fragment"),$t=Z("react.strict_mode"),jt=Z("react.profiler"),yt=Z("react.provider"),xt=Z("react.context"),Pt=Z("react.forward_ref"),St=Z("react.suspense"),ht=Z("react.suspense_list"),ke=Z("react.memo"),qe=Z("react.lazy"),st=Z("react.block"),Z("react.server.block"),Z("react.fundamental"),wt=Z("react.scope"),Z("react.opaque.id"),vn=Z("react.debug_trace_mode"),I=Z("react.offscreen"),N=Z("react.legacy_hidden")}var Me=typeof Symbol=="function"&&Symbol.iterator,ft="@@iterator";function et(r){if(r===null||typeof r!="object")return null;var s=Me&&r[Me]||r[ft];return typeof s=="function"?s:null}function Ft(r,s,u){var h=s.displayName||s.name||"";return r.displayName||(h!==""?u+"("+h+")":u)}function mn(r){return r.displayName||"Context"}function Le(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 at:return"Fragment";case tt:return"Portal";case jt:return"Profiler";case $t:return"StrictMode";case St:return"Suspense";case ht:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case xt:var s=r;return mn(s)+".Consumer";case yt:var u=r;return mn(u._context)+".Provider";case Pt:return Ft(r,r.render,"ForwardRef");case ke:return Le(r.type);case st:return Le(r._render);case qe:{var h=r,v=h._payload,b=h._init;try{return Le(b(v))}catch{return null}}}return null}var oe=0,X=1,de=2,le=4,he=6,be=8,Ve=16,J=32,re=64,De=128,Ae=256,Ne=512,Je=8192,Ct=1024,Nt=1028,_t=932,gn=2047,qt=2048,Bt=4096,Mr=16384,Pr=!0,Hr=!1,br=!1,Ps=!1,gl=g.ReactCurrentOwner;function es(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{var h=s;do s=h,(s.flags&(de|Ct))!==oe&&(u=s.return),h=s.return;while(h)}return s.tag===z?u:null}function nc(r){return es(r)===r}function rc(r){{var s=gl.current;if(s!==null&&s.tag===D){var u=s,h=u.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.",Le(u.type)||"A component"),h._warnedAboutRefsInRender=!0}}var v=W(r);return v?es(v)===v:!1}function yl(r){if(es(r)!==r)throw Error("Unable to find node on an unmounted component.")}function bl(r){var s=r.alternate;if(!s){var u=es(r);if(u===null)throw Error("Unable to find node on an unmounted component.");return u!==r?null:r}for(var h=r,v=s;;){var b=h.return;if(b===null)break;var E=b.alternate;if(E===null){var O=b.return;if(O!==null){h=v=O;continue}break}if(b.child===E.child){for(var k=b.child;k;){if(k===h)return yl(b),r;if(k===v)return yl(b),s;k=k.sibling}throw Error("Unable to find node on an unmounted component.")}if(h.return!==v.return)h=b,v=E;else{for(var B=!1,Y=b.child;Y;){if(Y===h){B=!0,h=b,v=E;break}if(Y===v){B=!0,v=b,h=E;break}Y=Y.sibling}if(!B){for(Y=E.child;Y;){if(Y===h){B=!0,h=E,v=b;break}if(Y===v){B=!0,v=E,h=b;break}Y=Y.sibling}if(!B)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!==z)throw Error("Unable to find node on an unmounted component.");return h.stateNode.current===h?r:s}function U(r){var s=bl(r);if(!s)return null;for(var u=s;;){if(u.tag===L||u.tag===A)return u;if(u.child){u.child.return=u,u=u.child;continue}if(u===s)return null;for(;!u.sibling;){if(!u.return||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function xe(r){var s=bl(r);if(!s)return null;for(var u=s;;){if(u.tag===L||u.tag===A||Hr)return u;if(u.child&&u.tag!==P){u.child.return=u,u=u.child;continue}if(u===s)return null;for(;!u.sibling;){if(!u.return||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function _e(r,s){for(var u=s,h=r.alternate;u!==null;){if(u===r||u===h)return!0;u=u.return}return!1}var dt=n.getPublicInstance,Dt=n.getRootHostContext,Ht=n.getChildHostContext,Rt=n.prepareForCommit,Et=n.resetAfterCommit,An=n.createInstance,Zt=n.appendInitialChild,rn=n.finalizeInitialChildren,Wn=n.prepareUpdate,ar=n.shouldSetTextContent,Vr=n.createTextInstance,Ot=n.scheduleTimeout,Sn=n.cancelTimeout,gi=n.noTimeout;n.now;var xn=n.isPrimaryRenderer,Xn=n.warnsIfNotActing,$n=n.supportsMutation,yi=n.supportsPersistence,dn=n.supportsHydration;n.getFundamentalComponentInstance,n.mountFundamentalComponent,n.shouldUpdateFundamentalComponent;var Sl=n.getInstanceFromNode;n.isOpaqueHydratingObject;var wd=n.makeOpaqueHydratingObject;n.makeClientId;var Ed=n.makeClientIdInDEV,Qo=n.beforeActiveInstanceBlur,Td=n.afterActiveInstanceBlur,ic=n.preparePortalMount;n.preparePortalMount,n.getInstanceFromScope;var Wr=n.supportsTestSelectors,mv=n.findFiberRoot,xl=n.getBoundingRect,sn=n.getTextContent,ii=n.isHiddenSubtree,gv=n.matchAccessibilityRole,yv=n.setFocusIfFocusable,Go=n.setupIntersectionObserver,Cd=n.appendChild,wl=n.appendChildToContainer,uo=n.commitTextUpdate,sc=n.commitMount,El=n.commitUpdate,ts=n.insertBefore,bv=n.insertInContainerBefore,Sv=n.removeChild,xv=n.removeChildFromContainer,Rd=n.resetTextContent,oc=n.hideInstance,ac=n.hideTextInstance,wv=n.unhideInstance,Od=n.unhideTextInstance;n.updateFundamentalComponent,n.unmountFundamentalComponent;var Xo=n.clearContainer,Ev=n.cloneInstance,Ko=n.createContainerChildSet,lc=n.appendChildToContainerChildSet,Ad=n.finalizeContainerChildren,uc=n.replaceContainerChildren,cc=n.cloneHiddenInstance,Tl=n.cloneHiddenTextInstance;n.cloneInstance;var Tv=n.canHydrateInstance,Di=n.canHydrateTextInstance;n.canHydrateSuspenseInstance;var Cl=n.isSuspenseInstancePending,fc=n.isSuspenseInstanceFallback;n.registerSuspenseInstanceRetry;var Rl=n.getNextHydratableSibling,Un=n.getFirstHydratableChild,co=n.hydrateInstance,Md=n.hydrateTextInstance;n.hydrateSuspenseInstance;var ki=n.getNextHydratableInstanceAfterSuspenseInstance,fo=n.commitHydratedContainer,$r=n.commitHydratedSuspenseInstance;n.clearSuspenseBoundary,n.clearSuspenseBoundaryFromContainer;var Pd=n.didNotMatchHydratedContainerTextInstance,Cv=n.didNotMatchHydratedTextInstance,Rv=n.didNotHydrateContainerInstance,qr=n.didNotHydrateInstance,Ov=n.didNotFindHydratableContainerInstance,Ol=n.didNotFindHydratableContainerTextInstance,Av=n.didNotFindHydratableContainerSuspenseInstance,si=n.didNotFindHydratableInstance,Al=n.didNotFindHydratableTextInstance,Ml=n.didNotFindHydratableSuspenseInstance,bi=0,Zo,Pl,dc,Ll,hc,Ls,Lr;function Ni(){}Ni.__reactDisabledLog=!0;function Yr(){{if(bi===0){Zo=console.log,Pl=console.info,dc=console.warn,Ll=console.error,hc=console.group,Ls=console.groupCollapsed,Lr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Ni,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}bi++}}function oi(){{if(bi--,bi===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:c({},r,{value:Zo}),info:c({},r,{value:Pl}),warn:c({},r,{value:dc}),error:c({},r,{value:Ll}),group:c({},r,{value:hc}),groupCollapsed:c({},r,{value:Ls}),groupEnd:c({},r,{value:Lr})})}bi<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Si=g.ReactCurrentDispatcher,xi;function zi(r,s,u){{if(xi===void 0)try{throw Error()}catch(v){var h=v.stack.trim().match(/\n( *(at )?)/);xi=h&&h[1]||""}return`
67
- `+xi+r}}var Ds=!1,Jo;{var Ld=typeof WeakMap=="function"?WeakMap:Map;Jo=new Ld}function ho(r,s){if(!r||Ds)return"";{var u=Jo.get(r);if(u!==void 0)return u}var h;Ds=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=Si.current,Si.current=null,Yr();try{if(s){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(Pe){h=Pe}Reflect.construct(r,[],E)}else{try{E.call()}catch(Pe){h=Pe}r.call(E.prototype)}}else{try{throw Error()}catch(Pe){h=Pe}r()}}catch(Pe){if(Pe&&h&&typeof Pe.stack=="string"){for(var O=Pe.stack.split(`
68
- `),k=h.stack.split(`
69
- `),B=O.length-1,Y=k.length-1;B>=1&&Y>=0&&O[B]!==k[Y];)Y--;for(;B>=1&&Y>=0;B--,Y--)if(O[B]!==k[Y]){if(B!==1||Y!==1)do if(B--,Y--,Y<0||O[B]!==k[Y]){var ie=`
70
- `+O[B].replace(" at new "," at ");return typeof r=="function"&&Jo.set(r,ie),ie}while(B>=1&&Y>=0);break}}}finally{Ds=!1,Si.current=b,oi(),Error.prepareStackTrace=v}var ue=r?r.displayName||r.name:"",Te=ue?zi(ue):"";return typeof r=="function"&&Jo.set(r,Te),Te}function Dl(r,s,u){return ho(r,!0)}function po(r,s,u){return ho(r,!1)}function Dd(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function kl(r,s,u){if(r==null)return"";if(typeof r=="function")return ho(r,Dd(r));if(typeof r=="string")return zi(r);switch(r){case St:return zi("Suspense");case ht:return zi("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case Pt:return po(r.render);case ke:return kl(r.type,s,u);case st:return po(r._render);case qe:{var h=r,v=h._payload,b=h._init;try{return kl(b(v),s,u)}catch{}}}return""}var Nl={},ea=g.ReactDebugCurrentFrame;function ns(r){if(r){var s=r._owner,u=kl(r.type,r._source,s?s.type:null);ea.setExtraStackFrame(u)}else ea.setExtraStackFrame(null)}function Sr(r,s,u,h,v){{var b=Function.call.bind(Object.prototype.hasOwnProperty);for(var E in r)if(b(r,E)){var O=void 0;try{if(typeof r[E]!="function"){var k=Error((h||"React class")+": "+u+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}O=r[E](s,E,h,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(B){O=B}O&&!(O instanceof Error)&&(ns(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",u,E,typeof O),ns(null)),O instanceof Error&&!(O.message in Nl)&&(Nl[O.message]=!0,ns(v),m("Failed %s type: %s",u,O.message),ns(null))}}}var zl=[],ks;ks=[];var wi=-1;function Qr(r){return{current:r}}function Jt(r,s){if(wi<0){m("Unexpected pop.");return}s!==ks[wi]&&m("Unexpected Fiber popped."),r.current=zl[wi],zl[wi]=null,ks[wi]=null,wi--}function Mn(r,s,u){wi++,zl[wi]=r.current,ks[wi]=u,r.current=s}var rs;rs={};var wn={};Object.freeze(wn);var ai=Qr(wn),lr=Qr(!1),jl=wn;function is(r,s,u){return u&&Kn(s)?jl:ai.current}function yn(r,s,u){{var h=r.stateNode;h.__reactInternalMemoizedUnmaskedChildContext=s,h.__reactInternalMemoizedMaskedChildContext=u}}function ji(r,s){{var u=r.type,h=u.contextTypes;if(!h)return wn;var v=r.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===s)return v.__reactInternalMemoizedMaskedChildContext;var b={};for(var E in h)b[E]=s[E];{var O=Le(u)||"Unknown";Sr(h,b,"context",O)}return v&&yn(r,s,b),b}}function Gr(){return lr.current}function Kn(r){{var s=r.childContextTypes;return s!=null}}function Dr(r){Jt(lr,r),Jt(ai,r)}function _l(r){Jt(lr,r),Jt(ai,r)}function pc(r,s,u){{if(ai.current!==wn)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");Mn(ai,s,r),Mn(lr,u,r)}}function Il(r,s,u){{var h=r.stateNode,v=s.childContextTypes;if(typeof h.getChildContext!="function"){{var b=Le(s)||"Unknown";rs[b]||(rs[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 u}var E=h.getChildContext();for(var O in E)if(!(O in v))throw Error((Le(s)||"Unknown")+'.getChildContext(): key "'+O+'" is not defined in childContextTypes.');{var k=Le(s)||"Unknown";Sr(v,E,"child context",k)}return c({},u,E)}}function ta(r){{var s=r.stateNode,u=s&&s.__reactInternalMemoizedMergedChildContext||wn;return jl=ai.current,Mn(ai,u,r),Mn(lr,lr.current,r),!0}}function na(r,s,u){{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(u){var v=Il(r,s,jl);h.__reactInternalMemoizedMergedChildContext=v,Jt(lr,r),Jt(ai,r),Mn(ai,v,r),Mn(lr,u,r)}else Jt(lr,r),Mn(lr,u,r)}}function vc(r){{if(!(nc(r)&&r.tag===D))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 z:return s.stateNode.context;case D:{var u=s.type;if(Kn(u))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 Ns=0,Ul=1,vo=2,ur=null,xr=null,on=!1,Zn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function qn(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{ur=s.inject(r),xr=s}catch(u){m("React instrumentation encountered an error: %s.",u)}return!0}function Fl(r,s){if(xr&&typeof xr.onScheduleFiberRoot=="function")try{xr.onScheduleFiberRoot(ur,r,s)}catch(u){on||(on=!0,m("React instrumentation encountered an error: %s",u))}}function ra(r,s){if(xr&&typeof xr.onCommitFiberRoot=="function")try{var u=(r.current.flags&re)===re;Pr&&xr.onCommitFiberRoot(ur,r,s,u)}catch(h){on||(on=!0,m("React instrumentation encountered an error: %s",h))}}function wr(r){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(ur,r)}catch(s){on||(on=!0,m("React instrumentation encountered an error: %s",s))}}var mc=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 Bl=99,ss=98,os=97,Ei=96,mo=95,ia=90;mc();var zs=15,sa=14,gc=13,as=12,oa=11,js=10,aa=9,_i=8,Hl=7,la=6,go=5,yc=4,bc=3,ua=2,Vl=1,Ii=0,kd=31,ye=0,Jn=0,zt=1,ca=2,Wl=4,$l=24,Nd=32,Xr=192,cr=256,ql=3584,Sc=4096,_s=4186112,yo=62914560,Is=33554432,fa=67108864,xc=134217727,Yl=134217728,Ql=805306368,kr=1073741824,bn=-1,wc=Ii;function Ec(){return wc}function Tc(r){wc=r}var en=_i;function Ui(r){if((zt&r)!==ye)return en=zs,zt;if((ca&r)!==ye)return en=sa,ca;if((Wl&r)!==ye)return en=gc,Wl;var s=$l&r;if(s!==ye)return en=as,s;if((r&Nd)!==ye)return en=oa,Nd;var u=Xr&r;if(u!==ye)return en=js,u;if((r&cr)!==ye)return en=aa,cr;var h=ql&r;if(h!==ye)return en=_i,h;if((r&Sc)!==ye)return en=Hl,Sc;var v=_s&r;if(v!==ye)return en=la,v;var b=yo&r;if(b!==ye)return en=go,b;if(r&fa)return en=yc,fa;if((r&Yl)!==ye)return en=bc,Yl;var E=Ql&r;return E!==ye?(en=ua,E):(kr&r)!==ye?(en=Vl,kr):(m("Should have found matching lanes. This is a bug in React."),en=_i,r)}function zd(r){switch(r){case Bl:return zs;case ss:return js;case os:case Ei:return _i;case mo:return ua;default:return Ii}}function Fi(r){switch(r){case zs:case sa:return Bl;case gc:case as:case oa:case js:return ss;case aa:case _i:case Hl:case la:case yc:case go:return os;case bc:case ua:case Vl:return mo;case Ii:return ia;default:throw Error("Invalid update priority: "+r+". This is a bug in React.")}}function Er(r,s){var u=r.pendingLanes;if(u===ye)return en=Ii,ye;var h=ye,v=Ii,b=r.expiredLanes,E=r.suspendedLanes,O=r.pingedLanes;if(b!==ye)h=b,v=en=zs;else{var k=u&xc;if(k!==ye){var B=k&~E;if(B!==ye)h=Ui(B),v=en;else{var Y=k&O;Y!==ye&&(h=Ui(Y),v=en)}}else{var ie=u&~E;ie!==ye?(h=Ui(ie),v=en):O!==ye&&(h=Ui(O),v=en)}}if(h===ye)return ye;if(h=u&Fd(h),s!==ye&&s!==h&&(s&E)===ye){Ui(s);var ue=en;if(v<=ue)return s;en=v}var Te=r.entangledLanes;if(Te!==ye)for(var Pe=r.entanglements,je=h&Te;je>0;){var pt=ls(je),Mt=1<<pt;h|=Pe[pt],je&=~Mt}return h}function da(r,s){for(var u=r.eventTimes,h=bn;s>0;){var v=ls(s),b=1<<v,E=u[v];E>h&&(h=E),s&=~b}return h}function ha(r,s){Ui(r);var u=en;return u>=js?s+250:u>=la?s+5e3:bn}function Gl(r,s){for(var u=r.pendingLanes,h=r.suspendedLanes,v=r.pingedLanes,b=r.expirationTimes,E=u;E>0;){var O=ls(E),k=1<<O,B=b[O];B===bn?((k&h)===ye||(k&v)!==ye)&&(b[O]=ha(k,s)):B<=s&&(r.expiredLanes|=k),E&=~k}}function Xl(r){return Ui(r.pendingLanes)}function Cc(r){var s=r.pendingLanes&~kr;return s!==ye?s:s&kr?kr:ye}function pa(){return en}function jd(r){return(r&xc)!==ye}function _d(r){return(r&yo)===r}function Rc(r){return(r&_s)===r}function bo(r,s){switch(r){case Ii:break;case zs:return zt;case sa:return ca;case as:{var u=fr($l&~s);return u===Jn?bo(js,s):u}case js:{var h=fr(Xr&~s);return h===Jn?bo(_i,s):h}case _i:{var v=fr(ql&~s);return v===Jn&&(v=fr(_s&~s),v===Jn&&(v=fr(ql))),v}case la:case go:break;case ua:var b=fr(Ql&~s);return b===Jn&&(b=fr(Ql)),b}throw Error("Invalid update priority: "+r+". This is a bug in React.")}function Mv(r,s){var u=fr(_s&~s);return u===Jn&&(u=fr(_s&~r),u===Jn&&(u=fr(_s))),u}function Id(r){var s=fr(yo&~r);return s===Jn&&(s=fr(yo)),s}function Ud(r){return r&-r}function Pv(r){var s=31-ya(r);return s<0?ye:1<<s}function Fd(r){return(Pv(r)<<1)-1}function fr(r){return Ud(r)}function ls(r){return 31-ya(r)}function Lv(r){return ls(r)}function Yn(r,s){return(r&s)!==ye}function us(r,s){return(r&s)===s}function It(r,s){return r|s}function va(r,s){return r&~s}function Dv(r){return r}function Bd(r,s){return r!==Jn&&r<s?r:s}function ma(r){for(var s=[],u=0;u<kd;u++)s.push(r);return s}function So(r,s,u){r.pendingLanes|=s;var h=s-1;r.suspendedLanes&=h,r.pingedLanes&=h;var v=r.eventTimes,b=Lv(s);v[b]=u}function Hd(r,s){r.suspendedLanes|=s,r.pingedLanes&=~s;for(var u=r.expirationTimes,h=s;h>0;){var v=ls(h),b=1<<v;u[v]=bn,h&=~b}}function Kl(r,s,u){r.pingedLanes|=r.suspendedLanes&s}function Vd(r,s){r.expiredLanes|=s&r.pendingLanes}function Zl(r){r.expiredLanes|=$l&r.pendingLanes}function kv(r){return(r&$l)!==ye}function ga(r,s){r.mutableReadLanes|=s&r.pendingLanes}function Jl(r,s){var u=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,E=u;E>0;){var O=ls(E),k=1<<O;h[O]=ye,v[O]=bn,b[O]=bn,E&=~k}}function eu(r,s){r.entangledLanes|=s;for(var u=r.entanglements,h=s;h>0;){var v=ls(h),b=1<<v;u[v]|=s,h&=~b}}var ya=Math.clz32?Math.clz32:Oc,tu=Math.log,ba=Math.LN2;function Oc(r){return r===0?32:31-(tu(r)/ba|0)|0}var Ac=f.unstable_runWithPriority,Sa=f.unstable_scheduleCallback,Mc=f.unstable_cancelCallback,Pc=f.unstable_shouldYield,xa=f.unstable_requestPaint,Lc=f.unstable_now,Nv=f.unstable_getCurrentPriorityLevel,Us=f.unstable_ImmediatePriority,nu=f.unstable_UserBlockingPriority,ru=f.unstable_NormalPriority,ct=f.unstable_LowPriority,er=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 Pn={},Gt=99,Nr=98,Kr=97,Fn=96,wa=95,cs=90,Ea=Pc,xo=xa!==void 0?xa:function(){},li=null,wo=null,Ta=!1,iu=Lc(),hn=iu<1e4?Lc:function(){return Lc()-iu};function Ye(){switch(Nv()){case Us:return Gt;case nu:return Nr;case ru:return Kr;case ct:return Fn;case er:return wa;default:throw Error("Unknown priority level.")}}function Ca(r){switch(r){case Gt:return Us;case Nr:return nu;case Kr:return ru;case Fn:return ct;case wa:return er;default:throw Error("Unknown priority level.")}}function ui(r,s){var u=Ca(r);return Ac(u,s)}function Qn(r,s,u){var h=Ca(r);return Sa(h,s,u)}function fs(r){return li===null?(li=[r],wo=Sa(Us,su)):li.push(r),Pn}function Eo(r){r!==Pn&&Mc(r)}function tr(){if(wo!==null){var r=wo;wo=null,Mc(r)}su()}function su(){if(!Ta&&li!==null){Ta=!0;var r=0;try{var s=!0,u=li;ui(Gt,function(){for(;r<u.length;r++){var h=u[r];do h=h(s);while(h!==null)}}),li=null}catch(h){throw li!==null&&(li=li.slice(r+1)),Sa(Us,tr),h}finally{Ta=!1}}}var an=0,Vt=1,Bn=2,Bi=4,nr=8,Hi=16,ou=g.ReactCurrentBatchConfig,Ra=0;function Oa(){return ou.transition}function Tr(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var zn=typeof Object.is=="function"?Object.is:Tr,Vi=Object.prototype.hasOwnProperty;function Fs(r,s){if(zn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),h=Object.keys(s);if(u.length!==h.length)return!1;for(var v=0;v<u.length;v++)if(!Vi.call(s,u[v])||!zn(r[u[v]],s[u[v]]))return!1;return!0}function zr(r){switch(r._debugOwner&&r._debugOwner.type,r._debugSource,r.tag){case L:return zi(r.type);case we:return zi("Lazy");case V:return zi("Suspense");case Fe:return zi("SuspenseList");case R:case M:case ge:return po(r.type);case K:return po(r.type.render);case Oe:return po(r.type._render);case D:return Dl(r.type);default:return""}}function Dc(r){try{var s="",u=r;do s+=zr(u),u=u.return;while(u);return s}catch(h){return`
71
- Error generating stack: `+h.message+`
72
- `+h.stack}}var Bs=g.ReactDebugCurrentFrame,rr=null,To=!1;function Wd(){{if(rr===null)return null;var r=rr._debugOwner;if(r!==null&&typeof r<"u")return Le(r.type)}return null}function $d(){return rr===null?"":Dc(rr)}function Gn(){Bs.getCurrentStack=null,rr=null,To=!1}function Ln(r){Bs.getCurrentStack=$d,rr=r,To=!1}function dr(r){To=r}function qd(){return To}var Zr={recordUnsafeLifecycleWarnings:function(r,s){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(r,s){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var Aa=function(r){for(var s=null,u=r;u!==null;)u.mode&Vt&&(s=u),u=u.return;return s},Hs=function(r){var s=[];return r.forEach(function(u){s.push(u)}),s.sort().join(", ")},Ma=[],Co=[],Ro=[],ci=[],Pa=[],La=[],hr=new Set;Zr.recordUnsafeLifecycleWarnings=function(r,s){hr.has(r.type)||(typeof s.componentWillMount=="function"&&s.componentWillMount.__suppressDeprecationWarning!==!0&&Ma.push(r),r.mode&Vt&&typeof s.UNSAFE_componentWillMount=="function"&&Co.push(r),typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Ro.push(r),r.mode&Vt&&typeof s.UNSAFE_componentWillReceiveProps=="function"&&ci.push(r),typeof s.componentWillUpdate=="function"&&s.componentWillUpdate.__suppressDeprecationWarning!==!0&&Pa.push(r),r.mode&Vt&&typeof s.UNSAFE_componentWillUpdate=="function"&&La.push(r))},Zr.flushPendingUnsafeLifecycleWarnings=function(){var r=new Set;Ma.length>0&&(Ma.forEach(function(ue){r.add(Le(ue.type)||"Component"),hr.add(ue.type)}),Ma=[]);var s=new Set;Co.length>0&&(Co.forEach(function(ue){s.add(Le(ue.type)||"Component"),hr.add(ue.type)}),Co=[]);var u=new Set;Ro.length>0&&(Ro.forEach(function(ue){u.add(Le(ue.type)||"Component"),hr.add(ue.type)}),Ro=[]);var h=new Set;ci.length>0&&(ci.forEach(function(ue){h.add(Le(ue.type)||"Component"),hr.add(ue.type)}),ci=[]);var v=new Set;Pa.length>0&&(Pa.forEach(function(ue){v.add(Le(ue.type)||"Component"),hr.add(ue.type)}),Pa=[]);var b=new Set;if(La.length>0&&(La.forEach(function(ue){b.add(Le(ue.type)||"Component"),hr.add(ue.type)}),La=[]),s.size>0){var E=Hs(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
-
74
- * Move code with side effects to componentDidMount, and set initial state in the constructor.
75
-
76
- Please update the following components: %s`,E)}if(h.size>0){var O=Hs(h);m(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
77
-
78
- * Move data fetching code or side effects to componentDidUpdate.
79
- * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
80
-
81
- Please update the following components: %s`,O)}if(b.size>0){var k=Hs(b);m(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
82
-
83
- * Move data fetching code or side effects to componentDidUpdate.
84
-
85
- Please update the following components: %s`,k)}if(r.size>0){var B=Hs(r);x(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
86
-
87
- * Move code with side effects to componentDidMount, and set initial state in the constructor.
88
- * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
89
-
90
- Please update the following components: %s`,B)}if(u.size>0){var Y=Hs(u);x(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
91
-
92
- * Move data fetching code or side effects to componentDidUpdate.
93
- * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
94
- * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
95
-
96
- Please update the following components: %s`,Y)}if(v.size>0){var ie=Hs(v);x(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
97
-
98
- * Move data fetching code or side effects to componentDidUpdate.
99
- * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
100
-
101
- Please update the following components: %s`,ie)}};var au=new Map,kc=new Set;Zr.recordLegacyContextWarning=function(r,s){var u=Aa(r);if(u===null){m("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");return}if(!kc.has(r.type)){var h=au.get(u);(r.type.contextTypes!=null||r.type.childContextTypes!=null||s!==null&&typeof s.getChildContext=="function")&&(h===void 0&&(h=[],au.set(u,h)),h.push(r))}},Zr.flushLegacyContextWarning=function(){au.forEach(function(r,s){if(r.length!==0){var u=r[0],h=new Set;r.forEach(function(b){h.add(Le(b.type)||"Component"),kc.add(b.type)});var v=Hs(h);try{Ln(u),m(`Legacy context API has been detected within a strict-mode tree.
102
-
103
- The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
104
-
105
- Please update the following components: %s
106
-
107
- Learn more about this warning here: https://reactjs.org/link/legacy-context`,v)}finally{Gn()}}})},Zr.discardPendingWarnings=function(){Ma=[],Co=[],Ro=[],ci=[],Pa=[],La=[],au=new Map}}function fi(r,s){if(r&&r.defaultProps){var u=c({},s),h=r.defaultProps;for(var v in h)u[v]===void 0&&(u[v]=h[v]);return u}return s}var Da=1073741823,di=Qr(null),ka;ka={};var lu=null,Vs=null,Ws=null,Oo=!1;function Na(){lu=null,Vs=null,Ws=null,Oo=!1}function uu(){Oo=!0}function Nc(){Oo=!1}function za(r,s){var u=r.type._context;xn?(Mn(di,u._currentValue,r),u._currentValue=s,u._currentRenderer!==void 0&&u._currentRenderer!==null&&u._currentRenderer!==ka&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer=ka):(Mn(di,u._currentValue2,r),u._currentValue2=s,u._currentRenderer2!==void 0&&u._currentRenderer2!==null&&u._currentRenderer2!==ka&&m("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),u._currentRenderer2=ka)}function cu(r){var s=di.current;Jt(di,r);var u=r.type._context;xn?u._currentValue=s:u._currentValue2=s}function zv(r,s,u){if(zn(u,s))return 0;var h=typeof r._calculateChangedBits=="function"?r._calculateChangedBits(u,s):Da;return(h&Da)!==h&&m("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",h),h|0}function jr(r,s){for(var u=r;u!==null;){var h=u.alternate;if(!us(u.childLanes,s))u.childLanes=It(u.childLanes,s),h!==null&&(h.childLanes=It(h.childLanes,s));else if(h!==null&&!us(h.childLanes,s))h.childLanes=It(h.childLanes,s);else break;u=u.return}}function zc(r,s,u,h){var v=r.child;for(v!==null&&(v.return=r);v!==null;){var b=void 0,E=v.dependencies;if(E!==null){b=v.child;for(var O=E.firstContext;O!==null;){if(O.context===s&&O.observedBits&u){if(v.tag===D){var k=ds(bn,fr(h));k.tag=Mo,hs(v,k)}v.lanes=It(v.lanes,h);var B=v.alternate;B!==null&&(B.lanes=It(B.lanes,h)),jr(v.return,h),E.lanes=It(E.lanes,h);break}O=O.next}}else v.tag===_?b=v.type===r.type?null:v.child:b=v.child;if(b!==null)b.return=v;else for(b=v;b!==null;){if(b===r){b=null;break}var Y=b.sibling;if(Y!==null){Y.return=b.return,b=Y;break}b=b.return}v=b}}function Ao(r,s){lu=r,Vs=null,Ws=null;var u=r.dependencies;if(u!==null){var h=u.firstContext;h!==null&&(Yn(u.lanes,s)&&Pm(),u.firstContext=null)}}function tn(r,s){if(Oo&&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()."),Ws!==r){if(!(s===!1||s===0)){var u;typeof s!="number"||s===Da?(Ws=r,u=Da):u=s;var h={context:r,observedBits:u,next:null};if(Vs===null){if(lu===null)throw Error("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().");Vs=h,lu.dependencies={lanes:ye,firstContext:h,responders:null}}else Vs=Vs.next=h}}return xn?r._currentValue:r._currentValue2}var ja=0,$s=1,Mo=2,_a=3,Po=!1,jc,Ia;jc=!1,Ia=null;function fu(r){var s={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null};r.updateQueue=s}function Ua(r,s){var u=s.updateQueue,h=r.updateQueue;if(u===h){var v={baseState:h.baseState,firstBaseUpdate:h.firstBaseUpdate,lastBaseUpdate:h.lastBaseUpdate,shared:h.shared,effects:h.effects};s.updateQueue=v}}function ds(r,s){var u={eventTime:r,lane:s,tag:ja,payload:null,callback:null,next:null};return u}function hs(r,s){var u=r.updateQueue;if(u!==null){var h=u.shared,v=h.pending;v===null?s.next=s:(s.next=v.next,v.next=s),h.pending=s,Ia===h&&!jc&&(m("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),jc=!0)}}function o(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null){var v=h.updateQueue;if(u===v){var b=null,E=null,O=u.firstBaseUpdate;if(O!==null){var k=O;do{var B={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};E===null?b=E=B:(E.next=B,E=B),k=k.next}while(k!==null);E===null?b=E=s:(E.next=s,E=s)}else b=E=s;u={baseState:v.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:v.shared,effects:v.effects},r.updateQueue=u;return}}var Y=u.lastBaseUpdate;Y===null?u.firstBaseUpdate=s:Y.next=s,u.lastBaseUpdate=s}function l(r,s,u,h,v,b){switch(u.tag){case $s:{var E=u.payload;if(typeof E=="function"){uu();var O=E.call(b,h,v);{if(r.mode&Vt){Yr();try{E.call(b,h,v)}finally{oi()}}Nc()}return O}return E}case _a:r.flags=r.flags&~Bt|re;case ja:{var k=u.payload,B;if(typeof k=="function"){uu(),B=k.call(b,h,v);{if(r.mode&Vt){Yr();try{k.call(b,h,v)}finally{oi()}}Nc()}}else B=k;return B==null?h:c({},h,B)}case Mo:return Po=!0,h}return h}function d(r,s,u,h){var v=r.updateQueue;Po=!1,Ia=v.shared;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,O=v.shared.pending;if(O!==null){v.shared.pending=null;var k=O,B=k.next;k.next=null,E===null?b=B:E.next=B,E=k;var Y=r.alternate;if(Y!==null){var ie=Y.updateQueue,ue=ie.lastBaseUpdate;ue!==E&&(ue===null?ie.firstBaseUpdate=B:ue.next=B,ie.lastBaseUpdate=k)}}if(b!==null){var Te=v.baseState,Pe=ye,je=null,pt=null,Mt=null,bt=b;do{var fn=bt.lane,Nn=bt.eventTime;if(us(h,fn)){if(Mt!==null){var pe={eventTime:Nn,lane:Jn,tag:bt.tag,payload:bt.payload,callback:bt.callback,next:null};Mt=Mt.next=pe}Te=l(r,v,bt,Te,s,u);var G=bt.callback;if(G!==null){r.flags|=J;var Ce=v.effects;Ce===null?v.effects=[bt]:Ce.push(bt)}}else{var se={eventTime:Nn,lane:fn,tag:bt.tag,payload:bt.payload,callback:bt.callback,next:null};Mt===null?(pt=Mt=se,je=Te):Mt=Mt.next=se,Pe=It(Pe,fn)}if(bt=bt.next,bt===null){if(O=v.shared.pending,O===null)break;var Qe=O,Ke=Qe.next;Qe.next=null,bt=Ke,v.lastBaseUpdate=Qe,v.shared.pending=null}}while(!0);Mt===null&&(je=Te),v.baseState=je,v.firstBaseUpdate=pt,v.lastBaseUpdate=Mt,ng(Pe),r.lanes=Pe,r.memoizedState=Te}Ia=null}function y(r,s){if(typeof r!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+r);r.call(s)}function S(){Po=!1}function C(){return Po}function j(r,s,u){var h=s.effects;if(s.effects=null,h!==null)for(var v=0;v<h.length;v++){var b=h[v],E=b.callback;E!==null&&(b.callback=null,y(E,u))}}var H={},ce=Array.isArray,ze=new a.Component().refs,rt,mt,We,Yt,ln,_r,te,q,fe,He;{rt=new Set,mt=new Set,We=new Set,Yt=new Set,q=new Set,ln=new Set,fe=new Set,He=new Set;var ot=new Set;te=function(r,s){if(!(r===null||typeof r=="function")){var u=s+"_"+r;ot.has(u)||(ot.add(u),m("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",s,r))}},_r=function(r,s){if(s===void 0){var u=Le(r)||"Component";ln.has(u)||(ln.add(u),m("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",u))}},Object.defineProperty(H,"_processChildContext",{enumerable:!1,value:function(){throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(H)}function Qt(r,s,u,h){var v=r.memoizedState;if(r.mode&Vt){Yr();try{u(h,v)}finally{oi()}}var b=u(h,v);_r(s,b);var E=b==null?v:c({},v,b);if(r.memoizedState=E,r.lanes===ye){var O=r.updateQueue;O.baseState=E}}var gt={isMounted:rc,enqueueSetState:function(r,s,u){var h=W(r),v=ni(),b=zo(h),E=ds(v,b);E.payload=s,u!=null&&(te(u,"setState"),E.callback=u),hs(h,E),vr(h,b,v)},enqueueReplaceState:function(r,s,u){var h=W(r),v=ni(),b=zo(h),E=ds(v,b);E.tag=$s,E.payload=s,u!=null&&(te(u,"replaceState"),E.callback=u),hs(h,E),vr(h,b,v)},enqueueForceUpdate:function(r,s){var u=W(r),h=ni(),v=zo(u),b=ds(h,v);b.tag=Mo,s!=null&&(te(s,"forceUpdate"),b.callback=s),hs(u,b),vr(u,v,h)}};function Ut(r,s,u,h,v,b,E){var O=r.stateNode;if(typeof O.shouldComponentUpdate=="function"){if(r.mode&Vt){Yr();try{O.shouldComponentUpdate(h,b,E)}finally{oi()}}var k=O.shouldComponentUpdate(h,b,E);return k===void 0&&m("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",Le(s)||"Component"),k}return s.prototype&&s.prototype.isPureReactComponent?!Fs(u,h)||!Fs(v,b):!0}function Dn(r,s,u){var h=r.stateNode;{var v=Le(s)||"Component",b=h.render;b||(s.prototype&&typeof s.prototype.render=="function"?m("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",v):m("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",v)),h.getInitialState&&!h.getInitialState.isReactClassApproved&&!h.state&&m("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",v),h.getDefaultProps&&!h.getDefaultProps.isReactClassApproved&&m("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",v),h.propTypes&&m("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",v),h.contextType&&m("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",v),h.contextTypes&&m("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",v),s.contextType&&s.contextTypes&&!fe.has(s)&&(fe.add(s),m("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",v)),typeof h.componentShouldUpdate=="function"&&m("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",v),s.prototype&&s.prototype.isPureReactComponent&&typeof h.shouldComponentUpdate<"u"&&m("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Le(s)||"A pure component"),typeof h.componentDidUnmount=="function"&&m("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",v),typeof h.componentDidReceiveProps=="function"&&m("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",v),typeof h.componentWillRecieveProps=="function"&&m("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",v),typeof h.UNSAFE_componentWillRecieveProps=="function"&&m("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",v);var E=h.props!==u;h.props!==void 0&&E&&m("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",v,v),h.defaultProps&&m("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",v,v),typeof h.getSnapshotBeforeUpdate=="function"&&typeof h.componentDidUpdate!="function"&&!We.has(s)&&(We.add(s),m("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Le(s))),typeof h.getDerivedStateFromProps=="function"&&m("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof h.getDerivedStateFromError=="function"&&m("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",v),typeof s.getSnapshotBeforeUpdate=="function"&&m("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",v);var O=h.state;O&&(typeof O!="object"||ce(O))&&m("%s.state: must be set to an object or null",v),typeof h.getChildContext=="function"&&typeof s.childContextTypes!="object"&&m("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",v)}}function At(r,s){s.updater=gt,r.stateNode=s,Re(s,r),s._reactInternalInstance=H}function Wi(r,s,u){var h=!1,v=wn,b=wn,E=s.contextType;if("contextType"in s){var O=E===null||E!==void 0&&E.$$typeof===xt&&E._context===void 0;if(!O&&!He.has(s)){He.add(s);var k="";E===void 0?k=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof E!="object"?k=" However, it is set to a "+typeof E+".":E.$$typeof===yt?k=" Did you accidentally pass the Context.Provider instead?":E._context!==void 0?k=" Did you accidentally pass the Context.Consumer instead?":k=" However, it is set to an object with keys {"+Object.keys(E).join(", ")+"}.",m("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Le(s)||"Component",k)}}if(typeof E=="object"&&E!==null)b=tn(E);else{v=is(r,s,!0);var B=s.contextTypes;h=B!=null,b=h?ji(r,v):wn}if(r.mode&Vt){Yr();try{new s(u,b)}finally{oi()}}var Y=new s(u,b),ie=r.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null;At(r,Y);{if(typeof s.getDerivedStateFromProps=="function"&&ie===null){var ue=Le(s)||"Component";mt.has(ue)||(mt.add(ue),m("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",ue,Y.state===null?"null":"undefined",ue))}if(typeof s.getDerivedStateFromProps=="function"||typeof Y.getSnapshotBeforeUpdate=="function"){var Te=null,Pe=null,je=null;if(typeof Y.componentWillMount=="function"&&Y.componentWillMount.__suppressDeprecationWarning!==!0?Te="componentWillMount":typeof Y.UNSAFE_componentWillMount=="function"&&(Te="UNSAFE_componentWillMount"),typeof Y.componentWillReceiveProps=="function"&&Y.componentWillReceiveProps.__suppressDeprecationWarning!==!0?Pe="componentWillReceiveProps":typeof Y.UNSAFE_componentWillReceiveProps=="function"&&(Pe="UNSAFE_componentWillReceiveProps"),typeof Y.componentWillUpdate=="function"&&Y.componentWillUpdate.__suppressDeprecationWarning!==!0?je="componentWillUpdate":typeof Y.UNSAFE_componentWillUpdate=="function"&&(je="UNSAFE_componentWillUpdate"),Te!==null||Pe!==null||je!==null){var pt=Le(s)||"Component",Mt=typeof s.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";Yt.has(pt)||(Yt.add(pt),m(`Unsafe legacy lifecycles will not be called for components using new component APIs.
108
-
109
- %s uses %s but also contains the following legacy lifecycles:%s%s%s
110
-
111
- The above lifecycles should be removed. Learn more about this warning here:
112
- https://reactjs.org/link/unsafe-component-lifecycles`,pt,Mt,Te!==null?`
113
- `+Te:"",Pe!==null?`
114
- `+Pe:"",je!==null?`
115
- `+je:""))}}}return h&&yn(r,v,b),Y}function jv(r,s){var u=s.state;typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),u!==s.state&&(m("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Le(r.type)||"Component"),gt.enqueueReplaceState(s,s.state,null))}function _1(r,s,u,h){var v=s.state;if(typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==v){{var b=Le(r.type)||"Component";rt.has(b)||(rt.add(b),m("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",b))}gt.enqueueReplaceState(s,s.state,null)}}function _v(r,s,u,h){Dn(r,s,u);var v=r.stateNode;v.props=u,v.state=r.memoizedState,v.refs=ze,fu(r);var b=s.contextType;if(typeof b=="object"&&b!==null)v.context=tn(b);else{var E=is(r,s,!0);v.context=ji(r,E)}{if(v.state===u){var O=Le(s)||"Component";q.has(O)||(q.add(O),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.",O))}r.mode&Vt&&Zr.recordLegacyContextWarning(r,v),Zr.recordUnsafeLifecycleWarnings(r,v)}d(r,u,v,h),v.state=r.memoizedState;var k=s.getDerivedStateFromProps;typeof k=="function"&&(Qt(r,s,k,u),v.state=r.memoizedState),typeof s.getDerivedStateFromProps!="function"&&typeof v.getSnapshotBeforeUpdate!="function"&&(typeof v.UNSAFE_componentWillMount=="function"||typeof v.componentWillMount=="function")&&(jv(r,v),d(r,u,v,h),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=le)}function MM(r,s,u,h){var v=r.stateNode,b=r.memoizedProps;v.props=b;var E=v.context,O=s.contextType,k=wn;if(typeof O=="object"&&O!==null)k=tn(O);else{var B=is(r,s,!0);k=ji(r,B)}var Y=s.getDerivedStateFromProps,ie=typeof Y=="function"||typeof v.getSnapshotBeforeUpdate=="function";!ie&&(typeof v.UNSAFE_componentWillReceiveProps=="function"||typeof v.componentWillReceiveProps=="function")&&(b!==u||E!==k)&&_1(r,v,u,k),S();var ue=r.memoizedState,Te=v.state=ue;if(d(r,u,v,h),Te=r.memoizedState,b===u&&ue===Te&&!Gr()&&!C())return typeof v.componentDidMount=="function"&&(r.flags|=le),!1;typeof Y=="function"&&(Qt(r,s,Y,u),Te=r.memoizedState);var Pe=C()||Ut(r,s,b,u,ue,Te,k);return Pe?(!ie&&(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|=le)):(typeof v.componentDidMount=="function"&&(r.flags|=le),r.memoizedProps=u,r.memoizedState=Te),v.props=u,v.state=Te,v.context=k,Pe}function PM(r,s,u,h,v){var b=s.stateNode;Ua(r,s);var E=s.memoizedProps,O=s.type===s.elementType?E:fi(s.type,E);b.props=O;var k=s.pendingProps,B=b.context,Y=u.contextType,ie=wn;if(typeof Y=="object"&&Y!==null)ie=tn(Y);else{var ue=is(s,u,!0);ie=ji(s,ue)}var Te=u.getDerivedStateFromProps,Pe=typeof Te=="function"||typeof b.getSnapshotBeforeUpdate=="function";!Pe&&(typeof b.UNSAFE_componentWillReceiveProps=="function"||typeof b.componentWillReceiveProps=="function")&&(E!==k||B!==ie)&&_1(s,b,h,ie),S();var je=s.memoizedState,pt=b.state=je;if(d(s,h,b,v),pt=s.memoizedState,E===k&&je===pt&&!Gr()&&!C())return typeof b.componentDidUpdate=="function"&&(E!==r.memoizedProps||je!==r.memoizedState)&&(s.flags|=le),typeof b.getSnapshotBeforeUpdate=="function"&&(E!==r.memoizedProps||je!==r.memoizedState)&&(s.flags|=Ae),!1;typeof Te=="function"&&(Qt(s,u,Te,h),pt=s.memoizedState);var Mt=C()||Ut(s,u,O,h,je,pt,ie);return Mt?(!Pe&&(typeof b.UNSAFE_componentWillUpdate=="function"||typeof b.componentWillUpdate=="function")&&(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,pt,ie),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,pt,ie)),typeof b.componentDidUpdate=="function"&&(s.flags|=le),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=Ae)):(typeof b.componentDidUpdate=="function"&&(E!==r.memoizedProps||je!==r.memoizedState)&&(s.flags|=le),typeof b.getSnapshotBeforeUpdate=="function"&&(E!==r.memoizedProps||je!==r.memoizedState)&&(s.flags|=Ae),s.memoizedProps=h,s.memoizedState=pt),b.props=h,b.state=pt,b.context=ie,Mt}var Iv,Uv,Fv,Bv,Hv,I1=function(r,s){};Iv=!1,Uv=!1,Fv={},Bv={},Hv={},I1=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 u=Le(s.type)||"Component";Bv[u]||(Bv[u]=!0,m('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};var Yd=Array.isArray;function _c(r,s,u){var h=u.ref;if(h!==null&&typeof h!="function"&&typeof h!="object"){if((r.mode&Vt||Ps)&&!(u._owner&&u._self&&u._owner.stateNode!==u._self)){var v=Le(r.type)||"Component";Fv[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),Fv[v]=!0)}if(u._owner){var b=u._owner,E;if(b){var O=b;if(O.tag!==D)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");E=O.stateNode}if(!E)throw Error("Missing owner for string ref "+h+". This error is likely caused by a bug in React. Please file an issue.");var k=""+h;if(s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===k)return s.ref;var B=function(Y){var ie=E.refs;ie===ze&&(ie=E.refs={}),Y===null?delete ie[k]:ie[k]=Y};return B._stringRef=k,B}else{if(typeof h!="string")throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!u._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
- 1. You may be adding a ref to a function component
117
- 2. You may be adding a ref to a component that was not created inside a component's render method
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 Qd(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 Gd(r){{var s=Le(r.type)||"Component";if(Hv[s])return;Hv[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 U1(r){function s(se,pe){if(r){var G=se.lastEffect;G!==null?(G.nextEffect=pe,se.lastEffect=pe):se.firstEffect=se.lastEffect=pe,pe.nextEffect=null,pe.flags=be}}function u(se,pe){if(!r)return null;for(var G=pe;G!==null;)s(se,G),G=G.sibling;return null}function h(se,pe){for(var G=new Map,Ce=pe;Ce!==null;)Ce.key!==null?G.set(Ce.key,Ce):G.set(Ce.index,Ce),Ce=Ce.sibling;return G}function v(se,pe){var G=el(se,pe);return G.index=0,G.sibling=null,G}function b(se,pe,G){if(se.index=G,!r)return pe;var Ce=se.alternate;if(Ce!==null){var Qe=Ce.index;return Qe<pe?(se.flags=de,pe):Qe}else return se.flags=de,pe}function E(se){return r&&se.alternate===null&&(se.flags=de),se}function O(se,pe,G,Ce){if(pe===null||pe.tag!==A){var Qe=yg(G,se.mode,Ce);return Qe.return=se,Qe}else{var Ke=v(pe,G);return Ke.return=se,Ke}}function k(se,pe,G,Ce){if(pe!==null&&(pe.elementType===G.type||Tx(pe,G))){var Qe=v(pe,G.props);return Qe.ref=_c(se,pe,G),Qe.return=se,Qe._debugSource=G._source,Qe._debugOwner=G._owner,Qe}var Ke=mg(G,se.mode,Ce);return Ke.ref=_c(se,pe,G),Ke.return=se,Ke}function B(se,pe,G,Ce){if(pe===null||pe.tag!==P||pe.stateNode.containerInfo!==G.containerInfo||pe.stateNode.implementation!==G.implementation){var Qe=bg(G,se.mode,Ce);return Qe.return=se,Qe}else{var Ke=v(pe,G.children||[]);return Ke.return=se,Ke}}function Y(se,pe,G,Ce,Qe){if(pe===null||pe.tag!==F){var Ke=tl(G,se.mode,Ce,Qe);return Ke.return=se,Ke}else{var Lt=v(pe,G);return Lt.return=se,Lt}}function ie(se,pe,G){if(typeof pe=="string"||typeof pe=="number"){var Ce=yg(""+pe,se.mode,G);return Ce.return=se,Ce}if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Ie:{var Qe=mg(pe,se.mode,G);return Qe.ref=_c(se,null,pe),Qe.return=se,Qe}case tt:{var Ke=bg(pe,se.mode,G);return Ke.return=se,Ke}}if(Yd(pe)||et(pe)){var Lt=tl(pe,se.mode,G,null);return Lt.return=se,Lt}Qd(se,pe)}return typeof pe=="function"&&Gd(se),null}function ue(se,pe,G,Ce){var Qe=pe!==null?pe.key:null;if(typeof G=="string"||typeof G=="number")return Qe!==null?null:O(se,pe,""+G,Ce);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case Ie:return G.key===Qe?G.type===at?Y(se,pe,G.props.children,Ce,Qe):k(se,pe,G,Ce):null;case tt:return G.key===Qe?B(se,pe,G,Ce):null}if(Yd(G)||et(G))return Qe!==null?null:Y(se,pe,G,Ce,null);Qd(se,G)}return typeof G=="function"&&Gd(se),null}function Te(se,pe,G,Ce,Qe){if(typeof Ce=="string"||typeof Ce=="number"){var Ke=se.get(G)||null;return O(pe,Ke,""+Ce,Qe)}if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case Ie:{var Lt=se.get(Ce.key===null?G:Ce.key)||null;return Ce.type===at?Y(pe,Lt,Ce.props.children,Qe,Ce.key):k(pe,Lt,Ce,Qe)}case tt:{var pn=se.get(Ce.key===null?G:Ce.key)||null;return B(pe,pn,Ce,Qe)}}if(Yd(Ce)||et(Ce)){var Tn=se.get(G)||null;return Y(pe,Tn,Ce,Qe,null)}Qd(pe,Ce)}return typeof Ce=="function"&&Gd(pe),null}function Pe(se,pe,G){{if(typeof se!="object"||se===null)return pe;switch(se.$$typeof){case Ie:case tt:I1(se,G);var Ce=se.key;if(typeof Ce!="string")break;if(pe===null){pe=new Set,pe.add(Ce);break}if(!pe.has(Ce)){pe.add(Ce);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.",Ce);break}}return pe}function je(se,pe,G,Ce){for(var Qe=null,Ke=0;Ke<G.length;Ke++){var Lt=G[Ke];Qe=Pe(Lt,Qe,se)}for(var pn=null,Tn=null,Xt=pe,Hn=0,Wt=0,Cn=null;Xt!==null&&Wt<G.length;Wt++){Xt.index>Wt?(Cn=Xt,Xt=null):Cn=Xt.sibling;var sr=ue(se,Xt,G[Wt],Ce);if(sr===null){Xt===null&&(Xt=Cn);break}r&&Xt&&sr.alternate===null&&s(se,Xt),Hn=b(sr,Hn,Wt),Tn===null?pn=sr:Tn.sibling=sr,Tn=sr,Xt=Cn}if(Wt===G.length)return u(se,Xt),pn;if(Xt===null){for(;Wt<G.length;Wt++){var jn=ie(se,G[Wt],Ce);jn!==null&&(Hn=b(jn,Hn,Wt),Tn===null?pn=jn:Tn.sibling=jn,Tn=jn)}return pn}for(var ys=h(se,Xt);Wt<G.length;Wt++){var _n=Te(ys,se,Wt,G[Wt],Ce);_n!==null&&(r&&_n.alternate!==null&&ys.delete(_n.key===null?Wt:_n.key),Hn=b(_n,Hn,Wt),Tn===null?pn=_n:Tn.sibling=_n,Tn=_n)}return r&&ys.forEach(function(bs){return s(se,bs)}),pn}function pt(se,pe,G,Ce){var Qe=et(G);if(typeof Qe!="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"&&G[Symbol.toStringTag]==="Generator"&&(Uv||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."),Uv=!0),G.entries===Qe&&(Iv||m("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Iv=!0);var Ke=Qe.call(G);if(Ke)for(var Lt=null,pn=Ke.next();!pn.done;pn=Ke.next()){var Tn=pn.value;Lt=Pe(Tn,Lt,se)}}var Xt=Qe.call(G);if(Xt==null)throw Error("An iterable object provided no iterator.");for(var Hn=null,Wt=null,Cn=pe,sr=0,jn=0,ys=null,_n=Xt.next();Cn!==null&&!_n.done;jn++,_n=Xt.next()){Cn.index>jn?(ys=Cn,Cn=null):ys=Cn.sibling;var bs=ue(se,Cn,_n.value,Ce);if(bs===null){Cn===null&&(Cn=ys);break}r&&Cn&&bs.alternate===null&&s(se,Cn),sr=b(bs,sr,jn),Wt===null?Hn=bs:Wt.sibling=bs,Wt=bs,Cn=ys}if(_n.done)return u(se,Cn),Hn;if(Cn===null){for(;!_n.done;jn++,_n=Xt.next()){var nl=ie(se,_n.value,Ce);nl!==null&&(sr=b(nl,sr,jn),Wt===null?Hn=nl:Wt.sibling=nl,Wt=nl)}return Hn}for(var Eg=h(se,Cn);!_n.done;jn++,_n=Xt.next()){var Io=Te(Eg,se,jn,_n.value,Ce);Io!==null&&(r&&Io.alternate!==null&&Eg.delete(Io.key===null?jn:Io.key),sr=b(Io,sr,jn),Wt===null?Hn=Io:Wt.sibling=Io,Wt=Io)}return r&&Eg.forEach(function(LD){return s(se,LD)}),Hn}function Mt(se,pe,G,Ce){if(pe!==null&&pe.tag===A){u(se,pe.sibling);var Qe=v(pe,G);return Qe.return=se,Qe}u(se,pe);var Ke=yg(G,se.mode,Ce);return Ke.return=se,Ke}function bt(se,pe,G,Ce){for(var Qe=G.key,Ke=pe;Ke!==null;){if(Ke.key===Qe){switch(Ke.tag){case F:{if(G.type===at){u(se,Ke.sibling);var Lt=v(Ke,G.props.children);return Lt.return=se,Lt._debugSource=G._source,Lt._debugOwner=G._owner,Lt}break}case Oe:default:{if(Ke.elementType===G.type||Tx(Ke,G)){u(se,Ke.sibling);var pn=v(Ke,G.props);return pn.ref=_c(se,Ke,G),pn.return=se,pn._debugSource=G._source,pn._debugOwner=G._owner,pn}break}}u(se,Ke);break}else s(se,Ke);Ke=Ke.sibling}if(G.type===at){var Tn=tl(G.props.children,se.mode,Ce,G.key);return Tn.return=se,Tn}else{var Xt=mg(G,se.mode,Ce);return Xt.ref=_c(se,pe,G),Xt.return=se,Xt}}function fn(se,pe,G,Ce){for(var Qe=G.key,Ke=pe;Ke!==null;){if(Ke.key===Qe)if(Ke.tag===P&&Ke.stateNode.containerInfo===G.containerInfo&&Ke.stateNode.implementation===G.implementation){u(se,Ke.sibling);var Lt=v(Ke,G.children||[]);return Lt.return=se,Lt}else{u(se,Ke);break}else s(se,Ke);Ke=Ke.sibling}var pn=bg(G,se.mode,Ce);return pn.return=se,pn}function Nn(se,pe,G,Ce){var Qe=typeof G=="object"&&G!==null&&G.type===at&&G.key===null;Qe&&(G=G.props.children);var Ke=typeof G=="object"&&G!==null;if(Ke)switch(G.$$typeof){case Ie:return E(bt(se,pe,G,Ce));case tt:return E(fn(se,pe,G,Ce))}if(typeof G=="string"||typeof G=="number")return E(Mt(se,pe,""+G,Ce));if(Yd(G))return je(se,pe,G,Ce);if(et(G))return pt(se,pe,G,Ce);if(Ke&&Qd(se,G),typeof G=="function"&&Gd(se),typeof G>"u"&&!Qe)switch(se.tag){case D:{var Lt=se.stateNode;if(Lt.render._isMockFunction)break}case Oe:case R:case K:case ge:throw Error((Le(se.type)||"Component")+"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.")}return u(se,pe)}return Nn}var Xd=U1(!0),F1=U1(!1);function LM(r,s){if(!(r===null||s.child===r.child))throw Error("Resuming work not yet implemented.");if(s.child!==null){var u=s.child,h=el(u,u.pendingProps);for(s.child=h,h.return=s;u.sibling!==null;)u=u.sibling,h=h.sibling=el(u,u.pendingProps),h.return=s;h.sibling=null}}function DM(r,s){for(var u=r.child;u!==null;)sD(u,s),u=u.sibling}var Ic={},Lo=Qr(Ic),Uc=Qr(Ic),Kd=Qr(Ic);function Zd(r){if(r===Ic)throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return r}function Vv(){var r=Zd(Kd.current);return r}function Wv(r,s){Mn(Kd,s,r),Mn(Uc,r,r),Mn(Lo,Ic,r);var u=Dt(s);Jt(Lo,r),Mn(Lo,u,r)}function du(r){Jt(Lo,r),Jt(Uc,r),Jt(Kd,r)}function Fc(){var r=Zd(Lo.current);return r}function B1(r){var s=Zd(Kd.current),u=Zd(Lo.current),h=Ht(u,r.type,s);u!==h&&(Mn(Uc,r,r),Mn(Lo,h,r))}function $v(r){Uc.current===r&&(Jt(Lo,r),Jt(Uc,r))}var kM=0,H1=1,qv=1,Bc=2,$i=Qr(kM);function Jd(r,s){return(r&s)!==0}function Hc(r){return r&H1}function Yv(r,s){return r&H1|s}function NM(r,s){return r|s}function Fa(r,s){Mn($i,s,r)}function hu(r){Jt($i,r)}function zM(r,s){var u=r.memoizedState;if(u!==null)return u.dehydrated!==null;var h=r.memoizedProps;return h.fallback===void 0?!1:h.unstable_avoidThisFallback!==!0?!0:!s}function eh(r){for(var s=r;s!==null;){if(s.tag===V){var u=s.memoizedState;if(u!==null){var h=u.dehydrated;if(h===null||Cl(h)||fc(h))return s}}else if(s.tag===Fe&&s.memoizedProps.revealOrder!==void 0){var v=(s.flags&re)!==oe;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 Qv=0,Ba=1,Ha=2,Vc=4,Ti=null,Va=null,Do=!1;function jM(r){if(!dn)return!1;var s=r.stateNode.containerInfo;return Va=Un(s),Ti=r,Do=!0,!0}function V1(r,s){switch(r.tag){case z:Rv(r.stateNode.containerInfo,s);break;case L:qr(r.type,r.memoizedProps,r.stateNode,s);break}var u=fD();u.stateNode=s,u.return=r,u.flags=be,r.lastEffect!==null?(r.lastEffect.nextEffect=u,r.lastEffect=u):r.firstEffect=r.lastEffect=u}function W1(r,s){switch(s.flags=s.flags&~Ct|de,r.tag){case z:{var u=r.stateNode.containerInfo;switch(s.tag){case L:var h=s.type,v=s.pendingProps;Ov(u,h,v);break;case A:var b=s.pendingProps;Ol(u,b);break;case V:Av(u);break}break}case L:{var E=r.type,O=r.memoizedProps,k=r.stateNode;switch(s.tag){case L:var B=s.type,Y=s.pendingProps;si(E,O,k,B,Y);break;case A:var ie=s.pendingProps;Al(E,O,k,ie);break;case V:Ml(E,O,k);break}break}default:return}}function $1(r,s){switch(r.tag){case L:{var u=r.type,h=r.pendingProps,v=Tv(s,u,h);return v!==null?(r.stateNode=v,!0):!1}case A:{var b=r.pendingProps,E=Di(s,b);return E!==null?(r.stateNode=E,!0):!1}case V:return!1;default:return!1}}function Gv(r){if(Do){var s=Va;if(!s){W1(Ti,r),Do=!1,Ti=r;return}var u=s;if(!$1(r,s)){if(s=Rl(u),!s||!$1(r,s)){W1(Ti,r),Do=!1,Ti=r;return}V1(Ti,u)}Ti=r,Va=Un(s)}}function _M(r,s,u){if(!dn)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=co(h,r.type,r.memoizedProps,s,u,r);return r.updateQueue=v,v!==null}function IM(r){if(!dn)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,u=r.memoizedProps,h=Md(s,u,r);if(h){var v=Ti;if(v!==null)switch(v.tag){case z:{var b=v.stateNode.containerInfo;Pd(b,s,u);break}case L:{var E=v.type,O=v.memoizedProps,k=v.stateNode;Cv(E,O,k,s,u);break}}}return h}function UM(r){if(!dn)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,u=s!==null?s.dehydrated:null;if(!u)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return ki(u)}function q1(r){for(var s=r.return;s!==null&&s.tag!==L&&s.tag!==z&&s.tag!==V;)s=s.return;Ti=s}function th(r){if(!dn||r!==Ti)return!1;if(!Do)return q1(r),Do=!0,!1;var s=r.type;if(r.tag!==L||s!=="head"&&s!=="body"&&!ar(s,r.memoizedProps))for(var u=Va;u;)V1(r,u),u=Rl(u);return q1(r),r.tag===V?Va=UM(r):Va=Ti?Rl(r.stateNode):null,!0}function Xv(){dn&&(Ti=null,Va=null,Do=!1)}function Kv(){return Do}var Wc=[],$c;$c={};function FM(r){Wc.push(r)}function Zv(){for(var r=0;r<Wc.length;r++){var s=Wc[r];xn?s._workInProgressVersionPrimary=null:s._workInProgressVersionSecondary=null}Wc.length=0}function BM(r){return xn?r._workInProgressVersionPrimary:r._workInProgressVersionSecondary}function Y1(r,s){xn?r._workInProgressVersionPrimary=s:r._workInProgressVersionSecondary=s,Wc.push(r)}function HM(r){xn?r._currentPrimaryRenderer==null?r._currentPrimaryRenderer=$c:r._currentPrimaryRenderer!==$c&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."):r._currentSecondaryRenderer==null?r._currentSecondaryRenderer=$c:r._currentSecondaryRenderer!==$c&&m("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.")}var $e=g.ReactCurrentDispatcher,Ci=g.ReactCurrentBatchConfig,Jv,em;em={},Jv=new Set;var qc=ye,cn=null,Cr=null,ir=null,nh=!1,Yc=!1,VM=25,Se=null,Ri=null,ko=-1,tm=!1;function un(){{var r=Se;Ri===null?Ri=[r]:Ri.push(r)}}function Ge(){{var r=Se;Ri!==null&&(ko++,Ri[ko]!==r&&WM(r))}}function Qc(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.",Se,typeof r)}function WM(r){{var s=Le(cn.type);if(!Jv.has(s)&&(Jv.add(s),Ri!==null)){for(var u="",h=30,v=0;v<=ko;v++){for(var b=Ri[v],E=v===ko?r:b,O=v+1+". "+b;O.length<h;)O+=" ";O+=E+`
120
- `,u+=O}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
-
122
- Previous render Next render
123
- ------------------------------------------------------
124
- %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125
- `,s,u)}}}function Jr(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
126
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
127
- 2. You might be breaking the Rules of Hooks
128
- 3. You might have more than one copy of React in the same app
129
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function nm(r,s){if(tm)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.",Se),!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
-
131
- Previous: %s
132
- Incoming: %s`,Se,"["+s.join(", ")+"]","["+r.join(", ")+"]");for(var u=0;u<s.length&&u<r.length;u++)if(!zn(r[u],s[u]))return!1;return!0}function pu(r,s,u,h,v,b){qc=b,cn=s,Ri=r!==null?r._debugHookTypes:null,ko=-1,tm=r!==null&&r.type!==s.type,s.memoizedState=null,s.updateQueue=null,s.lanes=ye,r!==null&&r.memoizedState!==null?$e.current=lS:Ri!==null?$e.current=aS:$e.current=oS;var E=u(h,v);if(Yc){var O=0;do{if(Yc=!1,!(O<VM))throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");O+=1,tm=!1,Cr=null,ir=null,s.updateQueue=null,ko=-1,$e.current=uS,E=u(h,v)}while(Yc)}$e.current=ph,s._debugHookTypes=Ri;var k=Cr!==null&&Cr.next!==null;if(qc=ye,cn=null,Cr=null,ir=null,Se=null,Ri=null,ko=-1,nh=!1,k)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return E}function Q1(r,s,u){s.updateQueue=r.updateQueue,s.flags&=~(Ne|le),r.lanes=va(r.lanes,u)}function G1(){if($e.current=ph,nh){for(var r=cn.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}nh=!1}qc=ye,cn=null,Cr=null,ir=null,Ri=null,ko=-1,Se=null,hh=!1,Yc=!1}function Wa(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ir===null?cn.memoizedState=ir=r:ir=ir.next=r,ir}function $a(){var r;if(Cr===null){var s=cn.alternate;s!==null?r=s.memoizedState:r=null}else r=Cr.next;var u;if(ir===null?u=cn.memoizedState:u=ir.next,u!==null)ir=u,u=ir.next,Cr=r;else{if(r===null)throw Error("Rendered more hooks than during the previous render.");Cr=r;var h={memoizedState:Cr.memoizedState,baseState:Cr.baseState,baseQueue:Cr.baseQueue,queue:Cr.queue,next:null};ir===null?cn.memoizedState=ir=h:ir=ir.next=h}return ir}function $M(){return{lastEffect:null}}function rh(r,s){return typeof s=="function"?s(r):s}function rm(r,s,u){var h=Wa(),v;u!==void 0?v=u(s):v=s,h.memoizedState=h.baseState=v;var b=h.queue={pending:null,dispatch:null,lastRenderedReducer:r,lastRenderedState:v},E=b.dispatch=mm.bind(null,cn,b);return[h.memoizedState,E]}function im(r,s,u){var h=$a(),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=Cr,E=b.baseQueue,O=v.pending;if(O!==null){if(E!==null){var k=E.next,B=O.next;E.next=B,O.next=k}b.baseQueue!==E&&m("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),b.baseQueue=E=O,v.pending=null}if(E!==null){var Y=E.next,ie=b.baseState,ue=null,Te=null,Pe=null,je=Y;do{var pt=je.lane;if(us(qc,pt)){if(Pe!==null){var bt={lane:Jn,action:je.action,eagerReducer:je.eagerReducer,eagerState:je.eagerState,next:null};Pe=Pe.next=bt}if(je.eagerReducer===r)ie=je.eagerState;else{var fn=je.action;ie=r(ie,fn)}}else{var Mt={lane:pt,action:je.action,eagerReducer:je.eagerReducer,eagerState:je.eagerState,next:null};Pe===null?(Te=Pe=Mt,ue=ie):Pe=Pe.next=Mt,cn.lanes=It(cn.lanes,pt),ng(pt)}je=je.next}while(je!==null&&je!==Y);Pe===null?ue=ie:Pe.next=Te,zn(ie,h.memoizedState)||Pm(),h.memoizedState=ie,h.baseState=ue,h.baseQueue=Pe,v.lastRenderedState=ie}var Nn=v.dispatch;return[h.memoizedState,Nn]}function sm(r,s,u){var h=$a(),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,E=v.pending,O=h.memoizedState;if(E!==null){v.pending=null;var k=E.next,B=k;do{var Y=B.action;O=r(O,Y),B=B.next}while(B!==k);zn(O,h.memoizedState)||Pm(),h.memoizedState=O,h.baseQueue===null&&(h.baseState=O),v.lastRenderedState=O}return[O,b]}function X1(r,s,u){HM(s);var h=s._getVersion,v=h(s._source),b=!1,E=BM(s);if(E!==null?b=E===v:(b=us(qc,r.mutableReadLanes),b&&Y1(s,v)),b){var O=u(s._source);return typeof O=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),O}else throw FM(s),Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.")}function K1(r,s,u,h){var v=oL();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,E=b(s._source),O=$e.current,k=O.useState(function(){return X1(v,s,u)}),B=k[0],Y=k[1],ie=B,ue=ir,Te=r.memoizedState,Pe=Te.refs,je=Pe.getSnapshot,pt=Te.source,Mt=Te.subscribe,bt=cn;if(r.memoizedState={refs:Pe,source:s,subscribe:h},O.useEffect(function(){Pe.getSnapshot=u,Pe.setSnapshot=Y;var Nn=b(s._source);if(!zn(E,Nn)){var se=u(s._source);if(typeof se=="function"&&m("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."),!zn(ie,se)){Y(se);var pe=zo(bt);ga(v,pe)}eu(v,v.mutableReadLanes)}},[u,s,h]),O.useEffect(function(){var Nn=function(){var pe=Pe.getSnapshot,G=Pe.setSnapshot;try{G(pe(s._source));var Ce=zo(bt);ga(v,Ce)}catch(Qe){G(function(){throw Qe})}},se=h(s._source,Nn);return typeof se!="function"&&m("Mutable source subscribe function must return an unsubscribe function."),se},[s,h]),!zn(je,u)||!zn(pt,s)||!zn(Mt,h)){var fn={pending:null,dispatch:null,lastRenderedReducer:rh,lastRenderedState:ie};fn.dispatch=Y=mm.bind(null,cn,fn),ue.queue=fn,ue.baseQueue=null,ie=X1(v,s,u),ue.memoizedState=ue.baseState=ie}return ie}function om(r,s,u){var h=Wa();return h.memoizedState={refs:{getSnapshot:s,setSnapshot:null},source:r,subscribe:u},K1(h,r,s,u)}function ih(r,s,u){var h=$a();return K1(h,r,s,u)}function qa(r){var s=Wa();typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r;var u=s.queue={pending:null,dispatch:null,lastRenderedReducer:rh,lastRenderedState:r},h=u.dispatch=mm.bind(null,cn,u);return[s.memoizedState,h]}function Gc(r){return im(rh)}function Xc(r){return sm(rh)}function sh(r,s,u,h){var v={tag:r,create:s,destroy:u,deps:h,next:null},b=cn.updateQueue;if(b===null)b=$M(),cn.updateQueue=b,b.lastEffect=v.next=v;else{var E=b.lastEffect;if(E===null)b.lastEffect=v.next=v;else{var O=E.next;E.next=v,v.next=O,b.lastEffect=v}}return v}function oh(r){var s=Wa(),u={current:r};return Object.seal(u),s.memoizedState=u,u}function vu(r){var s=$a();return s.memoizedState}function am(r,s,u,h){var v=Wa(),b=h===void 0?null:h;cn.flags|=r,v.memoizedState=sh(Ba|s,u,void 0,b)}function lm(r,s,u,h){var v=$a(),b=h===void 0?null:h,E=void 0;if(Cr!==null){var O=Cr.memoizedState;if(E=O.destroy,b!==null){var k=O.deps;if(nm(b,k)){sh(s,u,E,b);return}}}cn.flags|=r,v.memoizedState=sh(Ba|s,u,E,b)}function ah(r,s){return typeof jest<"u"&&vx(cn),am(le|Ne,Vc,r,s)}function mu(r,s){return typeof jest<"u"&&vx(cn),lm(le|Ne,Vc,r,s)}function um(r,s){return am(le,Ha,r,s)}function lh(r,s){return lm(le,Ha,r,s)}function Z1(r,s){if(typeof s=="function"){var u=s,h=r();return u(h),function(){u(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 cm(r,s,u){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=u!=null?u.concat([r]):null;return am(le,Ha,Z1.bind(null,s,r),h)}function uh(r,s,u){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=u!=null?u.concat([r]):null;return lm(le,Ha,Z1.bind(null,s,r),h)}function qM(r,s){}var ch=qM;function fm(r,s){var u=Wa(),h=s===void 0?null:s;return u.memoizedState=[r,h],r}function fh(r,s){var u=$a(),h=s===void 0?null:s,v=u.memoizedState;if(v!==null&&h!==null){var b=v[1];if(nm(h,b))return v[0]}return u.memoizedState=[r,h],r}function dm(r,s){var u=Wa(),h=s===void 0?null:s,v=r();return u.memoizedState=[v,h],v}function dh(r,s){var u=$a(),h=s===void 0?null:s,v=u.memoizedState;if(v!==null&&h!==null){var b=v[1];if(nm(h,b))return v[0]}var E=r();return u.memoizedState=[E,h],E}function hm(r){var s=qa(r),u=s[0],h=s[1];return ah(function(){var v=Ci.transition;Ci.transition=1;try{h(r)}finally{Ci.transition=v}},[r]),u}function J1(r){var s=Gc(),u=s[0],h=s[1];return mu(function(){var v=Ci.transition;Ci.transition=1;try{h(r)}finally{Ci.transition=v}},[r]),u}function eS(r){var s=Xc(),u=s[0],h=s[1];return mu(function(){var v=Ci.transition;Ci.transition=1;try{h(r)}finally{Ci.transition=v}},[r]),u}function YM(r,s){var u=Ye();ui(u<Nr?Nr:u,function(){r(!0)}),ui(u>Kr?Kr:u,function(){var h=Ci.transition;Ci.transition=1;try{r(!1),s()}finally{Ci.transition=h}})}function pm(){var r=qa(!1),s=r[0],u=r[1],h=YM.bind(null,u);return oh(h),[h,s]}function tS(){var r=Gc(),s=r[0],u=vu(),h=u.current;return[h,s]}function nS(){var r=Xc(),s=r[0],u=vu(),h=u.current;return[h,s]}var hh=!1;function QM(){return hh}function rS(r){{var s=Le(r.type)||"Unknown";qd()&&!em[s]&&(m("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly."),em[s]=!0)}}function vm(){var r=Ed.bind(null,rS.bind(null,cn));if(Kv()){var s=!1,u=cn,h=function(){throw s||(s=!0,hh=!0,b(r()),hh=!1,rS(u)),Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.")},v=wd(h),b=qa(v)[1];return(cn.mode&Bn)===an&&(cn.flags|=le|Ne,sh(Ba|Vc,function(){b(r())},void 0,null)),v}else{var E=r();return qa(E),E}}function iS(){var r=Gc()[0];return r}function sS(){var r=Xc()[0];return r}function mm(r,s,u){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=ni(),v=zo(r),b={lane:v,action:u,eagerReducer:null,eagerState:null,next:null},E=s.pending;E===null?b.next=b:(b.next=E.next,E.next=b),s.pending=b;var O=r.alternate;if(r===cn||O!==null&&O===cn)Yc=nh=!0;else{if(r.lanes===ye&&(O===null||O.lanes===ye)){var k=s.lastRenderedReducer;if(k!==null){var B;B=$e.current,$e.current=qi;try{var Y=s.lastRenderedState,ie=k(Y,u);if(b.eagerReducer=k,b.eagerState=ie,zn(ie,Y))return}catch{}finally{$e.current=B}}}typeof jest<"u"&&(px(r),qL(r)),vr(r,v,h)}}var ph={readContext:tn,useCallback:Jr,useContext:Jr,useEffect:Jr,useImperativeHandle:Jr,useLayoutEffect:Jr,useMemo:Jr,useReducer:Jr,useRef:Jr,useState:Jr,useDebugValue:Jr,useDeferredValue:Jr,useTransition:Jr,useMutableSource:Jr,useOpaqueIdentifier:Jr,unstable_isNewReconciler:br},oS=null,aS=null,lS=null,uS=null,ps=null,qi=null,vh=null;{var gm=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().")},Tt=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")};oS={readContext:function(r,s){return tn(r,s)},useCallback:function(r,s){return Se="useCallback",un(),Qc(s),fm(r,s)},useContext:function(r,s){return Se="useContext",un(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",un(),Qc(s),ah(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",un(),Qc(u),cm(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",un(),Qc(s),um(r,s)},useMemo:function(r,s){Se="useMemo",un(),Qc(s);var u=$e.current;$e.current=ps;try{return dm(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",un();var h=$e.current;$e.current=ps;try{return rm(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",un(),oh(r)},useState:function(r){Se="useState",un();var s=$e.current;$e.current=ps;try{return qa(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",un(),void 0},useDeferredValue:function(r){return Se="useDeferredValue",un(),hm(r)},useTransition:function(){return Se="useTransition",un(),pm()},useMutableSource:function(r,s,u){return Se="useMutableSource",un(),om(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",un(),vm()},unstable_isNewReconciler:br},aS={readContext:function(r,s){return tn(r,s)},useCallback:function(r,s){return Se="useCallback",Ge(),fm(r,s)},useContext:function(r,s){return Se="useContext",Ge(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Ge(),ah(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Ge(),cm(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Ge(),um(r,s)},useMemo:function(r,s){Se="useMemo",Ge();var u=$e.current;$e.current=ps;try{return dm(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Ge();var h=$e.current;$e.current=ps;try{return rm(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Ge(),oh(r)},useState:function(r){Se="useState",Ge();var s=$e.current;$e.current=ps;try{return qa(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Ge(),void 0},useDeferredValue:function(r){return Se="useDeferredValue",Ge(),hm(r)},useTransition:function(){return Se="useTransition",Ge(),pm()},useMutableSource:function(r,s,u){return Se="useMutableSource",Ge(),om(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Ge(),vm()},unstable_isNewReconciler:br},lS={readContext:function(r,s){return tn(r,s)},useCallback:function(r,s){return Se="useCallback",Ge(),fh(r,s)},useContext:function(r,s){return Se="useContext",Ge(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Ge(),mu(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Ge(),uh(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Ge(),lh(r,s)},useMemo:function(r,s){Se="useMemo",Ge();var u=$e.current;$e.current=qi;try{return dh(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Ge();var h=$e.current;$e.current=qi;try{return im(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Ge(),vu()},useState:function(r){Se="useState",Ge();var s=$e.current;$e.current=qi;try{return Gc(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Ge(),ch()},useDeferredValue:function(r){return Se="useDeferredValue",Ge(),J1(r)},useTransition:function(){return Se="useTransition",Ge(),tS()},useMutableSource:function(r,s,u){return Se="useMutableSource",Ge(),ih(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Ge(),iS()},unstable_isNewReconciler:br},uS={readContext:function(r,s){return tn(r,s)},useCallback:function(r,s){return Se="useCallback",Ge(),fh(r,s)},useContext:function(r,s){return Se="useContext",Ge(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Ge(),mu(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Ge(),uh(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Ge(),lh(r,s)},useMemo:function(r,s){Se="useMemo",Ge();var u=$e.current;$e.current=vh;try{return dh(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Ge();var h=$e.current;$e.current=vh;try{return sm(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Ge(),vu()},useState:function(r){Se="useState",Ge();var s=$e.current;$e.current=vh;try{return Xc(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Ge(),ch()},useDeferredValue:function(r){return Se="useDeferredValue",Ge(),eS(r)},useTransition:function(){return Se="useTransition",Ge(),nS()},useMutableSource:function(r,s,u){return Se="useMutableSource",Ge(),ih(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Ge(),sS()},unstable_isNewReconciler:br},ps={readContext:function(r,s){return gm(),tn(r,s)},useCallback:function(r,s){return Se="useCallback",Tt(),un(),fm(r,s)},useContext:function(r,s){return Se="useContext",Tt(),un(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Tt(),un(),ah(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Tt(),un(),cm(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Tt(),un(),um(r,s)},useMemo:function(r,s){Se="useMemo",Tt(),un();var u=$e.current;$e.current=ps;try{return dm(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Tt(),un();var h=$e.current;$e.current=ps;try{return rm(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Tt(),un(),oh(r)},useState:function(r){Se="useState",Tt(),un();var s=$e.current;$e.current=ps;try{return qa(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Tt(),un(),void 0},useDeferredValue:function(r){return Se="useDeferredValue",Tt(),un(),hm(r)},useTransition:function(){return Se="useTransition",Tt(),un(),pm()},useMutableSource:function(r,s,u){return Se="useMutableSource",Tt(),un(),om(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Tt(),un(),vm()},unstable_isNewReconciler:br},qi={readContext:function(r,s){return gm(),tn(r,s)},useCallback:function(r,s){return Se="useCallback",Tt(),Ge(),fh(r,s)},useContext:function(r,s){return Se="useContext",Tt(),Ge(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Tt(),Ge(),mu(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Tt(),Ge(),uh(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Tt(),Ge(),lh(r,s)},useMemo:function(r,s){Se="useMemo",Tt(),Ge();var u=$e.current;$e.current=qi;try{return dh(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Tt(),Ge();var h=$e.current;$e.current=qi;try{return im(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Tt(),Ge(),vu()},useState:function(r){Se="useState",Tt(),Ge();var s=$e.current;$e.current=qi;try{return Gc(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Tt(),Ge(),ch()},useDeferredValue:function(r){return Se="useDeferredValue",Tt(),Ge(),J1(r)},useTransition:function(){return Se="useTransition",Tt(),Ge(),tS()},useMutableSource:function(r,s,u){return Se="useMutableSource",Tt(),Ge(),ih(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Tt(),Ge(),iS()},unstable_isNewReconciler:br},vh={readContext:function(r,s){return gm(),tn(r,s)},useCallback:function(r,s){return Se="useCallback",Tt(),Ge(),fh(r,s)},useContext:function(r,s){return Se="useContext",Tt(),Ge(),tn(r,s)},useEffect:function(r,s){return Se="useEffect",Tt(),Ge(),mu(r,s)},useImperativeHandle:function(r,s,u){return Se="useImperativeHandle",Tt(),Ge(),uh(r,s,u)},useLayoutEffect:function(r,s){return Se="useLayoutEffect",Tt(),Ge(),lh(r,s)},useMemo:function(r,s){Se="useMemo",Tt(),Ge();var u=$e.current;$e.current=qi;try{return dh(r,s)}finally{$e.current=u}},useReducer:function(r,s,u){Se="useReducer",Tt(),Ge();var h=$e.current;$e.current=qi;try{return sm(r,s,u)}finally{$e.current=h}},useRef:function(r){return Se="useRef",Tt(),Ge(),vu()},useState:function(r){Se="useState",Tt(),Ge();var s=$e.current;$e.current=qi;try{return Xc(r)}finally{$e.current=s}},useDebugValue:function(r,s){return Se="useDebugValue",Tt(),Ge(),ch()},useDeferredValue:function(r){return Se="useDeferredValue",Tt(),Ge(),eS(r)},useTransition:function(){return Se="useTransition",Tt(),Ge(),nS()},useMutableSource:function(r,s,u){return Se="useMutableSource",Tt(),Ge(),ih(r,s,u)},useOpaqueIdentifier:function(){return Se="useOpaqueIdentifier",Tt(),Ge(),sS()},unstable_isNewReconciler:br}}var mh=f.unstable_now,cS=0,Kc=-1;function GM(){return cS}function fS(){cS=mh()}function ym(r){Kc=mh(),r.actualStartTime<0&&(r.actualStartTime=mh())}function dS(r){Kc=-1}function gh(r,s){if(Kc>=0){var u=mh()-Kc;r.actualDuration+=u,s&&(r.selfBaseDuration=u),Kc=-1}}function bm(r){for(var s=r.child;s;)r.actualDuration+=s.actualDuration,s=s.sibling}var Zc=g.ReactCurrentOwner,vs=!1,Sm,Jc,xm,wm,Em,Ya,Tm,yh;Sm={},Jc={},xm={},wm={},Em={},Ya=!1,Tm={},yh={};function ei(r,s,u,h){r===null?s.child=F1(s,null,u,h):s.child=Xd(s,r.child,u,h)}function XM(r,s,u,h){s.child=Xd(s,r.child,null,h),s.child=Xd(s,null,u,h)}function hS(r,s,u,h,v){if(s.type!==s.elementType){var b=u.propTypes;b&&Sr(b,h,"prop",Le(u))}var E=u.render,O=s.ref,k;Ao(s,v);{if(Zc.current=s,dr(!0),k=pu(r,s,E,h,O,v),s.mode&Vt){Yr();try{k=pu(r,s,E,h,O,v)}finally{oi()}}dr(!1)}return r!==null&&!vs?(Q1(r,s,v),qs(r,s,v)):(s.flags|=X,ei(r,s,k,v),s.child)}function pS(r,s,u,h,v,b){if(r===null){var E=u.type;if(rD(E)&&u.compare===null&&u.defaultProps===void 0){var O=E;return O=Eu(E),s.tag=ge,s.type=O,Am(s,E),vS(r,s,O,h,v,b)}{var k=E.propTypes;k&&Sr(k,h,"prop",Le(E))}var B=vg(u.type,null,h,s,s.mode,b);return B.ref=s.ref,B.return=s,s.child=B,B}{var Y=u.type,ie=Y.propTypes;ie&&Sr(ie,h,"prop",Le(Y))}var ue=r.child;if(!Yn(v,b)){var Te=ue.memoizedProps,Pe=u.compare;if(Pe=Pe!==null?Pe:Fs,Pe(Te,h)&&r.ref===s.ref)return qs(r,s,b)}s.flags|=X;var je=el(ue,h);return je.ref=s.ref,je.return=s,s.child=je,je}function vS(r,s,u,h,v,b){if(s.type!==s.elementType){var E=s.elementType;if(E.$$typeof===qe){var O=E,k=O._payload,B=O._init;try{E=B(k)}catch{E=null}var Y=E&&E.propTypes;Y&&Sr(Y,h,"prop",Le(E))}}if(r!==null){var ie=r.memoizedProps;if(Fs(ie,h)&&r.ref===s.ref&&s.type===r.type)if(vs=!1,Yn(b,v))(r.flags&Mr)!==oe&&(vs=!0);else return s.lanes=r.lanes,qs(r,s,b)}return Rm(r,s,u,h,b)}function Cm(r,s,u){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&Bi)===an){var E={baseLanes:ye};s.memoizedState=E,$h(s,u)}else if(Yn(u,kr)){var Y={baseLanes:ye};s.memoizedState=Y;var ie=b!==null?b.baseLanes:u;$h(s,ie)}else{var O;if(b!==null){var k=b.baseLanes;O=It(k,u)}else O=u;Xh(kr),s.lanes=s.childLanes=kr;var B={baseLanes:O};return s.memoizedState=B,$h(s,O),null}else{var ue;b!==null?(ue=It(b.baseLanes,u),s.memoizedState=null):ue=u,$h(s,ue)}return ei(r,s,v,u),s.child}var KM=Cm;function ZM(r,s,u){var h=s.pendingProps;return ei(r,s,h,u),s.child}function JM(r,s,u){var h=s.pendingProps.children;return ei(r,s,h,u),s.child}function eP(r,s,u){{s.flags|=le;var h=s.stateNode;h.effectDuration=0,h.passiveEffectDuration=0}var v=s.pendingProps,b=v.children;return ei(r,s,b,u),s.child}function mS(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=De)}function Rm(r,s,u,h,v){if(s.type!==s.elementType){var b=u.propTypes;b&&Sr(b,h,"prop",Le(u))}var E;{var O=is(s,u,!0);E=ji(s,O)}var k;Ao(s,v);{if(Zc.current=s,dr(!0),k=pu(r,s,u,h,E,v),s.mode&Vt){Yr();try{k=pu(r,s,u,h,E,v)}finally{oi()}}dr(!1)}return r!==null&&!vs?(Q1(r,s,v),qs(r,s,v)):(s.flags|=X,ei(r,s,k,v),s.child)}function gS(r,s,u,h,v){if(s.type!==s.elementType){var b=u.propTypes;b&&Sr(b,h,"prop",Le(u))}var E;Kn(u)?(E=!0,ta(s)):E=!1,Ao(s,v);var O=s.stateNode,k;O===null?(r!==null&&(r.alternate=null,s.alternate=null,s.flags|=de),Wi(s,u,h),_v(s,u,h,v),k=!0):r===null?k=MM(s,u,h,v):k=PM(r,s,u,h,v);var B=Om(r,s,u,k,E,v);{var Y=s.stateNode;k&&Y.props!==h&&(Ya||m("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Le(s.type)||"a component"),Ya=!0)}return B}function Om(r,s,u,h,v,b){mS(r,s);var E=(s.flags&re)!==oe;if(!h&&!E)return v&&na(s,u,!1),qs(r,s,b);var O=s.stateNode;Zc.current=s;var k;if(E&&typeof u.getDerivedStateFromError!="function")k=null,dS();else{if(dr(!0),k=O.render(),s.mode&Vt){Yr();try{O.render()}finally{oi()}}dr(!1)}return s.flags|=X,r!==null&&E?XM(r,s,k,b):ei(r,s,k,b),s.memoizedState=O.state,v&&na(s,u,!0),s.child}function yS(r){var s=r.stateNode;s.pendingContext?pc(r,s.pendingContext,s.pendingContext!==s.context):s.context&&pc(r,s.context,!1),Wv(r,s.containerInfo)}function tP(r,s,u){yS(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,E=b!==null?b.element:null;Ua(r,s),d(s,v,null,u);var O=s.memoizedState,k=O.element;if(k===E)return Xv(),qs(r,s,u);var B=s.stateNode;if(B.hydrate&&jM(s)){if(dn){var Y=B.mutableSourceEagerHydrationData;if(Y!=null)for(var ie=0;ie<Y.length;ie+=2){var ue=Y[ie],Te=Y[ie+1];Y1(ue,Te)}}var Pe=F1(s,null,k,u);s.child=Pe;for(var je=Pe;je;)je.flags=je.flags&~de|Ct,je=je.sibling}else ei(r,s,k,u),Xv();return s.child}function nP(r,s,u){B1(s),r===null&&Gv(s);var h=s.type,v=s.pendingProps,b=r!==null?r.memoizedProps:null,E=v.children,O=ar(h,v);return O?E=null:b!==null&&ar(h,b)&&(s.flags|=Ve),mS(r,s),ei(r,s,E,u),s.child}function rP(r,s){return r===null&&Gv(s),null}function iP(r,s,u,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=de);var b=s.pendingProps,E=u,O=E._payload,k=E._init,B=k(O);s.type=B;var Y=s.tag=iD(B),ie=fi(B,b),ue;switch(Y){case R:return Am(s,B),s.type=B=Eu(B),ue=Rm(null,s,B,ie,v),ue;case D:return s.type=B=ug(B),ue=gS(null,s,B,ie,v),ue;case K:return s.type=B=cg(B),ue=hS(null,s,B,ie,v),ue;case ae:{if(s.type!==s.elementType){var Te=B.propTypes;Te&&Sr(Te,ie,"prop",Le(B))}return ue=pS(null,s,B,fi(B.type,ie),h,v),ue}}var Pe="";throw B!==null&&typeof B=="object"&&B.$$typeof===qe&&(Pe=" Did you wrap a component in React.lazy() more than once?"),Error("Element type is invalid. Received a promise that resolves to: "+B+". Lazy element type must resolve to a class or function."+Pe)}function sP(r,s,u,h,v){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=de),s.tag=D;var b;return Kn(u)?(b=!0,ta(s)):b=!1,Ao(s,v),Wi(s,u,h),_v(s,u,h,v),Om(null,s,u,!0,b,v)}function oP(r,s,u,h){r!==null&&(r.alternate=null,s.alternate=null,s.flags|=de);var v=s.pendingProps,b;{var E=is(s,u,!1);b=ji(s,E)}Ao(s,h);var O;{if(u.prototype&&typeof u.prototype.render=="function"){var k=Le(u)||"Unknown";Sm[k]||(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.",k,k),Sm[k]=!0)}s.mode&Vt&&Zr.recordLegacyContextWarning(s,null),dr(!0),Zc.current=s,O=pu(null,s,u,v,b,h),dr(!1)}if(s.flags|=X,typeof O=="object"&&O!==null&&typeof O.render=="function"&&O.$$typeof===void 0){var B=Le(u)||"Unknown";Jc[B]||(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.",B,B,B),Jc[B]=!0)}if(typeof O=="object"&&O!==null&&typeof O.render=="function"&&O.$$typeof===void 0){{var Y=Le(u)||"Unknown";Jc[Y]||(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.",Y,Y,Y),Jc[Y]=!0)}s.tag=D,s.memoizedState=null,s.updateQueue=null;var ie=!1;Kn(u)?(ie=!0,ta(s)):ie=!1,s.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,fu(s);var ue=u.getDerivedStateFromProps;return typeof ue=="function"&&Qt(s,u,ue,v),At(s,O),_v(s,u,v,h),Om(null,s,u,!0,ie,h)}else{if(s.tag=R,s.mode&Vt){Yr();try{O=pu(null,s,u,v,b,h)}finally{oi()}}return ei(null,s,O,h),Am(s,u),s.child}}function Am(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 u="",h=Wd();h&&(u+=`
133
-
134
- Check the render method of \``+h+"`.");var v=h||r._debugID||"",b=r._debugSource;b&&(v=b.fileName+":"+b.lineNumber),Em[v]||(Em[v]=!0,m("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",u))}if(typeof s.getDerivedStateFromProps=="function"){var E=Le(s)||"Unknown";wm[E]||(m("%s: Function components do not support getDerivedStateFromProps.",E),wm[E]=!0)}if(typeof s.contextType=="object"&&s.contextType!==null){var O=Le(s)||"Unknown";xm[O]||(m("%s: Function components do not support contextType.",O),xm[O]=!0)}}}var bh={dehydrated:null,retryLane:Jn};function Sh(r){return{baseLanes:r}}function bS(r,s){return{baseLanes:It(r.baseLanes,s)}}function aP(r,s,u,h){if(s!==null){var v=s.memoizedState;if(v===null)return!1}return Jd(r,Bc)}function SS(r,s){return va(r.childLanes,s)}function xS(r,s,u){var h=s.pendingProps;Lx(s)&&(s.flags|=re);var v=$i.current,b=!1,E=(s.flags&re)!==oe;if(E||aP(v,r)?(b=!0,s.flags&=~re):(r===null||r.memoizedState!==null)&&h.fallback!==void 0&&h.unstable_avoidThisFallback!==!0&&(v=NM(v,qv)),v=Hc(v),Fa(s,v),r===null){h.fallback!==void 0&&Gv(s);var O=h.children,k=h.fallback;if(b){var B=wS(s,O,k,u),Y=s.child;return Y.memoizedState=Sh(u),s.memoizedState=bh,B}else if(typeof h.unstable_expectedLoadTime=="number"){var ie=wS(s,O,k,u),ue=s.child;return ue.memoizedState=Sh(u),s.memoizedState=bh,s.lanes=Is,Xh(Is),ie}else return lP(s,O,u)}else{var Te=r.memoizedState;if(Te!==null)if(b){var Pe=h.fallback,je=h.children,pt=CS(r,s,je,Pe,u),Mt=s.child,bt=r.child.memoizedState;return Mt.memoizedState=bt===null?Sh(u):bS(bt,u),Mt.childLanes=SS(r,u),s.memoizedState=bh,pt}else{var fn=h.children,Nn=TS(r,s,fn,u);return s.memoizedState=null,Nn}else if(b){var se=h.fallback,pe=h.children,G=CS(r,s,pe,se,u),Ce=s.child,Qe=r.child.memoizedState;return Ce.memoizedState=Qe===null?Sh(u):bS(Qe,u),Ce.childLanes=SS(r,u),s.memoizedState=bh,G}else{var Ke=h.children,Lt=TS(r,s,Ke,u);return s.memoizedState=null,Lt}}}function lP(r,s,u){var h=r.mode,v={mode:"visible",children:s},b=gg(v,h,u,null);return b.return=r,r.child=b,b}function wS(r,s,u,h){var v=r.mode,b=r.child,E={mode:"hidden",children:s},O,k;return(v&Bn)===an&&b!==null?(O=b,O.childLanes=ye,O.pendingProps=E,r.mode&nr&&(O.actualDuration=0,O.actualStartTime=-1,O.selfBaseDuration=0,O.treeBaseDuration=0),k=tl(u,v,h,null)):(O=gg(E,v,ye,null),k=tl(u,v,h,null)),O.return=r,k.return=r,O.sibling=k,r.child=O,k}function ES(r,s){return el(r,s)}function TS(r,s,u,h){var v=r.child,b=v.sibling,E=ES(v,{mode:"visible",children:u});return(s.mode&Bn)===an&&(E.lanes=h),E.return=s,E.sibling=null,b!==null&&(b.nextEffect=null,b.flags=be,s.firstEffect=s.lastEffect=b),s.child=E,E}function CS(r,s,u,h,v){var b=s.mode,E=r.child,O=E.sibling,k={mode:"hidden",children:u},B;if((b&Bn)===an&&s.child!==E){var Y=s.child;B=Y,B.childLanes=ye,B.pendingProps=k,s.mode&nr&&(B.actualDuration=0,B.actualStartTime=-1,B.selfBaseDuration=E.selfBaseDuration,B.treeBaseDuration=E.treeBaseDuration);var ie=B.lastEffect;ie!==null?(s.firstEffect=B.firstEffect,s.lastEffect=ie,ie.nextEffect=null):s.firstEffect=s.lastEffect=null}else B=ES(E,k);var ue;return O!==null?ue=el(O,h):(ue=tl(h,b,v,null),ue.flags|=de),ue.return=s,B.return=s,B.sibling=ue,s.child=B,ue}function RS(r,s){r.lanes=It(r.lanes,s);var u=r.alternate;u!==null&&(u.lanes=It(u.lanes,s)),jr(r.return,s)}function uP(r,s,u){for(var h=s;h!==null;){if(h.tag===V){var v=h.memoizedState;v!==null&&RS(h,u)}else if(h.tag===Fe)RS(h,u);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 cP(r){for(var s=r,u=null;s!==null;){var h=s.alternate;h!==null&&eh(h)===null&&(u=s),s=s.sibling}return u}function fP(r){if(r!==void 0&&r!=="forwards"&&r!=="backwards"&&r!=="together"&&!Tm[r])if(Tm[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 dP(r,s){r!==void 0&&!yh[r]&&(r!=="collapsed"&&r!=="hidden"?(yh[r]=!0,m('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',r)):s!=="forwards"&&s!=="backwards"&&(yh[r]=!0,m('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',r)))}function OS(r,s){{var u=Array.isArray(r),h=!u&&typeof et(r)=="function";if(u||h){var v=u?"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 hP(r,s){if((s==="forwards"||s==="backwards")&&r!==void 0&&r!==null&&r!==!1)if(Array.isArray(r)){for(var u=0;u<r.length;u++)if(!OS(r[u],u))return}else{var h=et(r);if(typeof h=="function"){var v=h.call(r);if(v)for(var b=v.next(),E=0;!b.done;b=v.next()){if(!OS(b.value,E))return;E++}}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 Mm(r,s,u,h,v,b){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:v,lastEffect:b}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=h,E.tail=u,E.tailMode=v,E.lastEffect=b)}function AS(r,s,u){var h=s.pendingProps,v=h.revealOrder,b=h.tail,E=h.children;fP(v),dP(b,v),hP(E,v),ei(r,s,E,u);var O=$i.current,k=Jd(O,Bc);if(k)O=Yv(O,Bc),s.flags|=re;else{var B=r!==null&&(r.flags&re)!==oe;B&&uP(s,s.child,u),O=Hc(O)}if(Fa(s,O),(s.mode&Bn)===an)s.memoizedState=null;else switch(v){case"forwards":{var Y=cP(s.child),ie;Y===null?(ie=s.child,s.child=null):(ie=Y.sibling,Y.sibling=null),Mm(s,!1,ie,Y,b,s.lastEffect);break}case"backwards":{var ue=null,Te=s.child;for(s.child=null;Te!==null;){var Pe=Te.alternate;if(Pe!==null&&eh(Pe)===null){s.child=Te;break}var je=Te.sibling;Te.sibling=ue,ue=Te,Te=je}Mm(s,!0,ue,null,b,s.lastEffect);break}case"together":{Mm(s,!1,null,null,void 0,s.lastEffect);break}default:s.memoizedState=null}return s.child}function pP(r,s,u){Wv(s,s.stateNode.containerInfo);var h=s.pendingProps;return r===null?s.child=Xd(s,null,h,u):ei(r,s,h,u),s.child}var MS=!1;function vP(r,s,u){var h=s.type,v=h._context,b=s.pendingProps,E=s.memoizedProps,O=b.value;{"value"in b||MS||(MS=!0,m("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var k=s.type.propTypes;k&&Sr(k,b,"prop","Context.Provider")}if(za(s,O),E!==null){var B=E.value,Y=zv(v,O,B);if(Y===0){if(E.children===b.children&&!Gr())return qs(r,s,u)}else zc(s,v,Y,u)}var ie=b.children;return ei(r,s,ie,u),s.child}var PS=!1;function mP(r,s,u){var h=s.type;h._context===void 0?h!==h.Consumer&&(PS||(PS=!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."),Ao(s,u);var E=tn(h,v.unstable_observedBits),O;return Zc.current=s,dr(!0),O=b(E),dr(!1),s.flags|=X,ei(r,s,O,u),s.child}function Pm(){vs=!0}function qs(r,s,u){return r!==null&&(s.dependencies=r.dependencies),dS(),ng(s.lanes),Yn(u,s.childLanes)?(LM(r,s),s.child):null}function gP(r,s,u){{var h=s.return;if(h===null)throw new Error("Cannot swap the root fiber.");if(r.alternate=null,s.alternate=null,u.index=s.index,u.sibling=s.sibling,u.return=s.return,u.ref=s.ref,s===h.child)h.child=u;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=u}var b=h.lastEffect;return b!==null?(b.nextEffect=r,h.lastEffect=r):h.firstEffect=h.lastEffect=r,r.nextEffect=null,r.flags=be,u.flags|=de,u}}function LS(r,s,u){var h=s.lanes;if(s._debugNeedsRemount&&r!==null)return gP(r,s,vg(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||Gr()||s.type!==r.type)vs=!0;else if(Yn(u,h))(r.flags&Mr)!==oe?vs=!0:vs=!1;else{switch(vs=!1,s.tag){case z:yS(s),Xv();break;case L:B1(s);break;case D:{var E=s.type;Kn(E)&&ta(s);break}case P:Wv(s,s.stateNode.containerInfo);break;case _:{var O=s.memoizedProps.value;za(s,O);break}case ee:{var k=Yn(u,s.childLanes);k&&(s.flags|=le);var B=s.stateNode;B.effectDuration=0,B.passiveEffectDuration=0}break;case V:{var Y=s.memoizedState;if(Y!==null){var ie=s.child,ue=ie.childLanes;if(Yn(u,ue))return xS(r,s,u);Fa(s,Hc($i.current));var Te=qs(r,s,u);return Te!==null?Te.sibling:null}else Fa(s,Hc($i.current));break}case Fe:{var Pe=(r.flags&re)!==oe,je=Yn(u,s.childLanes);if(Pe){if(je)return AS(r,s,u);s.flags|=re}var pt=s.memoizedState;if(pt!==null&&(pt.rendering=null,pt.tail=null,pt.lastEffect=null),Fa(s,$i.current),je)break;return null}case it:case nt:return s.lanes=ye,Cm(r,s,u)}return qs(r,s,u)}}else vs=!1;switch(s.lanes=ye,s.tag){case M:return oP(r,s,s.type,u);case we:{var Mt=s.elementType;return iP(r,s,Mt,h,u)}case R:{var bt=s.type,fn=s.pendingProps,Nn=s.elementType===bt?fn:fi(bt,fn);return Rm(r,s,bt,Nn,u)}case D:{var se=s.type,pe=s.pendingProps,G=s.elementType===se?pe:fi(se,pe);return gS(r,s,se,G,u)}case z:return tP(r,s,u);case L:return nP(r,s,u);case A:return rP(r,s);case V:return xS(r,s,u);case P:return pP(r,s,u);case K:{var Ce=s.type,Qe=s.pendingProps,Ke=s.elementType===Ce?Qe:fi(Ce,Qe);return hS(r,s,Ce,Ke,u)}case F:return ZM(r,s,u);case $:return JM(r,s,u);case ee:return eP(r,s,u);case _:return vP(r,s,u);case Q:return mP(r,s,u);case ae:{var Lt=s.type,pn=s.pendingProps,Tn=fi(Lt,pn);if(s.type!==s.elementType){var Xt=Lt.propTypes;Xt&&Sr(Xt,Tn,"prop",Le(Lt))}return Tn=fi(Lt.type,Tn),pS(r,s,Lt,Tn,h,u)}case ge:return vS(r,s,s.type,s.pendingProps,h,u);case Ee:{var Hn=s.type,Wt=s.pendingProps,Cn=s.elementType===Hn?Wt:fi(Hn,Wt);return sP(r,s,Hn,Cn,u)}case Fe:return AS(r,s,u);case Be:break;case vt:break;case Oe:break;case it:return Cm(r,s,u);case nt:return KM(r,s,u)}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function ms(r){r.flags|=le}function DS(r){r.flags|=De}var ef,tf,xh,wh;if($n)ef=function(r,s,u,h){for(var v=s.child;v!==null;){if(v.tag===L||v.tag===A)Zt(r,v.stateNode);else if(v.tag!==P){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}},tf=function(r){},xh=function(r,s,u,h,v){var b=r.memoizedProps;if(b!==h){var E=s.stateNode,O=Fc(),k=Wn(E,u,b,h,v,O);s.updateQueue=k,k&&ms(s)}},wh=function(r,s,u,h){u!==h&&ms(s)};else if(yi){ef=function(r,s,u,h){for(var v=s.child;v!==null;){if(v.tag===L){var b=v.stateNode;if(u&&h){var E=v.memoizedProps,O=v.type;b=cc(b,O,E,v)}Zt(r,b)}else if(v.tag===A){var k=v.stateNode;if(u&&h){var B=v.memoizedProps;k=Tl(k,B,v)}Zt(r,k)}else if(v.tag!==P){if(v.tag===V){if((v.flags&le)!==oe){var Y=v.memoizedState!==null;if(Y){var ie=v.child;if(ie!==null){ie.child!==null&&(ie.child.return=ie,ef(r,ie,!0,Y));var ue=ie.sibling;if(ue!==null){ue.return=v,v=ue;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 kS=function(r,s,u,h){for(var v=s.child;v!==null;){if(v.tag===L){var b=v.stateNode;if(u&&h){var E=v.memoizedProps,O=v.type;b=cc(b,O,E,v)}lc(r,b)}else if(v.tag===A){var k=v.stateNode;if(u&&h){var B=v.memoizedProps;k=Tl(k,B,v)}lc(r,k)}else if(v.tag!==P){if(v.tag===V){if((v.flags&le)!==oe){var Y=v.memoizedState!==null;if(Y){var ie=v.child;if(ie!==null){ie.child!==null&&(ie.child.return=ie,kS(r,ie,!0,Y));var ue=ie.sibling;if(ue!==null){ue.return=v,v=ue;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}};tf=function(r){var s=r.stateNode,u=r.firstEffect===null;if(!u){var h=s.containerInfo,v=Ko(h);kS(v,r,!1,!1),s.pendingChildren=v,ms(r),Ad(h,v)}},xh=function(r,s,u,h,v){var b=r.stateNode,E=r.memoizedProps,O=s.firstEffect===null;if(O&&E===h){s.stateNode=b;return}var k=s.stateNode,B=Fc(),Y=null;if(E!==h&&(Y=Wn(k,u,E,h,v,B)),O&&Y===null){s.stateNode=b;return}var ie=Ev(b,Y,u,E,h,s,O,k);rn(ie,u,h,v,B)&&ms(s),s.stateNode=ie,O?ms(s):ef(ie,s,!1,!1)},wh=function(r,s,u,h){if(u!==h){var v=Vv(),b=Fc();s.stateNode=Vr(h,v,b,s),ms(s)}else s.stateNode=r.stateNode}}else tf=function(r){},xh=function(r,s,u,h,v){},wh=function(r,s,u,h){};function nf(r,s){if(!Kv())switch(r.tailMode){case"hidden":{for(var u=r.tail,h=null;u!==null;)u.alternate!==null&&(h=u),u=u.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 NS(r,s,u){var h=s.pendingProps;switch(s.tag){case M:case we:case ge:case R:case K:case F:case $:case ee:case Q:case ae:return null;case D:{var v=s.type;return Kn(v)&&Dr(s),null}case z:{du(s),_l(s),Zv();var b=s.stateNode;if(b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),r===null||r.child===null){var E=th(s);E?ms(s):b.hydrate||(s.flags|=Ae)}return tf(s),null}case L:{$v(s);var O=Vv(),k=s.type;if(r!==null&&s.stateNode!=null)xh(r,s,k,h,O),r.ref!==s.ref&&DS(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 B=Fc(),Y=th(s);if(Y)_M(s,O,B)&&ms(s);else{var ie=An(k,h,O,B,s);ef(ie,s,!1,!1),s.stateNode=ie,rn(ie,k,h,O,B)&&ms(s)}s.ref!==null&&DS(s)}return null}case A:{var ue=h;if(r&&s.stateNode!=null){var Te=r.memoizedProps;wh(r,s,Te,ue)}else{if(typeof ue!="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 Pe=Vv(),je=Fc(),pt=th(s);pt?IM(s)&&ms(s):s.stateNode=Vr(ue,Pe,je,s)}return null}case V:{hu(s);var Mt=s.memoizedState;if((s.flags&re)!==oe)return s.lanes=u,(s.mode&nr)!==an&&bm(s),s;var bt=Mt!==null,fn=!1;if(r===null)s.memoizedProps.fallback!==void 0&&th(s);else{var Nn=r.memoizedState;fn=Nn!==null}if(bt&&!fn&&(s.mode&Bn)!==an){var se=r===null&&s.memoizedProps.unstable_avoidThisFallback!==!0;se||Jd($i.current,qv)?yL():bL()}return yi&&bt&&(s.flags|=le),$n&&(bt||fn)&&(s.flags|=le),null}case P:return du(s),tf(s),r===null&&ic(s.stateNode.containerInfo),null;case _:return cu(s),null;case Ee:{var pe=s.type;return Kn(pe)&&Dr(s),null}case Fe:{hu(s);var G=s.memoizedState;if(G===null)return null;var Ce=(s.flags&re)!==oe,Qe=G.rendering;if(Qe===null)if(Ce)nf(G,!1);else{var Ke=xL()&&(r===null||(r.flags&re)===oe);if(!Ke)for(var Lt=s.child;Lt!==null;){var pn=eh(Lt);if(pn!==null){Ce=!0,s.flags|=re,nf(G,!1);var Tn=pn.updateQueue;return Tn!==null&&(s.updateQueue=Tn,s.flags|=le),G.lastEffect===null&&(s.firstEffect=null),s.lastEffect=G.lastEffect,DM(s,u),Fa(s,Yv($i.current,Bc)),s.child}Lt=Lt.sibling}G.tail!==null&&hn()>nx()&&(s.flags|=re,Ce=!0,nf(G,!1),s.lanes=Is,Xh(Is))}else{if(!Ce){var Xt=eh(Qe);if(Xt!==null){s.flags|=re,Ce=!0;var Hn=Xt.updateQueue;if(Hn!==null&&(s.updateQueue=Hn,s.flags|=le),nf(G,!0),G.tail===null&&G.tailMode==="hidden"&&!Qe.alternate&&!Kv()){var Wt=s.lastEffect=G.lastEffect;return Wt!==null&&(Wt.nextEffect=null),null}}else hn()*2-G.renderingStartTime>nx()&&u!==kr&&(s.flags|=re,Ce=!0,nf(G,!1),s.lanes=Is,Xh(Is))}if(G.isBackwards)Qe.sibling=s.child,s.child=Qe;else{var Cn=G.last;Cn!==null?Cn.sibling=Qe:s.child=Qe,G.last=Qe}}if(G.tail!==null){var sr=G.tail;G.rendering=sr,G.tail=sr.sibling,G.lastEffect=s.lastEffect,G.renderingStartTime=hn(),sr.sibling=null;var jn=$i.current;return Ce?jn=Yv(jn,Bc):jn=Hc(jn),Fa(s,jn),sr}return null}case Be:break;case vt:break;case Oe:break;case it:case nt:{if(tg(s),r!==null){var ys=s.memoizedState,_n=r.memoizedState,bs=_n!==null,nl=ys!==null;bs!==nl&&h.mode!=="unstable-defer-without-hiding"&&(s.flags|=le)}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 yP(r,s){switch(r.tag){case D:{var u=r.type;Kn(u)&&Dr(r);var h=r.flags;return h&Bt?(r.flags=h&~Bt|re,(r.mode&nr)!==an&&bm(r),r):null}case z:{du(r),_l(r),Zv();var v=r.flags;if((v&re)!==oe)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&~Bt|re,r}case L:return $v(r),null;case V:{hu(r);var b=r.flags;return b&Bt?(r.flags=b&~Bt|re,(r.mode&nr)!==an&&bm(r),r):null}case Fe:return hu(r),null;case P:return du(r),null;case _:return cu(r),null;case it:case nt:return tg(r),null;default:return null}}function zS(r){switch(r.tag){case D:{var s=r.type.childContextTypes;s!=null&&Dr(r);break}case z:{du(r),_l(r),Zv();break}case L:{$v(r);break}case P:du(r);break;case V:hu(r);break;case Fe:hu(r);break;case _:cu(r);break;case it:case nt:tg(r);break}}function Lm(r,s){return{value:r,source:s,stack:Dc(s)}}function bP(r,s){return!0}function Dm(r,s){try{var u=bP(r,s);if(u===!1)return;var h=s.value,v=s.source,b=s.stack,E=b!==null?b:"";if(h!=null&&h._suppressLogging){if(r.tag===D)return;console.error(h)}var O=v?Le(v.type):null,k=O?"The above error occurred in the <"+O+"> component:":"The above error occurred in one of your React components:",B,Y=Le(r.type);Y?B="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+Y+"."):B=`Consider adding an error boundary to your tree to customize error handling behavior.
135
- Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;var ie=k+`
136
- `+E+`
137
-
138
- `+(""+B);console.error(ie)}catch(ue){setTimeout(function(){throw ue})}}var SP=typeof WeakMap=="function"?WeakMap:Map;function jS(r,s,u){var h=ds(bn,u);h.tag=_a,h.payload={element:null};var v=s.value;return h.callback=function(){zL(v),Dm(r,s)},h}function _S(r,s,u){var h=ds(bn,u);h.tag=_a;var v=r.type.getDerivedStateFromError;if(typeof v=="function"){var b=s.value;h.payload=function(){return Dm(r,s),v(b)}}var E=r.stateNode;return E!==null&&typeof E.componentDidCatch=="function"?h.callback=function(){Cx(r),typeof v!="function"&&(kL(this),Dm(r,s));var k=s.value,B=s.stack;this.componentDidCatch(k,{componentStack:B!==null?B:""}),typeof v!="function"&&(Yn(r.lanes,zt)||m("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",Le(r.type)||"Unknown"))}:h.callback=function(){Cx(r)},h}function xP(r,s,u){var h=r.pingCache,v;if(h===null?(h=r.pingCache=new SP,v=new Set,h.set(s,v)):(v=h.get(s),v===void 0&&(v=new Set,h.set(s,v))),!v.has(u)){v.add(u);var b=jL.bind(null,r,s,u);s.then(b,b)}}function wP(r,s,u,h,v){if(u.flags|=qt,u.firstEffect=u.lastEffect=null,h!==null&&typeof h=="object"&&typeof h.then=="function"){var b=h;if((u.mode&Bn)===an){var E=u.alternate;E?(u.updateQueue=E.updateQueue,u.memoizedState=E.memoizedState,u.lanes=E.lanes):(u.updateQueue=null,u.memoizedState=null)}var O=Jd($i.current,qv),k=s;do{if(k.tag===V&&zM(k,O)){var B=k.updateQueue;if(B===null){var Y=new Set;Y.add(b),k.updateQueue=Y}else B.add(b);if((k.mode&Bn)===an){if(k.flags|=re,u.flags|=Mr,u.flags&=~(_t|qt),u.tag===D){var ie=u.alternate;if(ie===null)u.tag=Ee;else{var ue=ds(bn,zt);ue.tag=Mo,hs(u,ue)}}u.lanes=It(u.lanes,zt);return}xP(r,b,v),k.flags|=Bt,k.lanes=v;return}k=k.return}while(k!==null);h=new Error((Le(u.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
139
-
140
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}SL(),h=Lm(h,u);var Te=s;do{switch(Te.tag){case z:{var Pe=h;Te.flags|=Bt;var je=fr(v);Te.lanes=It(Te.lanes,je);var pt=jS(Te,Pe,je);o(Te,pt);return}case D:var Mt=h,bt=Te.type,fn=Te.stateNode;if((Te.flags&re)===oe&&(typeof bt.getDerivedStateFromError=="function"||fn!==null&&typeof fn.componentDidCatch=="function"&&!rg(fn))){Te.flags|=Bt;var Nn=fr(v);Te.lanes=It(Te.lanes,Nn);var se=_S(Te,Mt,Nn);o(Te,se);return}break}Te=Te.return}while(Te!==null)}function IS(r,s,u,h,v,b,E,O,k){var B=Array.prototype.slice.call(arguments,3);try{s.apply(u,B)}catch(Y){this.onError(Y)}}var US=IS;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var km=document.createElement("react");US=function(s,u,h,v,b,E,O,k,B){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 Y=document.createEvent("Event"),ie=!1,ue=!0,Te=window.event,Pe=Object.getOwnPropertyDescriptor(window,"event");function je(){km.removeEventListener(pe,Mt,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=Te)}var pt=Array.prototype.slice.call(arguments,3);function Mt(){ie=!0,je(),u.apply(h,pt),ue=!1}var bt,fn=!1,Nn=!1;function se(G){if(bt=G.error,fn=!0,bt===null&&G.colno===0&&G.lineno===0&&(Nn=!0),G.defaultPrevented&&bt!=null&&typeof bt=="object")try{bt._suppressLogging=!0}catch{}}var pe="react-"+(s||"invokeguardedcallback");if(window.addEventListener("error",se),km.addEventListener(pe,Mt,!1),Y.initEvent(pe,!1,!1),km.dispatchEvent(Y),Pe&&Object.defineProperty(window,"event",Pe),ie&&ue&&(fn?Nn&&(bt=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.")):bt=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(bt)),window.removeEventListener("error",se),!ie)return je(),IS.apply(this,arguments)}}var EP=US,rf=!1,Eh=null,TP={onError:function(r){rf=!0,Eh=r}};function Ys(r,s,u,h,v,b,E,O,k){rf=!1,Eh=null,EP.apply(TP,arguments)}function Qs(){return rf}function Gs(){if(rf){var r=Eh;return rf=!1,Eh=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 FS=null;FS=new Set;var CP=typeof WeakSet=="function"?WeakSet:Set,RP=function(r,s){s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()};function OP(r,s){if(Ys(null,RP,null,r,s),Qs()){var u=Gs();jo(r,u)}}function BS(r){var s=r.ref;if(s!==null)if(typeof s=="function"){if(Ys(null,s,null,null),Qs()){var u=Gs();jo(r,u)}}else s.current=null}function AP(r,s){if(Ys(null,s,null),Qs()){var u=Gs();jo(r,u)}}function MP(r,s){switch(s.tag){case R:case K:case ge:case Oe:return;case D:{if(s.flags&Ae&&r!==null){var u=r.memoizedProps,h=r.memoizedState,v=s.stateNode;s.type===s.elementType&&!Ya&&(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.",Le(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.",Le(s.type)||"instance"));var b=v.getSnapshotBeforeUpdate(s.elementType===s.type?u:fi(s.type,u),h);{var E=FS;b===void 0&&!E.has(s.type)&&(E.add(s.type),m("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",Le(s.type)))}v.__reactInternalSnapshotBeforeUpdate=b}return}case z:{if($n&&s.flags&Ae){var O=s.stateNode;Xo(O.containerInfo)}return}case L:case A:case P: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 HS(r,s){var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var E=b.destroy;b.destroy=void 0,E!==void 0&&E()}b=b.next}while(b!==v)}}function PP(r,s){var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next,b=v;do{if((b.tag&r)===r){var E=b.create;b.destroy=E();{var O=b.destroy;if(O!==void 0&&typeof O!="function"){var k=void 0;O===null?k=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof O.then=="function"?k=`
141
-
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
-
144
- useEffect(() => {
145
- async function fetchData() {
146
- // You can await here
147
- const response = await MyAPI.getData(someId);
148
- // ...
149
- }
150
- fetchData();
151
- }, [someId]); // Or [] if effect doesn't need props or state
152
-
153
- Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:k=" You returned: "+O,m("An effect function must not return anything besides a function, which is used for clean-up.%s",k)}}}b=b.next}while(b!==v)}}function LP(r){var s=r.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var h=u.next,v=h;do{var b=v,E=b.next,O=b.tag;(O&Vc)!==Qv&&(O&Ba)!==Qv&&(cx(r,v),PL(r,v)),v=E}while(v!==h)}}function DP(r,s,u,h){switch(u.tag){case R:case K:case ge:case Oe:{PP(Ha|Ba,u),LP(u);return}case D:{var v=u.stateNode;if(u.flags&le)if(s===null)u.type===u.elementType&&!Ya&&(v.props!==u.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.",Le(u.type)||"instance"),v.state!==u.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.",Le(u.type)||"instance")),v.componentDidMount();else{var b=u.elementType===u.type?s.memoizedProps:fi(u.type,s.memoizedProps),E=s.memoizedState;u.type===u.elementType&&!Ya&&(v.props!==u.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.",Le(u.type)||"instance"),v.state!==u.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.",Le(u.type)||"instance")),v.componentDidUpdate(b,E,v.__reactInternalSnapshotBeforeUpdate)}var O=u.updateQueue;O!==null&&(u.type===u.elementType&&!Ya&&(v.props!==u.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.",Le(u.type)||"instance"),v.state!==u.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.",Le(u.type)||"instance")),j(u,O,v));return}case z:{var k=u.updateQueue;if(k!==null){var B=null;if(u.child!==null)switch(u.child.tag){case L:B=dt(u.child.stateNode);break;case D:B=u.child.stateNode;break}j(u,k,B)}return}case L:{var Y=u.stateNode;if(s===null&&u.flags&le){var ie=u.type,ue=u.memoizedProps;sc(Y,ie,ue,u)}return}case A:return;case P:return;case ee:{{var Te=u.memoizedProps;Te.onCommit;var Pe=Te.onRender;u.stateNode.effectDuration;var je=GM();typeof Pe=="function"&&Pe(u.memoizedProps.id,s===null?"mount":"update",u.actualDuration,u.treeBaseDuration,u.actualStartTime,je,r.memoizedInteractions)}return}case V:{FP(r,u);return}case Fe:case Ee:case Be:case vt:case it:case nt: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 VS(r,s){if($n)for(var u=r;;){if(u.tag===L){var h=u.stateNode;s?oc(h):wv(u.stateNode,u.memoizedProps)}else if(u.tag===A){var v=u.stateNode;s?ac(v):Od(v,u.memoizedProps)}else if(!((u.tag===it||u.tag===nt)&&u.memoizedState!==null&&u!==r)){if(u.child!==null){u.child.return=u,u=u.child;continue}}if(u===r)return;for(;u.sibling===null;){if(u.return===null||u.return===r)return;u=u.return}u.sibling.return=u.return,u=u.sibling}}function kP(r){var s=r.ref;if(s!==null){var u=r.stateNode,h;switch(r.tag){case L:h=dt(u);break;default:h=u}typeof s=="function"?s(h):(s.hasOwnProperty("current")||m("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",Le(r.type)),s.current=h)}}function NP(r){var s=r.ref;s!==null&&(typeof s=="function"?s(null):s.current=null)}function WS(r,s,u){switch(wr(s),s.tag){case R:case K:case ae:case ge:case Oe:{var h=s.updateQueue;if(h!==null){var v=h.lastEffect;if(v!==null){var b=v.next,E=b;do{var O=E,k=O.destroy,B=O.tag;k!==void 0&&((B&Vc)!==Qv?cx(s,E):AP(s,k)),E=E.next}while(E!==b)}}return}case D:{BS(s);var Y=s.stateNode;typeof Y.componentWillUnmount=="function"&&OP(s,Y);return}case L:{BS(s);return}case P:{$n?GS(r,s):yi&&zP(s);return}case Be:return;case Ue:return;case vt:return}}function $S(r,s,u){for(var h=s;;){if(WS(r,h),h.child!==null&&(!$n||h.tag!==P)){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 qS(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 zP(r){if(yi){var s=r.stateNode,u=s.containerInfo,h=Ko(u);uc(u,h)}}function jP(r){if(yi){switch(r.tag){case D:case L:case A:case Be:return;case z:case P:{var s=r.stateNode,u=s.containerInfo,h=s.pendingChildren;uc(u,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 _P(r){for(var s=r.return;s!==null;){if(YS(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 YS(r){return r.tag===L||r.tag===z||r.tag===P}function IP(r){var s=r;e:for(;;){for(;s.sibling===null;){if(s.return===null||YS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==L&&s.tag!==A&&s.tag!==Ue;){if(s.flags&de||s.child===null||s.tag===P)continue e;s.child.return=s,s=s.child}if(!(s.flags&de))return s.stateNode}}function QS(r){if($n){var s=_P(r),u,h,v=s.stateNode;switch(s.tag){case L:u=v,h=!1;break;case z:u=v.containerInfo,h=!0;break;case P:u=v.containerInfo,h=!0;break;case Be:default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}s.flags&Ve&&(Rd(u),s.flags&=~Ve);var b=IP(r);h?Nm(r,b,u):zm(r,b,u)}}function Nm(r,s,u){var h=r.tag,v=h===L||h===A;if(v||Hr){var b=v?r.stateNode:r.stateNode.instance;s?bv(u,b,s):wl(u,b)}else if(h!==P){var E=r.child;if(E!==null){Nm(E,s,u);for(var O=E.sibling;O!==null;)Nm(O,s,u),O=O.sibling}}}function zm(r,s,u){var h=r.tag,v=h===L||h===A;if(v||Hr){var b=v?r.stateNode:r.stateNode.instance;s?ts(u,b,s):Cd(u,b)}else if(h!==P){var E=r.child;if(E!==null){zm(E,s,u);for(var O=E.sibling;O!==null;)zm(O,s,u),O=O.sibling}}}function GS(r,s,u){for(var h=s,v=!1,b,E;;){if(!v){var O=h.return;e:for(;;){if(O===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");var k=O.stateNode;switch(O.tag){case L:b=k,E=!1;break e;case z:b=k.containerInfo,E=!0;break e;case P:b=k.containerInfo,E=!0;break e}O=O.return}v=!0}if(h.tag===L||h.tag===A)$S(r,h),E?xv(b,h.stateNode):Sv(b,h.stateNode);else if(h.tag===P){if(h.child!==null){b=h.stateNode.containerInfo,E=!0,h.child.return=h,h=h.child;continue}}else if(WS(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===P&&(v=!1)}h.sibling.return=h.return,h=h.sibling}}function UP(r,s,u){$n?GS(r,s):$S(r,s);var h=s.alternate;qS(s),h!==null&&qS(h)}function jm(r,s){if(!$n){switch(s.tag){case R:case K:case ae:case ge:case Oe:{HS(Ha|Ba,s);return}case ee:return;case V:{XS(s),Th(s);return}case Fe:{Th(s);return}case z:{if(dn){var u=s.stateNode;u.hydrate&&(u.hydrate=!1,fo(u.containerInfo))}break}case it:case nt:return}jP(s);return}switch(s.tag){case R:case K:case ae:case ge:case Oe:{HS(Ha|Ba,s);return}case D:return;case L:{var h=s.stateNode;if(h!=null){var v=s.memoizedProps,b=r!==null?r.memoizedProps:v,E=s.type,O=s.updateQueue;s.updateQueue=null,O!==null&&El(h,O,E,b,v,s)}return}case A:{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 k=s.stateNode,B=s.memoizedProps,Y=r!==null?r.memoizedProps:B;uo(k,Y,B);return}case z:{if(dn){var ie=s.stateNode;ie.hydrate&&(ie.hydrate=!1,fo(ie.containerInfo))}return}case ee:return;case V:{XS(s),Th(s);return}case Fe:{Th(s);return}case Ee:return;case Be:break;case vt:break;case it:case nt:{var ue=s.memoizedState,Te=ue!==null;VS(s,Te);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 XS(r){var s=r.memoizedState;if(s!==null&&(gL(),$n)){var u=r.child;VS(u,!0)}}function FP(r,s){if(dn){var u=s.memoizedState;if(u===null){var h=s.alternate;if(h!==null){var v=h.memoizedState;if(v!==null){var b=v.dehydrated;b!==null&&$r(b)}}}}}function Th(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new CP),s.forEach(function(h){var v=IL.bind(null,r,h);u.has(h)||(h.__reactDoNotTraceInteractions!==!0&&(v=p.unstable_wrap(v)),u.add(h),h.then(v,v))})}}function BP(r,s){if(r!==null){var u=r.memoizedState;if(u===null||u.dehydrated!==null){var h=s.memoizedState;return h!==null&&h.dehydrated===null}}return!1}function HP(r){$n&&Rd(r.stateNode)}var Ch=0,Rh=1,Oh=2,Ah=3,Mh=4;if(typeof Symbol=="function"&&Symbol.for){var sf=Symbol.for;Ch=sf("selector.component"),Rh=sf("selector.has_pseudo_class"),Oh=sf("selector.role"),Ah=sf("selector.test_id"),Mh=sf("selector.text")}function VP(r){return{$$typeof:Ch,value:r}}function WP(r){return{$$typeof:Rh,value:r}}function $P(r){return{$$typeof:Oh,value:r}}function qP(r){return{$$typeof:Mh,value:r}}function YP(r){return{$$typeof:Ah,value:r}}function _m(r){var s=Sl(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 u=mv(r);if(u===null)throw Error("Could not find React container within specified host subtree.");return u.stateNode.current}}function Im(r,s){switch(s.$$typeof){case Ch:if(r.type===s.value)return!0;break;case Rh:return QP(r,s.value);case Oh:if(r.tag===L){var u=r.stateNode;if(gv(u,s.value))return!0}break;case Mh:if(r.tag===L||r.tag===A){var h=sn(r);if(h!==null&&h.indexOf(s.value)>=0)return!0}break;case Ah:if(r.tag===L){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 Um(r){switch(r.$$typeof){case Ch:var s=Le(r.value)||"Unknown";return"<"+s+">";case Rh:return":has("+(Um(r)||"")+")";case Oh:return'[role="'+r.value+'"]';case Mh:return'"'+r.value+'"';case Ah:return'[data-testname="'+r.value+'"]';default:throw Error("Invalid selector type "+r+" specified.")}}function KS(r,s){for(var u=[],h=[r,0],v=0;v<h.length;){var b=h[v++],E=h[v++],O=s[E];if(!(b.tag===L&&ii(b))){for(;O!=null&&Im(b,O);)E++,O=s[E];if(E===s.length)u.push(b);else for(var k=b.child;k!==null;)h.push(k,E),k=k.sibling}}return u}function QP(r,s){for(var u=[r,0],h=0;h<u.length;){var v=u[h++],b=u[h++],E=s[b];if(!(v.tag===L&&ii(v))){for(;E!=null&&Im(v,E);)b++,E=s[b];if(b===s.length)return!0;for(var O=v.child;O!==null;)u.push(O,b),O=O.sibling}}return!1}function Ph(r,s){if(!Wr)throw Error("Test selector API is not supported by this renderer.");for(var u=_m(r),h=KS(u,s),v=[],b=Array.from(h),E=0;E<b.length;){var O=b[E++];if(O.tag===L){if(ii(O))continue;v.push(O.stateNode)}else for(var k=O.child;k!==null;)b.push(k),k=k.sibling}return v}function GP(r,s){if(!Wr)throw Error("Test selector API is not supported by this renderer.");for(var u=_m(r),h=0,v=[],b=[u,0],E=0;E<b.length;){var O=b[E++],k=b[E++],B=s[k];if(!(O.tag===L&&ii(O))&&(Im(O,B)&&(v.push(Um(B)),k++,k>h&&(h=k)),k<s.length))for(var Y=O.child;Y!==null;)b.push(Y,k),Y=Y.sibling}if(h<s.length){for(var ie=[],ue=h;ue<s.length;ue++)ie.push(Um(s[ue]));return`findAllNodes was able to match part of the selector:
154
- `+(" "+v.join(" > ")+`
155
-
156
- `)+`No matching component was found for:
157
- `+(" "+ie.join(" > "))}return null}function XP(r,s){if(!Wr)throw Error("Test selector API is not supported by this renderer.");for(var u=Ph(r,s),h=[],v=0;v<u.length;v++)h.push(xl(u[v]));for(var b=h.length-1;b>0;b--)for(var E=h[b],O=E.x,k=O+E.width,B=E.y,Y=B+E.height,ie=b-1;ie>=0;ie--)if(b!==ie){var ue=h[ie],Te=ue.x,Pe=Te+ue.width,je=ue.y,pt=je+ue.height;if(O>=Te&&B>=je&&k<=Pe&&Y<=pt){h.splice(b,1);break}else if(O===Te&&E.width===ue.width&&!(pt<B)&&!(je>Y)){je>B&&(ue.height+=je-B,ue.y=B),pt<Y&&(ue.height=Y-je),h.splice(b,1);break}else if(B===je&&E.height===ue.height&&!(Pe<O)&&!(Te>k)){Te>O&&(ue.width+=Te-O,ue.x=O),Pe<k&&(ue.width=k-Te),h.splice(b,1);break}}return h}function KP(r,s){if(!Wr)throw Error("Test selector API is not supported by this renderer.");for(var u=_m(r),h=KS(u,s),v=Array.from(h),b=0;b<v.length;){var E=v[b++];if(!ii(E)){if(E.tag===L){var O=E.stateNode;if(yv(O))return!0}for(var k=E.child;k!==null;)v.push(k),k=k.sibling}}return!1}var Lh=[];function ZP(){Wr&&Lh.forEach(function(r){return r()})}function JP(r,s,u,h){if(!Wr)throw Error("Test selector API is not supported by this renderer.");var v=Ph(r,s),b=Go(v,u,h),E=b.disconnect,O=b.observe,k=b.unobserve,B=function(){var Y=Ph(r,s);v.forEach(function(ie){Y.indexOf(ie)<0&&k(ie)}),Y.forEach(function(ie){v.indexOf(ie)<0&&O(ie)})};return Lh.push(B),{disconnect:function(){var Y=Lh.indexOf(B);Y>=0&&Lh.splice(Y,1),E()}}}var ZS=!1,Dh=null;function eL(r){if(Dh===null)try{var s=("require"+Math.random()).slice(0,7),u=t&&t[s];Dh=u.call(t,"timers").setImmediate}catch{Dh=function(v){ZS===!1&&(ZS=!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 Dh(r)}var tL=Math.ceil,Fm=g.ReactCurrentDispatcher,Bm=g.ReactCurrentOwner,gu=g.IsSomeRendererActing,En=0,of=1,nL=2,Hm=4,Vm=8,ti=16,Yi=32,JS=64,Xs=0,kh=1,Nh=2,zh=3,jh=4,Wm=5,ut=En,Ir=null,kn=null,Ur=ye,gs=ye,$m=Qr(ye),pr=Xs,_h=null,Qa=ye,Ih=ye,Ga=ye,Uh=ye,qm=null,Ym=0,ex=500,tx=1/0,rL=500;function No(){tx=hn()+rL}function nx(){return tx}var Xe=null,Fh=!1,Qm=null,yu=null,Ks=!1,bu=null,af=cs,Gm=ye,Xm=[],Km=[],Zs=null,iL=50,lf=0,Zm=null,sL=50,Bh=0,Xa=null,uf=bn,Js=ye,Hh=ye,Jm=!1,cf=null,ff=!1;function oL(){return Ir}function ni(){return(ut&(ti|Yi))!==En?hn():(uf!==bn||(uf=hn()),uf)}function zo(r){var s=r.mode;if((s&Bn)===an)return zt;if((s&Bi)===an)return Ye()===Gt?zt:ca;Js===ye&&(Js=Qa);var u=Oa()!==Ra;if(u)return Hh!==ye&&(Hh=qm!==null?qm.pendingLanes:ye),Mv(Js,Hh);var h=Ye(),v;if((ut&Hm)!==En&&h===Nr)v=bo(as,Js);else{var b=zd(h);v=bo(b,Js)}return v}function aL(r){var s=r.mode;return(s&Bn)===an?zt:(s&Bi)===an?Ye()===Gt?zt:ca:(Js===ye&&(Js=Qa),Id(Js))}function vr(r,s,u){FL(),WL(r);var h=Vh(r,s);if(h===null)return HL(r),null;So(h,s,u),h===Ir&&(Ga=It(Ga,s),pr===jh&&Su(h,Ur));var v=Ye();s===zt?(ut&Vm)!==En&&(ut&(ti|Yi))===En?(_o(h,s),eg(h)):(hi(h,u),_o(h,s),ut===En&&(No(),tr())):((ut&Hm)!==En&&(v===Nr||v===Gt)&&(Zs===null?Zs=new Set([h]):Zs.add(h)),hi(h,u),_o(h,s)),qm=h}function Vh(r,s){r.lanes=It(r.lanes,s);var u=r.alternate;u!==null&&(u.lanes=It(u.lanes,s)),u===null&&(r.flags&(de|Ct))!==oe&&dx(r);for(var h=r,v=r.return;v!==null;)v.childLanes=It(v.childLanes,s),u=v.alternate,u!==null?u.childLanes=It(u.childLanes,s):(v.flags&(de|Ct))!==oe&&dx(r),h=v,v=v.return;if(h.tag===z){var b=h.stateNode;return b}else return null}function hi(r,s){var u=r.callbackNode;Gl(r,s);var h=Er(r,r===Ir?Ur:ye),v=pa();if(h===ye){u!==null&&(Eo(u),r.callbackNode=null,r.callbackPriority=Ii);return}if(u!==null){var b=r.callbackPriority;if(b===v)return;Eo(u)}var E;if(v===zs)E=fs(eg.bind(null,r));else if(v===sa)E=Qn(Gt,eg.bind(null,r));else{var O=Fi(v);E=Qn(O,rx.bind(null,r))}r.callbackPriority=v,r.callbackNode=E}function rx(r){if(uf=bn,Js=ye,Hh=ye,(ut&(ti|Yi))!==En)throw Error("Should not already be working.");var s=r.callbackNode,u=Qi();if(u&&r.callbackNode!==s)return null;var h=Er(r,r===Ir?Ur:ye);if(h===ye)return null;var v=EL(r,h);if(Yn(Qa,Ga))xu(r,ye);else if(v!==Xs){if(v===Nh&&(ut|=JS,r.hydrate&&(r.hydrate=!1,Xo(r.containerInfo)),h=Cc(r),h!==ye&&(v=df(r,h))),v===kh){var b=_h;throw xu(r,ye),Su(r,h),hi(r,hn()),b}var E=r.current.alternate;r.finishedWork=E,r.finishedLanes=h,lL(r,v,h)}return hi(r,hn()),r.callbackNode===s?rx.bind(null,r):null}function lL(r,s,u){switch(s){case Xs:case kh:throw Error("Root did not complete. This is a bug in React.");case Nh:{Ka(r);break}case zh:{if(Su(r,u),_d(u)&&!Sx()){var h=Ym+ex-hn();if(h>10){var v=Er(r,ye);if(v!==ye)break;var b=r.suspendedLanes;if(!us(b,u)){ni(),Kl(r,b);break}r.timeoutHandle=Ot(Ka.bind(null,r),h);break}}Ka(r);break}case jh:{if(Su(r,u),Rc(u))break;if(!Sx()){var E=da(r,u),O=E,k=hn()-O,B=UL(k)-k;if(B>10){r.timeoutHandle=Ot(Ka.bind(null,r),B);break}}Ka(r);break}case Wm:{Ka(r);break}default:throw Error("Unknown root exit status.")}}function Su(r,s){s=va(s,Uh),s=va(s,Ga),Hd(r,s)}function eg(r){if((ut&(ti|Yi))!==En)throw Error("Should not already be working.");Qi();var s,u;if(r===Ir&&Yn(r.expiredLanes,Ur)?(s=Ur,u=df(r,s),Yn(Qa,Ga)&&(s=Er(r,s),u=df(r,s))):(s=Er(r,ye),u=df(r,s)),r.tag!==Ns&&u===Nh&&(ut|=JS,r.hydrate&&(r.hydrate=!1,Xo(r.containerInfo)),s=Cc(r),s!==ye&&(u=df(r,s))),u===kh){var h=_h;throw xu(r,ye),Su(r,s),hi(r,hn()),h}var v=r.current.alternate;return r.finishedWork=v,r.finishedLanes=s,Ka(r),hi(r,hn()),null}function uL(r,s){Vd(r,s),hi(r,hn()),(ut&(ti|Yi))===En&&(No(),tr())}function cL(){if((ut&(of|ti|Yi))!==En){(ut&ti)!==En&&m("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");return}dL(),Qi()}function fL(r){return ui(Kr,r)}function dL(){if(Zs!==null){var r=Zs;Zs=null,r.forEach(function(s){Zl(s),hi(s,hn())})}tr()}function ix(r,s){var u=ut;ut|=of;try{return r(s)}finally{ut=u,ut===En&&(No(),tr())}}function hL(r,s){var u=ut;ut|=nL;try{return r(s)}finally{ut=u,ut===En&&(No(),tr())}}function pL(r,s,u,h,v){var b=ut;ut|=Hm;try{return ui(Nr,r.bind(null,s,u,h,v))}finally{ut=b,ut===En&&(No(),tr())}}function vL(r,s){var u=ut;ut&=~of,ut|=Vm;try{return r(s)}finally{ut=u,ut===En&&(No(),tr())}}function Wh(r,s){var u=ut;if((u&(ti|Yi))!==En)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);ut|=of;try{return r?ui(Gt,r.bind(null,s)):void 0}finally{ut=u,tr()}}function mL(r){var s=ut;ut|=of;try{ui(Gt,r)}finally{ut=s,ut===En&&(No(),tr())}}function $h(r,s){Mn($m,gs,r),gs=It(gs,s),Qa=It(Qa,s)}function tg(r){gs=$m.current,Jt($m,r)}function xu(r,s){r.finishedWork=null,r.finishedLanes=ye;var u=r.timeoutHandle;if(u!==gi&&(r.timeoutHandle=gi,Sn(u)),kn!==null)for(var h=kn.return;h!==null;)zS(h),h=h.return;Ir=r,kn=el(r.current,null),Ur=gs=Qa=s,pr=Xs,_h=null,Ih=ye,Ga=ye,Uh=ye,Xa=null,Zr.discardPendingWarnings()}function sx(r,s){do{var u=kn;try{if(Na(),G1(),Gn(),Bm.current=null,u===null||u.return===null){pr=kh,_h=s,kn=null;return}Pr&&u.mode&nr&&gh(u,!0),wP(r,u.return,u,s,Ur),ux(u)}catch(h){s=h,kn===u&&u!==null?(u=u.return,kn=u):u=kn;continue}return}while(!0)}function ox(){var r=Fm.current;return Fm.current=ph,r===null?ph:r}function ax(r){Fm.current=r}function qh(r){{var s=p.__interactionsRef.current;return p.__interactionsRef.current=r.memoizedInteractions,s}}function Yh(r){p.__interactionsRef.current=r}function gL(){Ym=hn()}function ng(r){Ih=It(r,Ih)}function yL(){pr===Xs&&(pr=zh)}function bL(){(pr===Xs||pr===zh)&&(pr=jh),Ir!==null&&(jd(Ih)||jd(Ga))&&Su(Ir,Ur)}function SL(){pr!==Wm&&(pr=Nh)}function xL(){return pr===Xs}function df(r,s){var u=ut;ut|=ti;var h=ox();(Ir!==r||Ur!==s)&&(xu(r,s),yx(r,s));var v=qh(r);do try{wL();break}catch(b){sx(r,b)}while(!0);if(Na(),Yh(v),ut=u,ax(h),kn!==null)throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return Ir=null,Ur=ye,pr}function wL(){for(;kn!==null;)lx(kn)}function EL(r,s){var u=ut;ut|=ti;var h=ox();(Ir!==r||Ur!==s)&&(No(),xu(r,s),yx(r,s));var v=qh(r);do try{TL();break}catch(b){sx(r,b)}while(!0);return Na(),Yh(v),ax(h),ut=u,kn!==null?Xs:(Ir=null,Ur=ye,pr)}function TL(){for(;kn!==null&&!Ea();)lx(kn)}function lx(r){var s=r.alternate;Ln(r);var u;(r.mode&nr)!==an?(ym(r),u=ig(s,r,gs),gh(r,!0)):u=ig(s,r,gs),Gn(),r.memoizedProps=r.pendingProps,u===null?ux(r):kn=u,Bm.current=null}function ux(r){var s=r;do{var u=s.alternate,h=s.return;if((s.flags&qt)===oe){Ln(s);var v=void 0;if((s.mode&nr)===an?v=NS(u,s,gs):(ym(s),v=NS(u,s,gs),gh(s,!1)),Gn(),v!==null){kn=v;return}if(CL(s),h!==null&&(h.flags&qt)===oe){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>X&&(h.lastEffect!==null?h.lastEffect.nextEffect=s:h.firstEffect=s,h.lastEffect=s)}}else{var E=yP(s);if(E!==null){E.flags&=gn,kn=E;return}if((s.mode&nr)!==an){gh(s,!1);for(var O=s.actualDuration,k=s.child;k!==null;)O+=k.actualDuration,k=k.sibling;s.actualDuration=O}h!==null&&(h.firstEffect=h.lastEffect=null,h.flags|=qt)}var B=s.sibling;if(B!==null){kn=B;return}s=h,kn=s}while(s!==null);pr===Xs&&(pr=Wm)}function CL(r){if(!((r.tag===nt||r.tag===it)&&r.memoizedState!==null&&!Yn(gs,kr)&&(r.mode&Bi)!==ye)){var s=ye;if((r.mode&nr)!==an){for(var u=r.actualDuration,h=r.selfBaseDuration,v=r.alternate===null||r.child!==r.alternate.child,b=r.child;b!==null;)s=It(s,It(b.lanes,b.childLanes)),v&&(u+=b.actualDuration),h+=b.treeBaseDuration,b=b.sibling;var E=r.tag===V&&r.memoizedState!==null;if(E){var O=r.child;O!==null&&(h-=O.treeBaseDuration)}r.actualDuration=u,r.treeBaseDuration=h}else for(var k=r.child;k!==null;)s=It(s,It(k.lanes,k.childLanes)),k=k.sibling;r.childLanes=s}}function Ka(r){var s=Ye();return ui(Gt,RL.bind(null,r,s)),null}function RL(r,s){do Qi();while(bu!==null);if(BL(),(ut&(ti|Yi))!==En)throw Error("Should not already be working.");var u=r.finishedWork,h=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=ye,u===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=It(u.lanes,u.childLanes);Jl(r,v),Zs!==null&&!kv(v)&&Zs.has(r)&&Zs.delete(r),r===Ir&&(Ir=null,kn=null,Ur=ye);var b;if(u.flags>X?u.lastEffect!==null?(u.lastEffect.nextEffect=u,b=u.firstEffect):b=u:b=u.firstEffect,b!==null){var E=ut;ut|=Yi;var O=qh(r);Bm.current=null,cf=Rt(r.containerInfo),ff=!1,Xe=b;do if(Ys(null,OL,null),Qs()){if(Xe===null)throw Error("Should be working on an effect.");var k=Gs();jo(Xe,k),Xe=Xe.nextEffect}while(Xe!==null);cf=null,fS(),Xe=b;do if(Ys(null,AL,null,r,s),Qs()){if(Xe===null)throw Error("Should be working on an effect.");var B=Gs();jo(Xe,B),Xe=Xe.nextEffect}while(Xe!==null);ff&&Td(),Et(r.containerInfo),r.current=u,Xe=b;do if(Ys(null,ML,null,r,h),Qs()){if(Xe===null)throw Error("Should be working on an effect.");var Y=Gs();jo(Xe,Y),Xe=Xe.nextEffect}while(Xe!==null);Xe=null,xo(),Yh(O),ut=E}else r.current=u,fS();var ie=Ks;if(Ks)Ks=!1,bu=r,Gm=h,af=s;else for(Xe=b;Xe!==null;){var ue=Xe.nextEffect;Xe.nextEffect=null,Xe.flags&be&&Ex(Xe),Xe=ue}if(v=r.pendingLanes,v!==ye){if(Xa!==null){var Te=Xa;Xa=null;for(var Pe=0;Pe<Te.length;Pe++)gx(r,Te[Pe],r.memoizedInteractions)}_o(r,v)}else yu=null;if(ie||bx(r,h),v===zt?r===Zm?lf++:(lf=0,Zm=r):lf=0,ra(u.stateNode,s),ZP(),hi(r,hn()),Fh){Fh=!1;var je=Qm;throw Qm=null,je}return(ut&Vm)!==En||tr(),null}function OL(){for(;Xe!==null;){var r=Xe.alternate;!ff&&cf!==null&&((Xe.flags&be)!==oe?_e(Xe,cf)&&(ff=!0,Qo()):Xe.tag===V&&BP(r,Xe)&&_e(Xe,cf)&&(ff=!0,Qo()));var s=Xe.flags;(s&Ae)!==oe&&(Ln(Xe),MP(r,Xe),Gn()),(s&Ne)!==oe&&(Ks||(Ks=!0,Qn(Kr,function(){return Qi(),null}))),Xe=Xe.nextEffect}}function AL(r,s){for(;Xe!==null;){Ln(Xe);var u=Xe.flags;if(u&Ve&&HP(Xe),u&De){var h=Xe.alternate;h!==null&&NP(h)}var v=u&(de|le|be|Ct);switch(v){case de:{QS(Xe),Xe.flags&=~de;break}case he:{QS(Xe),Xe.flags&=~de;var b=Xe.alternate;jm(b,Xe);break}case Ct:{Xe.flags&=~Ct;break}case Nt:{Xe.flags&=~Ct;var E=Xe.alternate;jm(E,Xe);break}case le:{var O=Xe.alternate;jm(O,Xe);break}case be:{UP(r,Xe);break}}Gn(),Xe=Xe.nextEffect}}function ML(r,s){for(;Xe!==null;){Ln(Xe);var u=Xe.flags;if(u&(le|J)){var h=Xe.alternate;DP(r,h,Xe)}u&De&&kP(Xe),Gn(),Xe=Xe.nextEffect}}function Qi(){if(af!==cs){var r=af>Kr?Kr:af;return af=cs,ui(r,DL)}return!1}function PL(r,s){Xm.push(s,r),Ks||(Ks=!0,Qn(Kr,function(){return Qi(),null}))}function cx(r,s){Km.push(s,r);{r.flags|=Je;var u=r.alternate;u!==null&&(u.flags|=Je)}Ks||(Ks=!0,Qn(Kr,function(){return Qi(),null}))}function LL(r){var s=r.create;r.destroy=s()}function DL(){if(bu===null)return!1;var r=bu,s=Gm;if(bu=null,Gm=ye,(ut&(ti|Yi))!==En)throw Error("Cannot flush passive effects while already rendering.");Jm=!0;var u=ut;ut|=Yi;var h=qh(r),v=Km;Km=[];for(var b=0;b<v.length;b+=2){var E=v[b],O=v[b+1],k=E.destroy;E.destroy=void 0;{O.flags&=~Je;var B=O.alternate;B!==null&&(B.flags&=~Je)}if(typeof k=="function"){if(Ln(O),Ys(null,k,null),Qs()){if(O===null)throw Error("Should be working on an effect.");var Y=Gs();jo(O,Y)}Gn()}}var ie=Xm;Xm=[];for(var ue=0;ue<ie.length;ue+=2){var Te=ie[ue],Pe=ie[ue+1];{if(Ln(Pe),Ys(null,LL,null,Te),Qs()){if(Pe===null)throw Error("Should be working on an effect.");var je=Gs();jo(Pe,je)}Gn()}}for(var pt=r.current.firstEffect;pt!==null;){var Mt=pt.nextEffect;pt.nextEffect=null,pt.flags&be&&Ex(pt),pt=Mt}return Yh(h),bx(r,s),Jm=!1,ut=u,tr(),Bh=bu===null?0:Bh+1,!0}function rg(r){return yu!==null&&yu.has(r)}function kL(r){yu===null?yu=new Set([r]):yu.add(r)}function NL(r){Fh||(Fh=!0,Qm=r)}var zL=NL;function fx(r,s,u){var h=Lm(u,s),v=jS(r,h,zt);hs(r,v);var b=ni(),E=Vh(r,zt);E!==null&&(So(E,zt,b),hi(E,b),_o(E,zt))}function jo(r,s){if(r.tag===z){fx(r,r,s);return}for(var u=r.return;u!==null;){if(u.tag===z){fx(u,r,s);return}else if(u.tag===D){var h=u.type,v=u.stateNode;if(typeof h.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&!rg(v)){var b=Lm(s,r),E=_S(u,b,zt);hs(u,E);var O=ni(),k=Vh(u,zt);if(k!==null)So(k,zt,O),hi(k,O),_o(k,zt);else if(typeof v.componentDidCatch=="function"&&!rg(v))try{v.componentDidCatch(s,b)}catch{}return}}u=u.return}}function jL(r,s,u){var h=r.pingCache;h!==null&&h.delete(s);var v=ni();Kl(r,u),Ir===r&&us(Ur,u)&&(pr===jh||pr===zh&&_d(Ur)&&hn()-Ym<ex?xu(r,ye):Uh=It(Uh,u)),hi(r,v),_o(r,u)}function _L(r,s){s===Jn&&(s=aL(r));var u=ni(),h=Vh(r,s);h!==null&&(So(h,s,u),hi(h,u),_o(h,s))}function IL(r,s){var u=Jn,h;h=r.stateNode,h!==null&&h.delete(s),_L(r,u)}function UL(r){return r<120?120:r<480?480:r<1080?1080:r<1920?1920:r<3e3?3e3:r<4320?4320:tL(r/1960)*1960}function FL(){if(lf>iL)throw lf=0,Zm=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.");Bh>sL&&(Bh=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 BL(){Zr.flushLegacyContextWarning(),Zr.flushPendingUnsafeLifecycleWarnings()}var Qh=null;function dx(r){{if((ut&ti)!==En||!(r.mode&(Bn|Bi)))return;var s=r.tag;if(s!==M&&s!==z&&s!==D&&s!==R&&s!==K&&s!==ae&&s!==ge&&s!==Oe)return;var u=Le(r.type)||"ReactComponent";if(Qh!==null){if(Qh.has(u))return;Qh.add(u)}else Qh=new Set([u]);var h=rr;try{Ln(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?Ln(r):Gn()}}}var Gh=null;function HL(r){{var s=r.tag;if(s!==z&&s!==D&&s!==R&&s!==K&&s!==ae&&s!==ge&&s!==Oe||(r.flags&Je)!==oe)return;var u=Le(r.type)||"ReactComponent";if(Gh!==null){if(Gh.has(u))return;Gh.add(u)}else Gh=new Set([u]);if(!Jm){var h=rr;try{Ln(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===D?"the componentWillUnmount method":"a useEffect cleanup function")}finally{h?Ln(r):Gn()}}}}var ig;{var VL=null;ig=function(r,s,u){var h=Ox(VL,s);try{return LS(r,s,u)}catch(b){if(b!==null&&typeof b=="object"&&typeof b.then=="function")throw b;if(Na(),G1(),zS(s),Ox(s,h),s.mode&nr&&ym(s),Ys(null,LS,null,r,s,u),Qs()){var v=Gs();throw v}else throw b}}}var hx=!1,sg;sg=new Set;function WL(r){if(To&&(ut&ti)!==En&&!QM())switch(r.tag){case R:case K:case ge:{var s=kn&&Le(kn.type)||"Unknown",u=s;if(!sg.has(u)){sg.add(u);var h=Le(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 D:{hx||(m("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),hx=!0);break}}}var Za={current:!1};function px(r){if(Xn===!0&&gu.current===!0&&Za.current!==!0){var s=rr;try{Ln(r),m(`It looks like you're using the wrong act() around your test interactions.
158
- Be sure to use the matching version of act() corresponding to your renderer:
159
-
160
- // for react-dom:
161
- import {act} from 'react-dom/test-utils';
162
- // ...
163
- act(() => ...);
164
-
165
- // for react-test-renderer:
166
- import TestRenderer from react-test-renderer';
167
- const {act} = TestRenderer;
168
- // ...
169
- act(() => ...);`)}finally{s?Ln(r):Gn()}}}function vx(r){Xn===!0&&(r.mode&Vt)!==an&&gu.current===!1&&Za.current===!1&&m(`An update to %s ran an effect, but was not wrapped in act(...).
170
-
171
- When testing, code that causes React state updates should be wrapped into act(...):
172
-
173
- act(() => {
174
- /* fire events that update state */
175
- });
176
- /* assert on the output */
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`,Le(r.type))}function $L(r){if(Xn===!0&&ut===En&&gu.current===!1&&Za.current===!1){var s=rr;try{Ln(r),m(`An update to %s inside a test was not wrapped in act(...).
179
-
180
- When testing, code that causes React state updates should be wrapped into act(...):
181
-
182
- act(() => {
183
- /* fire events that update state */
184
- });
185
- /* assert on the output */
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`,Le(r.type))}finally{s?Ln(r):Gn()}}}var qL=$L,mx=!1;function YL(r){mx===!1&&f.unstable_flushAllWithoutAsserting===void 0&&(r.mode&Bn||r.mode&Bi)&&(mx=!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
- jest.mock('scheduler', () => require('scheduler/unstable_mock'));
189
-
190
- For more info, visit https://reactjs.org/link/mock-scheduler`))}function og(r,s){return s*1e3+r.interactionThreadID}function Xh(r){Xa===null?Xa=[r]:Xa.push(r)}function gx(r,s,u){if(u.size>0){var h=r.pendingInteractionMap,v=h.get(s);v!=null?u.forEach(function(O){v.has(O)||O.__count++,v.add(O)}):(h.set(s,new Set(u)),u.forEach(function(O){O.__count++}));var b=p.__subscriberRef.current;if(b!==null){var E=og(r,s);b.onWorkScheduled(u,E)}}}function _o(r,s){gx(r,s,p.__interactionsRef.current)}function yx(r,s){var u=new Set;if(r.pendingInteractionMap.forEach(function(b,E){Yn(s,E)&&b.forEach(function(O){return u.add(O)})}),r.memoizedInteractions=u,u.size>0){var h=p.__subscriberRef.current;if(h!==null){var v=og(r,s);try{h.onWorkStarted(u,v)}catch(b){Qn(Gt,function(){throw b})}}}}function bx(r,s){var u=r.pendingLanes,h;try{if(h=p.__subscriberRef.current,h!==null&&r.memoizedInteractions.size>0){var v=og(r,s);h.onWorkStopped(r.memoizedInteractions,v)}}catch(E){Qn(Gt,function(){throw E})}finally{var b=r.pendingInteractionMap;b.forEach(function(E,O){Yn(u,O)||(b.delete(O),E.forEach(function(k){if(k.__count--,h!==null&&k.__count===0)try{h.onInteractionScheduledWorkCompleted(k)}catch(B){Qn(Gt,function(){throw B})}}))})}}function Sx(){return Ja>0}var ag=f.unstable_flushAllWithoutAsserting,xx=typeof ag=="function";function lg(){if(ag!==void 0)try{return ag()}finally{}else try{for(var r=!1;Qi();)r=!0;return r}finally{}}function wx(r){try{lg(),eL(function(){lg()?wx(r):r()})}catch(s){r(s)}}var Ja=0;function QL(r){var s=Ja;Ja++;var u=gu.current,h=Za.current;gu.current=!0,Za.current=!0;function v(){Ja--,gu.current=u,Za.current=h,Ja>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=ix(r)}catch(O){throw v(),O}if(b!==null&&typeof b=="object"&&typeof b.then=="function"){var E=!1;return typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){E===!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(O,k){E=!0,b.then(function(){if(Ja>1||xx===!0&&u===!0){v(),O();return}wx(function(B){v(),B?k(B):O()})},function(B){v(),k(B)})}}}else{b!==void 0&&m("The callback passed to act(...) function must return undefined, or a Promise. You returned %s",b);try{Ja===1&&(xx===!1||u===!1)&&lg(),v()}catch(O){throw v(),O}return{then:function(O){m("Do not await the result of calling act(...) with sync logic, it is not a Promise."),O()}}}}function Ex(r){r.sibling=null,r.stateNode=null}var Oi=null,wu=null,GL=function(r){Oi=r};function Eu(r){{if(Oi===null)return r;var s=Oi(r);return s===void 0?r:s.current}}function ug(r){return Eu(r)}function cg(r){{if(Oi===null)return r;var s=Oi(r);if(s===void 0){if(r!=null&&typeof r.render=="function"){var u=Eu(r.render);if(r.render!==u){var h={$$typeof:Pt,render:u};return r.displayName!==void 0&&(h.displayName=r.displayName),h}}return r}return s.current}}function Tx(r,s){{if(Oi===null)return!1;var u=r.elementType,h=s.type,v=!1,b=typeof h=="object"&&h!==null?h.$$typeof:null;switch(r.tag){case D:{typeof h=="function"&&(v=!0);break}case R:{(typeof h=="function"||b===qe)&&(v=!0);break}case K:{(b===Pt||b===qe)&&(v=!0);break}case ae:case ge:{(b===ke||b===qe)&&(v=!0);break}default:return!1}if(v){var E=Oi(u);if(E!==void 0&&E===Oi(h))return!0}return!1}}function Cx(r){{if(Oi===null||typeof WeakSet!="function")return;wu===null&&(wu=new WeakSet),wu.add(r)}}var XL=function(r,s){{if(Oi===null)return;var u=s.staleFamilies,h=s.updatedFamilies;Qi(),Wh(function(){fg(r.current,h,u)})}},KL=function(r,s){{if(r.context!==wn)return;Qi(),Wh(function(){Ax(s,r,null,null)})}};function fg(r,s,u){{var h=r.alternate,v=r.child,b=r.sibling,E=r.tag,O=r.type,k=null;switch(E){case R:case ge:case D:k=O;break;case K:k=O.render;break}if(Oi===null)throw new Error("Expected resolveFamily to be set during hot reload.");var B=!1,Y=!1;if(k!==null){var ie=Oi(k);ie!==void 0&&(u.has(ie)?Y=!0:s.has(ie)&&(E===D?Y=!0:B=!0))}wu!==null&&(wu.has(r)||h!==null&&wu.has(h))&&(Y=!0),Y&&(r._debugNeedsRemount=!0),(Y||B)&&vr(r,zt,bn),v!==null&&!Y&&fg(v,s,u),b!==null&&fg(b,s,u)}}var ZL=function(r,s){{var u=new Set,h=new Set(s.map(function(v){return v.current}));return dg(r.current,h,u),u}};function dg(r,s,u){{var h=r.child,v=r.sibling,b=r.tag,E=r.type,O=null;switch(b){case R:case ge:case D:O=E;break;case K:O=E.render;break}var k=!1;O!==null&&s.has(O)&&(k=!0),k?JL(r,u):h!==null&&dg(h,s,u),v!==null&&dg(v,s,u)}}function JL(r,s){{var u=eD(r,s);if(u)return;for(var h=r;;){switch(h.tag){case L:s.add(h.stateNode);return;case P:s.add(h.stateNode.containerInfo);return;case z:s.add(h.stateNode.containerInfo);return}if(h.return===null)throw new Error("Expected to reach root first.");h=h.return}}}function eD(r,s){for(var u=r,h=!1;;){if(u.tag===L)h=!0,s.add(u.stateNode);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===r)return h;for(;u.sibling===null;){if(u.return===null||u.return===r)return h;u=u.return}u.sibling.return=u.return,u=u.sibling}return!1}var hg;{hg=!1;try{var Rx=Object.preventExtensions({})}catch{hg=!0}}var tD=1;function nD(r,s,u,h){this.tag=r,this.key=u,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=oe,this.nextEffect=null,this.firstEffect=null,this.lastEffect=null,this.lanes=ye,this.childLanes=ye,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=tD++,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!hg&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var pi=function(r,s,u,h){return new nD(r,s,u,h)};function pg(r){var s=r.prototype;return!!(s&&s.isReactComponent)}function rD(r){return typeof r=="function"&&!pg(r)&&r.defaultProps===void 0}function iD(r){if(typeof r=="function")return pg(r)?D:R;if(r!=null){var s=r.$$typeof;if(s===Pt)return K;if(s===ke)return ae}return M}function el(r,s){var u=r.alternate;u===null?(u=pi(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u._debugID=r._debugID,u._debugSource=r._debugSource,u._debugOwner=r._debugOwner,u._debugHookTypes=r._debugHookTypes,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=oe,u.nextEffect=null,u.firstEffect=null,u.lastEffect=null,u.actualDuration=0,u.actualStartTime=-1),u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue;var h=r.dependencies;switch(u.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.selfBaseDuration=r.selfBaseDuration,u.treeBaseDuration=r.treeBaseDuration,u._debugNeedsRemount=r._debugNeedsRemount,u.tag){case M:case R:case ge:u.type=Eu(r.type);break;case D:u.type=ug(r.type);break;case K:u.type=cg(r.type);break}return u}function sD(r,s){r.flags&=de,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null;var u=r.alternate;if(u===null)r.childLanes=ye,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=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type;var h=u.dependencies;r.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},r.selfBaseDuration=u.selfBaseDuration,r.treeBaseDuration=u.treeBaseDuration}return r}function oD(r){var s;return r===vo?s=Bi|Bn|Vt:r===Ul?s=Bn|Vt:s=an,Zn&&(s|=nr),pi(z,null,null,s)}function vg(r,s,u,h,v,b){var E=M,O=r;if(typeof r=="function")pg(r)?(E=D,O=ug(O)):O=Eu(O);else if(typeof r=="string")E=L;else e:switch(r){case at:return tl(u.children,v,b,s);case vn:E=$,v|=Hi;break;case $t:E=$,v|=Vt;break;case jt:return aD(u,v,b,s);case St:return lD(u,v,b,s);case ht:return uD(u,v,b,s);case I:return gg(u,v,b,s);case N:return cD(u,v,b,s);case wt:default:{if(typeof r=="object"&&r!==null)switch(r.$$typeof){case yt:E=_;break e;case xt:E=Q;break e;case Pt:E=K,O=cg(O);break e;case ke:E=ae;break e;case qe:E=we,O=null;break e;case st:E=Oe;break e}var k="";{(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(k+=" 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 B=h?Le(h.type):null;B&&(k+=`
191
-
192
- Check the render method of \``+B+"`.")}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)+"."+k)}}var Y=pi(E,u,s,v);return Y.elementType=r,Y.type=O,Y.lanes=b,Y._debugOwner=h,Y}function mg(r,s,u){var h=null;h=r._owner;var v=r.type,b=r.key,E=r.props,O=vg(v,b,E,h,s,u);return O._debugSource=r._source,O._debugOwner=r._owner,O}function tl(r,s,u,h){var v=pi(F,r,h,s);return v.lanes=u,v}function aD(r,s,u,h){typeof r.id!="string"&&m('Profiler must specify an "id" as a prop');var v=pi(ee,r,h,s|nr);return v.elementType=jt,v.type=jt,v.lanes=u,v.stateNode={effectDuration:0,passiveEffectDuration:0},v}function lD(r,s,u,h){var v=pi(V,r,h,s);return v.type=St,v.elementType=St,v.lanes=u,v}function uD(r,s,u,h){var v=pi(Fe,r,h,s);return v.type=ht,v.elementType=ht,v.lanes=u,v}function gg(r,s,u,h){var v=pi(it,r,h,s);return v.type=I,v.elementType=I,v.lanes=u,v}function cD(r,s,u,h){var v=pi(nt,r,h,s);return v.type=N,v.elementType=N,v.lanes=u,v}function yg(r,s,u){var h=pi(A,r,null,s);return h.lanes=u,h}function fD(){var r=pi(L,null,null,an);return r.elementType="DELETED",r.type="DELETED",r}function bg(r,s,u){var h=r.children!==null?r.children:[],v=pi(P,h,r.key,s);return v.lanes=u,v.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},v}function Ox(r,s){return r===null&&(r=pi(M,null,null,an)),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 dD(r,s,u){switch(this.tag=s,this.containerInfo=r,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=gi,this.context=null,this.pendingContext=null,this.hydrate=u,this.callbackNode=null,this.callbackPriority=Ii,this.eventTimes=ma(ye),this.expirationTimes=ma(bn),this.pendingLanes=ye,this.suspendedLanes=ye,this.pingedLanes=ye,this.expiredLanes=ye,this.mutableReadLanes=ye,this.finishedLanes=ye,this.entangledLanes=ye,this.entanglements=ma(ye),dn&&(this.mutableSourceEagerHydrationData=null),this.interactionThreadID=p.unstable_getThreadID(),this.memoizedInteractions=new Set,this.pendingInteractionMap=new Map,s){case Ul:this._debugRootType="createBlockingRoot()";break;case vo:this._debugRootType="createRoot()";break;case Ns:this._debugRootType="createLegacyRoot()";break}}function hD(r,s,u,h){var v=new dD(r,s,u),b=oD(s);return v.current=b,b.stateNode=v,fu(b),v}function pD(r,s){var u=s._getVersion,h=u(s._source);r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[s,h]:r.mutableSourceEagerHydrationData.push(s,h)}function vD(r,s,u){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:tt,key:h==null?null:""+h,children:r,containerInfo:s,implementation:u}}var Sg,xg;Sg=!1,xg={};function mD(r){if(!r)return wn;var s=W(r),u=vc(s);if(s.tag===D){var h=s.type;if(Kn(h))return Il(s,h,u)}return u}function gD(r){var s=W(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 u=U(s);return u===null?null:u.stateNode}function yD(r,s){{var u=W(r);if(u===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=U(u);if(h===null)return null;if(h.mode&Vt){var v=Le(u.type)||"Component";if(!xg[v]){xg[v]=!0;var b=rr;try{Ln(h),u.mode&Vt?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?Ln(b):Gn()}}}return h.stateNode}}function bD(r,s,u,h){return hD(r,s,u)}function Ax(r,s,u,h){Fl(s,r);var v=s.current,b=ni();typeof jest<"u"&&(YL(v),px(v));var E=zo(v),O=mD(u);s.context===null?s.context=O:s.pendingContext=O,To&&rr!==null&&!Sg&&(Sg=!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
-
194
- Check the render method of %s.`,Le(rr.type)||"Unknown"));var k=ds(b,E);return k.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),k.callback=h),hs(v,k),vr(v,E,b),E}function SD(r){var s=r.current;if(!s.child)return null;switch(s.child.tag){case L:return dt(s.child.stateNode);default:return s.child.stateNode}}function xD(r){switch(r.tag){case z:var s=r.stateNode;if(s.hydrate){var u=Xl(s);uL(s,u)}break;case V:var h=ni();Wh(function(){return vr(r,zt,h)});var v=Wl;Kh(r,v);break}}function Mx(r,s){var u=r.memoizedState;u!==null&&u.dehydrated!==null&&(u.retryLane=Bd(u.retryLane,s))}function Kh(r,s){Mx(r,s);var u=r.alternate;u&&Mx(u,s)}function wD(r){if(r.tag===V){var s=ni(),u=Wl;vr(r,u,s),Kh(r,u)}}function ED(r){if(r.tag===V){var s=ni(),u=fa;vr(r,u,s),Kh(r,u)}}function TD(r){if(r.tag===V){var s=ni(),u=zo(r);vr(r,u,s),Kh(r,u)}}function CD(r,s){var u=Ec();try{return Tc(r),s()}finally{Tc(u)}}function RD(r){var s=xe(r);return s===null?null:s.tag===Be?s.stateNode.instance:s.stateNode}var Px=function(r){return!1};function Lx(r){return Px(r)}var Dx=null,kx=null,Nx=null,zx=null,jx=null,_x=null,Ix=null,Ux=null;{var Fx=function(r,s,u){var h=s[u],v=Array.isArray(r)?r.slice():c({},r);return u+1===s.length?(Array.isArray(v)?v.splice(h,1):delete v[h],v):(v[h]=Fx(r[h],s,u+1),v)},Bx=function(r,s){return Fx(r,s,0)},Hx=function(r,s,u,h){var v=s[h],b=Array.isArray(r)?r.slice():c({},r);if(h+1===s.length){var E=u[h];b[E]=b[v],Array.isArray(b)?b.splice(v,1):delete b[v]}else b[v]=Hx(r[v],s,u,h+1);return b},Vx=function(r,s,u){if(s.length!==u.length){x("copyWithRename() expects paths of the same length");return}else for(var h=0;h<u.length-1;h++)if(s[h]!==u[h]){x("copyWithRename() expects paths to be the same except for the deepest key");return}return Hx(r,s,u,0)},Wx=function(r,s,u,h){if(u>=s.length)return h;var v=s[u],b=Array.isArray(r)?r.slice():c({},r);return b[v]=Wx(r[v],s,u+1,h),b},$x=function(r,s,u){return Wx(r,s,0,u)},wg=function(r,s){for(var u=r.memoizedState;u!==null&&s>0;)u=u.next,s--;return u};Dx=function(r,s,u,h){var v=wg(r,s);if(v!==null){var b=$x(v.memoizedState,u,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=c({},r.memoizedProps),vr(r,zt,bn)}},kx=function(r,s,u){var h=wg(r,s);if(h!==null){var v=Bx(h.memoizedState,u);h.memoizedState=v,h.baseState=v,r.memoizedProps=c({},r.memoizedProps),vr(r,zt,bn)}},Nx=function(r,s,u,h){var v=wg(r,s);if(v!==null){var b=Vx(v.memoizedState,u,h);v.memoizedState=b,v.baseState=b,r.memoizedProps=c({},r.memoizedProps),vr(r,zt,bn)}},zx=function(r,s,u){r.pendingProps=$x(r.memoizedProps,s,u),r.alternate&&(r.alternate.pendingProps=r.pendingProps),vr(r,zt,bn)},jx=function(r,s){r.pendingProps=Bx(r.memoizedProps,s),r.alternate&&(r.alternate.pendingProps=r.pendingProps),vr(r,zt,bn)},_x=function(r,s,u){r.pendingProps=Vx(r.memoizedProps,s,u),r.alternate&&(r.alternate.pendingProps=r.pendingProps),vr(r,zt,bn)},Ix=function(r){vr(r,zt,bn)},Ux=function(r){Px=r}}function OD(r){var s=U(r);return s===null?null:s.stateNode}function AD(r){return null}function MD(){return rr}function PD(r){var s=r.findFiberByHostInstance,u=g.ReactCurrentDispatcher;return qn({bundleType:r.bundleType,version:r.version,rendererPackageName:r.rendererPackageName,rendererConfig:r.rendererConfig,overrideHookState:Dx,overrideHookStateDeletePath:kx,overrideHookStateRenamePath:Nx,overrideProps:zx,overridePropsDeletePath:jx,overridePropsRenamePath:_x,setSuspenseHandler:Ux,scheduleUpdate:Ix,currentDispatcherRef:u,findHostInstanceByFiber:OD,findFiberByHostInstance:s||AD,findHostInstancesForRefresh:ZL,scheduleRefresh:XL,scheduleRoot:KL,setRefreshHandler:GL,getCurrentFiber:MD})}return i.IsThisRendererActing=Za,i.act=QL,i.attemptContinuousHydration=ED,i.attemptHydrationAtCurrentPriority=TD,i.attemptSynchronousHydration=xD,i.attemptUserBlockingHydration=wD,i.batchedEventUpdates=hL,i.batchedUpdates=ix,i.createComponentSelector=VP,i.createContainer=bD,i.createHasPsuedoClassSelector=WP,i.createPortal=vD,i.createRoleSelector=$P,i.createTestNameSelector=YP,i.createTextSelector=qP,i.deferredUpdates=fL,i.discreteUpdates=pL,i.findAllNodes=Ph,i.findBoundingRects=XP,i.findHostInstance=gD,i.findHostInstanceWithNoPortals=RD,i.findHostInstanceWithWarning=yD,i.flushControlled=mL,i.flushDiscreteUpdates=cL,i.flushPassiveEffects=Qi,i.flushSync=Wh,i.focusWithin=KP,i.getCurrentUpdateLanePriority=Ec,i.getFindAllNodesFailureDescription=GP,i.getPublicRootInstance=SD,i.injectIntoDevTools=PD,i.observeVisibleRects=JP,i.registerMutableSourceForHydration=pD,i.runWithPriority=CD,i.shouldSuspend=Lx,i.unbatchedUpdates=vL,i.updateContainer=Ax,i})}(pf)),pf.exports}var gf={exports:{}};/** @license React v0.26.2
195
- * react-reconciler.production.min.js
196
- *
197
- * Copyright (c) Facebook, Inc. and its affiliates.
198
- *
199
- * This source code is licensed under the MIT license found in the
200
- * LICENSE file in the root directory of this source tree.
201
- */gf.exports;var jg;function rw(){return jg||(jg=1,function(t){t.exports=function(n){var i={},a=Og(),c=T,f=Lg();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=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,m=60106,w=60107,R=60108,D=60114,M=60109,z=60110,P=60112,L=60113,A=60120,F=60115,$=60116,Q=60121,_=60129,K=60130,ee=60131;if(typeof Symbol=="function"&&Symbol.for){var V=Symbol.for;x=V("react.element"),m=V("react.portal"),w=V("react.fragment"),R=V("react.strict_mode"),D=V("react.profiler"),M=V("react.provider"),z=V("react.context"),P=V("react.forward_ref"),L=V("react.suspense"),A=V("react.suspense_list"),F=V("react.memo"),$=V("react.lazy"),Q=V("react.block"),V("react.scope"),_=V("react.debug_trace_mode"),K=V("react.offscreen"),ee=V("react.legacy_hidden")}var ae=typeof Symbol=="function"&&Symbol.iterator;function ge(o){return o===null||typeof o!="object"?null:(o=ae&&o[ae]||o["@@iterator"],typeof o=="function"?o:null)}function we(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 w:return"Fragment";case m:return"Portal";case D:return"Profiler";case R:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case z:return(o.displayName||"Context")+".Consumer";case M:return(o._context.displayName||"Context")+".Provider";case P:var l=o.render;return l=l.displayName||l.name||"",o.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case F:return we(o.type);case Q:return we(o._render);case $:l=o._payload,o=o._init;try{return we(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 Fe(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 S=d.return;if(S===null)break;var C=S.alternate;if(C===null){if(y=S.return,y!==null){d=y;continue}break}if(S.child===C.child){for(C=S.child;C;){if(C===d)return Ue(S),o;if(C===y)return Ue(S),l;C=C.sibling}throw Error(p(188))}if(d.return!==y.return)d=S,y=C;else{for(var j=!1,H=S.child;H;){if(H===d){j=!0,d=S,y=C;break}if(H===y){j=!0,y=S,d=C;break}H=H.sibling}if(!j){for(H=C.child;H;){if(H===d){j=!0,d=C,y=S;break}if(H===y){j=!0,y=C,d=S;break}H=H.sibling}if(!j)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 Be(o){if(o=Fe(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 vt(o){if(o=Fe(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 Oe(o,l){for(var d=o.alternate;l!==null;){if(l===o||l===d)return!0;l=l.return}return!1}var it=n.getPublicInstance,nt=n.getRootHostContext,W=n.getChildHostContext,Re=n.prepareForCommit,Ie=n.resetAfterCommit,tt=n.createInstance,at=n.appendInitialChild,$t=n.finalizeInitialChildren,jt=n.prepareUpdate,yt=n.shouldSetTextContent,xt=n.createTextInstance,Pt=n.scheduleTimeout,St=n.cancelTimeout,ht=n.noTimeout,ke=n.isPrimaryRenderer,qe=n.supportsMutation,st=n.supportsPersistence,wt=n.supportsHydration,vn=n.getInstanceFromNode,I=n.makeOpaqueHydratingObject,N=n.makeClientId,Z=n.beforeActiveInstanceBlur,Me=n.afterActiveInstanceBlur,ft=n.preparePortalMount,et=n.supportsTestSelectors,Ft=n.findFiberRoot,mn=n.getBoundingRect,Le=n.getTextContent,oe=n.isHiddenSubtree,X=n.matchAccessibilityRole,de=n.setFocusIfFocusable,le=n.setupIntersectionObserver,he=n.appendChild,be=n.appendChildToContainer,Ve=n.commitTextUpdate,J=n.commitMount,re=n.commitUpdate,De=n.insertBefore,Ae=n.insertInContainerBefore,Ne=n.removeChild,Je=n.removeChildFromContainer,Ct=n.resetTextContent,Nt=n.hideInstance,_t=n.hideTextInstance,gn=n.unhideInstance,qt=n.unhideTextInstance,Bt=n.clearContainer,Mr=n.cloneInstance,Pr=n.createContainerChildSet,Hr=n.appendChildToContainerChildSet,br=n.finalizeContainerChildren,Ps=n.replaceContainerChildren,gl=n.cloneHiddenInstance,es=n.cloneHiddenTextInstance,nc=n.canHydrateInstance,rc=n.canHydrateTextInstance,yl=n.isSuspenseInstancePending,bl=n.isSuspenseInstanceFallback,U=n.getNextHydratableSibling,xe=n.getFirstHydratableChild,_e=n.hydrateInstance,dt=n.hydrateTextInstance,Dt=n.getNextHydratableInstanceAfterSuspenseInstance,Ht=n.commitHydratedContainer,Rt=n.commitHydratedSuspenseInstance,Et;function An(o){if(Et===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Et=l&&l[1]||""}return`
202
- `+Et+o}var Zt=!1;function rn(o,l){if(!o||Zt)return"";Zt=!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(ce){var y=ce}Reflect.construct(o,[],l)}else{try{l.call()}catch(ce){y=ce}o.call(l.prototype)}else{try{throw Error()}catch(ce){y=ce}o()}}catch(ce){if(ce&&y&&typeof ce.stack=="string"){for(var S=ce.stack.split(`
203
- `),C=y.stack.split(`
204
- `),j=S.length-1,H=C.length-1;1<=j&&0<=H&&S[j]!==C[H];)H--;for(;1<=j&&0<=H;j--,H--)if(S[j]!==C[H]){if(j!==1||H!==1)do if(j--,H--,0>H||S[j]!==C[H])return`
205
- `+S[j].replace(" at new "," at ");while(1<=j&&0<=H);break}}}finally{Zt=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?An(o):""}var Wn=[],ar=-1;function Vr(o){return{current:o}}function Ot(o){0>ar||(o.current=Wn[ar],Wn[ar]=null,ar--)}function Sn(o,l){ar++,Wn[ar]=o.current,o.current=l}var gi={},xn=Vr(gi),Xn=Vr(!1),$n=gi;function yi(o,l){var d=o.type.contextTypes;if(!d)return gi;var y=o.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var S={},C;for(C in d)S[C]=l[C];return y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=S),S}function dn(o){return o=o.childContextTypes,o!=null}function Sl(){Ot(Xn),Ot(xn)}function wd(o,l,d){if(xn.current!==gi)throw Error(p(168));Sn(xn,l),Sn(Xn,d)}function Ed(o,l,d){var y=o.stateNode;if(o=l.childContextTypes,typeof y.getChildContext!="function")return d;y=y.getChildContext();for(var S in y)if(!(S in o))throw Error(p(108,we(l)||"Unknown",S));return a({},d,y)}function Qo(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||gi,$n=xn.current,Sn(xn,o),Sn(Xn,Xn.current),!0}function Td(o,l,d){var y=o.stateNode;if(!y)throw Error(p(169));d?(o=Ed(o,l,$n),y.__reactInternalMemoizedMergedChildContext=o,Ot(Xn),Ot(xn),Sn(xn,o)):Ot(Xn),Sn(Xn,d)}var ic=null,Wr=null,mv=f.unstable_now;mv();var xl=0,sn=8;function ii(o){if(1&o)return sn=15,1;if(2&o)return sn=14,2;if(4&o)return sn=13,4;var l=24&o;return l!==0?(sn=12,l):o&32?(sn=11,32):(l=192&o,l!==0?(sn=10,l):o&256?(sn=9,256):(l=3584&o,l!==0?(sn=8,l):o&4096?(sn=7,4096):(l=4186112&o,l!==0?(sn=6,l):(l=62914560&o,l!==0?(sn=5,l):o&67108864?(sn=4,67108864):o&134217728?(sn=3,134217728):(l=805306368&o,l!==0?(sn=2,l):1073741824&o?(sn=1,1073741824):(sn=8,o))))))}function gv(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 yv(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 Go(o,l){var d=o.pendingLanes;if(d===0)return sn=0;var y=0,S=0,C=o.expiredLanes,j=o.suspendedLanes,H=o.pingedLanes;if(C!==0)y=C,S=sn=15;else if(C=d&134217727,C!==0){var ce=C&~j;ce!==0?(y=ii(ce),S=sn):(H&=C,H!==0&&(y=ii(H),S=sn))}else C=d&~j,C!==0?(y=ii(C),S=sn):H!==0&&(y=ii(H),S=sn);if(y===0)return 0;if(y=31-ts(y),y=d&((0>y?0:1<<y)<<1)-1,l!==0&&l!==y&&!(l&j)){if(ii(l),S<=sn)return l;sn=S}if(l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=y;0<l;)d=31-ts(l),S=1<<d,y|=o[d],l&=~S;return y}function Cd(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function wl(o,l){switch(o){case 15:return 1;case 14:return 2;case 12:return o=uo(24&~l),o===0?wl(10,l):o;case 10:return o=uo(192&~l),o===0?wl(8,l):o;case 8:return o=uo(3584&~l),o===0&&(o=uo(4186112&~l),o===0&&(o=512)),o;case 2:return l=uo(805306368&~l),l===0&&(l=268435456),l}throw Error(p(358,o))}function uo(o){return o&-o}function sc(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function El(o,l,d){o.pendingLanes|=l;var y=l-1;o.suspendedLanes&=y,o.pingedLanes&=y,o=o.eventTimes,l=31-ts(l),o[l]=d}var ts=Math.clz32?Math.clz32:xv,bv=Math.log,Sv=Math.LN2;function xv(o){return o===0?32:31-(bv(o)/Sv|0)|0}var Rd=f.unstable_runWithPriority,oc=f.unstable_scheduleCallback,ac=f.unstable_cancelCallback,wv=f.unstable_shouldYield,Od=f.unstable_requestPaint,Xo=f.unstable_now,Ev=f.unstable_getCurrentPriorityLevel,Ko=f.unstable_ImmediatePriority,lc=f.unstable_UserBlockingPriority,Ad=f.unstable_NormalPriority,uc=f.unstable_LowPriority,cc=f.unstable_IdlePriority,Tl={},Tv=Od!==void 0?Od:function(){},Di=null,Cl=null,fc=!1,Rl=Xo(),Un=1e4>Rl?Xo:function(){return Xo()-Rl};function co(){switch(Ev()){case Ko:return 99;case lc:return 98;case Ad:return 97;case uc:return 96;case cc:return 95;default:throw Error(p(332))}}function Md(o){switch(o){case 99:return Ko;case 98:return lc;case 97:return Ad;case 96:return uc;case 95:return cc;default:throw Error(p(332))}}function ki(o,l){return o=Md(o),Rd(o,l)}function fo(o,l,d){return o=Md(o),oc(o,l,d)}function $r(){if(Cl!==null){var o=Cl;Cl=null,ac(o)}Pd()}function Pd(){if(!fc&&Di!==null){fc=!0;var o=0;try{var l=Di;ki(99,function(){for(;o<l.length;o++){var d=l[o];do d=d(!0);while(d!==null)}}),Di=null}catch(d){throw Di!==null&&(Di=Di.slice(o+1)),oc(Ko,$r),d}finally{fc=!1}}}var Cv=g.ReactCurrentBatchConfig;function Rv(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var qr=typeof Object.is=="function"?Object.is:Rv,Ov=Object.prototype.hasOwnProperty;function Ol(o,l){if(qr(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(!Ov.call(l,d[y])||!qr(o[d[y]],l[d[y]]))return!1;return!0}function Av(o){switch(o.tag){case 5:return An(o.type);case 16:return An("Lazy");case 13:return An("Suspense");case 19:return An("SuspenseList");case 0:case 2:case 15:return o=rn(o.type,!1),o;case 11:return o=rn(o.type.render,!1),o;case 22:return o=rn(o.type._render,!1),o;case 1:return o=rn(o.type,!0),o;default:return""}}function si(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 Al=Vr(null),Ml=null,bi=null,Zo=null;function Pl(){Zo=bi=Ml=null}function dc(o,l){o=o.type._context,ke?(Sn(Al,o._currentValue),o._currentValue=l):(Sn(Al,o._currentValue2),o._currentValue2=l)}function Ll(o){var l=Al.current;Ot(Al),o=o.type._context,ke?o._currentValue=l:o._currentValue2=l}function hc(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 Ls(o,l){Ml=o,Zo=bi=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&l&&(Xr=!0),o.firstContext=null)}function Lr(o,l){if(Zo!==o&&l!==!1&&l!==0)if((typeof l!="number"||l===1073741823)&&(Zo=o,l=1073741823),l={context:o,observedBits:l,next:null},bi===null){if(Ml===null)throw Error(p(308));bi=l,Ml.dependencies={lanes:0,firstContext:l,responders:null}}else bi=bi.next=l;return ke?o._currentValue:o._currentValue2}var Ni=!1;function Yr(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function oi(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 Si(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function xi(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 zi(o,l){var d=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,d===y)){var S=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var j={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?S=C=j:C=C.next=j,d=d.next}while(d!==null);C===null?S=C=l:C=C.next=l}else S=C=l;d={baseState:y.baseState,firstBaseUpdate:S,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 Ds(o,l,d,y){var S=o.updateQueue;Ni=!1;var C=S.firstBaseUpdate,j=S.lastBaseUpdate,H=S.shared.pending;if(H!==null){S.shared.pending=null;var ce=H,ze=ce.next;ce.next=null,j===null?C=ze:j.next=ze,j=ce;var rt=o.alternate;if(rt!==null){rt=rt.updateQueue;var mt=rt.lastBaseUpdate;mt!==j&&(mt===null?rt.firstBaseUpdate=ze:mt.next=ze,rt.lastBaseUpdate=ce)}}if(C!==null){mt=S.baseState,j=0,rt=ze=ce=null;do{H=C.lane;var We=C.eventTime;if((y&H)===H){rt!==null&&(rt=rt.next={eventTime:We,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var Yt=o,ln=C;switch(H=l,We=d,ln.tag){case 1:if(Yt=ln.payload,typeof Yt=="function"){mt=Yt.call(We,mt,H);break e}mt=Yt;break e;case 3:Yt.flags=Yt.flags&-4097|64;case 0:if(Yt=ln.payload,H=typeof Yt=="function"?Yt.call(We,mt,H):Yt,H==null)break e;mt=a({},mt,H);break e;case 2:Ni=!0}}C.callback!==null&&(o.flags|=32,H=S.effects,H===null?S.effects=[C]:H.push(C))}else We={eventTime:We,lane:H,tag:C.tag,payload:C.payload,callback:C.callback,next:null},rt===null?(ze=rt=We,ce=mt):rt=rt.next=We,j|=H;if(C=C.next,C===null){if(H=S.shared.pending,H===null)break;C=H.next,H.next=null,S.lastBaseUpdate=H,S.shared.pending=null}}while(!0);rt===null&&(ce=mt),S.baseState=ce,S.firstBaseUpdate=ze,S.lastBaseUpdate=rt,Ea|=j,o.lanes=j,o.memoizedState=mt}}function Jo(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var y=o[l],S=y.callback;if(S!==null){if(y.callback=null,y=d,typeof S!="function")throw Error(p(191,S));S.call(y)}}}var Ld=new c.Component().refs;function ho(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 Dl={isMounted:function(o){return(o=o._reactInternals)?Ee(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var y=Tr(),S=zn(o),C=Si(y,S);C.payload=l,d!=null&&(C.callback=d),xi(o,C),Vi(o,S,y)},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var y=Tr(),S=zn(o),C=Si(y,S);C.tag=1,C.payload=l,d!=null&&(C.callback=d),xi(o,C),Vi(o,S,y)},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Tr(),y=zn(o),S=Si(d,y);S.tag=2,l!=null&&(S.callback=l),xi(o,S),Vi(o,y,d)}};function po(o,l,d,y,S,C,j){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,j):l.prototype&&l.prototype.isPureReactComponent?!Ol(d,y)||!Ol(S,C):!0}function Dd(o,l,d){var y=!1,S=gi,C=l.contextType;return typeof C=="object"&&C!==null?C=Lr(C):(S=dn(l)?$n:xn.current,y=l.contextTypes,C=(y=y!=null)?yi(o,S):gi),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Dl,o.stateNode=l,l._reactInternals=o,y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=S,o.__reactInternalMemoizedMaskedChildContext=C),l}function kl(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&&Dl.enqueueReplaceState(l,l.state,null)}function Nl(o,l,d,y){var S=o.stateNode;S.props=d,S.state=o.memoizedState,S.refs=Ld,Yr(o);var C=l.contextType;typeof C=="object"&&C!==null?S.context=Lr(C):(C=dn(l)?$n:xn.current,S.context=yi(o,C)),Ds(o,d,S,y),S.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(ho(o,l,C,d),S.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(l=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),l!==S.state&&Dl.enqueueReplaceState(S,S.state,null),Ds(o,d,S,y),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4)}var ea=Array.isArray;function ns(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 S=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===S?l.ref:(l=function(C){var j=y.refs;j===Ld&&(j=y.refs={}),C===null?delete j[S]:j[S]=C},l._stringRef=S,l)}if(typeof o!="string")throw Error(p(284));if(!d._owner)throw Error(p(290,o))}return o}function Sr(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 zl(o){function l(te,q){if(o){var fe=te.lastEffect;fe!==null?(fe.nextEffect=q,te.lastEffect=q):te.firstEffect=te.lastEffect=q,q.nextEffect=null,q.flags=8}}function d(te,q){if(!o)return null;for(;q!==null;)l(te,q),q=q.sibling;return null}function y(te,q){for(te=new Map;q!==null;)q.key!==null?te.set(q.key,q):te.set(q.index,q),q=q.sibling;return te}function S(te,q){return te=tn(te,q),te.index=0,te.sibling=null,te}function C(te,q,fe){return te.index=fe,o?(fe=te.alternate,fe!==null?(fe=fe.index,fe<q?(te.flags=2,q):fe):(te.flags=2,q)):q}function j(te){return o&&te.alternate===null&&(te.flags=2),te}function H(te,q,fe,He){return q===null||q.tag!==6?(q=_a(fe,te.mode,He),q.return=te,q):(q=S(q,fe),q.return=te,q)}function ce(te,q,fe,He){return q!==null&&q.elementType===fe.type?(He=S(q,fe.props),He.ref=ns(te,q,fe),He.return=te,He):(He=ja(fe.type,fe.key,fe.props,null,te.mode,He),He.ref=ns(te,q,fe),He.return=te,He)}function ze(te,q,fe,He){return q===null||q.tag!==4||q.stateNode.containerInfo!==fe.containerInfo||q.stateNode.implementation!==fe.implementation?(q=Po(fe,te.mode,He),q.return=te,q):(q=S(q,fe.children||[]),q.return=te,q)}function rt(te,q,fe,He,ot){return q===null||q.tag!==7?(q=$s(fe,te.mode,He,ot),q.return=te,q):(q=S(q,fe),q.return=te,q)}function mt(te,q,fe){if(typeof q=="string"||typeof q=="number")return q=_a(""+q,te.mode,fe),q.return=te,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return fe=ja(q.type,q.key,q.props,null,te.mode,fe),fe.ref=ns(te,null,q),fe.return=te,fe;case m:return q=Po(q,te.mode,fe),q.return=te,q}if(ea(q)||ge(q))return q=$s(q,te.mode,fe,null),q.return=te,q;Sr(te,q)}return null}function We(te,q,fe,He){var ot=q!==null?q.key:null;if(typeof fe=="string"||typeof fe=="number")return ot!==null?null:H(te,q,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return fe.key===ot?fe.type===w?rt(te,q,fe.props.children,He,ot):ce(te,q,fe,He):null;case m:return fe.key===ot?ze(te,q,fe,He):null}if(ea(fe)||ge(fe))return ot!==null?null:rt(te,q,fe,He,null);Sr(te,fe)}return null}function Yt(te,q,fe,He,ot){if(typeof He=="string"||typeof He=="number")return te=te.get(fe)||null,H(q,te,""+He,ot);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case x:return te=te.get(He.key===null?fe:He.key)||null,He.type===w?rt(q,te,He.props.children,ot,He.key):ce(q,te,He,ot);case m:return te=te.get(He.key===null?fe:He.key)||null,ze(q,te,He,ot)}if(ea(He)||ge(He))return te=te.get(fe)||null,rt(q,te,He,ot,null);Sr(q,He)}return null}function ln(te,q,fe,He){for(var ot=null,Qt=null,gt=q,Ut=q=0,Dn=null;gt!==null&&Ut<fe.length;Ut++){gt.index>Ut?(Dn=gt,gt=null):Dn=gt.sibling;var At=We(te,gt,fe[Ut],He);if(At===null){gt===null&&(gt=Dn);break}o&&gt&&At.alternate===null&&l(te,gt),q=C(At,q,Ut),Qt===null?ot=At:Qt.sibling=At,Qt=At,gt=Dn}if(Ut===fe.length)return d(te,gt),ot;if(gt===null){for(;Ut<fe.length;Ut++)gt=mt(te,fe[Ut],He),gt!==null&&(q=C(gt,q,Ut),Qt===null?ot=gt:Qt.sibling=gt,Qt=gt);return ot}for(gt=y(te,gt);Ut<fe.length;Ut++)Dn=Yt(gt,te,Ut,fe[Ut],He),Dn!==null&&(o&&Dn.alternate!==null&&gt.delete(Dn.key===null?Ut:Dn.key),q=C(Dn,q,Ut),Qt===null?ot=Dn:Qt.sibling=Dn,Qt=Dn);return o&&gt.forEach(function(Wi){return l(te,Wi)}),ot}function _r(te,q,fe,He){var ot=ge(fe);if(typeof ot!="function")throw Error(p(150));if(fe=ot.call(fe),fe==null)throw Error(p(151));for(var Qt=ot=null,gt=q,Ut=q=0,Dn=null,At=fe.next();gt!==null&&!At.done;Ut++,At=fe.next()){gt.index>Ut?(Dn=gt,gt=null):Dn=gt.sibling;var Wi=We(te,gt,At.value,He);if(Wi===null){gt===null&&(gt=Dn);break}o&&gt&&Wi.alternate===null&&l(te,gt),q=C(Wi,q,Ut),Qt===null?ot=Wi:Qt.sibling=Wi,Qt=Wi,gt=Dn}if(At.done)return d(te,gt),ot;if(gt===null){for(;!At.done;Ut++,At=fe.next())At=mt(te,At.value,He),At!==null&&(q=C(At,q,Ut),Qt===null?ot=At:Qt.sibling=At,Qt=At);return ot}for(gt=y(te,gt);!At.done;Ut++,At=fe.next())At=Yt(gt,te,Ut,At.value,He),At!==null&&(o&&At.alternate!==null&&gt.delete(At.key===null?Ut:At.key),q=C(At,q,Ut),Qt===null?ot=At:Qt.sibling=At,Qt=At);return o&&gt.forEach(function(jv){return l(te,jv)}),ot}return function(te,q,fe,He){var ot=typeof fe=="object"&&fe!==null&&fe.type===w&&fe.key===null;ot&&(fe=fe.props.children);var Qt=typeof fe=="object"&&fe!==null;if(Qt)switch(fe.$$typeof){case x:e:{for(Qt=fe.key,ot=q;ot!==null;){if(ot.key===Qt){switch(ot.tag){case 7:if(fe.type===w){d(te,ot.sibling),q=S(ot,fe.props.children),q.return=te,te=q;break e}break;default:if(ot.elementType===fe.type){d(te,ot.sibling),q=S(ot,fe.props),q.ref=ns(te,ot,fe),q.return=te,te=q;break e}}d(te,ot);break}else l(te,ot);ot=ot.sibling}fe.type===w?(q=$s(fe.props.children,te.mode,He,fe.key),q.return=te,te=q):(He=ja(fe.type,fe.key,fe.props,null,te.mode,He),He.ref=ns(te,q,fe),He.return=te,te=He)}return j(te);case m:e:{for(ot=fe.key;q!==null;){if(q.key===ot)if(q.tag===4&&q.stateNode.containerInfo===fe.containerInfo&&q.stateNode.implementation===fe.implementation){d(te,q.sibling),q=S(q,fe.children||[]),q.return=te,te=q;break e}else{d(te,q);break}else l(te,q);q=q.sibling}q=Po(fe,te.mode,He),q.return=te,te=q}return j(te)}if(typeof fe=="string"||typeof fe=="number")return fe=""+fe,q!==null&&q.tag===6?(d(te,q.sibling),q=S(q,fe),q.return=te,te=q):(d(te,q),q=_a(fe,te.mode,He),q.return=te,te=q),j(te);if(ea(fe))return ln(te,q,fe,He);if(ge(fe))return _r(te,q,fe,He);if(Qt&&Sr(te,fe),typeof fe>"u"&&!ot)switch(te.tag){case 1:case 22:case 0:case 11:case 15:throw Error(p(152,we(te.type)||"Component"))}return d(te,q)}}var ks=zl(!0),wi=zl(!1),Qr={},Jt=Vr(Qr),Mn=Vr(Qr),rs=Vr(Qr);function wn(o){if(o===Qr)throw Error(p(174));return o}function ai(o,l){Sn(rs,l),Sn(Mn,o),Sn(Jt,Qr),o=nt(l),Ot(Jt),Sn(Jt,o)}function lr(){Ot(Jt),Ot(Mn),Ot(rs)}function jl(o){var l=wn(rs.current),d=wn(Jt.current);l=W(d,o.type,l),d!==l&&(Sn(Mn,o),Sn(Jt,l))}function is(o){Mn.current===o&&(Ot(Jt),Ot(Mn))}var yn=Vr(0);function ji(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||yl(d)||bl(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 Gr=null,Kn=null,Dr=!1;function _l(o,l){var d=jr(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 pc(o,l){switch(o.tag){case 5:return l=nc(l,o.type,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 6:return l=rc(l,o.pendingProps),l!==null?(o.stateNode=l,!0):!1;case 13:return!1;default:return!1}}function Il(o){if(Dr){var l=Kn;if(l){var d=l;if(!pc(o,l)){if(l=U(d),!l||!pc(o,l)){o.flags=o.flags&-1025|2,Dr=!1,Gr=o;return}_l(Gr,d)}Gr=o,Kn=xe(l)}else o.flags=o.flags&-1025|2,Dr=!1,Gr=o}}function ta(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Gr=o}function na(o){if(!wt||o!==Gr)return!1;if(!Dr)return ta(o),Dr=!0,!1;var l=o.type;if(o.tag!==5||l!=="head"&&l!=="body"&&!yt(l,o.memoizedProps))for(l=Kn;l;)_l(o,l),l=U(l);if(ta(o),o.tag===13){if(!wt)throw Error(p(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(p(317));Kn=Dt(o)}else Kn=Gr?U(o.stateNode):null;return!0}function vc(){wt&&(Kn=Gr=null,Dr=!1)}var Ns=[];function Ul(){for(var o=0;o<Ns.length;o++){var l=Ns[o];ke?l._workInProgressVersionPrimary=null:l._workInProgressVersionSecondary=null}Ns.length=0}var vo=g.ReactCurrentDispatcher,ur=g.ReactCurrentBatchConfig,xr=0,on=null,Zn=null,qn=null,Fl=!1,ra=!1;function wr(){throw Error(p(321))}function mc(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!qr(o[d],l[d]))return!1;return!0}function Bl(o,l,d,y,S,C){if(xr=C,on=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,vo.current=o===null||o.memoizedState===null?ca:Wl,o=d(y,S),ra){C=0;do{if(ra=!1,!(25>C))throw Error(p(301));C+=1,qn=Zn=null,l.updateQueue=null,vo.current=$l,o=d(y,S)}while(ra)}if(vo.current=zt,l=Zn!==null&&Zn.next!==null,xr=0,qn=Zn=on=null,Fl=!1,l)throw Error(p(300));return o}function ss(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?on.memoizedState=qn=o:qn=qn.next=o,qn}function os(){if(Zn===null){var o=on.alternate;o=o!==null?o.memoizedState:null}else o=Zn.next;var l=qn===null?on.memoizedState:qn.next;if(l!==null)qn=l,Zn=o;else{if(o===null)throw Error(p(310));Zn=o,o={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},qn===null?on.memoizedState=qn=o:qn=qn.next=o}return qn}function Ei(o,l){return typeof l=="function"?l(o):l}function mo(o){var l=os(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=Zn,S=y.baseQueue,C=d.pending;if(C!==null){if(S!==null){var j=S.next;S.next=C.next,C.next=j}y.baseQueue=S=C,d.pending=null}if(S!==null){S=S.next,y=y.baseState;var H=j=C=null,ce=S;do{var ze=ce.lane;if((xr&ze)===ze)H!==null&&(H=H.next={lane:0,action:ce.action,eagerReducer:ce.eagerReducer,eagerState:ce.eagerState,next:null}),y=ce.eagerReducer===o?ce.eagerState:o(y,ce.action);else{var rt={lane:ze,action:ce.action,eagerReducer:ce.eagerReducer,eagerState:ce.eagerState,next:null};H===null?(j=H=rt,C=y):H=H.next=rt,on.lanes|=ze,Ea|=ze}ce=ce.next}while(ce!==null&&ce!==S);H===null?C=y:H.next=j,qr(y,l.memoizedState)||(Xr=!0),l.memoizedState=y,l.baseState=C,l.baseQueue=H,d.lastRenderedState=y}return[l.memoizedState,d.dispatch]}function ia(o){var l=os(),d=l.queue;if(d===null)throw Error(p(311));d.lastRenderedReducer=o;var y=d.dispatch,S=d.pending,C=l.memoizedState;if(S!==null){d.pending=null;var j=S=S.next;do C=o(C,j.action),j=j.next;while(j!==S);qr(C,l.memoizedState)||(Xr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,y]}function zs(o,l,d){var y=l._getVersion;y=y(l._source);var S=ke?l._workInProgressVersionPrimary:l._workInProgressVersionSecondary;if(S!==null?o=S===y:(o=o.mutableReadLanes,(o=(xr&o)===o)&&(ke?l._workInProgressVersionPrimary=y:l._workInProgressVersionSecondary=y,Ns.push(l))),o)return d(l._source);throw Ns.push(l),Error(p(350))}function sa(o,l,d,y){var S=er;if(S===null)throw Error(p(349));var C=l._getVersion,j=C(l._source),H=vo.current,ce=H.useState(function(){return zs(S,l,d)}),ze=ce[1],rt=ce[0];ce=qn;var mt=o.memoizedState,We=mt.refs,Yt=We.getSnapshot,ln=mt.source;mt=mt.subscribe;var _r=on;return o.memoizedState={refs:We,source:l,subscribe:y},H.useEffect(function(){We.getSnapshot=d,We.setSnapshot=ze;var te=C(l._source);if(!qr(j,te)){te=d(l._source),qr(rt,te)||(ze(te),te=zn(_r),S.mutableReadLanes|=te&S.pendingLanes),te=S.mutableReadLanes,S.entangledLanes|=te;for(var q=S.entanglements,fe=te;0<fe;){var He=31-ts(fe),ot=1<<He;q[He]|=te,fe&=~ot}}},[d,l,y]),H.useEffect(function(){return y(l._source,function(){var te=We.getSnapshot,q=We.setSnapshot;try{q(te(l._source));var fe=zn(_r);S.mutableReadLanes|=fe&S.pendingLanes}catch(He){q(function(){throw He})}})},[l,y]),qr(Yt,d)&&qr(ln,l)&&qr(mt,y)||(o={pending:null,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:rt},o.dispatch=ze=Jn.bind(null,on,o),ce.queue=o,ce.baseQueue=null,rt=zs(S,l,d),ce.memoizedState=ce.baseState=rt),rt}function gc(o,l,d){var y=os();return sa(y,o,l,d)}function as(o){var l=ss();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o=l.queue={pending:null,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:o},o=o.dispatch=Jn.bind(null,on,o),[l.memoizedState,o]}function oa(o,l,d,y){return o={tag:o,create:l,destroy:d,deps:y,next:null},l=on.updateQueue,l===null?(l={lastEffect:null},on.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 js(o){var l=ss();return o={current:o},l.memoizedState=o}function aa(){return os().memoizedState}function _i(o,l,d,y){var S=ss();on.flags|=o,S.memoizedState=oa(1|l,d,void 0,y===void 0?null:y)}function Hl(o,l,d,y){var S=os();y=y===void 0?null:y;var C=void 0;if(Zn!==null){var j=Zn.memoizedState;if(C=j.destroy,y!==null&&mc(y,j.deps)){oa(l,d,C,y);return}}on.flags|=o,S.memoizedState=oa(1|l,d,C,y)}function la(o,l){return _i(516,4,o,l)}function go(o,l){return Hl(516,4,o,l)}function yc(o,l){return Hl(4,2,o,l)}function bc(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 ua(o,l,d){return d=d!=null?d.concat([o]):null,Hl(4,2,bc.bind(null,l,o),d)}function Vl(){}function Ii(o,l){var d=os();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&mc(l,y[1])?y[0]:(d.memoizedState=[o,l],o)}function kd(o,l){var d=os();l=l===void 0?null:l;var y=d.memoizedState;return y!==null&&l!==null&&mc(l,y[1])?y[0]:(o=o(),d.memoizedState=[o,l],o)}function ye(o,l){var d=co();ki(98>d?98:d,function(){o(!0)}),ki(97<d?97:d,function(){var y=ur.transition;ur.transition=1;try{o(!1),l()}finally{ur.transition=y}})}function Jn(o,l,d){var y=Tr(),S=zn(o),C={lane:S,action:d,eagerReducer:null,eagerState:null,next:null},j=l.pending;if(j===null?C.next=C:(C.next=j.next,j.next=C),l.pending=C,j=o.alternate,o===on||j!==null&&j===on)ra=Fl=!0;else{if(o.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var H=l.lastRenderedState,ce=j(H,d);if(C.eagerReducer=j,C.eagerState=ce,qr(ce,H))return}catch{}finally{}Vi(o,S,y)}}var zt={readContext:Lr,useCallback:wr,useContext:wr,useEffect:wr,useImperativeHandle:wr,useLayoutEffect:wr,useMemo:wr,useReducer:wr,useRef:wr,useState:wr,useDebugValue:wr,useDeferredValue:wr,useTransition:wr,useMutableSource:wr,useOpaqueIdentifier:wr,unstable_isNewReconciler:!1},ca={readContext:Lr,useCallback:function(o,l){return ss().memoizedState=[o,l===void 0?null:l],o},useContext:Lr,useEffect:la,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,_i(4,2,bc.bind(null,l,o),d)},useLayoutEffect:function(o,l){return _i(4,2,o,l)},useMemo:function(o,l){var d=ss();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var y=ss();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=Jn.bind(null,on,o),[y.memoizedState,o]},useRef:js,useState:as,useDebugValue:Vl,useDeferredValue:function(o){var l=as(o),d=l[0],y=l[1];return la(function(){var S=ur.transition;ur.transition=1;try{y(o)}finally{ur.transition=S}},[o]),d},useTransition:function(){var o=as(!1),l=o[0];return o=ye.bind(null,o[1]),js(o),[o,l]},useMutableSource:function(o,l,d){var y=ss();return y.memoizedState={refs:{getSnapshot:l,setSnapshot:null},source:o,subscribe:d},sa(y,o,l,d)},useOpaqueIdentifier:function(){if(Dr){var o=!1,l=I(function(){throw o||(o=!0,d(N())),Error(p(355))}),d=as(l)[1];return!(on.mode&2)&&(on.flags|=516,oa(5,function(){d(N())},void 0,null)),l}return l=N(),as(l),l},unstable_isNewReconciler:!1},Wl={readContext:Lr,useCallback:Ii,useContext:Lr,useEffect:go,useImperativeHandle:ua,useLayoutEffect:yc,useMemo:kd,useReducer:mo,useRef:aa,useState:function(){return mo(Ei)},useDebugValue:Vl,useDeferredValue:function(o){var l=mo(Ei),d=l[0],y=l[1];return go(function(){var S=ur.transition;ur.transition=1;try{y(o)}finally{ur.transition=S}},[o]),d},useTransition:function(){var o=mo(Ei)[0];return[aa().current,o]},useMutableSource:gc,useOpaqueIdentifier:function(){return mo(Ei)[0]},unstable_isNewReconciler:!1},$l={readContext:Lr,useCallback:Ii,useContext:Lr,useEffect:go,useImperativeHandle:ua,useLayoutEffect:yc,useMemo:kd,useReducer:ia,useRef:aa,useState:function(){return ia(Ei)},useDebugValue:Vl,useDeferredValue:function(o){var l=ia(Ei),d=l[0],y=l[1];return go(function(){var S=ur.transition;ur.transition=1;try{y(o)}finally{ur.transition=S}},[o]),d},useTransition:function(){var o=ia(Ei)[0];return[aa().current,o]},useMutableSource:gc,useOpaqueIdentifier:function(){return ia(Ei)[0]},unstable_isNewReconciler:!1},Nd=g.ReactCurrentOwner,Xr=!1;function cr(o,l,d,y){l.child=o===null?wi(l,null,d,y):ks(l,o.child,d,y)}function ql(o,l,d,y,S){d=d.render;var C=l.ref;return Ls(l,S),y=Bl(o,l,d,y,C,S),o!==null&&!Xr?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~S,Fi(o,l,S)):(l.flags|=1,cr(o,l,y,S),l.child)}function Sc(o,l,d,y,S,C){if(o===null){var j=d.type;return typeof j=="function"&&!zc(j)&&j.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=j,_s(o,l,j,y,S,C)):(o=ja(d.type,null,y,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}return j=o.child,!(S&C)&&(S=j.memoizedProps,d=d.compare,d=d!==null?d:Ol,d(S,y)&&o.ref===l.ref)?Fi(o,l,C):(l.flags|=1,o=tn(j,y),o.ref=l.ref,o.return=l,l.child=o)}function _s(o,l,d,y,S,C){if(o!==null&&Ol(o.memoizedProps,y)&&o.ref===l.ref)if(Xr=!1,(C&S)!==0)o.flags&16384&&(Xr=!0);else return l.lanes=o.lanes,Fi(o,l,C);return fa(o,l,d,y,C)}function yo(o,l,d){var y=l.pendingProps,S=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},Gn(l,d);else if(d&1073741824)l.memoizedState={baseLanes:0},Gn(l,C!==null?C.baseLanes:d);else return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o},Gn(l,o),null;else C!==null?(y=C.baseLanes|d,l.memoizedState=null):y=d,Gn(l,y);return cr(o,l,S,d),l.child}function Is(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=128)}function fa(o,l,d,y,S){var C=dn(d)?$n:xn.current;return C=yi(l,C),Ls(l,S),d=Bl(o,l,d,y,C,S),o!==null&&!Xr?(l.updateQueue=o.updateQueue,l.flags&=-517,o.lanes&=~S,Fi(o,l,S)):(l.flags|=1,cr(o,l,d,S),l.child)}function xc(o,l,d,y,S){if(dn(d)){var C=!0;Qo(l)}else C=!1;if(Ls(l,S),l.stateNode===null)o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),Dd(l,d,y),Nl(l,d,y,S),y=!0;else if(o===null){var j=l.stateNode,H=l.memoizedProps;j.props=H;var ce=j.context,ze=d.contextType;typeof ze=="object"&&ze!==null?ze=Lr(ze):(ze=dn(d)?$n:xn.current,ze=yi(l,ze));var rt=d.getDerivedStateFromProps,mt=typeof rt=="function"||typeof j.getSnapshotBeforeUpdate=="function";mt||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(H!==y||ce!==ze)&&kl(l,j,y,ze),Ni=!1;var We=l.memoizedState;j.state=We,Ds(l,y,j,S),ce=l.memoizedState,H!==y||We!==ce||Xn.current||Ni?(typeof rt=="function"&&(ho(l,d,rt,y),ce=l.memoizedState),(H=Ni||po(l,d,H,y,We,ce,ze))?(mt||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(l.flags|=4)):(typeof j.componentDidMount=="function"&&(l.flags|=4),l.memoizedProps=y,l.memoizedState=ce),j.props=y,j.state=ce,j.context=ze,y=H):(typeof j.componentDidMount=="function"&&(l.flags|=4),y=!1)}else{j=l.stateNode,oi(o,l),H=l.memoizedProps,ze=l.type===l.elementType?H:si(l.type,H),j.props=ze,mt=l.pendingProps,We=j.context,ce=d.contextType,typeof ce=="object"&&ce!==null?ce=Lr(ce):(ce=dn(d)?$n:xn.current,ce=yi(l,ce));var Yt=d.getDerivedStateFromProps;(rt=typeof Yt=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(H!==mt||We!==ce)&&kl(l,j,y,ce),Ni=!1,We=l.memoizedState,j.state=We,Ds(l,y,j,S);var ln=l.memoizedState;H!==mt||We!==ln||Xn.current||Ni?(typeof Yt=="function"&&(ho(l,d,Yt,y),ln=l.memoizedState),(ze=Ni||po(l,d,ze,y,We,ln,ce))?(rt||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(y,ln,ce),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(y,ln,ce)),typeof j.componentDidUpdate=="function"&&(l.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(l.flags|=256)):(typeof j.componentDidUpdate!="function"||H===o.memoizedProps&&We===o.memoizedState||(l.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||H===o.memoizedProps&&We===o.memoizedState||(l.flags|=256),l.memoizedProps=y,l.memoizedState=ln),j.props=y,j.state=ln,j.context=ce,y=ze):(typeof j.componentDidUpdate!="function"||H===o.memoizedProps&&We===o.memoizedState||(l.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||H===o.memoizedProps&&We===o.memoizedState||(l.flags|=256),y=!1)}return Yl(o,l,d,y,C,S)}function Yl(o,l,d,y,S,C){Is(o,l);var j=(l.flags&64)!==0;if(!y&&!j)return S&&Td(l,d,!1),Fi(o,l,C);y=l.stateNode,Nd.current=l;var H=j&&typeof d.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,o!==null&&j?(l.child=ks(l,o.child,null,C),l.child=ks(l,null,H,C)):cr(o,l,H,C),l.memoizedState=y.state,S&&Td(l,d,!0),l.child}function Ql(o){var l=o.stateNode;l.pendingContext?wd(o,l.pendingContext,l.pendingContext!==l.context):l.context&&wd(o,l.context,!1),ai(o,l.containerInfo)}var kr={dehydrated:null,retryLane:0};function bn(o,l,d){var y=l.pendingProps,S=yn.current,C=!1,j;return(j=(l.flags&64)!==0)||(j=o!==null&&o.memoizedState===null?!1:(S&2)!==0),j?(C=!0,l.flags&=-65):o!==null&&o.memoizedState===null||y.fallback===void 0||y.unstable_avoidThisFallback===!0||(S|=1),Sn(yn,S&1),o===null?(y.fallback!==void 0&&Il(l),o=y.children,S=y.fallback,C?(o=wc(l,o,S,d),l.child.memoizedState={baseLanes:d},l.memoizedState=kr,o):typeof y.unstable_expectedLoadTime=="number"?(o=wc(l,o,S,d),l.child.memoizedState={baseLanes:d},l.memoizedState=kr,l.lanes=33554432,o):(d=Mo({mode:"visible",children:o},l.mode,d,null),d.return=l,l.child=d)):o.memoizedState!==null?C?(y=Tc(o,l,y.children,y.fallback,d),C=l.child,S=o.child.memoizedState,C.memoizedState=S===null?{baseLanes:d}:{baseLanes:S.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=kr,y):(d=Ec(o,l,y.children,d),l.memoizedState=null,d):C?(y=Tc(o,l,y.children,y.fallback,d),C=l.child,S=o.child.memoizedState,C.memoizedState=S===null?{baseLanes:d}:{baseLanes:S.baseLanes|d},C.childLanes=o.childLanes&~d,l.memoizedState=kr,y):(d=Ec(o,l,y.children,d),l.memoizedState=null,d)}function wc(o,l,d,y){var S=o.mode,C=o.child;return l={mode:"hidden",children:l},!(S&2)&&C!==null?(C.childLanes=0,C.pendingProps=l):C=Mo(l,S,0,null),d=$s(d,S,y,null),C.return=o,d.return=o,C.sibling=d,o.child=C,d}function Ec(o,l,d,y){var S=o.child;return o=S.sibling,d=tn(S,{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 Tc(o,l,d,y,S){var C=l.mode,j=o.child;o=j.sibling;var H={mode:"hidden",children:d};return!(C&2)&&l.child!==j?(d=l.child,d.childLanes=0,d.pendingProps=H,j=d.lastEffect,j!==null?(l.firstEffect=d.firstEffect,l.lastEffect=j,j.nextEffect=null):l.firstEffect=l.lastEffect=null):d=tn(j,H),o!==null?y=tn(o,y):(y=$s(y,C,S,null),y.flags|=2),y.return=l,d.return=l,d.sibling=y,l.child=d,y}function en(o,l){o.lanes|=l;var d=o.alternate;d!==null&&(d.lanes|=l),hc(o.return,l)}function Ui(o,l,d,y,S,C){var j=o.memoizedState;j===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:d,tailMode:S,lastEffect:C}:(j.isBackwards=l,j.rendering=null,j.renderingStartTime=0,j.last=y,j.tail=d,j.tailMode=S,j.lastEffect=C)}function zd(o,l,d){var y=l.pendingProps,S=y.revealOrder,C=y.tail;if(cr(o,l,y.children,d),y=yn.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&&en(o,d);else if(o.tag===19)en(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(Sn(yn,y),!(l.mode&2))l.memoizedState=null;else switch(S){case"forwards":for(d=l.child,S=null;d!==null;)o=d.alternate,o!==null&&ji(o)===null&&(S=d),d=d.sibling;d=S,d===null?(S=l.child,l.child=null):(S=d.sibling,d.sibling=null),Ui(l,!1,S,d,C,l.lastEffect);break;case"backwards":for(d=null,S=l.child,l.child=null;S!==null;){if(o=S.alternate,o!==null&&ji(o)===null){l.child=S;break}o=S.sibling,S.sibling=d,d=S,S=o}Ui(l,!0,d,null,C,l.lastEffect);break;case"together":Ui(l,!1,null,null,void 0,l.lastEffect);break;default:l.memoizedState=null}return l.child}function Fi(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ea|=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=tn(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=tn(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}return null}function Er(o){o.flags|=4}var da,ha,Gl,Xl;if(qe)da=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)at(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}},ha=function(){},Gl=function(o,l,d,y,S){if(o=o.memoizedProps,o!==y){var C=l.stateNode,j=wn(Jt.current);d=jt(C,d,o,y,S,j),(l.updateQueue=d)&&Er(l)}},Xl=function(o,l,d,y){d!==y&&Er(l)};else if(st){da=function(o,l,d,y){for(var S=l.child;S!==null;){if(S.tag===5){var C=S.stateNode;d&&y&&(C=gl(C,S.type,S.memoizedProps,S)),at(o,C)}else if(S.tag===6)C=S.stateNode,d&&y&&(C=es(C,S.memoizedProps,S)),at(o,C);else if(S.tag!==4){if(S.tag===13&&S.flags&4&&(C=S.memoizedState!==null)){var j=S.child;if(j!==null&&(j.child!==null&&(j.child.return=j,da(o,j,!0,C)),C=j.sibling,C!==null)){C.return=S,S=C;continue}}if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===l)break;for(;S.sibling===null;){if(S.return===null||S.return===l)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var Cc=function(o,l,d,y){for(var S=l.child;S!==null;){if(S.tag===5){var C=S.stateNode;d&&y&&(C=gl(C,S.type,S.memoizedProps,S)),Hr(o,C)}else if(S.tag===6)C=S.stateNode,d&&y&&(C=es(C,S.memoizedProps,S)),Hr(o,C);else if(S.tag!==4){if(S.tag===13&&S.flags&4&&(C=S.memoizedState!==null)){var j=S.child;if(j!==null&&(j.child!==null&&(j.child.return=j,Cc(o,j,!0,C)),C=j.sibling,C!==null)){C.return=S,S=C;continue}}if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===l)break;for(;S.sibling===null;){if(S.return===null||S.return===l)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};ha=function(o){var l=o.stateNode;if(o.firstEffect!==null){var d=l.containerInfo,y=Pr(d);Cc(y,o,!1,!1),l.pendingChildren=y,Er(o),br(d,y)}},Gl=function(o,l,d,y,S){var C=o.stateNode,j=o.memoizedProps;if((o=l.firstEffect===null)&&j===y)l.stateNode=C;else{var H=l.stateNode,ce=wn(Jt.current),ze=null;j!==y&&(ze=jt(H,d,j,y,S,ce)),o&&ze===null?l.stateNode=C:(C=Mr(C,ze,d,j,y,l,o,H),$t(C,d,y,S,ce)&&Er(l),l.stateNode=C,o?Er(l):da(C,l,!1,!1))}},Xl=function(o,l,d,y){d!==y?(o=wn(rs.current),d=wn(Jt.current),l.stateNode=xt(y,o,d,l),Er(l)):l.stateNode=o.stateNode}}else ha=function(){},Gl=function(){},Xl=function(){};function pa(o,l){if(!Dr)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 jd(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 dn(l.type)&&Sl(),null;case 3:return lr(),Ot(Xn),Ot(xn),Ul(),y=l.stateNode,y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(o===null||o.child===null)&&(na(l)?Er(l):y.hydrate||(l.flags|=256)),ha(l),null;case 5:is(l);var S=wn(rs.current);if(d=l.type,o!==null&&l.stateNode!=null)Gl(o,l,d,y,S),o.ref!==l.ref&&(l.flags|=128);else{if(!y){if(l.stateNode===null)throw Error(p(166));return null}if(o=wn(Jt.current),na(l)){if(!wt)throw Error(p(175));o=_e(l.stateNode,l.type,l.memoizedProps,S,o,l),l.updateQueue=o,o!==null&&Er(l)}else{var C=tt(d,y,S,o,l);da(C,l,!1,!1),l.stateNode=C,$t(C,d,y,S,o)&&Er(l)}l.ref!==null&&(l.flags|=128)}return null;case 6:if(o&&l.stateNode!=null)Xl(o,l,o.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(p(166));if(o=wn(rs.current),S=wn(Jt.current),na(l)){if(!wt)throw Error(p(176));dt(l.stateNode,l.memoizedProps,l)&&Er(l)}else l.stateNode=xt(y,o,S,l)}return null;case 13:return Ot(yn),y=l.memoizedState,l.flags&64?(l.lanes=d,l):(y=y!==null,S=!1,o===null?l.memoizedProps.fallback!==void 0&&na(l):S=o.memoizedState!==null,y&&!S&&l.mode&2&&(o===null&&l.memoizedProps.unstable_avoidThisFallback!==!0||yn.current&1?Fn===0&&(Fn=3):((Fn===0||Fn===3)&&(Fn=4),er===null||!(Ea&134217727)&&!(xo&134217727)||Bs(er,Gt))),st&&y&&(l.flags|=4),qe&&(y||S)&&(l.flags|=4),null);case 4:return lr(),ha(l),o===null&&ft(l.stateNode.containerInfo),null;case 10:return Ll(l),null;case 17:return dn(l.type)&&Sl(),null;case 19:if(Ot(yn),y=l.memoizedState,y===null)return null;if(S=(l.flags&64)!==0,C=y.rendering,C===null)if(S)pa(y,!1);else{if(Fn!==0||o!==null&&o.flags&64)for(o=l.child;o!==null;){if(C=ji(o),C!==null){for(l.flags|=64,pa(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;)S=y,d=o,S.flags&=2,S.nextEffect=null,S.firstEffect=null,S.lastEffect=null,C=S.alternate,C===null?(S.childLanes=0,S.lanes=d,S.child=null,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=C.childLanes,S.lanes=C.lanes,S.child=C.child,S.memoizedProps=C.memoizedProps,S.memoizedState=C.memoizedState,S.updateQueue=C.updateQueue,S.type=C.type,d=C.dependencies,S.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return Sn(yn,yn.current&1|2),l.child}o=o.sibling}y.tail!==null&&Un()>iu&&(l.flags|=64,S=!0,pa(y,!1),l.lanes=33554432)}else{if(!S)if(o=ji(C),o!==null){if(l.flags|=64,S=!0,o=o.updateQueue,o!==null&&(l.updateQueue=o,l.flags|=4),pa(y,!0),y.tail===null&&y.tailMode==="hidden"&&!C.alternate&&!Dr)return l=l.lastEffect=y.lastEffect,l!==null&&(l.nextEffect=null),null}else 2*Un()-y.renderingStartTime>iu&&d!==1073741824&&(l.flags|=64,S=!0,pa(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=Un(),o.sibling=null,l=yn.current,Sn(yn,S?l&1|2:l&1),o):null;case 23:case 24:return Ln(),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 _d(o){switch(o.tag){case 1:dn(o.type)&&Sl();var l=o.flags;return l&4096?(o.flags=l&-4097|64,o):null;case 3:if(lr(),Ot(Xn),Ot(xn),Ul(),l=o.flags,l&64)throw Error(p(285));return o.flags=l&-4097|64,o;case 5:return is(o),null;case 13:return Ot(yn),l=o.flags,l&4096?(o.flags=l&-4097|64,o):null;case 19:return Ot(yn),null;case 4:return lr(),null;case 10:return Ll(o),null;case 23:case 24:return Ln(),null;default:return null}}function Rc(o,l){try{var d="",y=l;do d+=Av(y),y=y.return;while(y);var S=d}catch(C){S=`
206
- Error generating stack: `+C.message+`
207
- `+C.stack}return{value:o,source:l,stack:S}}function bo(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var Mv=typeof WeakMap=="function"?WeakMap:Map;function Id(o,l,d){d=Si(-1,d),d.tag=3,d.payload={element:null};var y=l.value;return d.callback=function(){Ca||(Ca=!0,ui=y),bo(o,l)},d}function Ud(o,l,d){d=Si(-1,d),d.tag=3;var y=o.type.getDerivedStateFromError;if(typeof y=="function"){var S=l.value;d.payload=function(){return bo(o,l),y(S)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){typeof y!="function"&&(Qn===null?Qn=new Set([this]):Qn.add(this),bo(o,l));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})}),d}var Pv=typeof WeakSet=="function"?WeakSet:Set;function Fd(o){var l=o.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){di(o,d)}else l.current=null}function fr(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:si(l.type,d),y),o.__reactInternalSnapshotBeforeUpdate=l}return;case 3:qe&&l.flags&256&&Bt(l.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(p(163))}function ls(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 Lv(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 S=o;y=S.next,S=S.tag,S&4&&S&1&&(kc(d,o),au(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:si(d.type,l.memoizedProps),o.componentDidUpdate(y,l.memoizedState,o.__reactInternalSnapshotBeforeUpdate))),l=d.updateQueue,l!==null&&Jo(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=it(d.child.stateNode);break;case 1:o=d.child.stateNode}Jo(d,l,o)}return;case 5:o=d.stateNode,l===null&&d.flags&4&&J(o,d.type,d.memoizedProps,d);return;case 6:return;case 4:return;case 12:return;case 13:wt&&d.memoizedState===null&&(d=d.alternate,d!==null&&(d=d.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&Rt(d))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(p(163))}function Yn(o,l){if(qe)for(var d=o;;){if(d.tag===5){var y=d.stateNode;l?Nt(y):gn(d.stateNode,d.memoizedProps)}else if(d.tag===6)y=d.stateNode,l?_t(y):qt(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 us(o,l){if(Wr&&typeof Wr.onCommitFiberUnmount=="function")try{Wr.onCommitFiberUnmount(ic,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,S=y.destroy;if(y=y.tag,S!==void 0)if(y&4)kc(l,d);else{y=l;try{S()}catch(C){di(y,C)}}d=d.next}while(d!==o)}break;case 1:if(Fd(l),o=l.stateNode,typeof o.componentWillUnmount=="function")try{o.props=l.memoizedProps,o.state=l.memoizedState,o.componentWillUnmount()}catch(C){di(l,C)}break;case 5:Fd(l);break;case 4:qe?Hd(o,l):st&&st&&(l=l.stateNode.containerInfo,o=Pr(l),Ps(l,o))}}function It(o,l){for(var d=l;;)if(us(o,d),d.child===null||qe&&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 va(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 Dv(o){return o.tag===5||o.tag===3||o.tag===4}function Bd(o){if(qe){e:{for(var l=o.return;l!==null;){if(Dv(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&&(Ct(l),d.flags&=-17);e:t:for(d=o;;){for(;d.sibling===null;){if(d.return===null||Dv(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?ma(o,d,l):So(o,d,l)}}function ma(o,l,d){var y=o.tag,S=y===5||y===6;if(S)o=S?o.stateNode:o.stateNode.instance,l?Ae(d,o,l):be(d,o);else if(y!==4&&(o=o.child,o!==null))for(ma(o,l,d),o=o.sibling;o!==null;)ma(o,l,d),o=o.sibling}function So(o,l,d){var y=o.tag,S=y===5||y===6;if(S)o=S?o.stateNode:o.stateNode.instance,l?De(d,o,l):he(d,o);else if(y!==4&&(o=o.child,o!==null))for(So(o,l,d),o=o.sibling;o!==null;)So(o,l,d),o=o.sibling}function Hd(o,l){for(var d=l,y=!1,S,C;;){if(!y){y=d.return;e:for(;;){if(y===null)throw Error(p(160));switch(S=y.stateNode,y.tag){case 5:C=!1;break e;case 3:S=S.containerInfo,C=!0;break e;case 4:S=S.containerInfo,C=!0;break e}y=y.return}y=!0}if(d.tag===5||d.tag===6)It(o,d),C?Je(S,d.stateNode):Ne(S,d.stateNode);else if(d.tag===4){if(d.child!==null){S=d.stateNode.containerInfo,C=!0,d.child.return=d,d=d.child;continue}}else if(us(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 Kl(o,l){if(qe){switch(l.tag){case 0:case 11:case 14:case 15:case 22:ls(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 S=l.type,C=l.updateQueue;l.updateQueue=null,C!==null&&re(d,C,S,o,y,l)}return;case 6:if(l.stateNode===null)throw Error(p(162));d=l.memoizedProps,Ve(l.stateNode,o!==null?o.memoizedProps:d,d);return;case 3:wt&&(l=l.stateNode,l.hydrate&&(l.hydrate=!1,Ht(l.containerInfo)));return;case 12:return;case 13:Vd(l),Zl(l);return;case 19:Zl(l);return;case 17:return;case 23:case 24:Yn(l,l.memoizedState!==null);return}throw Error(p(163))}switch(l.tag){case 0:case 11:case 14:case 15:case 22:ls(3,l);return;case 12:return;case 13:Vd(l),Zl(l);return;case 19:Zl(l);return;case 3:wt&&(d=l.stateNode,d.hydrate&&(d.hydrate=!1,Ht(d.containerInfo)));break;case 23:case 24:return}e:if(st){switch(l.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:l=l.stateNode,Ps(l.containerInfo,l.pendingChildren);break e}throw Error(p(163))}}function Vd(o){o.memoizedState!==null&&(Ta=Un(),qe&&Yn(o.child,!0))}function Zl(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new Pv),l.forEach(function(y){var S=lu.bind(null,o,y);d.has(y)||(d.add(y),y.then(S,S))})}}function kv(o,l){return o!==null&&(o=o.memoizedState,o===null||o.dehydrated!==null)?(l=l.memoizedState,l!==null&&l.dehydrated===null):!1}var ga=0,Jl=1,eu=2,ya=3,tu=4;if(typeof Symbol=="function"&&Symbol.for){var ba=Symbol.for;ga=ba("selector.component"),Jl=ba("selector.has_pseudo_class"),eu=ba("selector.role"),ya=ba("selector.test_id"),tu=ba("selector.text")}function Oc(o){var l=vn(o);if(l!=null){if(typeof l.memoizedProps["data-testname"]!="string")throw Error(p(364));return l}if(o=Ft(o),o===null)throw Error(p(362));return o.stateNode.current}function Ac(o,l){switch(l.$$typeof){case ga:if(o.type===l.value)return!0;break;case Jl:e:{l=l.value,o=[o,0];for(var d=0;d<o.length;){var y=o[d++],S=o[d++],C=l[S];if(y.tag!==5||!oe(y)){for(;C!=null&&Ac(y,C);)S++,C=l[S];if(S===l.length){l=!0;break e}else for(y=y.child;y!==null;)o.push(y,S),y=y.sibling}}l=!1}return l;case eu:if(o.tag===5&&X(o.stateNode,l.value))return!0;break;case tu:if((o.tag===5||o.tag===6)&&(o=Le(o),o!==null&&0<=o.indexOf(l.value)))return!0;break;case ya: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 Sa(o){switch(o.$$typeof){case ga:return"<"+(we(o.value)||"Unknown")+">";case Jl:return":has("+(Sa(o)||"")+")";case eu:return'[role="'+o.value+'"]';case tu:return'"'+o.value+'"';case ya:return'[data-testname="'+o.value+'"]';default:throw Error(p(365,o))}}function Mc(o,l){var d=[];o=[o,0];for(var y=0;y<o.length;){var S=o[y++],C=o[y++],j=l[C];if(S.tag!==5||!oe(S)){for(;j!=null&&Ac(S,j);)C++,j=l[C];if(C===l.length)d.push(S);else for(S=S.child;S!==null;)o.push(S,C),S=S.sibling}}return d}function Pc(o,l){if(!et)throw Error(p(363));o=Oc(o),o=Mc(o,l),l=[],o=Array.from(o);for(var d=0;d<o.length;){var y=o[d++];if(y.tag===5)oe(y)||l.push(y.stateNode);else for(y=y.child;y!==null;)o.push(y),y=y.sibling}return l}var xa=null;function Lc(o){if(xa===null)try{var l=("require"+Math.random()).slice(0,7);xa=(t&&t[l]).call(t,"timers").setImmediate}catch{xa=function(y){var S=new MessageChannel;S.port1.onmessage=y,S.port2.postMessage(void 0)}}return xa(o)}var Nv=Math.ceil,Us=g.ReactCurrentDispatcher,nu=g.ReactCurrentOwner,ru=g.IsSomeRendererActing,ct=0,er=null,Pn=null,Gt=0,Nr=0,Kr=Vr(0),Fn=0,wa=null,cs=0,Ea=0,xo=0,li=0,wo=null,Ta=0,iu=1/0;function hn(){iu=Un()+500}var Ye=null,Ca=!1,ui=null,Qn=null,fs=!1,Eo=null,tr=90,su=[],an=[],Vt=null,Bn=0,Bi=null,nr=-1,Hi=0,ou=0,Ra=null,Oa=!1;function Tr(){return ct&48?Un():nr!==-1?nr:nr=Un()}function zn(o){if(o=o.mode,!(o&2))return 1;if(!(o&4))return co()===99?1:2;if(Hi===0&&(Hi=cs),Cv.transition!==0){ou!==0&&(ou=wo!==null?wo.pendingLanes:0),o=Hi;var l=4186112&~ou;return l&=-l,l===0&&(o=4186112&~o,l=o&-o,l===0&&(l=8192)),l}return o=co(),ct&4&&o===98?o=wl(12,Hi):(o=gv(o),o=wl(o,Hi)),o}function Vi(o,l,d){if(50<Bn)throw Bn=0,Bi=null,Error(p(185));if(o=Fs(o,l),o===null)return null;El(o,l,d),o===er&&(xo|=l,Fn===4&&Bs(o,Gt));var y=co();l===1?ct&8&&!(ct&48)?rr(o):(zr(o,d),ct===0&&(hn(),$r())):(!(ct&4)||y!==98&&y!==99||(Vt===null?Vt=new Set([o]):Vt.add(o)),zr(o,d)),wo=o}function Fs(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 zr(o,l){for(var d=o.callbackNode,y=o.suspendedLanes,S=o.pingedLanes,C=o.expirationTimes,j=o.pendingLanes;0<j;){var H=31-ts(j),ce=1<<H,ze=C[H];if(ze===-1){if(!(ce&y)||ce&S){ze=l,ii(ce);var rt=sn;C[H]=10<=rt?ze+250:6<=rt?ze+5e3:-1}}else ze<=l&&(o.expiredLanes|=ce);j&=~ce}if(y=Go(o,o===er?Gt:0),l=sn,y===0)d!==null&&(d!==Tl&&ac(d),o.callbackNode=null,o.callbackPriority=0);else{if(d!==null){if(o.callbackPriority===l)return;d!==Tl&&ac(d)}l===15?(d=rr.bind(null,o),Di===null?(Di=[d],Cl=oc(Ko,Pd)):Di.push(d),d=Tl):l===14?d=fo(99,rr.bind(null,o)):(d=yv(l),d=fo(d,Dc.bind(null,o))),o.callbackPriority=l,o.callbackNode=d}}function Dc(o){if(nr=-1,ou=Hi=0,ct&48)throw Error(p(327));var l=o.callbackNode;if(hr()&&o.callbackNode!==l)return null;var d=Go(o,o===er?Gt:0);if(d===0)return null;var y=d,S=ct;ct|=16;var C=Zr();(er!==o||Gt!==y)&&(hn(),dr(o,y));do try{Ma();break}catch(H){qd(o,H)}while(!0);if(Pl(),Us.current=C,ct=S,Pn!==null?y=0:(er=null,Gt=0,y=Fn),cs&xo)dr(o,0);else if(y!==0){if(y===2&&(ct|=64,o.hydrate&&(o.hydrate=!1,Bt(o.containerInfo)),d=Cd(o),d!==0&&(y=Aa(o,d))),y===1)throw l=wa,dr(o,0),Bs(o,d),zr(o,Un()),l;switch(o.finishedWork=o.current.alternate,o.finishedLanes=d,y){case 0:case 1:throw Error(p(345));case 2:ci(o);break;case 3:if(Bs(o,d),(d&62914560)===d&&(y=Ta+500-Un(),10<y)){if(Go(o,0)!==0)break;if(S=o.suspendedLanes,(S&d)!==d){Tr(),o.pingedLanes|=o.suspendedLanes&S;break}o.timeoutHandle=Pt(ci.bind(null,o),y);break}ci(o);break;case 4:if(Bs(o,d),(d&4186112)===d)break;for(y=o.eventTimes,S=-1;0<d;){var j=31-ts(d);C=1<<j,j=y[j],j>S&&(S=j),d&=~C}if(d=S,d=Un()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Nv(d/1960))-d,10<d){o.timeoutHandle=Pt(ci.bind(null,o),d);break}ci(o);break;case 5:ci(o);break;default:throw Error(p(329))}}return zr(o,Un()),o.callbackNode===l?Dc.bind(null,o):null}function Bs(o,l){for(l&=~li,l&=~xo,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-ts(l),y=1<<d;o[d]=-1,l&=~y}}function rr(o){if(ct&48)throw Error(p(327));if(hr(),o===er&&o.expiredLanes&Gt){var l=Gt,d=Aa(o,l);cs&xo&&(l=Go(o,l),d=Aa(o,l))}else l=Go(o,0),d=Aa(o,l);if(o.tag!==0&&d===2&&(ct|=64,o.hydrate&&(o.hydrate=!1,Bt(o.containerInfo)),l=Cd(o),l!==0&&(d=Aa(o,l))),d===1)throw d=wa,dr(o,0),Bs(o,l),zr(o,Un()),d;return o.finishedWork=o.current.alternate,o.finishedLanes=l,ci(o),zr(o,Un()),null}function To(){if(Vt!==null){var o=Vt;Vt=null,o.forEach(function(l){l.expiredLanes|=24&l.pendingLanes,zr(l,Un())})}$r()}function Wd(o,l){var d=ct;ct|=1;try{return o(l)}finally{ct=d,ct===0&&(hn(),$r())}}function $d(o,l){var d=ct;if(d&48)return o(l);ct|=1;try{if(o)return ki(99,o.bind(null,l))}finally{ct=d,$r()}}function Gn(o,l){Sn(Kr,Nr),Nr|=l,cs|=l}function Ln(){Nr=Kr.current,Ot(Kr)}function dr(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==ht&&(o.timeoutHandle=ht,St(d)),Pn!==null)for(d=Pn.return;d!==null;){var y=d;switch(y.tag){case 1:y=y.type.childContextTypes,y!=null&&Sl();break;case 3:lr(),Ot(Xn),Ot(xn),Ul();break;case 5:is(y);break;case 4:lr();break;case 13:Ot(yn);break;case 19:Ot(yn);break;case 10:Ll(y);break;case 23:case 24:Ln()}d=d.return}er=o,Pn=tn(o.current,null),Gt=Nr=cs=l,Fn=0,wa=null,li=xo=Ea=0}function qd(o,l){do{var d=Pn;try{if(Pl(),vo.current=zt,Fl){for(var y=on.memoizedState;y!==null;){var S=y.queue;S!==null&&(S.pending=null),y=y.next}Fl=!1}if(xr=0,qn=Zn=on=null,ra=!1,nu.current=null,d===null||d.return===null){Fn=1,wa=l,Pn=null;break}e:{var C=o,j=d.return,H=d,ce=l;if(l=Gt,H.flags|=2048,H.firstEffect=H.lastEffect=null,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var ze=ce;if(!(H.mode&2)){var rt=H.alternate;rt?(H.updateQueue=rt.updateQueue,H.memoizedState=rt.memoizedState,H.lanes=rt.lanes):(H.updateQueue=null,H.memoizedState=null)}var mt=(yn.current&1)!==0,We=j;do{var Yt;if(Yt=We.tag===13){var ln=We.memoizedState;if(ln!==null)Yt=ln.dehydrated!==null;else{var _r=We.memoizedProps;Yt=_r.fallback===void 0?!1:_r.unstable_avoidThisFallback!==!0?!0:!mt}}if(Yt){var te=We.updateQueue;if(te===null){var q=new Set;q.add(ze),We.updateQueue=q}else te.add(ze);if(!(We.mode&2)){if(We.flags|=64,H.flags|=16384,H.flags&=-2981,H.tag===1)if(H.alternate===null)H.tag=17;else{var fe=Si(-1,1);fe.tag=2,xi(H,fe)}H.lanes|=1;break e}ce=void 0,H=l;var He=C.pingCache;if(He===null?(He=C.pingCache=new Mv,ce=new Set,He.set(ze,ce)):(ce=He.get(ze),ce===void 0&&(ce=new Set,He.set(ze,ce))),!ce.has(H)){ce.add(H);var ot=ka.bind(null,C,ze,H);ze.then(ot,ot)}We.flags|=4096,We.lanes=l;break e}We=We.return}while(We!==null);ce=Error((we(H.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
208
-
209
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Fn!==5&&(Fn=2),ce=Rc(ce,H),We=j;do{switch(We.tag){case 3:C=ce,We.flags|=4096,l&=-l,We.lanes|=l;var Qt=Id(We,C,l);zi(We,Qt);break e;case 1:C=ce;var gt=We.type,Ut=We.stateNode;if(!(We.flags&64)&&(typeof gt.getDerivedStateFromError=="function"||Ut!==null&&typeof Ut.componentDidCatch=="function"&&(Qn===null||!Qn.has(Ut)))){We.flags|=4096,l&=-l,We.lanes|=l;var Dn=Ud(We,C,l);zi(We,Dn);break e}}We=We.return}while(We!==null)}Ro(d)}catch(At){l=At,Pn===d&&d!==null&&(Pn=d=d.return);continue}break}while(!0)}function Zr(){var o=Us.current;return Us.current=zt,o===null?zt:o}function Aa(o,l){var d=ct;ct|=16;var y=Zr();er===o&&Gt===l||dr(o,l);do try{Hs();break}catch(S){qd(o,S)}while(!0);if(Pl(),ct=d,Us.current=y,Pn!==null)throw Error(p(261));return er=null,Gt=0,Fn}function Hs(){for(;Pn!==null;)Co(Pn)}function Ma(){for(;Pn!==null&&!wv();)Co(Pn)}function Co(o){var l=Vs(o.alternate,o,Nr);o.memoizedProps=o.pendingProps,l===null?Ro(o):Pn=l,nu.current=null}function Ro(o){var l=o;do{var d=l.alternate;if(o=l.return,l.flags&2048){if(d=_d(l),d!==null){d.flags&=2047,Pn=d;return}o!==null&&(o.firstEffect=o.lastEffect=null,o.flags|=2048)}else{if(d=jd(d,l,Nr),d!==null){Pn=d;return}if(d=l,d.tag!==24&&d.tag!==23||d.memoizedState===null||Nr&1073741824||!(d.mode&4)){for(var y=0,S=d.child;S!==null;)y|=S.lanes|S.childLanes,S=S.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){Pn=l;return}Pn=l=o}while(l!==null);Fn===0&&(Fn=5)}function ci(o){var l=co();return ki(99,Pa.bind(null,o,l)),null}function Pa(o,l){do hr();while(Eo!==null);if(ct&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,S=y,C=o.pendingLanes&~S;o.pendingLanes=S,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=S,o.mutableReadLanes&=S,o.entangledLanes&=S,S=o.entanglements;for(var j=o.eventTimes,H=o.expirationTimes;0<C;){var ce=31-ts(C),ze=1<<ce;S[ce]=0,j[ce]=-1,H[ce]=-1,C&=~ze}if(Vt!==null&&!(y&24)&&Vt.has(o)&&Vt.delete(o),o===er&&(Pn=er=null,Gt=0),1<d.flags?d.lastEffect!==null?(d.lastEffect.nextEffect=d,y=d.firstEffect):y=d:y=d.firstEffect,y!==null){S=ct,ct|=32,nu.current=null,Ra=Re(o.containerInfo),Oa=!1,Ye=y;do try{La()}catch(q){if(Ye===null)throw Error(p(330));di(Ye,q),Ye=Ye.nextEffect}while(Ye!==null);Ra=null,Ye=y;do try{for(j=o;Ye!==null;){var rt=Ye.flags;if(rt&16&&qe&&Ct(Ye.stateNode),rt&128){var mt=Ye.alternate;if(mt!==null){var We=mt.ref;We!==null&&(typeof We=="function"?We(null):We.current=null)}}switch(rt&1038){case 2:Bd(Ye),Ye.flags&=-3;break;case 6:Bd(Ye),Ye.flags&=-3,Kl(Ye.alternate,Ye);break;case 1024:Ye.flags&=-1025;break;case 1028:Ye.flags&=-1025,Kl(Ye.alternate,Ye);break;case 4:Kl(Ye.alternate,Ye);break;case 8:H=j,C=Ye,qe?Hd(H,C):It(H,C);var Yt=C.alternate;va(C),Yt!==null&&va(Yt)}Ye=Ye.nextEffect}}catch(q){if(Ye===null)throw Error(p(330));di(Ye,q),Ye=Ye.nextEffect}while(Ye!==null);Oa&&Me(),Ie(o.containerInfo),o.current=d,Ye=y;do try{for(rt=o;Ye!==null;){var ln=Ye.flags;if(ln&36&&Lv(rt,Ye.alternate,Ye),ln&128){mt=void 0;var _r=Ye.ref;if(_r!==null){var te=Ye.stateNode;switch(Ye.tag){case 5:mt=it(te);break;default:mt=te}typeof _r=="function"?_r(mt):_r.current=mt}}Ye=Ye.nextEffect}}catch(q){if(Ye===null)throw Error(p(330));di(Ye,q),Ye=Ye.nextEffect}while(Ye!==null);Ye=null,Tv(),ct=S}else o.current=d;if(fs)fs=!1,Eo=o,tr=l;else for(Ye=y;Ye!==null;)l=Ye.nextEffect,Ye.nextEffect=null,Ye.flags&8&&(ln=Ye,ln.sibling=null,ln.stateNode=null),Ye=l;if(y=o.pendingLanes,y===0&&(Qn=null),y===1?o===Bi?Bn++:(Bn=0,Bi=o):Bn=0,d=d.stateNode,Wr&&typeof Wr.onCommitFiberRoot=="function")try{Wr.onCommitFiberRoot(ic,d,void 0,(d.current.flags&64)===64)}catch{}if(zr(o,Un()),Ca)throw Ca=!1,o=ui,ui=null,o;return ct&8||$r(),null}function La(){for(;Ye!==null;){var o=Ye.alternate;Oa||Ra===null||(Ye.flags&8?Oe(Ye,Ra)&&(Oa=!0,Z()):Ye.tag===13&&kv(o,Ye)&&Oe(Ye,Ra)&&(Oa=!0,Z()));var l=Ye.flags;l&256&&fr(o,Ye),!(l&512)||fs||(fs=!0,fo(97,function(){return hr(),null})),Ye=Ye.nextEffect}}function hr(){if(tr!==90){var o=97<tr?97:tr;return tr=90,ki(o,fi)}return!1}function au(o,l){su.push(l,o),fs||(fs=!0,fo(97,function(){return hr(),null}))}function kc(o,l){an.push(l,o),fs||(fs=!0,fo(97,function(){return hr(),null}))}function fi(){if(Eo===null)return!1;var o=Eo;if(Eo=null,ct&48)throw Error(p(331));var l=ct;ct|=32;var d=an;an=[];for(var y=0;y<d.length;y+=2){var S=d[y],C=d[y+1],j=S.destroy;if(S.destroy=void 0,typeof j=="function")try{j()}catch(ce){if(C===null)throw Error(p(330));di(C,ce)}}for(d=su,su=[],y=0;y<d.length;y+=2){S=d[y],C=d[y+1];try{var H=S.create;S.destroy=H()}catch(ce){if(C===null)throw Error(p(330));di(C,ce)}}for(H=o.current.firstEffect;H!==null;)o=H.nextEffect,H.nextEffect=null,H.flags&8&&(H.sibling=null,H.stateNode=null),H=o;return ct=l,$r(),!0}function Da(o,l,d){l=Rc(d,l),l=Id(o,l,1),xi(o,l),l=Tr(),o=Fs(o,1),o!==null&&(El(o,1,l),zr(o,l))}function di(o,l){if(o.tag===3)Da(o,o,l);else for(var d=o.return;d!==null;){if(d.tag===3){Da(d,o,l);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Qn===null||!Qn.has(y))){o=Rc(l,o);var S=Ud(d,o,1);if(xi(d,S),S=Tr(),d=Fs(d,1),d!==null)El(d,1,S),zr(d,S);else if(typeof y.componentDidCatch=="function"&&(Qn===null||!Qn.has(y)))try{y.componentDidCatch(l,o)}catch{}break}}d=d.return}}function ka(o,l,d){var y=o.pingCache;y!==null&&y.delete(l),l=Tr(),o.pingedLanes|=o.suspendedLanes&d,er===o&&(Gt&d)===d&&(Fn===4||Fn===3&&(Gt&62914560)===Gt&&500>Un()-Ta?dr(o,0):li|=d),zr(o,l)}function lu(o,l){var d=o.stateNode;d!==null&&d.delete(l),l=0,l===0&&(l=o.mode,l&2?l&4?(Hi===0&&(Hi=cs),l=uo(62914560&~Hi),l===0&&(l=4194304)):l=co()===99?1:2:l=1),d=Tr(),o=Fs(o,l),o!==null&&(El(o,l,d),zr(o,d))}var Vs;Vs=function(o,l,d){var y=l.lanes;if(o!==null)if(o.memoizedProps!==l.pendingProps||Xn.current)Xr=!0;else if(d&y)Xr=!!(o.flags&16384);else{switch(Xr=!1,l.tag){case 3:Ql(l),vc();break;case 5:jl(l);break;case 1:dn(l.type)&&Qo(l);break;case 4:ai(l,l.stateNode.containerInfo);break;case 10:dc(l,l.memoizedProps.value);break;case 13:if(l.memoizedState!==null)return d&l.child.childLanes?bn(o,l,d):(Sn(yn,yn.current&1),l=Fi(o,l,d),l!==null?l.sibling:null);Sn(yn,yn.current&1);break;case 19:if(y=(d&l.childLanes)!==0,o.flags&64){if(y)return zd(o,l,d);l.flags|=64}var S=l.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Sn(yn,yn.current),y)break;return null;case 23:case 24:return l.lanes=0,yo(o,l,d)}return Fi(o,l,d)}else Xr=!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,S=yi(l,xn.current),Ls(l,d),S=Bl(null,l,y,o,S,d),l.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0){if(l.tag=1,l.memoizedState=null,l.updateQueue=null,dn(y)){var C=!0;Qo(l)}else C=!1;l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Yr(l);var j=y.getDerivedStateFromProps;typeof j=="function"&&ho(l,y,j,o),S.updater=Dl,l.stateNode=S,S._reactInternals=l,Nl(l,y,o,d),l=Yl(null,l,y,!0,C,d)}else l.tag=0,cr(null,l,S,d),l=l.child;return l;case 16:S=l.elementType;e:{switch(o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),o=l.pendingProps,C=S._init,S=C(S._payload),l.type=S,C=l.tag=Ao(S),o=si(S,o),C){case 0:l=fa(null,l,S,o,d);break e;case 1:l=xc(null,l,S,o,d);break e;case 11:l=ql(null,l,S,o,d);break e;case 14:l=Sc(null,l,S,si(S.type,o),y,d);break e}throw Error(p(306,S,""))}return l;case 0:return y=l.type,S=l.pendingProps,S=l.elementType===y?S:si(y,S),fa(o,l,y,S,d);case 1:return y=l.type,S=l.pendingProps,S=l.elementType===y?S:si(y,S),xc(o,l,y,S,d);case 3:if(Ql(l),y=l.updateQueue,o===null||y===null)throw Error(p(282));if(y=l.pendingProps,S=l.memoizedState,S=S!==null?S.element:null,oi(o,l),Ds(l,y,null,d),y=l.memoizedState.element,y===S)vc(),l=Fi(o,l,d);else{if(S=l.stateNode,(C=S.hydrate)&&(wt?(Kn=xe(l.stateNode.containerInfo),Gr=l,C=Dr=!0):C=!1),C){if(wt&&(o=S.mutableSourceEagerHydrationData,o!=null))for(S=0;S<o.length;S+=2)C=o[S],j=o[S+1],ke?C._workInProgressVersionPrimary=j:C._workInProgressVersionSecondary=j,Ns.push(C);for(d=wi(l,null,y,d),l.child=d;d;)d.flags=d.flags&-3|1024,d=d.sibling}else cr(o,l,y,d),vc();l=l.child}return l;case 5:return jl(l),o===null&&Il(l),y=l.type,S=l.pendingProps,C=o!==null?o.memoizedProps:null,j=S.children,yt(y,S)?j=null:C!==null&&yt(y,C)&&(l.flags|=16),Is(o,l),cr(o,l,j,d),l.child;case 6:return o===null&&Il(l),null;case 13:return bn(o,l,d);case 4:return ai(l,l.stateNode.containerInfo),y=l.pendingProps,o===null?l.child=ks(l,null,y,d):cr(o,l,y,d),l.child;case 11:return y=l.type,S=l.pendingProps,S=l.elementType===y?S:si(y,S),ql(o,l,y,S,d);case 7:return cr(o,l,l.pendingProps,d),l.child;case 8:return cr(o,l,l.pendingProps.children,d),l.child;case 12:return cr(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(y=l.type._context,S=l.pendingProps,j=l.memoizedProps,C=S.value,dc(l,C),j!==null){var H=j.value;if(C=qr(H,C)?0:(typeof y._calculateChangedBits=="function"?y._calculateChangedBits(H,C):1073741823)|0,C===0){if(j.children===S.children&&!Xn.current){l=Fi(o,l,d);break e}}else for(H=l.child,H!==null&&(H.return=l);H!==null;){var ce=H.dependencies;if(ce!==null){j=H.child;for(var ze=ce.firstContext;ze!==null;){if(ze.context===y&&ze.observedBits&C){H.tag===1&&(ze=Si(-1,d&-d),ze.tag=2,xi(H,ze)),H.lanes|=d,ze=H.alternate,ze!==null&&(ze.lanes|=d),hc(H.return,d),ce.lanes|=d;break}ze=ze.next}}else j=H.tag===10&&H.type===l.type?null:H.child;if(j!==null)j.return=H;else for(j=H;j!==null;){if(j===l){j=null;break}if(H=j.sibling,H!==null){H.return=j.return,j=H;break}j=j.return}H=j}}cr(o,l,S.children,d),l=l.child}return l;case 9:return S=l.type,C=l.pendingProps,y=C.children,Ls(l,d),S=Lr(S,C.unstable_observedBits),y=y(S),l.flags|=1,cr(o,l,y,d),l.child;case 14:return S=l.type,C=si(S,l.pendingProps),C=si(S.type,C),Sc(o,l,S,C,y,d);case 15:return _s(o,l,l.type,l.pendingProps,y,d);case 17:return y=l.type,S=l.pendingProps,S=l.elementType===y?S:si(y,S),o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,dn(y)?(o=!0,Qo(l)):o=!1,Ls(l,d),Dd(l,y,S),Nl(l,y,S,d),Yl(null,l,y,!0,o,d);case 19:return zd(o,l,d);case 23:return yo(o,l,d);case 24:return yo(o,l,d)}throw Error(p(156,l.tag))};var Ws={current:!1},Oo=f.unstable_flushAllWithoutAsserting,Na=typeof Oo=="function";function uu(){if(Oo!==void 0)return Oo();for(var o=!1;hr();)o=!0;return o}function Nc(o){try{uu(),Lc(function(){uu()?Nc(o):o()})}catch(l){o(l)}}var za=0,cu=!1;function zv(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 jr(o,l,d,y){return new zv(o,l,d,y)}function zc(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Ao(o){if(typeof o=="function")return zc(o)?1:0;if(o!=null){if(o=o.$$typeof,o===P)return 11;if(o===F)return 14}return 2}function tn(o,l){var d=o.alternate;return d===null?(d=jr(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 ja(o,l,d,y,S,C){var j=2;if(y=o,typeof o=="function")zc(o)&&(j=1);else if(typeof o=="string")j=5;else e:switch(o){case w:return $s(d.children,S,C,l);case _:j=8,S|=16;break;case R:j=8,S|=1;break;case D:return o=jr(12,d,l,S|8),o.elementType=D,o.type=D,o.lanes=C,o;case L:return o=jr(13,d,l,S),o.type=L,o.elementType=L,o.lanes=C,o;case A:return o=jr(19,d,l,S),o.elementType=A,o.lanes=C,o;case K:return Mo(d,S,C,l);case ee:return o=jr(24,d,l,S),o.elementType=ee,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:j=10;break e;case z:j=9;break e;case P:j=11;break e;case F:j=14;break e;case $:j=16,y=null;break e;case Q:j=22;break e}throw Error(p(130,o==null?o:typeof o,""))}return l=jr(j,d,l,S),l.elementType=o,l.type=y,l.lanes=C,l}function $s(o,l,d,y){return o=jr(7,o,y,l),o.lanes=d,o}function Mo(o,l,d,y){return o=jr(23,o,y,l),o.elementType=K,o.lanes=d,o}function _a(o,l,d){return o=jr(6,o,null,l),o.lanes=d,o}function Po(o,l,d){return l=jr(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function jc(o,l,d){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ht,this.pendingContext=this.context=null,this.hydrate=d,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=sc(0),this.expirationTimes=sc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sc(0),wt&&(this.mutableSourceEagerHydrationData=null)}function Ia(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=Be(l),o===null?null:o.stateNode}function fu(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function Ua(o,l){fu(o,l),(o=o.alternate)&&fu(o,l)}function ds(o){return o=Be(o),o===null?null:o.stateNode}function hs(){return null}return i.IsThisRendererActing=Ws,i.act=function(o){function l(){za--,ru.current=d,Ws.current=y}cu===!1&&(cu=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),za++;var d=ru.current,y=Ws.current;ru.current=!0,Ws.current=!0;try{var S=Wd(o)}catch(C){throw l(),C}if(S!==null&&typeof S=="object"&&typeof S.then=="function")return{then:function(C,j){S.then(function(){1<za||Na===!0&&d===!0?(l(),C()):Nc(function(H){l(),H?j(H):C()})},function(H){l(),j(H)})}};try{za!==1||Na!==!1&&d!==!1||uu(),l()}catch(C){throw l(),C}return{then:function(C){C()}}},i.attemptContinuousHydration=function(o){if(o.tag===13){var l=Tr();Vi(o,67108864,l),Ua(o,67108864)}},i.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var l=Tr(),d=zn(o);Vi(o,d,l),Ua(o,d)}},i.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.hydrate){var d=ii(l.pendingLanes);l.expiredLanes|=d&l.pendingLanes,zr(l,Un()),!(ct&48)&&(hn(),$r())}break;case 13:var y=Tr();$d(function(){return Vi(o,1,y)}),Ua(o,4)}},i.attemptUserBlockingHydration=function(o){if(o.tag===13){var l=Tr();Vi(o,4,l),Ua(o,4)}},i.batchedEventUpdates=function(o,l){var d=ct;ct|=2;try{return o(l)}finally{ct=d,ct===0&&(hn(),$r())}},i.batchedUpdates=Wd,i.createComponentSelector=function(o){return{$$typeof:ga,value:o}},i.createContainer=function(o,l,d){return o=new jc(o,l,d),l=jr(3,null,null,l===2?7:l===1?3:0),o.current=l,l.stateNode=o,Yr(l),o},i.createHasPsuedoClassSelector=function(o){return{$$typeof:Jl,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:eu,value:o}},i.createTestNameSelector=function(o){return{$$typeof:ya,value:o}},i.createTextSelector=function(o){return{$$typeof:tu,value:o}},i.deferredUpdates=function(o){return ki(97,o)},i.discreteUpdates=function(o,l,d,y,S){var C=ct;ct|=4;try{return ki(98,o.bind(null,l,d,y,S))}finally{ct=C,ct===0&&(hn(),$r())}},i.findAllNodes=Pc,i.findBoundingRects=function(o,l){if(!et)throw Error(p(363));l=Pc(o,l),o=[];for(var d=0;d<l.length;d++)o.push(mn(l[d]));for(l=o.length-1;0<l;l--){d=o[l];for(var y=d.x,S=y+d.width,C=d.y,j=C+d.height,H=l-1;0<=H;H--)if(l!==H){var ce=o[H],ze=ce.x,rt=ze+ce.width,mt=ce.y,We=mt+ce.height;if(y>=ze&&C>=mt&&S<=rt&&j<=We){o.splice(l,1);break}else if(y!==ze||d.width!==ce.width||We<C||mt>j){if(!(C!==mt||d.height!==ce.height||rt<y||ze>S)){ze>y&&(ce.width+=ze-y,ce.x=y),rt<S&&(ce.width=S-ze),o.splice(l,1);break}}else{mt>C&&(ce.height+=mt-C,ce.y=C),We<j&&(ce.height=j-mt),o.splice(l,1);break}}}return o},i.findHostInstance=Ia,i.findHostInstanceWithNoPortals=function(o){return o=vt(o),o===null?null:o.tag===20?o.stateNode.instance:o.stateNode},i.findHostInstanceWithWarning=function(o){return Ia(o)},i.flushControlled=function(o){var l=ct;ct|=1;try{ki(99,o)}finally{ct=l,ct===0&&(hn(),$r())}},i.flushDiscreteUpdates=function(){!(ct&49)&&(To(),hr())},i.flushPassiveEffects=hr,i.flushSync=$d,i.focusWithin=function(o,l){if(!et)throw Error(p(363));for(o=Oc(o),l=Mc(o,l),l=Array.from(l),o=0;o<l.length;){var d=l[o++];if(!oe(d)){if(d.tag===5&&de(d.stateNode))return!0;for(d=d.child;d!==null;)l.push(d),d=d.sibling}}return!1},i.getCurrentUpdateLanePriority=function(){return xl},i.getFindAllNodesFailureDescription=function(o,l){if(!et)throw Error(p(363));var d=0,y=[];o=[Oc(o),0];for(var S=0;S<o.length;){var C=o[S++],j=o[S++],H=l[j];if((C.tag!==5||!oe(C))&&(Ac(C,H)&&(y.push(Sa(H)),j++,j>d&&(d=j)),j<l.length))for(C=C.child;C!==null;)o.push(C,j),C=C.sibling}if(d<l.length){for(o=[];d<l.length;d++)o.push(Sa(l[d]));return`findAllNodes was able to match part of the selector:
210
- `+(y.join(" > ")+`
211
-
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 it(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:ds,findFiberByHostInstance:o.findFiberByHostInstance||hs,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{ic=l.inject(o),Wr=l}catch{}o=!0}return o},i.observeVisibleRects=function(o,l,d,y){if(!et)throw Error(p(363));o=Pc(o,l);var S=le(o,d,y).disconnect;return{disconnect:function(){S()}}},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=xl;try{return xl=o,l()}finally{xl=d}},i.shouldSuspend=function(){return!1},i.unbatchedUpdates=function(o,l){var d=ct;ct&=-2,ct|=8;try{return o(l)}finally{ct=d,ct===0&&(hn(),$r())}},i.updateContainer=function(o,l,d,y){var S=l.current,C=Tr(),j=zn(S);e:if(d){d=d._reactInternals;t:{if(Ee(d)!==d||d.tag!==1)throw Error(p(170));var H=d;do{switch(H.tag){case 3:H=H.stateNode.context;break t;case 1:if(dn(H.type)){H=H.stateNode.__reactInternalMemoizedMergedChildContext;break t}}H=H.return}while(H!==null);throw Error(p(171))}if(d.tag===1){var ce=d.type;if(dn(ce)){d=Ed(d,ce,H);break e}}d=H}else d=gi;return l.context===null?l.context=d:l.pendingContext=d,l=Si(C,j),l.payload={element:o},y=y===void 0?null:y,y!==null&&(l.callback=y),xi(S,l),Vi(S,j,C),j},i}}(gf)),gf.exports}process.env.NODE_ENV==="production"?ep.exports=rw():ep.exports=nw();var iw=ep.exports;const sw=Qx(iw),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 ow(){return yf.reduce((t,e)=>(t[e]=[],t),{})}const rl=yf.reduce((t,e)=>(t[e.slice(2).toLowerCase()]=e,t[e]=e,t),{}),Ru=(t,e,n)=>{const i=t.length,a=n||lt(i);for(let c=0;c<i;c++)a[c]=c%5===0?t[c+1]<e[3]&&t[c+3]>e[1]&&t[c+2]<e[4]&&t[c+4]>e[2]?1:0:t[c];return a};function lt(t,e,n){return new Float32Array(t,e,n)}const aw=(t,e,n)=>{const i=t[1]<=e[3]&&t[3]>=e[1]&&t[2]<=e[4]&&t[4]>=e[2],a=n||lt(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)},lw=t=>t.length/5,xs=(t,e,n)=>{const i=n||lt(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 kt{constructor(e){this.index=0,this.length=e,this.points=lt(this.length)}static grid(e=1,n=1){return new kt(5*e*n)}static point(e,n){const i=lt(5);return i[0]=1,i[1]=e,i[2]=n,i[3]=e,i[4]=n,i}static positionPair(e){const n=lt(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 kt.singleBox(e.width,e.height,e.x,e.y)}static singleBox(e,n,i=0,a=0){const c=lt(5);return c[0]=1,c[1]=i,c[2]=a,c[3]=e+i,c[4]=n+a,c}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 Gi=(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},eo=t=>{const e=lt(9);return e[0]=t,e[4]=t,e[8]=1,e},Rr=(t,e)=>{const n=lt(9);return n[0]=1,n[2]=t,n[4]=1,n[5]=e,n[8]=1,n},Ou=(t,e,n)=>xs(Rr((1-t)*e,(1-t)*n),eo(t)),ws=(t,e,n)=>{const i=t.length,a=n&&n.length>=i?n.slice(0,i):lt(i);for(let c=0;c<i;c++)a[c]=c%5===0?e[6]*t[c+1]+e[7]*t[c+2]+e[8]*t[c]:c%5%2===1?e[0]*t[c]+e[1]*t[c+1]+e[2]:e[3]*t[c-1]+e[4]*t[c]+e[5];return a};let bf=(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 Xi{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=bf(),this.eventHandlers=ow()}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 c=!1;if(a)for(let f=0;f<a;f++)try{i[f](n),c=!0}catch(p){console.error(e,p)}return c}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){Gi(this.points,Rr(e,n))}atScale(e){Gi(this.points,Ou(e,this.x,this.y)),this.scale*=e}transform(e){Gi(this.points,e)}applyProps(e){this.__revision++}appendChild(e){}removeChild(e){}insertBefore(e,n){}hideInstance(){}}class Mi extends Xi{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:lt(5)},this.points=lt(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=kt.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:kt.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(kt.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=kt.singleBox(e.crop.width,e.crop.height,e.crop.x,e.crop.y);Gi(a,Rr(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(a):this.crop=lt(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=kt.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=kt.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 Mi.fromImage("data:image/svg+xml;base64,"+btoa(e),n,i,a)}static fromImage(e,n,i,a){const c=new Mi;return c.applyProps({uri:e,id:a,display:i,target:n}),c}getImageUrl(){return this.uri}}class sp extends Xi{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:lt(5)},this.points=lt(5);else{const n=e.scale||1;this.id=e.id||e.uri,this.uri=e.uri,this.points=kt.singleBox(e.width,e.height),this.display={x:0,y:0,scale:n,width:e.width/n,height:e.height/n,points:n!==1?kt.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(kt.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?kt.singleBox(e.target.width/i,e.target.height/i):this.points}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}function uw(t,e,n=1){const i=e.length;if(i===0)throw new Error("No resources passed in.");let a=0;for(let c=0;c<i&&!(!e[c]||!e[c].display);c++)a=Math.abs(e[c].display.scale-t)*n<Math.abs(e[a].display.scale-t)?c:a;return a}function _g(t,e){return Math.abs(t-e)}function Sf(t,e){const n=_g(t.x,e.x),i=_g(t.y,e.y);return Math.sqrt(Math.pow(n,2)+Math.pow(i,2))}function cw(t){const e=t.length;return t.indexOf("/info.json")===e-10?t.slice(0,-10):t}function Ig(...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 ve.useCallback(Ig(...t),t)}function mr(){return mr=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},mr.apply(this,arguments)}const Ug=ve.forwardRef((t,e)=>{const{children:n,...i}=t;return ve.Children.toArray(n).some(Bg)?ve.createElement(ve.Fragment,null,ve.Children.map(n,a=>Bg(a)?ve.createElement(op,mr({},i,{ref:e}),a.props.children):a)):ve.createElement(op,mr({},i,{ref:e}),n)});Ug.displayName="Slot";const op=ve.forwardRef((t,e)=>{const{children:n,...i}=t;return ve.isValidElement(n)?ve.cloneElement(n,{...fw(i,n.props),ref:Ig(e,n.ref)}):ve.Children.count(n)>1?ve.Children.only(null):null});op.displayName="SlotClone";const Fg=({children:t})=>ve.createElement(ve.Fragment,null,t);function Bg(t){return ve.isValidElement(t)&&t.type===Fg}function fw(t,e){const n={...e};for(const i in e){const a=t[i],c=e[i];/^on[A-Z]/.test(i)?n[i]=(...f)=>{c==null||c(...f),a==null||a(...f)}:i==="style"?n[i]={...a,...c}:i==="className"&&(n[i]=[a,c].filter(Boolean).join(" "))}return{...t,...n}}const wf=globalThis!=null&&globalThis.document?ve.useLayoutEffect:()=>{};var Ef=function(e,n,i,a){this.name=e,this.fn=n,this.args=i,this.modifiers=a};Ef.prototype._test=function(e){var n=this.fn;try{il(this.modifiers.slice(),n,this)(e)}catch{n=function(){return!1}}try{return il(this.modifiers.slice(),n,this)(e)}catch{return!1}},Ef.prototype._check=function(e){try{il(this.modifiers.slice(),this.fn,this)(e)}catch{if(il(this.modifiers.slice(),function(i){return i},this)(!1))return}if(!il(this.modifiers.slice(),this.fn,this)(e))throw null},Ef.prototype._testAsync=function(e){var n=this;return new Promise(function(i,a){Vg(n.modifiers.slice(),n.fn,n)(e).then(function(c){c?i(e):a(null)}).catch(function(c){return a(c)})})};function Hg(t,e){return e===void 0&&(e="simple"),typeof t=="object"?t[e]:t}function il(t,e,n){if(t.length){var i=t.shift(),a=il(t,e,n);return i.perform(a,n)}else return Hg(e)}function Vg(t,e,n){if(t.length){var i=t.shift(),a=Vg(t,e,n);return i.performAsync(a,n)}else return function(c){return Promise.resolve(Hg(e,"async")(c))}}var dw=function(e,n,i){this.name=e,this.perform=n,this.performAsync=i},ap=function(t){function e(n,i,a,c){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=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Ki=function(e,n){e===void 0&&(e=[]),n===void 0&&(n=[]),this.chain=e,this.nextRuleModifiers=n};Ki.prototype._applyRule=function(e,n){var i=this;return function(){for(var a=[],c=arguments.length;c--;)a[c]=arguments[c];return i.chain.push(new Ef(n,e.apply(i,a),a,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}},Ki.prototype._applyModifier=function(e,n){return this.nextRuleModifiers.push(new dw(n,e.simple,e.async)),this},Ki.prototype._clone=function(){return new Ki(this.chain.slice(),this.nextRuleModifiers.slice())},Ki.prototype.test=function(e){return this.chain.every(function(n){return n._test(e)})},Ki.prototype.testAll=function(e){var n=[];return this.chain.forEach(function(i){try{i._check(e)}catch(a){n.push(new ap(i,e,a))}}),n},Ki.prototype.check=function(e){this.chain.forEach(function(n){try{n._check(e)}catch(i){throw new ap(n,e,i)}})},Ki.prototype.testAsync=function(e){var n=this;return new Promise(function(i,a){Wg(e,n.chain.slice(),i,a)})};function Wg(t,e,n,i){if(e.length){var a=e.shift();a._testAsync(t).then(function(){Wg(t,e,n,i)},function(c){i(new ap(a,t,c))})}else n(t)}var $g=function(t,e){return e&&typeof t=="string"&&t.trim().length===0?!0:t==null};function hw(t,e){return e===void 0&&(e=!1),{simple:function(n){return $g(n,e)||t.check(n)===void 0},async:function(n){return $g(n,e)||t.testAsync(n)}}}function to(){return typeof Proxy<"u"?qg(new Ki):lp(new Ki)}var Au={};to.extend=function(t){Object.assign(Au,t)},to.clearCustomRules=function(){Au={}};function qg(t){return new Proxy(t,{get:function(n,i){if(i in n)return n[i];var a=qg(t._clone());if(i in Tf)return a._applyModifier(Tf[i],i);if(i in Au)return a._applyRule(Au[i],i);if(i in up)return a._applyRule(up[i],i)}})}function lp(t){var e=function(a,c){return Object.keys(a).forEach(function(f){c[f]=function(){for(var p=[],g=arguments.length;g--;)p[g]=arguments[g];var x=lp(c._clone()),m=x._applyRule(a[f],f).apply(void 0,p);return m}}),c},n=e(up,t),i=e(Au,n);return Object.keys(Tf).forEach(function(a){Object.defineProperty(i,a,{get:function(){var c=lp(i._clone());return c._applyModifier(Tf[a],a)}})}),i}var Tf={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 Cf(e).some(function(n){try{return t(n)}catch{return!1}})}},async:function(t){return function(e){return Promise.all(Cf(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&&Cf(e).every(t)}},async:function(t){return function(e){return Promise.all(Cf(e).map(t)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(t,e){return function(n){return Yg(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 Yg(e)&&n&&typeof n=="object"?Object.keys(e.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function Yg(t){return t&&t.name==="schema"&&t.args.length>0&&typeof t.args[0]=="object"}function Cf(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||pw;return e(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return sl("string")},boolean:function(){return sl("boolean")},undefined:function(){return sl("undefined")},null:function(){return sl("null")},array:function(){return sl("array")},object:function(){return sl("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 vw(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:hw};function sl(t){return function(e){return Array.isArray(e)&&t==="array"||e===null&&t==="null"||typeof e===t}}function pw(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function vw(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach(function(i){var a=t[i];try{a.check((e||{})[i])}catch(c){c.target=i,n.push(c)}}),n.length>0)throw n;return!0},async:function(e){var n=[],i=Object.keys(t).map(function(a){var c=t[a];return c.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 nn="colors",Or="sizes",Ze="space",mw={gap:Ze,gridGap:Ze,columnGap:Ze,gridColumnGap:Ze,rowGap:Ze,gridRowGap:Ze,inset:Ze,insetBlock:Ze,insetBlockEnd:Ze,insetBlockStart:Ze,insetInline:Ze,insetInlineEnd:Ze,insetInlineStart:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,marginBlock:Ze,marginBlockEnd:Ze,marginBlockStart:Ze,marginInline:Ze,marginInlineEnd:Ze,marginInlineStart:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,paddingBlock:Ze,paddingBlockEnd:Ze,paddingBlockStart:Ze,paddingInline:Ze,paddingInlineEnd:Ze,paddingInlineStart:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,scrollMargin:Ze,scrollMarginTop:Ze,scrollMarginRight:Ze,scrollMarginBottom:Ze,scrollMarginLeft:Ze,scrollMarginX:Ze,scrollMarginY:Ze,scrollMarginBlock:Ze,scrollMarginBlockEnd:Ze,scrollMarginBlockStart:Ze,scrollMarginInline:Ze,scrollMarginInlineEnd:Ze,scrollMarginInlineStart:Ze,scrollPadding:Ze,scrollPaddingTop:Ze,scrollPaddingRight:Ze,scrollPaddingBottom:Ze,scrollPaddingLeft:Ze,scrollPaddingX:Ze,scrollPaddingY:Ze,scrollPaddingBlock:Ze,scrollPaddingBlockEnd:Ze,scrollPaddingBlockStart:Ze,scrollPaddingInline:Ze,scrollPaddingInlineEnd:Ze,scrollPaddingInlineStart:Ze,fontSize:"fontSizes",background:nn,backgroundColor:nn,backgroundImage:nn,borderImage:nn,border:nn,borderBlock:nn,borderBlockEnd:nn,borderBlockStart:nn,borderBottom:nn,borderBottomColor:nn,borderColor:nn,borderInline:nn,borderInlineEnd:nn,borderInlineStart:nn,borderLeft:nn,borderLeftColor:nn,borderRight:nn,borderRightColor:nn,borderTop:nn,borderTopColor:nn,caretColor:nn,color:nn,columnRuleColor:nn,fill:nn,outline:nn,outlineColor:nn,stroke:nn,textDecorationColor:nn,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:Or,minBlockSize:Or,maxBlockSize:Or,inlineSize:Or,minInlineSize:Or,maxInlineSize:Or,width:Or,minWidth:Or,maxWidth:Or,height:Or,minHeight:Or,maxHeight:Or,flexBasis:Or,gridTemplateColumns:Or,gridTemplateRows:Or,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"},gw=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,ol=()=>{const t=Object.create(null);return(e,n,...i)=>{const a=(c=>JSON.stringify(c,gw))(e);return a in t?t[a]:t[a]=n(e,...i)}},Uo=Symbol.for("sxs.internal"),cp=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),Qg=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:yw}=Object.prototype,fp=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),bw=/\s+(?![^()]*\))/,al=t=>e=>t(...typeof e=="string"?String(e).split(bw):[e]),Gg={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:al((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:al((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:al((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:al((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:al((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:al((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},dp=/([\d.]+)([^]*)/,Sw=(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,xw=(t,e)=>t in ww&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,a,c)=>i+(a==="stretch"?`-moz-available${c};${fp(t)}:${i}-webkit-fill-available`:`-moz-fit-content${c};${fp(t)}:${i}fit-content`)+c):String(e),ww={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Es=t=>t?t+"-":"",Xg=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,a,c,f,p)=>f=="$"==!!c?i:(a||f=="--"?"calc(":"")+"var(--"+(f==="$"?Es(e)+(p.includes("$")?"":Es(n))+p.replace(/\$/g,"-"):p)+")"+(a||f=="--"?"*"+(a||"")+(c||"1")+")":"")),Ew=/\s*,\s*(?![^()]*\))/,Tw=Object.prototype.toString,ll=(t,e,n,i,a)=>{let c,f,p;const g=(x,m,w)=>{let R,D;const M=z=>{for(R in z){const A=R.charCodeAt(0)===64,F=A&&Array.isArray(z[R])?z[R]:[z[R]];for(D of F){const $=/[A-Z]/.test(L=R)?L:L.replace(/-[^]/g,_=>_[1].toUpperCase()),Q=typeof D=="object"&&D&&D.toString===Tw&&(!i.utils[$]||!m.length);if($ in i.utils&&!Q){const _=i.utils[$];if(_!==f){f=_,M(_(D)),f=null;continue}}else if($ in Gg){const _=Gg[$];if(_!==p){p=_,M(_(D)),p=null;continue}}if(A&&(P=R.slice(1)in i.media?"@media "+i.media[R.slice(1)]:R,R=P.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(_,K,ee,V,ae,ge)=>{const we=dp.test(K),Ee=.0625*(we?-1:1),[Ue,Fe]=we?[V,K]:[K,V];return"("+(ee[0]==="="?"":ee[0]===">"===we?"max-":"min-")+Ue+":"+(ee[0]!=="="&&ee.length===1?Fe.replace(dp,(Be,vt,Oe)=>Number(vt)+Ee*(ee===">"?1:-1)+Oe):Fe)+(ae?") and ("+(ae[0]===">"?"min-":"max-")+Ue+":"+(ae.length===1?ge.replace(dp,(Be,vt,Oe)=>Number(vt)+Ee*(ae===">"?-1:1)+Oe):ge):"")+")"})),Q){const _=A?w.concat(R):[...w],K=A?[...m]:Sw(m,R.split(Ew));c!==void 0&&a(Kg(...c)),c=void 0,g(D,K,_)}else c===void 0&&(c=[[],m,w]),R=A||R.charCodeAt(0)!==36?R:`--${Es(i.prefix)}${R.slice(1).replace(/\$/g,"-")}`,D=Q?D:typeof D=="number"?D&&$ in Cw?String(D)+"px":String(D):Xg(xw($,D??""),i.prefix,i.themeMap[$]),c[0].push(`${A?`${R} `:`${fp(R)}:`}${D}`)}}var P,L};M(x),c!==void 0&&a(Kg(...c)),c=void 0};g(t,e,n)},Kg=(t,e,n)=>`${n.map(i=>`${i}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,Cw={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},Zg=t=>String.fromCharCode(t+(t>25?39:97)),Fo=t=>(e=>{let n,i="";for(n=Math.abs(e);n>52;n=n/52|0)i=Zg(n%52)+i;return Zg(n%52)+i})(((e,n)=>{let i=n.length;for(;i;)e=33*e^n.charCodeAt(--i);return e})(5381,JSON.stringify(t))>>>0),Mu=["themed","global","styled","onevar","resonevar","allvar","inline"],Rw=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},Ow=t=>{let e;const n=()=>{const{cssRules:a}=e.sheet;return[].map.call(a,(c,f)=>{const{cssText:p}=c;let g="";if(p.startsWith("--sxs"))return"";if(a[f-1]&&(g=a[f-1].cssText).startsWith("--sxs")){if(!c.cssRules.length)return"";for(const x in e.rules)if(e.rules[x].group===c)return`--sxs{--sxs:${[...e.rules[x].cache].join(" ")}}${p}`;return c.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 x in p)delete p[x]}const a=Object(t).styleSheets||[];for(const p of a)if(Rw(p)){for(let g=0,x=p.cssRules;x[g];++g){const m=Object(x[g]);if(m.type!==1)continue;const w=Object(x[g+1]);if(w.type!==4)continue;++g;const{cssText:R}=m;if(!R.startsWith("--sxs"))continue;const D=R.slice(14,-3).trim().split(/\s+/),M=Mu[D[0]];M&&(e||(e={sheet:p,reset:i,rules:{},toString:n}),e.rules[M]={group:w,index:g,cache:new Set(D)})}if(e)break}if(!e){const p=(g,x)=>({type:x,cssRules:[],insertRule(m,w){this.cssRules.splice(w,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:c,rules:f}=e;for(let p=Mu.length-1;p>=0;--p){const g=Mu[p];if(!f[g]){const x=Mu[p+1],m=f[x]?f[x].index:c.cssRules.length;c.insertRule("@media{}",m),c.insertRule(`--sxs{--sxs:${p}}`,m),f[g]={group:c.cssRules[m+1],index:m,cache:new Set([p])}}Aw(f[g])}};return i(),e},Aw=t=>{const e=t.group;let n=e.cssRules.length;t.apply=i=>{try{e.insertRule(i,n),++n}catch{}}},Pu=Symbol(),Mw=ol(),Jg=(t,e)=>Mw(t,()=>(...n)=>{let i={type:null,composers:new Set};for(const a of n)if(a!=null)if(a[Uo]){i.type==null&&(i.type=a[Uo].type);for(const c of a[Uo].composers)i.composers.add(c)}else a.constructor!==Object||a.$$typeof?i.type==null&&(i.type=a):i.composers.add(Pw(a,t));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),Lw(t,i,e)}),Pw=({variants:t,compoundVariants:e,defaultVariants:n,...i},a)=>{const c=`${Es(a.prefix)}c-${Fo(i)}`,f=[],p=[],g=Object.create(null),x=[];for(const R in n)g[R]=String(n[R]);if(typeof t=="object"&&t)for(const R in t){m=g,w=R,yw.call(m,w)||(g[R]="undefined");const D=t[R];for(const M in D){const z={[R]:String(M)};String(M)==="undefined"&&x.push(R);const P=D[M],L=[z,P,!Qg(P)];f.push(L)}}var m,w;if(typeof e=="object"&&e)for(const R of e){let{css:D,...M}=R;D=typeof D=="object"&&D||{};for(const P in M)M[P]=String(M[P]);const z=[M,D,!Qg(D)];p.push(z)}return[c,i,f,p,g,x]},Lw=(t,e,n)=>{const[i,a,c,f]=Dw(e.composers),p=typeof e.type=="function"||e.type.$$typeof?(w=>{function R(){for(let D=0;D<R[Pu].length;D++){const[M,z]=R[Pu][D];w.rules[M].apply(z)}return R[Pu]=[],null}return R[Pu]=[],R.rules={},Mu.forEach(D=>R.rules[D]={apply:M=>R[Pu].push([D,M])}),R})(n):null,g=(p||n).rules,x=`.${i}${a.length>1?`:where(.${a.slice(1).join(".")})`:""}`,m=w=>{w=typeof w=="object"&&w||kw;const{css:R,...D}=w,M={};for(const L in c)if(delete D[L],L in w){let A=w[L];typeof A=="object"&&A?M[L]={"@initial":c[L],...A}:(A=String(A),M[L]=A!=="undefined"||f.has(L)?A:c[L])}else M[L]=c[L];const z=new Set([...a]);for(const[L,A,F,$]of e.composers){n.rules.styled.cache.has(L)||(n.rules.styled.cache.add(L),ll(A,[`.${L}`],[],t,K=>{g.styled.apply(K)}));const Q=ey(F,M,t.media),_=ey($,M,t.media,!0);for(const K of Q)if(K!==void 0)for(const[ee,V,ae]of K){const ge=`${L}-${Fo(V)}-${ee}`;z.add(ge);const we=(ae?n.rules.resonevar:n.rules.onevar).cache,Ee=ae?g.resonevar:g.onevar;we.has(ge)||(we.add(ge),ll(V,[`.${ge}`],[],t,Ue=>{Ee.apply(Ue)}))}for(const K of _)if(K!==void 0)for(const[ee,V]of K){const ae=`${L}-${Fo(V)}-${ee}`;z.add(ae),n.rules.allvar.cache.has(ae)||(n.rules.allvar.cache.add(ae),ll(V,[`.${ae}`],[],t,ge=>{g.allvar.apply(ge)}))}}if(typeof R=="object"&&R){const L=`${i}-i${Fo(R)}-css`;z.add(L),n.rules.inline.cache.has(L)||(n.rules.inline.cache.add(L),ll(R,[`.${L}`],[],t,A=>{g.inline.apply(A)}))}for(const L of String(w.className||"").trim().split(/\s+/))L&&z.add(L);const P=D.className=[...z].join(" ");return{type:e.type,className:P,selector:x,props:D,toString:()=>P,deferredInjector:p}};return cp(m,{className:i,selector:x,[Uo]:e,toString:()=>(n.rules.styled.cache.has(i)||m(),i)})},Dw=t=>{let e="";const n=[],i={},a=[];for(const[c,,,,f,p]of t){e===""&&(e=c),n.push(c),a.push(...p);for(const g in f){const x=f[g];(i[g]===void 0||x!=="undefined"||p.includes(x))&&(i[g]=x)}}return[e,n,i,new Set(a)]},ey=(t,e,n,i)=>{const a=[];e:for(let[c,f,p]of t){if(p)continue;let g,x=0,m=!1;for(g in c){const w=c[g];let R=e[g];if(R!==w){if(typeof R!="object"||!R)continue e;{let D,M,z=0;for(const P in R){if(w===String(R[P])){if(P!=="@initial"){const L=P.slice(1);(M=M||[]).push(L in n?n[L]:P.replace(/^@media ?/,"")),m=!0}x+=z,D=!0}++z}if(M&&M.length&&(f={["@media "+M.join(", ")]:f}),!D)continue e}}}(a[x]=a[x]||[]).push([i?"cv":`${g}-${c[g]}`,f,m])}return a},kw={},Nw=ol(),zw=(t,e)=>Nw(t,()=>(...n)=>{const i=()=>{for(let a of n){a=typeof a=="object"&&a||{};let c=Fo(a);if(!e.rules.global.cache.has(c)){if(e.rules.global.cache.add(c),"@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 cp(i,{toString:i})}),jw=ol(),_w=(t,e)=>jw(t,()=>n=>{const i=`${Es(t.prefix)}k-${Fo(n)}`,a=()=>{if(!e.rules.global.cache.has(i)){e.rules.global.cache.add(i);const c=[];ll(n,[],[],t,p=>c.push(p));const f=`@keyframes ${i}{${c.join("")}}`;e.rules.global.apply(f)}return i};return cp(a,{get name(){return a()},toString:a})}),Iw=class{constructor(t,e,n,i){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=i==null?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Es(this.prefix)+Es(this.scale)+this.token}toString(){return this.computedValue}},Uw=ol(),Fw=(t,e)=>Uw(t,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const a=`.${n=(n=typeof n=="string"?n:"")||`${Es(t.prefix)}t-${Fo(i)}`}`,c={},f=[];for(const g in i){c[g]={};for(const x in i[g]){const m=`--${Es(t.prefix)}${g}-${x}`,w=Xg(String(i[g][x]),t.prefix,g);c[g][x]=new Iw(x,w,g,t.prefix),f.push(`${m}:${w}`)}}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{...c,get className(){return p()},selector:a,toString:p}}),Bw=ol(),Hw=ol(),Vw=t=>{const e=(n=>{let i=!1;const a=Bw(n,c=>{i=!0;const f="prefix"in(c=typeof c=="object"&&c||{})?String(c.prefix):"",p=typeof c.media=="object"&&c.media||{},g=typeof c.root=="object"?c.root||null:globalThis.document||null,x=typeof c.theme=="object"&&c.theme||{},m={prefix:f,media:p,theme:x,themeMap:typeof c.themeMap=="object"&&c.themeMap||{...mw},utils:typeof c.utils=="object"&&c.utils||{}},w=Ow(g),R={css:Jg(m,w),globalCss:zw(m,w),keyframes:_w(m,w),createTheme:Fw(m,w),reset(){w.reset(),R.theme.toString()},theme:{},sheet:w,config:m,prefix:f,getCssText:w.toString,toString:w.toString};return String(R.theme=R.createTheme(x)),R});return i||a.reset(),a})(t);return e.styled=(({config:n,sheet:i})=>Hw(n,()=>{const a=Jg(n,i);return(...c)=>{const f=a(...c),p=f[Uo].type,g=T.forwardRef((x,m)=>{const w=x&&x.as||p,{props:R,deferredInjector:D}=f(x);return delete R.as,R.ref=m,D?T.createElement(T.Fragment,null,T.createElement(w,R),T.createElement(D,null)):T.createElement(w,R)});return g.className=f.className,g.displayName=`Styled.${p.displayName||p.name||p}`,g.selector=f.selector,g.toString=()=>f.selector,g[Uo]=f[Uo],g}}))(e),e};function Ww(t,e,n){return Math.max(e,Math.min(t,n))}const gr={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 ty(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function ny(t,e,n,i=.15){return i===0?Ww(t,e,n):t<e?-ty(e-t,n-e,i)+e:t>n?+ty(t-n,n-e,i)+n:t}function $w(t,[e,n],[i,a]){const[[c,f],[p,g]]=t;return[ny(e,c,f,i),ny(n,p,g,a)]}function qw(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 Yw(t){var e=qw(t,"string");return typeof e=="symbol"?e:String(e)}function Fr(t,e,n){return e=Yw(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ry(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 Rn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ry(Object(n),!0).forEach(function(i){Fr(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ry(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const iy={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 sy(t){return t?t[0].toUpperCase()+t.slice(1):""}const Qw=["enter","leave"];function Gw(t=!1,e){return t&&!Qw.includes(e)}function Xw(t,e="",n=!1){const i=iy[t],a=i&&i[e]||e;return"on"+sy(t)+sy(a)+(Gw(n,a)?"Capture":"")}const Kw=["gotpointercapture","lostpointercapture"];function Zw(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const i=Kw.includes(e)?"capturecapture":"capture",a=!!~e.indexOf(i);return a&&(e=e.replace("capture","")),{device:e,capture:a,passive:n}}function Jw(t,e=""){const n=iy[t],i=n&&n[e]||e;return t+i}function Rf(t){return"touches"in t}function oy(t){return Rf(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function eE(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 tE(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function ay(t){return Rf(t)?tE(t)[0]:t}function nE(t){return eE(t).map(e=>e.identifier)}function hp(t){const e=ay(t);return Rf(t)?e.identifier:e.pointerId}function ly(t){const e=ay(t);return[e.clientX,e.clientY]}function rE(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:i,metaKey:a,ctrlKey:c}=t;Object.assign(e,{shiftKey:n,altKey:i,metaKey:a,ctrlKey:c})}return e}function Of(t,...e){return typeof t=="function"?t(...e):t}function iE(){}function sE(...t){return t.length===0?iE:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function uy(t,e){return Object.assign({},e,t||{})}const oE=32;class aE{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?Of(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 c=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,rE(e)),a.down=a.pressed=a.buttons%2===1||a.touches>0,c=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const _=n._delta.map(Math.abs);gr.addTo(n._distance,_)}this.axisIntent&&this.axisIntent(e);const[f,p]=n._movement,[g,x]=i.threshold,{_step:m,values:w}=n;if(i.hasCustomTransform?(m[0]===!1&&(m[0]=Math.abs(f)>=g&&w[0]),m[1]===!1&&(m[1]=Math.abs(p)>=x&&w[1])):(m[0]===!1&&(m[0]=Math.abs(f)>=g&&Math.sign(f)*g),m[1]===!1&&(m[1]=Math.abs(p)>=x&&Math.sign(p)*x)),n.intentional=m[0]!==!1||m[1]!==!1,!n.intentional)return;const R=[0,0];if(i.hasCustomTransform){const[_,K]=w;R[0]=m[0]!==!1?_-m[0]:0,R[1]=m[1]!==!1?K-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 D=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=Of(i.bounds,n)),this.setup&&this.setup()),n.movement=R,this.computeOffset()));const[z,P]=n.offset,[[L,A],[F,$]]=n._bounds;n.overflow=[z<L?-1:z>A?1:0,P<F?-1:P>$?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 Q=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=$w(n._bounds,n.offset,Q),n.delta=gr.sub(n.offset,D),this.computeMovement(),M&&(!n.last||c>oE)){n.delta=gr.sub(n.offset,D);const _=n.delta.map(Math.abs);gr.addTo(n.distance,_),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&c>0&&(n.velocity=[_[0]/c,_[1]/c])}}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(Rn(Rn(Rn({},n),e),{},{[this.aliasKey]:e.values}));a!==void 0&&(e.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function lE([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 uE extends aE{constructor(...e){super(...e),Fr(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=gr.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=gr.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[oy(e)]:i.axisThreshold;n.axis=lE(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 cE=t=>t,cy=.15,fy={enabled(t=!0){return t},eventOptions(t,e,n){return Rn(Rn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[cy,cy];case!1:return[0,0];default:return gr.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return gr.toVector(t)},transform(t,e,n){const i=t||n.shared.transform;return this.hasCustomTransform=!!i,i||cE},threshold(t){return gr.toVector(t,0)}},fE=0,Lu=Rn(Rn({},fy),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=fE){return t},bounds(t={}){if(typeof t=="function")return c=>Lu.bounds(t(c));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]]}}),dy={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 dE extends uE{constructor(...e){super(...e),Fr(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=Lu.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(ly(e)),this.computeInitial(),n.preventScrollAxis&&oy(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 c=ly(e);if(document.pointerLockElement===e.target?n._delta=[e.movementX,e.movementY]:(n._delta=gr.sub(c,n._values),this.computeValues(c)),gr.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[c,f]=n._distance;if(n.tap=c<=i.tapsThreshold&&f<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[p,g]=n.direction,[x,m]=n.velocity,[w,R]=n.movement,[D,M]=i.swipe.velocity,[z,P]=i.swipe.distance,L=i.swipe.duration;n.elapsedTime<L&&(Math.abs(x)>D&&Math.abs(w)>z&&(n.swipe[0]=p),Math.abs(m)>M&&Math.abs(R)>P&&(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,hE(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=dy[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,gr.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in dy&&(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 hE(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const Du=typeof window<"u"&&window.document&&window.document.createElement;function pE(){return Du&&"ontouchstart"in window}function hy(){return pE()||Du&&window.navigator.maxTouchPoints>1}function vE(){return Du&&"onpointerdown"in window}function mE(){return Du&&"exitPointerLock"in window.document}function gE(){try{return"constructor"in GestureEvent}catch{return!1}}const vi={isBrowser:Du,gesture:gE(),touch:hy(),touchscreen:hy(),pointer:vE(),pointerLock:mE()},yE=250,bE=180,SE=.5,xE=50,wE=250,EE=10,py={mouse:0,touch:0,pen:8},TE=Rn(Rn({},Lu),{},{device(t,e,{pointer:{touch:n=!1,lock:i=!1,mouse:a=!1}={}}){return this.pointerLock=i&&vi.pointerLock,vi.touch&&n?"touch":this.pointerLock?"mouse":vi.pointer&&!a?"pointer":vi.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?yE:void 0,!(!vi.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 c=gr.toVector(t,n?i:a?1:0);return this.filterTaps=n,this.tapsThreshold=i,c},swipe({velocity:t=SE,distance:e=xE,duration:n=wE}={}){return{velocity:this.transform(gr.toVector(t)),distance:this.transform(gr.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return bE;case!1:return 0;default:return t}},axisThreshold(t){return t?Rn(Rn({},py),t):py},keyboardDisplacement(t=EE){return t}});Rn(Rn({},fy),{},{device(t,e,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!vi.touch&&vi.gesture)return"gesture";if(vi.touch&&i)return"touch";if(vi.touchscreen){if(vi.pointer)return"pointer";if(vi.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:i={}}){const a=f=>{const p=uy(Of(n,f),{min:-1/0,max:1/0});return[p.min,p.max]},c=f=>{const p=uy(Of(i,f),{min:-1/0,max:1/0});return[p.min,p.max]};return typeof n!="function"&&typeof i!="function"?[a(),c()]:f=>[a(f),c(f)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",gr.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}}),Rn(Rn({},Lu),{},{mouseOnly:(t=!0)=>t}),Rn(Rn({},Lu),{},{mouseOnly:(t=!0)=>t});const vy=new Map,pp=new Map;function CE(t){vy.set(t.key,t.engine),pp.set(t.key,t.resolver)}const RE={key:"drag",engine:dE,resolver:TE};function OE(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,c;for(c=0;c<i.length;c++)a=i[c],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function AE(t,e){if(t==null)return{};var n=OE(t,e),i,a;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(a=0;a<c.length;a++)i=c[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}const ME={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=vi.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},PE=["target","eventOptions","window","enabled","transform"];function Af(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]=Af(t[i],a);break;case"boolean":a&&(n[i]=t[i]);break}return n}function LE(t,e,n={}){const i=t,{target:a,eventOptions:c,window:f,enabled:p,transform:g}=i,x=AE(i,PE);if(n.shared=Af({target:a,eventOptions:c,window:f,enabled:p,transform:g},ME),e){const m=pp.get(e);n[e]=Af(Rn({shared:n.shared},x),m)}else for(const m in x){const w=pp.get(m);w&&(n[m]=Af(Rn({shared:n.shared},x[m]),w))}return n}class my{constructor(e,n){Fr(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,i,a,c){const f=this._listeners,p=Jw(n,i),g=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},x=Rn(Rn({},g),c);e.addEventListener(p,a,x);const m=()=>{e.removeEventListener(p,a,x),f.delete(m)};return f.add(m),m}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class DE{constructor(){Fr(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 kE{constructor(e){Fr(this,"gestures",new Set),Fr(this,"_targetEventStore",new my(this)),Fr(this,"gestureEventStores",{}),Fr(this,"gestureTimeoutStores",{}),Fr(this,"handlers",{}),Fr(this,"config",{}),Fr(this,"pointerIds",new Set),Fr(this,"touchIds",new Set),Fr(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),NE(this,e)}setEventIds(e){if(Rf(e))return this.touchIds=new Set(nE(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=LE(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=gy(i,p.eventOptions,!!a);if(p.enabled){const x=vy.get(f);new x(this,e,f).bind(g)}}const c=gy(i,n.eventOptions,!!a);for(const f in this.nativeHandlers)c(f,"",p=>this.nativeHandlers[f](Rn(Rn({},this.state.shared),{},{event:p,args:e})),void 0,!0)}for(const c in i)i[c]=sE(...i[c]);if(!a)return i;for(const c in i){const{device:f,capture:p,passive:g}=Zw(c);this._targetEventStore.add(a,f,"",i[c],{capture:p,passive:g})}}}}function ul(t,e){t.gestures.add(e),t.gestureEventStores[e]=new my(t,e),t.gestureTimeoutStores[e]=new DE}function NE(t,e){e.drag&&ul(t,"drag"),e.wheel&&ul(t,"wheel"),e.scroll&&ul(t,"scroll"),e.move&&ul(t,"move"),e.pinch&&ul(t,"pinch"),e.hover&&ul(t,"hover")}const gy=(t,e,n)=>(i,a,c,f={},p=!1)=>{var g,x;const m=(g=f.capture)!==null&&g!==void 0?g:e.capture,w=(x=f.passive)!==null&&x!==void 0?x:e.passive;let R=p?i:Xw(i,a,m);n&&w&&(R+="Passive"),t[R]=t[R]||[],t[R].push(c)};function zE(t,e={},n,i){const a=T.useMemo(()=>new kE(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 jE(t,e){return CE(RE),zE({drag:t},e||{},"drag")}const _E=ve.useId||(()=>{});let IE=0;function UE(t){const[e,n]=ve.useState(_E());return wf(()=>{t||n(i=>i??String(IE++))},[t]),t||(e?`radix-${e}`:"")}const cl=["a","button","div","h2","h3","img","li","nav","p","span","svg","ul"].reduce((t,e)=>({...t,[e]:ve.forwardRef((n,i)=>{const{asChild:a,...c}=n,f=a?Ug:e;return ve.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.as&&console.error(FE),ve.createElement(f,mr({},c,{ref:i}))})}),{}),FE="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",BE=ve.forwardRef((t,e)=>ve.createElement(cl.span,mr({},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"}}))),HE=ve.forwardRef((t,e)=>{var n,i;const{containerRef:a,style:c,...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]=ve.useState({});return wf(()=>{g({})},[]),p?Zh.createPortal(ve.createElement(cl.div,mr({"data-radix-portal":""},f,{ref:e,style:p===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...c}:void 0})),p):null}),VE=ve.forwardRef((t,e)=>{const{children:n,width:i=10,height:a=5,...c}=t;return ve.createElement(cl.svg,mr({},c,{ref:e,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:ve.createElement("polygon",{points:"0,0 30,0 15,10"}))});function yy(t){const[e,n]=ve.useState(void 0);return ve.useEffect(()=>{if(t){const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const c=a[0];let f,p;if("borderBoxSize"in c){const g=c.borderBoxSize,x=Array.isArray(g)?g[0]:g;f=x.inlineSize,p=x.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 WE(t,e){const n=Bo.get(t);return n===void 0?(Bo.set(t,{rect:{},callbacks:[e]}),Bo.size===1&&(vp=requestAnimationFrame(by))):(n.callbacks.push(e),e(t.getBoundingClientRect())),()=>{const i=Bo.get(t);if(i===void 0)return;const a=i.callbacks.indexOf(e);a>-1&&i.callbacks.splice(a,1),i.callbacks.length===0&&(Bo.delete(t),Bo.size===0&&cancelAnimationFrame(vp))}}let vp;const Bo=new Map;function by(){const t=[];Bo.forEach((e,n)=>{const i=n.getBoundingClientRect();var a,c;a=e.rect,c=i,(a.width!==c.width||a.height!==c.height||a.top!==c.top||a.right!==c.right||a.bottom!==c.bottom||a.left!==c.left)&&(e.rect=i,t.push(e))}),t.forEach(e=>{e.callbacks.forEach(n=>n(e.rect))}),vp=requestAnimationFrame(by)}function Sy(t){const[e,n]=ve.useState();return ve.useEffect(()=>{if(t){const i=WE(t,n);return()=>{n(void 0),i()}}},[t]),e}function xy(t,e=[]){let n=[];const i=()=>{const a=n.map(c=>ve.createContext(c));return function(c){const f=(c==null?void 0:c[t])||a;return ve.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])}};return i.scopeName=t,[function(a,c){const f=ve.createContext(c),p=n.length;function g(x){const{scope:m,children:w,...R}=x,D=(m==null?void 0:m[t][p])||f,M=ve.useMemo(()=>R,Object.values(R));return ve.createElement(D.Provider,{value:M},w)}return n=[...n,c],g.displayName=a+"Provider",[g,function(x,m){const w=(m==null?void 0:m[t][p])||f,R=ve.useContext(w);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${a}\``)}]},$E(i,...e)]}function $E(...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 c=i.reduce((f,{useScope:p,scopeName:g})=>({...f,...p(a)[`__scope${g}`]}),{});return ve.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function qE({anchorRect:t,popperSize:e,arrowSize:n,arrowOffset:i=0,side:a,sideOffset:c=0,align:f,alignOffset:p=0,shouldAvoidCollisions:g=!0,collisionBoundariesRect:x,collisionTolerance:m=0}){if(!t||!e||!x)return{popperStyles:YE,arrowStyles:mp};const w=function(K,ee,V=0,ae=0,ge){const we=ge?ge.height:0,Ee=wy(ee,K,"x"),Ue=wy(ee,K,"y"),Fe=Ue.before-V-we,Be=Ue.after+V+we,vt=Ee.before-V-we,Oe=Ee.after+V+we;return{top:{start:{x:Ee.start+ae,y:Fe},center:{x:Ee.center,y:Fe},end:{x:Ee.end-ae,y:Fe}},right:{start:{x:Oe,y:Ue.start+ae},center:{x:Oe,y:Ue.center},end:{x:Oe,y:Ue.end-ae}},bottom:{start:{x:Ee.start+ae,y:Be},center:{x:Ee.center,y:Be},end:{x:Ee.end-ae,y:Be}},left:{start:{x:vt,y:Ue.start+ae},center:{x:vt,y:Ue.center},end:{x:vt,y:Ue.end-ae}}}}(e,t,c,p,n),R=w[a][f];if(g===!1){const K=Ey(R);let ee=mp;return n&&(ee=Cy({popperSize:e,arrowSize:n,arrowOffset:i,side:a,align:f})),{popperStyles:{...K,"--radix-popper-transform-origin":Ty(e,a,f,i,n)},arrowStyles:ee,placedSide:a,placedAlign:f}}const D=DOMRect.fromRect({...e,...R}),M=(z=x,P=m,DOMRect.fromRect({width:z.width-2*P,height:z.height-2*P,x:z.left+P,y:z.top+P}));var z,P;const L=Oy(D,M),A=w[Ry(a)][f],F=function(K,ee,V){const ae=Ry(K);return ee[K]&&!V[ae]?ae:K}(a,L,Oy(DOMRect.fromRect({...e,...A}),M)),$=function(K,ee,V,ae,ge){const we=V==="top"||V==="bottom",Ee=we?"left":"top",Ue=we?"right":"bottom",Fe=we?"width":"height",Be=ee[Fe]>K[Fe];return(ae==="start"||ae==="center")&&(ge[Ee]&&Be||ge[Ue]&&!Be)?"end":(ae==="end"||ae==="center")&&(ge[Ue]&&Be||ge[Ee]&&!Be)?"start":ae}(e,t,a,f,L),Q=Ey(w[F][$]);let _=mp;return n&&(_=Cy({popperSize:e,arrowSize:n,arrowOffset:i,side:F,align:$})),{popperStyles:{...Q,"--radix-popper-transform-origin":Ty(e,F,$,i,n)},arrowStyles:_,placedSide:F,placedAlign:$}}function wy(t,e,n){const i=t[n==="x"?"left":"top"],a=n==="x"?"width":"height",c=t[a],f=e[a];return{before:i-f,start:i,center:i+(c-f)/2,end:i+c-f,after:i+c}}function Ey(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 Ty(t,e,n,i,a){const c=e==="top"||e==="bottom",f=a?a.width:0,p=a?a.height:0,g=f/2+i;let x="",m="";return c?(x={start:`${g}px`,center:"center",end:t.width-g+"px"}[n],m=e==="top"?`${t.height+p}px`:-p+"px"):(x=e==="left"?`${t.width+p}px`:-p+"px",m={start:`${g}px`,center:"center",end:t.height-g+"px"}[n]),`${x} ${m}`}const YE={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},mp={position:"absolute",opacity:0};function Cy({popperSize:t,arrowSize:e,arrowOffset:n,side:i,align:a}){const c=(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),x={width:`${g}px`,height:`${g}px`,transform:`rotate(${p}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:QE(i,a)};return i!=="top"&&i!=="bottom"||(a==="start"&&(x.left=`${n}px`),a==="center"&&(x.left=`${c}px`),a==="end"&&(x.right=`${n}px`)),i!=="left"&&i!=="right"||(a==="start"&&(x.top=`${n}px`),a==="center"&&(x.top=`${f}px`),a==="end"&&(x.bottom=`${n}px`)),x}function QE(t,e){return(t!=="top"&&t!=="right"||e!=="end")&&(t!=="bottom"&&t!=="left"||e==="end")?"ltr":"rtl"}function Ry(t){return{top:"bottom",right:"left",bottom:"top",left:"right"}[t]}function Oy(t,e){return{top:t.top<e.top,right:t.right>e.right,bottom:t.bottom>e.bottom,left:t.left<e.left}}const[Ay,My]=xy("Popper"),[GE,Py]=Ay("Popper"),XE=t=>{const{__scopePopper:e,children:n}=t,[i,a]=ve.useState(null);return ve.createElement(GE,{scope:e,anchor:i,onAnchorChange:a},n)},KE=ve.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...a}=t,c=Py("PopperAnchor",n),f=ve.useRef(null),p=xf(e,f);return ve.useEffect(()=>{c.onAnchorChange((i==null?void 0:i.current)||f.current)}),i?null:ve.createElement(cl.div,mr({},a,{ref:p}))}),[ZE,JE]=Ay("PopperContent"),eT=ve.forwardRef((t,e)=>{const{__scopePopper:n,side:i="bottom",sideOffset:a,align:c="center",alignOffset:f,collisionTolerance:p,avoidCollisions:g=!0,...x}=t,m=Py("PopperContent",n),[w,R]=ve.useState(),D=Sy(m.anchor),[M,z]=ve.useState(null),P=yy(M),[L,A]=ve.useState(null),F=yy(L),$=xf(e,we=>z(we)),Q=function(){const[we,Ee]=ve.useState(void 0);return ve.useEffect(()=>{let Ue;function Fe(){Ee({width:window.innerWidth,height:window.innerHeight})}function Be(){window.clearTimeout(Ue),Ue=window.setTimeout(Fe,100)}return Fe(),window.addEventListener("resize",Be),()=>window.removeEventListener("resize",Be)},[]),we}(),_=Q?DOMRect.fromRect({...Q,x:0,y:0}):void 0,{popperStyles:K,arrowStyles:ee,placedSide:V,placedAlign:ae}=qE({anchorRect:D,popperSize:P,arrowSize:F,arrowOffset:w,side:i,sideOffset:a,align:c,alignOffset:f,shouldAvoidCollisions:g,collisionBoundariesRect:_,collisionTolerance:p}),ge=V!==void 0;return ve.createElement("div",{style:K,"data-radix-popper-content-wrapper":""},ve.createElement(ZE,{scope:n,arrowStyles:ee,onArrowChange:A,onArrowOffsetChange:R},ve.createElement(cl.div,mr({"data-side":V,"data-align":ae},x,{style:{...x.style,animation:ge?void 0:"none"},ref:$}))))}),tT=ve.forwardRef(function(t,e){const{__scopePopper:n,offset:i,...a}=t,c=JE("PopperArrow",n),{onArrowOffsetChange:f}=c;return ve.useEffect(()=>f(i),[f,i]),ve.createElement("span",{style:{...c.arrowStyles,pointerEvents:"none"}},ve.createElement("span",{ref:c.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},ve.createElement(VE,mr({},a,{ref:e,style:{...a.style,display:"block"}}))))}),nT=XE,rT=KE,iT=eT,sT=tT,Ly=t=>{const{present:e,children:n}=t,i=function(f){const[p,g]=ve.useState(),x=ve.useRef({}),m=ve.useRef(f),w=ve.useRef("none"),R=f?"mounted":"unmounted",[D,M]=function(z,P){return ve.useReducer((L,A)=>{const F=P[L][A];return F??L},z)}(R,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ve.useEffect(()=>{const z=Mf(x.current);w.current=D==="mounted"?z:"none"},[D]),wf(()=>{const z=x.current,P=m.current;if(P!==f){const L=w.current,A=Mf(z);f?M("MOUNT"):A==="none"||(z==null?void 0:z.display)==="none"?M("UNMOUNT"):M(P&&L!==A?"ANIMATION_OUT":"UNMOUNT"),m.current=f}},[f,M]),wf(()=>{if(p){const z=L=>{const A=Mf(x.current).includes(L.animationName);L.target===p&&A&&M("ANIMATION_END")},P=L=>{L.target===p&&(w.current=Mf(x.current))};return p.addEventListener("animationstart",P),p.addEventListener("animationcancel",z),p.addEventListener("animationend",z),()=>{p.removeEventListener("animationstart",P),p.removeEventListener("animationcancel",z),p.removeEventListener("animationend",z)}}},[p,M]),{isPresent:["mounted","unmountSuspended"].includes(D),ref:ve.useCallback(z=>{z&&(x.current=getComputedStyle(z)),g(z)},[])}}(e),a=typeof n=="function"?n({present:i.isPresent}):ve.Children.only(n),c=xf(i.ref,a.ref);return typeof n=="function"||i.isPresent?ve.cloneElement(a,{ref:c}):null};function Mf(t){return(t==null?void 0:t.animationName)||"none"}Ly.displayName="Presence";function Dy(t){const e=ve.useRef(t);return ve.useEffect(()=>{e.current=t},[t]),e.current}function gp(t){const e=ve.useRef(t);return ve.useEffect(()=>{e.current=t}),ve.useMemo(()=>(...n)=>{var i;return(i=e.current)===null||i===void 0?void 0:i.call(e,...n)},[])}function oT(t){const e=gp(t);ve.useEffect(()=>{const n=i=>{i.key==="Escape"&&e(i)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}function aT({prop:t,defaultProp:e,onChange:n=()=>{}}){const[i,a]=function({defaultProp:g,onChange:x}){const m=ve.useState(g),[w]=m,R=ve.useRef(w),D=gp(x);return ve.useEffect(()=>{R.current!==w&&(D(w),R.current=w)},[w,R,D]),m}({defaultProp:e,onChange:n}),c=t!==void 0,f=c?t:i,p=gp(n);return[f,ve.useCallback(g=>{if(c){const x=g,m=typeof g=="function"?x(t):g;m!==t&&p(m)}else a(g)},[c,t,a,p])]}function fl(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[ky,ND]=xy("Tooltip",[My]),Pf=My(),lT=700,[zD,uT]=ky("TooltipProvider",{isOpenDelayed:!0,delayDuration:lT,onOpen:()=>{},onClose:()=>{}}),[cT,Lf]=ky("Tooltip"),fT=t=>{const{__scopeTooltip:e,children:n,open:i,defaultOpen:a=!1,onOpenChange:c,delayDuration:f}=t,p=uT("Tooltip",e),g=Pf(e),[x,m]=ve.useState(null),w=UE(),R=ve.useRef(0),D=f??p.delayDuration,M=ve.useRef(!1),{onOpen:z,onClose:P}=p,[L=!1,A]=aT({prop:i,defaultProp:a,onChange:_=>{_&&(document.dispatchEvent(new CustomEvent("tooltip.open")),z()),c==null||c(_)}}),F=ve.useMemo(()=>L?M.current?"delayed-open":"instant-open":"closed",[L]),$=ve.useCallback(()=>{window.clearTimeout(R.current),M.current=!1,A(!0)},[A]),Q=ve.useCallback(()=>{window.clearTimeout(R.current),R.current=window.setTimeout(()=>{M.current=!0,A(!0)},D)},[D,A]);return ve.useEffect(()=>()=>window.clearTimeout(R.current),[]),ve.createElement(nT,g,ve.createElement(cT,{scope:e,contentId:w,open:L,stateAttribute:F,trigger:x,onTriggerChange:m,onTriggerEnter:ve.useCallback(()=>{p.isOpenDelayed?Q():$()},[p.isOpenDelayed,Q,$]),onOpen:ve.useCallback($,[$]),onClose:ve.useCallback(()=>{window.clearTimeout(R.current),A(!1),P()},[A,P])},n))},dT=ve.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=Lf("TooltipTrigger",n),c=Pf(n),f=xf(e,a.onTriggerChange),p=ve.useRef(!1),g=ve.useCallback(()=>p.current=!1,[]);return ve.useEffect(()=>()=>document.removeEventListener("mouseup",g),[g]),ve.createElement(rT,mr({asChild:!0},c),ve.createElement(cl.button,mr({"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute},i,{ref:f,onMouseEnter:fl(t.onMouseEnter,a.onTriggerEnter),onMouseLeave:fl(t.onMouseLeave,a.onClose),onMouseDown:fl(t.onMouseDown,()=>{a.onClose(),p.current=!0,document.addEventListener("mouseup",g,{once:!0})}),onFocus:fl(t.onFocus,()=>{p.current||a.onOpen()}),onBlur:fl(t.onBlur,a.onClose),onClick:fl(t.onClick,a.onClose)})))}),hT=ve.forwardRef((t,e)=>{const{forceMount:n,...i}=t,a=Lf("TooltipContent",t.__scopeTooltip);return ve.createElement(Ly,{present:n||a.open},ve.createElement(pT,mr({ref:e},i)))}),pT=ve.forwardRef((t,e)=>{const{__scopeTooltip:n,children:i,"aria-label":a,portalled:c=!0,...f}=t,p=Lf("TooltipContent",n),g=Pf(n),x=c?HE:ve.Fragment,{onClose:m}=p;return oT(()=>m()),ve.useEffect(()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m)),[m]),ve.createElement(x,null,ve.createElement(mT,{__scopeTooltip:n}),ve.createElement(iT,mr({"data-state":p.stateAttribute},g,f,{ref:e,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),ve.createElement(Fg,null,i),ve.createElement(BE,{id:p.contentId,role:"tooltip"},a||i)))}),vT=ve.forwardRef((t,e)=>{const{__scopeTooltip:n,...i}=t,a=Pf(n);return ve.createElement(sT,mr({},a,i,{ref:e}))});function mT(t){const{__scopeTooltip:e}=t,n=Lf("CheckTriggerMoved",e),i=Sy(n.trigger),a=i==null?void 0:i.left,c=Dy(a),f=i==null?void 0:i.top,p=Dy(f),g=n.onClose;return ve.useEffect(()=>{(c!==void 0&&c!==a||p!==void 0&&p!==f)&&g()},[g,c,p,a,f]),null}const gT=fT,yT=dT,bT=hT,ST=vT;function xT(t,e){if(t==null)return{};var n={},i=Object.keys(t),a,c;for(c=0;c<i.length;c++)a=i[c],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Ts(t,e){if(t==null)return{};var n=xT(t,e),i,a;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(a=0;a<c.length;a++)i=c[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}let Ar;(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"})(Ar||(Ar={}));const wT={[Ar.UNSUPPORTED_INPUT]:(t,e)=>[`An input with type \`${t}\` input was found at path \`${e}\` but it's not supported yet.`],[Ar.NO_COMPONENT_FOR_TYPE]:(t,e)=>[`Type \`${t}\` found at path \`${e}\` can't be displayed in panel because no component supports it yet.`],[Ar.UNKNOWN_INPUT]:(t,e)=>[`input at path \`${t}\` is not recognized.`,e],[Ar.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.`],[Ar.ALREADY_REGISTERED_TYPE]:t=>[`Type ${t} has already been registered. You can't register a component with the same type.`],[Ar.CLIPBOARD_ERROR]:t=>["Error copying the value",t],[Ar.THEME_ERROR]:(t,e)=>[`Error accessing the theme \`${t}.${e}\` value.`],[Ar.PATH_DOESNT_EXIST]:t=>[`Error getting the value at path \`${t}\`. There is probably an error in your \`render\` function.`],[Ar.PATH_DOESNT_EXIST]:t=>[`Error accessing the value at path \`${t}\``],[Ar.INPUT_TYPE_OVERRIDE]:(t,e,n)=>[`Input at path \`${t}\` already exists with type: \`${e}\`. Its type cannot be overridden with type \`${n}\`.`],[Ar.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Ny(t,e,...n){const[i,...a]=wT[e](...n);console[t]("LEVA: "+i,...a)}const zy=Ny.bind(null,"warn");Ny.bind(null,"log");function jD(t){return t}function ET(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jy(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 Ho(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jy(Object(n),!0).forEach(function(i){ET(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jy(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}const no=(t,e,n)=>t>n?n:t<e?e:t,TT=t=>{if(t===""||typeof t=="number")return t;try{const e=ro(t);if(!isNaN(e))return e}catch{}return parseFloat(t)},CT=Math.log(10);function _y(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)/CT)+1,i=Math.floor(Math.log10(Math.abs(t))),a=Math.pow(10,i-n);return Math.max(a,.001)}const RT=(t,e,n)=>n===e?0:(no(t,e,n)-e)/(n-e),Iy=(t,e,n)=>t*(n-e)+e,Uy=/\(([0-9+\-*/^ .]+)\)/,Fy=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,By=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,Hy=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,Vy=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,Wy=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function ro(t){if(isNaN(Number(t)))if(Uy.test(t)){const e=t.replace(Uy,(n,i)=>String(ro(i)));return ro(e)}else if(Fy.test(t)){const e=t.replace(Fy,(n,i,a)=>String(Math.pow(Number(i),Number(a))));return ro(e)}else if(By.test(t)){const e=t.replace(By,(n,i,a)=>String(Number(i)*Number(a)));return ro(e)}else if(Hy.test(t)){const e=t.replace(Hy,(n,i,a)=>{if(a!=0)return String(Number(i)/Number(a));throw new Error("Division by zero")});return ro(e)}else if(Vy.test(t)){const e=t.replace(Vy,(n,i,a)=>String(Number(i)+Number(a)));return ro(e)}else if(Wy.test(t)){const e=t.replace(Wy,(n,i,a)=>String(Number(i)-Number(a)));return ro(e)}else return Number(t);return Number(t)}let $y;(function(t){t.BUTTON="BUTTON",t.BUTTON_GROUP="BUTTON_GROUP",t.MONITOR="MONITOR",t.FOLDER="FOLDER"})($y||($y={}));let qy;(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"})(qy||(qy={}));const OT=t=>t.shiftKey?5:t.altKey?1/5:1,AT=["value"],MT=["min","max"],PT=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},LT=(t,{min:e=-1/0,max:n=1/0,suffix:i})=>{const a=parseFloat(t);if(t===""||isNaN(a))throw Error("Invalid number");const c=no(a,e,n);return i?c+i:c},DT=(t,{pad:e=0,suffix:n})=>{const i=parseFloat(t).toFixed(e);return n?i+n:i},kT=t=>{let{value:e}=t,n=Ts(t,AT);const{min:i=-1/0,max:a=1/0}=n,c=Ts(n,MT);let f=parseFloat(e);const p=typeof e=="string"?e.substring((""+f).length):void 0;f=no(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 x=g?_y(g)*10:_y(f);g=g||x/10;const m=Math.round(no(Math.log10(1/x),0,2));return{value:p?f+p:f,settings:Ho({initialValue:f,step:g,pad:m,min:i,max:a,suffix:p},c)}},Yy=(t,{step:e,initialValue:n})=>{const i=Math.round((t-n)/e);return n+i*e};var NT=Object.freeze({__proto__:null,schema:PT,sanitize:LT,format:DT,normalize:kT,sanitizeStep:Yy});function ri(){return ri=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},ri.apply(this,arguments)}const zT=T.createContext({});function Cs(){return T.useContext(zT)}const jT=T.createContext(null);T.createContext(null);const _T=T.createContext(null);function IT(){return T.useContext(_T)}const UT=()=>({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 Df(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 ku={$inputStyle:()=>t=>Df(t,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>t=>Df(t,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>t=>Df(t,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>t=>Df(t,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:Kt,css:_D,createTheme:ID,globalCss:FT,keyframes:UD}=Vw({prefix:"leva",theme:UT(),utils:Ho(Ho({},ku),{},{$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":ku.$focusStyle()(t)}),$focusWithin:t=>({"&:focus-within":ku.$focusStyle()(t)}),$hover:t=>({"&:hover":ku.$hoverStyle()(t)}),$active:t=>({"&:active":ku.$activeStyle()(t)})})});FT({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function BT(t,e){const{theme:n}=T.useContext(jT);if(!(t in n)||!(e in n[t]))return zy(Ar.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 Qy=Kt("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),Gy=Kt("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${Qy}`]:{paddingLeft:0}}),HT=Kt(Gy,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),VT=Kt("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),WT=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],$T=["onUpdate"];function Xy(t){let{innerLabel:e,value:n,onUpdate:i,onChange:a,onKeyDown:c,type:f,id:p,inputType:g="text",rows:x=0}=t,m=Ts(t,WT);const{id:w,emitOnEditStart:R,emitOnEditEnd:D,disabled:M}=Cs(),z=p||w,P=T.useRef(null),L=x>0,A=L?"textarea":"input",F=T.useCallback(_=>K=>{const ee=K.currentTarget.value;_(ee)},[]);T.useEffect(()=>{const _=P.current,K=F(ee=>{i(ee),D()});return _==null||_.addEventListener("blur",K),()=>_==null?void 0:_.removeEventListener("blur",K)},[F,i,D]);const $=T.useCallback(_=>{_.key==="Enter"&&F(i)(_)},[F,i]),Q=Object.assign({as:A},L?{rows:x}:{},m);return T.createElement(VT,{textArea:L},e&&typeof e=="string"?T.createElement(Gy,null,e):e,T.createElement(Qy,ri({levaType:f,ref:P,id:z,type:g,autoComplete:"off",spellCheck:"false",value:n,onChange:F(a),onFocus:()=>R(),onKeyPress:$,onKeyDown:c,disabled:M},Q)))}function qT(t){let{onUpdate:e}=t,n=Ts(t,$T);const i=T.useCallback(c=>e(TT(c)),[e]),a=T.useCallback(c=>{const f=c.key==="ArrowUp"?1:c.key==="ArrowDown"?-1:0;if(f){c.preventDefault();const p=c.altKey?.1:c.shiftKey?10:1;e(g=>parseFloat(g)+f*p)}},[e]);return T.createElement(Xy,ri({},n,{onUpdate:i,onKeyDown:a,type:"number"}))}const yp=Kt("div",{}),Ky=Kt("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"}}]});Kt("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 + ${Ky}::after`]:{opacity:.6},[`${yp}:hover > & + ${Ky}::after`]:{opacity:.6},[`${yp}:hover > & > svg`]:{opacity:1}});const YT=Kt("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"}}}}}),Zy=Kt("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${YT} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),QT=Kt(Zy,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),GT=Kt("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"}}}}),XT=Kt("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"}}),bp=Kt("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}});Kt("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${bp}`]:{pointerEvents:"auto"}}}}}),Kt("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"});const KT=Kt("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),ZT=Kt(ST,{fill:"$toolTipBackground"}),JT=["align"];function eC(){const{id:t,disable:e,disabled:n}=Cs();return T.createElement(T.Fragment,null,T.createElement(XT,{id:t+"__disable",type:"checkbox",checked:!n,onChange:()=>e(!n)}),T.createElement("label",{htmlFor:t+"__disable"}))}function tC(t){const{id:e,optional:n,hint:i}=Cs(),a=t.htmlFor||(e?{htmlFor:e}:null),c=!i&&typeof t.children=="string"?{title:t.children}:null;return T.createElement(T.Fragment,null,n&&T.createElement(eC,null),i!==void 0?T.createElement(gT,null,T.createElement(yT,{asChild:!0},T.createElement(bp,ri({},a,t))),T.createElement(bT,{side:"top",sideOffset:2},T.createElement(KT,null,i,T.createElement(ZT,null)))):T.createElement(bp,ri({},a,c,t)))}function kf(t){let{align:e}=t,n=Ts(t,JT);const{value:i,label:a,key:c,disabled:f}=Cs(),{hideCopyButton:p}=IT(),g=!p&&c!==void 0,[x,m]=T.useState(!1),w=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[c]:i??""})),m(!0)}catch{zy(Ar.CLIPBOARD_ERROR,{[c]:i})}};return T.createElement(GT,{align:e,onPointerLeave:()=>m(!1)},T.createElement(tC,n),g&&!f&&T.createElement("div",{title:`Click to copy ${typeof a=="string"?a:c} value`},x?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:w,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 nC=["toggled"],rC=Kt("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function iC(t){let{toggled:e}=t,n=Ts(t,nC);return T.createElement(rC,ri({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 sC=["input"];function Nf(t){let{input:e}=t,n=Ts(t,sC);return e?T.createElement(QT,n):T.createElement(Zy,n)}function Jy(t,e){const{emitOnEditStart:n,emitOnEditEnd:i}=Cs();return jE(a=>{a.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const c=t(a);return a.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),c},e)}const oC=Kt("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),aC=Kt("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),lC=Kt("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)))"}}}}),uC=Kt("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),cC=Kt("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function fC({value:t,min:e,max:n,onDrag:i,step:a,initialValue:c}){const f=T.useRef(null),p=T.useRef(null),g=T.useRef(0),x=BT("sizes","scrubberWidth"),m=Jy(({event:R,first:D,xy:[M],movement:[z],memo:P})=>{if(D){const{width:A,left:F}=f.current.getBoundingClientRect();g.current=A-parseFloat(x),P=(R==null?void 0:R.target)===p.current?t:Iy((M-F)/A,e,n)}const L=P+Iy(z/g.current,0,n-e);return i(Yy(L,{step:a,initialValue:c})),P}),w=RT(t,e,n);return T.createElement(uC,ri({ref:f},m()),T.createElement(aC,null,T.createElement(cC,{style:{left:0,right:`${(1-w)*100}%`}})),T.createElement(lC,{ref:p,style:{left:`calc(${w} * (100% - ${x}))`}}))}const dC=T.memo(({label:t,onUpdate:e,step:n,innerLabelTrim:i})=>{const[a,c]=T.useState(!1),f=Jy(({active:p,delta:[g],event:x,memo:m=0})=>(c(p),m+=g/2,Math.abs(m)>=1&&(e(w=>parseFloat(w)+Math.floor(m)*n*OT(x)),m=0),m));return T.createElement(HT,ri({dragging:a,title:t.length>1?t:""},f()),t.slice(0,i))});function hC({label:t,id:e,displayValue:n,onUpdate:i,onChange:a,settings:c,innerLabelTrim:f=1}){const p=f>0&&T.createElement(dC,{label:t,step:c.step,onUpdate:i,innerLabelTrim:f});return T.createElement(qT,{id:e,value:String(n),onUpdate:i,onChange:a,innerLabel:p})}function pC(){const t=Cs(),{label:e,value:n,onUpdate:i,settings:a,id:c}=t,{min:f,max:p}=a,g=p!==1/0&&f!==-1/0;return T.createElement(Nf,{input:!0},T.createElement(kf,null,e),T.createElement(oC,{hasRange:g},g&&T.createElement(fC,ri({value:parseFloat(n),onDrag:i},a)),T.createElement(hC,ri({},t,{id:c,label:"value",innerLabelTrim:g?0:1}))))}const vC=Ts(NT,["sanitizeStep"]);Ho({component:pC},vC);var mC=Object.freeze({__proto__:null,schema:(t,e)=>to().schema({options:to().passesAnyOf(to().object(),to().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(c=>String(c))):(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 gC=Kt("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Sp=Kt("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),yC=Kt("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Sp}:focus + &`]:{$focusStyle:""},[`${Sp}:hover + &`]:{$hoverStyle:""}});function bC({displayValue:t,value:e,onUpdate:n,id:i,settings:a,disabled:c}){const{keys:f,values:p}=a,g=T.useRef();return e===p[t]&&(g.current=f[t]),T.createElement(gC,null,T.createElement(Sp,{id:i,value:t,onChange:x=>n(p[Number(x.currentTarget.value)]),disabled:c},f.map((x,m)=>T.createElement("option",{key:x,value:m},x))),T.createElement(yC,null,g.current),T.createElement(iC,{toggled:!0}))}function SC(){const{label:t,value:e,displayValue:n,onUpdate:i,id:a,disabled:c,settings:f}=Cs();return T.createElement(Nf,{input:!0},T.createElement(kf,null,t),T.createElement(bC,{id:a,value:e,displayValue:n,onUpdate:i,settings:f,disabled:c}))}Ho({component:SC},mC);var xC=Object.freeze({__proto__:null,schema:t=>to().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 wC=["displayValue","onUpdate","onChange","editable"],EC=Kt("div",{whiteSpace:"pre-wrap"});function TC(t){let{displayValue:e,onUpdate:n,onChange:i,editable:a=!0}=t,c=Ts(t,wC);return a?T.createElement(Xy,ri({value:e,onUpdate:n,onChange:i},c)):T.createElement(EC,null,e)}function CC(){const{label:t,settings:e,displayValue:n,onUpdate:i,onChange:a}=Cs();return T.createElement(Nf,{input:!0},T.createElement(kf,null,t),T.createElement(TC,ri({displayValue:n,onUpdate:i,onChange:a},e)))}Ho({component:CC},xC);var RC=Object.freeze({__proto__:null,schema:t=>to().boolean().test(t),sanitize:t=>{if(typeof t!="boolean")throw Error("Invalid boolean");return t}});const OC=Kt("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 AC({value:t,onUpdate:e,id:n,disabled:i}){return T.createElement(OC,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 MC(){const{label:t,value:e,onUpdate:n,disabled:i,id:a}=Cs();return T.createElement(Nf,{input:!0},T.createElement(kf,null,t),T.createElement(AC,{value:e,onUpdate:n,id:a,disabled:i}))}Ho({component:MC},RC),Kt("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});class Vo extends Xi{constructor(e){super(),this.type="spacial-content",this.style={opacity:1},this.format="jpg",this.tileUrl=cw(e.url),this.id=e.id||`${this.tileUrl}--${e.scaleFactor}`,this.points=e.displayPoints?e.displayPoints:ws(e.points,eo(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=lt([...this.points]),i=n.length/5,a=e.crop.x||0,c=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 x=g*5;n[x+1]<f&&n[x+3]>a&&n[x+2]<p&&n[x+4]>c?(n[x+1]=no(n[x+1],a,f),n[x+3]=no(n[x+3],a,f),n[x+2]=no(n[x+2],c,p),n[x+4]=no(n[x+4],c,p)):n[x]=0}Gi(n,Rr(-e.crop.x,-e.crop.y)),this.crop?this.crop.set(n):this.crop=n}}static fromTile(e,n,i,a,c,f){i.height=i.height?i.height:i.width;const p=Math.ceil(n.width/a),g=Math.ceil(n.height/a),x=Math.ceil(p/i.width),m=Math.ceil(g/i.height),w=kt.grid(x,m),R=kt.grid(x,m);for(let M=0;M<m;M++)for(let z=0;z<x;z++){const P=z*i.width,L=M*i.height;R.addPoints(P*a,L*a,z===x-1?n.width:(P+i.width)*a,M===m-1?n.height:(L+i.height)*a),w.addPoints(P,L,z===x-1?p:P+i.width,M===m-1?g:L+i.height)}const D=new Vo({url:e,scaleFactor:a,points:w.build(),displayPoints:R.build(),width:n.width,height:n.height,tileWidth:i.width,format:f});return D.applyProps({service:c}),D}getImageUrl(e){const n=this.points.slice(e*5,e*5+5),i=n[3]-n[1],a=n[4]-n[2],c=Math.ceil(i/this.display.scale);return`${this.tileUrl}/${n[1]},${n[2]},${i},${a}/${c>this.tileWidth?this.tileWidth:c},/0/default.${this.format||"jpg"}`}getAllPointsAt(e,n,i){const a=Ru(this.crop||this.points,e);return[[this,a,n]]}transform(e){Gi(this.points,e)}getScheduledUpdates(e,n){return[]}}class PC extends Xi{constructor(){super(...arguments),this.type="spacial-content"}getAllPointsAt(e,n,i){return[[this,this.points,n]]}}class LC extends PC{constructor(e){super(),this.images=[],this.allImages=[],this.scaleFactors=[],this.aggregateBuffer=lt(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 Mi&&(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 c=this.images.pop();c&&(c instanceof Mi||c.priority)?(i.priority&&this.images.push(i),this.images.push(c)):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=kt.singleBox(e.width,e.height),this.lazyLoader=e.loadFullImages,e.loadFullImages||(this.isFullyLoaded=!0),this.display={x:0,y:0,points:kt.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=uw(1/(i||1)/(window.devicePixelRatio||1),this.images,this.renderOptions.quality),c=this.images.length,f=n?xs(n,Rr(this.x,this.y)):Rr(this.x,this.y);if(a!==this.images.length-1&&this.images[a+1]){let p=[];for(let m=c-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 x=[];for(let m=0;m<p.length;m++)x.push(...this.images[p[m]].getAllPointsAt(e,f,i));return x}return this.images[a].getAllPointsAt(e,f,i)}}function zf(t,e,n,i,a){const c=Math.PI/180*a,f=Math.cos(c),p=Math.sin(c),g=f*(n-t)+p*(i-e)+t,x=f*(i-e)-p*(n-t)+e;return[g,x]}class Nu extends Xi{constructor(e,n){super(),this.type="world-object",this.intersectionBuffer=lt(5),this.aggregateBuffer=lt(9),this.invertedBuffer=lt(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=lt([1,i,a,i+e.width,a+e.height]),this.worldPoints=lt([1,i,a,i+e.width,a+e.height]),this.filteredPointsBuffer=lt(e.layers.length*5)):(this.id="",this.scale=1,this.layers=[],this.points=lt(5),this.worldPoints=lt(5),this.filteredPointsBuffer=lt(5))}static createWithProps(e){const n=new Nu;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=lt(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),c=this.layers.slice(i);this.layers=[...a,e,...c]}hideInstance(){console.warn("hideInstance: not yet implemented")}getObjectsAt(e,n){if(this.rotation&&(e=this.applyRotation(e)),Ru(this.points,e,this.filteredPointsBuffer)[0]===0)return[];const a=this.layers.length,c=[];for(let f=0;f<a;f++){const p=this.layers[f];if(n&&p.isShape){const x=ws(p.points,Rr(this.x,this.y));if(!p.intersects([e[1]-x[1],e[2]-x[2]]))continue}if(Ru(ws(p.points,Rr(this.x,this.y)),e,this.filteredPointsBuffer)[0]!==0&&c.push(p),n){const x=p;c.push(...x.getObjectsAt(e,n))}}return c}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]},c={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,x]=zf(f,p,n.x,n.y,this.rotation),[m,w]=zf(f,p,i.x,i.y,this.rotation),[R,D]=zf(f,p,a.x,a.y,this.rotation),[M,z]=zf(f,p,c.x,c.y,this.rotation),P=Math.min(g,m,R,M),L=Math.max(g,m,R,M),A=Math.min(x,w,D,z),F=Math.max(x,w,D,z);return lt([e[0],P,A,L,F])}return e}getAllPointsAt(e,n,i){const a=xs(Rr(this.x,this.y),eo(this.scale),this.aggregateBuffer);this.rotation&&(e=this.applyRotation(e));const c=aw(e,this.points,this.intersectionBuffer),f=this.layers.length,p=[],g=ws(c,xs(eo(1/this.scale),Rr(-this.x,-this.y),this.invertedBuffer)),x=n?xs(n,a,this.aggregateBuffer):a,m=i*this.scale;for(let w=0;w<f;w++)p.push(...this.layers[w].getAllPointsAt(g,x,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||lt([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=lt(this.layers.length*5)}getScheduledUpdates(e,n){const i=this.layers.length;this._updatedList=[];const a=n*this.scale;for(let c=0;c<i;c++){const f=this.layers[c].getScheduledUpdates(e,a);f&&this._updatedList.push(...f)}return this._updatedList}}class dl extends Xi{constructor(e=0,n=0,i=100,a="left-to-right"){super(),this.id="world",this.aggregateBuffer=lt(9),this.isDirty=!1,this.zones=[],this.triggerQueue=[],this.activatedEvents=[],this._updatedList=[],this.translationBuffer=lt(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=lt(i*5),this.filteredPointsBuffer=lt(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 dl;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 c of i)if(c.x&&c.y){const f=kt.singleBox(1,1,c.x,c.y);a.push(this.getObjectsAt(f,!0).reverse())}return a.map(c=>this.propagateEvent(e,n,c,{bubbles:!0,cancelable:!0}))}propagatePointerEvent(e,n,i,a,c={}){const f=kt.singleBox(1,1,i,a),p=this.getObjectsAt(f,!0).reverse();return this.propagateEvent(e,n,p,c)}propagateEvent(e,n,i,{bubbles:a=!1,cancelable:c=!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 w=i[m][1].length;if(w)for(let R=0;R<w;R++)this._propagateEventTargets.unshift(i[m][1][R])}const g=this._propagateEventTargets.length;let x=!1;for(let m=0;m<g&&(n.atlasTarget=this._propagateEventTargets[m],n.atlasWorld=this,x=this._propagateEventTargets[m].dispatchEvent(e,n)||x,!f);m++);return x&&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(lw(this.points)===this.objects.length){const e=this.points,n=lt(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=lt(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 c=Math.max(...n);c!==this._width&&(this._width=c,e=!0);const f=Math.max(...i);f!==this._height&&(this._height=f,e=!0),e&&this.trigger("recalculate-world-size",{width:c,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:c}=n,f=i/e.width;this.checkResizeInternalBuffer(),this.points.set(kt.singleBox(e.width,e.height,0,0),this.objects.length*5);const p=new Nu(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,c),this.filteredPointsBuffer=lt(this.points.length*2),this.triggerRepaint(),this.needsRecalculate=!0,p}scaleWorldObject(e,n){Gi(this.points.subarray(e*5,e*5+5),Ou(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){Gi(this.points.subarray(e*5,e*5+5),Rr(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=kt.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=Ru(this.points,e,this.filteredPointsBuffer),a=this.objects.length;this._updatedList=[];for(let c=0;c<a;c++)if(i[c*5]!==0){if(!this.objects[c])continue;this._updatedList.push(...this.objects[c].getScheduledUpdates(e,n))}return this._updatedList}getObjectsAt(e,n=!1){const i=this.getActiveZone(),a=Ru(this.points,e,this.filteredPointsBuffer),c=this.renderOrder.length,f=[];for(let p=0;p<c;p++){const g=this.renderOrder[p];if(a[g*5]!==0){const x=this.objects[g];if(!x||i&&i.objects.indexOf(x)===-1)continue;if(x.type!=="world-object"){f.push([x,[x]]);continue}n?f.push([x,x.getObjectsAt(e,n)]):f.push([x,this.emptyPaintables])}}return f}getPointsAt(e,n,i=1){const a=this.getObjectsAt(e),c=xs(eo(i),Rr(-e[1],-e[2]),this.translationBuffer),f=n?xs(n,c,this.aggregateBuffer):c,p=a.length,g=[];for(let x=0;x<p;x++)a[x]&&g.push(...a[x][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 jf=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,_f={},DC=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class zu extends Xi{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:lt(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=bf(12),this.points=lt(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=_f[i]||jf.exec(i)||jf.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=_f[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=_f[e.style.outline]||jf.exec(e.style.outline)||jf.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=_f[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 DC)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=kt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=kt.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 If extends Xi{constructor(){super(),this.type="spacial-content",this.color="#000",this.text="",this.display={x:0,y:0,scale:1,width:100,height:100,points:lt(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=lt(5)}getAllPointsAt(e,n){return[[this,this.points,n]]}applyProps({id:e,target:n,text:i,color:a,backgroundColor:c,fontSize:f=18,interactive:p,fontFamily:g="Arial, sans-serif",...x}){x.font=`${f}px ${g}`,this.interactive=p||!1,typeof i<"u"&&(this.text=i||""),a&&(this.color=a),c&&(this.backgroundColor=c),e&&(this.id=e),n&&(this.points=kt.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,...x},this.__revision++}}const On=Math.pow,Uf=Math.sqrt,ju=Math.sin,e0=Math.cos,_u=Math.PI,Ff=1.70158,Bf=Ff*1.525,t0=Ff+1,n0=2*_u/3,r0=2*_u/4.5,Hf=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},io={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-On(-2*t+2,2)/2},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1-On(1-t,3)},easeInOutCubic:function(t){return t<.5?4*t*t*t:1-On(-2*t+2,3)/2},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1-On(1-t,4)},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-On(-2*t+2,4)/2},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1-On(1-t,5)},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1-On(-2*t+2,5)/2},easeInSine:function(t){return 1-e0(t*_u/2)},easeOutSine:function(t){return ju(t*_u/2)},easeInOutSine:function(t){return-(e0(_u*t)-1)/2},easeInExpo:function(t){return t===0?0:On(2,10*t-10)},easeOutExpo:function(t){return t===1?1:1-On(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?On(2,20*t-10)/2:(2-On(2,-20*t+10))/2},easeInCirc:function(t){return 1-Uf(1-On(t,2))},easeOutCirc:function(t){return Uf(1-On(t-1,2))},easeInOutCirc:function(t){return t<.5?(1-Uf(1-On(2*t,2)))/2:(Uf(1-On(-2*t+2,2))+1)/2},easeInBack:function(t){return t0*t*t*t-Ff*t*t},easeOutBack:function(t){return 1+t0*On(t-1,3)+Ff*On(t-1,2)},easeInOutBack:function(t){return t<.5?On(2*t,2)*((Bf+1)*2*t-Bf)/2:(On(2*t-2,2)*((Bf+1)*(t*2-2)+Bf)+2)/2},easeInElastic:function(t){return t===0?0:t===1?1:-On(2,10*t-10)*ju((t*10-10.75)*n0)},easeOutElastic:function(t){return t===0?0:t===1?1:On(2,-10*t)*ju((t*10-.75)*n0)+1},easeInOutElastic:function(t){return t===0?0:t===1?1:t<.5?-(On(2,20*t-10)*ju((20*t-11.125)*r0))/2:On(2,-20*t+10)*ju((20*t-11.125)*r0)/2+1},easeInBounce:function(t){return 1-Hf(1-t)},easeOutBounce:Hf,easeInOutBounce:function(t){return t<.5?(1-Hf(1-2*t))/2:(1+Hf(2*t-1))/2}};class kC{constructor(e){this.runtime=e,this.pendingTransition={from:lt(5),to:lt(5),elapsed_time:0,done:!0,total_time:0,timingFunction:io.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=lt(this.runtime.target),this.pendingTransition.to=lt(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,c=i.total_time===0?1:a===0?0:i.timingFunction(a);e[1]=i.from[1]+(i.to[1]-i.from[1])*c,e[2]=i.from[2]+(i.to[2]-i.from[2])*c,e[3]=i.from[3]+(i.to[3]-i.from[3])*c,e[4]=i.from[4]+(i.to[4]-i.from[4])*c,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:io.easeOutExpo}}))}}zoomTo(e,{origin:n,stream:i=!1,transition:a}={}){const c=this.runtime.getZoomedPosition(e,{origin:n}),f=Math.abs(1-e);this.applyTransition(c,a,{duration:2e3*f,easing:io.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:io.easeOutQuart,constrain:!1}),this.runtime.updateNextFrame())}applyTransition(e,n,i,{stream:a}={}){this.pendingTransition.from=lt(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)||io.easeInOutSine}goToRegion(e,{transition:n}={}){const i=this.runtime.clampRegion(e);this.applyTransition(kt.singleBox(i.width,i.height,i.x,i.y),n,{duration:1e3,easing:io.easeOutExpo,constrain:!0}),this.runtime.updateNextFrame()}}class Vf{constructor(e,n,i,a=[],c){this.id=bf(),this.ready=!1,this.transformBuffer=lt(500),this.lastTarget=lt(5),this.zoomBuffer=lt(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.hookOptions={filters:{grayscale:0,contrast:0,brightness:0,saturate:0,sepia:0,invert:0,hueRotate:0,blur:0}},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,x=this.renderer.pendingUpdate();if(this.transitionManager.hasPending()&&(this.transitionManager.runTransition(this.target,p),this.pendingUpdate=!0,this.updateControllerPosition()),!this.firstRender&&!g&&!x&&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,this.hookOptions);const m=this.getScaleFactor(),w=this.renderer.getPointsAt(this.world,this.target,this.aggregate,m),R=w.length;for(let z=0;z<R;z++){const P=w[z][0],L=w[z][1],A=w[z][2],F=A?ws(L,A,this.transformBuffer):L;this.renderer.prepareLayer(P,P.__parent&&A?ws(P.__parent.crop||P.__parent.points,A):F);const $=F.length/5;for(let Q=0;Q<$;Q++){const _=Q*5;F[_]!==0&&(this.renderer.paint(P,Q,F[_+1],F[_+2],F[_+3]-F[_+1],F[_+4]-F[_+2]),this.hook("useAfterPaint",P))}this.renderer.finishLayer(P,L)}this.renderer.afterFrame(this.world,p,this.target,this.hookOptions),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 D=this.world.getScheduledUpdates(this.target,m),M=D.length;if(M>0)for(let z=0;z<M;z++){const P=D[M-z-1]();P?P.then(()=>{this.pendingUpdate=!0}):this.pendingUpdate=!0}},this.renderer=e,this.world=n,this.options={maxOverZoom:1,maxUnderZoom:1,visibilityRatio:1.5,...c||{}},this.target=kt.projection(i),this.manualHomePosition=!1,this.pendingUpdate=!0,this.homePosition=kt.projection(this.world),this.manualFocalPosition=!1,this.focalPosition=this.target,this.updateFocalPosition(),this.transitionManager=new kC(this),this.aggregate=eo(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(kt.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,c=this.height*n,f=i.width/a,p=i.height/c,g=a/c;if(e.cover?f>p:f<p){const x=g*i.height,m=(x-i.width)/2;this.target[1]=-m+i.x,this.target[2]=i.y,this.target[3]=x-m+i.x,this.target[4]=i.height+i.y}else{const x=i.width/g,m=(x-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+x-m}this.constrainBounds(this.target),this.updateControllerPosition()}resize(e,n,i,a){this.updateFocalPosition(e-n,i-a);const c=n/e,f=a/i;this.target[3]=this.target[1]+(this.target[3]-this.target[1])*c,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,c=Math.min(i,a),f=0,p=0,g=this.x+f,x=this.y+p;if(i<a){const m=this.height-this.width;this.focalPosition=kt.projection({x:g,y:x+m/2,width:c-f*2,height:c-p*2}),this.pendingUpdate=!0}else{const m=this.width-this.height;this.focalPosition=kt.projection({x:g+m/2,y:x,width:c-f*2,height:c-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:c,minY:f,maxY:p}=this.getBounds({target:e,padding:n});let g=!1;const x=i?e:lt(e),m=e[3]-e[1],w=e[4]-e[2];return a>e[1]&&(g=!0,x[1]=a,x[3]=a+m),f>e[2]&&(g=!0,x[2]=f,x[4]=f+w),c<e[1]&&(g=!0,x[1]=c,x[3]=c+m),p<e[2]&&(g=!0,x[2]=p,x[4]=p+w),[g,x]}getBounds(e){const n=e.target||this.target,i=e.padding,a=this.options.visibilityRatio,c=Math.abs(1-a);if(this.world.hasActiveZone()){const A=this.world.getActiveZone();if(A){const F=n[3]-n[1]<A.points[3]-A.points[1],$=n[4]-n[2]<A.points[4]-A.points[2];return{minX:F?A.points[1]-i:A.points[1]+(A.points[3]-A.points[1])/2-(n[3]-n[1])/2,maxX:$?A.points[2]-i:A.points[2]+(A.points[4]-A.points[2])/2-(n[4]-n[2])/2,minY:F?A.points[3]+i:A.points[1]+(A.points[3]-A.points[1])/2-(n[3]-n[1])/2,maxY:$?A.points[4]+i:A.points[2]+(A.points[4]-A.points[2])/2-(n[4]-n[2])/2}}}const f=n[3]-n[1],p=this.world.width,g=-f*c,x=p-f-g,m=n[4]-n[2],w=this.world.height,R=-m*c,D=w-m-R,M=Math.max(g,x),z=Math.min(g,x),P=Math.max(R,D),L=Math.min(R,D);return{minX:z,maxX:M,minY:L,maxY:P}}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 c=i?{width:i[3]-i[1],height:i[4]-i[2]}:void 0,f=c?this.renderer.getScale(c.width,c.height):this.getScaleFactor(),p=c?c.width:this.width,g=c?c.height:this.height,x=(a=this.getRendererScreenPosition())==null?void 0:a.width,m=this.world.width,w=x?x/m:1,R=this.options.maxUnderZoom,D=Math.max(w||1,this.options.maxOverZoom),M=1/e,z=f*M;if(M<1){const A=p*f,F=g*f,$=this.world.width/A,Q=this.world.height/F;if($>Q){const _=this.world.width*z,ee=~~(p*f)*R;_<ee&&(e=this.world.width*f/(p*f*R))}else{const _=this.world.height*z,ee=~~(g*f)*R;_<ee&&(e=this.world.height*f/(g*f*R))}}else z>D&&(e=f/D);const L=ws(this.target,Ou(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(L,{ref:!0,panPadding:100}),L}clampRegion({x:e,y:n,width:i,height:a,padding:c=0}){const f=this.width,p=this.height,g=i/f<a/p,x=e-c,m=n-c,w=i+c*2,R=a+c*2;if(g){const M=R/p*f;return{x:x-(M-w)/2,y:m,width:M,height:R}}const D=w/f*p;return{x,y:m-(D-R)/2,width:w,height:D}}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 c=kt.singleBox(i,a,e,n);return Gi(c,xs(eo(this.getScaleFactor()),Rr(-this.target[1],-this.target[2]))),{x:c[1],y:c[2],width:c[3]-c[1],height:c[4]-c[2],strand:c}}setScale(e,n){Gi(this.target,Ou(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 Iu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Wf=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new i0}abort(e=new Error("This operation was aborted")){this.signal.reason=e,this.signal.dispatchEvent({type:"abort",target:this.signal})}},NC=typeof AbortSignal=="function",zC=typeof Wf.AbortSignal=="function",i0=NC?AbortSignal:zC?Wf.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,wp=(t,e)=>{const n=`LRU_CACHE_OPTION_${t}`;$f(n)&&Tp(n,`${t} option`,`options.${e}`,Wo)},Ep=(t,e)=>{const n=`LRU_CACHE_METHOD_${t}`;if($f(n)){const{prototype:i}=Wo,{get:a}=Object.getOwnPropertyDescriptor(i,t);Tp(n,`${t} method`,`cache.${e}()`,a)}},jC=(t,e)=>{const n=`LRU_CACHE_PROPERTY_${t}`;if($f(n)){const{prototype:i}=Wo,{get:a}=Object.getOwnPropertyDescriptor(i,t);Tp(n,`${t} property`,`cache.${e}`,a)}},s0=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},$f=t=>!xp.has(t),Tp=(t,e,n,i)=>{xp.add(t);const a=`The ${e} is deprecated. Please use ${n} instead.`;s0(a,"DeprecationWarning",t,i)},so=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),o0=t=>so(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?qf:null:null;class qf extends Array{constructor(e){super(e),this.fill(0)}}class _C{constructor(e){if(e===0)return[];const n=o0(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class Wo{constructor(e={}){const{max:n=0,ttl:i,ttlResolution:a=1,ttlAutopurge:c,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:g,dispose:x,disposeAfter:m,noDisposeOnSet:w,noUpdateTTL:R,maxSize:D=0,maxEntrySize:M=0,sizeCalculation:z,fetchMethod:P,fetchContext:L,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:Q,ignoreFetchAbort:_}=e,{length:K,maxAge:ee,stale:V}=e instanceof Wo?{}:e;if(n!==0&&!so(n))throw new TypeError("max option must be a nonnegative integer");const ae=n?o0(n):Array;if(!ae)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=D,this.maxEntrySize=M||this.maxSize,this.sizeCalculation=z||K,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=P||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=L,!this.fetchMethod&&L!==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 ae(n),this.prev=new ae(n),this.head=0,this.tail=0,this.free=new _C(n),this.initialFill=1,this.size=0,typeof x=="function"&&(this.dispose=x),typeof m=="function"?(this.disposeAfter=m,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!R,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!Q,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.maxSize!==0&&!so(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!so(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!g||!!V,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=so(a)||a===0?a:1,this.ttlAutopurge=!!c,this.ttl=i||ee||0,this.ttl){if(!so(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";$f(ge)&&(xp.add(ge),s0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ge,Wo))}V&&wp("stale","allowStale"),ee&&wp("maxAge","ttl"),K&&wp("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new qf(this.max),this.starts=new qf(this.max),this.setItemTTL=(i,a,c=Iu.now())=>{if(this.starts[i]=a!==0?c: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?Iu.now():0};let e=0;const n=()=>{const i=Iu.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 qf(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(!so(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,e),!so(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 Ep("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],c=this.isBackgroundFetch(a)?a.__staleWhileFetching:a;if(c===void 0)continue;const f={value:c};if(this.ttls){f.ttl=this.ttls[n];const p=Iu.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=Iu.now()-a}this.set(n,i.value,i)}}dispose(e,n,i){}set(e,n,{ttl:i=this.ttl,start:a,noDisposeOnSet:c=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 x=this.size===0?void 0:this.keyMap.get(e);if(x===void 0)x=this.newIndex(),this.keyList[x]=e,this.valList[x]=n,this.keyMap.set(e,x),this.next[this.tail]=x,this.prev[x]=this.tail,this.tail=x,this.size++,this.addItemSize(x,f),g=!1;else{this.moveToTail(x);const m=this.valList[x];n!==m&&(this.isBackgroundFetch(m)?m.__abortController.abort(new Error("replaced")):c||(this.dispose(m,e,"set"),this.disposeAfter&&this.disposed.push([m,e,"set"])),this.removeItemSize(x),this.valList[x]=n,this.addItemSize(x,f))}if(i!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),g||this.setItemTTL(x,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 c=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(c))return c;const f=new Wf;i.signal&&i.signal.addEventListener("abort",()=>f.abort(i.signal.reason));const p={signal:f.signal,options:i,context:a},g=(R,D=!1)=>{const{aborted:M}=f.signal,z=i.ignoreFetchAbort&&R!==void 0;return M&&!z&&!D?x(f.signal.reason):(this.valList[n]===w&&(R===void 0?w.__staleWhileFetching?this.valList[n]=w.__staleWhileFetching:this.delete(e):this.set(e,R,p.options)),R)},x=R=>{const{aborted:D}=f.signal,M=D&&i.allowStaleOnFetchAbort,z=M||i.allowStaleOnFetchRejection,P=z||i.noDeleteOnFetchRejection;if(this.valList[n]===w&&(!P||w.__staleWhileFetching===void 0?this.delete(e):M||(this.valList[n]=w.__staleWhileFetching)),z)return w.__staleWhileFetching;if(w.__returned===w)throw R},m=(R,D)=>{this.fetchMethod(e,c,p).then(M=>R(M),D),f.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(R(),i.allowStaleOnFetchAbort&&(R=M=>g(M,!0)))})},w=new Promise(m).then(g,x);return w.__abortController=f,w.__staleWhileFetching=c,w.__returned=null,n===void 0?(this.set(e,w,p.options),n=this.keyMap.get(e)):this.valList[n]=w,w}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:c=this.ttl,noDisposeOnSet:f=this.noDisposeOnSet,size:p=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:R=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,fetchContext:M=this.fetchContext,forceRefresh:z=!1,signal:P}={}){if(!this.fetchMethod)return this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a});const L={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:c,noDisposeOnSet:f,size:p,sizeCalculation:g,noUpdateTTL:x,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:D,ignoreFetchAbort:R,signal:P};let A=this.keyMap.get(e);if(A===void 0){const F=this.backgroundFetch(e,A,L,M);return F.__returned=F}else{const F=this.valList[A];if(this.isBackgroundFetch(F))return n&&F.__staleWhileFetching!==void 0?F.__staleWhileFetching:F.__returned=F;if(!z&&!this.isStale(A))return this.moveToTail(A),i&&this.updateItemAge(A),F;const $=this.backgroundFetch(e,A,L,M);return n&&$.__staleWhileFetching!==void 0?$.__staleWhileFetching:$.__returned=$}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet}={}){const c=this.keyMap.get(e);if(c!==void 0){const f=this.valList[c],p=this.isBackgroundFetch(f);return this.isStale(c)?p?n?f.__staleWhileFetching:void 0:(a||this.delete(e),n?f:void 0):p?void 0:(this.moveToTail(c),i&&this.updateItemAge(c),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 Ep("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 Ep("reset","clear"),this.clear}get length(){return jC("length","size"),this.size}static get AbortController(){return Wf}static get AbortSignal(){return i0}}var IC=Wo;const Yf=/([0-9]+(px|em)\s+)+(solid)\s+(.*)/g,Qf={},UC=["backgroundColor","opacity","boxShadow","borderColor","borderWidth","borderStyle","outlineColor","outlineWidth","outlineOffset","outlineStyle"];class a0 extends Xi{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:lt(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=bf(12),this.points=lt(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])),c=Math.max(0,...e.map(f=>f[1]));this.boundingBox={x:n,y:i,width:a-n,height:c-i};return}this.boundingBox=null}intersects(e){if(!e||this.shape.type==="none")return!1;const[n,i]=e,a=this.shape.points;let c=this.boundingBox;if(c||(this.updateBoundingBox(),c=this.boundingBox),!c||n<c.x||n>c.x+c.width||i<c.y||i>c.height+c.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 c=0;c<a;c++)if(e.points[c][0]!==this.shape.points[c][0]||e.points[c][1]!==this.shape.points[c][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=Qf[i]||Yf.exec(i)||Yf.exec(i);a&&(this._parsed.border.id=i,this._parsed.border.match=Qf[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=Qf[e.style.outline]||Yf.exec(e.style.outline)||Yf.exec(e.style.outline);a&&(this._parsed.outline.id=e.style.outline,this._parsed.outline.match=Qf[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 UC)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=kt.singleBox(e.target.width,e.target.height,e.target.x,e.target.y),this.display.points=kt.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 l0=/(-?[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,u0={},Gf={};class FC{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 IC({maxSize:1024*512*512,dispose:(i,a,c)=>{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(),c=a.width/e,f=a.height/n,p=(c<f?f:c)*(i&&this.dpi||1);return Number.isNaN(p)||(this.lastKnownScale=p),this.lastKnownScale}beforeFrame(e,n,i,a){this.options.debug&&this.stats&&this.stats.begin(),this.frameIsRendering=!0,this.visible=[],this.options.beforeFrame&&this.options.beforeFrame(n);const c=this.getCanvasDims();if(this.ctx.globalAlpha=1,this.ctx.fillStyle=this.options.background||"rgb(0, 0, 0)",this.ctx.fillRect(0,0,c.width,c.height),a.enableFilters&&(a.filters.brightness||a.filters.contrast||a.filters.grayscale||a.filters.invert||a.filters.sepia||a.filters.saturate||a.filters.hueRotate||a.filters.blur)){let f="";a.filters.brightness&&(f+=`brightness(${~~(100+a.filters.brightness*100)}%) `),a.filters.contrast&&(f+=`contrast(${~~(100+a.filters.contrast*100)}%) `),a.filters.grayscale&&(f+=`grayscale(${~~(a.filters.grayscale*100)}%) `),a.filters.invert&&(f+=`invert(${~~(a.filters.invert*100)}%) `),a.filters.sepia&&(f+=`sepia(${~~(a.filters.sepia*100)}%) `),a.filters.saturate&&(f+=`saturate(${~~(100+a.filters.saturate*100)}%) `),a.filters.hueRotate&&(f+=`hue-rotate(${a.filters.hueRotate}deg) `),a.filters.blur&&(f+=`blur(${a.filters.blur}px) `),this.ctx.filter=f}else this.ctx.filter="none"}applyTransform(e,n,i,a,c){const f=e.__owner.value;if(f&&f.rotation){this.ctx.save();const p=n+a/2,g=i+c/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,c,f){const p=this.ctx.globalAlpha;if(e instanceof Mi||e instanceof Vo){if(e.display.rotation){this.ctx.save();let m=i+c/2,w=a+f/2;e.crop&&(m-=e.crop[n*5+1],w-=e.crop[n*5+2]),this.ctx.translate(m,w),this.ctx.rotate(e.display.rotation*Math.PI/180),this.ctx.translate(-m,-w)}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,w=this.getCanvasDims();if((m.indices.indexOf(n)===-1||this.invalidated.indexOf(m.canvases[n])!==-1)&&this.schedulePaintToCanvas(m,e,n,Sf({x:i+c/2,y:a+c/2},{x:w.width/2,y:w.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 D=[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];D[0]+=e.cropData.x/e.display.scale,D[1]+=e.cropData.y/e.display.scale;const M=e.x*this.lastKnownScale,z=e.y*this.lastKnownScale,P=[i+M,a+z,c,f];P[0]+=M,P[1]+=z,this.ctx.drawImage(R,D[0],D[1],D[2],D[3],P[0],P[1],P[2]+1,P[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,c+Number.MIN_VALUE,f+Number.MIN_VALUE)}catch{}e.display.rotation&&this.ctx.restore()}const g=e instanceof zu&&this.options.box,x=e instanceof a0&&this.options.polygon;if((g||x)&&!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:{}),w=e.props.relativeStyle?1:c/e.width;typeof m.opacity<"u"&&(this.ctx.globalAlpha=m.opacity);let R=0;typeof m.borderWidth<"u"&&(R=parseInt(m.borderWidth,10)*w);let D=0;typeof m.outlineWidth<"u"&&(D=parseInt(m.outlineWidth,10)*w);let M=0;if(typeof m.outlineOffset<"u"&&(M=parseInt(m.outlineOffset,10)*w),m.borderColor&&(this.ctx.strokeStyle=m.borderColor),m.boxShadow){const z=m.boxShadow.split(/,(?![^(]*\))/);for(const P of z){const L=u0[P]||l0.exec(P)||l0.exec(P);u0[P]=L,L&&(this.ctx.save(),this.ctx.shadowOffsetX=parseInt(L[1])*this.dpi*w,this.ctx.shadowOffsetY=parseInt(L[3])*this.dpi*w,this.ctx.shadowBlur=parseInt(L[5])*this.dpi*w,this.ctx.shadowColor=L[9],this.ctx.fillStyle="rgba(0,0,0,1)",this.ctx.fillRect(i+R,a+R,c,f),this.ctx.restore())}}if(this.ctx.fillStyle=m.backgroundColor||"transparent",this.ctx.lineWidth=R,x){const z=e.shape,P=z.points||[],L=P.length;this.ctx.beginPath();for(let A=0;A<L;A++)this.ctx.lineTo(i+P[A][0]*this.lastKnownScale,a+P[A][1]*this.lastKnownScale);z.open||this.ctx.closePath(),R&&this.ctx.stroke(),z.open||this.ctx.fill()}else R&&this.ctx.strokeRect(i+R/2,a+R/2,c+R,f+R),this.ctx.fillRect(i+R,a+R,c,f);D&&(m.outlineColor&&(this.ctx.strokeStyle=m.outlineColor),this.ctx.lineWidth=D,this.ctx.strokeRect(i-D/2-M,a-D/2-M,c+R*2+D+M*2,f+R*2+D+M*2))}this.ctx.globalAlpha=p}}loadImage(e,n,i,a=!1){if(Gf[e]&&Gf[e].naturalWidth>0){n(Gf[e]);return}try{let c=!1;a||setTimeout(()=>{c||this.loadImage(e,n,i,!0)},3e3);const f=document.createElement("img");f.decoding="auto",f.onload=function(){c=!0,n(f),Gf[e]=f,f.onload=null},this.options.crossOrigin&&(f.crossOrigin="anonymous"),f.src=e,f.complete&&f.onload({}),f.width}catch(c){console.log("image error",c),i(c)}}schedulePaintToCanvas(e,n,i,a){this.imagesPending++,e.indices.push(i);const c=`${n.id}--${n.display.scale}-${i}`,f=this.invalidated.indexOf(c);f!==-1&&this.invalidated.splice(f,1),e.canvases[i]=c,n.__host.canvas.loading=!0,this.loadingQueueOrdered=!1,this.loadingQueue.push({id:c,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,x=>{this.loadingQueue.push({id:c,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 w=n.display.points.slice(i*5,i*5+5),R=document.createElement("canvas"),D=R.getContext("2d");R.width=w[3]-w[1],R.height=w[4]-w[2],this.hostCache.set(e.canvases[i],R),this.drawCalls.push(()=>{D.drawImage(x,0,0,w[3]-w[1],w[4]-w[2]),m()})})}),p()},x=>{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 Mi||e instanceof Vo)&&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 c=n[3]-n[1]<a.points[3]-a.points[1],f=n[4]-n[2]<a.points[4]-a.points[2];return{x1:c?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:c?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 c0{constructor(e){this.renderers=[];for(const n of e)n&&this.renderers.push(n);this.length=this.renderers.length}afterFrame(e,n,i,a){for(let c=0;c<this.length;c++)this.renderers[c].afterFrame(e,n,i,a)}afterPaintLayer(e,n){for(let i=0;i<this.length;i++)this.renderers[i].afterPaintLayer(e,n)}beforeFrame(e,n,i,a){for(let c=0;c<this.length;c++)this.renderers[c].beforeFrame(e,n,i,a)}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,c,f){for(let p=0;p<this.length;p++)this.renderers[p].paint(e,n,i,a,c,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 BC{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=eo(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,c=this.initialHeight/e.height,f=this.widthRatio>this.heightRatio?a:c;if(this.target=i,this.bounds){const p=e.getPointsAt(this.bounds,this.aggregate,f);for(const[g,x]of p)if(g instanceof Mi&&g.__host.canvas){const m=x.length/5;for(let w=0;w<m;w++)g.__host.canvas.canvases[w]&&(x[w+1]*f,x[w+2]*f,(x[w+3]-x[w+1])*f,(x[w+4]-x[w+2])*f)}}e.getPoints().forEach((p,g,x)=>{if(g%5===0&&p){const m={x1:x[g+1]*f,y1:x[g+2]*f,x2:x[g+3]*f,y2:x[g+4]*f,width:(x[g+3]-x[g+1])*f,height:(x[g+4]-x[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=kt.singleBox(e.width,e.height)}drawImage(){}afterPaintLayer(e,n){}paint(e,n,i,a,c,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 f0=!1,$o,Cp,Rp,Xf,Kf,d0,Zf,Op,Ap,Mp,h0,Pp,Lp,p0,v0;function Br(){if(!f0){f0=!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(Pp=/\b(iPhone|iP[ao]d)/.exec(t),Lp=/\b(iP[ao]d)/.exec(t),Mp=/Android/i.exec(t),p0=/FBAN\/\w+;/i.exec(t),v0=/Mobile/i.exec(t),h0=!!/Win64/.exec(t),e){$o=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,$o&&document&&document.documentMode&&($o=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(t);d0=i?parseFloat(i[1])+4:$o,Cp=e[2]?parseFloat(e[2]):NaN,Rp=e[3]?parseFloat(e[3]):NaN,Xf=e[4]?parseFloat(e[4]):NaN,Xf?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Kf=e&&e[1]?parseFloat(e[1]):NaN):Kf=NaN}else $o=Cp=Rp=Kf=Xf=NaN;if(n){if(n[1]){var a=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Zf=a?parseFloat(a[1].replace("_",".")):!0}else Zf=!1;Op=!!n[2],Ap=!!n[3]}else Zf=Op=Ap=!1}}var Dp={ie:function(){return Br()||$o},ieCompatibilityMode:function(){return Br()||d0>$o},ie64:function(){return Dp.ie()&&h0},firefox:function(){return Br()||Cp},opera:function(){return Br()||Rp},webkit:function(){return Br()||Xf},safari:function(){return Dp.webkit()},chrome:function(){return Br()||Kf},windows:function(){return Br()||Op},osx:function(){return Br()||Zf},linux:function(){return Br()||Ap},iphone:function(){return Br()||Pp},mobile:function(){return Br()||Pp||Lp||Mp||v0},nativeApp:function(){return Br()||p0},android:function(){return Br()||Mp},ipad:function(){return Br()||Lp}},HC=Dp,Jf=!!(typeof window<"u"&&window.document&&window.document.createElement),VC={canUseDOM:Jf,canUseWorkers:typeof Worker<"u",canUseEventListeners:Jf&&!!(window.addEventListener||window.attachEvent),canUseViewport:Jf&&!!window.screen,isInWorker:!Jf},WC=VC,m0=WC,g0;m0.canUseDOM&&(g0=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
214
- * Checks if an event is supported in the current execution environment.
215
- *
216
- * NOTE: This will not work correctly for non-generic events such as `change`,
217
- * `reset`, `load`, `error`, and `select`.
218
- *
219
- * Borrows from Modernizr.
220
- *
221
- * @param {string} eventNameSuffix Event name, e.g. "click".
222
- * @param {?boolean} capture Check if the capture phase is supported.
223
- * @return {boolean} True if the event is supported.
224
- * @internal
225
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
226
- */function $C(t,e){if(!m0.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&&g0&&t==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var qC=$C,YC=HC,QC=qC,y0=10,b0=40,S0=800;function x0(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*y0,a=n*y0,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||a)&&t.deltaMode&&(t.deltaMode==1?(i*=b0,a*=b0):(i*=S0,a*=S0)),i&&!e&&(e=i<1?-1:1),a&&!n&&(n=a<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:a}}x0.getEventType=function(){return YC.firefox()?"DOMMouseScroll":QC("wheel")?"wheel":"mousewheel"};var GC=x0,XC=GC;function KC(t){return{x:t[1],y:t[2],width:t[3]-t[1],height:t[4]-t[2]}}const ZC={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:()=>{}},w0=(t={})=>({start:function(e){const{zoomWheelConstant:n,enableWheel:i,enableClickToZoom:a}={...ZC,...t},c={pointerStart:{x:0,y:0},isPressing:!1,mousemoveBuffer:lt(5),multiTouch:{distance:0}};e.world.activatedEvents.push("onMouseUp","onMouseDown","onMouseMove","onTouchStart","onTouchEnd","onTouchMove","onPointerUp","onPointerDown","onPointerMove");function f(){e.world.constraintBounds(),x=0}function p(P){if(P.which>1){c.isPressing=!1;return}e.mode==="explore"&&(P.preventDefault(),c.pointerStart.x=P.atlas.x,c.pointerStart.y=P.atlas.y,e.transitionManager.stopTransition(),c.isPressing=!0)}function g(){c.isPressing&&(e.mode==="explore"&&e.world.constraintBounds(),c.isPressing=!1)}let x=0;function m(P){if(e.mode==="explore"){if(P.atlasTouches.length===1&&(P.preventDefault(),c.pointerStart.x=P.atlasTouches[0].x,c.pointerStart.y=P.atlasTouches[0].y),P.atlasTouches.length===2){P.preventDefault();const L=P.atlasTouches[0].x,A=P.atlasTouches[1].x;c.pointerStart.x=(L+A)/2;const F=P.atlasTouches[0].y,$=P.atlasTouches[1].y;c.pointerStart.y=(F+$)/2,x=Sf({x:P.touches[0].clientX,y:P.touches[0].clientY},{x:P.touches[1].clientX,y:P.touches[1].clientY})}e.transitionManager.stopTransition(),c.isPressing=!0}}function w(P){let L=null,A=null,F=0;if(c.isPressing&&P.touches.length===2){const $=P.touches[0].clientX,Q=P.touches[1].clientX;L=($+Q)/2;const _=P.touches[0].clientY,K=P.touches[1].clientY;A=(_+K)/2,F=Sf({x:P.touches[0].clientX,y:P.touches[0].clientY},{x:P.touches[1].clientX,y:P.touches[1].clientY})}if(c.isPressing&&P.touches.length===1){const $=P.touches[0];L=$.clientX,A=$.clientY}if(L!==null&&A!==null){const $=e.getRendererScreenPosition();if($){const{x:Q,y:_}=e.viewerToWorld(L-$.x,A-$.y),K=F&&x?F/x:1;e.transitionManager.customTransition(ee=>{ee.from=lt(e.target),ee.to=ws(ee.from,xs(Rr(c.pointerStart.x-Q,c.pointerStart.y-_),Ou(1/K,Q,_)),c.mousemoveBuffer),ee.elapsed_time=0,ee.total_time=0,ee.timingFunction=io.easeInOutExpo,ee.done=!1})}x=F}}function R(P){if(c.isPressing){const L=e.getRendererScreenPosition();if(L){const{x:A,y:F}=e.viewerToWorld(P.clientX-L.x,P.clientY-L.y);e.transitionManager.customTransition($=>{$.from=lt(e.target),$.to=ws($.from,Rr(c.pointerStart.x-A,c.pointerStart.y-F),c.mousemoveBuffer),$.elapsed_time=0,$.total_time=0,$.timingFunction=io.easeInOutExpo,$.done=!1})}}}function D(P){e.mode==="explore"&&e.world.zoomIn(P.atlas)}function M(P){const A=1+XC(P).spinY/n;e.world.zoomTo(A,P.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",w),a&&(e.world.activatedEvents.push("onClick"),e.world.addEventListener("click",D)),i&&(e.world.activatedEvents.push("onWheel"),e.world.addEventListener("wheel",M));const z=e.world.addLayoutSubscriber((P,L)=>{if(P==="zone-changed"&&e.transitionManager.constrainBounds({transition:{duration:0}}),P==="zoom-to"&&L&&e.transitionManager.zoomTo(L.factor,{origin:L.point,stream:L.stream}),P==="go-home"){const A=L.immediate?{duration:0}:void 0;e.transitionManager.goToRegion(KC(e.homePosition),{transition:A})}if(P==="goto-region"&&L){const A=L.immediate?{duration:0}:{};e.transitionManager.goToRegion(L,{transition:A})}P==="constrain-bounds"&&e.transitionManager.constrainBounds({transition:L!=null&&L.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",D),i&&e.world.removeEventListener("wheel",M),z()}},updatePosition(){}}),Uu=T.createContext("explore");Uu.displayName="Mode";const JC=()=>T.useContext(Uu);function kp(t,e,n){var i,a,c,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(c,a),c=a=null))}var x=function(){c=this,a=arguments,f=Date.now();var m=n&&!i;return i||(i=setTimeout(g,e)),m&&(p=t.apply(c,a),c=a=null),p};return x.clear=function(){i&&(clearTimeout(i),i=null)},x.flush=function(){i&&(p=t.apply(c,a),c=a=null,clearTimeout(i),i=null)},x}kp.debounce=kp;var E0=kp;function T0(t){let{debounce:e,scroll:n,polyfill:i,offsetSize:a}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const c=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!c)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}),x=e?typeof e=="number"?e:e.scroll:null,m=e?typeof e=="number"?e:e.resize:null,w=T.useRef(!1);T.useEffect(()=>(w.current=!0,()=>void(w.current=!1)));const[R,D,M]=T.useMemo(()=>{const A=()=>{if(!g.current.element)return;const{left:F,top:$,width:Q,height:_,bottom:K,right:ee,x:V,y:ae}=g.current.element.getBoundingClientRect(),ge={left:F,top:$,width:Q,height:_,bottom:K,right:ee,x:V,y:ae};g.current.element instanceof HTMLElement&&a&&(ge.height=g.current.element.offsetHeight,ge.width=g.current.element.offsetWidth),Object.freeze(ge),w.current&&!rR(g.current.lastBounds,ge)&&p(g.current.lastBounds=ge)};return[A,m?E0(A,m):A,x?E0(A,x):A]},[p,a,x,m]);function z(){g.current.scrollContainers&&(g.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",M,!0)),g.current.scrollContainers=null),g.current.resizeObserver&&(g.current.resizeObserver.disconnect(),g.current.resizeObserver=null)}function P(){g.current.element&&(g.current.resizeObserver=new c(M),g.current.resizeObserver.observe(g.current.element),n&&g.current.scrollContainers&&g.current.scrollContainers.forEach(A=>A.addEventListener("scroll",M,{capture:!0,passive:!0})))}const L=A=>{!A||A===g.current.element||(z(),g.current.element=A,g.current.scrollContainers=C0(A),P())};return tR(M,!!n),eR(D),T.useEffect(()=>{z(),P()},[n,M,D]),T.useEffect(()=>z,[]),[L,f,R]}function eR(t){T.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function tR(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 C0(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(c=>c==="auto"||c==="scroll")&&e.push(t),[...e,...C0(t.parentElement)]}const nR=["x","y","top","bottom","left","right","width","height"],rR=(t,e)=>nR.every(n=>t[n]===e[n]),ed=T.createContext(null);ed.displayName="Atlas";const td=T.createContext(null);td.displayName="Bounds";let nd;if(typeof performance=="object"&&typeof performance.now=="function"){const t=performance;nd=()=>t.now()}else{const t=Date,e=t.now();nd=()=>t.now()-e}function R0(t,e){t&&t.appendChild&&e&&t.appendChild(e)}function O0(t,e){t&&t.removeChild&&e&&t.removeChild(e)}function iR(t,e){return O0(t.world,e)}function sR(t,e,n){return A0(t.world,e,n)}function A0(t,e,n){t&&t instanceof Vf&&(t=t.world),t&&t.insertBefore&&t.insertBefore(e,n)}function M0(t,e,n){if(n&&(t.applyProps&&t.applyProps(n),t instanceof Xi))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 P0(t,e){const n=Object.keys(e);let i=!1;for(const a of n)if(yf.indexOf(a)!==-1){const c=rl[a];if(c){if(t.activatedEvents.indexOf(c)!==-1)continue;i=!0,t.activatedEvents.push(c)}}i&&t.triggerEventActivation()}const rd=new Map,L0={};function oR(t,{args:e=[],...n},i,a,c){if(!(i instanceof Vf)&&c){const g=x=>x.return?g(x.return):x.stateNode&&x.stateNode.containerInfo;i=g(c)}let f,p=i.world;switch(t){case"world":f=dl.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 zu;break;case"shape":f=new a0;break;case"worldObject":case"world-object":f=new Nu;break;case"worldImage":case"world-image":f=new Mi;break;case"texture":f=new sp;break;case"compositeImage":case"composite-image":f=new LC({id:n.id,width:n.width,height:n.height,images:[]});break;case"tiledImage":case"tiled-image":f=Vo.fromTile(n.uri,n.display,n.tile,n.scaleFactor,void 0,n.format);break;case"paragraph":f=new If,f.text=n.children;break;default:return}return P0(p,n),M0(f,{},n),f}function aR(t,e){if(e instanceof dl)t.world=e;else if(e instanceof Nu)t.world.appendChild(e);else if(e)throw new Error("Invalid root")}const Fu=sw({unstable_now:nd,now:nd,createInstance:oR,removeChild:O0,appendChild:R0,appendInitialChild:R0,insertBefore:A0,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:aR,removeChildFromContainer:iR,createTextInstance(){},insertInContainerBefore:sR,prepareUpdate(t,e,n,i,a){return P0(a.world,i),i},commitUpdate(t,e,n,i,a,c){t.applyProps&&e&&M0(t,i,e)},finalizeInitialChildren(t){return t==null?void 0:t.__handlers},getChildHostContext(){return L0},getRootHostContext(){return L0},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}});Fu.injectIntoDevTools({bundleType:0,version:T.version,rendererPackageName:"@atlas-viewer/atlas"});function Np(t,e){const n=rd.get(t);n&&Fu.updateContainer(null,n,null,()=>{rd.delete(t),e&&e(t)})}const D0={render(t,e){const n=rd.get(e);if(n)Fu.updateContainer(t,n,null,()=>{});else{const i=Fu.createContainer(e,0,null,!1,null,"",()=>{},null);Fu.updateContainer(t,i,null,null),rd.set(e,i)}},unmountComponentAtNode(t,e){Np(t,e)}},lR=T.memo(({children:t,setIsReady:e,onCreated:n,bounds:i,preset:a,mode:c="explore"})=>{const f=T.useCallback(function(g){const x=T.useRef(!1),m=()=>{e(!0)};return T.useEffect(()=>{if(a&&!x.current){a.runtime.goHome();const w=n&&n(a);return void(w&&w.then?w.then(m):m())}return()=>{}},[]),T.useEffect(()=>{x.current=!0},[]),g.children},[a]);return T.useLayoutEffect(()=>{if(a){const p=a.runtime;c!==p.mode&&(p.mode=c),D0.render(T.createElement(T.StrictMode,null,T.createElement(f,null,T.createElement(td.Provider,{value:i},T.createElement(Uu.Provider,{value:c},T.createElement(ed.Provider,{value:a},t))))),p)}},[a,c,t]),T.useLayoutEffect(()=>{if(a){const p=a.runtime;return()=>{D0.unmountComponentAtNode(p)}}return()=>{}},[a]),null});class uR{constructor(e,n){this.fragmentShaderSource=`
227
- precision mediump float;
228
-
229
- uniform sampler2D u_image;
230
- varying vec2 v_texCoord;
231
-
232
- void main() {
233
- gl_FragColor = texture2D(u_image, v_texCoord);
234
- }
235
- `,this.vertexShaderSource=`
236
- attribute vec2 a_position;
237
- uniform vec2 u_resolution;
238
- varying vec4 v_color;
239
- uniform sampler2D u_texture;
240
-
241
- attribute vec2 a_texCoord;
242
- varying vec2 v_texCoord;
243
-
244
- void main() {
245
-
246
- // convert the position from pixels to 0.0 to 1.0
247
- vec2 zeroToOne = a_position / u_resolution;
248
-
249
- // convert from 0->1 to 0->2
250
- vec2 zeroToTwo = zeroToOne * 2.0;
251
-
252
- // convert from 0->2 to -1->+1 (clip space)
253
- vec2 clipSpace = zeroToTwo - 1.0;
254
-
255
- gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);
256
-
257
- v_texCoord = a_texCoord;
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 Mi||e instanceof Vo)&&this.createImageHost(e),e instanceof sp&&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 sp){const c=e.getTexture();c.source&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,c.source),a=c}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 c=this.gl,f=this.gl.createTexture();c.bindTexture(c.TEXTURE_2D,f),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null),e.__host.webgl.textures[i]=f,e.__host.webgl.loaded.push(i)}}}paint(e,n,i,a,c,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,w=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,w,R,g.source),e.__host.webgl.lastImage=g.hash}catch(x){e.__host.webgl.error=x}}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,c,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(),c=a.width/e,f=a.height/n,p=(c<f?f:c)*(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 c=this.gl.getShaderInfoLog(i);if(this.gl.deleteShader(i),c)throw new Error(c)}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 c=this.gl.getProgramInfoLog(i);if(this.gl.deleteProgram(i),c)throw new Error(c)}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 c=e,f=e+i,p=n,g=n+a;return this.rectBuffer.set([c,p,f,p,c,g,c,g,f,p,f,g]),this.rectBuffer}getRendererScreenPosition(){return this.rendererPosition}finishLayer(){}reset(){}}function zp(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 k0{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+zp(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+zp(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 N0{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 k0({sheetPrefix:this.options.sheetPrefix}),this.options.inlineStyles||this.htmlContainer.appendChild(this.stylesheet.getElement()),this.options.background&&this.htmlContainer.classList.add(this.stylesheet.addStylesheet(`
260
- background: ${this.options.background};
261
- `)),this.classes={hostClassName:this.stylesheet.addStylesheet(`
262
- position: absolute;
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,c=[this.classes.hostClassName];if(e.props.interactive?this.options.inlineStyles?a.style.pointerEvents="all":c.push(this.classes.interactive):this.options.inlineStyles?a.style.pointerEvents="none":c.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&&(c.push(e.props.className),e.hovering&&c.push(`${e.props.className}--hover`),e.pressing&&c.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 If){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=c.join(" ");a.className=g,a.part=g}e instanceof zu&&(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=c.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,c,f){if(this.zIndex++,(this.options.text&&e instanceof If||e instanceof zu&&(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,c,f);const p=c/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 If||e instanceof zu)&&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 id=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 c=rl[a.type],f=[],p=a.touches.length;for(let g=0;g<p;g++){const x=a.touches.item(g);if(!x)continue;const{x:m,y:w}=this.runtime.viewerToWorld(x.clientX-this.bounds.left,x.clientY-this.bounds.top),R={id:x.identifier,x:m,y:w};f.push(R)}f.length&&this.assignToEvent(a,f[0].x,f[0].y),c!=="onTouchEnd"?(this.pointerEventState.lastTouches=f,a.atlasTouches=f,this.runtime.world.propagateTouchEvent(c,a,f)):(a.atlasTouches=[],this.runtime.world.propagateTouchEvent(c,a,this.pointerEventState.lastTouches),this.pointerEventState.lastTouches=[])},this.onPointerEvent=a=>{const c=rl[a.type];if(c&&this.runtime.world.activatedEvents.indexOf(c)!==-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(c,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 c=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,c.x,c.y)}},800),this.onPointerEvent(a)},this.onPointerUp=a=>{if(this.pointerEventState.isClicking){const{x:c,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);this.assignToEvent(a,c,f),this.runtime.world.propagatePointerEvent("onClick",a,c,f)}if(this.pointerEventState.isDragging){for(const c of this.pointerEventState.itemsBeingDragged)c.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:c,y:f}=this.runtime.viewerToWorld(a.clientX-this.bounds.left,a.clientY-this.bounds.top);if(Number.isNaN(c)||Number.isNaN(f))return;this.assignToEvent(a,c,f),this.runtime.world.propagatePointerEvent("onPointerMove",a,c,f);const p=this.runtime.world.propagatePointerEvent("onMouseMove",a,c,f),g=[],x=[];for(const m of p)g.push(m.id),x.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&&Sf(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=x},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){id.eventPool.atlas.x=e,id.eventPool.atlas.y=n,t.atlas=id.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 jp=id;jp.eventPool={atlas:{x:0,y:0}};function z0({interactive:t=!0,viewport:e,forceRefresh:n,canvasElement:i,overlayElement:a,controllerConfig:c,unstable_webglRenderer:f,dpi:p,debug:g,canvasBox:x=!0,polygon:m=!0,navigatorElement:w,background:R,runtimeOptions:D}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const M=t?w0({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...c||{}}):void 0,z=new c0([f?new uR(i,{dpi:p}):new FC(i,{dpi:p,debug:g,box:x,polygon:m,background:R}),a?new N0(a,{box:f||!x,text:!0,triggerResize:n}):void 0,w?new BC(w):void 0]),P=new Vf(z,new dl(1024,1024),e,M?[M]:[],D),L=new jp(i,P);return{name:"default-preset",em:L,runtime:P,renderer:z,controller:M,canvas:i,navigator:w,unmount(){Np(P),P.stopControllers(),P.stop(),P.reset(),L&&L.stop()}}}class cR{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 k0({sheetPrefix:this.options.sheetPrefix}),this.container.classList.add(this.stylesheet.addStylesheet(`
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,c=i<a?a:i;return Number.isNaN(c)||(this.lastKnownScale=c),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,c,f){if(this.pending=!1,this.zIndex++,e instanceof Mi){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:${(c+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${c+Number.MIN_VALUE}px`,p.style.height=`${f+Number.MIN_VALUE}px`),p.style.transform=`translate(${i}px, ${a}px)`}if(e instanceof Vo){if(e.__host||(e.__host={images:[]}),!e.__host.images[n]){const g=e.getImageUrl(n),x=this.createImage();x.src=g,e.__host.images[n]=x,this.container.appendChild(x)}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:${(c+Number.MIN_VALUE).toFixed(2)}px;height:${(f+Number.MIN_VALUE).toFixed(2)}px;`):(p.style.width=`${c+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 fR({interactive:t,viewport:e,forceRefresh:n,containerElement:i,overlayElement:a,controllerConfig:c,background:f}){if(!i)throw new Error("Invalid container");i.style.userSelect="none";const p=t?w0({minZoomFactor:.5,maxZoomFactor:3,enableClickToZoom:!1,...c||{}}):void 0,g=new cR(i,{addPart:!1,setDraggableFalse:!1,imageClass:"atlas-static-image",background:f}),x=a?new c0([g,new N0(a,{box:!0,text:!0,triggerResize:n})]):g,m=new Vf(x,new dl(1024,1024),e,p?[p]:[]),w=new jp(i,m);return{name:"static-preset",em:w,runtime:m,renderer:x,controller:p,container:i,overlay:a,unmount(){Np(m),m.stopControllers(),m.stop(),w&&w.stop()}}}const dR={"default-preset":z0,"static-preset":fR},hR={};function pR(t,e){const n=T.useRef(),i=T.useRef(),a=T.useRef(),c=T.useRef(),f=T.useRef({width:e.width,height:e.height,didUpdate:!0}),[p="default-preset",g=hR]=Array.isArray(t)?t||[]:[t],[x,m]=T.useState(null);T.useLayoutEffect(()=>{const R=i.current,D=c.current,M=n.current,z=a.current,L=(dR[p]||z0)({containerElement:D,canvasElement:R,overlayElement:M,navigatorElement:z,viewport:f.current,dpi:window.devicePixelRatio||1,forceRefresh:e.forceRefresh,unstable_webglRenderer:e.unstable_webglRenderer,...g||{}});return m(L),()=>{L&&(L.unmount(),R&&(R.height=0,R.width=0),M&&(M.innerHTML=""),z&&(z.height=0,z.width=0))}},[p,g]);const w=T.useMemo(()=>({canvas:i,overlay:n,container:c,navigator:a}),[]);return[p,x,f,w]}function vR(t){return T.useMemo(()=>zp(t),t)}const Bu=T.forwardRef((t,e)=>T.createElement("div",{...t,ref:e,part:t.className})),j0=["brightness","contrast","grayscale","hueRotate","invert","saturate","sepia","blur"],mR=({htmlChildren:t,renderPreset:e,onCreated:n,mode:i="explore",resetWorldOnChange:a=!0,unstable_webglRenderer:c=!1,unstable_noReconciler:f=!1,hideInlineStyle:p=!1,controllerConfig:g,children:x,overlayStyle:m,containerStyle:w,enableNavigator:R,className:D,containerProps:M={},homePosition:z,homeOnResize:P,homeCover:L,background:A,runtimeOptions:F,debug:$,filters:Q,..._})=>{const[K,ee]=T.useState(A),[V,ae]=T.useState(i),[ge,we]=T.useState(!1),Ee=T.useRef(!1),Ue=T.useMemo(()=>(typeof e=="string"&&(e=[e,{}]),K||$?e?[e[0],{debug:$,background:K,...e[1]||{}}]:["default-preset",{background:K,debug:$}]:e||"default-preset"),[e,K,$]),[Fe,Be,vt]=T0({scroll:!0}),Oe=T.useRef(),it=ke=>{Oe.current=ke,Fe(ke)},[nt,W,Re,Ie]=pR(Ue,{width:_.width,height:_.height,forceRefresh:vt,unstable_webglRenderer:c}),[tt,at]=T.useState("");T.useEffect(()=>{ae(i)},[i]),T.useEffect(()=>{W&&W.em&&W.em.updateBounds()},[W,Be]),T.useEffect(()=>{W==null||W.runtime.setOptions(F||{})},[F]),T.useEffect(()=>{W&&W.runtime&&(W.runtime.mode=V),ge&&W&&(W.ready=!0)},[W,ge,V]),T.useEffect(()=>{W&&(L||(W.runtime.manualHomePosition=!!z,W.runtime.setHomePosition(z)))},[W,L,z]),T.useEffect(()=>{if(W){const ke=W.runtime;ke.resize(Re.current.width,_.width,Re.current.height,_.height),Re.current.width=_.width,Re.current.height=_.height,ke.updateNextFrame(),Re.current.didUpdate=!0}},[W,_.width,_.height]),T.useEffect(()=>{if(Q&&W){const ke=W.runtime;let qe=!1;ke.hookOptions.enableFilters=!0;for(const st of j0)Q[st]?Q[st]!==W.runtime.hookOptions.filters[st]&&(ke.hookOptions.filters[st]=Q[st],qe=!0):ke.hookOptions.filters[st]&&(ke.hookOptions.filters[st]=0,qe=!0);qe&&ke.updateNextFrame()}else if(W){const ke=W.runtime;for(const qe of j0)ke.hookOptions.filters[qe]=0;ke.hookOptions.enableFilters=!1,ke.updateNextFrame()}},[W,Q]),T.useLayoutEffect(()=>{if(W&&(W.overlay&&(W.overlay.style.width=`${Be.width}px`,W.overlay.style.height=`${Be.height}px`),W.container&&(W.container.style.width=`${Be.width}px`,W.container.style.height=`${Be.height}px`),L)){const ke=W.runtime.world.width,qe=W.runtime.world.height,st=ke/qe,wt=Re.current.width,vn=Re.current.height;let I=wt/vn;if(st>I){I=vn/wt,W.runtime.manualHomePosition=!0;let N=(ke-qe/I)/2;L==="start"&&(N=0),L==="end"&&(N=ke-qe/I),W.runtime.setHomePosition({x:N,y:0,width:qe/I,height:qe})}else{let N=(qe-ke/I)/2;L==="start"&&(N=0),L==="end"&&(N=qe-ke/I),W.runtime.manualHomePosition=!0,W.runtime.setHomePosition({x:0,y:N,width:ke,height:ke/I})}P&&W.runtime.goHome({})}},[W,Be.height,Be.width,L]),T.useLayoutEffect(()=>{const ke=()=>{if(W){const qe=W.runtime;Re.current.width!==_.width&&Re.current.height!==_.height&&(qe.resize(Re.current.width,_.width,Re.current.height,_.height),Re.current.width=_.width,Re.current.height=_.height,qe.updateNextFrame(),Re.current.didUpdate=!0)}};return window.addEventListener("resize",ke),()=>window.removeEventListener("resize",ke)},[W,_.height,_.width]);const $t={width:120},jt=()=>{if(W&&W.navigator){const ke=W.runtime.world.height,qe=W.runtime.world.width,st=window.devicePixelRatio||1,wt=$t.width,vn=$t.width/qe*ke;W.navigator.width=wt*st,W.navigator.height=vn*st,W.navigator.style.width=wt+"px",W.navigator.style.height=vn+"px"}};T.useLayoutEffect(()=>{if(W){jt();const ke=W.runtime;return ke.world.addLayoutSubscriber(qe=>{qe==="recalculate-world-size"&&(jt(),ke.resize(Re.current.width,_.width,Re.current.height,_.height))})}return()=>{}},[W]);const yt=T.useCallback(function(qe){const st=()=>{we(!0)};return T.useEffect(()=>{if(W){W.runtime.goHome();const wt=n&&n(W);return void(wt&&wt.then?wt.then(st):st())}else throw new Error("Invalid configuration - no runtime found")},[]),qe.children},[W]);T.useEffect(()=>{if(W){const ke=W.runtime;if(a)return ke.world.addLayoutSubscriber(qe=>{qe==="recalculate-world-size"&&ke.goHome()})}return()=>{}},[W,a]),T.useEffect(()=>W?W.runtime.registerHook("useBeforeFrame",()=>{var qe;if(Re.current.didUpdate&&W.canvas){const st=window.devicePixelRatio||1,wt=Re.current.width,vn=Re.current.height;W.canvas.width=wt*st,W.canvas.height=vn*st,W.canvas.style.width=wt+"px",W.canvas.style.height=vn+"px",(qe=W.canvas.getContext("2d"))==null||qe.scale(st,st),W&&W.em&&W.em.updateBounds(),Re.current.didUpdate=!1}}):()=>{},[W,a]),T.useEffect(()=>{const ke=()=>{W&&(ae("sketch"),at("mode-sketch")),window.removeEventListener("keyup",ke)},qe=st=>{if(st.code==="Space"&&W&&W.runtime.mode==="sketch"){if(st.target&&st.target.tagName&&st.target.tagName.toLowerCase()==="input")return;st.preventDefault(),ae("explore"),at("mode-explore"),window.addEventListener("keyup",ke)}};return window.addEventListener("keydown",qe),()=>{window.removeEventListener("keydown",qe),window.removeEventListener("keyup",ke)}},[W]),T.useLayoutEffect(()=>{if(Oe.current&&!K){const qe=getComputedStyle(Oe.current).getPropertyValue("--atlas-background");qe&&ee(qe)}},[K]),Ee.current=!0;const{height:xt,width:Pt,...St}=_,ht=vR([_.width,_.height]);return T.createElement(Bu,{ref:it,className:["atlas",p?"":`atlas-width-${ht}`,tt,D,`atlas-${nt}`].filter(Boolean).join(" ").trim(),style:{...w,...p?{}:{width:_.width,height:_.height}}},nt==="static-preset"?T.createElement(Bu,{className:"atlas-static-container",style:W&&W.controller?void 0:{pointerEvents:"none"},ref:Ie.container,tabIndex:0,...M}):T.createElement("canvas",{className:"atlas-canvas",part:"atlas-canvas",tabIndex:0,...St,...M,ref:Ie.canvas}),T.createElement(Bu,{className:"atlas-overlay",style:{...m||{}},ref:Ie.overlay},f?T.createElement(yt,null,T.createElement(td.Provider,{value:Be},T.createElement(Uu.Provider,{value:V},T.createElement(ed.Provider,{value:W},x)))):T.createElement(lR,{bounds:Be,preset:W,mode:V,setIsReady:we,onCreated:n},x)),R?T.createElement(Bu,{className:"atlas-navigator"},T.createElement("canvas",{className:"atlas-navigator-canvas",part:"atlas-navigator-canvas",ref:Ie.navigator})):null,p?T.createElement("style",null,`.atlas-width-${ht} { width: ${_.width}px; height: ${_.height}px; }`):T.createElement("style",null,`
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
- .atlas-width-${ht} { width: ${_.width}px; height: ${_.height}px; }
269
- .atlas-canvas { flex: 1 1 0px; }
270
- .atlas-canvas:focus, .atlas-static-container:focus { outline: none }
271
- .atlas-canvas:focus-visible, .atlas-canvas-container:focus-visible { outline: var(--atlas-focus, 2px solid darkorange) }
272
- .atlas-static-preset { touch-action: inherit; }
273
- .atlas-static-container { position: relative; overflow: hidden; flex: 1 1 0px; }
274
- .atlas-overlay { position: absolute; top: 0; left: 0; pointer-events: none; overflow: hidden; }
275
- .atlas-static-image { position: absolute; pointer-events: none; user-select: none; transform-origin: 0px 0px; }
276
- .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 }
277
- .atlas-navigator-canvas { width: 100%; }
278
- `),t)};function gR(t){return Number(t)==t?`${t}px`:t}const yR=({resizeHash:t,aspectRatio:e,containerProps:n={},...i})=>{const[a,c,f]=T0(),{height:p,width:g,...x}=i;T.useEffect(()=>{f()},[g,p,t,f]);const m=T.useMemo(()=>e?{width:c.width,height:c.width*(1/e)}:c,[c,e]);return T.createElement(Bu,{ref:a,className:"atlas-container",...n},m.width?T.createElement(mR,{width:m.width||100,height:m.height||100,...x},i.children):null,i.hideInlineStyle?null:T.createElement("style",null,`
279
- .atlas-container {
280
- display: var(--atlas-container-display, block);
281
- flex: var(--atlas-container-flex, none);
282
- width: var(--atlas-container-width, ${g?`${g}px`:"100%"});
283
- height: var(--atlas-container-height, ${gR(p||(e?m.height:512))})
284
- }
285
- `),i.htmlChildren)},_0=()=>T.useContext(ed),sd=()=>{const t=_0();return t?t.runtime:void 0},I0=(t,e=[])=>{const n=sd();T.useEffect(()=>n?n.registerHook("useFrame",t):()=>{},e)},bR=()=>{const t=_0();return t&&t.canvas?t.canvas:void 0};function SR(){return T.useContext(td)}async function xR(t,e,n){if(T.version.startsWith("18.")){const i=await Promise.resolve().then(()=>AM),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,c=i.default?i.default.unmountComponentAtNode:i.unmountComponentAtNode;a(e,t),n.current={unmount(){c(t)}}}}const _p=T.forwardRef(({children:t,...e},n)=>{const i=T.useRef(),a=sd(),c=T.useRef(0),f=T.useRef(),p=T.useRef();return I0(()=>{var g,x,m,w;if(e.relative){const R=i.current;if(R&&a){const D=a.getScaleFactor();c.current!==D&&(c.current=D,R.style.transformOrigin="0 0",R.style.transform=`scale(${1/c.current})`,R.style.width=`${c.current*100}%`,R.style.height=`${c.current*100}%`,i.current&&((x=(g=f.current)==null?void 0:g.__owner.value)!=null&&x.rotation)&&(R.style.transform=`scale(${1/c.current}) translate(50%, 50%) rotate(${((w=(m=f.current)==null?void 0:m.__owner.value)==null?void 0:w.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 x(){if(g&&g.__host){const m=e.relative?T.createElement("div",{ref:i},t):t;await xR(g.__host.element,m,p)}}g&&g.__host?x():g&&(g.__onCreate=x)},[n,t,f,e.relative]),T.useLayoutEffect(()=>()=>{p.current&&setTimeout(()=>{p.current.unmount()},0)},[]),T.createElement("box",{html:!0,...e,ref:f})});_p.displayName="HTMLPortal";const U0=(t,e,n=[])=>{const i=sd(),a=i?i.world:void 0;T.useEffect(()=>{if(i){const c=e,f=rl[t];i.world.activatedEvents.push(f);const p=f.slice(2).toLowerCase();return i.world.addEventListener(p,c),()=>{i.world.removeEventListener(p,c)}}return()=>{}},[a,t,...n])};function F0(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 wR(){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 ER=(t,e)=>{const n=JC(),i=sd(),a=SR(),c=T.useRef(),f=T.useRef(null),p=T.useRef(),[g,x]=T.useState(!1),m=T.useRef(!1),w=T.useRef({north:0,south:0,east:0,west:0}),R=wR(),D=T.useCallback(A=>F=>{if(m.current=!0,x(!0),a&&i){const{top:$,left:Q}=a,_=i.viewerToWorld(F.pageX-Q,F.pageY-$);p.current={x:_.x,y:_.y},c.current=A}},[a,i]),M=T.useMemo(()=>t.width/t.height,[t.width,t.height]),z=T.useCallback(A=>{if(!Math.abs(A.north-A.south+(A.east-A.west)))return;const $=-A.west+A.east,Q=-A.north+A.south,_=t.width+$,K=t.height+Q;if(_/K>=M){const V=K*M,ae=_-V,[ge,we]=F0(A.east,A.west);A.west=A.west+ae*we,A.east=A.east-ae*ge}else{const V=_/M,ae=K-V,[ge,we]=F0(A.north,A.south);A.north=A.north+ae*ge,A.south=A.south-ae*we}},[t.width,t.height,M]);I0(()=>{p&&i&&i.updateNextFrame()}),T.useEffect(()=>{i&&i.updateNextFrame()},[i,g]);const P=T.useCallback(A=>{var F;if(!i||!a||i.mode!=="sketch")return;const{top:$,left:Q}=a,_=i.viewerToWorld(A.pageX-Q,A.pageY-$),K=f.current,ee=!t.maintainAspectRatio&&R.current.alt,V=!ee&&R.current.shift&&((F=c.current)==null?void 0:F.indexOf("-"))!==-1;if((c.current==="translate"||c.current==="east"||c.current==="north-east"||c.current==="south-east")&&(w.current.east=_.x-(p.current?p.current.x:0),ee&&(w.current.west=-w.current.east)),(c.current==="translate"||c.current==="west"||c.current==="north-west"||c.current==="south-west")&&(w.current.west=_.x-(p.current?p.current.x:0),ee&&(w.current.east=-w.current.west)),(c.current==="translate"||c.current==="north"||c.current==="north-east"||c.current==="north-west")&&(w.current.north=_.y-(p.current?p.current.y:0),ee&&(w.current.south=-w.current.north)),(c.current==="translate"||c.current==="south"||c.current==="south-west"||c.current==="south-east")&&(w.current.south=_.y-(p.current?p.current.y:0),ee&&(w.current.north=-w.current.south)),(t.maintainAspectRatio||V)&&z(w.current),K){const ae=w.current.west,ge=w.current.north,we=t.width+w.current.east,Ee=t.height+w.current.south;K.points[1]=Math.min(ae,we),K.points[2]=Math.min(ge,Ee),K.points[3]=Math.max(ae,we),K.points[4]=Math.max(ge,Ee),i.updateNextFrame()}},[i,t.width,t.height,t.maintainAspectRatio,a]);U0("mousemove",P,[t.width,t.height,a]),U0("pointermove",P,[t.width,t.height,a]);const L=T.useRef();return T.useEffect(()=>{L.current=()=>{if(m.current){const A=w.current.west,F=w.current.north,$=t.width+w.current.east,Q=t.height+w.current.south,_=Math.min(A,$),K=Math.min(F,Q),ee=Math.max(A,$),V=Math.max(F,Q),ae={x:(t.x||0)+_,y:(t.y||0)+K,width:ee-_||1,height:V-K||1};t.maintainAspectRatio,e(ae),c.current=void 0,p.current=void 0,w.current.east=0,w.current.west=0,w.current.north=0,w.current.south=0,m.current=!1,x(!1)}}},[e,t.height,t.width,t.x,t.y]),T.useEffect(()=>{const A=()=>{L.current&&L.current()};return window.addEventListener("pointerup",A),window.addEventListener("touchend",A),()=>{window.removeEventListener("pointerup",A),window.removeEventListener("touchend",A)}},[]),{portalRef:f,mode:n,mouseEvent:D,onPointerMoveCallback:P,isEditing:g}};function TR({handleSize:t,resizable:e,onSave:n,children:i,maintainAspectRatio:a,disableCardinalControls:c,...f}){const p=typeof t>"u"?a?10:8:t,{portalRef:g,mode:x,mouseEvent:m,isEditing:w}=ER({x:f.x||0,y:f.y||0,width:f.width,height:f.height,maintainAspectRatio:a},n),R=T.useMemo(()=>m("translate"),[m]),D=T.useMemo(()=>m("east"),[m]),M=T.useMemo(()=>m("west"),[m]),z=T.useMemo(()=>m("south"),[m]),P=T.useMemo(()=>m("north"),[m]),L=T.useMemo(()=>m("south-east"),[m]),A=T.useMemo(()=>m("south-west"),[m]),F=T.useMemo(()=>m("north-east"),[m]),$=T.useMemo(()=>m("north-west"),[m]),Q=x==="sketch",_={zIndex:999,boxShadow:"0px 2px 3px 0 rgba(0,0,0,0.2)",border:"1px solid rgba(155,155,155,.7)",borderRadius:a||c?"50%":2,position:"absolute",background:"#fff",pointerEvents:w?"none":Q?"initial":"none"};return T.createElement(T.Fragment,null,T.createElement("world-object",{...f},i,Q&&e?T.createElement(_p,{ref:g,target:{x:0,y:0,height:f.height,width:f.width},relative:!0,interactive:!1},Q&&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:w?"none":Q?"initial":"none"}}),a?null:T.createElement(T.Fragment,null,T.createElement("div",{title:"east",onTouchStart:D,onMouseDown:D,style:{..._,cursor:"e-resize",height:p*2,width:p,right:0,top:"50%",opacity:c?0:1,transform:`translate(${p/2}px, -${p}px)`}}),T.createElement("div",{title:"west",onMouseDown:M,style:{..._,cursor:"w-resize",position:"absolute",height:p*2,width:p,left:0,top:"50%",opacity:c?0:1,transform:`translate(-${p/2}px, -${p}px)`}}),T.createElement("div",{title:"north",onMouseDown:P,style:{..._,cursor:"n-resize",position:"absolute",height:p,width:p*2,left:"50%",top:0,opacity:c?0:1,transform:`translate(-${p}px, -${p/2}px)`}}),T.createElement("div",{title:"south",onMouseDown:z,style:{..._,cursor:"s-resize",position:"absolute",height:p,width:p*2,left:"50%",bottom:0,opacity:c?0:1,transform:`translate(-${p}px, ${p/2}px)`}})),T.createElement("div",{title:"north-east",onMouseDown:F,style:{..._,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:L,style:{..._,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:A,style:{..._,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:$,style:{..._,cursor:"nw-resize",position:"absolute",height:p,width:p,top:0,left:0,transform:`translate(-${p/2}px, -${p/2}px)`}})):null):null))}function CR({interactive:t,region:e,onClick:n,onSave:i,maintainAspectRatio:a,disableCardinalControls:c,isEditing:f,rotation:p,style:g={backgroundColor:"rgba(0,0,0,.5)"}}){const x=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(TR,{x:e.x,y:e.y,rotation:p,width:e.width,height:e.height,resizable:f,onSave:x,maintainAspectRatio:a,disableCardinalControls:c},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 RR=t=>{var e,n,i,a,c;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||[],x=t.enableThumbnail,m=t.enableSizes,w=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:((c=t.crop)==null?void 0:c.height)||t.tiles.height,crop:t.crop},x&&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,D)=>T.createElement("world-image",{key:D,uri:`${w}/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(D=>T.createElement("tiled-image",{key:`${t.tiles.imageService.id}-tile-${D}`,uri:t.tiles.imageService.id,display:{width:t.tiles.width,height:t.tiles.height},tile:R,scaleFactor:D,crop:t.crop})))))};function OR(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}const AR=T.createContext(null),Ip={didCatch:!1,error:null};class MR extends T.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ip}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,i,a=arguments.length,c=new Array(a),f=0;f<a;f++)c[f]=arguments[f];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:c,reason:"imperative-api"}),this.setState(Ip)}}componentDidCatch(e,n){var i,a;(i=(a=this.props).onError)===null||i===void 0||i.call(a,e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:a}=this.props;if(i&&n.error!==null&&PR(e.resetKeys,a)){var c,f;(c=(f=this.props).onReset)===null||c===void 0||c.call(f,{next:a,prev:e.resetKeys,reason:"keys"}),this.setState(Ip)}}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:a}=this.props,{didCatch:c,error:f}=this.state;let p=e;if(c){const g={error:f,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")p=n(g);else if(i)p=T.createElement(i,g);else if(a===null||T.isValidElement(a))p=a;else throw f}return T.createElement(AR.Provider,{value:{didCatch:c,error:f,resetErrorBoundary:this.resetErrorBoundary}},p)}}function PR(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}const LR={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},od=T.createContext(LR),Rs=()=>T.useContext(od);function oo({value:t,children:e}){const n=Rs(),i=T.useMemo(()=>({...n,...t}),[t,n]);return ne.jsx(od.Provider,{value:i,children:e})}const Hu=T.createContext({vault:null,setVaultInstance:t=>{}});function ad({vault:t,vaultOptions:e,useGlobal:n,resources:i,children:a}){const[c,f]=T.useState(()=>t||(n?hf.globalVault(e):e?new hf.Vault(e):new hf.Vault));return ne.jsx(Hu.Provider,{value:{vault:c,setVaultInstance:f},children:ne.jsx(oo,{value:i||{},children:a})})}function ld(t){const e=T.useContext(Hu);return t||(e&&e.vault?e.vault:hf.globalVault())}function Up(t,{noCache:e=!1}={}){const n=typeof t=="string"?t:t.id,i=ld(),[a,c]=T.useState(n),[f,p]=T.useState(void 0),g=T.useMemo(()=>i.get(n,{skipSelfReturn:!0})||void 0,[n,i]),[x,m]=T.useState(g);return T.useEffect(()=>{(async()=>{try{const w=g&&!e?g:await i.load(n),R=w?w.id||w["@id"]:null;w&&a!==R&&c(R),m(w)}catch(w){p(w)}})()},[n,e]),{isLoaded:!!x,id:a,requestId:n,error:f,resource:x,cached:!!(x&&x===g)}}function B0(t,e){const{id:n,isLoaded:i,error:a,resource:c,requestId:f,cached:p}=Up(t,e);return{id:n,isLoaded:i,error:a,manifest:c,requestId:f,cached:p}}function H0({manifest:t,children:e}){return ne.jsx(oo,{value:{manifest:t},children:e})}function Vu({canvas:t,children:e}){return ne.jsx(oo,{value:{canvas:t},children:e})}const Vn=()=>{const{vault:t}=T.useContext(Hu);if(t===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return t};function or(t,e=[]){const n=Vn(),[i,a]=T.useState(()=>t(n.getState(),n));return T.useEffect(()=>n.subscribe(c=>t(c,n),c=>{a(c)},!1),e),i}const Wu=T.createContext([]);function Fp(){const t=T.useContext(Wu);return or(e=>t.map(n=>e.iiif.entities.Canvas[n]).filter(Boolean),[t])}function Zi(t={},e=[]){const{id:n,selector:i}=t,a=Rs();Vn();const c=n||a.manifest,f=or(p=>c?p.iiif.entities.Manifest[c]:void 0,[c]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function V0({range:t,children:e}){return ne.jsx(oo,{value:{range:t},children:e})}function W0(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=W0(t,t.get(n));if(i)return i}}return null}function Bp(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(...Bp(t,t.get(a))),a.type==="SpecificResource"){const c=typeof a.source=="string"?a.source:a.source.id;n.push({id:c,type:"Canvas"})}return n}function DR(t,e,n){for(const i of e.structures){const a=Hp(t,t.get(i),n);if(a)return a}return null}function Hp(t,e,n){var i,a,c;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"&&((c=f.source)==null?void 0:c.type)==="Canvas"&&n===p)return e;if(f.type==="Range"){const g=Hp(t,t.get(f),n);if(g)return g}}return null}function kR(t,e,n,i=!1){const a=e.behavior,c=n?t.get(n):null;if(!c)return[];const f=c.behavior,p=i?!1:a.includes("paged"),g=p?!1:a.includes("continuous"),x=p||g?!1:a.includes("individuals"),m=f.includes("facing-pages"),w=f.includes("non-paged");if(m||w||x||i)return[{id:c.id,type:"Canvas"}];const[R,D]=Vp(t,e);if(g)return R;const M=R.findIndex(z=>z.id===n);if(M===-1)return[];for(const z of D)if(z.includes(M))return z.map(P=>R[P]);return[{id:c.id,type:"Canvas"}]}function Vp(t,e,{disablePaging:n,skipNonPaged:i}={}){const a=e.behavior,c=a.includes("paged"),f=c?!1:a.includes("continuous"),p=c||f?!1:a.includes("individuals"),g=e.type==="Manifest"?e.items:Bp(t,e);if(f)return[g,[g.map((M,z)=>z)]];if(p||!c||n)return[g,g.map((M,z)=>[z])];const x=[];let m=[];const w=()=>{m.length&&(x.push([...m]),m=[])};let R=0,D=!1;for(let M=0;M<g.length;M++){const z=t.get(g[M]);if(z.behavior.includes("non-paged")){M===R&&R++,i||(w(),x.push([M]),w());continue}if(M===R||z.behavior.includes("facing-pages")){m.length&&(D=!0),w(),x.push([M]),w();continue}if(m.push(M),D){w(),D=!1;continue}m.length>1&&w()}return m.length&&w(),[g,x]}function Wp(t={},e=[]){const{id:n,selector:i}=t,a=Rs(),c=n||a.range,f=or(p=>c?p.iiif.entities.Range[c]:void 0,[c]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function $0({startCanvas:t,disablePaging:e}){var z;const n=Vn(),i=Zi(),a=Wp(),[c,f]=T.useState(void 0),p=a||i;if(!p)throw new Error("Nothing selected");const[g,x]=T.useMemo(()=>Vp(n,p,{disablePaging:e}),[n,p,e]),m=T.useRef(x);if(m.current!==x){const L=m.current[c][0],A=x.findIndex(F=>F.includes(L));m.current=x,f(A)}const w=T.useCallback(P=>{const L=x.findIndex(A=>A.includes(P));f(L===-1?0:L)},[g,x]),R=T.useCallback(P=>{const L=g.findIndex(A=>A.id===P);L!==-1?w(L):f(0)},[g,x]),D=T.useCallback(()=>{f(P=>P>=x.length-1?P:P+1)},[x]),M=T.useCallback(()=>{f(P=>P<=0?0:P-1)},[x]);return typeof c>"u"&&(t?R(t):f(0)),{visibleItems:((z=x[c])==null?void 0:z.map(P=>g[P].id))||[],cursor:c,items:g,sequence:x,hasPrevious:c>0,hasNext:c<x.length-1,setSequenceIndex:f,setCanvasIndex:w,setCanvasId:R,next:D,previous:M}}const $u=()=>{},qu=T.createContext({setCurrentCanvasId:$u,setCurrentCanvasIndex:$u,nextCanvas:$u,previousCanvas:$u,items:[],sequence:[],setSequenceIndex:$u,currentSequenceIndex:0,hasNext:!1,hasPrevious:!1});function q0(t){const e=Zi(),{cursor:n,visibleItems:i,next:a,sequence:c,items:f,setCanvasIndex:p,setCanvasId:g,previous:x,setSequenceIndex:m,hasNext:w,hasPrevious:R}=$0({startCanvas:t.startCanvas,disablePaging:t.pagingEnabled===!1}),D=T.useMemo(()=>({sequence:c,items:f,setCurrentCanvasId:g,nextCanvas:a,previousCanvas:x,totalCanvases:f.length,setCurrentCanvasIndex:p,setSequenceIndex:m,currentSequenceIndex:n,hasNext:w,hasPrevious:R}),[c,f,g,a,x,f,p,m,n]);return e?i.length===0?null:ne.jsx(qu.Provider,{value:D,children:ne.jsx(Wu.Provider,{value:i,children:ne.jsx(Vu,{canvas:i[0],children:t.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),ne.jsx("div",{children:"Sorry, something went wrong."}))}function Y0(t){const e=ld(t.vault),n=B0(t.manifest);if(!n)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),ne.jsx("div",{children:"Sorry, something went wrong."});if(n.error)return ne.jsx("div",{children:n.error.toString()});if(!n.isLoaded)return ne.jsx("div",{children:"Loading..."});const i=ne.jsx(q0,{...t,children:t.children});return ne.jsx(ad,{vault:e,children:ne.jsx(H0,{manifest:n.id,children:t.rangeId?ne.jsx(V0,{range:t.rangeId,children:i}):i})})}function $p(){return T.useContext(qu)}function Q0(){return{VaultContext:T.useContext(Hu),ResourceContext:T.useContext(od),SimpleViewerReactContext:T.useContext(qu),VisibleCanvasReactContext:T.useContext(Wu)}}function G0(t){return ne.jsx(ad,{vault:t.bridge.VaultContext.vault||void 0,resources:t.bridge.ResourceContext,children:ne.jsx(Wu.Provider,{value:t.bridge.VisibleCanvasReactContext,children:ne.jsx(qu.Provider,{value:t.bridge.SimpleViewerReactContext,children:t.children})})})}const Ji=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}})}},NR="@iiif/IMPORT_ENTITIES",zR="@iiif/MODIFY_ENTITY_FIELD",jR="@iiif/REORDER_ENTITY_FIELD",_R="@iiif/ADD_REFERENCE",IR="@iiif/UPDATE_REFERENCE",UR="@iiif/REMOVE_REFERENCE",FR="@iiif/ADD_METADATA",BR="@iiif/REMOVE_METADATA",HR="@iiif/UPDATE_METADATA",VR="@iiif/REORDER_METADATA",WR=Ji(NR)(),$R=Ji(zR)(),qR=Ji(jR)(),YR=Ji(_R)(),QR=Ji(UR)(),GR=Ji(IR)(),XR=Ji(FR)(),KR=Ji(HR)(),ZR=Ji(BR)(),JR=Ji(VR)(),qp={importEntities:WR,modifyEntityField:$R,reorderEntityField:qR,addReference:YR,removeReference:QR,updateReference:GR,addMetadata:XR,removeMetadata:ZR,updateMetadata:KR,reorderMetadata:JR};function X0(){const e=Vn().getStore();return T.useMemo(()=>n=>e.dispatch(n),[e])}function K0(t){return typeof t!="string"&&t&&t.bindToVault}function Z0(){const t=Vn(),e=T.useRef([]),n=X0(),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(qp.importEntities({entities:{AnnotationPage:{[p.id]:p}}}))},[i]);const a=or(p=>i?p.iiif.entities.AnnotationPage[i]:null,[i]),c=T.useCallback((p,g)=>{if(i){if(K0(p)){const w=p;w.__vault||w.bindToVault(t),p=typeof w.source=="string"?w.source:w.source.id,e.current[p]=w}else typeof p!="string"&&(p=p.id);const x=t.get({id:i,type:"AnnotationPage"}),m=t.get({id:p,type:"Annotation"});x&&m&&(x.items.find(w=>w.id===m.id)||n(qp.addReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"},index:g})))}},[i]),f=T.useCallback(p=>{i&&(K0(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(qp.removeReference({id:i,type:"AnnotationPage",key:"items",reference:{id:p,type:"Annotation"}})))},[i]);return[a,{addAnnotation:c,removeAnnotation:f}]}const J0=T.createContext(null);function eb(){const t=T.useContext(J0);return[t.fullPage,{addAnnotation:t.addAnnotation,removeAnnotation:t.removeAnnotation}]}function tb({children:t}){const[e,{addAnnotation:n,removeAnnotation:i}]=Z0();return ne.jsx(J0.Provider,{value:T.useMemo(()=>({fullPage:e,addAnnotation:n,removeAnnotation:i}),[e]),children:t})}function eO({width:t,style:e,height:n,error:i,resetErrorBoundary:a}){return ne.jsxs("div",{style:{width:t,height:n,minHeight:500,...e||{},background:"#f9f9f9"},children:[ne.jsx("h3",{children:"Error occurred"}),ne.jsx("p",{children:i.message}),ne.jsx("button",{onClick:a,children:"Reset"})]})}const ud=T.createContext(null);function nb(){return T.useContext(ud)}const rb=T.createContext(()=>{}),ib=T.createContext(()=>{});function hl(t,e,n,i,a=[]){const c=T.useContext(t==="portal"?ib:rb);T.useEffect(()=>(t!=="none"&&c(e,n,i),()=>{c(e,null)}),[e,t,c,...a])}function mi(t={},e=[]){const{id:n,selector:i}=t,a=Rs(),c=n||a.canvas,f=or(p=>c?p.iiif.entities.Canvas[c]:void 0,[c]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}const sb=T.createContext(()=>{});function tO(t){const e=mi(),n=T.useContext(sb);T.useEffect(()=>e&&e.id?(n(e.id,t),()=>n(e.id,-1)):()=>{},[e,t])}function nO({children:t,errorFallback:e,outerContainerProps:n={},worldScale:i,...a}){const[c,f]=T.useState(),p=Q0(),g=e||eO,[x,m]=T.useState({}),w=Object.entries(x),[R,D]=T.useState({}),M=Object.entries(R),[z,P]=T.useState({}),L=T.useMemo(()=>i||Math.max(...Object.values(z)),[z]),A=T.useMemo(()=>({maxOverZoom:L||1,...a.runtimeOptions||{}}),[L,a.runtimeOptions]),F=T.useCallback((_,K)=>{P(ee=>{if(K===-1){const{[_]:V,...ae}=ee;return ae}return{...ee,[_]:K}})},[]),$=T.useCallback((_,K,ee)=>{m(({[_]:V,...ae})=>K?{...ae,[_]:{element:K,props:ee}}:ae)},[]),Q=T.useCallback((_,K,ee)=>{D(({[_]:V,...ae})=>K?{...ae,[_]:{element:K,props:ee}}:ae)},[]);return ne.jsxs(MR,{resetKeys:[],fallbackRender:_=>ne.jsx(g,{...a,..._}),children:[ne.jsx(yR,{...a,containerProps:{style:{position:"relative"},...a.containerProps||{}},htmlChildren:ne.jsx(ne.Fragment,{children:w.map(([_,{element:K,props:ee}])=>ne.jsx(T.Fragment,{children:ne.jsx(K,{...ee||{}})},_))}),onCreated:_=>{f(_),a.onCreated&&a.onCreated(_)},runtimeOptions:A,children:ne.jsx(ud.Provider,{value:c,children:ne.jsx(sb.Provider,{value:F,children:ne.jsx(rb.Provider,{value:$,children:ne.jsx(ib.Provider,{value:Q,children:ne.jsx(G0,{bridge:p,children:ne.jsx(Uu.Provider,{value:a.mode||"explore",children:ne.jsx(tb,{children:t})})})})})})})}),ne.jsx("div",{children:M.map(([_,{element:K,props:ee}])=>ne.jsx(T.Fragment,{children:ne.jsx(K,{...ee||{}})},_))})]})}const cd={},ob={get(t){return t},setMetaValue([t,e,n],i){const a=ob.getResourceMeta(t,e),c=a?a[n]:void 0,f=typeof i=="function"?i(c):i;cd[t]={...cd[t]||{},[e]:{...(cd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=cd[t];if(n)return e?n[e]:n}};function ab(t=ob){return{addEventListener(e,n,i,a){if(e)return t.setMetaValue([e.id,"eventManager",n],c=>{const f=c||[];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(c=>c.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"),c={};if(a&&i)for(const f of Object.keys(a))c[f]=p=>{const g=t.get(i);for(const{callback:x,scope:m}of a[f]||[])(!m||n&&m.indexOf(n)!==-1)&&x(p,g)};return c}}}function Yp(t,e){const n=Vn(),i=T.useMemo(()=>ab(n),[n]),a=or(()=>t&&t.id?n.getResourceMeta(t.id,"eventManager"):null,[t]);return T.useMemo(()=>t?i.getListenersAsProps(t,e):{},[a,t,n,e])}const fd={},lb={get(t){return t},setMetaValue([t,e,n],i){const a=lb.getResourceMeta(t,e),c=a?a[n]:void 0,f=typeof i=="function"?i(c):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 Qp(t=lb){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 Yu(t,e){const n=Vn(),i=T.useMemo(()=>Qp(n),[n]);return or(()=>{if(!t)return null;const a=i.getAppliedStyles(t.id);return a?e?a[e]:a:void 0},[t,e])}var rO=Object.defineProperty,iO=(t,e,n)=>e in t?rO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dd=(t,e,n)=>(iO(t,typeof e!="symbol"?e+"":e,n),n),sO=function(){function t(e,n){var i=[],a=!0,c=!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(x){c=!0,f=x}finally{try{!a&&p.return&&p.return()}finally{if(c)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")}}(),Qu=Math.PI*2,Gp=function(t,e,n,i,a,c,f){var p=t.x,g=t.y;p*=e,g*=n;var x=i*p-a*g,m=a*p+i*g;return{x:x+c,y:m+f}},oO=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),c=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:c+f*n,y:f-c*n},{x:c,y:f}]},ub=function(t,e,n,i){var a=t*i-e*n<0?-1:1,c=t*n+e*i;return c>1&&(c=1),c<-1&&(c=-1),a*Math.acos(c)},aO=function(t,e,n,i,a,c,f,p,g,x,m,w){var R=Math.pow(a,2),D=Math.pow(c,2),M=Math.pow(m,2),z=Math.pow(w,2),P=R*D-R*z-D*M;P<0&&(P=0),P/=R*z+D*M,P=Math.sqrt(P)*(f===p?-1:1);var L=P*a/c*w,A=P*-c/a*m,F=x*L-g*A+(t+n)/2,$=g*L+x*A+(e+i)/2,Q=(m-L)/a,_=(w-A)/c,K=(-m-L)/a,ee=(-w-A)/c,V=ub(1,0,Q,_),ae=ub(Q,_,K,ee);return p===0&&ae>0&&(ae-=Qu),p===1&&ae<0&&(ae+=Qu),[F,$,V,ae]},lO=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,c=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,x=t.largeArcFlag,m=x===void 0?0:x,w=t.sweepFlag,R=w===void 0?0:w,D=[];if(c===0||f===0)return[];var M=Math.sin(g*Qu/360),z=Math.cos(g*Qu/360),P=z*(e-i)/2+M*(n-a)/2,L=-M*(e-i)/2+z*(n-a)/2;if(P===0&&L===0)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(P,2)/Math.pow(c,2)+Math.pow(L,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var F=aO(e,n,i,a,c,f,m,R,M,z,P,L),$=sO(F,4),Q=$[0],_=$[1],K=$[2],ee=$[3],V=Math.abs(ee)/(Qu/4);Math.abs(1-V)<1e-7&&(V=1);var ae=Math.max(Math.ceil(V),1);ee/=ae;for(var ge=0;ge<ae;ge++)D.push(oO(K,ee)),K+=ee;return D.map(function(we){var Ee=Gp(we[0],c,f,z,M,Q,_),Ue=Ee.x,Fe=Ee.y,Be=Gp(we[1],c,f,z,M,Q,_),vt=Be.x,Oe=Be.y,it=Gp(we[2],c,f,z,M,Q,_),nt=it.x,W=it.y;return{x1:Ue,y1:Fe,x2:vt,y2:Oe,x:nt,y:W}})};function cb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uO=fO,Xp={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},cO=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function fO(t){var e=[];return t.replace(cO,function(n,i,a){var c=i.toLowerCase();for(a=hO(a),c=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),c="l",i=i=="m"?"l":"L");;){if(a.length==Xp[c])return a.unshift(i),e.push(a);if(a.length<Xp[c])throw new Error("malformed path data");e.push([i].concat(a.splice(0,Xp[c])))}}),e}var dO=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function hO(t){var e=t.match(dO);return e?e.map(Number):[]}const pO=cb(uO);var vO=mO;function mO(t){var e=0,n=0,i=0,a=0;return t.map(function(c){c=c.slice();var f=c[0],p=f.toUpperCase();if(f!=p)switch(c[0]=p,f){case"a":c[6]+=i,c[7]+=a;break;case"v":c[1]+=a;break;case"h":c[1]+=i;break;default:for(var g=1;g<c.length;)c[g++]+=i,c[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=c[1];break;case"V":a=c[1];break;case"M":i=e=c[1],a=n=c[2];break;default:i=c[c.length-2],a=c[c.length-1]}return c})}const gO=cb(vO);function yO(t){const e=pO(t),n=gO(e);let i,a=0,c=0,f=0,p=0,g,x,m=0,w=0;const R=[];for(let D=0;D<n.length;D++){let M=n[D];const z=M[0];switch(z){case"M":a=M[1],c=M[2];break;case"H":M=["L",M[1],c];break;case"V":M=["L",a,M[1]];break;case"S":{let P=m,L=w;(i==="C"||i=="S")&&(P+=P-f,L+=L-p),M=["C",P,L,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,x=w*2-x):(g=m,x=w),M=["Q",g,x,M[1],M[2]];break;case"Q":g=M[1],x=M[2];break;case"A":{const P=lO({px:m,py:w,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!P.length)continue;for(const[L,A]of P.entries())M=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],L<P.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,c];break}i=z,m=M[M.length-2],w=M[M.length-1],["C","Q","A"].indexOf(z)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=w),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
286
- *
287
- * All code in this module is based on JavaScript code by Raph Levien, published on his blog at
288
- * https://raphlinus.github.io/.
289
- * I merely changed the structure a bit, removed some unneeded parts and added some comments and type hints.
290
- *
291
- * Flattening of quadratic Bézier curves:
292
- * - Article: https://raphlinus.github.io/graphics/curves/2019/12/23/flatten-quadbez.html
293
- * - Code: https://github.com/raphlinus/raphlinus.github.io/blob/master/_posts/2019-12-23-flatten-quadbez.md?plain=1#L73-L212
294
- *
295
- * Flattening of cubic Bézier curves: https://levien.com/tmp/flatten.html
296
- *
297
- * Note that the code in this module has a different license than the rest of the package,
298
- * due to the inclusion of Apache-licensed third party code.
299
- *
300
- * @license
301
- * Copyright 2022 Johannes Baiter <johannes.baiter@gmail.com>
302
- * Copyright 2019, 2022 Raph Levien <raph.levien@gmail.com>
303
- *
304
- * Licensed under the Apache License, Version 2.0 (the "License");
305
- * you may not use this file except in compliance with the License.
306
- * You may obtain a copy of the License at
307
- *
308
- * http://www.apache.org/licenses/LICENSE-2.0
309
- *
310
- * Unless required by applicable law or agreed to in writing, software
311
- * distributed under the License is distributed on an "AS IS" BASIS,
312
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
313
- * See the License for the specific language governing permissions and
314
- * limitations under the License.
315
- */function bO(t,e,n,i=1){return new fb(t,e,n).subdivide(i)}function SO(t,e,n,i,a=1){return new Kp(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function xO(t){return t.x*t.x+t.y*t.y}function Gu(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function pl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class fb{constructor(e,n,i){dd(this,"start"),dd(this,"control"),dd(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:c,y:f}=this.end,p=2*i-e-c,g=2*a-n-f,x=(i-e)*p+(a-n)*g,m=(c-i)*p+(f-a)*g,w=(c-e)*g-(f-n)*p,R=x/w,D=m/w,M=Math.abs(w)/(Math.hypot(p,g)*Math.abs(D-R));return{x0:e,x2:c,scale:M,cross:w}}subdivide(e){const n=this.mapToBasic(),i=Gu(n.x0),a=Gu(n.x2),c=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(c),p=pl(i),g=pl(a),x=[0];for(let m=1;m<f;m++){const w=(pl(i+(a-i)*m/f)-p)/(g-p);x.push(w)}return x.push(1),x.map(m=>this.eval(m))}}class Kp{constructor(e){dd(this,"c"),this.c=e}weightsum(e,n,i,a){const c=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:c,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,c=3*n*e*e,f=e*e*e;return this.weightsum(i,a,c,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,c=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,c,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new fb({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),c=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]=c.x-f*g.x,i[5]=c.y-f*g.y,i[6]=c.x,i[7]=c.y,new Kp(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),c=xO(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(c/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const z=M/f,P=(M+1)/f,L=this.subsegment(z,P).midpoint_quadbez(),A=L.mapToBasic(),F=Gu(A.x0),$=Gu(A.x2),Q=Math.sqrt(A.scale);let _=Math.abs($-F)*Q;if(Math.sign(A.x0)!=Math.sign(A.x2)){const K=a/Q,ee=a*Math.abs($-F)/Gu(K);_=Math.max(_,ee)}p.push({quad:L,a0:F,a2:$,val:_}),g+=_}const x=.5*g/a,m=Math.ceil(x),w=[{x:this.c[0],y:this.c[1]}];let R=0,D=0;for(let M=1;M<m;M++){const z=g*M/m;for(;R+p[D].val<z;)R+=p[D].val,D++;const P=p[D].a0,L=p[D].a2,A=pl(P),F=pl(L),$=P+(L-P)*(z-R)/p[D].val,Q=(pl($)-A)/(F-A);w.push(p[D].quad.eval(Q))}return w.push({x:this.c[6],y:this.c[7]}),w}}const wO=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,EO=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,db=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function Xu(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return Pi(t.reduce((a,c)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=Xu(c,{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 Pi({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,c]=t.split("#");return c?Xu({type:"FragmentSelector",value:c},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):Pi({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 Pi({selector:a,selectors:[a],iiifRenderingHints:i})}if(pb(t)){const a=[];if(t.region){const c=Xu({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...c.selectors)}return Pi({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=wO.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 Pi({selector:f,selectors:[f],iiifRenderingHints:i})}const c=t.value.match(EO);if(c){const f={type:"TemporalSelector",temporal:{startTime:c[4]?parseFloat(c[4]):0,endTime:c[7]?parseFloat(c[7]):void 0}};return Pi({selector:f,selectors:[f],iiifRenderingHints:i})}return Pi({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=[],c,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}`),Pi({selector:null,selectors:[],iiifRenderingHints:i});const w=hb(m);w&&(a=w.points,g=w.shapeType,c=[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}=RO(w.element)??{svg:p})}const x={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:c?{unit:"pixel",x:c[0],y:c[1],width:c[2]-c[0],height:c[3]-c[1]}:void 0};return Pi({selector:x,selectors:[x],iiifRenderingHints:i})}return Pi({selector:null,selectors:[],iiifRenderingHints:i})}function TO(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 hb(t){var e;for(const n of Array.from(t.children))switch(n==null?void 0:n.tagName.toLowerCase()){case"g":{const i=hb(n);if(i)return i}continue;case"path":{const i=n.getAttribute("d");if(!i)continue;const a=yO(i);return{element:n,points:CO(a),shapeType:TO(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("r")??"0");if(!c)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+c*Math.cos(g),a+c*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"),c=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!c&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const x=Math.tan(g/360*Math.PI),m=c*(1-x**2)/(1+x**2),w=f*2*x/(1+x**2);p.push([i+m,a+w])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),c=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===c&&a===f)continue;return{element:n,points:[[i,a],[c,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(c=>c.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"),c=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!c||!f)continue;return{element:n,points:[[i,a],[i+c,a],[i+c,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function CO(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(...SO({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(c=>[c.x,c.y]).slice(1));continue;case"Q":e.push(...bO({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(c=>[c.x,c.y]).slice(1));continue}}return e}function RO(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=db.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=db.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 pb(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Pi(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=vb(`${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 vb(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function ao(t,e={}){if(Array.isArray(t))return ao(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?ao({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 ao(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?Xu(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?ao({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 Zp(t={},e=[]){const{id:n,selector:i}=t,a=Rs(),c=Vn(),f=n||a.annotation,p=or(x=>f?x.iiif.entities.Annotation[f]:void 0,[f]),g=or(x=>p&&p.body?p.body.map(m=>m?m.type==="SpecificResource"?{...m,source:c.get(m)}:m?x.iiif.entities[m.type][m.id]:null:null).filter(Boolean):[],[p]);return T.useMemo(()=>{if(!p)return;const x={...p,body:g,target:ao(p.target,{typeMap:c.getState().iiif.mapping})};return i?i(x):x},[p,i,g,...e])}const mb=({id:t,style:e,className:n,interactive:i})=>{const a=Zp({id:t}),c=Yu(a,"atlas"),f=Yu(a,"html"),p=Yp(a,["atlas"]),g=mi(),x=T.useMemo(()=>OR(e,c),[e,c]);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)?ne.jsx(CR,{id:a.id,isEditing:!0,region:a.target.selector.spatial,style:x,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 gb(t={},e=[]){const{id:n,selector:i}=t,a=Rs(),c=n||a.annotationPage,f=or(p=>c?p.iiif.entities.AnnotationPage[c]:void 0,[c]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,...e])}const Jp=({className:t,page:e})=>{var c;const n=gb({id:e.id})||e,i=Yu(n,"atlas"),a=Yu(n,"html");return or(f=>n.id?f.iiif.entities.AnnotationPage[n.id]:null,[]),ne.jsx(T.Fragment,{children:(c=n.items)==null?void 0:c.map(f=>ne.jsx(mb,{id:f.id,style:i,className:(a==null?void 0:a.className)||t},f.id))})};function yb({id:t,image:e,thumbnail:n,isStatic:i,x:a=0,y:c=0,children:f,selector:p,onClick:g,enableSizes:x}){var w,R;const m=T.useMemo(()=>{if(!(!p||p.spatial.x===0&&p.spatial.y===0))return p.spatial},[p]);return ne.jsx("world-object",{x:a+e.target.spatial.x,y:c+e.target.spatial.y,width:e.target.spatial.width,height:e.target.spatial.height,onClick:g,children:e.service?ne.jsxs(T.Fragment,{children:[ne.jsx(RR,{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:x,x:0,y:0,width:(w=e.target)==null?void 0:w.spatial.width,height:(R=e.target)==null?void 0:R.spatial.height,crop:m}),f]},"service"):ne.jsxs(T.Fragment,{children:[ne.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 OO=Object.defineProperty,AO=(t,e,n)=>e in t?OO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hd=(t,e,n)=>(AO(t,typeof e!="symbol"?e+"":e,n),n),MO=function(){function t(e,n){var i=[],a=!0,c=!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(x){c=!0,f=x}finally{try{!a&&p.return&&p.return()}finally{if(c)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")}}(),Ku=Math.PI*2,ev=function(t,e,n,i,a,c,f){var p=t.x,g=t.y;p*=e,g*=n;var x=i*p-a*g,m=a*p+i*g;return{x:x+c,y:m+f}},PO=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),c=Math.cos(t+e),f=Math.sin(t+e);return[{x:i-a*n,y:a+i*n},{x:c+f*n,y:f-c*n},{x:c,y:f}]},bb=function(t,e,n,i){var a=t*i-e*n<0?-1:1,c=t*n+e*i;return c>1&&(c=1),c<-1&&(c=-1),a*Math.acos(c)},LO=function(t,e,n,i,a,c,f,p,g,x,m,w){var R=Math.pow(a,2),D=Math.pow(c,2),M=Math.pow(m,2),z=Math.pow(w,2),P=R*D-R*z-D*M;P<0&&(P=0),P/=R*z+D*M,P=Math.sqrt(P)*(f===p?-1:1);var L=P*a/c*w,A=P*-c/a*m,F=x*L-g*A+(t+n)/2,$=g*L+x*A+(e+i)/2,Q=(m-L)/a,_=(w-A)/c,K=(-m-L)/a,ee=(-w-A)/c,V=bb(1,0,Q,_),ae=bb(Q,_,K,ee);return p===0&&ae>0&&(ae-=Ku),p===1&&ae<0&&(ae+=Ku),[F,$,V,ae]},DO=function(t){var e=t.px,n=t.py,i=t.cx,a=t.cy,c=t.rx,f=t.ry,p=t.xAxisRotation,g=p===void 0?0:p,x=t.largeArcFlag,m=x===void 0?0:x,w=t.sweepFlag,R=w===void 0?0:w,D=[];if(c===0||f===0)return[];var M=Math.sin(g*Ku/360),z=Math.cos(g*Ku/360),P=z*(e-i)/2+M*(n-a)/2,L=-M*(e-i)/2+z*(n-a)/2;if(P===0&&L===0)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(P,2)/Math.pow(c,2)+Math.pow(L,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var F=LO(e,n,i,a,c,f,m,R,M,z,P,L),$=MO(F,4),Q=$[0],_=$[1],K=$[2],ee=$[3],V=Math.abs(ee)/(Ku/4);Math.abs(1-V)<1e-7&&(V=1);var ae=Math.max(Math.ceil(V),1);ee/=ae;for(var ge=0;ge<ae;ge++)D.push(PO(K,ee)),K+=ee;return D.map(function(we){var Ee=ev(we[0],c,f,z,M,Q,_),Ue=Ee.x,Fe=Ee.y,Be=ev(we[1],c,f,z,M,Q,_),vt=Be.x,Oe=Be.y,it=ev(we[2],c,f,z,M,Q,_),nt=it.x,W=it.y;return{x1:Ue,y1:Fe,x2:vt,y2:Oe,x:nt,y:W}})},kO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var NO=jO,tv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},zO=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function jO(t){var e=[];return t.replace(zO,function(n,i,a){var c=i.toLowerCase();for(a=IO(a),c=="m"&&a.length>2&&(e.push([i].concat(a.splice(0,2))),c="l",i=i=="m"?"l":"L");;){if(a.length==tv[c])return a.unshift(i),e.push(a);if(a.length<tv[c])throw new Error("malformed path data");e.push([i].concat(a.splice(0,tv[c])))}}),e}var _O=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function IO(t){var e=t.match(_O);return e?e.map(Number):[]}const UO=Sb(NO);var FO=BO;function BO(t){var e=0,n=0,i=0,a=0;return t.map(function(c){c=c.slice();var f=c[0],p=f.toUpperCase();if(f!=p)switch(c[0]=p,f){case"a":c[6]+=i,c[7]+=a;break;case"v":c[1]+=a;break;case"h":c[1]+=i;break;default:for(var g=1;g<c.length;)c[g++]+=i,c[g++]+=a}switch(p){case"Z":i=e,a=n;break;case"H":i=c[1];break;case"V":a=c[1];break;case"M":i=e=c[1],a=n=c[2];break;default:i=c[c.length-2],a=c[c.length-1]}return c})}const HO=Sb(FO);function VO(t){const e=UO(t),n=HO(e);let i,a=0,c=0,f=0,p=0,g,x,m=0,w=0;const R=[];for(let D=0;D<n.length;D++){let M=n[D];const z=M[0];switch(z){case"M":a=M[1],c=M[2];break;case"H":M=["L",M[1],c];break;case"V":M=["L",a,M[1]];break;case"S":{let P=m,L=w;(i==="C"||i=="S")&&(P+=P-f,L+=L-p),M=["C",P,L,M[1],M[2],M[3],M[4]]}break;case"T":i==="Q"||i=="T"?(g=m*2-g,x=w*2-x):(g=m,x=w),M=["Q",g,x,M[1],M[2]];break;case"Q":g=M[1],x=M[2];break;case"A":{const P=DO({px:m,py:w,cx:M[6],cy:M[7],rx:M[1],ry:M[2],xAxisRotation:M[3],largeArcFlag:M[4],sweepFlag:M[5]});if(!P.length)continue;for(const[L,A]of P.entries())M=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],L<P.length-1&&R.push(M);M=M}break;case"Z":M=["L",a,c];break}i=z,m=M[M.length-2],w=M[M.length-1],["C","Q","A"].indexOf(z)>-1?(f=M[M.length-4],p=M[M.length-3]):(f=m,p=w),R.push(M)}return R}/** Code to "flatten" quadratic and cubic Bézier curves to polylines.
316
- *
317
- * All code in this module is based on JavaScript code by Raph Levien, published on his blog at
318
- * https://raphlinus.github.io/.
319
- * I merely changed the structure a bit, removed some unneeded parts and added some comments and type hints.
320
- *
321
- * Flattening of quadratic Bézier curves:
322
- * - Article: https://raphlinus.github.io/graphics/curves/2019/12/23/flatten-quadbez.html
323
- * - Code: https://github.com/raphlinus/raphlinus.github.io/blob/master/_posts/2019-12-23-flatten-quadbez.md?plain=1#L73-L212
324
- *
325
- * Flattening of cubic Bézier curves: https://levien.com/tmp/flatten.html
326
- *
327
- * Note that the code in this module has a different license than the rest of the package,
328
- * due to the inclusion of Apache-licensed third party code.
329
- *
330
- * @license
331
- * Copyright 2022 Johannes Baiter <johannes.baiter@gmail.com>
332
- * Copyright 2019, 2022 Raph Levien <raph.levien@gmail.com>
333
- *
334
- * Licensed under the Apache License, Version 2.0 (the "License");
335
- * you may not use this file except in compliance with the License.
336
- * You may obtain a copy of the License at
337
- *
338
- * http://www.apache.org/licenses/LICENSE-2.0
339
- *
340
- * Unless required by applicable law or agreed to in writing, software
341
- * distributed under the License is distributed on an "AS IS" BASIS,
342
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343
- * See the License for the specific language governing permissions and
344
- * limitations under the License.
345
- */function WO(t,e,n,i=1){return new xb(t,e,n).subdivide(i)}function $O(t,e,n,i,a=1){return new nv(new Float64Array([t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y])).subdivide(a)}function qO(t){return t.x*t.x+t.y*t.y}function Zu(t){return t/(1-.67+Math.pow(Math.pow(.67,4)+.25*t*t,.25))}function vl(t){return t*(1-.39+Math.sqrt(.39*.39+.25*t*t))}class xb{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:c,y:f}=this.end,p=2*i-e-c,g=2*a-n-f,x=(i-e)*p+(a-n)*g,m=(c-i)*p+(f-a)*g,w=(c-e)*g-(f-n)*p,R=x/w,D=m/w,M=Math.abs(w)/(Math.hypot(p,g)*Math.abs(D-R));return{x0:e,x2:c,scale:M,cross:w}}subdivide(e){const n=this.mapToBasic(),i=Zu(n.x0),a=Zu(n.x2),c=.5*Math.abs(a-i)*Math.sqrt(n.scale/e),f=Math.ceil(c),p=vl(i),g=vl(a),x=[0];for(let m=1;m<f;m++){const w=(vl(i+(a-i)*m/f)-p)/(g-p);x.push(w)}return x.push(1),x.map(m=>this.eval(m))}}class nv{constructor(e){hd(this,"c"),this.c=e}weightsum(e,n,i,a){const c=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:c,y:f}}eval(e){const n=1-e,i=n*n*n,a=3*n*n*e,c=3*n*e*e,f=e*e*e;return this.weightsum(i,a,c,f)}deriv(e){const n=1-e,i=-3*n*n,a=3*e*e,c=-6*e*n-i,f=6*e*n-a;return this.weightsum(i,c,f,a)}midpoint_quadbez(){const e=this.weightsum(-.25,.75,.75,-.25);return new xb({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),c=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]=c.x-f*g.x,i[5]=c.y-f*g.y,i[6]=c.x,i[7]=c.y,new nv(i)}subdivide(e){const n=.1*e,i=e-n,a=Math.sqrt(i),c=qO(this.weightsum(1,-3,3,-1)),f=Math.ceil(Math.pow(c/(432*n*n),1/6)),p=[];let g=0;for(let M=0;M<f;M++){const z=M/f,P=(M+1)/f,L=this.subsegment(z,P).midpoint_quadbez(),A=L.mapToBasic(),F=Zu(A.x0),$=Zu(A.x2),Q=Math.sqrt(A.scale);let _=Math.abs($-F)*Q;if(Math.sign(A.x0)!=Math.sign(A.x2)){const K=a/Q,ee=a*Math.abs($-F)/Zu(K);_=Math.max(_,ee)}p.push({quad:L,a0:F,a2:$,val:_}),g+=_}const x=.5*g/a,m=Math.ceil(x),w=[{x:this.c[0],y:this.c[1]}];let R=0,D=0;for(let M=1;M<m;M++){const z=g*M/m;for(;R+p[D].val<z;)R+=p[D].val,D++;const P=p[D].a0,L=p[D].a2,A=vl(P),F=vl(L),$=P+(L-P)*(z-R)/p[D].val,Q=(vl($)-A)/(F-A);w.push(p[D].quad.eval(Q))}return w.push({x:this.c[6],y:this.c[7]}),w}}const YO=/&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/,QO=/&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/,wb=/^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;function pd(t,{domParser:e,svgPreprocessor:n,iiifRenderingHints:i}={}){if(Array.isArray(t))return Li(t.reduce((a,c)=>{const{selector:f,selectors:p,iiifRenderingHints:g}=pd(c,{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 Li({selector:null,selectors:[],iiifRenderingHints:i});if(typeof t=="string"){const[a,c]=t.split("#");return c?pd({type:"FragmentSelector",value:c},{svgPreprocessor:n,iiifRenderingHints:i,domParser:e}):Li({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 Li({selector:a,selectors:[a],iiifRenderingHints:i})}if(ZO(t)){const a=[];if(t.region){const c=pd({type:"FragmentSelector",value:"xywh="+t.region},{domParser:e,svgPreprocessor:n,iiifRenderingHints:i});a.push(...c.selectors)}return Li({selector:a[0],selectors:a,iiifRenderingHints:i?{...i,...t}:t})}if(t.type==="FragmentSelector"){const a=YO.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 Li({selector:f,selectors:[f],iiifRenderingHints:i})}const c=t.value.match(QO);if(c){const f={type:"TemporalSelector",temporal:{startTime:c[4]?parseFloat(c[4]):0,endTime:c[7]?parseFloat(c[7]):void 0}};return Li({selector:f,selectors:[f],iiifRenderingHints:i})}return Li({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=[],c,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}`),Li({selector:null,selectors:[],iiifRenderingHints:i});const w=Eb(m);w&&(a=w.points,g=w.shapeType,c=[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}=KO(w.element)??{svg:p})}const x={type:"SvgSelector",svg:p,svgShape:g,style:f,points:a.length?a:void 0,spatial:c?{unit:"pixel",x:c[0],y:c[1],width:c[2]-c[0],height:c[3]-c[1]}:void 0};return Li({selector:x,selectors:[x],iiifRenderingHints:i})}return Li({selector:null,selectors:[],iiifRenderingHints:i})}function GO(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=VO(i);return{element:n,points:XO(a),shapeType:GO(a)}}case"circle":{const i=parseFloat(n.getAttribute("cx")??"0"),a=parseFloat(n.getAttribute("cy")??"0"),c=parseFloat(n.getAttribute("r")??"0");if(!c)continue;const f=[];for(let p=0;p<=360;p+=12){const g=p*Math.PI/180;f.push([i+c*Math.cos(g),a+c*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"),c=parseFloat(n.getAttribute("rx")??"0"),f=parseFloat(n.getAttribute("ry")??"0");if(!c&&!f)continue;const p=[];for(let g=0;g<=360;g+=12){const x=Math.tan(g/360*Math.PI),m=c*(1-x**2)/(1+x**2),w=f*2*x/(1+x**2);p.push([i+m,a+w])}return{element:n,points:p,shapeType:"ellipse"}}case"line":{const i=parseFloat(n.getAttribute("x0")??"0"),a=parseFloat(n.getAttribute("y0")??"0"),c=parseFloat(n.getAttribute("x1")??"0"),f=parseFloat(n.getAttribute("y1")??"0");if(i===c&&a===f)continue;return{element:n,points:[[i,a],[c,f]],shapeType:"polyline"}}case"polygon":case"polyline":{const i=((e=n.getAttribute("points"))==null?void 0:e.split(" ").map(c=>c.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"),c=parseFloat(n.getAttribute("width")??"0"),f=parseFloat(n.getAttribute("height")??"0");if(!c||!f)continue;return{element:n,points:[[i,a],[i+c,a],[i+c,a+f],[i,a+f],[i,a]],shapeType:"rect"}}default:continue}return null}function XO(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(...$O({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(c=>[c.x,c.y]).slice(1));continue;case"Q":e.push(...WO({x:i[0],y:i[1]},{x:a[1],y:a[2]},{x:a[3],y:a[4]}).map(c=>[c.x,c.y]).slice(1));continue}}return e}function KO(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=wb.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=wb.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 ZO(t){return!!t&&t.type==="iiif:ImageApiSelector"&&t.type==="iiif:ImageApiSelector"}function Li(t){if(t.iiifRenderingHints){const e=t.iiifRenderingHints;if(e.rotation){const n=JO(`${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 JO(t){let e=parseFloat(t);return e&&t.startsWith("!")&&(e=360-e),e&&(e=e%360),e!==e?0:e||0}function Ju(t,e={}){if(Array.isArray(t))return Ju(t[0]);if(typeof t=="string"){const[n,i]=t.split("#");return i?Ju({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 Ju(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?pd(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?Ju({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 eA=Object.defineProperty,tA=(t,e,n)=>e in t?eA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tb=(t,e,n)=>(tA(t,typeof e!="symbol"?e+"":e,n),n);function nA(t){return Array.isArray(t)?t:t?[t]:[]}const Cb=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function rA(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=Cb.indexOf(t["@type"]);if(e!==-1)return Cb[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}class rv{constructor(e,n={}){Tb(this,"traversals"),Tb(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 rv({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(rA(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 c of i)typeof c=="string"?a.push(this.traverseContentResource({"@id":c,"@type":"dctypes:Image"})):a.push(this.traverseContentResource(c));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 c of i)a.push(this.traverseService(c));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 c=a(i);return typeof c>"u"&&!this.options.allowUndefinedReturn?i:c},e)}}const iA="http://library.stanford.edu/iiif/image-api/compliance.html#level0",Rb="http://library.stanford.edu/iiif/image-api/compliance.html#level1",Ob="http://library.stanford.edu/iiif/image-api/compliance.html#level2",sA="http://library.stanford.edu/iiif/image-api/conformance.html#level0",Ab="http://library.stanford.edu/iiif/image-api/conformance.html#level1",Mb="http://library.stanford.edu/iiif/image-api/conformance.html#level2",oA="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",Pb="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",Lb="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",aA="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",Db="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",kb="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",lA="http://iiif.io/api/image/1/level0.json",uA="http://iiif.io/api/image/1/profiles/level0.json",Nb="http://iiif.io/api/image/1/level1.json",zb="http://iiif.io/api/image/1/profiles/level1.json",jb="http://iiif.io/api/image/1/level2.json",_b="http://iiif.io/api/image/1/profiles/level2.json",cA="http://iiif.io/api/image/2/level0.json",fA="http://iiif.io/api/image/2/profiles/level0.json",Ib="http://iiif.io/api/image/2/level1.json",Ub="http://iiif.io/api/image/2/profiles/level1.json",Fb="http://iiif.io/api/image/2/level2.json",Bb="http://iiif.io/api/image/2/profiles/level2.json",dA="level0",Hb="level1",Vb="level2",hA="http://iiif.io/api/image/2/level0",Wb="http://iiif.io/api/image/2/level1",$b="http://iiif.io/api/image/2/level2",pA=[Wb,$b,Rb,Ob,Ab,Mb,Pb,Lb,Db,kb,Nb,zb,jb,_b,Ib,Ub,Fb,Bb,Hb,Vb],vA=[hA,Wb,$b,iA,Rb,Ob,sA,Ab,Mb,oA,Pb,Lb,aA,Db,kb,lA,uA,Nb,zb,jb,_b,cA,fA,Ib,Ub,Fb,Bb,dA,Hb,Vb];function Os(t){for(const e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}const iv={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function mA(t){if(typeof t=="string")return[t];if(!t)return[];const e=Array.isArray(t)?t:[t],n=[];for(const i of e){if(typeof i=="string"){n.push(i);continue}n.push({"@language":i["@language"]||i.language,"@value":i["@value"]||i.value})}return n}function qo(t,e="none"){if(!t)return{};const n=mA(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 c=a["@language"];i[c]=i[c]?i[c]:[],i[c].push(a["@value"]||"")}return i}function qb(t){if(Array.isArray(t))return qb(t.find(e=>typeof e=="string"));if(vA.indexOf(t)!==-1)return"level2";if(pA.indexOf(t)!==-1)return"level1";if(typeof t=="string")return t}function gA(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 yA(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 Yb(t){for(const e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}const bA=["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 c=yA(i);if(c)return c}if(a){const c=gA(a);if(c)return c}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 c of["sc","oa","dcterms","dctypes","iiif"])if(n.startsWith(`${c}:`)){n=n.slice(c.length+1);break}switch(n){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(n&&bA.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 SA=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function xA(t){const e=t.match(SA);return e?e[0]:t}function wA(t,e="Rights/License",n="none"){let i=null;const a=[],c=Array.isArray(t)?t:[t];for(const f of c){const p=f?xA(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 EA=["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 TA(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"),EA.indexOf(i)===-1&&n.push(i);if(e.length)return n.length===1?n[0]:n}}function CA(t){return t?t.map(e=>({label:qo(e.label),value:qo(e.value)})):[]}let Qb=0;function Gb(t,e){const n=encodeURI(t.id||t["@id"]||"").trim();return n&&e?`${n}/${e}`:n||(Qb++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${Qb}`)}function As(t){const e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let n;return Array.isArray(t.motivation)?n=t.motivation.map(Yb):t.motivation&&(n=Yb(t.motivation)),{"@context":t["@context"]?TA(t["@context"]):void 0,id:(t["@id"]||Gb(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 Ms(t){const[e,n]=wA(t.license),i=[...t.metadata?CA(t.metadata):[],...n];return{rights:e,metadata:i.length?i:void 0,label:t.label?qo(t.label):void 0,requiredStatement:t.attribution?{label:qo(iv.attributionLabel),value:qo(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?qo(t.description):void 0,thumbnail:RA(t.thumbnail)}}function RA(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 OA(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 lo(t){const e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],n=t.contentLayer;return{provider:t.logo||e.length?[{id:iv.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:qo(iv.providerName)}]:void 0,partOf:OA(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?nA(t.service):void 0,supplementary:n?[n]:void 0}}function AA(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function MA(t){return Os({...As(t),...Ms(t),...lo(t),items:t.members})}function PA(t){const e=[],n=[];let i;for(const c of t.sequences||[])c.canvases.length&&e.push(...c.canvases),c.behavior&&n.push(...c.behavior),c.startCanvas&&(i=c.startCanvas);const a=As(t);return n.length&&(a.behavior?a.behavior.push(...n):a.behavior=n),Os({...a,...Ms(t),...lo(t),start:i,items:e,structures:t.structures})}function LA(t){return Os({...As(t),...Ms(t),...lo(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:Gb(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function DA(t){return Os({...As(t),...Ms(t),...lo(t),items:t.resources&&t.resources.length?t.resources:void 0})}function kA(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],startCanvas:t.startCanvas}}function NA(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:av(n.selector)}}else return encodeURI(n["@id"]).trim()}return Os({...As(t),...Ms(t),...lo(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(ov):ov(t.resource)})}function ov(t){const e=t;return Os({...As(e),...Ms(e),...lo(e),...AA(e)})}function zA(t){const e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),{...As(t),...Ms(t),items:e}}function jA(t){return Os({...As(t),...Ms(t),...lo(t),items:t.members})}function _A(t){const{"@id":e,"@type":n,"@context":i,profile:a,...c}=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=qb(a)),Os({...f,...c})}function IA(t){return Os({...As(t),...Ms(t),...lo(t)})}new rv({collection:[MA],manifest:[PA],canvas:[LA],annotationList:[DA],sequence:[kA],annotation:[NA],contentResource:[ov],choice:[zA],range:[jA],service:[_A],layer:[IA]});function av(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[av(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(av)];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 Xb={exports:{}};(function(t,e){var n=Object.defineProperty,i=(c,f,p)=>f in c?n(c,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[f]=p,a=(c,f,p)=>(i(c,typeof f!="symbol"?f+"":f,p),p);(function(c,f){f(e)})(kO,function(c){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",x="http://library.stanford.edu/iiif/image-api/conformance.html#level2",m="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",w="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",D="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",M="http://iiif.io/api/image/1/level1.json",z="http://iiif.io/api/image/1/profiles/level1.json",P="http://iiif.io/api/image/1/level2.json",L="http://iiif.io/api/image/1/profiles/level2.json",A="http://iiif.io/api/image/2/level1.json",F="http://iiif.io/api/image/2/profiles/level1.json",$="http://iiif.io/api/image/2/level2.json",Q="http://iiif.io/api/image/2/profiles/level2.json",_="level1",K="level2",ee="http://iiif.io/api/image/2/level1",V="http://iiif.io/api/image/2/level2",ae=[ee,V,f,p,g,x,m,w,R,D,M,z,P,L,A,F,$,Q,_,K],ge=["http://iiif.io/api/image/2/level0",ee,V,"http://library.stanford.edu/iiif/image-api/compliance.html#level0",f,p,"http://library.stanford.edu/iiif/image-api/conformance.html#level0",g,x,"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",m,w,"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",R,D,"http://iiif.io/api/image/1/level0.json","http://iiif.io/api/image/1/profiles/level0.json",M,z,P,L,"http://iiif.io/api/image/2/level0.json","http://iiif.io/api/image/2/profiles/level0.json",A,F,$,Q,"level0",_,K],we=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];class Ee{constructor(N,Z={}){a(this,"traversals"),a(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...N},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...Z}}static all(N){return new Ee({collection:[N],manifest:[N],canvas:[N],annotationList:[N],sequence:[N],annotation:[N],contentResource:[N],choice:[N],range:[N],service:[N],layer:[N]})}traverseCollection(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(N))),this.traversals.collection)}traverseCollectionItems(N){if(this.options.mergeMemberProperties){const Z=[...(N.manifests||[]).map(Me=>typeof Me=="string"?{"@id":Me,"@type":"sc:Manifest"}:Me),...(N.collections||[]).map(Me=>typeof Me=="string"?{"@id":Me,"@type":"sc:Collection"}:Me),...N.members||[]];delete N.collections,delete N.manifests,N.members=Z}return N.manifests&&(N.manifests=N.manifests.map(Z=>this.traverseManifest(typeof Z=="string"?{"@id":Z,"@type":"sc:Manifest"}:Z))),N.collections&&(N.collections=N.collections.map(Z=>this.traverseCollection(typeof Z=="string"?{"@id":Z,"@type":"sc:Collection"}:Z))),N.members&&(N.members=N.members.map(Z=>typeof Z=="string"?Z:this.traverseUnknown(Z))),N}traverseManifest(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(N))),this.traversals.manifest)}traverseManifestItems(N){return N.sequences&&(N.sequences=N.sequences.map(Z=>this.traverseSequence(Z))),N.structures&&(N.structures=N.structures.map(Z=>this.traverseRange(Z))),N}traverseSequence(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(N))),this.traversals.sequence)}traverseSequenceItems(N){return N.canvases&&(N.canvases=N.canvases.map(Z=>this.traverseCanvas(Z))),N}traverseCanvas(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(N))),this.traversals.canvas)}traverseCanvasItems(N){return N.images&&(N.images=N.images.map(Z=>this.traverseAnnotation(Z))),N.otherContent&&(N.otherContent=N.otherContent.map(Z=>this.traverseAnnotationList(Z))),N}traverseRange(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(N))),this.traversals.range)}traverseRangeItems(N){if(this.options.mergeMemberProperties){const Z=[...(N.ranges||[]).map(Me=>typeof Me=="string"?{"@id":Me,"@type":"sc:Range"}:Me),...(N.canvases||[]).map(Me=>typeof Me=="string"?{"@id":Me,"@type":"sc:Canvas"}:Me),...N.members||[]];delete N.ranges,delete N.canvases,N.members=Z.length?Z.map(Me=>this.traverseUnknown(Me)):void 0}return N}traverseAnnotationList(N){const Z=typeof N=="string"?{"@id":N,"@type":"sc:AnnotationList"}:N;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(Z)),this.traversals.annotationList)}traverseAnnotationListItems(N){return N.resources&&(N.resources=N.resources.map(Z=>this.traverseAnnotation(Z))),N}traverseAnnotation(N){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(N))),this.traversals.annotation)}traverseAnnotationItems(N){return N.resource&&(Array.isArray(N.resource)?N.resource=N.resource.map(Z=>this.traverseContentResource(Z)):N.resource=this.traverseContentResource(N.resource)),N.on,N}traverseLayer(N){return this.traverseType(this.traverseLinking(this.traverseLayerItems(N)),this.traversals.layer)}traverseLayerItems(N){return N.otherContent&&(N.otherContent=N.otherContent.map(Z=>this.traverseAnnotationList(Z))),N}traverseChoice(N){return this.traverseType(this.traverseChoiceItems(N),this.traversals.choice)}traverseChoiceItems(N){return N.default&&N.default!=="rdf:nil"&&(N.default=this.traverseContentResource(N.default)),N.item&&N.item!=="rdf:nil"&&(N.item=N.item.map(Z=>this.traverseContentResource(Z))),N}traverseService(N){return this.traverseType(this.traverseLinking(N),this.traversals.service)}traverseContentResource(N){return N["@type"]==="oa:Choice"?this.traverseChoice(N):this.traverseType(this.traverseDescriptive(this.traverseLinking(N)),this.traversals.contentResource)}traverseUnknown(N){if(!N["@type"]||typeof N=="string")return N;switch(function(Z){if(Z==null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(Z))throw new Error("Array is not a valid entity");if(typeof Z!="object")throw new Error(typeof Z+" is not a valid entity");if(typeof Z["@type"]=="string"){const Me=we.indexOf(Z["@type"]);if(Me!==-1)return we[Me]}if(Z.profile)return"Service";if(Z.format||Z["@type"])return"ContentResource";throw new Error("Resource type is not known")}(N)){case"sc:Collection":return this.traverseCollection(N);case"sc:Manifest":return this.traverseManifest(N);case"sc:Canvas":return this.traverseCanvas(N);case"sc:Sequence":return this.traverseSequence(N);case"sc:Range":return this.traverseRange(N);case"oa:Annotation":return this.traverseAnnotation(N);case"sc:AnnotationList":return this.traverseAnnotationList(N);case"sc:Layer":return this.traverseLayer(N);case"Service":return this.traverseService(N);case"oa:Choice":return this.traverseChoice(N);case"ContentResource":return this.traverseContentResource(N)}return N.profile?this.traverseService(N):N}traverseImageResource(N){const Z=Array.isArray(N),Me=Array.isArray(N)?N:[N],ft=[];for(const et of Me)typeof et=="string"?ft.push(this.traverseContentResource({"@id":et,"@type":"dctypes:Image"})):ft.push(this.traverseContentResource(et));return Z||this.options.convertPropsToArray?ft:ft[0]}traverseDescriptive(N){return N.thumbnail&&(N.thumbnail=this.traverseImageResource(N.thumbnail)),N.logo&&(N.logo=this.traverseImageResource(N.logo)),N}traverseOneOrMoreServices(N){const Z=Array.isArray(N),Me=Array.isArray(N)?N:[N],ft=[];for(const et of Me)ft.push(this.traverseService(et));return Z||this.options.convertPropsToArray?ft:ft[0]}traverseLinking(N){return N.related&&(N.related=this.traverseOneOrManyType(N.related,this.traversals.contentResource)),N.rendering&&(N.rendering=this.traverseOneOrManyType(N.rendering,this.traversals.contentResource)),N.service&&(N.service=this.traverseOneOrMoreServices(N.service)),N.seeAlso&&(N.seeAlso=this.traverseOneOrManyType(N.seeAlso,this.traversals.contentResource)),N.within&&(typeof N.within=="string"||(N.within=this.traverseOneOrManyType(N.within,this.traversals.contentResource))),N.startCanvas&&(typeof N.startCanvas=="string"?N.startCanvas=this.traverseType({"@id":N.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):N.startCanvas&&this.traverseType(N.startCanvas,this.traversals.canvas)),N.contentLayer&&(typeof N.contentLayer=="string"?N.contentLayer=this.traverseLayer({"@id":N.contentLayer,"@type":"sc:Layer"}):N.contentLayer=this.traverseLayer(N.contentLayer)),N}traverseOneOrManyType(N,Z){if(!Array.isArray(N)){if(!this.options.convertPropsToArray)return this.traverseType(N,Z);N=[N]}return N.map(Me=>this.traverseType(Me,Z))}traverseType(N,Z){return Z.reduce((Me,ft)=>{const et=ft(Me);return et!==void 0||this.options.allowUndefinedReturn?et:Me},N)}}function Ue(I){for(const N in I)I[N]!==void 0&&I[N]!==null||delete I[N];return I}const Fe="Attribution",Be="http://example.org/provider",vt="Unknown";function Oe(I,N="none"){if(!I)return{};const Z=function(ft){if(typeof ft=="string")return[ft];if(!ft)return[];const et=Array.isArray(ft)?ft:[ft],Ft=[];for(const mn of et)typeof mn!="string"?Ft.push({"@language":mn["@language"]||mn.language,"@value":mn["@value"]||mn.value}):Ft.push(mn);return Ft}(I),Me={};for(const ft of Z){if(typeof ft=="string"){Me[N]=Me[N]?Me[N]:[],Me[N].push(ft||"");continue}if(!ft["@language"]){Me[N]=Me[N]?Me[N]:[],Me[N].push(ft["@value"]||"");continue}const et=ft["@language"];Me[et]=Me[et]?Me[et]:[],Me[et].push(ft["@value"]||"")}return Me}function it(I){return Array.isArray(I)?it(I.find(N=>typeof N=="string")):ge.indexOf(I)!==-1?"level2":ae.indexOf(I)!==-1?"level1":typeof I=="string"?I:void 0}function nt(I){for(const N of["sc","oa","dcterms","dctypes","iiif"])if(I.startsWith(`${N}:`))return I.slice(N.length+1);return I}const W=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function Re(I){const N=I["@id"]||I.id;let Z=I["@type"]||I.type;const Me=I.profile||void 0,ft=I["@context"]||void 0;if(Me){const et=function(Ft){switch(Ft){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"}}(Me);if(et)return et}if(ft){const et=function(Ft){const mn=Array.isArray(Ft)?Ft:[Ft];for(const Le of mn)switch(Le){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"}}(ft);if(et)return et}if(Z){if(Array.isArray(Z)){if(Z.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(Z.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";Z=Z[0]}for(const et of["sc","oa","dcterms","dctypes","iiif"])if(Z.startsWith(`${et}:`)){Z=Z.slice(et.length+1);break}switch(Z){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(Z&&W.indexOf(Z)!==-1)return Z;if(I.format){if(I.format.startsWith("image/"))return"Image";if(I.format.startsWith("text/")||I.format==="application/pdf")return"Text";if(I.format.startsWith("application/"))return"Dataset"}return N&&(N.endsWith(".jpg")||N.endsWith(".png")||N.endsWith(".jpeg"))?"Image":Z||"unknown"}const Ie=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function tt(I){const N=I.match(Ie);return N?N[0]:I}const at=["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 $t(I){if(I){const N=Array.isArray(I)?I:[I],Z=[];for(const Me of N)Me==="http://iiif.io/api/presentation/2/context.json"&&Z.push("http://iiif.io/api/presentation/3/context.json"),at.indexOf(Me)===-1&&Z.push(Me);if(N.length)return Z.length===1?Z[0]:Z}}let jt=0;function yt(I,N){const Z=encodeURI(I.id||I["@id"]||"").trim();return Z&&N?`${Z}/${N}`:Z||(jt++,`http://example.org/${I["@type"]}${N?`/${N}`:""}/${jt}`)}function xt(I){const N=[...I.behavior||[]];let Z;return I.viewingHint&&N.push(I.viewingHint),Array.isArray(I.motivation)?Z=I.motivation.map(nt):I.motivation&&(Z=nt(I.motivation)),{"@context":I["@context"]?$t(I["@context"]):void 0,id:(I["@id"]||yt(I)).trim(),type:Re(I),behavior:N.length?N:void 0,height:I.height?I.height:void 0,width:I.width?I.width:void 0,motivation:Z,viewingDirection:I.viewingDirection,profile:I.profile,format:I.format?I.format:void 0,duration:void 0,timeMode:void 0}}function Pt(I){const[N,Z]=function(et,Ft="Rights/License",mn="none"){let Le=null;const oe=[],X=Array.isArray(et)?et:[et];for(const de of X){const le=de?tt(de):void 0;!le||le.indexOf("creativecommons.org")===-1&&le.indexOf("rightsstatements.org")===-1?le&&oe.push({label:{[mn]:[Ft]},value:{[mn]:[le]}}):Le=le.startsWith("https://")?`http://${le.slice(8)}`:le}return[Le,oe]}(I.license),Me=[...I.metadata?(ft=I.metadata,ft?ft.map(et=>({label:Oe(et.label),value:Oe(et.value)})):[]):[],...Z];var ft;return{rights:N,metadata:Me.length?Me:void 0,label:I.label?Oe(I.label):void 0,requiredStatement:I.attribution?{label:Oe(Fe),value:Oe(I.attribution)}:void 0,navDate:I.navDate,summary:I.description?Oe(I.description):void 0,thumbnail:St(I.thumbnail)}}function St(I){return I&&(Array.isArray(I)?I:[I]).map(N=>typeof N=="string"?{id:N,type:"Image"}:(N.type==="unknown"&&(N.type="Image"),N))}function ht(I){if(!I.within)return;const N=Array.isArray(I.within)?I.within:[I.within],Z=[];for(const Me of N)typeof Me=="string"?Me&&I["@type"]==="sc:Manifest"&&Z.push({id:Me,type:"Collection"}):Me["@id"]&&Z.push({id:Me["@id"],type:Re(Me)});return Z.length?Z:void 0}function ke(I){const N=I.related?Array.isArray(I.related)?I.related:[I.related]:[],Z=I.contentLayer;return{provider:I.logo||N.length?[{id:Be,type:"Agent",homepage:N.length?[N[0]]:void 0,logo:I.logo?Array.isArray(I.logo)?I.logo:[I.logo]:void 0,label:Oe(vt)}]:void 0,partOf:ht(I),rendering:I.rendering,seeAlso:I.seeAlso,start:I.startCanvas,service:I.service?(Me=I.service,Array.isArray(Me)?Me:Me?[Me]:[]):void 0,supplementary:Z?[Z]:void 0};var Me}function qe(I){const N=I;return Ue({...xt(N),...Pt(N),...ke(N),...(Z=N,{chars:Z.chars,format:Z.format?Z.format:void 0,language:Z.language})});var Z}const st=new Ee({collection:[function(I){return Ue({...xt(I),...Pt(I),...ke(I),items:I.members})}],manifest:[function(I){const N=[],Z=[];let Me;for(const et of I.sequences||[])et.canvases.length&&N.push(...et.canvases),et.behavior&&Z.push(...et.behavior),et.startCanvas&&(Me=et.startCanvas);const ft=xt(I);return Z.length&&(ft.behavior?ft.behavior.push(...Z):ft.behavior=Z),Ue({...ft,...Pt(I),...ke(I),start:Me,items:N,structures:I.structures})}],canvas:[function(I){return Ue({...xt(I),...Pt(I),...ke(I),annotations:I.otherContent&&I.otherContent.length?I.otherContent:void 0,items:I.images&&I.images.length?[{id:yt(I,"annotation-page"),type:"AnnotationPage",items:I.images}]:void 0})}],annotationList:[function(I){return Ue({...xt(I),...Pt(I),...ke(I),items:I.resources&&I.resources.length?I.resources:void 0})}],sequence:[function(I){return I.canvases&&I.canvases.length!==0?{canvases:I.canvases,behavior:I.viewingHint?[I.viewingHint]:[],startCanvas:I.startCanvas}:{canvases:[],behavior:[]}}],annotation:[function(I){return Ue({...xt(I),...Pt(I),...ke(I),target:function N(Z){if(Array.isArray(Z)){if(Z.length>1)return{type:"List",items:Z.map(N)};Z=Z[0]}if(typeof Z=="string")return encodeURI(Z).trim();if("@type"in Z){let Me;if(typeof Z.full=="string")Me=Z.full;else if(Z.full["@type"]==="dctypes:Image")Me={id:Z.full["@id"],type:"Image"};else{if(Z.full["@type"]!=="sc:Canvas")throw new Error(`Unsupported source type on annotation: ${Z.full["@type"]}`);Me={id:Z.full["@id"],type:"Canvas"}}return{type:"SpecificResource",source:Me,selector:wt(Z.selector)}}return encodeURI(Z["@id"]).trim()}(I.on),body:Array.isArray(I.resource)?I.resource.map(qe):qe(I.resource)})}],contentResource:[qe],choice:[function(I){const N=[];return I.default&&I.default!=="rdf:nil"&&N.push(I.default),I.item&&I.item!=="rdf:nil"&&N.push(...I.item),{...xt(I),...Pt(I),items:N}}],range:[function(I){return Ue({...xt(I),...Pt(I),...ke(I),items:I.members})}],service:[function(I){const{"@id":N,"@type":Z,"@context":Me,profile:ft,...et}=I,Ft={};return N&&(Ft["@id"]=N),Ft["@type"]=Re(I),Ft["@type"]==="unknown"&&(Me&&Me.length&&(Ft["@context"]=Me),Ft["@type"]="Service"),ft&&(Ft.profile=it(ft)),Ue({...Ft,...et})}],layer:[function(I){return Ue({...xt(I),...Pt(I),...ke(I)})}]});function wt(I){if((Array.isArray(I["@type"])&&I["@type"].includes("oa:SvgSelector")||I["@type"]=="oa:SvgSelector")&&("chars"in I||"value"in I))return{type:"SvgSelector",value:"chars"in I?I.chars:I.value};if(I["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:I.value};if(I["@type"]==="oa:Choice")return[wt(I.default),...(Array.isArray(I.item)?I.item:[I.item]).map(wt)];if(I["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in I?I.region:void 0,rotation:"rotation"in I?I.rotation:void 0};throw new Error(`Unsupported selector type: ${I["@type"]}`)}const vn=function(I){return I&&I["@context"]&&(I["@context"]==="http://iiif.io/api/presentation/2/context.json"||I["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||I["@context"]==="http://www.shared-canvas.org/ns/context.json")||I["@context"]==="http://iiif.io/api/image/2/context.json"?st.traverseUnknown(I):I};c.upgrade=vn,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})})(Xb,Xb.exports);function UA(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}function lv(t,e){const{selector:n,source:i}=Ju(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 Kb={makeChoice:()=>{}},vd={type:"unknown"},In=t=>({type:"unknown",reason:t,annotations:{pages:[]}}),Zb=(t,e)=>({type:"empty",width:t,height:e,annotations:{pages:[]},image:null,images:[]});function FA(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 BA(t,e){return or(n=>{const i=[];if(!t)return i;const a=Object.keys(n.iiif.entities.AnnotationPage);for(const c of a)if(!e||e.indexOf(c)!==-1){const f=FA(n,c);f&&f.views&&f.views[t]&&i.push(c)}return i},[t,e])}function Jb({canvas:t,manifest:e,all:n,canvases:i}){const a=[];if(e)for(const c of e.annotations)a.indexOf(c.id)===-1&&a.push(c.id);if(n){if(i&&i.length)for(const c of i)for(const f of c.annotations)a.indexOf(f.id)===-1&&a.push(f.id)}else if(t)for(const c of t.annotations)a.indexOf(c.id)===-1&&a.push(c.id);return a}function HA(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 uv(t,e={}){const n=Vn(),i=Zi(),a=mi(),c=Fp(),f=T.useMemo(()=>Jb({all:e.all,manifest:i,canvas:a,canvases:c}),[e.all,a,c,i]),p=BA(t,e.all?void 0:f),g=T.useCallback(m=>{t&&n.setMetaValue([m,"annotationPageManager","views"],w=>w&&!w[t]?w:{...w||{},[t]:!1})},[t,n]),x=T.useCallback((m,w={})=>{if(!t)return;const R=n.getState(),D=[];if(w!=null&&w.deselectOthers){const M=Object.keys(R.iiif.entities.AnnotationPage);for(const z of M){const P=HA(R,z);P&&P.views&&P.views[t]&&D.push(z)}}for(const M of D)g(M);n.setMetaValue([m,"annotationPageManager","views"],M=>M&&M[t]?M:{...M||{},[t]:!0})},[t,g,n]);return{availablePageIds:f,enabledPageIds:p,setPageEnabled:x,setPageDisabled:g}}function e1(t,e){return or((n,i)=>i.get(t.map(a=>({id:a,type:e}))),[t,e])}const t1=T.createContext(new Ss.ImageServiceLoader);function ec(){return T.useContext(t1)}function n1(){const t=ec(),[e,n]=T.useState({}),i=T.useRef(!1);return T.useEffect(()=>()=>{i.current=!0},[]),[T.useCallback((c,{height:f,width:p})=>{if(c){const g=c.id||c["@id"],x=t.loadServiceSync({id:g,width:c.width||p,height:c.height||f,source:c});x?c=x:e[g]||(i.current||n(m=>({...m,[g]:"loading"})),t.loadService({id:g,width:c.width||p,height:c.height||f}).then(()=>{i.current||n(m=>({...m,[g]:"done"}))}))}return c},[t,e]),e]}function md(t={}){const e=Zp(),n=mi(t.canvasId?{id:t.canvasId}:void 0);return or((i,a)=>{if(!n)return[];if(e&&t.enableSingleAnnotation)return[e];const c=a.get(n.items),f=[];for(const p of c)f.push(...a.get(p.items));return f},[n])}function VA(t){return t.type==="SpecificResource"?[t.source,{selector:t.selector}]:[t,{selector:null}]}const gd={},r1={get(t){return t},setMetaValue([t,e,n],i){const a=r1.getResourceMeta(t,e),c=a?a[n]:void 0,f=typeof i=="function"?i(c):i;gd[t]={...gd[t]||{},[e]:{...(gd[t]||{})[e]||{},[n]:f}}},getResourceMeta:(t,e)=>{const n=gd[t];if(n)return e?n[e]:n}};function WA(t=r1){function e(a){const c=a?typeof a=="string"?t.get(a):a:null;if(!c)return[];const f=t.get(c.items,{parent:c}),p=[];for(const g of f)p.push(...t.get(g.items,{parent:g}));return p}function n(a,c=[]){const f=Array.isArray(a)?a:e(a),p=[];let g=null;const x=[];for(const m of f){if(m.type!=="Annotation")throw new Error("getPaintables() accept either a canvas or list of annotations");const w=Array.from(Array.isArray(m.body)?m.body:[m.body]);for(const R of w){const[D,{selector:M}]=VA(R),z=t.get(D),P=(z.type||"unknown").toLowerCase();if(P==="choice"){const L=t.get(z.items,{parent:z.id}),A=c.length?c.map(F=>L.find($=>$.id===F)).filter(Boolean):[L[0]];A.length===0&&A.push(L[0]),g={type:"single-choice",items:L.map(F=>({id:F.id,label:F.label,selected:A.indexOf(F)!==-1})),label:D.label},w.push(...A);continue}p.indexOf(P)===-1&&p.push(P),x.push({type:P,annotationId:m.id,resource:z,target:m.target,selector:M})}}return{types:p,items:x,choice:g}}function i(a){const{choice:c}=n(a);return c}return{getAllPaintingAnnotations:e,getPaintables:n,extractChoices:i}}function i1(t,e=[]){const n=Vn(),i=T.useMemo(()=>WA(n),[]),a=md({enableSingleAnnotation:t==null?void 0:t.enableSingleAnnotation}),[c,f]=T.useState((t==null?void 0:t.defaultChoices)||[]),p=T.useMemo(()=>i.getPaintables(a,c),[n,a,c,...e]),x={makeChoice:T.useCallback((m,{deselectOthers:w=!0,deselect:R=!1}={})=>{if(p.choice){if(p.choice.type!=="single-choice")throw new Error("Complex choice not supported yet");f(D=>{if(R){const z=D.filter(P=>P!==m);if(z.length===0){const P=p.items[0].resource.id;return P?[P]:[]}return z}if(w)return[m];const M=[...D];if(M.length===0&&p.items.length){const z=p.items[0].resource.id;z&&M.push(z)}return D.indexOf(m)!==-1?D:[...D,m]})}},[p.choice])};return[p,x]}const $A=["model/gltf-binary"];function s1(t,e){const i=e.items[0].resource;return i.format?$A.indexOf(i.format)===-1?In(`3D format: ${i.format} is unsupported`):{type:"3d-model",model:i}:In("Unknown format")}function qA(t,e){var i;if(!t.duration)return In("No duration on canvas");if(e.items.length>1)return In("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:[]}}:In("Audio does not have format"):In("Unknown audio")}function o1(t,e,n){const i=[];for(const a of e.items){const c=a.resource&&a.resource.type==="SpecificResource"?a.resource.source:a.resource;if(!c.id)return In("No resource Identifier");let f;if(c.service){const D=Ss.getImageServices(c);D[0]&&(f=n(D[0],t))}const p={type:"BoxSelector",spatial:{x:0,y:0,width:Number(t.width),height:Number(t.height)}},[g,x]=lv(t,a.target);if(!(x.id===t.id||decodeURIComponent(x.id||"")===(t.id||"")))continue;a.resource.width&&a.resource.height&&(a.resource.width,a.resource.height);let m=a.resource.type==="SpecificResource"?ao(a.resource):null;if(a.selector){const D=ao({type:"SpecificResource",source:a.resource,selector:a.selector});D&&(m=D)}const w=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:c.id,type:"Image",annotationId:a.annotationId,width:Number(g||w?c.width:t.width),height:Number(g||w?c.height:t.height),service:f,sizes:f&&f.sizes?f.sizes:c.width&&c.height?[{width:c.width,height:c.height}]:[],target:g&&g.type!=="PointSelector"?g:p,selector:w};i.push(R)}return{type:"images",image:i[0],images:i,choice:e.choice}}function a1(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=>a1(a,e,i))}return e}function l1(t,e){const n=[];return e.items.forEach(i=>{if(i.resource){const[a]=lv(t,i.target);n.push({annotationId:i.annotationId,text:a1(i.resource),target:a})}}),{type:"textual-content",items:n}}const YA=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;function u1(t,e){var p;const n=e.items.filter(g=>g.type==="video");let i=!1;if(t.duration||(i=!0),n.length>1)return In("Only one video source supported");const a=(p=n[0])==null?void 0:p.resource,c=!!(a.service||[]).find(g=>(g.profile||"").includes("youtube.com"));if(!c&&i)return In("Video does not have duration");if(!a)return In("Unknown video");if((!a.format||a.format==="text/html")&&!c)return In("Video does not have format");const f={annotationId:e.items[0].annotationId,duration:t.duration,url:a.id,type:"Video",items:[],target:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}},format:a.format,selector:{type:"TemporalSelector",temporal:{startTime:0,endTime:t.duration}}};if(c){f.type="VideoYouTube";const g=a.id.match(YA);if(!g[1])return In("Video is not known youtube video");f.youTubeId=g[1]}return{type:"media",media:f,annotations:{pages:[]}}}function c1({canvas:t,paintables:e,supports:n,loadImageService:i}){if(!t)return console.log("No canvas"),vd;if(e.types.length===0)return n.indexOf("empty")!==-1?Zb(t.width,t.height):(console.log("No paintables"),vd);if(e.types.length!==1)if(e.types.length===2&&e.types.indexOf("text")!==-1)e.types=e.types.filter(c=>c!=="text");else return n.indexOf("complex-timeline")===-1?In("Complex timeline not supported"):In("ComplexTimelineStrategy not yet supported");const a=e.types[0];return a==="image"?n.indexOf("images")===-1?In("Image not supported"):o1(t,e,i):a==="Model"||a==="model"?n.indexOf("3d-model")===-1?In("3D not supported"):s1(t,e):a==="textualbody"?n.indexOf("textual-content")===-1?In("Textual content not supported"):l1(t,e):a==="sound"||a==="audio"?n.indexOf("media")===-1?In("Media not supported"):qA(t,e):a==="video"?n.indexOf("media")===-1?In("Media not supported"):u1(t,e):vd}function f1(t){const e=Zi(),n=mi(),i=Vn(),[a,c]=n1(),{enabledPageIds:f}=uv((t==null?void 0:t.annotationPageManagerId)||(e==null?void 0:e.id)||(n==null?void 0:n.id),{all:!1}),p=e1(f,"AnnotationPage"),g=(t==null?void 0:t.strategies)||["empty","images","media","textual-content","complex-timeline"],[x,m]=i1(t,[c]),w=T.useMemo(()=>c1({canvas:n,paintables:x,supports:g,loadImageService:a}),[n,x,i,m.makeChoice]);return T.useMemo(()=>w.type==="unknown"?[w,Kb]:[{...w,annotations:{pages:p}},m],[w,p])}const d1=(t,e=[])=>{const n=Vn();T.useEffect(()=>{t(n)},[n,...e])},yd={},h1={get(t){return t},setMetaValue([t,e,n],i){const a=h1.getResourceMeta(t,e),c=a?a[n]:void 0,f=typeof i=="function"?i(c):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}},QA=new Ss.ImageServiceLoader;function GA(t=h1,e={}){const n=e.imageServiceLoader||QA;async function i(a,c,f=!1,p=[],g){const x=()=>n.getThumbnailFromResource(void 0,c,f,p);if(!a)return await n.getThumbnailFromResource(void 0,c,f,p);if(typeof a=="string"){const w=Ss.getFixedSizeFromImage(a);return w&&p.push(w),await n.getThumbnailFromResource(void 0,c,f,p)}const m=t.get(a,{skipSelfReturn:!1});if(typeof m=="string")return{best:Ss.getFixedSizeFromImage(m),fallback:[],log:[]};if(!m)return await x();switch(await(async w=>{if(w&&w.thumbnail&&w.thumbnail.length){const R=t.get(w.thumbnail[0]),D=await n.getImageCandidates(R,f);D&&D.length&&p.push(...D)}})(m),m.type){case"Annotation":{const w=Array.isArray(m.body)?m.body:[m.body],R=t.get(w[0]);return g&&!R.width&&(R.width=g.width,R.height=g.height),await n.getThumbnailFromResource(R,c,f,p)}case"Canvas":{const w=m;return i(w.items[0],c,f,p,{width:w.width,height:w.height})}case"AnnotationPage":return i(m.items[0],c,f,p,g);case"Choice":{const w=m;return!w.items||w.items[0]?await x():i(w.items[0],c,f,p,g)}case"Collection":{const w=m.items[0];return w?i(w,c,f,p,g):await x()}case"Manifest":{const w=m.items[0];return w?i(w,c,f,p,g):await x()}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,c,f,p)}return await x()}return{getBestThumbnailAtSize:i}}function cv(t,e,{canvasId:n,manifestId:i}={}){const a=Vn(),c=ec(),f=T.useMemo(()=>GA(a,{imageServiceLoader:c}),[a,c]),[p,g]=T.useState(),x=Zi(i?{id:i}:void 0),m=mi(n?{id:n}:void 0),w=m||x,R=T.useRef(!1);if(T.useEffect(()=>(R.current=!1,()=>{R.current=!0}),[]),!w)throw new Error("Must be called under a manifest or canvas context.");return d1(D=>{f.getBestThumbnailAtSize(w,t,e).then(M=>{M.best&&!R.current&&g(M.best)})},[w]),p}function XA(t){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:t}}function KA(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 p1(t){const e=Math.round(t);return`${Math.floor(e/60)}:${`${e%60}`.padStart(2,"0")}`}function bd(t){const[e,n]=T.useReducer(KA,XA(t.duration)),i=T.useRef(null),a=T.useRef(null),c=T.useRef(null),f=T.useRef(!1),p=T.useCallback(()=>{a.current&&i.current&&(a.current.innerHTML=p1(i.current.currentTime),c.current&&(c.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]),x=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]),w=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"}))},[]),D=T.useCallback(()=>{i.current&&(i.current.muted=!1,n({type:"UNMUTE"}))},[]),M=T.useCallback(L=>{i.current&&(i.current.muted=!1,i.current.volume=L/100,n({type:"SET_VOLUME",volume:L}))},[]),z=T.useCallback(L=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(L*t.duration,t.duration)),p())},[]),P=T.useCallback(L=>{i.current&&(i.current.currentTime=Math.max(0,Math.min(L,t.duration)),p())},[]);return T.useEffect(()=>{const L=setInterval(()=>{p()},350);return()=>clearInterval(L)},[p,t.duration]),T.useEffect(()=>{const L=()=>{n({type:"FINISHED"})},A=i.current;return A==null||A.addEventListener("ended",L),()=>A==null?void 0:A.removeEventListener("ended",L)},[]),[{element:i,currentTime:a,progress:c},e,{play:g,pause:m,playPause:x,mute:R,unmute:D,toggleMute:w,setVolume:M,setDurationPercent:z,setTime:P}]}const v1=T.createContext(null),m1=T.createContext(null),g1=T.createContext(null);function ZA(){const t=T.useContext(v1);if(!t)throw new Error("Ctx not found");return t}function JA(){const t=T.useContext(m1);if(!t)throw new Error("Ctx not found");return t}function eM(){const t=T.useContext(g1);if(!t)throw new Error("Ctx not found");return t}function fv({actions:t,state:e,children:n,currentTime:i,progress:a,element:c}){return ne.jsx(g1.Provider,{value:{currentTime:i,progress:a,element:c},children:ne.jsx(m1.Provider,{value:t,children:ne.jsx(v1.Provider,{value:e,children:n})})})}function y1({media:t,children:e}){const[{element:n,currentTime:i,progress:a},c,f]=bd({duration:t.duration});return ne.jsxs(fv,{state:c,actions:f,currentTime:i,progress:a,element:n,children:[ne.jsx("audio",{ref:n,src:t.url}),e]})}function b1({media:t,mediaControlsDeps:e,children:n}){return hl("portal","audio",y1,{media:t,children:n},[t,...e||[]]),null}function S1({element:t,media:e,playPause:n}){return ne.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[ne.jsx("style",{children:`
346
- .video-container {
347
- position: absolute;
348
- top: 0;
349
- bottom: 0;
350
- left: 0;
351
- right: 0;
352
- background: #000;
353
- z-index: 13;
354
- display: flex;
355
- justify-content: center;
356
- pointer-events: visible;
357
- }
358
- `}),ne.jsx("video",{ref:t,src:e.url,style:{width:"100%",objectFit:"contain"}})]})}function x1({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:c},f,p]=bd({duration:t.duration});return hl("overlay","video-element",S1,{element:i,media:t,playPause:p.playPause}),hl("portal","custom-controls",fv,{state:f,actions:p,currentTime:a,progress:c,element:i,children:n},[a,f,t,...e||[]]),null}function w1({model:t}){return ne.jsxs(ne.Fragment,{children:[ne.jsx("style",{children:`
359
- .model-container {
360
- position: absolute;
361
- top: 0;
362
- bottom: 0;
363
- left: 0;
364
- right: 0;
365
- background: #000;
366
- z-index: 13;
367
- display: flex;
368
- justify-content: center;
369
- pointer-events: visible;
370
- }
371
- `}),ne.jsx("div",{className:"model-container",children:ne.jsx("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:t.id})})]})}function E1({model:t,name:e}){return hl("overlay",`model-${e}`,w1,{model:t},[t]),null}function T1({style:t}){const e=mi();return!e||!e.height||!e.width?null:ne.jsx("box",{interactive:!1,target:{x:0,y:0,width:Number(e.width),height:Number(e.height)},style:t})}const C1=T.createContext("en");function tM(t){return ne.jsx(C1.Provider,{value:t.language,children:t.children})}function Sd(){return T.useContext(C1)}function R1(t){return t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):t}function O1({as:t,language:e,children:n,viewingDirection:i,...a}){const c=Sd();return T.useMemo(()=>R1(c)===R1(e),[c,e])?t?ne.jsx(t,{...a,children:n}):ne.jsx("span",{...a,children:n}):t?ne.jsx(t,{...a,lang:e,dir:i,children:n}):ne.jsx("span",{...a,lang:e,dir:i,children:n})}function A1(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 M1=(t,e=[])=>{const n=Sd();return T.useMemo(()=>{const i=t();return A1(n,i,[])},[n,...e])};function P1(t,e,n=`
372
- `){const i=M1(()=>Object.keys(t||{}),[t]);return[T.useMemo(()=>{if(!t)return e||"";if(typeof t=="string")return t;const a=i?t[i]:void 0;return a?typeof a=="string"?a:a.join(n):""},[i,e,t]),i]}function nM(){const t=Sd();return function(n,i,a){const c=Object.keys(n||{}),f=A1(t,c,[]);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:`
373
- `):""}}function Yo({as:t,defaultText:e,enableDangerouslySetInnerHTML:n,children:i,separator:a,...c}){const[f,p]=P1(i,e,a);return p?ne.jsx(O1,{...c,as:t,language:p,title:n?void 0:f,dangerouslySetInnerHTML:n?{__html:f}:void 0,children:n?void 0:f}):t?ne.jsx(t,{...c,children:f}):ne.jsx("span",{...c,title:n?void 0:f,dangerouslySetInnerHTML:n?{__html:f}:void 0,children:n?void 0:f})}function rM({element:t,media:e,playPause:n}){const i=T.useRef(null);return e.youTubeId?ne.jsxs("div",{className:"video-container",part:"video-container",onClick:n,children:[ne.jsx("style",{children:`
374
- .video-container {
375
- position: absolute;
376
- top: 0;
377
- bottom: 0;
378
- left: 0;
379
- right: 0;
380
- background: #000;
381
- z-index: 13;
382
- display: flex;
383
- justify-content: center;
384
- pointer-events: visible;
385
- }
386
- .video-yt {
387
- border: none;
388
- width: 100%;
389
- object-fit: contain;
390
- }
391
- `}),ne.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 iM({media:t,mediaControlsDeps:e,children:n}){const[{element:i,currentTime:a,progress:c},f,p]=bd({duration:t.duration});return hl("overlay","video-element",rM,{element:i,media:t,playPause:p.playPause}),null}function L1({x:t,y:e,onChoiceChange:n,registerActions:i,defaultChoices:a,isStatic:c,renderViewerControls:f,renderMediaControls:p,viewControlsDeps:g,mediaControlsDeps:x,strategies:m,throwOnUnknown:w,backgroundStyle:R,alwaysShowBackground:D,keepCanvasScale:M=!1,enableSizes:z=!1,enableYouTube:P=!0,onClickPaintingAnnotation:L,children:A}){const F=mi(),$=Yp(F,["deep-zoom"]),[Q]=eb(),_=nb(),K=Vn(),ee=T.useMemo(()=>Qp(K),[K]),[V,ae]=f1({strategies:m||["images"],defaultChoices:a==null?void 0:a.map(({id:Oe})=>Oe)}),ge=V.type==="images"?V.choice:void 0,we=T.useMemo(()=>M?1:Math.max(1,...V.type==="images"?V.images.map(Oe=>{var it;return(Oe.width||0)/((it=Oe.target)==null?void 0:it.spatial.width)}):[]),[M,V]);tO(we),T.useEffect(()=>{i&&i(ae)},[V.annotations]),T.useEffect(()=>{if(a)for(const Oe of a)typeof Oe.opacity<"u"&&ee.applyStyles({id:Oe.id},"atlas",{opacity:Oe.opacity})},[a]),T.useLayoutEffect(()=>{n&&n(ge)},[ge]),hl(_&&(V.type==="images"||V.type==="empty"||V.type==="textual-content"&&f)?"overlay":"none",`canvas-portal-controls-${F==null?void 0:F.id}`,ud.Provider,f?{value:_||null,children:f(V)}:{},[F,_,V,...g||[]]);const Ee=cv({maxWidth:256,maxHeight:256});if(!F)return null;const Ue=F.accompanyingCanvas,Fe=Ee&&Ee.type==="fixed"?ne.jsx("world-object",{height:F.height,width:F.width,x:t,y:e,children:ne.jsx("world-image",{uri:Ee.id,target:{x:0,y:0,width:F.width,height:F.height},display:Ee.width&&Ee.height?{width:Ee.width,height:Ee.height}:void 0,crop:void 0})}):null;if(V.type==="unknown"){if(Fe)return Fe;if(w)throw new Error(V.reason||"Unknown image strategy");return null}const Be=ne.jsxs(T.Fragment,{children:[Q?ne.jsx(Jp,{page:Q}):null,V.annotations&&V.annotations.pages?V.annotations.pages.map(Oe=>ne.jsx(Jp,{page:Oe},Oe.id)):null,A]}),vt=V.type==="images"?V.images.length:0;return ne.jsxs(ne.Fragment,{children:[ne.jsxs("world-object",{height:F.height,width:F.width,x:t,y:e,...$,children:[V.type==="empty"||D?ne.jsx(T1,{style:R}):null,V.type==="textual-content"?V.items.map((Oe,it)=>{var nt;return ne.jsxs(ne.Fragment,{children:[ne.jsx(_p,{onClick:L?W=>{W.stopPropagation(),L(Oe.annotationId,Oe,W)}:void 0,target:((nt=Oe.target)==null?void 0:nt.spatial)||void 0,children:ne.jsx("div",{"data-textual-content":!0,children:ne.jsx(Yo,{enableDangerouslySetInnerHTML:!0,children:Oe.text})})},it),Be]})}):null,V.type==="images"?ne.jsxs(ne.Fragment,{children:[V.images.map((Oe,it)=>ne.jsx(yb,{isStatic:c,image:Oe,id:Oe.id,thumbnail:it===0?Ee:void 0,selector:Oe.selector,enableSizes:z,onClick:L?nt=>{nt.stopPropagation(),L(Oe.annotationId,Oe,nt)}:void 0},Oe.id+it)),Be]}):null,V.type==="3d-model"?ne.jsx(E1,{model:V.model}):null,V.type==="media"?ne.jsx(ne.Fragment,{children:V.media.type==="Sound"?ne.jsxs(b1,{media:V.media,mediaControlsDeps:x,children:[Fe,p?p(V):null]}):V.media.type==="Video"?ne.jsxs(x1,{media:V.media,mediaControlsDeps:x,children:[Fe,p?p(V):null]}):V.media.type==="VideoYouTube"&&P?ne.jsxs(iM,{media:V.media,mediaControlsDeps:x,children:[Fe,p?p(V):null]}):null}):null]},`${F.id}/${V.type}/${vt}`),V.type==="media"&&V.media.type==="Sound"&&Ue?ne.jsx(Vu,{canvas:Ue.id,children:ne.jsx(L1,{renderViewerControls:f})}):null]})}const sM=T.forwardRef(function(e,n){const i=Zi(),a=Fp(),c=$p(),{ViewerControls:f,MediaControls:p}=e.components||{};if(T.useImperativeHandle(n,()=>c,[c]),!i)return ne.jsx("div",{});let g=0;return ne.jsxs(ne.Fragment,{children:[e.header,ne.jsx(yr.Viewer,{height:e.height,mode:e.mode,children:a.map((x,m)=>{const w=g;return g+=x.width+(e.spacing||0),ne.jsx(Vu,{canvas:x.id,children:ne.jsx(yr.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content"],renderViewerControls:m===0&&f?()=>ne.jsx(f,{}):void 0,renderMediaControls:m===0&&p?()=>ne.jsx(p,{}):void 0,x:w,...e.canvasProps||{},children:e.annotations},x.id)},x.id)})},e.reuseAtlas?"":c.currentSequenceIndex),e.children]})}),yr=T.forwardRef(function({children:e,height:n,annotations:i,canvasProps:a,spacing:c,header:f,components:p,mode:g,reuseAtlas:x,...m},w){const R=ld();return ne.jsx(ad,{vault:R,children:ne.jsx(Y0,{...m,children:ne.jsx(sM,{ref:w,height:n,components:p,spacing:c,canvasProps:a,annotations:i,header:f,mode:g,reuseAtlas:x,children:e})})})});yr.RenderImage=yb,yr.RenderCanvas=L1,yr.RenderAnnotationPage=Jp,yr.RenderAnnotation=mb,yr.Viewer=nO,yr.CanvasBackground=T1,yr.Audio=b1,yr.Video=x1,yr.Model=E1,yr.AudioHTML=y1,yr.VideoHTML=S1,yr.ModelHTML=w1;const oM=T.forwardRef(function({canvasId:e},n){const i=bR(),a=uv(e||(i==null?void 0:i.id)),c=Vn();return T.useImperativeHandle(n,()=>a,[e,i]),!i||a.enabledPageIds.length===0?null:ne.jsx(ne.Fragment,{children:a.enabledPageIds.map(f=>ne.jsx(yr.RenderAnnotationPage,{page:c.get(f)},f))})});function dv({metadata:t=[],config:e,labelWidth:n=16,showEmptyMessage:i=!0,allowHtml:a,emptyFallback:c,classes:f={},emptyMessage:p="No metadata available",emptyValueFallback:g="No value",emptyLabelFallback:x="",separator:m,tableFooter:w,tableHeader:R}){const D=T.useMemo(()=>{const z=(e||[]).reduce((L,A)=>[...L,...A.keys],[]),P={};for(const L of t){const A=L&&L.label?Object.values(L.label):[];for(const F of A)if(F&&F.length&&(z.indexOf(`metadata.${F[0]}`)!==-1||z.length===0)&&L){const $=`metadata.${F[0]}`;P[$]=P[$]?P[$]:[],P[$].push(L);break}}return P},[e,t]);return Object.keys(D).length===0&&i?ne.jsx(ne.Fragment,{children:c})||ne.jsx("div",{className:f.empty,children:p}):e&&e.length?ne.jsxs("table",{className:f.container,children:[R,ne.jsx("tbody",{children:e.map((z,P)=>{const L=[];for(const A of z.keys)for(const F of D[A]||[])L.push(ne.jsx(Yo,{enableDangerouslySetInnerHTML:a,defaultText:g,separator:m,children:F.value},P+"__"+A));return L.length===0?null:ne.jsxs("tr",{className:f.row,children:[ne.jsx("td",{className:f.label,style:n?{minWidth:n}:{},children:ne.jsx(Yo,{enableDangerouslySetInnerHTML:a,separator:m,defaultText:x,children:z.label})}),ne.jsx("td",{className:f.value,children:L})]},P)})}),w]}):ne.jsxs("table",{className:f.container,children:[R,ne.jsx("tbody",{children:t&&t.length?t.map((z,P)=>z?ne.jsxs("tr",{className:f.row,children:[ne.jsx("td",{className:f.label,style:n?{minWidth:n}:{},children:ne.jsx(Yo,{enableDangerouslySetInnerHTML:a,defaultText:g,separator:m,children:z.label})}),ne.jsx("td",{className:f.value,children:ne.jsx(Yo,{enableDangerouslySetInnerHTML:a,defaultText:g,separator:m,children:z.value})})]},P):null):null}),w]})}function aM(t){const e=Zi(),n=mi(),i=Wp(),a=T.useMemo(()=>{const c=(e==null?void 0:e.metadata)||[],f=(n==null?void 0:n.metadata)||[],p=(i==null?void 0:i.metadata)||[];return[...c,...f,...p]},[e,n,i]);return ne.jsx(dv,{metadata:a,...t})}function hv(t,e={},n=[]){return T.useMemo(()=>{var f,p;if(!t)return null;let i=e.quality;t&&t.extraQualities&&e.quality&&(t.extraQualities.includes(e.quality)||(console.log("Invalid quality",e.quality,t.extraQualities),i="default"));const a=Ss.createImageServiceRequest(t);return Ss.imageServiceRequestToString({identifier:a.identifier,server:a.server,scheme:a.scheme,type:"image",size:{max:!((f=e.size)!=null&&f.width)&&!((p=e.size)!=null&&p.height),confined:!1,upscaled:!1,...e.size||{}},format:e.format||"jpg",region:e.region||{full:!0},rotation:e!=null&&e.rotation?Number.isInteger(e.rotation)?{angle:e.rotation}:e.rotation:{angle:0},quality:i||"default",prefix:a.prefix,originalPath:a.originalPath})},[...n])}function lM(t){const e=typeof t.src=="string"?t.src:t.src.id,n=ec(),[i,a]=T.useState(!1);let c;if(e){const p=n.loadServiceSync({id:e});p&&(c=p)}!c&&!i&&n.loadService({id:e}).then(()=>{a(!0)});const f=hv(c,{size:t.size,selector:t.region,rotation:t.rotation,format:t.format,region:t.region,quality:t.quality},[i,t.src,t.size,t.region,t.rotation,t.format,t.region,t.quality]);return T.useEffect(()=>()=>{a(!1)},[e]),f?ne.jsx("img",{src:f,alt:t.alt,className:t.className,style:t.style}):ne.jsx(D1,{...t,fetchImageService:!1})}function D1(t){if(t.fetchImageService)return ne.jsx(lM,{...t});const e=typeof t.src=="string"?{id:t.src,profile:"level0"}:t.src,n=hv(e,{size:t.size,selector:t.region,rotation:t.rotation,format:t.format,region:t.region,quality:t.quality},[t.src,t.size,t.region,t.rotation,t.format,t.region,t.quality]);return n?ne.jsx("img",{src:n,alt:t.alt,className:t.className,style:t.style}):null}function uM(t){const e=Zi();return ne.jsx(dv,{metadata:(e==null?void 0:e.metadata)||[],...t})}var k1={exports:{}};(()=>{var t={296:(a,c,f)=>{var p=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,m=/^0o[0-7]+$/i,w=parseInt,R=typeof f.g=="object"&&f.g&&f.g.Object===Object&&f.g,D=typeof self=="object"&&self&&self.Object===Object&&self,M=R||D||Function("return this")(),z=Object.prototype.toString,P=Math.max,L=Math.min,A=function(){return M.Date.now()};function F(Q){var _=typeof Q;return!!Q&&(_=="object"||_=="function")}function $(Q){if(typeof Q=="number")return Q;if(function(ee){return typeof ee=="symbol"||function(V){return!!V&&typeof V=="object"}(ee)&&z.call(ee)=="[object Symbol]"}(Q))return NaN;if(F(Q)){var _=typeof Q.valueOf=="function"?Q.valueOf():Q;Q=F(_)?_+"":_}if(typeof Q!="string")return Q===0?Q:+Q;Q=Q.replace(p,"");var K=x.test(Q);return K||m.test(Q)?w(Q.slice(2),K?2:8):g.test(Q)?NaN:+Q}a.exports=function(Q,_,K){var ee,V,ae,ge,we,Ee,Ue=0,Fe=!1,Be=!1,vt=!0;if(typeof Q!="function")throw new TypeError("Expected a function");function Oe(Ie){var tt=ee,at=V;return ee=V=void 0,Ue=Ie,ge=Q.apply(at,tt)}function it(Ie){var tt=Ie-Ee;return Ee===void 0||tt>=_||tt<0||Be&&Ie-Ue>=ae}function nt(){var Ie=A();if(it(Ie))return W(Ie);we=setTimeout(nt,function(tt){var at=_-(tt-Ee);return Be?L(at,ae-(tt-Ue)):at}(Ie))}function W(Ie){return we=void 0,vt&&ee?Oe(Ie):(ee=V=void 0,ge)}function Re(){var Ie=A(),tt=it(Ie);if(ee=arguments,V=this,Ee=Ie,tt){if(we===void 0)return function(at){return Ue=at,we=setTimeout(nt,_),Fe?Oe(at):ge}(Ee);if(Be)return we=setTimeout(nt,_),Oe(Ee)}return we===void 0&&(we=setTimeout(nt,_)),ge}return _=$(_)||0,F(K)&&(Fe=!!K.leading,ae=(Be="maxWait"in K)?P($(K.maxWait)||0,_):ae,vt="trailing"in K?!!K.trailing:vt),Re.cancel=function(){we!==void 0&&clearTimeout(we),Ue=0,ee=Ee=V=we=void 0},Re.flush=function(){return we===void 0?ge:W(A())},Re}},96:(a,c,f)=>{var p="Expected a function",g=NaN,x="[object Symbol]",m=/^\s+|\s+$/g,w=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,D=/^0o[0-7]+$/i,M=parseInt,z=typeof f.g=="object"&&f.g&&f.g.Object===Object&&f.g,P=typeof self=="object"&&self&&self.Object===Object&&self,L=z||P||Function("return this")(),A=Object.prototype.toString,F=Math.max,$=Math.min,Q=function(){return L.Date.now()};function _(ee){var V=typeof ee;return!!ee&&(V=="object"||V=="function")}function K(ee){if(typeof ee=="number")return ee;if(function(ge){return typeof ge=="symbol"||function(we){return!!we&&typeof we=="object"}(ge)&&A.call(ge)==x}(ee))return g;if(_(ee)){var V=typeof ee.valueOf=="function"?ee.valueOf():ee;ee=_(V)?V+"":V}if(typeof ee!="string")return ee===0?ee:+ee;ee=ee.replace(m,"");var ae=R.test(ee);return ae||D.test(ee)?M(ee.slice(2),ae?2:8):w.test(ee)?g:+ee}a.exports=function(ee,V,ae){var ge=!0,we=!0;if(typeof ee!="function")throw new TypeError(p);return _(ae)&&(ge="leading"in ae?!!ae.leading:ge,we="trailing"in ae?!!ae.trailing:we),function(Ee,Ue,Fe){var Be,vt,Oe,it,nt,W,Re=0,Ie=!1,tt=!1,at=!0;if(typeof Ee!="function")throw new TypeError(p);function $t(St){var ht=Be,ke=vt;return Be=vt=void 0,Re=St,it=Ee.apply(ke,ht)}function jt(St){var ht=St-W;return W===void 0||ht>=Ue||ht<0||tt&&St-Re>=Oe}function yt(){var St=Q();if(jt(St))return xt(St);nt=setTimeout(yt,function(ht){var ke=Ue-(ht-W);return tt?$(ke,Oe-(ht-Re)):ke}(St))}function xt(St){return nt=void 0,at&&Be?$t(St):(Be=vt=void 0,it)}function Pt(){var St=Q(),ht=jt(St);if(Be=arguments,vt=this,W=St,ht){if(nt===void 0)return function(ke){return Re=ke,nt=setTimeout(yt,Ue),Ie?$t(ke):it}(W);if(tt)return nt=setTimeout(yt,Ue),$t(W)}return nt===void 0&&(nt=setTimeout(yt,Ue)),it}return Ue=K(Ue)||0,_(Fe)&&(Ie=!!Fe.leading,Oe=(tt="maxWait"in Fe)?F(K(Fe.maxWait)||0,Ue):Oe,at="trailing"in Fe?!!Fe.trailing:at),Pt.cancel=function(){nt!==void 0&&clearTimeout(nt),Re=0,Be=W=vt=nt=void 0},Pt.flush=function(){return nt===void 0?it:xt(Q())},Pt}(ee,V,{leading:ge,maxWait:V,trailing:we})}},703:(a,c,f)=>{var p=f(414);function g(){}function x(){}x.resetWarningCache=g,a.exports=function(){function m(D,M,z,P,L,A){if(A!==p){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}}function w(){return m}m.isRequired=m;var R={array:m,bigint:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:w,element:m,elementType:m,instanceOf:w,node:m,objectOf:w,oneOf:w,oneOfType:w,shape:w,exact:w,checkPropTypes:x,resetWarningCache:g};return R.PropTypes=R,R}},697:(a,c,f)=>{a.exports=f(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},e={};function n(a){var c=e[a];if(c!==void 0)return c.exports;var f=e[a]={exports:{}};return t[a](f,f.exports,n),f.exports}n.n=a=>{var c=a&&a.__esModule?()=>a.default:()=>a;return n.d(c,{a:c}),c},n.d=(a,c)=>{for(var f in c)n.o(c,f)&&!n.o(a,f)&&Object.defineProperty(a,f,{enumerable:!0,get:c[f]})},n.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),n.o=(a,c)=>Object.prototype.hasOwnProperty.call(a,c),n.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var i={};(()=>{n.r(i),n.d(i,{LazyLoadComponent:()=>qe,LazyLoadImage:()=>Le,trackWindowScroll:()=>W});const a=T;var c=n.n(a),f=n(697);const p=Zh;var g=n.n(p);function x(){return typeof window<"u"&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function m(oe){return m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},m(oe)}function w(oe,X){var de=Object.keys(oe);if(Object.getOwnPropertySymbols){var le=Object.getOwnPropertySymbols(oe);X&&(le=le.filter(function(he){return Object.getOwnPropertyDescriptor(oe,he).enumerable})),de.push.apply(de,le)}return de}function R(oe,X,de){return(X=M(X))in oe?Object.defineProperty(oe,X,{value:de,enumerable:!0,configurable:!0,writable:!0}):oe[X]=de,oe}function D(oe,X){for(var de=0;de<X.length;de++){var le=X[de];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(oe,M(le.key),le)}}function M(oe){var X=function(de,le){if(m(de)!=="object"||de===null)return de;var he=de[Symbol.toPrimitive];if(he!==void 0){var be=he.call(de,"string");if(m(be)!=="object")return be;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(de)}(oe);return m(X)==="symbol"?X:String(X)}function z(oe,X){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,le){return de.__proto__=le,de},z(oe,X)}function P(oe){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},P(oe)}var L=function(oe){oe.forEach(function(X){X.isIntersecting&&X.target.onVisible()})},A={},F=function(oe){(function(J,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");J.prototype=Object.create(re&&re.prototype,{constructor:{value:J,writable:!0,configurable:!0}}),Object.defineProperty(J,"prototype",{writable:!1}),re&&z(J,re)})(Ve,oe);var X,de,le,he,be=(le=Ve,he=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var J,re=P(le);if(he){var De=P(this).constructor;J=Reflect.construct(re,arguments,De)}else J=re.apply(this,arguments);return function(Ae,Ne){if(Ne&&(m(Ne)==="object"||typeof Ne=="function"))return Ne;if(Ne!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Je){if(Je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Je}(Ae)}(this,J)});function Ve(J){var re;if(function(Ae,Ne){if(!(Ae instanceof Ne))throw new TypeError("Cannot call a class as a function")}(this,Ve),(re=be.call(this,J)).supportsObserver=!J.scrollPosition&&J.useIntersectionObserver&&x(),re.supportsObserver){var De=J.threshold;re.observer=function(Ae){return A[Ae]=A[Ae]||new IntersectionObserver(L,{rootMargin:Ae+"px"}),A[Ae]}(De)}return re}return X=Ve,de=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollPosition,re=this.placeholder.getBoundingClientRect(),De=g().findDOMNode(this.placeholder).style,Ae=parseInt(De.getPropertyValue("margin-left"),10)||0,Ne=parseInt(De.getPropertyValue("margin-top"),10)||0;return{bottom:J.y+re.bottom+Ne,left:J.x+re.left+Ae,right:J.x+re.right+Ae,top:J.y+re.top+Ne}}},{key:"isPlaceholderInViewport",value:function(){if(typeof window>"u"||!this.placeholder)return!1;var J=this.props,re=J.scrollPosition,De=J.threshold,Ae=this.getPlaceholderBoundingBox(re),Ne=re.y+window.innerHeight,Je=re.x,Ct=re.x+window.innerWidth,Nt=re.y;return Nt-De<=Ae.bottom&&Ne+De>=Ae.top&&Je-De<=Ae.right&&Ct+De>=Ae.left}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var J=this,re=this.props,De=re.className,Ae=re.height,Ne=re.placeholder,Je=re.style,Ct=re.width;if(Ne&&typeof Ne.type!="function")return c().cloneElement(Ne,{ref:function(_t){return J.placeholder=_t}});var Nt=function(_t){for(var gn=1;gn<arguments.length;gn++){var qt=arguments[gn]!=null?arguments[gn]:{};gn%2?w(Object(qt),!0).forEach(function(Bt){R(_t,Bt,qt[Bt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_t,Object.getOwnPropertyDescriptors(qt)):w(Object(qt)).forEach(function(Bt){Object.defineProperty(_t,Bt,Object.getOwnPropertyDescriptor(qt,Bt))})}return _t}({display:"inline-block"},Je);return Ct!==void 0&&(Nt.width=Ct),Ae!==void 0&&(Nt.height=Ae),c().createElement("span",{className:De,ref:function(_t){return J.placeholder=_t},style:Nt},Ne)}}],de&&D(X.prototype,de),Object.defineProperty(X,"prototype",{writable:!1}),Ve}(c().Component);F.propTypes={onVisible:f.PropTypes.func.isRequired,className:f.PropTypes.string,height:f.PropTypes.oneOfType([f.PropTypes.number,f.PropTypes.string]),placeholder:f.PropTypes.element,threshold:f.PropTypes.number,useIntersectionObserver:f.PropTypes.bool,scrollPosition:f.PropTypes.shape({x:f.PropTypes.number.isRequired,y:f.PropTypes.number.isRequired}),width:f.PropTypes.oneOfType([f.PropTypes.number,f.PropTypes.string])},F.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const $=F;var Q=n(296),_=n.n(Q),K=n(96),ee=n.n(K),V=function(oe){var X=getComputedStyle(oe,null);return X.getPropertyValue("overflow")+X.getPropertyValue("overflow-y")+X.getPropertyValue("overflow-x")};const ae=function(oe){if(!(oe instanceof HTMLElement))return window;for(var X=oe;X&&X instanceof HTMLElement;){if(/(scroll|auto)/.test(V(X)))return X;X=X.parentNode}return window};function ge(oe){return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},ge(oe)}var we=["delayMethod","delayTime"];function Ee(){return Ee=Object.assign?Object.assign.bind():function(oe){for(var X=1;X<arguments.length;X++){var de=arguments[X];for(var le in de)Object.prototype.hasOwnProperty.call(de,le)&&(oe[le]=de[le])}return oe},Ee.apply(this,arguments)}function Ue(oe,X){for(var de=0;de<X.length;de++){var le=X[de];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(oe,(he=function(be,Ve){if(ge(be)!=="object"||be===null)return be;var J=be[Symbol.toPrimitive];if(J!==void 0){var re=J.call(be,"string");if(ge(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(be)}(le.key),ge(he)==="symbol"?he:String(he)),le)}var he}function Fe(oe,X){return Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,le){return de.__proto__=le,de},Fe(oe,X)}function Be(oe,X){if(X&&(ge(X)==="object"||typeof X=="function"))return X;if(X!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vt(oe)}function vt(oe){if(oe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe}function Oe(oe){return Oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},Oe(oe)}var it=function(){return typeof window>"u"?0:window.scrollX||window.pageXOffset},nt=function(){return typeof window>"u"?0:window.scrollY||window.pageYOffset};const W=function(oe){var X=function(de){(function(De,Ae){if(typeof Ae!="function"&&Ae!==null)throw new TypeError("Super expression must either be null or a function");De.prototype=Object.create(Ae&&Ae.prototype,{constructor:{value:De,writable:!0,configurable:!0}}),Object.defineProperty(De,"prototype",{writable:!1}),Ae&&Fe(De,Ae)})(re,de);var le,he,be,Ve,J=(be=re,Ve=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var De,Ae=Oe(be);if(Ve){var Ne=Oe(this).constructor;De=Reflect.construct(Ae,arguments,Ne)}else De=Ae.apply(this,arguments);return Be(this,De)});function re(De){var Ae;if(function(Je,Ct){if(!(Je instanceof Ct))throw new TypeError("Cannot call a class as a function")}(this,re),(Ae=J.call(this,De)).useIntersectionObserver=De.useIntersectionObserver&&x(),Ae.useIntersectionObserver)return Be(Ae);var Ne=Ae.onChangeScroll.bind(vt(Ae));return De.delayMethod==="debounce"?Ae.delayedScroll=_()(Ne,De.delayTime):De.delayMethod==="throttle"&&(Ae.delayedScroll=ee()(Ne,De.delayTime)),Ae.state={scrollPosition:{x:it(),y:nt()}},Ae.baseComponentRef=c().createRef(),Ae}return le=re,(he=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){typeof window>"u"||this.useIntersectionObserver||ae(g().findDOMNode(this.baseComponentRef.current))!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement=ae(g().findDOMNode(this.baseComponentRef.current)),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:it(),y:nt()}})}},{key:"render",value:function(){var De=this.props,Ae=(De.delayMethod,De.delayTime,function(Je,Ct){if(Je==null)return{};var Nt,_t,gn=function(Bt,Mr){if(Bt==null)return{};var Pr,Hr,br={},Ps=Object.keys(Bt);for(Hr=0;Hr<Ps.length;Hr++)Pr=Ps[Hr],Mr.indexOf(Pr)>=0||(br[Pr]=Bt[Pr]);return br}(Je,Ct);if(Object.getOwnPropertySymbols){var qt=Object.getOwnPropertySymbols(Je);for(_t=0;_t<qt.length;_t++)Nt=qt[_t],Ct.indexOf(Nt)>=0||Object.prototype.propertyIsEnumerable.call(Je,Nt)&&(gn[Nt]=Je[Nt])}return gn}(De,we)),Ne=this.useIntersectionObserver?null:this.state.scrollPosition;return c().createElement(oe,Ee({forwardRef:this.baseComponentRef,scrollPosition:Ne},Ae))}}])&&Ue(le.prototype,he),Object.defineProperty(le,"prototype",{writable:!1}),re}(c().Component);return X.propTypes={delayMethod:f.PropTypes.oneOf(["debounce","throttle"]),delayTime:f.PropTypes.number,useIntersectionObserver:f.PropTypes.bool},X.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},X};function Re(oe){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},Re(oe)}function Ie(oe,X){for(var de=0;de<X.length;de++){var le=X[de];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(oe,(he=function(be,Ve){if(Re(be)!=="object"||be===null)return be;var J=be[Symbol.toPrimitive];if(J!==void 0){var re=J.call(be,"string");if(Re(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(be)}(le.key),Re(he)==="symbol"?he:String(he)),le)}var he}function tt(oe,X){return tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,le){return de.__proto__=le,de},tt(oe,X)}function at(oe){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},at(oe)}var $t=function(oe){(function(J,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");J.prototype=Object.create(re&&re.prototype,{constructor:{value:J,writable:!0,configurable:!0}}),Object.defineProperty(J,"prototype",{writable:!1}),re&&tt(J,re)})(Ve,oe);var X,de,le,he,be=(le=Ve,he=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var J,re=at(le);if(he){var De=at(this).constructor;J=Reflect.construct(re,arguments,De)}else J=re.apply(this,arguments);return function(Ae,Ne){if(Ne&&(Re(Ne)==="object"||typeof Ne=="function"))return Ne;if(Ne!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Je){if(Je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Je}(Ae)}(this,J)});function Ve(J){return function(re,De){if(!(re instanceof De))throw new TypeError("Cannot call a class as a function")}(this,Ve),be.call(this,J)}return X=Ve,(de=[{key:"render",value:function(){return c().createElement($,this.props)}}])&&Ie(X.prototype,de),Object.defineProperty(X,"prototype",{writable:!1}),Ve}(c().Component);const jt=W($t);function yt(oe){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},yt(oe)}function xt(oe,X){for(var de=0;de<X.length;de++){var le=X[de];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(oe,(he=function(be,Ve){if(yt(be)!=="object"||be===null)return be;var J=be[Symbol.toPrimitive];if(J!==void 0){var re=J.call(be,"string");if(yt(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(be)}(le.key),yt(he)==="symbol"?he:String(he)),le)}var he}function Pt(oe,X){return Pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,le){return de.__proto__=le,de},Pt(oe,X)}function St(oe){if(oe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe}function ht(oe){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},ht(oe)}var ke=function(oe){(function(J,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");J.prototype=Object.create(re&&re.prototype,{constructor:{value:J,writable:!0,configurable:!0}}),Object.defineProperty(J,"prototype",{writable:!1}),re&&Pt(J,re)})(Ve,oe);var X,de,le,he,be=(le=Ve,he=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var J,re=ht(le);if(he){var De=ht(this).constructor;J=Reflect.construct(re,arguments,De)}else J=re.apply(this,arguments);return function(Ae,Ne){if(Ne&&(yt(Ne)==="object"||typeof Ne=="function"))return Ne;if(Ne!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return St(Ae)}(this,J)});function Ve(J){var re;(function(Ct,Nt){if(!(Ct instanceof Nt))throw new TypeError("Cannot call a class as a function")})(this,Ve),re=be.call(this,J);var De=J.afterLoad,Ae=J.beforeLoad,Ne=J.scrollPosition,Je=J.visibleByDefault;return re.state={visible:Je},Je&&(Ae(),De()),re.onVisible=re.onVisible.bind(St(re)),re.isScrollTracked=!!(Ne&&Number.isFinite(Ne.x)&&Ne.x>=0&&Number.isFinite(Ne.y)&&Ne.y>=0),re}return X=Ve,(de=[{key:"componentDidUpdate",value:function(J,re){re.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var J=this.props,re=J.className,De=J.delayMethod,Ae=J.delayTime,Ne=J.height,Je=J.placeholder,Ct=J.scrollPosition,Nt=J.style,_t=J.threshold,gn=J.useIntersectionObserver,qt=J.width;return this.isScrollTracked||gn&&x()?c().createElement($,{className:re,height:Ne,onVisible:this.onVisible,placeholder:Je,scrollPosition:Ct,style:Nt,threshold:_t,useIntersectionObserver:gn,width:qt}):c().createElement(jt,{className:re,delayMethod:De,delayTime:Ae,height:Ne,onVisible:this.onVisible,placeholder:Je,style:Nt,threshold:_t,width:qt})}}])&&xt(X.prototype,de),Object.defineProperty(X,"prototype",{writable:!1}),Ve}(c().Component);ke.propTypes={afterLoad:f.PropTypes.func,beforeLoad:f.PropTypes.func,useIntersectionObserver:f.PropTypes.bool,visibleByDefault:f.PropTypes.bool},ke.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const qe=ke;function st(oe){return st=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},st(oe)}var wt=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function vn(oe,X){var de=Object.keys(oe);if(Object.getOwnPropertySymbols){var le=Object.getOwnPropertySymbols(oe);X&&(le=le.filter(function(he){return Object.getOwnPropertyDescriptor(oe,he).enumerable})),de.push.apply(de,le)}return de}function I(oe){for(var X=1;X<arguments.length;X++){var de=arguments[X]!=null?arguments[X]:{};X%2?vn(Object(de),!0).forEach(function(le){N(oe,le,de[le])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oe,Object.getOwnPropertyDescriptors(de)):vn(Object(de)).forEach(function(le){Object.defineProperty(oe,le,Object.getOwnPropertyDescriptor(de,le))})}return oe}function N(oe,X,de){return(X=ft(X))in oe?Object.defineProperty(oe,X,{value:de,enumerable:!0,configurable:!0,writable:!0}):oe[X]=de,oe}function Z(){return Z=Object.assign?Object.assign.bind():function(oe){for(var X=1;X<arguments.length;X++){var de=arguments[X];for(var le in de)Object.prototype.hasOwnProperty.call(de,le)&&(oe[le]=de[le])}return oe},Z.apply(this,arguments)}function Me(oe,X){for(var de=0;de<X.length;de++){var le=X[de];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(oe,ft(le.key),le)}}function ft(oe){var X=function(de,le){if(st(de)!=="object"||de===null)return de;var he=de[Symbol.toPrimitive];if(he!==void 0){var be=he.call(de,"string");if(st(be)!=="object")return be;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(de)}(oe);return st(X)==="symbol"?X:String(X)}function et(oe,X){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,le){return de.__proto__=le,de},et(oe,X)}function Ft(oe){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},Ft(oe)}var mn=function(oe){(function(J,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");J.prototype=Object.create(re&&re.prototype,{constructor:{value:J,writable:!0,configurable:!0}}),Object.defineProperty(J,"prototype",{writable:!1}),re&&et(J,re)})(Ve,oe);var X,de,le,he,be=(le=Ve,he=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var J,re=Ft(le);if(he){var De=Ft(this).constructor;J=Reflect.construct(re,arguments,De)}else J=re.apply(this,arguments);return function(Ae,Ne){if(Ne&&(st(Ne)==="object"||typeof Ne=="function"))return Ne;if(Ne!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Je){if(Je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Je}(Ae)}(this,J)});function Ve(J){var re;return function(De,Ae){if(!(De instanceof Ae))throw new TypeError("Cannot call a class as a function")}(this,Ve),(re=be.call(this,J)).state={loaded:!1},re}return X=Ve,(de=[{key:"onImageLoad",value:function(){var J=this;return this.state.loaded?null:function(re){J.props.onLoad(re),J.props.afterLoad(),J.setState({loaded:!0})}}},{key:"getImg",value:function(){var J=this.props,re=(J.afterLoad,J.beforeLoad,J.delayMethod,J.delayTime,J.effect,J.placeholder,J.placeholderSrc,J.scrollPosition,J.threshold,J.useIntersectionObserver,J.visibleByDefault,J.wrapperClassName,J.wrapperProps,function(De,Ae){if(De==null)return{};var Ne,Je,Ct=function(_t,gn){if(_t==null)return{};var qt,Bt,Mr={},Pr=Object.keys(_t);for(Bt=0;Bt<Pr.length;Bt++)qt=Pr[Bt],gn.indexOf(qt)>=0||(Mr[qt]=_t[qt]);return Mr}(De,Ae);if(Object.getOwnPropertySymbols){var Nt=Object.getOwnPropertySymbols(De);for(Je=0;Je<Nt.length;Je++)Ne=Nt[Je],Ae.indexOf(Ne)>=0||Object.prototype.propertyIsEnumerable.call(De,Ne)&&(Ct[Ne]=De[Ne])}return Ct}(J,wt));return c().createElement("img",Z({},re,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var J=this.props,re=J.beforeLoad,De=J.className,Ae=J.delayMethod,Ne=J.delayTime,Je=J.height,Ct=J.placeholder,Nt=J.scrollPosition,_t=J.style,gn=J.threshold,qt=J.useIntersectionObserver,Bt=J.visibleByDefault,Mr=J.width;return c().createElement(qe,{beforeLoad:re,className:De,delayMethod:Ae,delayTime:Ne,height:Je,placeholder:Ct,scrollPosition:Nt,style:_t,threshold:gn,useIntersectionObserver:qt,visibleByDefault:Bt,width:Mr},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(J){var re=this.props,De=re.effect,Ae=re.height,Ne=re.placeholderSrc,Je=re.width,Ct=re.wrapperClassName,Nt=re.wrapperProps,_t=this.state.loaded,gn=_t?" lazy-load-image-loaded":"",qt=_t||!Ne?{}:{backgroundImage:"url(".concat(Ne,")"),backgroundSize:"100% 100%"};return c().createElement("span",Z({className:Ct+" lazy-load-image-background "+De+gn,style:I(I({},qt),{},{color:"transparent",display:"inline-block",height:Ae,width:Je})},Nt),J)}},{key:"render",value:function(){var J=this.props,re=J.effect,De=J.placeholderSrc,Ae=J.visibleByDefault,Ne=J.wrapperClassName,Je=J.wrapperProps,Ct=this.getLazyLoadImage();return(re||De)&&!Ae||Ne||Je?this.getWrappedLazyLoadImage(Ct):Ct}}])&&Me(X.prototype,de),Object.defineProperty(X,"prototype",{writable:!1}),Ve}(c().Component);mn.propTypes={onLoad:f.PropTypes.func,afterLoad:f.PropTypes.func,beforeLoad:f.PropTypes.func,delayMethod:f.PropTypes.string,delayTime:f.PropTypes.number,effect:f.PropTypes.string,placeholderSrc:f.PropTypes.string,threshold:f.PropTypes.number,useIntersectionObserver:f.PropTypes.bool,visibleByDefault:f.PropTypes.bool,wrapperClassName:f.PropTypes.string,wrapperProps:f.PropTypes.object},mn.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const Le=mn})(),k1.exports=i})();var cM=k1.exports;function fM(t,e,n=[],i=!1,a=[]){if(a.length&&(e=e.filter(f=>a.indexOf(f)===-1)),!e||e.length===0)return;if(e.length===1)return e[0];if(!t)return e.indexOf("none")!==-1?"none":e[0];if(e.indexOf(t)!==-1)return t;const c=t.indexOf("-")!==-1?t.slice(0,t.indexOf("-")):null;if(c&&e.indexOf(c)!==-1)return c;for(const f of n)if(e.indexOf(f)!==-1)return f;if(!i&&t){const f=e.map(p=>p.indexOf("-")!==-1?p.slice(0,p.indexOf("-")):null).indexOf(t);if(f!==-1)return e[f];for(const p of n){const g=p.indexOf("-")!==-1?p.slice(0,p.indexOf("-")):null,x=g?e.indexOf(g):-1;if(x!==-1)return e[x]}}return e.indexOf("none")!==-1?"none":e.indexOf("@none")!==-1?"@none":e[0]}function N1(t,e,n={}){const{strictFallback:i=!1,defaultText:a="",separator:c=`
392
- `,fallbackLanguages:f=[],closest:p,skipLanguages:g}=n,x=Object.keys(t||{}),m=p?e:fM(e,x,f,i,g);if(!t)return a;if(typeof t=="string")return t;const w=m?t[m]:void 0;if(w&&m){if(typeof w=="string")return w;if(w.length===1&&w[0]===""){const R=n.skipLanguages||[];return N1(t,e,{...n,skipLanguages:[...R,m]})}return w.join(c)}return""}function dM(t,e={}){return N1(t,e.language||(typeof navigator<"u"?navigator.language:"en"),e)}const hM=cM.LazyLoadComponent;function z1(t){const{size:e,visible:n,classes:i,canvasId:a,figure:c}=t,f=(e==null?void 0:e.width)||128,p=(e==null?void 0:e.height)||(e==null?void 0:e.width)||128,g=ne.jsx(pM,{...t}),x=ne.jsx(hM,{threshold:300,style:{height:p,width:f},visibleByDefault:n,children:a?ne.jsx(Vu,{canvas:a,children:g}):g});return c?ne.jsx("figure",{className:i==null?void 0:i.figure,children:x}):x}function pM({fallback:t,size:e,classes:n,showLabel:i,alt:a,dereference:c=!1}){const f=mi(),p=(e==null?void 0:e.width)||128,g=(e==null?void 0:e.height)||(e==null?void 0:e.width)||128,x=a||dM(f==null?void 0:f.label)||"",m=cv({width:p,height:g},c);return!m||m.type!=="fixed"?ne.jsx(ne.Fragment,{children:t}):ne.jsxs(ne.Fragment,{children:[ne.jsx("div",{className:n==null?void 0:n.imageWrapper,children:ne.jsx("img",{className:n==null?void 0:n.img,src:m.id,alt:x})}),i?ne.jsx(Yo,{as:"figcaption",className:n==null?void 0:n.label,children:f==null?void 0:f.label}):null]})}function vM({flat:t,size:e,classes:n={},showLabel:i,figure:a,fallback:c}){var D,M,z,P,L,A;const f=T.useRef(null),{items:p,sequence:g,currentSequenceIndex:x,setSequenceIndex:m}=$p(),w={row:((D=n.selected)==null?void 0:D.row)||n.row,item:((M=n.selected)==null?void 0:M.item)||n.item,figure:((z=n.selected)==null?void 0:z.figure)||n.figure,img:((P=n.selected)==null?void 0:P.img)||n.img,label:((L=n.selected)==null?void 0:L.label)||n.label,imageWrapper:((A=n.selected)==null?void 0:A.imageWrapper)||n.imageWrapper};T.useLayoutEffect(()=>{if(!f.current)return;const F=f.current.querySelector("[data-selected=true]");F&&F.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[x]);const R=[];for(const F of g){const $=[],Q=g[x]===F;for(const _ of F){const K=p[_];$.push(ne.jsx("div",{className:Q?w.item:n.item,children:ne.jsx(z1,{classes:Q?w:n,canvasId:K.id,size:e,showLabel:i,figure:a,placeholder:ne.jsx("div",{style:{height:128,width:128}}),fallback:c})},_))}if(t){R.push($);continue}R.push(ne.jsx("div",{onClick:_=>{m(g.indexOf(F))},"data-selected":Q,className:Q?w.row:n.row,children:$}))}return ne.jsx("div",{ref:f,className:n.container,children:R})}function mM({annotation:t,children:e}){return ne.jsx(oo,{value:{annotation:t},children:e})}function gM({annotationPage:t,children:e}){return ne.jsx(oo,{value:{annotationPage:t},children:e})}function yM({collection:t,children:e}){return ne.jsx(oo,{value:{collection:t},children:e})}function bM(t,e={}){return md(e)}function SM(t,e=!1){}function xM(t){const n=Rs().manifest,i=t?t.map(a=>typeof a=="string"?a:a==null?void 0:a.id):[];return or(a=>{const c=n?a.iiif.entities.Manifest[n]:void 0,f=(c==null?void 0:c.items)||[];if(typeof t>"u")return f;const p=[];for(const g of(c==null?void 0:c.items)||[])i.indexOf(g.id)!==-1&&p.push(g);return p},[i.join("/")])}function wM(t,e=[]){const{id:n,selector:i}=t,a=Rs(),c=n||a.collection,f=or(p=>c?p.iiif.entities.Collection[c]:void 0,[c]);return T.useMemo(()=>{if(f)return i?i(f):f},[f,i,...e])}function EM(t,e,n,i,a=[]){const c=Vn(),f=T.useMemo(()=>ab(c),[c]);T.useEffect(()=>{const p=t;return p?(f.addEventListener(p,e,n,i),()=>{f.removeEventListener(p,e,n)}):()=>{}},[f,t,e,...a])}function TM(t,e){const{id:n,isLoaded:i,error:a,resource:c,requestId:f,cached:p}=Up(t,e);return{id:n,isLoaded:i,error:a,manifest:c,requestId:f,cached:p}}function j1({cacheKey:t}={}){const e=mi(),n=md(),i=Vn(),a=ec(),[c,f]=T.useState(void 0),[p,g]=T.useState(!1),[x,m]=T.useState("idle"),[w,R]=T.useState(void 0),D=e?e.id:"undefined",M=T.useMemo(()=>{try{if(e&&n.length){const P=n[0],L=i.get(P.body[0]),F=Ss.getImageServices(L)[0];return F&&a.loadServiceSync({id:F.id||F["@id"],width:F.width||e.width,height:F.height||e.height})||void 0}}catch(P){console.error(P)}},[D,t,e]),z=x==="success"&&c?c:M;return T.useEffect(()=>{(async()=>{try{if(e&&n.length){const P=n[0],L=i.get(P.body[0]),F=Ss.getImageServices(L)[0];if(!F)return;g(!0),m("loading");try{const $=await a.loadService({id:F.id||F["@id"],width:F.width||e.width,height:F.height||e.height})||void 0;f($),m("success"),g(!1)}catch($){m("error"),R($)}}}catch(P){m("error"),R(P)}})()},[D,t]),T.useMemo(()=>({data:z,isFetching:p,status:x,error:w}),[z,p,x,w])}function CM(){const t=j1();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 RM(){const t=Zi();return t?t.service.find(e=>e.profile==="SearchService1"||e.profile==="http://iiif.io/api/search/1/search"):void 0}function OM(){const t=Vn();return T.useMemo(()=>Qp(t),[t])}var ml={},pv,vv,tc=Zh;if(process.env.NODE_ENV==="production")vv=ml.createRoot=tc.createRoot,pv=ml.hydrateRoot=tc.hydrateRoot;else{var xd=tc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;vv=ml.createRoot=function(t,e){xd.usingClientEntryPoint=!0;try{return tc.createRoot(t,e)}finally{xd.usingClientEntryPoint=!1}},pv=ml.hydrateRoot=function(t,e,n){xd.usingClientEntryPoint=!0;try{return tc.hydrateRoot(t,e,n)}finally{xd.usingClientEntryPoint=!1}}}const AM=Yx({__proto__:null,get createRoot(){return vv},default:ml,get hydrateRoot(){return pv}},[ml]);me.AnnotationContext=mM,me.AnnotationPageContext=gM,me.CanvasAnnotations=oM,me.CanvasContext=Vu,me.CanvasPanel=yr,me.CollectionContext=yM,me.CombinedMetadata=aM,me.ContextBridge=G0,me.Image=D1,me.ImageServiceLoaderContext=t1,me.InnerViewerProvider=q0,me.LanguageProvider=tM,me.LanguageString=O1,me.LocaleString=Yo,me.ManifestContext=H0,me.ManifestMetadata=uM,me.MediaPlayerProvider=fv,me.Metadata=dv,me.RangeContext=V0,me.ReactVaultContext=Hu,me.ResourceProvider=oo,me.ResourceReactContext=od,me.SequenceThumbnails=vM,me.SimpleViewerProvider=Y0,me.SimpleViewerReactContext=qu,me.SingleCanvasThumbnail=z1,me.VaultProvider=ad,me.ViewerPresetContext=ud,me.VirtualAnnotationProvider=tb,me.VisibleCanvasReactContext=Wu,me.emptyActions=Kb,me.emptyStrategy=Zb,me.expandTarget=ao,me.findAllCanvasesInRange=Bp,me.findFirstCanvasFromRange=W0,me.findManifestSelectedRange=DR,me.findSelectedRange=Hp,me.flattenAnnotationPageIds=Jb,me.formatTime=p1,me.get3dStrategy=s1,me.getImageStrategy=o1,me.getManifestSequence=Vp,me.getParsedTargetSelector=lv,me.getRenderingStrategy=c1,me.getTextualContentStrategy=l1,me.getVideoStrategy=u1,me.getVisibleCanvasesFromCanvasId=kR,me.isImageApiSelector=pb,me.parseRotation=vb,me.parseSelector=Xu,me.parseSpecificResource=UA,me.unknownResponse=vd,me.unsupportedStrategy=In,me.useAnnotation=Zp,me.useAnnotationPage=gb,me.useAnnotationPageManager=uv,me.useAnnotationsAtTime=bM,me.useCanvas=mi,me.useCanvasClock=SM,me.useCanvasSequence=$0,me.useCanvasSubset=xM,me.useClosestLanguage=M1,me.useCollection=wM,me.useContextBridge=Q0,me.useCreateLocaleString=nM,me.useDispatch=X0,me.useEventListener=EM,me.useExistingVault=ld,me.useExternalCollection=TM,me.useExternalManifest=B0,me.useExternalResource=Up,me.useIIIFLanguage=Sd,me.useImage=hv,me.useImageService=j1,me.useImageServiceLoader=ec,me.useImageTile=CM,me.useLoadImageService=n1,me.useLocaleString=P1,me.useManifest=Zi,me.useMediaActions=JA,me.useMediaElements=eM,me.useMediaState=ZA,me.usePaintables=i1,me.usePaintingAnnotations=md,me.useRange=Wp,me.useRenderingStrategy=f1,me.useResourceContext=Rs,me.useResourceEvents=Yp,me.useResources=e1,me.useSearchService=RM,me.useSimpleMediaPlayer=bd,me.useSimpleViewer=$p,me.useStyleHelper=OM,me.useStyles=Yu,me.useThumbnail=cv,me.useVault=Vn,me.useVaultEffect=d1,me.useVaultSelector=or,me.useViewerPreset=nb,me.useVirtualAnnotationPage=Z0,me.useVirtualAnnotationPageContext=eb,me.useVisibleCanvases=Fp,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})});
393
- //# sourceMappingURL=index.umd.js.map