@gamelearn/arcade-components 2.41.1 → 3.0.2

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 (212) hide show
  1. package/README.md +9 -6
  2. package/dist/arcade-components.cjs +274 -0
  3. package/dist/arcade-components.js +57929 -0
  4. package/package.json +74 -73
  5. package/dist/components/animation-component/components/AnimationComponent.js +0 -98
  6. package/dist/components/animation-component/index.js +0 -10
  7. package/dist/components/animation-component/mocks/mockForStory.js +0 -26
  8. package/dist/components/auto-evaluation-component/components/AutoEvaluation.js +0 -215
  9. package/dist/components/auto-evaluation-component/components/EndScreen.js +0 -43
  10. package/dist/components/auto-evaluation-component/components/StartScreen.js +0 -32
  11. package/dist/components/auto-evaluation-component/index.js +0 -10
  12. package/dist/components/auto-evaluation-component/mocks/mockForStory.js +0 -38
  13. package/dist/components/cards-selector-puzzle-component/components/Board/index.js +0 -159
  14. package/dist/components/cards-selector-puzzle-component/components/Card/index.js +0 -115
  15. package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js +0 -289
  16. package/dist/components/cards-selector-puzzle-component/index.js +0 -10
  17. package/dist/components/cards-selector-puzzle-component/mocks/mockForStory.js +0 -446
  18. package/dist/components/cartel-component/components/CartelComponent.js +0 -124
  19. package/dist/components/cartel-component/index.js +0 -10
  20. package/dist/components/chained-image-click-puzzle-component/components/ChainedImageClickPuzzleComponent.js +0 -80
  21. package/dist/components/chained-image-click-puzzle-component/components/CurrentImagePuzzle.js +0 -182
  22. package/dist/components/chained-image-click-puzzle-component/index.js +0 -10
  23. package/dist/components/chained-image-click-puzzle-component/mocks/mockForStory.js +0 -413
  24. package/dist/components/comic-component/components/ComicComponent.js +0 -201
  25. package/dist/components/comic-component/components/Slide.js +0 -31
  26. package/dist/components/comic-component/components/Vignette.js +0 -70
  27. package/dist/components/comic-component/index.js +0 -10
  28. package/dist/components/comic-component/mocks/mockForStory.js +0 -314
  29. package/dist/components/conversational-component/components/ConversationalComponent.js +0 -101
  30. package/dist/components/conversational-component/index.js +0 -10
  31. package/dist/components/conversational-pro-component/components/ConversationalProComponent.js +0 -543
  32. package/dist/components/conversational-pro-component/components/Message.js +0 -37
  33. package/dist/components/conversational-pro-component/components/Slot.js +0 -92
  34. package/dist/components/conversational-pro-component/components/SlotList.js +0 -162
  35. package/dist/components/conversational-pro-component/components/scene/Panel.js +0 -179
  36. package/dist/components/conversational-pro-component/components/scene/Panels.js +0 -46
  37. package/dist/components/conversational-pro-component/components/scene/index.js +0 -77
  38. package/dist/components/conversational-pro-component/index.js +0 -10
  39. package/dist/components/conversational-pro-component/mocks/mockForStory.js +0 -1529
  40. package/dist/components/cracker-puzzle-component/components/CrackerPuzzleComponent.js +0 -261
  41. package/dist/components/cracker-puzzle-component/components/DrawGrid/index.js +0 -33
  42. package/dist/components/cracker-puzzle-component/components/DrawItem/index.js +0 -48
  43. package/dist/components/cracker-puzzle-component/components/DrawRow/index.js +0 -43
  44. package/dist/components/cracker-puzzle-component/components/colors.js +0 -12
  45. package/dist/components/cracker-puzzle-component/components/helpers.js +0 -133
  46. package/dist/components/cracker-puzzle-component/index.js +0 -10
  47. package/dist/components/cracker-puzzle-component/mocks/mockForStory.js +0 -277
  48. package/dist/components/decision-component/components/DecisionBody.js +0 -116
  49. package/dist/components/decision-component/components/DecisionComponent.js +0 -248
  50. package/dist/components/decision-component/components/Feedback.js +0 -40
  51. package/dist/components/decision-component/components/Options.js +0 -74
  52. package/dist/components/decision-component/index.js +0 -10
  53. package/dist/components/decision-component/mocks/mockForStory.js +0 -166
  54. package/dist/components/dialog-component/components/BubbleWrapper.js +0 -39
  55. package/dist/components/dialog-component/components/DialogComponent.js +0 -779
  56. package/dist/components/dialog-component/components/DialogDecision.js +0 -44
  57. package/dist/components/dialog-component/components/SpeechBubbleComponent.js +0 -66
  58. package/dist/components/dialog-component/index.js +0 -10
  59. package/dist/components/dialog-component/mocks/mockForStory.js +0 -550
  60. package/dist/components/drag-item-puzzle-component/components/DragItemPuzzleComponent.js +0 -361
  61. package/dist/components/drag-item-puzzle-component/index.js +0 -10
  62. package/dist/components/drag-item-puzzle-component/mocks/mockForStory.js +0 -74
  63. package/dist/components/feedback-component/components/FeedbackComponent.js +0 -126
  64. package/dist/components/feedback-component/index.js +0 -10
  65. package/dist/components/feedback-component/mocks/mockForStory.js +0 -52
  66. package/dist/components/frame-click-puzzle-component/components/Counter/index.js +0 -24
  67. package/dist/components/frame-click-puzzle-component/components/CurrentFramePuzzle.js +0 -196
  68. package/dist/components/frame-click-puzzle-component/components/FrameClickPuzzleComponent.js +0 -178
  69. package/dist/components/frame-click-puzzle-component/components/Tooltip/index.js +0 -23
  70. package/dist/components/frame-click-puzzle-component/index.js +0 -10
  71. package/dist/components/frame-click-puzzle-component/mocks/mockForStory.js +0 -717
  72. package/dist/components/hacker-puzzle-component/components/HackerPuzzleComponent.js +0 -255
  73. package/dist/components/hacker-puzzle-component/components/languages.js +0 -13
  74. package/dist/components/hacker-puzzle-component/index.js +0 -10
  75. package/dist/components/hacker-puzzle-component/mocks/mockForStory.js +0 -103
  76. package/dist/components/hanged-puzzle-component/components/HangedPuzzleComponent.js +0 -488
  77. package/dist/components/hanged-puzzle-component/index.js +0 -10
  78. package/dist/components/hanged-puzzle-component/mocks/mockForStory.js +0 -61
  79. package/dist/components/hanged-puzzle-component/utils.js +0 -64
  80. package/dist/components/image-click-puzzle-component/components/ImageClickPuzzleComponent.js +0 -40
  81. package/dist/components/image-click-puzzle-component/index.js +0 -10
  82. package/dist/components/image-click-puzzle-component/mocks/mockForStory.js +0 -427
  83. package/dist/components/image-click-wrapper-component/components/CountDown/index.js +0 -18
  84. package/dist/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js +0 -472
  85. package/dist/components/image-click-wrapper-component/components/TimerDialog/index.js +0 -26
  86. package/dist/components/image-click-wrapper-component/index.js +0 -10
  87. package/dist/components/image-click-wrapper-component/mocks/mockForStory.js +0 -432
  88. package/dist/components/image-component/components/ImageComponent.js +0 -83
  89. package/dist/components/image-component/index.js +0 -10
  90. package/dist/components/image-component/mocks/mockForStory.js +0 -52
  91. package/dist/components/index.js +0 -260
  92. package/dist/components/inventory-item/components/InventoryItem.js +0 -120
  93. package/dist/components/inventory-item/index.js +0 -10
  94. package/dist/components/inventory-item/mocks/mockForStory.js +0 -29
  95. package/dist/components/keyboard-puzzle-component/components/KeyboardPuzzleComponent.js +0 -275
  96. package/dist/components/keyboard-puzzle-component/index.js +0 -10
  97. package/dist/components/keyboard-puzzle-component/mocks/mockForStory.js +0 -40
  98. package/dist/components/konva-components/Area/index.js +0 -170
  99. package/dist/components/konva-components/KonvaMapper.js +0 -185
  100. package/dist/components/lectures-component/components/LectureButtons.js +0 -40
  101. package/dist/components/lectures-component/components/LecturesComponent.js +0 -157
  102. package/dist/components/lectures-component/index.js +0 -10
  103. package/dist/components/lectures-component/mocks/mockForStory.js +0 -39
  104. package/dist/components/login-puzzle-component/components/LoginPuzzleComponent.js +0 -243
  105. package/dist/components/login-puzzle-component/index.js +0 -10
  106. package/dist/components/login-puzzle-component/mocks/mockForStory.js +0 -38
  107. package/dist/components/notice-component/components/NoticeComponent.js +0 -96
  108. package/dist/components/notice-component/index.js +0 -10
  109. package/dist/components/notice-component/mocks/mockForStory.js +0 -20
  110. package/dist/components/pattern-component/components/PatternComponent.js +0 -78
  111. package/dist/components/pattern-component/index.js +0 -10
  112. package/dist/components/pattern-component/mocks/mockForStory.js +0 -35
  113. package/dist/components/pdf-component/components/PdfComponent.js +0 -122
  114. package/dist/components/pdf-component/components/PdfVisor.js +0 -187
  115. package/dist/components/pdf-component/index.js +0 -20
  116. package/dist/components/pdf-component/mocks/mockForProps.js +0 -38
  117. package/dist/components/referral-component/components/EmailPill.js +0 -26
  118. package/dist/components/referral-component/components/ReferralComponent.js +0 -115
  119. package/dist/components/referral-component/components/StepOne.js +0 -170
  120. package/dist/components/referral-component/components/StepTwo.js +0 -57
  121. package/dist/components/referral-component/index.js +0 -10
  122. package/dist/components/referral-component/mocks/mockForStory.js +0 -40
  123. package/dist/components/survey-component/components/ApplicableBox.js +0 -49
  124. package/dist/components/survey-component/components/OpinionBox.js +0 -45
  125. package/dist/components/survey-component/components/SurveyComponent.js +0 -150
  126. package/dist/components/survey-component/components/TextBox.js +0 -40
  127. package/dist/components/survey-component/index.js +0 -10
  128. package/dist/components/survey-component/mocks/mockForStory.js +0 -14
  129. package/dist/components/terminal-puzzle-component/components/FilesGroup/Item.js +0 -28
  130. package/dist/components/terminal-puzzle-component/components/FilesGroup/index.js +0 -76
  131. package/dist/components/terminal-puzzle-component/components/Image/index.js +0 -22
  132. package/dist/components/terminal-puzzle-component/components/TerminalPuzzleComponent.js +0 -216
  133. package/dist/components/terminal-puzzle-component/components/Visor/index.js +0 -129
  134. package/dist/components/terminal-puzzle-component/components/utils/index.js +0 -26
  135. package/dist/components/terminal-puzzle-component/index.js +0 -10
  136. package/dist/components/terminal-puzzle-component/mocks/mockForStory.js +0 -188
  137. package/dist/components/test-component/components/Container.js +0 -211
  138. package/dist/components/test-component/components/Feedbacks.js +0 -48
  139. package/dist/components/test-component/components/Questions.js +0 -145
  140. package/dist/components/test-component/components/Results.js +0 -208
  141. package/dist/components/test-component/components/TestComponent.js +0 -302
  142. package/dist/components/test-component/index.js +0 -10
  143. package/dist/components/test-component/mocks/mockForStory.js +0 -113
  144. package/dist/components/text-click-puzzle-component/components/TextClickPuzzleComponent.js +0 -387
  145. package/dist/components/text-click-puzzle-component/index.js +0 -10
  146. package/dist/components/text-click-puzzle-component/mocks/mockForStory.js +0 -485
  147. package/dist/components/text-click-puzzle-component/utils/index.js +0 -76
  148. package/dist/components/url-component/components/UrlComponent.js +0 -88
  149. package/dist/components/url-component/index.js +0 -10
  150. package/dist/components/url-component/mocks/mockForProps.js +0 -20
  151. package/dist/components/video-component/components/VideoComponent.js +0 -73
  152. package/dist/components/video-component/index.js +0 -10
  153. package/dist/components/video-component/mocks/mockForStory.js +0 -94
  154. package/dist/components/video-visor/components/VideoControllers/BufferBar.js +0 -108
  155. package/dist/components/video-visor/components/VideoControllers/ControlButtons.js +0 -31
  156. package/dist/components/video-visor/components/VideoControllers/FinishedVideoButtons.js +0 -32
  157. package/dist/components/video-visor/components/VideoControllers/PlayInitButton.js +0 -37
  158. package/dist/components/video-visor/components/VideoControllers/SkipButton.js +0 -37
  159. package/dist/components/video-visor/components/VideoControllers/Timer.js +0 -37
  160. package/dist/components/video-visor/components/VideoControllers/VolumeBar.js +0 -92
  161. package/dist/components/video-visor/components/VideoControllers/index.js +0 -122
  162. package/dist/components/video-visor/components/VideoVisor.js +0 -271
  163. package/dist/components/video-visor/index.js +0 -10
  164. package/dist/components/video-visor/mocks/mockForStory.js +0 -42
  165. package/dist/components/web-builder-puzzle-component/Popups/PopupColorComponent/index.js +0 -87
  166. package/dist/components/web-builder-puzzle-component/Popups/PopupImageComponent/index.js +0 -94
  167. package/dist/components/web-builder-puzzle-component/Popups/PopupTextComponent/index.js +0 -114
  168. package/dist/components/web-builder-puzzle-component/Popups/index.js +0 -27
  169. package/dist/components/web-builder-puzzle-component/Templates/Bank.js +0 -98
  170. package/dist/components/web-builder-puzzle-component/Templates/Facebook.js +0 -37
  171. package/dist/components/web-builder-puzzle-component/Templates/resourcePath.js +0 -9
  172. package/dist/components/web-builder-puzzle-component/components/EditButton/index.js +0 -28
  173. package/dist/components/web-builder-puzzle-component/components/Feedback/index.js +0 -41
  174. package/dist/components/web-builder-puzzle-component/components/PublishButton/index.js +0 -29
  175. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/BankBody.js +0 -118
  176. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/FacebookBody.js +0 -149
  177. package/dist/components/web-builder-puzzle-component/components/WebBuilderBody/index.js +0 -25
  178. package/dist/components/web-builder-puzzle-component/components/WebBuilderFront/index.js +0 -89
  179. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/BankHeader.js +0 -84
  180. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/FacebookHeader.js +0 -38
  181. package/dist/components/web-builder-puzzle-component/components/WebBuilderHeader/index.js +0 -40
  182. package/dist/components/web-builder-puzzle-component/components/WebBuilderPuzzleComponent.js +0 -302
  183. package/dist/components/web-builder-puzzle-component/components/WebBuilderTopBar/index.js +0 -30
  184. package/dist/components/web-builder-puzzle-component/index.js +0 -10
  185. package/dist/components/web-builder-puzzle-component/mocks/mockForStory.js +0 -27
  186. package/dist/components/writer-puzzle-component/components/ElectionComponent.js +0 -69
  187. package/dist/components/writer-puzzle-component/components/FeedbackComponent.js +0 -97
  188. package/dist/components/writer-puzzle-component/components/FeedbackElement.js +0 -32
  189. package/dist/components/writer-puzzle-component/components/FinishedTextComponent.js +0 -25
  190. package/dist/components/writer-puzzle-component/components/FixedComponent.js +0 -120
  191. package/dist/components/writer-puzzle-component/components/SingleElection.js +0 -85
  192. package/dist/components/writer-puzzle-component/components/WriterPuzzleComponent.js +0 -450
  193. package/dist/components/writer-puzzle-component/index.js +0 -10
  194. package/dist/components/writer-puzzle-component/mocks/mockForStory.js +0 -1194
  195. package/dist/components/zoom-test/components/ZoomTest.js +0 -73
  196. package/dist/components/zoom-test/index.js +0 -10
  197. package/dist/components/zoom-test/mocks/mockForStory.js +0 -21
  198. package/dist/helpers/LangIsRtl.js +0 -16
  199. package/dist/helpers/LightSet.js +0 -35
  200. package/dist/helpers/LodController.js +0 -28
  201. package/dist/helpers/deviceDetection.js +0 -21
  202. package/dist/helpers/drawLOD.js +0 -310
  203. package/dist/helpers/index.js +0 -268
  204. package/dist/helpers/lodStats.js +0 -55
  205. package/dist/helpers/mocker.js +0 -116
  206. package/dist/helpers/useEkho.js +0 -172
  207. package/dist/helpers/useGLB.js +0 -57
  208. package/dist/helpers/useStateMachine.js +0 -277
  209. package/dist/helpers/useTimeout.js +0 -32
  210. package/dist/helpers/useWindowSize.js +0 -44
  211. package/dist/index.js +0 -16
  212. package/dist/test/testSceneWrapper.js +0 -31
@@ -0,0 +1,274 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const React$2=require("react"),drei=require("@react-three/drei"),arcadeThreeCore=require("@gamelearn/arcade-three-core"),fiber=require("@react-three/fiber"),three=require("three"),require$$0=require("react-dom");function _interopNamespaceDefault(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return e.default=o,Object.freeze(e)}const React__namespace=_interopNamespaceDefault(React$2);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function getAugmentedNamespace(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(o).forEach(function(t){var n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return o[t]}})}),r}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.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 hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var o=React$2,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,n=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,d){var h,y={},E=null,p=null;d!==void 0&&(E=""+d),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(p=f.ref);for(h in f)t.call(f,h)&&!a.hasOwnProperty(h)&&(y[h]=f[h]);if(u&&u.defaultProps)for(h in f=u.defaultProps,f)y[h]===void 0&&(y[h]=f[h]);return{$$typeof:e,type:u,key:E,ref:p,props:y,_owner:n.current}}return reactJsxRuntime_production_min.Fragment=r,reactJsxRuntime_production_min.jsx=l,reactJsxRuntime_production_min.jsxs=l,reactJsxRuntime_production_min}var reactJsxRuntime_development={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var hasRequiredReactJsxRuntime_development;function requireReactJsxRuntime_development(){return hasRequiredReactJsxRuntime_development||(hasRequiredReactJsxRuntime_development=1,process.env.NODE_ENV!=="production"&&function(){var o=React$2,e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),_=Symbol.iterator,g="@@iterator";function x(ge){if(ge===null||typeof ge!="object")return null;var ze=_&&ge[_]||ge[g];return typeof ze=="function"?ze:null}var C=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(ge){{for(var ze=arguments.length,Je=new Array(ze>1?ze-1:0),xt=1;xt<ze;xt++)Je[xt-1]=arguments[xt];S("error",ge,Je)}}function S(ge,ze,Je){{var xt=C.ReactDebugCurrentFrame,Vt=xt.getStackAddendum();Vt!==""&&(ze+="%s",Je=Je.concat([Vt]));var It=Je.map(function(Lt){return String(Lt)});It.unshift("Warning: "+ze),Function.prototype.apply.call(console[ge],console,It)}}var A=!1,T=!1,w=!1,P=!1,O=!1,k=Symbol.for("react.module.reference");function D(ge){return!!(typeof ge=="string"||typeof ge=="function"||ge===t||ge===a||O||ge===n||ge===d||ge===h||P||ge===p||A||T||w||typeof ge=="object"&&ge!==null&&(ge.$$typeof===E||ge.$$typeof===y||ge.$$typeof===l||ge.$$typeof===u||ge.$$typeof===f||ge.$$typeof===k||ge.getModuleId!==void 0))}function F(ge,ze,Je){var xt=ge.displayName;if(xt)return xt;var Vt=ze.displayName||ze.name||"";return Vt!==""?Je+"("+Vt+")":Je}function G(ge){return ge.displayName||"Context"}function V(ge){if(ge==null)return null;if(typeof ge.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ge=="function")return ge.displayName||ge.name||null;if(typeof ge=="string")return ge;switch(ge){case t:return"Fragment";case r:return"Portal";case a:return"Profiler";case n:return"StrictMode";case d:return"Suspense";case h:return"SuspenseList"}if(typeof ge=="object")switch(ge.$$typeof){case u:var ze=ge;return G(ze)+".Consumer";case l:var Je=ge;return G(Je._context)+".Provider";case f:return F(ge,ge.render,"ForwardRef");case y:var xt=ge.displayName||null;return xt!==null?xt:V(ge.type)||"Memo";case E:{var Vt=ge,It=Vt._payload,Lt=Vt._init;try{return V(Lt(It))}catch{return null}}}return null}var W=Object.assign,ee=0,q,z,U,$,I,B,X;function Q(){}Q.__reactDisabledLog=!0;function J(){{if(ee===0){q=console.log,z=console.info,U=console.warn,$=console.error,I=console.group,B=console.groupCollapsed,X=console.groupEnd;var ge={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:ge,log:ge,warn:ge,error:ge,group:ge,groupCollapsed:ge,groupEnd:ge})}ee++}}function ne(){{if(ee--,ee===0){var ge={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},ge,{value:q}),info:W({},ge,{value:z}),warn:W({},ge,{value:U}),error:W({},ge,{value:$}),group:W({},ge,{value:I}),groupCollapsed:W({},ge,{value:B}),groupEnd:W({},ge,{value:X})})}ee<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=C.ReactCurrentDispatcher,Z;function se(ge,ze,Je){{if(Z===void 0)try{throw Error()}catch(Vt){var xt=Vt.stack.trim().match(/\n( *(at )?)/);Z=xt&&xt[1]||""}return`
18
+ `+Z+ge}}var oe=!1,fe;{var de=typeof WeakMap=="function"?WeakMap:Map;fe=new de}function ce(ge,ze){if(!ge||oe)return"";{var Je=fe.get(ge);if(Je!==void 0)return Je}var xt;oe=!0;var Vt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var It;It=ae.current,ae.current=null,J();try{if(ze){var Lt=function(){throw Error()};if(Object.defineProperty(Lt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Lt,[])}catch(ci){xt=ci}Reflect.construct(ge,[],Lt)}else{try{Lt.call()}catch(ci){xt=ci}ge.call(Lt.prototype)}}else{try{throw Error()}catch(ci){xt=ci}ge()}}catch(ci){if(ci&&xt&&typeof ci.stack=="string"){for(var Dt=ci.stack.split(`
19
+ `),br=xt.stack.split(`
20
+ `),lr=Dt.length-1,ur=br.length-1;lr>=1&&ur>=0&&Dt[lr]!==br[ur];)ur--;for(;lr>=1&&ur>=0;lr--,ur--)if(Dt[lr]!==br[ur]){if(lr!==1||ur!==1)do if(lr--,ur--,ur<0||Dt[lr]!==br[ur]){var _r=`
21
+ `+Dt[lr].replace(" at new "," at ");return ge.displayName&&_r.includes("<anonymous>")&&(_r=_r.replace("<anonymous>",ge.displayName)),typeof ge=="function"&&fe.set(ge,_r),_r}while(lr>=1&&ur>=0);break}}}finally{oe=!1,ae.current=It,ne(),Error.prepareStackTrace=Vt}var sa=ge?ge.displayName||ge.name:"",Fa=sa?se(sa):"";return typeof ge=="function"&&fe.set(ge,Fa),Fa}function Se(ge,ze,Je){return ce(ge,!1)}function Le(ge){var ze=ge.prototype;return!!(ze&&ze.isReactComponent)}function Ne(ge,ze,Je){if(ge==null)return"";if(typeof ge=="function")return ce(ge,Le(ge));if(typeof ge=="string")return se(ge);switch(ge){case d:return se("Suspense");case h:return se("SuspenseList")}if(typeof ge=="object")switch(ge.$$typeof){case f:return Se(ge.render);case y:return Ne(ge.type,ze,Je);case E:{var xt=ge,Vt=xt._payload,It=xt._init;try{return Ne(It(Vt),ze,Je)}catch{}}}return""}var He=Object.prototype.hasOwnProperty,Ke={},Qe=C.ReactDebugCurrentFrame;function dt(ge){if(ge){var ze=ge._owner,Je=Ne(ge.type,ge._source,ze?ze.type:null);Qe.setExtraStackFrame(Je)}else Qe.setExtraStackFrame(null)}function yt(ge,ze,Je,xt,Vt){{var It=Function.call.bind(He);for(var Lt in ge)if(It(ge,Lt)){var Dt=void 0;try{if(typeof ge[Lt]!="function"){var br=Error((xt||"React class")+": "+Je+" type `"+Lt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ge[Lt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw br.name="Invariant Violation",br}Dt=ge[Lt](ze,Lt,xt,Je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(lr){Dt=lr}Dt&&!(Dt instanceof Error)&&(dt(Vt),R("%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).",xt||"React class",Je,Lt,typeof Dt),dt(null)),Dt instanceof Error&&!(Dt.message in Ke)&&(Ke[Dt.message]=!0,dt(Vt),R("Failed %s type: %s",Je,Dt.message),dt(null))}}}var ut=Array.isArray;function ft(ge){return ut(ge)}function Xt(ge){{var ze=typeof Symbol=="function"&&Symbol.toStringTag,Je=ze&&ge[Symbol.toStringTag]||ge.constructor.name||"Object";return Je}}function kt(ge){try{return Ge(ge),!1}catch{return!0}}function Ge(ge){return""+ge}function Ze(ge){if(kt(ge))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xt(ge)),Ge(ge)}var rt=C.ReactCurrentOwner,qt={key:!0,ref:!0,__self:!0,__source:!0},We,at,pe;pe={};function me(ge){if(He.call(ge,"ref")){var ze=Object.getOwnPropertyDescriptor(ge,"ref").get;if(ze&&ze.isReactWarning)return!1}return ge.ref!==void 0}function ye(ge){if(He.call(ge,"key")){var ze=Object.getOwnPropertyDescriptor(ge,"key").get;if(ze&&ze.isReactWarning)return!1}return ge.key!==void 0}function De(ge,ze){if(typeof ge.ref=="string"&&rt.current&&ze&&rt.current.stateNode!==ze){var Je=V(rt.current.type);pe[Je]||(R('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',V(rt.current.type),ge.ref),pe[Je]=!0)}}function Be(ge,ze){{var Je=function(){We||(We=!0,R("%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)",ze))};Je.isReactWarning=!0,Object.defineProperty(ge,"key",{get:Je,configurable:!0})}}function Ce(ge,ze){{var Je=function(){at||(at=!0,R("%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)",ze))};Je.isReactWarning=!0,Object.defineProperty(ge,"ref",{get:Je,configurable:!0})}}var Ee=function(ge,ze,Je,xt,Vt,It,Lt){var Dt={$$typeof:e,type:ge,key:ze,ref:Je,props:Lt,_owner:It};return Dt._store={},Object.defineProperty(Dt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Dt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xt}),Object.defineProperty(Dt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Vt}),Object.freeze&&(Object.freeze(Dt.props),Object.freeze(Dt)),Dt};function Pe(ge,ze,Je,xt,Vt){{var It,Lt={},Dt=null,br=null;Je!==void 0&&(Ze(Je),Dt=""+Je),ye(ze)&&(Ze(ze.key),Dt=""+ze.key),me(ze)&&(br=ze.ref,De(ze,Vt));for(It in ze)He.call(ze,It)&&!qt.hasOwnProperty(It)&&(Lt[It]=ze[It]);if(ge&&ge.defaultProps){var lr=ge.defaultProps;for(It in lr)Lt[It]===void 0&&(Lt[It]=lr[It])}if(Dt||br){var ur=typeof ge=="function"?ge.displayName||ge.name||"Unknown":ge;Dt&&Be(Lt,ur),br&&Ce(Lt,ur)}return Ee(ge,Dt,br,Vt,xt,rt.current,Lt)}}var Xe=C.ReactCurrentOwner,nt=C.ReactDebugCurrentFrame;function it(ge){if(ge){var ze=ge._owner,Je=Ne(ge.type,ge._source,ze?ze.type:null);nt.setExtraStackFrame(Je)}else nt.setExtraStackFrame(null)}var Ht;Ht=!1;function Sr(ge){return typeof ge=="object"&&ge!==null&&ge.$$typeof===e}function Qt(){{if(Xe.current){var ge=V(Xe.current.type);if(ge)return`
22
+
23
+ Check the render method of \``+ge+"`."}return""}}function Nt(ge){{if(ge!==void 0){var ze=ge.fileName.replace(/^.*[\\\/]/,""),Je=ge.lineNumber;return`
24
+
25
+ Check your code at `+ze+":"+Je+"."}return""}}var Er={};function dn(ge){{var ze=Qt();if(!ze){var Je=typeof ge=="string"?ge:ge.displayName||ge.name;Je&&(ze=`
26
+
27
+ Check the top-level render call using <`+Je+">.")}return ze}}function An(ge,ze){{if(!ge._store||ge._store.validated||ge.key!=null)return;ge._store.validated=!0;var Je=dn(ze);if(Er[Je])return;Er[Je]=!0;var xt="";ge&&ge._owner&&ge._owner!==Xe.current&&(xt=" It was passed a child from "+V(ge._owner.type)+"."),it(ge),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Je,xt),it(null)}}function Br(ge,ze){{if(typeof ge!="object")return;if(ft(ge))for(var Je=0;Je<ge.length;Je++){var xt=ge[Je];Sr(xt)&&An(xt,ze)}else if(Sr(ge))ge._store&&(ge._store.validated=!0);else if(ge){var Vt=x(ge);if(typeof Vt=="function"&&Vt!==ge.entries)for(var It=Vt.call(ge),Lt;!(Lt=It.next()).done;)Sr(Lt.value)&&An(Lt.value,ze)}}}function ui(ge){{var ze=ge.type;if(ze==null||typeof ze=="string")return;var Je;if(typeof ze=="function")Je=ze.propTypes;else if(typeof ze=="object"&&(ze.$$typeof===f||ze.$$typeof===y))Je=ze.propTypes;else return;if(Je){var xt=V(ze);yt(Je,ge.props,"prop",xt,ge)}else if(ze.PropTypes!==void 0&&!Ht){Ht=!0;var Vt=V(ze);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Vt||"Unknown")}typeof ze.getDefaultProps=="function"&&!ze.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ii(ge){{for(var ze=Object.keys(ge.props),Je=0;Je<ze.length;Je++){var xt=ze[Je];if(xt!=="children"&&xt!=="key"){it(ge),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xt),it(null);break}}ge.ref!==null&&(it(ge),R("Invalid attribute `ref` supplied to `React.Fragment`."),it(null))}}function Da(ge,ze,Je,xt,Vt,It){{var Lt=D(ge);if(!Lt){var Dt="";(ge===void 0||typeof ge=="object"&&ge!==null&&Object.keys(ge).length===0)&&(Dt+=" 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 br=Nt(Vt);br?Dt+=br:Dt+=Qt();var lr;ge===null?lr="null":ft(ge)?lr="array":ge!==void 0&&ge.$$typeof===e?(lr="<"+(V(ge.type)||"Unknown")+" />",Dt=" Did you accidentally export a JSX literal instead of a component?"):lr=typeof ge,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",lr,Dt)}var ur=Pe(ge,ze,Je,Vt,It);if(ur==null)return ur;if(Lt){var _r=ze.children;if(_r!==void 0)if(xt)if(ft(_r)){for(var sa=0;sa<_r.length;sa++)Br(_r[sa],ge);Object.freeze&&Object.freeze(_r)}else R("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(_r,ge)}return ge===t?Ii(ur):ui(ur),ur}}function Po(ge,ze,Je){return Da(ge,ze,Je,!0)}function Ws(ge,ze,Je){return Da(ge,ze,Je,!1)}var La=Ws,qr=Po;reactJsxRuntime_development.Fragment=t,reactJsxRuntime_development.jsx=La,reactJsxRuntime_development.jsxs=qr}()),reactJsxRuntime_development}process.env.NODE_ENV==="production"?jsxRuntime.exports=requireReactJsxRuntime_production_min():jsxRuntime.exports=requireReactJsxRuntime_development();var jsxRuntimeExports=jsxRuntime.exports;const useTimeout=()=>{const o=React$2.useRef(),e=(t,n)=>{o.current=setTimeout(t,n)},r=()=>{o.current&&clearTimeout(o.current)};return React$2.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{start:e,stop:r,running:!!o.current}},LangIsRtl=()=>{const o=["ar","fa","he","ku","ur"],e=document.querySelector("html").getAttribute("lang");return!!o.includes(e)};function NoticeComponent({title:o,text:e,buttonText:r,emitEvent:t,soundActions:n,keyboardControl:a,styles:l,autoEnd:u}){const[f]=n,{start:d,stop:h}=useTimeout(),y=75,E=React$2.useCallback(()=>{f("click-ui"),t({type:"success"})},[t,f]);return React$2.useEffect(()=>{if(u){const p=y*((e.length||0)+(o.length||0));d(E,p<4e3?4e3:p)}return()=>{h()}},[u,E,d,h,e]),a(null,E,E),jsxRuntimeExports.jsx("div",{className:`notice--layer notice--layer--${l}`,children:jsxRuntimeExports.jsxs("div",{className:`notice notice--${l}`,children:[jsxRuntimeExports.jsxs("div",{className:"notice--head__title--wrapper",children:[["classic","futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title",children:o}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part2"}),["futuristic"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--head__title-part3"})]}),jsxRuntimeExports.jsxs("div",{className:"notice--info",children:[["notification-light","notification-dark","minimalist"].includes(l)&&jsxRuntimeExports.jsx("span",{className:"notice--info__title",children:o}),jsxRuntimeExports.jsxs("div",{className:"notice--info__item",children:[jsxRuntimeExports.jsx("span",{className:"notice--info__text",style:{whiteSpace:"pre-line"},children:e}),["classic"].includes(l)?jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",onClick:E,type:"button",children:r}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:E,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})]})})}NoticeComponent.defaultProps={title:"",buttonText:"X",color:"#CCC",text:"",context:{},styles:"classic",autoEnd:!1};function toTrianglesDrawMode(o,e){if(e===three.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===three.TriangleFanDrawMode||e===three.TriangleStripDrawMode){let r=o.getIndex();if(r===null){const l=[],u=o.getAttribute("position");if(u!==void 0){for(let f=0;f<u.count;f++)l.push(f);o.setIndex(l),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const t=r.count-2,n=[];if(e===three.TriangleFanDrawMode)for(let l=1;l<=t;l++)n.push(r.getX(0)),n.push(r.getX(l)),n.push(r.getX(l+1));else for(let l=0;l<t;l++)l%2===0?(n.push(r.getX(l)),n.push(r.getX(l+1)),n.push(r.getX(l+2))):(n.push(r.getX(l+2)),n.push(r.getX(l+1)),n.push(r.getX(l)));n.length/3!==t&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=o.clone();return a.setIndex(n),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class GLTFLoader extends three.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(r){return new GLTFMaterialsClearcoatExtension(r)}),this.register(function(r){return new GLTFTextureBasisUExtension(r)}),this.register(function(r){return new GLTFTextureWebPExtension(r)}),this.register(function(r){return new GLTFTextureAVIFExtension(r)}),this.register(function(r){return new GLTFMaterialsSheenExtension(r)}),this.register(function(r){return new GLTFMaterialsTransmissionExtension(r)}),this.register(function(r){return new GLTFMaterialsVolumeExtension(r)}),this.register(function(r){return new GLTFMaterialsIorExtension(r)}),this.register(function(r){return new GLTFMaterialsEmissiveStrengthExtension(r)}),this.register(function(r){return new GLTFMaterialsSpecularExtension(r)}),this.register(function(r){return new GLTFMaterialsIridescenceExtension(r)}),this.register(function(r){return new GLTFMaterialsAnisotropyExtension(r)}),this.register(function(r){return new GLTFMaterialsBumpExtension(r)}),this.register(function(r){return new GLTFLightsExtension(r)}),this.register(function(r){return new GLTFMeshoptCompression(r)}),this.register(function(r){return new GLTFMeshGpuInstancing(r)})}load(e,r,t,n){const a=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const d=three.LoaderUtils.extractUrlBase(e);l=three.LoaderUtils.resolveURL(d,this.path)}else l=three.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const u=function(d){n?n(d):console.error(d),a.manager.itemError(e),a.manager.itemEnd(e)},f=new three.FileLoader(this.manager);f.setPath(this.path),f.setResponseType("arraybuffer"),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(e,function(d){try{a.parse(d,l,function(h){r(h),a.manager.itemEnd(e)},u)}catch(h){u(h)}},t,u)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,r,t,n){let a;const l={},u={},f=new TextDecoder;if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(f.decode(new Uint8Array(e,0,4))===BINARY_EXTENSION_HEADER_MAGIC){try{l[EXTENSIONS.KHR_BINARY_GLTF]=new GLTFBinaryExtension(e)}catch(y){n&&n(y);return}a=JSON.parse(l[EXTENSIONS.KHR_BINARY_GLTF].content)}else a=JSON.parse(f.decode(e));else a=e;if(a.asset===void 0||a.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const d=new GLTFParser(a,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const y=this.pluginCallbacks[h](d);y.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),u[y.name]=y,l[y.name]=!0}if(a.extensionsUsed)for(let h=0;h<a.extensionsUsed.length;++h){const y=a.extensionsUsed[h],E=a.extensionsRequired||[];switch(y){case EXTENSIONS.KHR_MATERIALS_UNLIT:l[y]=new GLTFMaterialsUnlitExtension;break;case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:l[y]=new GLTFDracoMeshCompressionExtension(a,this.dracoLoader);break;case EXTENSIONS.KHR_TEXTURE_TRANSFORM:l[y]=new GLTFTextureTransformExtension;break;case EXTENSIONS.KHR_MESH_QUANTIZATION:l[y]=new GLTFMeshQuantizationExtension;break;default:E.indexOf(y)>=0&&u[y]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+y+'".')}}d.setExtensions(l),d.setPlugins(u),d.parse(t,n)}parseAsync(e,r){const t=this;return new Promise(function(n,a){t.parse(e,r,n,a)})}}function GLTFRegistry(){let o={};return{get:function(e){return o[e]},add:function(e,r){o[e]=r},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const EXTENSIONS={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class GLTFLightsExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,r=this.parser.json.nodes||[];for(let t=0,n=r.length;t<n;t++){const a=r[t];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const r=this.parser,t="light:"+e;let n=r.cache.get(t);if(n)return n;const a=r.json,f=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let d;const h=new three.Color(16777215);f.color!==void 0&&h.setRGB(f.color[0],f.color[1],f.color[2],three.LinearSRGBColorSpace);const y=f.range!==void 0?f.range:0;switch(f.type){case"directional":d=new three.DirectionalLight(h),d.target.position.set(0,0,-1),d.add(d.target);break;case"point":d=new three.PointLight(h),d.distance=y;break;case"spot":d=new three.SpotLight(h),d.distance=y,f.spot=f.spot||{},f.spot.innerConeAngle=f.spot.innerConeAngle!==void 0?f.spot.innerConeAngle:0,f.spot.outerConeAngle=f.spot.outerConeAngle!==void 0?f.spot.outerConeAngle:Math.PI/4,d.angle=f.spot.outerConeAngle,d.penumbra=1-f.spot.innerConeAngle/f.spot.outerConeAngle,d.target.position.set(0,0,-1),d.add(d.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+f.type)}return d.position.set(0,0,0),d.decay=2,assignExtrasToUserData(d,f),f.intensity!==void 0&&(d.intensity=f.intensity),d.name=r.createUniqueName(f.name||"light_"+e),n=Promise.resolve(d),r.cache.add(t,n),n}getDependency(e,r){if(e==="light")return this._loadLight(r)}createNodeAttachment(e){const r=this,t=this.parser,a=t.json.nodes[e],u=(a.extensions&&a.extensions[this.name]||{}).light;return u===void 0?null:this._loadLight(u).then(function(f){return t._getNodeRef(r.cache,u,f)})}}class GLTFMaterialsUnlitExtension{constructor(){this.name=EXTENSIONS.KHR_MATERIALS_UNLIT}getMaterialType(){return three.MeshBasicMaterial}extendParams(e,r,t){const n=[];e.color=new three.Color(1,1,1),e.opacity=1;const a=r.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const l=a.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],three.LinearSRGBColorSpace),e.opacity=l[3]}a.baseColorTexture!==void 0&&n.push(t.assignTexture(e,"map",a.baseColorTexture,three.SRGBColorSpace))}return Promise.all(n)}}class GLTFMaterialsEmissiveStrengthExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,r){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=n.extensions[this.name].emissiveStrength;return a!==void 0&&(r.emissiveIntensity=a),Promise.resolve()}}class GLTFMaterialsClearcoatExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];if(l.clearcoatFactor!==void 0&&(r.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&a.push(t.assignTexture(r,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(r.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&a.push(t.assignTexture(r,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(a.push(t.assignTexture(r,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const u=l.clearcoatNormalTexture.scale;r.clearcoatNormalScale=new three.Vector2(u,u)}return Promise.all(a)}}class GLTFMaterialsIridescenceExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];return l.iridescenceFactor!==void 0&&(r.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&a.push(t.assignTexture(r,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(r.iridescenceIOR=l.iridescenceIor),r.iridescenceThicknessRange===void 0&&(r.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(r.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(r.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&a.push(t.assignTexture(r,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(a)}}class GLTFMaterialsSheenExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[];r.sheenColor=new three.Color(0,0,0),r.sheenRoughness=0,r.sheen=1;const l=n.extensions[this.name];if(l.sheenColorFactor!==void 0){const u=l.sheenColorFactor;r.sheenColor.setRGB(u[0],u[1],u[2],three.LinearSRGBColorSpace)}return l.sheenRoughnessFactor!==void 0&&(r.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&a.push(t.assignTexture(r,"sheenColorMap",l.sheenColorTexture,three.SRGBColorSpace)),l.sheenRoughnessTexture!==void 0&&a.push(t.assignTexture(r,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(a)}}class GLTFMaterialsTransmissionExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];return l.transmissionFactor!==void 0&&(r.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&a.push(t.assignTexture(r,"transmissionMap",l.transmissionTexture)),Promise.all(a)}}class GLTFMaterialsVolumeExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];r.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&a.push(t.assignTexture(r,"thicknessMap",l.thicknessTexture)),r.attenuationDistance=l.attenuationDistance||1/0;const u=l.attenuationColor||[1,1,1];return r.attenuationColor=new three.Color().setRGB(u[0],u[1],u[2],three.LinearSRGBColorSpace),Promise.all(a)}}class GLTFMaterialsIorExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=n.extensions[this.name];return r.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class GLTFMaterialsSpecularExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];r.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&a.push(t.assignTexture(r,"specularIntensityMap",l.specularTexture));const u=l.specularColorFactor||[1,1,1];return r.specularColor=new three.Color().setRGB(u[0],u[1],u[2],three.LinearSRGBColorSpace),l.specularColorTexture!==void 0&&a.push(t.assignTexture(r,"specularColorMap",l.specularColorTexture,three.SRGBColorSpace)),Promise.all(a)}}class GLTFMaterialsBumpExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];return r.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&a.push(t.assignTexture(r,"bumpMap",l.bumpTexture)),Promise.all(a)}}class GLTFMaterialsAnisotropyExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:three.MeshPhysicalMaterial}extendMaterialParams(e,r){const t=this.parser,n=t.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const a=[],l=n.extensions[this.name];return l.anisotropyStrength!==void 0&&(r.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(r.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&a.push(t.assignTexture(r,"anisotropyMap",l.anisotropyTexture)),Promise.all(a)}}class GLTFTextureBasisUExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.KHR_TEXTURE_BASISU}loadTexture(e){const r=this.parser,t=r.json,n=t.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const a=n.extensions[this.name],l=r.options.ktx2Loader;if(!l){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return r.loadTextureImage(e,a.source,l)}}class GLTFTextureWebPExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const r=this.name,t=this.parser,n=t.json,a=n.textures[e];if(!a.extensions||!a.extensions[r])return null;const l=a.extensions[r],u=n.images[l.source];let f=t.textureLoader;if(u.uri){const d=t.options.manager.getHandler(u.uri);d!==null&&(f=d)}return this.detectSupport().then(function(d){if(d)return t.loadTextureImage(e,l.source,f);if(n.extensionsRequired&&n.extensionsRequired.indexOf(r)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return t.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const r=new Image;r.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",r.onload=r.onerror=function(){e(r.height===1)}})),this.isSupported}}class GLTFTextureAVIFExtension{constructor(e){this.parser=e,this.name=EXTENSIONS.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const r=this.name,t=this.parser,n=t.json,a=n.textures[e];if(!a.extensions||!a.extensions[r])return null;const l=a.extensions[r],u=n.images[l.source];let f=t.textureLoader;if(u.uri){const d=t.options.manager.getHandler(u.uri);d!==null&&(f=d)}return this.detectSupport().then(function(d){if(d)return t.loadTextureImage(e,l.source,f);if(n.extensionsRequired&&n.extensionsRequired.indexOf(r)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return t.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const r=new Image;r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",r.onload=r.onerror=function(){e(r.height===1)}})),this.isSupported}}class GLTFMeshoptCompression{constructor(e){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const r=this.parser.json,t=r.bufferViews[e];if(t.extensions&&t.extensions[this.name]){const n=t.extensions[this.name],a=this.parser.getDependency("buffer",n.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.supported){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(u){const f=n.byteOffset||0,d=n.byteLength||0,h=n.count,y=n.byteStride,E=new Uint8Array(u,f,d);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(h,y,E,n.mode,n.filter).then(function(p){return p.buffer}):l.ready.then(function(){const p=new ArrayBuffer(h*y);return l.decodeGltfBuffer(new Uint8Array(p),h,y,E,n.mode,n.filter),p})})}else return null}}class GLTFMeshGpuInstancing{constructor(e){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const r=this.parser.json,t=r.nodes[e];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const n=r.meshes[t.mesh];for(const d of n.primitives)if(d.mode!==WEBGL_CONSTANTS.TRIANGLES&&d.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&d.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&d.mode!==void 0)return null;const l=t.extensions[this.name].attributes,u=[],f={};for(const d in l)u.push(this.parser.getDependency("accessor",l[d]).then(h=>(f[d]=h,f[d])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(d=>{const h=d.pop(),y=h.isGroup?h.children:[h],E=d[0].count,p=[];for(const _ of y){const g=new three.Matrix4,x=new three.Vector3,C=new three.Quaternion,R=new three.Vector3(1,1,1),S=new three.InstancedMesh(_.geometry,_.material,E);for(let A=0;A<E;A++)f.TRANSLATION&&x.fromBufferAttribute(f.TRANSLATION,A),f.ROTATION&&C.fromBufferAttribute(f.ROTATION,A),f.SCALE&&R.fromBufferAttribute(f.SCALE,A),S.setMatrixAt(A,g.compose(x,C,R));for(const A in f)if(A==="_COLOR_0"){const T=f[A];S.instanceColor=new three.InstancedBufferAttribute(T.array,T.itemSize,T.normalized)}else A!=="TRANSLATION"&&A!=="ROTATION"&&A!=="SCALE"&&_.geometry.setAttribute(A,f[A]);three.Object3D.prototype.copy.call(S,_),this.parser.assignFinalMaterial(S),p.push(S)}return h.isGroup?(h.clear(),h.add(...p),h):p[0]}))}}const BINARY_EXTENSION_HEADER_MAGIC="glTF",BINARY_EXTENSION_HEADER_LENGTH=12,BINARY_EXTENSION_CHUNK_TYPES={JSON:1313821514,BIN:5130562};class GLTFBinaryExtension{constructor(e){this.name=EXTENSIONS.KHR_BINARY_GLTF,this.content=null,this.body=null;const r=new DataView(e,0,BINARY_EXTENSION_HEADER_LENGTH),t=new TextDecoder;if(this.header={magic:t.decode(new Uint8Array(e.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==BINARY_EXTENSION_HEADER_MAGIC)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-BINARY_EXTENSION_HEADER_LENGTH,a=new DataView(e,BINARY_EXTENSION_HEADER_LENGTH);let l=0;for(;l<n;){const u=a.getUint32(l,!0);l+=4;const f=a.getUint32(l,!0);if(l+=4,f===BINARY_EXTENSION_CHUNK_TYPES.JSON){const d=new Uint8Array(e,BINARY_EXTENSION_HEADER_LENGTH+l,u);this.content=t.decode(d)}else if(f===BINARY_EXTENSION_CHUNK_TYPES.BIN){const d=BINARY_EXTENSION_HEADER_LENGTH+l;this.body=e.slice(d,d+u)}l+=u}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class GLTFDracoMeshCompressionExtension{constructor(e,r){if(!r)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=EXTENSIONS.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=r,this.dracoLoader.preload()}decodePrimitive(e,r){const t=this.json,n=this.dracoLoader,a=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,u={},f={},d={};for(const h in l){const y=ATTRIBUTES[h]||h.toLowerCase();u[y]=l[h]}for(const h in e.attributes){const y=ATTRIBUTES[h]||h.toLowerCase();if(l[h]!==void 0){const E=t.accessors[e.attributes[h]],p=WEBGL_COMPONENT_TYPES[E.componentType];d[y]=p.name,f[y]=E.normalized===!0}}return r.getDependency("bufferView",a).then(function(h){return new Promise(function(y){n.decodeDracoFile(h,function(E){for(const p in E.attributes){const _=E.attributes[p],g=f[p];g!==void 0&&(_.normalized=g)}y(E)},u,d)})})}}class GLTFTextureTransformExtension{constructor(){this.name=EXTENSIONS.KHR_TEXTURE_TRANSFORM}extendTexture(e,r){return(r.texCoord===void 0||r.texCoord===e.channel)&&r.offset===void 0&&r.rotation===void 0&&r.scale===void 0||(e=e.clone(),r.texCoord!==void 0&&(e.channel=r.texCoord),r.offset!==void 0&&e.offset.fromArray(r.offset),r.rotation!==void 0&&(e.rotation=r.rotation),r.scale!==void 0&&e.repeat.fromArray(r.scale),e.needsUpdate=!0),e}}class GLTFMeshQuantizationExtension{constructor(){this.name=EXTENSIONS.KHR_MESH_QUANTIZATION}}class GLTFCubicSplineInterpolant extends three.Interpolant{constructor(e,r,t,n){super(e,r,t,n)}copySampleValue_(e){const r=this.resultBuffer,t=this.sampleValues,n=this.valueSize,a=e*n*3+n;for(let l=0;l!==n;l++)r[l]=t[a+l];return r}interpolate_(e,r,t,n){const a=this.resultBuffer,l=this.sampleValues,u=this.valueSize,f=u*2,d=u*3,h=n-r,y=(t-r)/h,E=y*y,p=E*y,_=e*d,g=_-d,x=-2*p+3*E,C=p-E,R=1-x,S=C-E+y;for(let A=0;A!==u;A++){const T=l[g+A+u],w=l[g+A+f]*h,P=l[_+A+u],O=l[_+A]*h;a[A]=R*T+S*w+x*P+C*O}return a}}const _q=new three.Quaternion;class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant{interpolate_(e,r,t,n){const a=super.interpolate_(e,r,t,n);return _q.fromArray(a).normalize().toArray(a),a}}const WEBGL_CONSTANTS={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},WEBGL_COMPONENT_TYPES={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},WEBGL_FILTERS={9728:three.NearestFilter,9729:three.LinearFilter,9984:three.NearestMipmapNearestFilter,9985:three.LinearMipmapNearestFilter,9986:three.NearestMipmapLinearFilter,9987:three.LinearMipmapLinearFilter},WEBGL_WRAPPINGS={33071:three.ClampToEdgeWrapping,33648:three.MirroredRepeatWrapping,10497:three.RepeatWrapping},WEBGL_TYPE_SIZES={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ATTRIBUTES={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},PATH_PROPERTIES={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},INTERPOLATION={CUBICSPLINE:void 0,LINEAR:three.InterpolateLinear,STEP:three.InterpolateDiscrete},ALPHA_MODES={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function createDefaultMaterial(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new three.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:three.FrontSide})),o.DefaultMaterial}function addUnknownExtensionsToUserData(o,e,r){for(const t in r.extensions)o[t]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[t]=r.extensions[t])}function assignExtrasToUserData(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function addMorphTargets(o,e,r){let t=!1,n=!1,a=!1;for(let d=0,h=e.length;d<h;d++){const y=e[d];if(y.POSITION!==void 0&&(t=!0),y.NORMAL!==void 0&&(n=!0),y.COLOR_0!==void 0&&(a=!0),t&&n&&a)break}if(!t&&!n&&!a)return Promise.resolve(o);const l=[],u=[],f=[];for(let d=0,h=e.length;d<h;d++){const y=e[d];if(t){const E=y.POSITION!==void 0?r.getDependency("accessor",y.POSITION):o.attributes.position;l.push(E)}if(n){const E=y.NORMAL!==void 0?r.getDependency("accessor",y.NORMAL):o.attributes.normal;u.push(E)}if(a){const E=y.COLOR_0!==void 0?r.getDependency("accessor",y.COLOR_0):o.attributes.color;f.push(E)}}return Promise.all([Promise.all(l),Promise.all(u),Promise.all(f)]).then(function(d){const h=d[0],y=d[1],E=d[2];return t&&(o.morphAttributes.position=h),n&&(o.morphAttributes.normal=y),a&&(o.morphAttributes.color=E),o.morphTargetsRelative=!0,o})}function updateMorphTargets(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let r=0,t=e.weights.length;r<t;r++)o.morphTargetInfluences[r]=e.weights[r];if(e.extras&&Array.isArray(e.extras.targetNames)){const r=e.extras.targetNames;if(o.morphTargetInfluences.length===r.length){o.morphTargetDictionary={};for(let t=0,n=r.length;t<n;t++)o.morphTargetDictionary[r[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function createPrimitiveKey(o){let e;const r=o.extensions&&o.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION];if(r?e="draco:"+r.bufferView+":"+r.indices+":"+createAttributesKey(r.attributes):e=o.indices+":"+createAttributesKey(o.attributes)+":"+o.mode,o.targets!==void 0)for(let t=0,n=o.targets.length;t<n;t++)e+=":"+createAttributesKey(o.targets[t]);return e}function createAttributesKey(o){let e="";const r=Object.keys(o).sort();for(let t=0,n=r.length;t<n;t++)e+=r[t]+":"+o[r[t]]+";";return e}function getNormalizedComponentScale(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function getImageURIMimeType(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const _identityMatrix=new three.Matrix4;class GLTFParser{constructor(e={},r={}){this.json=e,this.extensions={},this.plugins={},this.options=r,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let t=!1,n=!1,a=-1;typeof navigator<"u"&&(t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,n=navigator.userAgent.indexOf("Firefox")>-1,a=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||t||n&&a<98?this.textureLoader=new three.TextureLoader(this.options.manager):this.textureLoader=new three.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new three.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,r){const t=this,n=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([t.getDependencies("scene"),t.getDependencies("animation"),t.getDependencies("camera")])}).then(function(l){const u={scene:l[0][n.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:n.asset,parser:t,userData:{}};return addUnknownExtensionsToUserData(a,u,n),assignExtrasToUserData(u,n),Promise.all(t._invokeAll(function(f){return f.afterRoot&&f.afterRoot(u)})).then(function(){e(u)})}).catch(r)}_markDefs(){const e=this.json.nodes||[],r=this.json.skins||[],t=this.json.meshes||[];for(let n=0,a=r.length;n<a;n++){const l=r[n].joints;for(let u=0,f=l.length;u<f;u++)e[l[u]].isBone=!0}for(let n=0,a=e.length;n<a;n++){const l=e[n];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(t[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,r){r!==void 0&&(e.refs[r]===void 0&&(e.refs[r]=e.uses[r]=0),e.refs[r]++)}_getNodeRef(e,r,t){if(e.refs[r]<=1)return t;const n=t.clone(),a=(l,u)=>{const f=this.associations.get(l);f!=null&&this.associations.set(u,f);for(const[d,h]of l.children.entries())a(h,u.children[d])};return a(t,n),n.name+="_instance_"+e.uses[r]++,n}_invokeOne(e){const r=Object.values(this.plugins);r.push(this);for(let t=0;t<r.length;t++){const n=e(r[t]);if(n)return n}return null}_invokeAll(e){const r=Object.values(this.plugins);r.unshift(this);const t=[];for(let n=0;n<r.length;n++){const a=e(r[n]);a&&t.push(a)}return t}getDependency(e,r){const t=e+":"+r;let n=this.cache.get(t);if(!n){switch(e){case"scene":n=this.loadScene(r);break;case"node":n=this._invokeOne(function(a){return a.loadNode&&a.loadNode(r)});break;case"mesh":n=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(r)});break;case"accessor":n=this.loadAccessor(r);break;case"bufferView":n=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(r)});break;case"buffer":n=this.loadBuffer(r);break;case"material":n=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(r)});break;case"texture":n=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(r)});break;case"skin":n=this.loadSkin(r);break;case"animation":n=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(r)});break;case"camera":n=this.loadCamera(r);break;default:if(n=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,r)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(t,n)}return n}getDependencies(e){let r=this.cache.get(e);if(!r){const t=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];r=Promise.all(n.map(function(a,l){return t.getDependency(e,l)})),this.cache.add(e,r)}return r}loadBuffer(e){const r=this.json.buffers[e],t=this.fileLoader;if(r.type&&r.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+r.type+" buffer type is not supported.");if(r.uri===void 0&&e===0)return Promise.resolve(this.extensions[EXTENSIONS.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(a,l){t.load(three.LoaderUtils.resolveURL(r.uri,n.path),a,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+r.uri+'".'))})})}loadBufferView(e){const r=this.json.bufferViews[e];return this.getDependency("buffer",r.buffer).then(function(t){const n=r.byteLength||0,a=r.byteOffset||0;return t.slice(a,a+n)})}loadAccessor(e){const r=this,t=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const l=WEBGL_TYPE_SIZES[n.type],u=WEBGL_COMPONENT_TYPES[n.componentType],f=n.normalized===!0,d=new u(n.count*l);return Promise.resolve(new three.BufferAttribute(d,l,f))}const a=[];return n.bufferView!==void 0?a.push(this.getDependency("bufferView",n.bufferView)):a.push(null),n.sparse!==void 0&&(a.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(a).then(function(l){const u=l[0],f=WEBGL_TYPE_SIZES[n.type],d=WEBGL_COMPONENT_TYPES[n.componentType],h=d.BYTES_PER_ELEMENT,y=h*f,E=n.byteOffset||0,p=n.bufferView!==void 0?t.bufferViews[n.bufferView].byteStride:void 0,_=n.normalized===!0;let g,x;if(p&&p!==y){const C=Math.floor(E/p),R="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+C+":"+n.count;let S=r.cache.get(R);S||(g=new d(u,C*p,n.count*p/h),S=new three.InterleavedBuffer(g,p/h),r.cache.add(R,S)),x=new three.InterleavedBufferAttribute(S,f,E%p/h,_)}else u===null?g=new d(n.count*f):g=new d(u,E,n.count*f),x=new three.BufferAttribute(g,f,_);if(n.sparse!==void 0){const C=WEBGL_TYPE_SIZES.SCALAR,R=WEBGL_COMPONENT_TYPES[n.sparse.indices.componentType],S=n.sparse.indices.byteOffset||0,A=n.sparse.values.byteOffset||0,T=new R(l[1],S,n.sparse.count*C),w=new d(l[2],A,n.sparse.count*f);u!==null&&(x=new three.BufferAttribute(x.array.slice(),x.itemSize,x.normalized));for(let P=0,O=T.length;P<O;P++){const k=T[P];if(x.setX(k,w[P*f]),f>=2&&x.setY(k,w[P*f+1]),f>=3&&x.setZ(k,w[P*f+2]),f>=4&&x.setW(k,w[P*f+3]),f>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return x})}loadTexture(e){const r=this.json,t=this.options,a=r.textures[e].source,l=r.images[a];let u=this.textureLoader;if(l.uri){const f=t.manager.getHandler(l.uri);f!==null&&(u=f)}return this.loadTextureImage(e,a,u)}loadTextureImage(e,r,t){const n=this,a=this.json,l=a.textures[e],u=a.images[r],f=(u.uri||u.bufferView)+":"+l.sampler;if(this.textureCache[f])return this.textureCache[f];const d=this.loadImageSource(r,t).then(function(h){h.flipY=!1,h.name=l.name||u.name||"",h.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(h.name=u.uri);const E=(a.samplers||{})[l.sampler]||{};return h.magFilter=WEBGL_FILTERS[E.magFilter]||three.LinearFilter,h.minFilter=WEBGL_FILTERS[E.minFilter]||three.LinearMipmapLinearFilter,h.wrapS=WEBGL_WRAPPINGS[E.wrapS]||three.RepeatWrapping,h.wrapT=WEBGL_WRAPPINGS[E.wrapT]||three.RepeatWrapping,n.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[f]=d,d}loadImageSource(e,r){const t=this,n=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(y=>y.clone());const l=n.images[e],u=self.URL||self.webkitURL;let f=l.uri||"",d=!1;if(l.bufferView!==void 0)f=t.getDependency("bufferView",l.bufferView).then(function(y){d=!0;const E=new Blob([y],{type:l.mimeType});return f=u.createObjectURL(E),f});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(f).then(function(y){return new Promise(function(E,p){let _=E;r.isImageBitmapLoader===!0&&(_=function(g){const x=new three.Texture(g);x.needsUpdate=!0,E(x)}),r.load(three.LoaderUtils.resolveURL(y,a.path),_,void 0,p)})}).then(function(y){return d===!0&&u.revokeObjectURL(f),y.userData.mimeType=l.mimeType||getImageURIMimeType(l.uri),y}).catch(function(y){throw console.error("THREE.GLTFLoader: Couldn't load texture",f),y});return this.sourceCache[e]=h,h}assignTexture(e,r,t,n){const a=this;return this.getDependency("texture",t.index).then(function(l){if(!l)return null;if(t.texCoord!==void 0&&t.texCoord>0&&(l=l.clone(),l.channel=t.texCoord),a.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){const u=t.extensions!==void 0?t.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const f=a.associations.get(l);l=a.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(l,u),a.associations.set(l,f)}}return n!==void 0&&(l.colorSpace=n),e[r]=l,l})}assignFinalMaterial(e){const r=e.geometry;let t=e.material;const n=r.attributes.tangent===void 0,a=r.attributes.color!==void 0,l=r.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+t.uuid;let f=this.cache.get(u);f||(f=new three.PointsMaterial,three.Material.prototype.copy.call(f,t),f.color.copy(t.color),f.map=t.map,f.sizeAttenuation=!1,this.cache.add(u,f)),t=f}else if(e.isLine){const u="LineBasicMaterial:"+t.uuid;let f=this.cache.get(u);f||(f=new three.LineBasicMaterial,three.Material.prototype.copy.call(f,t),f.color.copy(t.color),f.map=t.map,this.cache.add(u,f)),t=f}if(n||a||l){let u="ClonedMaterial:"+t.uuid+":";n&&(u+="derivative-tangents:"),a&&(u+="vertex-colors:"),l&&(u+="flat-shading:");let f=this.cache.get(u);f||(f=t.clone(),a&&(f.vertexColors=!0),l&&(f.flatShading=!0),n&&(f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(u,f),this.associations.set(f,this.associations.get(t))),t=f}e.material=t}getMaterialType(){return three.MeshStandardMaterial}loadMaterial(e){const r=this,t=this.json,n=this.extensions,a=t.materials[e];let l;const u={},f=a.extensions||{},d=[];if(f[EXTENSIONS.KHR_MATERIALS_UNLIT]){const y=n[EXTENSIONS.KHR_MATERIALS_UNLIT];l=y.getMaterialType(),d.push(y.extendParams(u,a,r))}else{const y=a.pbrMetallicRoughness||{};if(u.color=new three.Color(1,1,1),u.opacity=1,Array.isArray(y.baseColorFactor)){const E=y.baseColorFactor;u.color.setRGB(E[0],E[1],E[2],three.LinearSRGBColorSpace),u.opacity=E[3]}y.baseColorTexture!==void 0&&d.push(r.assignTexture(u,"map",y.baseColorTexture,three.SRGBColorSpace)),u.metalness=y.metallicFactor!==void 0?y.metallicFactor:1,u.roughness=y.roughnessFactor!==void 0?y.roughnessFactor:1,y.metallicRoughnessTexture!==void 0&&(d.push(r.assignTexture(u,"metalnessMap",y.metallicRoughnessTexture)),d.push(r.assignTexture(u,"roughnessMap",y.metallicRoughnessTexture))),l=this._invokeOne(function(E){return E.getMaterialType&&E.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(E){return E.extendMaterialParams&&E.extendMaterialParams(e,u)})))}a.doubleSided===!0&&(u.side=three.DoubleSide);const h=a.alphaMode||ALPHA_MODES.OPAQUE;if(h===ALPHA_MODES.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,h===ALPHA_MODES.MASK&&(u.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&l!==three.MeshBasicMaterial&&(d.push(r.assignTexture(u,"normalMap",a.normalTexture)),u.normalScale=new three.Vector2(1,1),a.normalTexture.scale!==void 0)){const y=a.normalTexture.scale;u.normalScale.set(y,y)}if(a.occlusionTexture!==void 0&&l!==three.MeshBasicMaterial&&(d.push(r.assignTexture(u,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&l!==three.MeshBasicMaterial){const y=a.emissiveFactor;u.emissive=new three.Color().setRGB(y[0],y[1],y[2],three.LinearSRGBColorSpace)}return a.emissiveTexture!==void 0&&l!==three.MeshBasicMaterial&&d.push(r.assignTexture(u,"emissiveMap",a.emissiveTexture,three.SRGBColorSpace)),Promise.all(d).then(function(){const y=new l(u);return a.name&&(y.name=a.name),assignExtrasToUserData(y,a),r.associations.set(y,{materials:e}),a.extensions&&addUnknownExtensionsToUserData(n,y,a),y})}createUniqueName(e){const r=three.PropertyBinding.sanitizeNodeName(e||"");return r in this.nodeNamesUsed?r+"_"+ ++this.nodeNamesUsed[r]:(this.nodeNamesUsed[r]=0,r)}loadGeometries(e){const r=this,t=this.extensions,n=this.primitiveCache;function a(u){return t[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,r).then(function(f){return addPrimitiveAttributes(f,u,r)})}const l=[];for(let u=0,f=e.length;u<f;u++){const d=e[u],h=createPrimitiveKey(d),y=n[h];if(y)l.push(y.promise);else{let E;d.extensions&&d.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION]?E=a(d):E=addPrimitiveAttributes(new three.BufferGeometry,d,r),n[h]={primitive:d,promise:E},l.push(E)}}return Promise.all(l)}loadMesh(e){const r=this,t=this.json,n=this.extensions,a=t.meshes[e],l=a.primitives,u=[];for(let f=0,d=l.length;f<d;f++){const h=l[f].material===void 0?createDefaultMaterial(this.cache):this.getDependency("material",l[f].material);u.push(h)}return u.push(r.loadGeometries(l)),Promise.all(u).then(function(f){const d=f.slice(0,f.length-1),h=f[f.length-1],y=[];for(let p=0,_=h.length;p<_;p++){const g=h[p],x=l[p];let C;const R=d[p];if(x.mode===WEBGL_CONSTANTS.TRIANGLES||x.mode===WEBGL_CONSTANTS.TRIANGLE_STRIP||x.mode===WEBGL_CONSTANTS.TRIANGLE_FAN||x.mode===void 0)C=a.isSkinnedMesh===!0?new three.SkinnedMesh(g,R):new three.Mesh(g,R),C.isSkinnedMesh===!0&&C.normalizeSkinWeights(),x.mode===WEBGL_CONSTANTS.TRIANGLE_STRIP?C.geometry=toTrianglesDrawMode(C.geometry,three.TriangleStripDrawMode):x.mode===WEBGL_CONSTANTS.TRIANGLE_FAN&&(C.geometry=toTrianglesDrawMode(C.geometry,three.TriangleFanDrawMode));else if(x.mode===WEBGL_CONSTANTS.LINES)C=new three.LineSegments(g,R);else if(x.mode===WEBGL_CONSTANTS.LINE_STRIP)C=new three.Line(g,R);else if(x.mode===WEBGL_CONSTANTS.LINE_LOOP)C=new three.LineLoop(g,R);else if(x.mode===WEBGL_CONSTANTS.POINTS)C=new three.Points(g,R);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+x.mode);Object.keys(C.geometry.morphAttributes).length>0&&updateMorphTargets(C,a),C.name=r.createUniqueName(a.name||"mesh_"+e),assignExtrasToUserData(C,a),x.extensions&&addUnknownExtensionsToUserData(n,C,x),r.assignFinalMaterial(C),y.push(C)}for(let p=0,_=y.length;p<_;p++)r.associations.set(y[p],{meshes:e,primitives:p});if(y.length===1)return a.extensions&&addUnknownExtensionsToUserData(n,y[0],a),y[0];const E=new three.Group;a.extensions&&addUnknownExtensionsToUserData(n,E,a),r.associations.set(E,{meshes:e});for(let p=0,_=y.length;p<_;p++)E.add(y[p]);return E})}loadCamera(e){let r;const t=this.json.cameras[e],n=t[t.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return t.type==="perspective"?r=new three.PerspectiveCamera(three.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):t.type==="orthographic"&&(r=new three.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),t.name&&(r.name=this.createUniqueName(t.name)),assignExtrasToUserData(r,t),Promise.resolve(r)}loadSkin(e){const r=this.json.skins[e],t=[];for(let n=0,a=r.joints.length;n<a;n++)t.push(this._loadNodeShallow(r.joints[n]));return r.inverseBindMatrices!==void 0?t.push(this.getDependency("accessor",r.inverseBindMatrices)):t.push(null),Promise.all(t).then(function(n){const a=n.pop(),l=n,u=[],f=[];for(let d=0,h=l.length;d<h;d++){const y=l[d];if(y){u.push(y);const E=new three.Matrix4;a!==null&&E.fromArray(a.array,d*16),f.push(E)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',r.joints[d])}return new three.Skeleton(u,f)})}loadAnimation(e){const r=this.json,t=this,n=r.animations[e],a=n.name?n.name:"animation_"+e,l=[],u=[],f=[],d=[],h=[];for(let y=0,E=n.channels.length;y<E;y++){const p=n.channels[y],_=n.samplers[p.sampler],g=p.target,x=g.node,C=n.parameters!==void 0?n.parameters[_.input]:_.input,R=n.parameters!==void 0?n.parameters[_.output]:_.output;g.node!==void 0&&(l.push(this.getDependency("node",x)),u.push(this.getDependency("accessor",C)),f.push(this.getDependency("accessor",R)),d.push(_),h.push(g))}return Promise.all([Promise.all(l),Promise.all(u),Promise.all(f),Promise.all(d),Promise.all(h)]).then(function(y){const E=y[0],p=y[1],_=y[2],g=y[3],x=y[4],C=[];for(let R=0,S=E.length;R<S;R++){const A=E[R],T=p[R],w=_[R],P=g[R],O=x[R];if(A===void 0)continue;A.updateMatrix&&A.updateMatrix();const k=t._createAnimationTracks(A,T,w,P,O);if(k)for(let D=0;D<k.length;D++)C.push(k[D])}return new three.AnimationClip(a,void 0,C)})}createNodeMesh(e){const r=this.json,t=this,n=r.nodes[e];return n.mesh===void 0?null:t.getDependency("mesh",n.mesh).then(function(a){const l=t._getNodeRef(t.meshCache,n.mesh,a);return n.weights!==void 0&&l.traverse(function(u){if(u.isMesh)for(let f=0,d=n.weights.length;f<d;f++)u.morphTargetInfluences[f]=n.weights[f]}),l})}loadNode(e){const r=this.json,t=this,n=r.nodes[e],a=t._loadNodeShallow(e),l=[],u=n.children||[];for(let d=0,h=u.length;d<h;d++)l.push(t.getDependency("node",u[d]));const f=n.skin===void 0?Promise.resolve(null):t.getDependency("skin",n.skin);return Promise.all([a,Promise.all(l),f]).then(function(d){const h=d[0],y=d[1],E=d[2];E!==null&&h.traverse(function(p){p.isSkinnedMesh&&p.bind(E,_identityMatrix)});for(let p=0,_=y.length;p<_;p++)h.add(y[p]);return h})}_loadNodeShallow(e){const r=this.json,t=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=r.nodes[e],l=a.name?n.createUniqueName(a.name):"",u=[],f=n._invokeOne(function(d){return d.createNodeMesh&&d.createNodeMesh(e)});return f&&u.push(f),a.camera!==void 0&&u.push(n.getDependency("camera",a.camera).then(function(d){return n._getNodeRef(n.cameraCache,a.camera,d)})),n._invokeAll(function(d){return d.createNodeAttachment&&d.createNodeAttachment(e)}).forEach(function(d){u.push(d)}),this.nodeCache[e]=Promise.all(u).then(function(d){let h;if(a.isBone===!0?h=new three.Bone:d.length>1?h=new three.Group:d.length===1?h=d[0]:h=new three.Object3D,h!==d[0])for(let y=0,E=d.length;y<E;y++)h.add(d[y]);if(a.name&&(h.userData.name=a.name,h.name=l),assignExtrasToUserData(h,a),a.extensions&&addUnknownExtensionsToUserData(t,h,a),a.matrix!==void 0){const y=new three.Matrix4;y.fromArray(a.matrix),h.applyMatrix4(y)}else a.translation!==void 0&&h.position.fromArray(a.translation),a.rotation!==void 0&&h.quaternion.fromArray(a.rotation),a.scale!==void 0&&h.scale.fromArray(a.scale);return n.associations.has(h)||n.associations.set(h,{}),n.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const r=this.extensions,t=this.json.scenes[e],n=this,a=new three.Group;t.name&&(a.name=n.createUniqueName(t.name)),assignExtrasToUserData(a,t),t.extensions&&addUnknownExtensionsToUserData(r,a,t);const l=t.nodes||[],u=[];for(let f=0,d=l.length;f<d;f++)u.push(n.getDependency("node",l[f]));return Promise.all(u).then(function(f){for(let h=0,y=f.length;h<y;h++)a.add(f[h]);const d=h=>{const y=new Map;for(const[E,p]of n.associations)(E instanceof three.Material||E instanceof three.Texture)&&y.set(E,p);return h.traverse(E=>{const p=n.associations.get(E);p!=null&&y.set(E,p)}),y};return n.associations=d(a),a})}_createAnimationTracks(e,r,t,n,a){const l=[],u=e.name?e.name:e.uuid,f=[];PATH_PROPERTIES[a.path]===PATH_PROPERTIES.weights?e.traverse(function(E){E.morphTargetInfluences&&f.push(E.name?E.name:E.uuid)}):f.push(u);let d;switch(PATH_PROPERTIES[a.path]){case PATH_PROPERTIES.weights:d=three.NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:d=three.QuaternionKeyframeTrack;break;case PATH_PROPERTIES.position:case PATH_PROPERTIES.scale:d=three.VectorKeyframeTrack;break;default:switch(t.itemSize){case 1:d=three.NumberKeyframeTrack;break;case 2:case 3:default:d=three.VectorKeyframeTrack;break}break}const h=n.interpolation!==void 0?INTERPOLATION[n.interpolation]:three.InterpolateLinear,y=this._getArrayFromAccessor(t);for(let E=0,p=f.length;E<p;E++){const _=new d(f[E]+"."+PATH_PROPERTIES[a.path],r.array,y,h);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(_),l.push(_)}return l}_getArrayFromAccessor(e){let r=e.array;if(e.normalized){const t=getNormalizedComponentScale(r.constructor),n=new Float32Array(r.length);for(let a=0,l=r.length;a<l;a++)n[a]=r[a]*t;r=n}return r}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof three.QuaternionKeyframeTrack?GLTFCubicSplineQuaternionInterpolant:GLTFCubicSplineInterpolant;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function computeBounds(o,e,r){const t=e.attributes,n=new three.Box3;if(t.POSITION!==void 0){const u=r.json.accessors[t.POSITION],f=u.min,d=u.max;if(f!==void 0&&d!==void 0){if(n.set(new three.Vector3(f[0],f[1],f[2]),new three.Vector3(d[0],d[1],d[2])),u.normalized){const h=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[u.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const u=new three.Vector3,f=new three.Vector3;for(let d=0,h=a.length;d<h;d++){const y=a[d];if(y.POSITION!==void 0){const E=r.json.accessors[y.POSITION],p=E.min,_=E.max;if(p!==void 0&&_!==void 0){if(f.setX(Math.max(Math.abs(p[0]),Math.abs(_[0]))),f.setY(Math.max(Math.abs(p[1]),Math.abs(_[1]))),f.setZ(Math.max(Math.abs(p[2]),Math.abs(_[2]))),E.normalized){const g=getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[E.componentType]);f.multiplyScalar(g)}u.max(f)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(u)}o.boundingBox=n;const l=new three.Sphere;n.getCenter(l.center),l.radius=n.min.distanceTo(n.max)/2,o.boundingSphere=l}function addPrimitiveAttributes(o,e,r){const t=e.attributes,n=[];function a(l,u){return r.getDependency("accessor",l).then(function(f){o.setAttribute(u,f)})}for(const l in t){const u=ATTRIBUTES[l]||l.toLowerCase();u in o.attributes||n.push(a(t[l],u))}if(e.indices!==void 0&&!o.index){const l=r.getDependency("accessor",e.indices).then(function(u){o.setIndex(u)});n.push(l)}return three.ColorManagement.workingColorSpace!==three.LinearSRGBColorSpace&&"COLOR_0"in t&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${three.ColorManagement.workingColorSpace}" not supported.`),assignExtrasToUserData(o,e),computeBounds(o,e,r),Promise.all(n).then(function(){return e.targets!==void 0?addMorphTargets(o,e.targets,r):o})}new three.Vector3(1,0,0);new three.Vector3(0,1,0);new three.Vector3(0,0,1);const bones=["Jaw_M","Head_M","L_lip_jnt","HeadEnd_M","Neck_M","R_lip_jnt","joint4","transform1","lowerTeeths","upperTeeths"],cameraFitAnyObject=(o,e,r=null,t=null,n=!1)=>{const a=e.clone(),l=r||1.25,u=new three.Box3;u.setFromObject(o);const f=u.getCenter(new three.Vector3),d=new three.Vector3(0,f.y,0),h=u.getSize(new three.Vector3),y=Math.max(h.x,h.y,h.z),E=a.fov*(Math.PI/180);let p=Math.abs(y*Math.sqrt(2)/2*Math.tan(E*2));p*=l;const _=new three.Vector3;_.setFromMatrixPosition(o.matrixWorld);const x=new three.Vector3(1,1,1).normalize();a.position.copy(x.multiplyScalar(p)),a.lookAt(_);const C=u.min.z,R=C<0?-C+p:p-C;return a.far=R*3,a.near=.01,a.updateProjectionMatrix(),a.lookAt(d),t&&(t.target=d,t.maxDistance=R*2,t.saveState()),n?a:(e.copy(a),null)},mixWithTalkingClip=(o,e)=>{const r=o.clone(),t=e.clone(),n=r.tracks.filter(a=>bones.find(l=>a.name.includes(l)));return t.tracks=t.tracks.filter(a=>!bones.find(l=>a.name.includes(l))),t.tracks.push(...n),t.resetDuration(),t.name+="_talking",t.duration>4?three.AnimationUtils.subclip(t,t.name,0,120,30):t};function LightSet(){return jsxRuntimeExports.jsxs("group",{children:[jsxRuntimeExports.jsx("pointLight",{position:[-2.29,17.35,2.56],color:16773785,intensity:12,power:150,distance:0,decay:1,castShadow:!0,"shadow-bias":-.002}),jsxRuntimeExports.jsx("pointLight",{position:[2.25,16.57,-1.9],color:4234239,intensity:20,power:250,distance:0,decay:1,"shadow-bias":-.002}),jsxRuntimeExports.jsx("hemisphereLight",{color:7918828,groundColor:7429837,intensity:4,position:[0,500,0]})]})}function Item$1(o){const e=fiber.useThree(n=>n.controls),r=fiber.useThree(n=>n.camera),t=n=>{n&&e&&(n.updateMatrixWorld(!0),n.position.set(0,0,0),r.position.z+=10,r.fov=35,r.updateProjectionMatrix(),cameraFitAnyObject(n,r,null,e))};return jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{...o,onLoad:t})}function InventoryItem({name:o,description:e,element:r,onFinish:t,soundActions:n,keyboardControl:a,emitEvent:l}){const[u]=n,f=h=>l({type:"translate",payload:h});if(!r)return t(),null;const d=()=>{u("click-ui"),t()};return a&&a(null,d,d),jsxRuntimeExports.jsx("div",{className:"inventory--layer__info",dir:"auto",children:jsxRuntimeExports.jsxs("div",{className:`inventory-popup fadeIn--animation ${e?"inventory-popup--withdescription":""}`,children:[jsxRuntimeExports.jsx("button",{type:"button","aria-label":f("inventory.closeDetail"),className:"inventory-popup__close",onClick:()=>{d()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})}),jsxRuntimeExports.jsx("h2",{className:"inventory-popup__title",children:o}),e&&jsxRuntimeExports.jsx("div",{tabIndex:"0",className:"inventory-popup__description",children:e}),jsxRuntimeExports.jsx("div",{className:"inventory-popup__image",children:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{fullscreen:!1,gl:{alpha:!0},onCreated:({gl:h})=>{h.setClearColor(16777215)},style:{height:"100%"},children:[jsxRuntimeExports.jsx(drei.OrbitControls,{makeDefault:!0,enableKeys:!1,enableZoom:!1,enablePan:!1}),jsxRuntimeExports.jsxs(React$2.Suspense,{fallback:null,children:[jsxRuntimeExports.jsx(LightSet,{}),jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:"divideby16",children:jsxRuntimeExports.jsx(Item$1,{url:r.url,position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],material:r.material||{},name:r.name},`${r.uid}`)})]})]})})]})})}function commonjsRequire(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$4=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(e,r){module.exports=r()})(commonjsGlobal,function(){return function(o){var e={};function r(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return o[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=o,r.c=e,r.d=function(t,n,a){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:a})},r.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(n&1&&(t=r(t)),n&8||n&4&&typeof t=="object"&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),n&2&&typeof t!="string")for(var l in t)r.d(a,l,(function(u){return t[u]}).bind(null,l));return a},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=0)}([function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return t.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return t.getFilenameFromUrl}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return t.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return t.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return t.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return t.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return a.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return a.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return a.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return a.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return a.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return a.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return a.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return a.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return a.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return a.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return a.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return a.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return a.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return a.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return a.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return l.AnnotationLayer}}),Object.defineProperty(e,"apiCompatibilityParams",{enumerable:!0,get:function(){return u.apiCompatibilityParams}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return f.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return d.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}});var t=r(1),n=r(5),a=r(2),l=r(16),u=r(7),f=r(10),d=r(17),h=r(18);{const{isNodeJS:y}=r(4);if(y){const E=r(19).PDFNodeStream;(0,n.setPDFNetworkStreamFactory)(p=>new E(p))}else{const E=r(22).PDFNetworkStream;let p;(0,t.isFetchSupported)()&&(p=r(23).PDFFetchStream),(0,n.setPDFNetworkStreamFactory)(_=>p&&(0,t.isValidFetchUrl)(_.url)?new p(_):new E(_))}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.addLinkAttributes=E,e.getFilenameFromUrl=p,e.isFetchSupported=g,e.isValidFetchUrl=x,e.loadScript=C,e.deprecated=R,e.PDFDateString=e.StatTimer=e.DOMSVGFactory=e.DOMCMapReaderFactory=e.DOMCanvasFactory=e.DEFAULT_LINK_REL=e.LinkTarget=e.RenderingCancelledException=e.PageViewport=void 0;var t=r(2);const n="noopener noreferrer nofollow";e.DEFAULT_LINK_REL=n;const a="http://www.w3.org/2000/svg";class l{create(w,P){if(w<=0||P<=0)throw new Error("Invalid canvas size");const O=document.createElement("canvas"),k=O.getContext("2d");return O.width=w,O.height=P,{canvas:O,context:k}}reset(w,P,O){if(!w.canvas)throw new Error("Canvas is not specified");if(P<=0||O<=0)throw new Error("Invalid canvas size");w.canvas.width=P,w.canvas.height=O}destroy(w){if(!w.canvas)throw new Error("Canvas is not specified");w.canvas.width=0,w.canvas.height=0,w.canvas=null,w.context=null}}e.DOMCanvasFactory=l;class u{constructor({baseUrl:w=null,isCompressed:P=!1}){this.baseUrl=w,this.isCompressed=P}async fetch({name:w}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!w)throw new Error("CMap name must be specified.");const P=this.baseUrl+w+(this.isCompressed?".bcmap":""),O=this.isCompressed?t.CMapCompressionType.BINARY:t.CMapCompressionType.NONE;return g()&&x(P,document.baseURI)?fetch(P).then(async k=>{if(!k.ok)throw new Error(k.statusText);let D;return this.isCompressed?D=new Uint8Array(await k.arrayBuffer()):D=(0,t.stringToBytes)(await k.text()),{cMapData:D,compressionType:O}}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${P}`)}):new Promise((k,D)=>{const F=new XMLHttpRequest;F.open("GET",P,!0),this.isCompressed&&(F.responseType="arraybuffer"),F.onreadystatechange=()=>{if(F.readyState===XMLHttpRequest.DONE){if(F.status===200||F.status===0){let G;if(this.isCompressed&&F.response?G=new Uint8Array(F.response):!this.isCompressed&&F.responseText&&(G=(0,t.stringToBytes)(F.responseText)),G){k({cMapData:G,compressionType:O});return}}D(new Error(F.statusText))}},F.send(null)}).catch(k=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${P}`)})}}e.DOMCMapReaderFactory=u;class f{create(w,P){(0,t.assert)(w>0&&P>0,"Invalid SVG dimensions");const O=document.createElementNS(a,"svg:svg");return O.setAttribute("version","1.1"),O.setAttribute("width",w+"px"),O.setAttribute("height",P+"px"),O.setAttribute("preserveAspectRatio","none"),O.setAttribute("viewBox","0 0 "+w+" "+P),O}createElement(w){return(0,t.assert)(typeof w=="string","Invalid SVG element type"),document.createElementNS(a,w)}}e.DOMSVGFactory=f;class d{constructor({viewBox:w,scale:P,rotation:O,offsetX:k=0,offsetY:D=0,dontFlip:F=!1}){this.viewBox=w,this.scale=P,this.rotation=O,this.offsetX=k,this.offsetY=D;const G=(w[2]+w[0])/2,V=(w[3]+w[1])/2;let W,ee,q,z;switch(O=O%360,O=O<0?O+360:O,O){case 180:W=-1,ee=0,q=0,z=1;break;case 90:W=0,ee=1,q=1,z=0;break;case 270:W=0,ee=-1,q=-1,z=0;break;case 0:W=1,ee=0,q=0,z=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}F&&(q=-q,z=-z);let U,$,I,B;W===0?(U=Math.abs(V-w[1])*P+k,$=Math.abs(G-w[0])*P+D,I=Math.abs(w[3]-w[1])*P,B=Math.abs(w[2]-w[0])*P):(U=Math.abs(G-w[0])*P+k,$=Math.abs(V-w[1])*P+D,I=Math.abs(w[2]-w[0])*P,B=Math.abs(w[3]-w[1])*P),this.transform=[W*P,ee*P,q*P,z*P,U-W*P*G-q*P*V,$-ee*P*G-z*P*V],this.width=I,this.height=B}clone({scale:w=this.scale,rotation:P=this.rotation,offsetX:O=this.offsetX,offsetY:k=this.offsetY,dontFlip:D=!1}={}){return new d({viewBox:this.viewBox.slice(),scale:w,rotation:P,offsetX:O,offsetY:k,dontFlip:D})}convertToViewportPoint(w,P){return t.Util.applyTransform([w,P],this.transform)}convertToViewportRectangle(w){const P=t.Util.applyTransform([w[0],w[1]],this.transform),O=t.Util.applyTransform([w[2],w[3]],this.transform);return[P[0],P[1],O[0],O[1]]}convertToPdfPoint(w,P){return t.Util.applyInverseTransform([w,P],this.transform)}}e.PageViewport=d;class h extends t.BaseException{constructor(w,P){super(w),this.type=P}}e.RenderingCancelledException=h;const y={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};e.LinkTarget=y;function E(T,{url:w,target:P,rel:O,enabled:k=!0}={}){(0,t.assert)(w&&typeof w=="string",'addLinkAttributes: A valid "url" parameter must provided.');const D=(0,t.removeNullCharacters)(w);k?T.href=T.title=D:(T.href="",T.title=`Disabled: ${D}`,T.onclick=()=>!1);let F="";switch(P){case y.NONE:break;case y.SELF:F="_self";break;case y.BLANK:F="_blank";break;case y.PARENT:F="_parent";break;case y.TOP:F="_top";break}T.target=F,T.rel=typeof O=="string"?O:n}function p(T){const w=T.indexOf("#"),P=T.indexOf("?"),O=Math.min(w>0?w:T.length,P>0?P:T.length);return T.substring(T.lastIndexOf("/",O)+1,O)}class _{constructor(){this.started=Object.create(null),this.times=[]}time(w){w in this.started&&(0,t.warn)(`Timer is already running for ${w}`),this.started[w]=Date.now()}timeEnd(w){w in this.started||(0,t.warn)(`Timer has not been started for ${w}`),this.times.push({name:w,start:this.started[w],end:Date.now()}),delete this.started[w]}toString(){const w=[];let P=0;for(const O of this.times){const k=O.name;k.length>P&&(P=k.length)}for(const O of this.times){const k=O.end-O.start;w.push(`${O.name.padEnd(P)} ${k}ms
28
+ `)}return w.join("")}}e.StatTimer=_;function g(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&typeof ReadableStream<"u"}function x(T,w){try{const{protocol:P}=w?new URL(T,w):new URL(T);return P==="http:"||P==="https:"}catch{return!1}}function C(T){return new Promise((w,P)=>{const O=document.createElement("script");O.src=T,O.onload=w,O.onerror=function(){P(new Error(`Cannot load script at: ${O.src}`))},(document.head||document.documentElement).appendChild(O)})}function R(T){console.log("Deprecated API usage: "+T)}let S;class A{static toDateObject(w){if(!w||!(0,t.isString)(w))return null;S||(S=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const P=S.exec(w);if(!P)return null;const O=parseInt(P[1],10);let k=parseInt(P[2],10);k=k>=1&&k<=12?k-1:0;let D=parseInt(P[3],10);D=D>=1&&D<=31?D:1;let F=parseInt(P[4],10);F=F>=0&&F<=23?F:0;let G=parseInt(P[5],10);G=G>=0&&G<=59?G:0;let V=parseInt(P[6],10);V=V>=0&&V<=59?V:0;const W=P[7]||"Z";let ee=parseInt(P[8],10);ee=ee>=0&&ee<=23?ee:0;let q=parseInt(P[9],10)||0;return q=q>=0&&q<=59?q:0,W==="-"?(F+=ee,G+=q):W==="+"&&(F-=ee,G-=q),new Date(Date.UTC(O,k,D,F,G,V))}}e.PDFDateString=A},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.arrayByteLength=fe,e.arraysToBytes=de,e.assert=V,e.bytesToString=se,e.createPromiseCapability=We,e.getVerbosityLevel=k,e.info=D,e.isArrayBuffer=rt,e.isArrayEqual=qt,e.isBool=kt,e.isEmptyObj=Xt,e.isNum=Ge,e.isString=Ze,e.isSameOrigin=W,e.createValidAbsoluteUrl=q,e.removeNullCharacters=Z,e.setVerbosityLevel=O,e.shadow=z,e.string32=ce,e.stringToBytes=oe,e.stringToPDFString=yt,e.stringToUTF8String=ut,e.utf8StringToString=ft,e.warn=F,e.unreachable=G,e.IsEvalSupportedCached=e.IsLittleEndianCached=e.createObjectURL=e.FormatError=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.StreamType=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.MissingPDFException=e.InvalidPDFException=e.AbortException=e.CMapCompressionType=e.ImageKind=e.FontType=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.UNSUPPORTED_FEATURES=e.VerbosityLevel=e.OPS=e.IDENTITY_MATRIX=e.FONT_IDENTITY_MATRIX=e.BaseException=void 0,r(3);const t=[1,0,0,1,0,0];e.IDENTITY_MATRIX=t;const n=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=n;const a={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.PermissionFlag=a;const l={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.TextRenderingMode=l;const u={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=u;const f={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationType=f;const d={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=d;const h={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=h;const y={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=y;const E={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=E;const p={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=p;const _={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationFieldFlag=_;const g={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=g;const x={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=x;const C={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=C;const R={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=R;const S={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=S;const A={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=A;const T={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontGetPath:"errorFontGetPath"};e.UNSUPPORTED_FEATURES=T;const w={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=w;let P=R.WARNINGS;function O(pe){Number.isInteger(pe)&&(P=pe)}function k(){return P}function D(pe){P>=R.INFOS&&console.log(`Info: ${pe}`)}function F(pe){P>=R.WARNINGS&&console.log(`Warning: ${pe}`)}function G(pe){throw new Error(pe)}function V(pe,me){pe||G(me)}function W(pe,me){let ye;try{if(ye=new URL(pe),!ye.origin||ye.origin==="null")return!1}catch{return!1}const De=new URL(me,ye);return ye.origin===De.origin}function ee(pe){if(!pe)return!1;switch(pe.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function q(pe,me){if(!pe)return null;try{const ye=me?new URL(pe,me):new URL(pe);if(ee(ye))return ye}catch{}return null}function z(pe,me,ye){return Object.defineProperty(pe,me,{value:ye,enumerable:!0,configurable:!0,writable:!1}),ye}const U=function(){function me(ye){this.constructor===me&&G("Cannot initialize BaseException."),this.message=ye,this.name=this.constructor.name}return me.prototype=new Error,me.constructor=me,me}();e.BaseException=U;class $ extends U{constructor(me,ye){super(me),this.code=ye}}e.PasswordException=$;class I extends U{constructor(me,ye){super(me),this.details=ye}}e.UnknownErrorException=I;class B extends U{}e.InvalidPDFException=B;class X extends U{}e.MissingPDFException=X;class Q extends U{constructor(me,ye){super(me),this.status=ye}}e.UnexpectedResponseException=Q;class J extends U{}e.FormatError=J;class ne extends U{}e.AbortException=ne;const ae=/\x00/g;function Z(pe){return typeof pe!="string"?(F("The argument for removeNullCharacters must be a string."),pe):pe.replace(ae,"")}function se(pe){V(pe!==null&&typeof pe=="object"&&pe.length!==void 0,"Invalid argument for bytesToString");const me=pe.length,ye=8192;if(me<ye)return String.fromCharCode.apply(null,pe);const De=[];for(let Be=0;Be<me;Be+=ye){const Ce=Math.min(Be+ye,me),Ee=pe.subarray(Be,Ce);De.push(String.fromCharCode.apply(null,Ee))}return De.join("")}function oe(pe){V(typeof pe=="string","Invalid argument for stringToBytes");const me=pe.length,ye=new Uint8Array(me);for(let De=0;De<me;++De)ye[De]=pe.charCodeAt(De)&255;return ye}function fe(pe){return pe.length!==void 0?pe.length:(V(pe.byteLength!==void 0,"arrayByteLength - invalid argument."),pe.byteLength)}function de(pe){const me=pe.length;if(me===1&&pe[0]instanceof Uint8Array)return pe[0];let ye=0;for(let Ce=0;Ce<me;Ce++)ye+=fe(pe[Ce]);let De=0;const Be=new Uint8Array(ye);for(let Ce=0;Ce<me;Ce++){let Ee=pe[Ce];Ee instanceof Uint8Array||(typeof Ee=="string"?Ee=oe(Ee):Ee=new Uint8Array(Ee));const Pe=Ee.byteLength;Be.set(Ee,De),De+=Pe}return Be}function ce(pe){return String.fromCharCode(pe>>24&255,pe>>16&255,pe>>8&255,pe&255)}function Se(){const pe=new Uint8Array(4);return pe[0]=1,new Uint32Array(pe.buffer,0,1)[0]===1}const Le={get value(){return z(this,"value",Se())}};e.IsLittleEndianCached=Le;function Ne(){try{return new Function(""),!0}catch{return!1}}const He={get value(){return z(this,"value",Ne())}};e.IsEvalSupportedCached=He;const Ke=["rgb(",0,",",0,",",0,")"];class Qe{static makeCssRgb(me,ye,De){return Ke[1]=me,Ke[3]=ye,Ke[5]=De,Ke.join("")}static transform(me,ye){return[me[0]*ye[0]+me[2]*ye[1],me[1]*ye[0]+me[3]*ye[1],me[0]*ye[2]+me[2]*ye[3],me[1]*ye[2]+me[3]*ye[3],me[0]*ye[4]+me[2]*ye[5]+me[4],me[1]*ye[4]+me[3]*ye[5]+me[5]]}static applyTransform(me,ye){const De=me[0]*ye[0]+me[1]*ye[2]+ye[4],Be=me[0]*ye[1]+me[1]*ye[3]+ye[5];return[De,Be]}static applyInverseTransform(me,ye){const De=ye[0]*ye[3]-ye[1]*ye[2],Be=(me[0]*ye[3]-me[1]*ye[2]+ye[2]*ye[5]-ye[4]*ye[3])/De,Ce=(-me[0]*ye[1]+me[1]*ye[0]+ye[4]*ye[1]-ye[5]*ye[0])/De;return[Be,Ce]}static getAxialAlignedBoundingBox(me,ye){const De=Qe.applyTransform(me,ye),Be=Qe.applyTransform(me.slice(2,4),ye),Ce=Qe.applyTransform([me[0],me[3]],ye),Ee=Qe.applyTransform([me[2],me[1]],ye);return[Math.min(De[0],Be[0],Ce[0],Ee[0]),Math.min(De[1],Be[1],Ce[1],Ee[1]),Math.max(De[0],Be[0],Ce[0],Ee[0]),Math.max(De[1],Be[1],Ce[1],Ee[1])]}static inverseTransform(me){const ye=me[0]*me[3]-me[1]*me[2];return[me[3]/ye,-me[1]/ye,-me[2]/ye,me[0]/ye,(me[2]*me[5]-me[4]*me[3])/ye,(me[4]*me[1]-me[5]*me[0])/ye]}static apply3dTransform(me,ye){return[me[0]*ye[0]+me[1]*ye[1]+me[2]*ye[2],me[3]*ye[0]+me[4]*ye[1]+me[5]*ye[2],me[6]*ye[0]+me[7]*ye[1]+me[8]*ye[2]]}static singularValueDecompose2dScale(me){const ye=[me[0],me[2],me[1],me[3]],De=me[0]*ye[0]+me[1]*ye[2],Be=me[0]*ye[1]+me[1]*ye[3],Ce=me[2]*ye[0]+me[3]*ye[2],Ee=me[2]*ye[1]+me[3]*ye[3],Pe=(De+Ee)/2,Xe=Math.sqrt((De+Ee)*(De+Ee)-4*(De*Ee-Ce*Be))/2,nt=Pe+Xe||1,it=Pe-Xe||1;return[Math.sqrt(nt),Math.sqrt(it)]}static normalizeRect(me){const ye=me.slice(0);return me[0]>me[2]&&(ye[0]=me[2],ye[2]=me[0]),me[1]>me[3]&&(ye[1]=me[3],ye[3]=me[1]),ye}static intersect(me,ye){function De(Pe,Xe){return Pe-Xe}const Be=[me[0],me[2],ye[0],ye[2]].sort(De),Ce=[me[1],me[3],ye[1],ye[3]].sort(De),Ee=[];if(me=Qe.normalizeRect(me),ye=Qe.normalizeRect(ye),Be[0]===me[0]&&Be[1]===ye[0]||Be[0]===ye[0]&&Be[1]===me[0])Ee[0]=Be[1],Ee[2]=Be[2];else return null;if(Ce[0]===me[1]&&Ce[1]===ye[1]||Ce[0]===ye[1]&&Ce[1]===me[1])Ee[1]=Ce[1],Ee[3]=Ce[2];else return null;return Ee}}e.Util=Qe;const dt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function yt(pe){const me=pe.length,ye=[];if(pe[0]==="þ"&&pe[1]==="ÿ")for(let De=2;De<me;De+=2)ye.push(String.fromCharCode(pe.charCodeAt(De)<<8|pe.charCodeAt(De+1)));else if(pe[0]==="ÿ"&&pe[1]==="þ")for(let De=2;De<me;De+=2)ye.push(String.fromCharCode(pe.charCodeAt(De+1)<<8|pe.charCodeAt(De)));else for(let De=0;De<me;++De){const Be=dt[pe.charCodeAt(De)];ye.push(Be?String.fromCharCode(Be):pe.charAt(De))}return ye.join("")}function ut(pe){return decodeURIComponent(escape(pe))}function ft(pe){return unescape(encodeURIComponent(pe))}function Xt(pe){for(const me in pe)return!1;return!0}function kt(pe){return typeof pe=="boolean"}function Ge(pe){return typeof pe=="number"}function Ze(pe){return typeof pe=="string"}function rt(pe){return typeof pe=="object"&&pe!==null&&pe.byteLength!==void 0}function qt(pe,me){return pe.length!==me.length?!1:pe.every(function(ye,De){return ye===me[De]})}function We(){const pe=Object.create(null);let me=!1;return Object.defineProperty(pe,"settled",{get(){return me}}),pe.promise=new Promise(function(ye,De){pe.resolve=function(Be){me=!0,ye(Be)},pe.reject=function(Be){me=!0,De(Be)}}),pe}const at=function(){const me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(De,Be,Ce=!1){if(!Ce&&URL.createObjectURL){const Pe=new Blob([De],{type:Be});return URL.createObjectURL(Pe)}let Ee=`data:${Be};base64,`;for(let Pe=0,Xe=De.length;Pe<Xe;Pe+=3){const nt=De[Pe]&255,it=De[Pe+1]&255,Ht=De[Pe+2]&255,Sr=nt>>2,Qt=(nt&3)<<4|it>>4,Nt=Pe+1<Xe?(it&15)<<2|Ht>>6:64,Er=Pe+2<Xe?Ht&63:64;Ee+=me[Sr]+me[Qt]+me[Nt]+me[Er]}return Ee}}();e.createObjectURL=at},function(o,e,r){r(4)},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;const t=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;e.isNodeJS=t},function(module,exports,__w_pdfjs_require__){Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.build=exports.version=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFWorker=exports.PDFDataRangeTransport=exports.LoopbackPort=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(6),_api_compatibility=__w_pdfjs_require__(7),_canvas=__w_pdfjs_require__(8),_worker_options=__w_pdfjs_require__(10),_is_node=__w_pdfjs_require__(4),_message_handler=__w_pdfjs_require__(11),_metadata=__w_pdfjs_require__(12),_transport_stream=__w_pdfjs_require__(14),_webgl=__w_pdfjs_require__(15);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let createPDFNetworkStream;function setPDFNetworkStreamFactory(o){createPDFNetworkStream=o}function getDocument(o){const e=new PDFDocumentLoadingTask;let r;if(typeof o=="string")r={url:o};else if((0,_util.isArrayBuffer)(o))r={data:o};else if(o instanceof PDFDataRangeTransport)r={range:o};else{if(typeof o!="object")throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!o.url&&!o.data&&!o.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=o}const t=Object.create(null);let n=null,a=null;for(const u in r){if(u==="url"&&typeof window<"u"){t[u]=new URL(r[u],window.location).href;continue}else if(u==="range"){n=r[u];continue}else if(u==="worker"){a=r[u];continue}else if(u==="data"&&!(r[u]instanceof Uint8Array)){const f=r[u];if(typeof f=="string")t[u]=(0,_util.stringToBytes)(f);else if(typeof f=="object"&&f!==null&&!isNaN(f.length))t[u]=new Uint8Array(f);else if((0,_util.isArrayBuffer)(f))t[u]=new Uint8Array(f);else throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");continue}t[u]=r[u]}if(t.rangeChunkSize=t.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,t.CMapReaderFactory=t.CMapReaderFactory||_display_utils.DOMCMapReaderFactory,t.ignoreErrors=t.stopAtErrors!==!0,t.fontExtraProperties=t.fontExtraProperties===!0,t.pdfBug=t.pdfBug===!0,Number.isInteger(t.maxImageSize)||(t.maxImageSize=-1),typeof t.isEvalSupported!="boolean"&&(t.isEvalSupported=!0),typeof t.disableFontFace!="boolean"&&(t.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1),typeof t.disableRange!="boolean"&&(t.disableRange=!1),typeof t.disableStream!="boolean"&&(t.disableStream=!1),typeof t.disableAutoFetch!="boolean"&&(t.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(t.verbosity),!a){const u={verbosity:t.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};a=u.port?PDFWorker.fromPort(u):new PDFWorker(u),e._worker=a}const l=e.docId;return a.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const u=_fetchDocument(a,t,n,l),f=new Promise(function(d){let h;n?h=new _transport_stream.PDFDataTransportStream({length:t.length,initialData:t.initialData,progressiveDone:t.progressiveDone,disableRange:t.disableRange,disableStream:t.disableStream},n):t.data||(h=createPDFNetworkStream({url:t.url,length:t.length,httpHeaders:t.httpHeaders,withCredentials:t.withCredentials,rangeChunkSize:t.rangeChunkSize,disableRange:t.disableRange,disableStream:t.disableStream})),d(h)});return Promise.all([u,f]).then(function([d,h]){if(e.destroyed)throw new Error("Loading aborted");const y=new _message_handler.MessageHandler(l,d,a.port);y.postMessageTransfers=a.postMessageTransfers;const E=new WorkerTransport(y,e,h,t);e._transport=E,y.send("Ready",null)})}).catch(e._capability.reject),e}function _fetchDocument(o,e,r,t){return o.destroyed?Promise.reject(new Error("Worker was destroyed")):(r&&(e.length=r.length,e.initialData=r.initialData,e.progressiveDone=r.progressiveDone),o.messageHandler.sendWithPromise("GetDocRequest",{docId:t,apiVersion:"2.5.207",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,postMessageTransfers:o.postMessageTransfers,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then(function(n){if(o.destroyed)throw new Error("Worker was destroyed");return n}))}const PDFDocumentLoadingTask=function(){let e=0;class r{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then(()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}}return r}();class PDFDataRangeTransport{constructor(e,r,t=!1){this.length=e,this.initialData=r,this.progressiveDone=t,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,r){for(const t of this._rangeListeners)t(e,r)}onDataProgress(e,r){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const r of this._progressiveReadListeners)r(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,r){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,r){this._pdfInfo=e,this._transport=r}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getOpenActionDestination(){return(0,_display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."),this.getOpenAction().then(function(e){return e&&e.dest?e.dest:null})}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,r,t,n=!1){this._pageIndex=e,this._pageInfo=r,this._transport=t,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=t.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:r=this.rotate,offsetX:t=0,offsetY:n=0,dontFlip:a=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:r,offsetX:t,offsetY:n,dontFlip:a})}getAnnotations({intent:e=null}={}){return(!this.annotationsPromise||this.annotationsIntent!==e)&&(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:r,intent:t="display",enableWebGL:n=!1,renderInteractiveForms:a=!1,transform:l=null,imageLayer:u=null,canvasFactory:f=null,background:d=null}){this._stats&&this._stats.time("Overall");const h=t==="print"?"print":"display";this.pendingCleanup=!1,this.intentStates[h]||(this.intentStates[h]=Object.create(null));const y=this.intentStates[h];y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const E=f||new _display_utils.DOMCanvasFactory,p=new _webgl.WebGLContext({enable:n});y.displayReadyCapability||(y.displayReadyCapability=(0,_util.createPromiseCapability)(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:h,renderInteractiveForms:a===!0}));const _=C=>{const R=y.renderTasks.indexOf(g);R>=0&&y.renderTasks.splice(R,1),(this.cleanupAfterRender||h==="print")&&(this.pendingCleanup=!0),this._tryCleanup(),C?(g.capability.reject(C),this._abortOperatorList({intentState:y,reason:C})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},g=new InternalRenderTask({callback:_,params:{canvasContext:e,viewport:r,transform:l,imageLayer:u,background:d},objs:this.objs,commonObjs:this.commonObjs,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:E,webGLContext:p,useRequestAnimationFrame:h!=="print",pdfBug:this._pdfBug});y.renderTasks||(y.renderTasks=[]),y.renderTasks.push(g);const x=g.task;return y.displayReadyCapability.promise.then(C=>{if(this.pendingCleanup){_();return}this._stats&&this._stats.time("Rendering"),g.initializeGraphics(C),g.operatorListChanged()}).catch(_),x}getOperatorList(){function e(){if(t.operatorList.lastChunk){t.opListReadCapability.resolve(t.operatorList);const a=t.renderTasks.indexOf(n);a>=0&&t.renderTasks.splice(a,1)}}const r="oplist";this.intentStates[r]||(this.intentStates[r]=Object.create(null));const t=this.intentStates[r];let n;return t.opListReadCapability||(n={},n.operatorListChanged=e,t.opListReadCapability=(0,_util.createPromiseCapability)(),t.renderTasks=[],t.renderTasks.push(n),t.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:r})),t.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:r=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:e===!0,combineTextItems:r!==!0},{highWaterMark:100,size(n){return n.items.length}})}getTextContent(e={}){const r=this.streamTextContent(e);return new Promise(function(t,n){function a(){l.read().then(function({value:f,done:d}){if(d){t(u);return}Object.assign(u.styles,f.styles),u.items.push(...f.items),a()},n)}const l=r.getReader(),u={items:[],styles:Object.create(null)};a()})}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];return Object.keys(this.intentStates).forEach(r=>{const t=this.intentStates[r];this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),r!=="oplist"&&t.renderTasks.forEach(function(n){const a=n.capability.promise.catch(function(){});e.push(a),n.cancel()})}),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){return!this.pendingCleanup||Object.keys(this.intentStates).some(r=>{const t=this.intentStates[r];return t.renderTasks.length!==0||!t.operatorList.lastChunk})?!1:(Object.keys(this.intentStates).forEach(r=>{delete this.intentStates[r]}),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0)}_startRenderPage(e,r){const t=this.intentStates[r];t&&(this._stats&&this._stats.timeEnd("Page Request"),t.displayReadyCapability&&t.displayReadyCapability.resolve(e))}_renderPageChunk(e,r){for(let t=0,n=e.length;t<n;t++)r.operatorList.fnArray.push(e.fnArray[t]),r.operatorList.argsArray.push(e.argsArray[t]);r.operatorList.lastChunk=e.lastChunk;for(let t=0;t<r.renderTasks.length;t++)r.renderTasks[t].operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){(0,_util.assert)(e.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');const t=this._transport.messageHandler.sendWithStream("GetOperatorList",e).getReader(),n=this.intentStates[e.intent];n.streamReader=t;const a=()=>{t.read().then(({value:l,done:u})=>{if(u){n.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(l,n),a())},l=>{if(n.streamReader=null,!this._transport.destroyed){if(n.operatorList){n.operatorList.lastChunk=!0;for(let u=0;u<n.renderTasks.length;u++)n.renderTasks[u].operatorListChanged();this._tryCleanup()}if(n.displayReadyCapability)n.displayReadyCapability.reject(l);else if(n.opListReadCapability)n.opListReadCapability.reject(l);else throw l}})};a()}_abortOperatorList({intentState:e,reason:r,force:t=!1}){if((0,_util.assert)(r instanceof Error||typeof r=="object"&&r!==null,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),!!e.streamReader){if(!t){if(e.renderTasks.length!==0)return;if(r instanceof _display_utils.RenderingCancelledException){e.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:e,reason:r,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}e.streamReader.cancel(new _util.AbortException(r&&r.message)),e.streamReader=null,!this._transport.destroyed&&(Object.keys(this.intentStates).some(n=>this.intentStates[n]===e?(delete this.intentStates[n],!0):!1),this.cleanup())}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,r){function t(l){if(typeof l!="object"||l===null)return l;if(n.has(l))return n.get(l);let u,f;if((u=l.buffer)&&(0,_util.isArrayBuffer)(u))return r&&r.includes(u)?f=new l.constructor(u,l.byteOffset,l.byteLength):f=new l.constructor(l),n.set(l,f),f;f=Array.isArray(l)?[]:{},n.set(l,f);for(const d in l){let h,y=l;for(;!(h=Object.getOwnPropertyDescriptor(y,d));)y=Object.getPrototypeOf(y);if(!(typeof h.value>"u")){if(typeof h.value=="function"){if(l.hasOwnProperty&&l.hasOwnProperty(d))throw new Error(`LoopbackPort.postMessage - cannot clone: ${l[d]}`);continue}f[d]=t(h.value)}}return f}if(!this._defer){this._listeners.forEach(l=>{l.call(this,{data:e})});return}const n=new WeakMap,a={data:t(e)};this._deferred.then(()=>{this._listeners.forEach(l=>{l.call(this,a)})})}addEventListener(e,r){this._listeners.push(r)}removeEventListener(e,r){const t=this._listeners.indexOf(r);this._listeners.splice(t,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS&&typeof commonjsRequire=="function")isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"&&"currentScript"in document){const o=document.currentScript&&document.currentScript.src;o&&(fallbackWorkerSrc=o.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(typeof fallbackWorkerSrc<"u")return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let o;try{o=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch{}return o||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(o){const e="importScripts('"+o+"');";return URL.createObjectURL(new Blob([e]))}class PDFWorker{constructor({name:e=null,port:r=null,verbosity:t=(0,_util.getVerbosityLevel)()}={}){if(r&&pdfWorkerPorts.has(r))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=t,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,r){pdfWorkerPorts.set(r,this),this._initializeFromPort(r);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(typeof Worker<"u"&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const r=new Worker(e),t=new _message_handler.MessageHandler("main","worker",r),n=()=>{r.removeEventListener("error",a),t.destroy(),r.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=()=>{this._webWorker||n()};r.addEventListener("error",a),t.on("test",u=>{if(r.removeEventListener("error",a),this.destroyed){n();return}u?(this._messageHandler=t,this._port=r,this._webWorker=r,u.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),t.destroy(),r.terminate())}),t.on("ready",u=>{if(r.removeEventListener("error",a),this.destroyed){n();return}try{l()}catch{this._setupFakeWorker()}});const l=()=>{const u=new Uint8Array([this.postMessageTransfers?255:0]);try{t.send("test",u,[u.buffer])}catch{(0,_util.warn)("Cannot use postMessage transfers."),u[0]=0,t.send("test",u)}};l();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const r=new LoopbackPort;this._port=r;const t="fake"+nextFakeWorkerId++,n=new _message_handler.MessageHandler(t+"_worker",t,r);e.setup(n,r);const a=new _message_handler.MessageHandler(t,t+"_worker",r);this._messageHandler=a,this._readyCapability.resolve(),a.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,r,t,n){this.messageHandler=e,this.loadingTask=r,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:r.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=n,this.CMapReaderFactory=new n.CMapReaderFactory({baseUrl:n.cMapUrl,isCompressed:n.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=t,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];this.pageCache.forEach(function(t){t&&e.push(t._destroy())}),this.pageCache.length=0,this.pagePromises.length=0;const r=this.messageHandler.sendWithPromise("Terminate",null);return e.push(r),Promise.all(e).then(()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:r}=this;e.on("GetReader",(t,n)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},n.onPull=()=>{this._fullReader.read().then(function({value:a,done:l}){if(l){n.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(a),"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{n.error(a)})},n.onCancel=a=>{this._fullReader.cancel(a)}}),e.on("ReaderHeadersReady",t=>{const n=(0,_util.createPromiseCapability)(),a=this._fullReader;return a.headersReady.then(()=>{(!a.isStreamingSupported||!a.isRangeSupported)&&(this._lastProgress&&r.onProgress&&r.onProgress(this._lastProgress),a.onProgress=l=>{r.onProgress&&r.onProgress({loaded:l.loaded,total:l.total})}),n.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(t,n)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(t.begin,t.end);if(!a){n.close();return}n.onPull=()=>{a.read().then(function({value:l,done:u}){if(u){n.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(l),"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(l),1,[l])}).catch(l=>{n.error(l)})},n.onCancel=l=>{a.cancel(l)}}),e.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,r._capability.resolve(new PDFDocumentProxy(t,this))}),e.on("DocException",function(t){let n;switch(t.name){case"PasswordException":n=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":n=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(t.message,t.details);break}r._capability.reject(n)}),e.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),r.onPassword){const n=a=>{this._passwordCapability.resolve({password:a})};try{r.onPassword(n,t.code)}catch(a){this._passwordCapability.reject(a)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),e.on("DataLoaded",t=>{r.onProgress&&r.onProgress({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),e.on("StartRenderPage",t=>{if(this.destroyed)return;this.pageCache[t.pageIndex]._startRenderPage(t.transparency,t.intent)}),e.on("commonobj",t=>{if(this.destroyed)return;const[n,a,l]=t;if(!this.commonObjs.has(n))switch(a){case"Font":const u=this._params;if("error"in l){const h=l.error;(0,_util.warn)(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let f=null;u.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(f={registerFont(h,y){globalThis.FontInspector.fontAdded(h,y)}});const d=new _font_loader.FontFaceObject(l,{isEvalSupported:u.isEvalSupported,disableFontFace:u.disableFontFace,ignoreErrors:u.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:f});this.fontLoader.bind(d).catch(h=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!u.fontExtraProperties&&d.data&&(d.data=null),this.commonObjs.resolve(n,d)});break;case"FontPath":case"FontType3Res":case"Image":this.commonObjs.resolve(n,l);break;default:throw new Error(`Got unknown common object type ${a}`)}}),e.on("obj",t=>{if(this.destroyed)return;const[n,a,l,u]=t,f=this.pageCache[a];if(!f.objs.has(n))switch(l){case"Image":f.objs.resolve(n,u);const d=8e6;u&&"data"in u&&u.data.length>d&&(f.cleanupAfterRender=!0);break;default:throw new Error(`Got unknown object type ${l}`)}}),e.on("DocProgress",t=>{this.destroyed||r.onProgress&&r.onProgress({loaded:t.loaded,total:t.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(t,n)=>{if(this.destroyed){n.error(new Error("Worker was destroyed"));return}let a=!1;n.onPull=()=>{if(a){n.close();return}a=!0,this.CMapReaderFactory.fetch(t).then(function(l){n.enqueue(l,1,[l.cMapData.buffer])}).catch(function(l){n.error(l)})}})}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const r=e-1;if(r in this.pagePromises)return this.pagePromises[r];const t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");const a=new PDFPageProxy(r,n,this,this._params.pdfBug);return this.pageCache[r]=a,a});return this.pagePromises[r]=t,t}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(r){return Promise.reject(new Error(r))})}getAnnotations(e,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:r})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null}))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then(()=>{for(let e=0,r=this.pageCache.length;e<r;e++){const t=this.pageCache[e];if(t&&!t.cleanup())throw new Error(`startCleanup: Page ${e+1} is currently rendering.`)}this.commonObjs.clear(),this.fontLoader.clear()})}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,disableFontFace:e.disableFontFace})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(e){return this._objs[e]?this._objs[e]:this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(e,r=null){if(r)return this._ensureObj(e).capability.promise.then(r),null;const t=this._objs[e];if(!t||!t.resolved)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return t.data}has(e){const r=this._objs[e];return r?r.resolved:!1}resolve(e,r){const t=this._ensureObj(e);t.resolved=!0,t.data=r,t.capability.resolve(r)}clear(){this._objs=Object.create(null)}}class RenderTask{constructor(e){this._internalRenderTask=e,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}const InternalRenderTask=function o(){const e=new WeakSet;class r{constructor({callback:n,params:a,objs:l,commonObjs:u,operatorList:f,pageIndex:d,canvasFactory:h,webGLContext:y,useRequestAnimationFrame:E=!1,pdfBug:p=!1}){this.callback=n,this.params=a,this.objs=l,this.commonObjs=u,this.operatorListIdx=null,this.operatorList=f,this._pageIndex=d,this.canvasFactory=h,this.webGLContext=y,this._pdfBug=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=E===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=a.canvasContext.canvas}initializeGraphics(n=!1){if(this.cancelled)return;if(this._canvas){if(e.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager&&globalThis.StepperManager.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:l,transform:u,imageLayer:f,background:d}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,f),this.gfx.beginDrawing({transform:u,viewport:l,transparency:n,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(n=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback(n||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&this.stepper.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this.cancel.bind(this))}):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback())))}}return r}(),version="2.5.207";exports.version=version;const build="0974d605";exports.build=build},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var t=r(2);class n{constructor({docId:f,onUnsupportedFeature:d}){this.constructor===n&&(0,t.unreachable)("Cannot initialize BaseFontLoader."),this.docId=f,this._onUnsupportedFeature=d,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(f){this.nativeFontFaces.push(f),document.fonts.add(f)}insertRule(f){let d=this.styleElement;d||(d=this.styleElement=document.createElement("style"),d.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,document.documentElement.getElementsByTagName("head")[0].appendChild(d));const h=d.sheet;h.insertRule(f,h.cssRules.length)}clear(){this.nativeFontFaces.forEach(function(f){document.fonts.delete(f)}),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(f){if(f.attached||f.missingFile)return;if(f.attached=!0,this.isFontLoadingAPISupported){const h=f.createNativeFontFace();if(h){this.addNativeFontFace(h);try{await h.loaded}catch(y){throw this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,t.warn)(`Failed to load font '${h.family}': '${y}'.`),f.disableFontFace=!0,y}}return}const d=f.createFontFaceRule();if(d){if(this.insertRule(d),this.isSyncFontLoadingSupported)return;await new Promise(h=>{const y=this._queueLoadingCallback(h);this._prepareFontLoadEvent([d],[f],y)})}}_queueLoadingCallback(f){(0,t.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const f=typeof document<"u"&&!!document.fonts;return(0,t.shadow)(this,"isFontLoadingAPISupported",f)}get isSyncFontLoadingSupported(){(0,t.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,t.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(f,d,h){(0,t.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let a;e.FontLoader=a,e.FontLoader=a=class extends n{constructor(f){super(f),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let f=!1;if(typeof navigator>"u")f=!0;else{const d=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);d&&d[1]>=14&&(f=!0)}return(0,t.shadow)(this,"isSyncFontLoadingSupported",f)}_queueLoadingCallback(f){function d(){for((0,t.assert)(!y.done,"completeRequest() cannot be called twice."),y.done=!0;h.requests.length>0&&h.requests[0].done;){const E=h.requests.shift();setTimeout(E.callback,0)}}const h=this.loadingContext,y={id:`pdfjs-font-loading-${h.nextRequestId++}`,done:!1,complete:d,callback:f};return h.requests.push(y),y}get _loadTestFont(){const f=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,t.shadow)(this,"_loadTestFont",f())}_prepareFontLoadEvent(f,d,h){function y(V,W){return V.charCodeAt(W)<<24|V.charCodeAt(W+1)<<16|V.charCodeAt(W+2)<<8|V.charCodeAt(W+3)&255}function E(V,W,ee,q){const z=V.substring(0,W),U=V.substring(W+ee);return z+q+U}let p,_;const g=document.createElement("canvas");g.width=1,g.height=1;const x=g.getContext("2d");let C=0;function R(V,W){if(C++,C>30){(0,t.warn)("Load test font never loaded."),W();return}if(x.font="30px "+V,x.fillText(".",0,20),x.getImageData(0,0,1,1).data[3]>0){W();return}setTimeout(R.bind(null,V,W))}const S=`lt${Date.now()}${this.loadTestFontId++}`;let A=this._loadTestFont;A=E(A,976,S.length,S);const w=16,P=1482184792;let O=y(A,w);for(p=0,_=S.length-3;p<_;p+=4)O=O-P+y(S,p)|0;p<S.length&&(O=O-P+y(S+"XXX",p)|0),A=E(A,w,4,(0,t.string32)(O));const k=`url(data:font/opentype;base64,${btoa(A)});`,D=`@font-face {font-family:"${S}";src:${k}}`;this.insertRule(D);const F=[];for(p=0,_=d.length;p<_;p++)F.push(d[p].loadedName);F.push(S);const G=document.createElement("div");for(G.style.visibility="hidden",G.style.width=G.style.height="10px",G.style.position="absolute",G.style.top=G.style.left="0px",p=0,_=F.length;p<_;++p){const V=document.createElement("span");V.textContent="Hi",V.style.fontFamily=F[p],G.appendChild(V)}document.body.appendChild(G),R(S,function(){document.body.removeChild(G),h.complete()})}};class l{constructor(f,{isEvalSupported:d=!0,disableFontFace:h=!1,ignoreErrors:y=!1,onUnsupportedFeature:E=null,fontRegistry:p=null}){this.compiledGlyphs=Object.create(null);for(const _ in f)this[_]=f[_];this.isEvalSupported=d!==!1,this.disableFontFace=h===!0,this.ignoreErrors=y===!0,this._onUnsupportedFeature=E,this.fontRegistry=p}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const f=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),f}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const f=(0,t.bytesToString)(new Uint8Array(this.data)),d=`url(data:${this.mimetype};base64,${btoa(f)});`,h=`@font-face {font-family:"${this.loadedName}";src:${d}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,d),h}getPathGenerator(f,d){if(this.compiledGlyphs[d]!==void 0)return this.compiledGlyphs[d];let h,y;try{h=f.get(this.loadedName+"_path_"+d)}catch(E){if(!this.ignoreErrors)throw E;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,t.warn)(`getPathGenerator - ignoring character: "${E}".`),this.compiledGlyphs[d]=function(p,_){}}if(this.isEvalSupported&&t.IsEvalSupportedCached.value){let E,p="";for(let _=0,g=h.length;_<g;_++)y=h[_],y.args!==void 0?E=y.args.join(","):E="",p+="c."+y.cmd+"("+E+`);
29
+ `;return this.compiledGlyphs[d]=new Function("c","size",p)}return this.compiledGlyphs[d]=function(E,p){for(let _=0,g=h.length;_<g;_++)y=h[_],y.cmd==="scale"&&(y.args=[p,-p]),E[y.cmd].apply(E,y.args)}}}e.FontFaceObject=l},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.apiCompatibilityParams=void 0;var t=r(4);const n=Object.create(null);(function(){t.isNodeJS&&(n.disableFontFace=!0)})();const a=Object.freeze(n);e.apiCompatibilityParams=a},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var t=r(2),n=r(9),a=16,l=100,u=4096,f=.65,d=1e3,h=16;function y(x){x.mozCurrentTransform||(x._originalSave=x.save,x._originalRestore=x.restore,x._originalRotate=x.rotate,x._originalScale=x.scale,x._originalTranslate=x.translate,x._originalTransform=x.transform,x._originalSetTransform=x.setTransform,x._transformMatrix=x._transformMatrix||[1,0,0,1,0,0],x._transformStack=[],Object.defineProperty(x,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(x,"mozCurrentTransformInverse",{get:function(){var R=this._transformMatrix,S=R[0],A=R[1],T=R[2],w=R[3],P=R[4],O=R[5],k=S*w-A*T,D=A*T-S*w;return[w/k,A/D,T/D,S/k,(w*P-T*O)/D,(A*P-S*O)/k]}}),x.save=function(){var R=this._transformMatrix;this._transformStack.push(R),this._transformMatrix=R.slice(0,6),this._originalSave()},x.restore=function(){var R=this._transformStack.pop();R&&(this._transformMatrix=R,this._originalRestore())},x.translate=function(R,S){var A=this._transformMatrix;A[4]=A[0]*R+A[2]*S+A[4],A[5]=A[1]*R+A[3]*S+A[5],this._originalTranslate(R,S)},x.scale=function(R,S){var A=this._transformMatrix;A[0]=A[0]*R,A[1]=A[1]*R,A[2]=A[2]*S,A[3]=A[3]*S,this._originalScale(R,S)},x.transform=function(R,S,A,T,w,P){var O=this._transformMatrix;this._transformMatrix=[O[0]*R+O[2]*S,O[1]*R+O[3]*S,O[0]*A+O[2]*T,O[1]*A+O[3]*T,O[0]*w+O[2]*P+O[4],O[1]*w+O[3]*P+O[5]],x._originalTransform(R,S,A,T,w,P)},x.setTransform=function(R,S,A,T,w,P){this._transformMatrix=[R,S,A,T,w,P],x._originalSetTransform(R,S,A,T,w,P)},x.rotate=function(R){var S=Math.cos(R),A=Math.sin(R),T=this._transformMatrix;this._transformMatrix=[T[0]*S+T[2]*A,T[1]*S+T[3]*A,T[0]*-A+T[2]*S,T[1]*-A+T[3]*S,T[4],T[5]],this._originalRotate(R)})}var E=function(){function C(R){this.canvasFactory=R,this.cache=Object.create(null)}return C.prototype={getCanvas:function(S,A,T,w){var P;return this.cache[S]!==void 0?(P=this.cache[S],this.canvasFactory.reset(P,A,T),P.context.setTransform(1,0,0,1,0,0)):(P=this.canvasFactory.create(A,T),this.cache[S]=P),w&&y(P.context),P},clear(){for(var R in this.cache){var S=this.cache[R];this.canvasFactory.destroy(S),delete this.cache[R]}}},C}();function p(x){var C=1e3,R=x.width,S=x.height,A,T,w,P=R+1,O=new Uint8Array(P*(S+1)),k=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),D=R+7&-8,F=x.data,G=new Uint8Array(D*S),V=0,W;for(A=0,W=F.length;A<W;A++)for(var ee=128,q=F[A];ee>0;)G[V++]=q&ee?0:255,ee>>=1;var z=0;for(V=0,G[V]!==0&&(O[0]=1,++z),T=1;T<R;T++)G[V]!==G[V+1]&&(O[T]=G[V]?2:1,++z),V++;for(G[V]!==0&&(O[T]=2,++z),A=1;A<S;A++){V=A*D,w=A*P,G[V-D]!==G[V]&&(O[w]=G[V]?1:8,++z);var U=(G[V]?4:0)+(G[V-D]?8:0);for(T=1;T<R;T++)U=(U>>2)+(G[V+1]?4:0)+(G[V-D+1]?8:0),k[U]&&(O[w+T]=k[U],++z),V++;if(G[V-D]!==G[V]&&(O[w+T]=G[V]?2:4,++z),z>C)return null}for(V=D*(S-1),w=A*P,G[V]!==0&&(O[w]=8,++z),T=1;T<R;T++)G[V]!==G[V+1]&&(O[w+T]=G[V]?4:8,++z),V++;if(G[V]!==0&&(O[w+T]=4,++z),z>C)return null;var $=new Int32Array([0,P,-1,0,-P,0,0,0,1]),I=[];for(A=0;z&&A<=S;A++){for(var B=A*P,X=B+R;B<X&&!O[B];)B++;if(B!==X){var Q=[B%P,A],J=O[B],ne=B,ae;do{var Z=$[J];do B+=Z;while(!O[B]);ae=O[B],ae!==5&&ae!==10?(J=ae,O[B]=0):(J=ae&51*J>>4,O[B]&=J>>2|J<<2),Q.push(B%P),Q.push(B/P|0),O[B]||--z}while(ne!==B);I.push(Q),--A}}var se=function(oe){oe.save(),oe.scale(1/R,-1/S),oe.translate(0,-S),oe.beginPath();for(let de=0,ce=I.length;de<ce;de++){var fe=I[de];oe.moveTo(fe[0],fe[1]);for(let Se=2,Le=fe.length;Se<Le;Se+=2)oe.lineTo(fe[Se],fe[Se+1])}oe.fill(),oe.beginPath(),oe.restore()};return se}var _=function(){function C(){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=t.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=t.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=t.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.resumeSMaskCtx=null}return C.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(S,A){this.x=S,this.y=A}},C}(),g=function(){var C=15,R=10;function S(U,$,I,B,X,Q){this.ctx=U,this.current=new _,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=$,this.objs=I,this.canvasFactory=B,this.webGLContext=X,this.imageLayer=Q,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.cachedCanvases=new E(this.canvasFactory),U&&y(U),this._cachedGetSinglePixelWidth=null}function A(U,$){if(typeof ImageData<"u"&&$ instanceof ImageData){U.putImageData($,0,0);return}var I=$.height,B=$.width,X=I%h,Q=(I-X)/h,J=X===0?Q:Q+1,ne=U.createImageData(B,h),ae=0,Z,se=$.data,oe=ne.data,fe,de,ce,Se;if($.kind===t.ImageKind.GRAYSCALE_1BPP){var Le=se.byteLength,Ne=new Uint32Array(oe.buffer,0,oe.byteLength>>2),He=Ne.length,Ke=B+7>>3,Qe=4294967295,dt=t.IsLittleEndianCached.value?4278190080:255;for(fe=0;fe<J;fe++){for(ce=fe<Q?h:X,Z=0,de=0;de<ce;de++){for(var yt=Le-ae,ut=0,ft=yt>Ke?B:yt*8-7,Xt=ft&-8,kt=0,Ge=0;ut<Xt;ut+=8)Ge=se[ae++],Ne[Z++]=Ge&128?Qe:dt,Ne[Z++]=Ge&64?Qe:dt,Ne[Z++]=Ge&32?Qe:dt,Ne[Z++]=Ge&16?Qe:dt,Ne[Z++]=Ge&8?Qe:dt,Ne[Z++]=Ge&4?Qe:dt,Ne[Z++]=Ge&2?Qe:dt,Ne[Z++]=Ge&1?Qe:dt;for(;ut<ft;ut++)kt===0&&(Ge=se[ae++],kt=128),Ne[Z++]=Ge&kt?Qe:dt,kt>>=1}for(;Z<He;)Ne[Z++]=0;U.putImageData(ne,0,fe*h)}}else if($.kind===t.ImageKind.RGBA_32BPP){for(de=0,Se=B*h*4,fe=0;fe<Q;fe++)oe.set(se.subarray(ae,ae+Se)),ae+=Se,U.putImageData(ne,0,de),de+=h;fe<J&&(Se=B*X*4,oe.set(se.subarray(ae,ae+Se)),U.putImageData(ne,0,de))}else if($.kind===t.ImageKind.RGB_24BPP)for(ce=h,Se=B*ce,fe=0;fe<J;fe++){for(fe>=Q&&(ce=X,Se=B*ce),Z=0,de=Se;de--;)oe[Z++]=se[ae++],oe[Z++]=se[ae++],oe[Z++]=se[ae++],oe[Z++]=255;U.putImageData(ne,0,fe*h)}else throw new Error(`bad image kind: ${$.kind}`)}function T(U,$){for(var I=$.height,B=$.width,X=I%h,Q=(I-X)/h,J=X===0?Q:Q+1,ne=U.createImageData(B,h),ae=0,Z=$.data,se=ne.data,oe=0;oe<J;oe++){for(var fe=oe<Q?h:X,de=3,ce=0;ce<fe;ce++)for(var Se=0,Le=0;Le<B;Le++){if(!Se){var Ne=Z[ae++];Se=128}se[de]=Ne&Se?0:255,de+=4,Se>>=1}U.putImageData(ne,0,oe*h)}}function w(U,$){for(var I=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],B=0,X=I.length;B<X;B++){var Q=I[B];U[Q]!==void 0&&($[Q]=U[Q])}U.setLineDash!==void 0&&($.setLineDash(U.getLineDash()),$.lineDashOffset=U.lineDashOffset)}function P(U){U.strokeStyle="#000000",U.fillStyle="#000000",U.fillRule="nonzero",U.globalAlpha=1,U.lineWidth=1,U.lineCap="butt",U.lineJoin="miter",U.miterLimit=10,U.globalCompositeOperation="source-over",U.font="10px sans-serif",U.setLineDash!==void 0&&(U.setLineDash([]),U.lineDashOffset=0)}function O(U,$,I,B){for(var X=U.length,Q=3;Q<X;Q+=4){var J=U[Q];if(J===0)U[Q-3]=$,U[Q-2]=I,U[Q-1]=B;else if(J<255){var ne=255-J;U[Q-3]=U[Q-3]*J+$*ne>>8,U[Q-2]=U[Q-2]*J+I*ne>>8,U[Q-1]=U[Q-1]*J+B*ne>>8}}}function k(U,$,I){for(var B=U.length,X=1/255,Q=3;Q<B;Q+=4){var J=I?I[U[Q]]:U[Q];$[Q]=$[Q]*J*X|0}}function D(U,$,I){for(var B=U.length,X=3;X<B;X+=4){var Q=U[X-3]*77+U[X-2]*152+U[X-1]*28;$[X]=I?$[X]*I[Q>>8]>>8:$[X]*Q>>16}}function F(U,$,I,B,X,Q,J){var ne=!!Q,ae=ne?Q[0]:0,Z=ne?Q[1]:0,se=ne?Q[2]:0,oe;X==="Luminosity"?oe=D:oe=k;for(var fe=1048576,de=Math.min(B,Math.ceil(fe/I)),ce=0;ce<B;ce+=de){var Se=Math.min(de,B-ce),Le=U.getImageData(0,ce,I,Se),Ne=$.getImageData(0,ce,I,Se);ne&&O(Le.data,ae,Z,se),oe(Le.data,Ne.data,J),U.putImageData(Ne,0,ce)}}function G(U,$,I,B){var X=$.canvas,Q=$.context;U.setTransform($.scaleX,0,0,$.scaleY,$.offsetX,$.offsetY);var J=$.backdrop||null;if(!$.transferMap&&B.isEnabled){const ne=B.composeSMask({layer:I.canvas,mask:X,properties:{subtype:$.subtype,backdrop:J}});U.setTransform(1,0,0,1,0,0),U.drawImage(ne,$.offsetX,$.offsetY);return}F(Q,I,X.width,X.height,$.subtype,J,$.transferMap),U.drawImage(X,0,0)}var V=["butt","round","square"],W=["miter","round","bevel"],ee={},q={};S.prototype={beginDrawing({transform:U,viewport:$,transparency:I=!1,background:B=null}){var X=this.ctx.canvas.width,Q=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=B||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,X,Q),this.ctx.restore(),I){var J=this.cachedCanvases.getCanvas("transparent",X,Q,!0);this.compositeCtx=this.ctx,this.transparentCanvas=J.canvas,this.ctx=J.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),P(this.ctx),U&&this.ctx.transform.apply(this.ctx,U),this.ctx.transform.apply(this.ctx,$.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function($,I,B,X){var Q=$.argsArray,J=$.fnArray,ne=I||0,ae=Q.length;if(ae===ne)return ne;for(var Z=ae-ne>R&&typeof B=="function",se=Z?Date.now()+C:0,oe=0,fe=this.commonObjs,de=this.objs,ce;;){if(X!==void 0&&ne===X.nextBreakPoint)return X.breakIt(ne,B),ne;if(ce=J[ne],ce!==t.OPS.dependency)this[ce].apply(this,Q[ne]);else for(const Se of Q[ne]){const Le=Se.startsWith("g_")?fe:de;if(!Le.has(Se))return Le.get(Se,B),ne}if(ne++,ne===ae)return ne;if(Z&&++oe>R){if(Date.now()>se)return B(),ne;oe=0}}},endDrawing:function(){this.current.activeSMask!==null&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function($){this.current.lineWidth=$,this.ctx.lineWidth=$},setLineCap:function($){this.ctx.lineCap=V[$]},setLineJoin:function($){this.ctx.lineJoin=W[$]},setMiterLimit:function($){this.ctx.miterLimit=$},setDash:function($,I){var B=this.ctx;B.setLineDash!==void 0&&(B.setLineDash($),B.lineDashOffset=I)},setRenderingIntent(U){},setFlatness(U){},setGState:function($){for(var I=0,B=$.length;I<B;I++){var X=$[I],Q=X[0],J=X[1];switch(Q){case"LW":this.setLineWidth(J);break;case"LC":this.setLineCap(J);break;case"LJ":this.setLineJoin(J);break;case"ML":this.setMiterLimit(J);break;case"D":this.setDash(J[0],J[1]);break;case"RI":this.setRenderingIntent(J);break;case"FL":this.setFlatness(J);break;case"Font":this.setFont(J[0],J[1]);break;case"CA":this.current.strokeAlpha=X[1];break;case"ca":this.current.fillAlpha=X[1],this.ctx.globalAlpha=X[1];break;case"BM":this.ctx.globalCompositeOperation=J;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=J?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break}}},beginSMaskGroup:function(){var $=this.current.activeSMask,I=$.canvas.width,B=$.canvas.height,X="smaskGroupAt"+this.groupLevel,Q=this.cachedCanvases.getCanvas(X,I,B,!0),J=this.ctx,ne=J.mozCurrentTransform;this.ctx.save();var ae=Q.context;ae.scale(1/$.scaleX,1/$.scaleY),ae.translate(-$.offsetX,-$.offsetY),ae.transform.apply(ae,ne),$.startTransformInverse=ae.mozCurrentTransformInverse,w(J,ae),this.ctx=ae,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(J),this.groupLevel++},suspendSMaskGroup:function(){var $=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),G(this.ctx,this.current.activeSMask,$,this.webGLContext),this.ctx.restore(),this.ctx.save(),w($,this.ctx),this.current.resumeSMaskCtx=$;var I=t.Util.transform(this.current.activeSMask.startTransformInverse,$.mozCurrentTransform);this.ctx.transform.apply(this.ctx,I),$.save(),$.setTransform(1,0,0,1,0,0),$.clearRect(0,0,$.canvas.width,$.canvas.height),$.restore()},resumeSMaskGroup:function(){var $=this.current.resumeSMaskCtx,I=this.ctx;this.ctx=$,this.groupStack.push(I),this.groupLevel++},endSMaskGroup:function(){var $=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),G(this.ctx,this.current.activeSMask,$,this.webGLContext),this.ctx.restore(),w($,this.ctx);var I=t.Util.transform(this.current.activeSMask.startTransformInverse,$.mozCurrentTransform);this.ctx.transform.apply(this.ctx,I)},save:function(){this.ctx.save();var $=this.current;this.stateStack.push($),this.current=$.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),this.current.activeSMask!==null&&(this.stateStack.length===0||this.stateStack[this.stateStack.length-1].activeSMask!==this.current.activeSMask)&&this.endSMaskGroup(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function($,I,B,X,Q,J){this.ctx.transform($,I,B,X,Q,J),this._cachedGetSinglePixelWidth=null},constructPath:function($,I){for(var B=this.ctx,X=this.current,Q=X.x,J=X.y,ne=0,ae=0,Z=$.length;ne<Z;ne++)switch($[ne]|0){case t.OPS.rectangle:Q=I[ae++],J=I[ae++];var se=I[ae++],oe=I[ae++];se===0&&(se=this.getSinglePixelWidth()),oe===0&&(oe=this.getSinglePixelWidth());var fe=Q+se,de=J+oe;this.ctx.moveTo(Q,J),this.ctx.lineTo(fe,J),this.ctx.lineTo(fe,de),this.ctx.lineTo(Q,de),this.ctx.lineTo(Q,J),this.ctx.closePath();break;case t.OPS.moveTo:Q=I[ae++],J=I[ae++],B.moveTo(Q,J);break;case t.OPS.lineTo:Q=I[ae++],J=I[ae++],B.lineTo(Q,J);break;case t.OPS.curveTo:Q=I[ae+4],J=I[ae+5],B.bezierCurveTo(I[ae],I[ae+1],I[ae+2],I[ae+3],Q,J),ae+=6;break;case t.OPS.curveTo2:B.bezierCurveTo(Q,J,I[ae],I[ae+1],I[ae+2],I[ae+3]),Q=I[ae+2],J=I[ae+3],ae+=4;break;case t.OPS.curveTo3:Q=I[ae+2],J=I[ae+3],B.bezierCurveTo(I[ae],I[ae+1],Q,J,Q,J),ae+=4;break;case t.OPS.closePath:B.closePath();break}X.setCurrentPoint(Q,J)},closePath:function(){this.ctx.closePath()},stroke:function($){$=typeof $<"u"?$:!0;var I=this.ctx,B=this.current.strokeColor;if(I.globalAlpha=this.current.strokeAlpha,B&&B.hasOwnProperty("type")&&B.type==="Pattern"){I.save();const X=I.mozCurrentTransform,Q=t.Util.singularValueDecompose2dScale(X)[0];I.strokeStyle=B.getPattern(I,this),I.lineWidth=Math.max(this.getSinglePixelWidth()*f,this.current.lineWidth*Q),I.stroke(),I.restore()}else I.lineWidth=Math.max(this.getSinglePixelWidth()*f,this.current.lineWidth),I.stroke();$&&this.consumePath(),I.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function($){$=typeof $<"u"?$:!0;var I=this.ctx,B=this.current.fillColor,X=this.current.patternFill,Q=!1;X&&(I.save(),this.baseTransform&&I.setTransform.apply(I,this.baseTransform),I.fillStyle=B.getPattern(I,this),Q=!0),this.pendingEOFill?(I.fill("evenodd"),this.pendingEOFill=!1):I.fill(),Q&&I.restore(),$&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=ee},eoClip:function(){this.pendingClip=q},beginText:function(){this.current.textMatrix=t.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var $=this.pendingTextPaths,I=this.ctx;if($===void 0){I.beginPath();return}I.save(),I.beginPath();for(var B=0;B<$.length;B++){var X=$[B];I.setTransform.apply(I,X.transform),I.translate(X.x,X.y),X.addToPath(I,X.fontSize)}I.restore(),I.clip(),I.beginPath(),delete this.pendingTextPaths},setCharSpacing:function($){this.current.charSpacing=$},setWordSpacing:function($){this.current.wordSpacing=$},setHScale:function($){this.current.textHScale=$/100},setLeading:function($){this.current.leading=-$},setFont:function($,I){var B=this.commonObjs.get($),X=this.current;if(!B)throw new Error(`Can't find font for ${$}`);if(X.fontMatrix=B.fontMatrix?B.fontMatrix:t.FONT_IDENTITY_MATRIX,(X.fontMatrix[0]===0||X.fontMatrix[3]===0)&&(0,t.warn)("Invalid font matrix for font "+$),I<0?(I=-I,X.fontDirection=-1):X.fontDirection=1,this.current.font=B,this.current.fontSize=I,B.isType3Font)return;var Q=B.loadedName||"sans-serif";let J="normal";B.black?J="900":B.bold&&(J="bold");var ne=B.italic?"italic":"normal",ae=`"${Q}", ${B.fallbackName}`;let Z=I;I<a?Z=a:I>l&&(Z=l),this.current.fontSizeScale=I/Z,this.ctx.font=`${ne} ${J} ${Z}px ${ae}`},setTextRenderingMode:function($){this.current.textRenderingMode=$},setTextRise:function($){this.current.textRise=$},moveText:function($,I){this.current.x=this.current.lineX+=$,this.current.y=this.current.lineY+=I},setLeadingMoveText:function($,I){this.setLeading(-I),this.moveText($,I)},setTextMatrix:function($,I,B,X,Q,J){this.current.textMatrix=[$,I,B,X,Q,J],this.current.textMatrixScale=Math.sqrt($*$+I*I),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(U,$,I,B){var X=this.ctx,Q=this.current,J=Q.font,ne=Q.textRenderingMode,ae=Q.fontSize/Q.fontSizeScale,Z=ne&t.TextRenderingMode.FILL_STROKE_MASK,se=!!(ne&t.TextRenderingMode.ADD_TO_PATH_FLAG);const oe=Q.patternFill&&!J.missingFile;var fe;if((J.disableFontFace||se||oe)&&(fe=J.getPathGenerator(this.commonObjs,U)),J.disableFontFace||oe?(X.save(),X.translate($,I),X.beginPath(),fe(X,ae),B&&X.setTransform.apply(X,B),(Z===t.TextRenderingMode.FILL||Z===t.TextRenderingMode.FILL_STROKE)&&X.fill(),(Z===t.TextRenderingMode.STROKE||Z===t.TextRenderingMode.FILL_STROKE)&&X.stroke(),X.restore()):((Z===t.TextRenderingMode.FILL||Z===t.TextRenderingMode.FILL_STROKE)&&X.fillText(U,$,I),(Z===t.TextRenderingMode.STROKE||Z===t.TextRenderingMode.FILL_STROKE)&&X.strokeText(U,$,I)),se){var de=this.pendingTextPaths||(this.pendingTextPaths=[]);de.push({transform:X.mozCurrentTransform,x:$,y:I,fontSize:ae,addToPath:fe})}},get isFontSubpixelAAEnabled(){const{context:U}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);U.scale(1.5,1),U.fillText("I",0,10);for(var $=U.getImageData(0,0,10,10).data,I=!1,B=3;B<$.length;B+=4)if($[B]>0&&$[B]<255){I=!0;break}return(0,t.shadow)(this,"isFontSubpixelAAEnabled",I)},showText:function($){var I=this.current,B=I.font;if(B.isType3Font)return this.showType3Text($);var X=I.fontSize;if(X===0)return;var Q=this.ctx,J=I.fontSizeScale,ne=I.charSpacing,ae=I.wordSpacing,Z=I.fontDirection,se=I.textHScale*Z,oe=$.length,fe=B.vertical,de=fe?1:-1,ce=B.defaultVMetrics,Se=X*I.fontMatrix[0],Le=I.textRenderingMode===t.TextRenderingMode.FILL&&!B.disableFontFace&&!I.patternFill;Q.save();let Ne;if(I.patternFill){Q.save();const Ee=I.fillColor.getPattern(Q,this);Ne=Q.mozCurrentTransform,Q.restore(),Q.fillStyle=Ee}Q.transform.apply(Q,I.textMatrix),Q.translate(I.x,I.y+I.textRise),Z>0?Q.scale(se,-1):Q.scale(se,1);var He=I.lineWidth,Ke=I.textMatrixScale;if(Ke===0||He===0){var Qe=I.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;(Qe===t.TextRenderingMode.STROKE||Qe===t.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,He=this.getSinglePixelWidth()*f)}else He/=Ke;J!==1&&(Q.scale(J,J),He/=J),Q.lineWidth=He;var dt=0,yt;for(yt=0;yt<oe;++yt){var ut=$[yt];if((0,t.isNum)(ut)){dt+=de*ut*X/1e3;continue}var ft=!1,Xt=(ut.isSpace?ae:0)+ne,kt=ut.fontChar,Ge=ut.accent,Ze,rt,qt,We,at=ut.width;if(fe){var pe,me,ye;pe=ut.vmetric||ce,me=ut.vmetric?pe[1]:at*.5,me=-me*Se,ye=pe[2]*Se,at=pe?-pe[0]:at,Ze=me/J,rt=(dt+ye)/J}else Ze=dt/J,rt=0;if(B.remeasure&&at>0){var De=Q.measureText(kt).width*1e3/X*J;if(at<De&&this.isFontSubpixelAAEnabled){var Be=at/De;ft=!0,Q.save(),Q.scale(Be,1),Ze/=Be}else at!==De&&(Ze+=(at-De)/2e3*X/J)}(ut.isInFont||B.missingFile)&&(Le&&!Ge?Q.fillText(kt,Ze,rt):(this.paintChar(kt,Ze,rt,Ne),Ge&&(qt=Ze+Ge.offset.x/J,We=rt-Ge.offset.y/J,this.paintChar(Ge.fontChar,qt,We,Ne))));var Ce;fe?Ce=at*Se-Xt*Z:Ce=at*Se+Xt*Z,dt+=Ce,ft&&Q.restore()}fe?I.y-=dt:I.x+=dt*se,Q.restore()},showType3Text:function($){var I=this.ctx,B=this.current,X=B.font,Q=B.fontSize,J=B.fontDirection,ne=X.vertical?1:-1,ae=B.charSpacing,Z=B.wordSpacing,se=B.textHScale*J,oe=B.fontMatrix||t.FONT_IDENTITY_MATRIX,fe=$.length,de=B.textRenderingMode===t.TextRenderingMode.INVISIBLE,ce,Se,Le,Ne;if(!(de||Q===0)){for(this._cachedGetSinglePixelWidth=null,I.save(),I.transform.apply(I,B.textMatrix),I.translate(B.x,B.y),I.scale(se,J),ce=0;ce<fe;++ce){if(Se=$[ce],(0,t.isNum)(Se)){Ne=ne*Se*Q/1e3,this.ctx.translate(Ne,0),B.x+=Ne*se;continue}var He=(Se.isSpace?Z:0)+ae,Ke=X.charProcOperatorList[Se.operatorListId];if(!Ke){(0,t.warn)(`Type3 character "${Se.operatorListId}" is not available.`);continue}this.processingType3=Se,this.save(),I.scale(Q,Q),I.transform.apply(I,oe),this.executeOperatorList(Ke),this.restore();var Qe=t.Util.applyTransform([Se.width,0],oe);Le=Qe[0]*Q+He,I.translate(Le,0),B.x+=Le*se}I.restore(),this.processingType3=null}},setCharWidth:function($,I){},setCharWidthAndBounds:function($,I,B,X,Q,J){this.ctx.rect(B,X,Q-B,J-X),this.clip(),this.endPath()},getColorN_Pattern:function($){var I;if($[0]==="TilingPattern"){var B=$[1],X=this.baseTransform||this.ctx.mozCurrentTransform.slice(),Q={createCanvasGraphics:J=>new S(J,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};I=new n.TilingPattern($,B,this.ctx,Q,X)}else I=(0,n.getShadingPatternFromIR)($);return I},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function($,I,B){var X=t.Util.makeCssRgb($,I,B);this.ctx.strokeStyle=X,this.current.strokeColor=X},setFillRGBColor:function($,I,B){var X=t.Util.makeCssRgb($,I,B);this.ctx.fillStyle=X,this.current.fillColor=X,this.current.patternFill=!1},shadingFill:function($){var I=this.ctx;this.save();var B=(0,n.getShadingPatternFromIR)($);I.fillStyle=B.getPattern(I,this,!0);var X=I.mozCurrentTransformInverse;if(X){var Q=I.canvas,J=Q.width,ne=Q.height,ae=t.Util.applyTransform([0,0],X),Z=t.Util.applyTransform([0,ne],X),se=t.Util.applyTransform([J,0],X),oe=t.Util.applyTransform([J,ne],X),fe=Math.min(ae[0],Z[0],se[0],oe[0]),de=Math.min(ae[1],Z[1],se[1],oe[1]),ce=Math.max(ae[0],Z[0],se[0],oe[0]),Se=Math.max(ae[1],Z[1],se[1],oe[1]);this.ctx.fillRect(fe,de,ce-fe,Se-de)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,t.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,t.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function($,I){if(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray($)&&$.length===6&&this.transform.apply(this,$),this.baseTransform=this.ctx.mozCurrentTransform,I){var B=I[2]-I[0],X=I[3]-I[1];this.ctx.rect(I[0],I[1],B,X),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function($){this.save();var I=this.ctx;$.isolated||(0,t.info)("TODO: Support non-isolated groups."),$.knockout&&(0,t.warn)("Knockout groups not supported.");var B=I.mozCurrentTransform;if($.matrix&&I.transform.apply(I,$.matrix),!$.bbox)throw new Error("Bounding box is required.");var X=t.Util.getAxialAlignedBoundingBox($.bbox,I.mozCurrentTransform),Q=[0,0,I.canvas.width,I.canvas.height];X=t.Util.intersect(X,Q)||[0,0,0,0];var J=Math.floor(X[0]),ne=Math.floor(X[1]),ae=Math.max(Math.ceil(X[2])-J,1),Z=Math.max(Math.ceil(X[3])-ne,1),se=1,oe=1;ae>u&&(se=ae/u,ae=u),Z>u&&(oe=Z/u,Z=u);var fe="groupAt"+this.groupLevel;$.smask&&(fe+="_smask_"+this.smaskCounter++%2);var de=this.cachedCanvases.getCanvas(fe,ae,Z,!0),ce=de.context;ce.scale(1/se,1/oe),ce.translate(-J,-ne),ce.transform.apply(ce,B),$.smask?this.smaskStack.push({canvas:de.canvas,context:ce,offsetX:J,offsetY:ne,scaleX:se,scaleY:oe,subtype:$.smask.subtype,backdrop:$.smask.backdrop,transferMap:$.smask.transferMap||null,startTransformInverse:null}):(I.setTransform(1,0,0,1,0,0),I.translate(J,ne),I.scale(se,oe)),w(I,ce),this.ctx=ce,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(I),this.groupLevel++,this.current.activeSMask=null},endGroup:function($){this.groupLevel--;var I=this.ctx;this.ctx=this.groupStack.pop(),this.ctx.imageSmoothingEnabled!==void 0?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,$.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(I.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function($,I,B){if(this.save(),P(this.ctx),this.current=new _,Array.isArray($)&&$.length===4){var X=$[2]-$[0],Q=$[3]-$[1];this.ctx.rect($[0],$[1],X,Q),this.clip(),this.endPath()}this.transform.apply(this,I),this.transform.apply(this,B)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function($){var I=this.ctx,B=$.width,X=$.height,Q=this.current.fillColor,J=this.current.patternFill,ne=this.processingType3;if(ne&&ne.compiled===void 0&&(B<=d&&X<=d?ne.compiled=p({data:$.data,width:B,height:X}):ne.compiled=null),ne&&ne.compiled){ne.compiled(I);return}var ae=this.cachedCanvases.getCanvas("maskCanvas",B,X),Z=ae.context;Z.save(),T(Z,$),Z.globalCompositeOperation="source-in",Z.fillStyle=J?Q.getPattern(Z,this):Q,Z.fillRect(0,0,B,X),Z.restore(),this.paintInlineImageXObject(ae.canvas)},paintImageMaskXObjectRepeat:function($,I,B,X){var Q=$.width,J=$.height,ne=this.current.fillColor,ae=this.current.patternFill,Z=this.cachedCanvases.getCanvas("maskCanvas",Q,J),se=Z.context;se.save(),T(se,$),se.globalCompositeOperation="source-in",se.fillStyle=ae?ne.getPattern(se,this):ne,se.fillRect(0,0,Q,J),se.restore();for(var oe=this.ctx,fe=0,de=X.length;fe<de;fe+=2)oe.save(),oe.transform(I,0,0,B,X[fe],X[fe+1]),oe.scale(1,-1),oe.drawImage(Z.canvas,0,0,Q,J,0,-1,1,1),oe.restore()},paintImageMaskXObjectGroup:function($){for(var I=this.ctx,B=this.current.fillColor,X=this.current.patternFill,Q=0,J=$.length;Q<J;Q++){var ne=$[Q],ae=ne.width,Z=ne.height,se=this.cachedCanvases.getCanvas("maskCanvas",ae,Z),oe=se.context;oe.save(),T(oe,ne),oe.globalCompositeOperation="source-in",oe.fillStyle=X?B.getPattern(oe,this):B,oe.fillRect(0,0,ae,Z),oe.restore(),I.save(),I.transform.apply(I,ne.transform),I.scale(1,-1),I.drawImage(se.canvas,0,0,ae,Z,0,-1,1,1),I.restore()}},paintImageXObject:function($){const I=$.startsWith("g_")?this.commonObjs.get($):this.objs.get($);if(!I){(0,t.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(I)},paintImageXObjectRepeat:function($,I,B,X){const Q=$.startsWith("g_")?this.commonObjs.get($):this.objs.get($);if(!Q){(0,t.warn)("Dependent image isn't ready yet");return}for(var J=Q.width,ne=Q.height,ae=[],Z=0,se=X.length;Z<se;Z+=2)ae.push({transform:[I,0,0,B,X[Z],X[Z+1]],x:0,y:0,w:J,h:ne});this.paintInlineImageXObjectGroup(Q,ae)},paintInlineImageXObject:function($){var I=$.width,B=$.height,X=this.ctx;this.save(),X.scale(1/I,-1/B);var Q=X.mozCurrentTransformInverse,J=Q[0],ne=Q[1],ae=Math.max(Math.sqrt(J*J+ne*ne),1),Z=Q[2],se=Q[3],oe=Math.max(Math.sqrt(Z*Z+se*se),1),fe,de;if(typeof HTMLElement=="function"&&$ instanceof HTMLElement||!$.data)fe=$;else{de=this.cachedCanvases.getCanvas("inlineImage",I,B);var ce=de.context;A(ce,$),fe=de.canvas}for(var Se=I,Le=B,Ne="prescale1";ae>2&&Se>1||oe>2&&Le>1;){var He=Se,Ke=Le;ae>2&&Se>1&&(He=Math.ceil(Se/2),ae/=Se/He),oe>2&&Le>1&&(Ke=Math.ceil(Le/2),oe/=Le/Ke),de=this.cachedCanvases.getCanvas(Ne,He,Ke),ce=de.context,ce.clearRect(0,0,He,Ke),ce.drawImage(fe,0,0,Se,Le,0,0,He,Ke),fe=de.canvas,Se=He,Le=Ke,Ne=Ne==="prescale1"?"prescale2":"prescale1"}if(X.drawImage(fe,0,0,Se,Le,0,-B,I,B),this.imageLayer){var Qe=this.getCanvasPosition(0,-B);this.imageLayer.appendImage({imgData:$,left:Qe[0],top:Qe[1],width:I/Q[0],height:B/Q[3]})}this.restore()},paintInlineImageXObjectGroup:function($,I){var B=this.ctx,X=$.width,Q=$.height,J=this.cachedCanvases.getCanvas("inlineImage",X,Q),ne=J.context;A(ne,$);for(var ae=0,Z=I.length;ae<Z;ae++){var se=I[ae];if(B.save(),B.transform.apply(B,se.transform),B.scale(1,-1),B.drawImage(J.canvas,se.x,se.y,se.w,se.h,0,-1,1,1),this.imageLayer){var oe=this.getCanvasPosition(se.x,se.y);this.imageLayer.appendImage({imgData:$,left:oe[0],top:oe[1],width:X,height:Q})}B.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},paintXObject:function(){(0,t.warn)("Unsupported 'paintXObject' command.")},markPoint:function($){},markPointProps:function($,I){},beginMarkedContent:function($){},beginMarkedContentProps:function($,I){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var $=this.ctx;this.pendingClip&&(this.pendingClip===q?$.clip("evenodd"):$.clip(),this.pendingClip=null),$.beginPath()},getSinglePixelWidth(U){if(this._cachedGetSinglePixelWidth===null){const $=this.ctx.mozCurrentTransformInverse;this._cachedGetSinglePixelWidth=Math.sqrt(Math.max($[0]*$[0]+$[1]*$[1],$[2]*$[2]+$[3]*$[3]))}return this._cachedGetSinglePixelWidth},getCanvasPosition:function($,I){var B=this.ctx.mozCurrentTransform;return[B[0]*$+B[2]*I+B[4],B[1]*$+B[3]*I+B[5]]}};for(var z in t.OPS)S.prototype[t.OPS[z]]=S.prototype[z];return S}();e.CanvasGraphics=g},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.getShadingPatternFromIR=u,e.TilingPattern=void 0;var t=r(2),n={};function a(d,h){if(!h||typeof Path2D>"u")return;const y=h[2]-h[0],E=h[3]-h[1],p=new Path2D;p.rect(h[0],h[1],y,E),d.clip(p)}n.RadialAxial={fromIR:function(h){var y=h[1],E=h[2],p=h[3],_=h[4],g=h[5],x=h[6],C=h[7];return{type:"Pattern",getPattern:function(S){a(S,E);var A;y==="axial"?A=S.createLinearGradient(_[0],_[1],g[0],g[1]):y==="radial"&&(A=S.createRadialGradient(_[0],_[1],x,g[0],g[1],C));for(var T=0,w=p.length;T<w;++T){var P=p[T];A.addColorStop(P[0],P[1])}return A}}}};var l=function(){function h(p,_,g,x,C,R,S,A){var T=_.coords,w=_.colors,P=p.data,O=p.width*4,k;T[g+1]>T[x+1]&&(k=g,g=x,x=k,k=R,R=S,S=k),T[x+1]>T[C+1]&&(k=x,x=C,C=k,k=S,S=A,A=k),T[g+1]>T[x+1]&&(k=g,g=x,x=k,k=R,R=S,S=k);var D=(T[g]+_.offsetX)*_.scaleX,F=(T[g+1]+_.offsetY)*_.scaleY,G=(T[x]+_.offsetX)*_.scaleX,V=(T[x+1]+_.offsetY)*_.scaleY,W=(T[C]+_.offsetX)*_.scaleX,ee=(T[C+1]+_.offsetY)*_.scaleY;if(!(F>=ee))for(var q=w[R],z=w[R+1],U=w[R+2],$=w[S],I=w[S+1],B=w[S+2],X=w[A],Q=w[A+1],J=w[A+2],ne=Math.round(F),ae=Math.round(ee),Z,se,oe,fe,de,ce,Se,Le,Ne=ne;Ne<=ae;Ne++){if(Ne<V){let ut;Ne<F?ut=0:F===V?ut=1:ut=(F-Ne)/(F-V),Z=D-(D-G)*ut,se=q-(q-$)*ut,oe=z-(z-I)*ut,fe=U-(U-B)*ut}else{let ut;Ne>ee?ut=1:V===ee?ut=0:ut=(V-Ne)/(V-ee),Z=G-(G-W)*ut,se=$-($-X)*ut,oe=I-(I-Q)*ut,fe=B-(B-J)*ut}let yt;Ne<F?yt=0:Ne>ee?yt=1:yt=(F-Ne)/(F-ee),de=D-(D-W)*yt,ce=q-(q-X)*yt,Se=z-(z-Q)*yt,Le=U-(U-J)*yt;for(var He=Math.round(Math.min(Z,de)),Ke=Math.round(Math.max(Z,de)),Qe=O*Ne+He*4,dt=He;dt<=Ke;dt++)yt=(Z-dt)/(Z-de),yt<0?yt=0:yt>1&&(yt=1),P[Qe++]=se-(se-ce)*yt|0,P[Qe++]=oe-(oe-Se)*yt|0,P[Qe++]=fe-(fe-Le)*yt|0,P[Qe++]=255}}function y(p,_,g){var x=_.coords,C=_.colors,R,S;switch(_.type){case"lattice":var A=_.verticesPerRow,T=Math.floor(x.length/A)-1,w=A-1;for(R=0;R<T;R++)for(var P=R*A,O=0;O<w;O++,P++)h(p,g,x[P],x[P+1],x[P+A],C[P],C[P+1],C[P+A]),h(p,g,x[P+A+1],x[P+1],x[P+A],C[P+A+1],C[P+1],C[P+A]);break;case"triangles":for(R=0,S=x.length;R<S;R+=3)h(p,g,x[R],x[R+1],x[R+2],C[R],C[R+1],C[R+2]);break;default:throw new Error("illegal figure")}}function E(p,_,g,x,C,R,S,A){var T=1.1,w=3e3,P=2,O=Math.floor(p[0]),k=Math.floor(p[1]),D=Math.ceil(p[2])-O,F=Math.ceil(p[3])-k,G=Math.min(Math.ceil(Math.abs(D*_[0]*T)),w),V=Math.min(Math.ceil(Math.abs(F*_[1]*T)),w),W=D/G,ee=F/V,q={coords:g,colors:x,offsetX:-O,offsetY:-k,scaleX:1/W,scaleY:1/ee},z=G+P*2,U=V+P*2,$,I,B,X;if(A.isEnabled)$=A.drawFigures({width:G,height:V,backgroundColor:R,figures:C,context:q}),I=S.getCanvas("mesh",z,U,!1),I.context.drawImage($,P,P),$=I.canvas;else{I=S.getCanvas("mesh",z,U,!1);var Q=I.context,J=Q.createImageData(G,V);if(R){var ne=J.data;for(B=0,X=ne.length;B<X;B+=4)ne[B]=R[0],ne[B+1]=R[1],ne[B+2]=R[2],ne[B+3]=255}for(B=0;B<C.length;B++)y(J,C[B],q);Q.putImageData(J,P,P),$=I.canvas}return{canvas:$,offsetX:O-P*W,offsetY:k-P*ee,scaleX:W,scaleY:ee}}return E}();n.Mesh={fromIR:function(h){var y=h[2],E=h[3],p=h[4],_=h[5],g=h[6],x=h[7],C=h[8];return{type:"Pattern",getPattern:function(S,A,T){a(S,x);var w;if(T)w=t.Util.singularValueDecompose2dScale(S.mozCurrentTransform);else if(w=t.Util.singularValueDecompose2dScale(A.baseTransform),g){var P=t.Util.singularValueDecompose2dScale(g);w=[w[0]*P[0],w[1]*P[1]]}var O=l(_,w,y,E,p,T?null:C,A.cachedCanvases,A.webGLContext);return T||(S.setTransform.apply(S,A.baseTransform),g&&S.transform.apply(S,g)),S.translate(O.offsetX,O.offsetY),S.scale(O.scaleX,O.scaleY),S.createPattern(O.canvas,"no-repeat")}}}},n.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};function u(d){var h=n[d[0]];if(!h)throw new Error(`Unknown IR type: ${d[0]}`);return h.fromIR(d)}var f=function(){var h={COLORED:1,UNCOLORED:2},y=3e3;function E(p,_,g,x,C){this.operatorList=p[2],this.matrix=p[3]||[1,0,0,1,0,0],this.bbox=p[4],this.xstep=p[5],this.ystep=p[6],this.paintType=p[7],this.tilingType=p[8],this.color=_,this.canvasGraphicsFactory=x,this.baseTransform=C,this.type="Pattern",this.ctx=g}return E.prototype={createPatternCanvas:function(_){var g=this.operatorList,x=this.bbox,C=this.xstep,R=this.ystep,S=this.paintType,A=this.tilingType,T=this.color,w=this.canvasGraphicsFactory;(0,t.info)("TilingType: "+A);var P=x[0],O=x[1],k=x[2],D=x[3],F=t.Util.singularValueDecompose2dScale(this.matrix),G=t.Util.singularValueDecompose2dScale(this.baseTransform),V=[F[0]*G[0],F[1]*G[1]],W=this.getSizeAndScale(C,this.ctx.canvas.width,V[0]),ee=this.getSizeAndScale(R,this.ctx.canvas.height,V[1]),q=_.cachedCanvases.getCanvas("pattern",W.size,ee.size,!0),z=q.context,U=w.createCanvasGraphics(z);return U.groupLevel=_.groupLevel,this.setFillAndStrokeStyleToContext(U,S,T),U.transform(W.scale,0,0,ee.scale,0,0),U.transform(1,0,0,1,-P,-O),this.clipBbox(U,x,P,O,k,D),U.executeOperatorList(g),this.ctx.transform(1,0,0,1,P,O),this.ctx.scale(1/W.scale,1/ee.scale),q.canvas},getSizeAndScale:function(_,g,x){_=Math.abs(_);var C=Math.max(y,g),R=Math.ceil(_*x);return R>=C?R=C:x=R/_,{scale:x,size:R}},clipBbox:function(_,g,x,C,R,S){if(Array.isArray(g)&&g.length===4){var A=R-x,T=S-C;_.ctx.rect(x,C,A,T),_.clip(),_.endPath()}},setFillAndStrokeStyleToContext:function(_,g,x){const C=_.ctx,R=_.current;switch(g){case h.COLORED:var S=this.ctx;C.fillStyle=S.fillStyle,C.strokeStyle=S.strokeStyle,R.fillColor=S.fillStyle,R.strokeColor=S.strokeStyle;break;case h.UNCOLORED:var A=t.Util.makeCssRgb(x[0],x[1],x[2]);C.fillStyle=A,C.strokeStyle=A,R.fillColor=A,R.strokeColor=A;break;default:throw new t.FormatError(`Unsupported paint type: ${g}`)}},getPattern:function(_,g){_=this.ctx,_.setTransform.apply(_,this.baseTransform),_.transform.apply(_,this.matrix);var x=this.createPatternCanvas(g);return _.createPattern(x,"repeat")}},E}();e.TilingPattern=f},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const t=Object.create(null);e.GlobalWorkerOptions=t,t.workerPort=t.workerPort===void 0?null:t.workerPort,t.workerSrc=t.workerSrc===void 0?"":t.workerSrc},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var t=r(2);const n={UNKNOWN:0,DATA:1,ERROR:2},a={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function l(f){if(typeof f!="object"||f===null)return f;switch(f.name){case"AbortException":return new t.AbortException(f.message);case"MissingPDFException":return new t.MissingPDFException(f.message);case"UnexpectedResponseException":return new t.UnexpectedResponseException(f.message,f.status);case"UnknownErrorException":return new t.UnknownErrorException(f.message,f.details);default:return new t.UnknownErrorException(f.message,f.toString())}}class u{constructor(d,h,y){this.sourceName=d,this.targetName=h,this.comObj=y,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=E=>{const p=E.data;if(p.targetName!==this.sourceName)return;if(p.stream){this._processStreamMessage(p);return}if(p.callback){const g=p.callbackId,x=this.callbackCapabilities[g];if(!x)throw new Error(`Cannot resolve callback ${g}`);if(delete this.callbackCapabilities[g],p.callback===n.DATA)x.resolve(p.data);else if(p.callback===n.ERROR)x.reject(l(p.reason));else throw new Error("Unexpected callback case");return}const _=this.actionHandler[p.action];if(!_)throw new Error(`Unknown action from worker: ${p.action}`);if(p.callbackId){const g=this.sourceName,x=p.sourceName;new Promise(function(C){C(_(p.data))}).then(function(C){y.postMessage({sourceName:g,targetName:x,callback:n.DATA,callbackId:p.callbackId,data:C})},function(C){y.postMessage({sourceName:g,targetName:x,callback:n.ERROR,callbackId:p.callbackId,reason:l(C)})});return}if(p.streamId){this._createStreamSink(p);return}_(p.data)},y.addEventListener("message",this._onComObjOnMessage)}on(d,h){const y=this.actionHandler;if(y[d])throw new Error(`There is already an actionName called "${d}"`);y[d]=h}send(d,h,y){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:d,data:h},y)}sendWithPromise(d,h,y){const E=this.callbackId++,p=(0,t.createPromiseCapability)();this.callbackCapabilities[E]=p;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:d,callbackId:E,data:h},y)}catch(_){p.reject(_)}return p.promise}sendWithStream(d,h,y,E){const p=this.streamId++,_=this.sourceName,g=this.targetName,x=this.comObj;return new ReadableStream({start:C=>{const R=(0,t.createPromiseCapability)();return this.streamControllers[p]={controller:C,startCall:R,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:_,targetName:g,action:d,streamId:p,data:h,desiredSize:C.desiredSize},E),R.promise},pull:C=>{const R=(0,t.createPromiseCapability)();return this.streamControllers[p].pullCall=R,x.postMessage({sourceName:_,targetName:g,stream:a.PULL,streamId:p,desiredSize:C.desiredSize}),R.promise},cancel:C=>{(0,t.assert)(C instanceof Error,"cancel must have a valid reason");const R=(0,t.createPromiseCapability)();return this.streamControllers[p].cancelCall=R,this.streamControllers[p].isClosed=!0,x.postMessage({sourceName:_,targetName:g,stream:a.CANCEL,streamId:p,reason:l(C)}),R.promise}},y)}_createStreamSink(d){const h=this,y=this.actionHandler[d.action],E=d.streamId,p=this.sourceName,_=d.sourceName,g=this.comObj,x={enqueue(C,R=1,S){if(this.isCancelled)return;const A=this.desiredSize;this.desiredSize-=R,A>0&&this.desiredSize<=0&&(this.sinkCapability=(0,t.createPromiseCapability)(),this.ready=this.sinkCapability.promise),h._postMessage({sourceName:p,targetName:_,stream:a.ENQUEUE,streamId:E,chunk:C},S)},close(){this.isCancelled||(this.isCancelled=!0,g.postMessage({sourceName:p,targetName:_,stream:a.CLOSE,streamId:E}),delete h.streamSinks[E])},error(C){(0,t.assert)(C instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,g.postMessage({sourceName:p,targetName:_,stream:a.ERROR,streamId:E,reason:l(C)}))},sinkCapability:(0,t.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:d.desiredSize,ready:null};x.sinkCapability.resolve(),x.ready=x.sinkCapability.promise,this.streamSinks[E]=x,new Promise(function(C){C(y(d.data,x))}).then(function(){g.postMessage({sourceName:p,targetName:_,stream:a.START_COMPLETE,streamId:E,success:!0})},function(C){g.postMessage({sourceName:p,targetName:_,stream:a.START_COMPLETE,streamId:E,reason:l(C)})})}_processStreamMessage(d){const h=d.streamId,y=this.sourceName,E=d.sourceName,p=this.comObj;switch(d.stream){case a.START_COMPLETE:d.success?this.streamControllers[h].startCall.resolve():this.streamControllers[h].startCall.reject(l(d.reason));break;case a.PULL_COMPLETE:d.success?this.streamControllers[h].pullCall.resolve():this.streamControllers[h].pullCall.reject(l(d.reason));break;case a.PULL:if(!this.streamSinks[h]){p.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,success:!0});break}this.streamSinks[h].desiredSize<=0&&d.desiredSize>0&&this.streamSinks[h].sinkCapability.resolve(),this.streamSinks[h].desiredSize=d.desiredSize;const{onPull:_}=this.streamSinks[d.streamId];new Promise(function(x){x(_&&_())}).then(function(){p.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,success:!0})},function(x){p.postMessage({sourceName:y,targetName:E,stream:a.PULL_COMPLETE,streamId:h,reason:l(x)})});break;case a.ENQUEUE:if((0,t.assert)(this.streamControllers[h],"enqueue should have stream controller"),this.streamControllers[h].isClosed)break;this.streamControllers[h].controller.enqueue(d.chunk);break;case a.CLOSE:if((0,t.assert)(this.streamControllers[h],"close should have stream controller"),this.streamControllers[h].isClosed)break;this.streamControllers[h].isClosed=!0,this.streamControllers[h].controller.close(),this._deleteStreamController(h);break;case a.ERROR:(0,t.assert)(this.streamControllers[h],"error should have stream controller"),this.streamControllers[h].controller.error(l(d.reason)),this._deleteStreamController(h);break;case a.CANCEL_COMPLETE:d.success?this.streamControllers[h].cancelCall.resolve():this.streamControllers[h].cancelCall.reject(l(d.reason)),this._deleteStreamController(h);break;case a.CANCEL:if(!this.streamSinks[h])break;const{onCancel:g}=this.streamSinks[d.streamId];new Promise(function(x){x(g&&g(l(d.reason)))}).then(function(){p.postMessage({sourceName:y,targetName:E,stream:a.CANCEL_COMPLETE,streamId:h,success:!0})},function(x){p.postMessage({sourceName:y,targetName:E,stream:a.CANCEL_COMPLETE,streamId:h,reason:l(x)})}),this.streamSinks[h].sinkCapability.reject(l(d.reason)),this.streamSinks[h].isCancelled=!0,delete this.streamSinks[h];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(d){await Promise.allSettled([this.streamControllers[d].startCall,this.streamControllers[d].pullCall,this.streamControllers[d].cancelCall].map(function(h){return h&&h.promise})),delete this.streamControllers[d]}_postMessage(d,h){h&&this.postMessageTransfers?this.comObj.postMessage(d,h):this.comObj.postMessage(d)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}e.MessageHandler=u},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var t=r(2),n=r(13);class a{constructor(u){(0,t.assert)(typeof u=="string","Metadata: input is not a string"),u=this._repair(u);const d=new n.SimpleXMLParser().parseFromString(u);this._metadataMap=new Map,d&&this._parse(d)}_repair(u){return u.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,function(f,d){const h=d.replace(/\\([0-3])([0-7])([0-7])/g,function(E,p,_,g){return String.fromCharCode(p*64+_*8+g*1)}).replace(/&(amp|apos|gt|lt|quot);/g,function(E,p){switch(p){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${p} isn't defined.`)});let y="";for(let E=0,p=h.length;E<p;E+=2){const _=h.charCodeAt(E)*256+h.charCodeAt(E+1);_>=32&&_<127&&_!==60&&_!==62&&_!==38?y+=String.fromCharCode(_):y+="&#x"+(65536+_).toString(16).substring(1)+";"}return">"+y})}_parse(u){let f=u.documentElement;if(f.nodeName.toLowerCase()!=="rdf:rdf")for(f=f.firstChild;f&&f.nodeName.toLowerCase()!=="rdf:rdf";)f=f.nextSibling;const d=f?f.nodeName.toLowerCase():null;if(!f||d!=="rdf:rdf"||!f.hasChildNodes())return;const h=f.childNodes;for(let y=0,E=h.length;y<E;y++){const p=h[y];if(p.nodeName.toLowerCase()==="rdf:description"){for(let _=0,g=p.childNodes.length;_<g;_++)if(p.childNodes[_].nodeName.toLowerCase()!=="#text"){const x=p.childNodes[_],C=x.nodeName.toLowerCase();this._metadataMap.set(C,x.textContent.trim())}}}}get(u){return this._metadataMap.has(u)?this._metadataMap.get(u):null}getAll(){const u=Object.create(null);for(const[f,d]of this._metadataMap)u[f]=d;return u}has(u){return this._metadataMap.has(u)}}e.Metadata=a},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleXMLParser=void 0;const t={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};function n(d,h){const y=d[h];return y===" "||y===`
30
+ `||y==="\r"||y===" "}function a(d){for(let h=0,y=d.length;h<y;h++)if(!n(d,h))return!1;return!0}class l{_resolveEntities(h){return h.replace(/&([^;]+);/g,(y,E)=>{if(E.substring(0,2)==="#x")return String.fromCharCode(parseInt(E.substring(2),16));if(E.substring(0,1)==="#")return String.fromCharCode(parseInt(E.substring(1),10));switch(E){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(E)})}_parseContent(h,y){const E=[];let p=y;function _(){for(;p<h.length&&n(h,p);)++p}for(;p<h.length&&!n(h,p)&&h[p]!==">"&&h[p]!=="/";)++p;const g=h.substring(y,p);for(_();p<h.length&&h[p]!==">"&&h[p]!=="/"&&h[p]!=="?";){_();let x="",C="";for(;p<h.length&&!n(h,p)&&h[p]!=="=";)x+=h[p],++p;if(_(),h[p]!=="=")return null;++p,_();const R=h[p];if(R!=='"'&&R!=="'")return null;const S=h.indexOf(R,++p);if(S<0)return null;C=h.substring(p,S),E.push({name:x,value:this._resolveEntities(C)}),p=S+1,_()}return{name:g,attributes:E,parsed:p-y}}_parseProcessingInstruction(h,y){let E=y;function p(){for(;E<h.length&&n(h,E);)++E}for(;E<h.length&&!n(h,E)&&h[E]!==">"&&h[E]!=="/";)++E;const _=h.substring(y,E);p();const g=E;for(;E<h.length&&(h[E]!=="?"||h[E+1]!==">");)++E;const x=h.substring(g,E);return{name:_,value:x,parsed:E-y}}parseXml(h){let y=0;for(;y<h.length;){const E=h[y];let p=y;if(E==="<"){++p;const _=h[p];let g;switch(_){case"/":if(++p,g=h.indexOf(">",p),g<0){this.onError(t.UnterminatedElement);return}this.onEndElement(h.substring(p,g)),p=g+1;break;case"?":++p;const x=this._parseProcessingInstruction(h,p);if(h.substring(p+x.parsed,p+x.parsed+2)!=="?>"){this.onError(t.UnterminatedXmlDeclaration);return}this.onPi(x.name,x.value),p+=x.parsed+2;break;case"!":if(h.substring(p+1,p+3)==="--"){if(g=h.indexOf("-->",p+3),g<0){this.onError(t.UnterminatedComment);return}this.onComment(h.substring(p+3,g)),p=g+3}else if(h.substring(p+1,p+8)==="[CDATA["){if(g=h.indexOf("]]>",p+8),g<0){this.onError(t.UnterminatedCdat);return}this.onCdata(h.substring(p+8,g)),p=g+3}else if(h.substring(p+1,p+8)==="DOCTYPE"){const S=h.indexOf("[",p+8);let A=!1;if(g=h.indexOf(">",p+8),g<0){this.onError(t.UnterminatedDoctypeDeclaration);return}if(S>0&&g>S){if(g=h.indexOf("]>",p+8),g<0){this.onError(t.UnterminatedDoctypeDeclaration);return}A=!0}const T=h.substring(p+8,g+(A?1:0));this.onDoctype(T),p=g+(A?2:1)}else{this.onError(t.MalformedElement);return}break;default:const C=this._parseContent(h,p);if(C===null){this.onError(t.MalformedElement);return}let R=!1;if(h.substring(p+C.parsed,p+C.parsed+2)==="/>")R=!0;else if(h.substring(p+C.parsed,p+C.parsed+1)!==">"){this.onError(t.UnterminatedElement);return}this.onBeginElement(C.name,C.attributes,R),p+=C.parsed+(R?2:1);break}}else{for(;p<h.length&&h[p]!=="<";)p++;const _=h.substring(y,p);this.onText(this._resolveEntities(_))}y=p}}onResolveEntity(h){return`&${h};`}onPi(h,y){}onComment(h){}onCdata(h){}onDoctype(h){}onText(h){}onBeginElement(h,y,E){}onEndElement(h){}onError(h){}}class u{constructor(h,y){this.nodeName=h,this.nodeValue=y,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const h=this.parentNode.childNodes;if(!h)return;const y=h.indexOf(this);if(y!==-1)return h[y+1]}get textContent(){return this.childNodes?this.childNodes.map(function(h){return h.textContent}).join(""):this.nodeValue||""}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}}class f extends l{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=t.NoError}parseFromString(h){if(this._currentFragment=[],this._stack=[],this._errorCode=t.NoError,this.parseXml(h),this._errorCode!==t.NoError)return;const[y]=this._currentFragment;if(y)return{documentElement:y}}onResolveEntity(h){switch(h){case"apos":return"'"}return super.onResolveEntity(h)}onText(h){if(a(h))return;const y=new u("#text",h);this._currentFragment.push(y)}onCdata(h){const y=new u("#text",h);this._currentFragment.push(y)}onBeginElement(h,y,E){const p=new u(h);p.childNodes=[],this._currentFragment.push(p),!E&&(this._stack.push(this._currentFragment),this._currentFragment=p.childNodes)}onEndElement(h){this._currentFragment=this._stack.pop()||[];const y=this._currentFragment[this._currentFragment.length-1];if(y)for(let E=0,p=y.childNodes.length;E<p;E++)y.childNodes[E].parentNode=y}onError(h){this._errorCode=h}}e.SimpleXMLParser=f},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var t=r(2);class n{constructor(f,d){(0,t.assert)(d,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=f.progressiveDone||!1;const h=f.initialData;if(h&&h.length>0){const y=new Uint8Array(h).buffer;this._queuedChunks.push(y)}this._pdfDataRangeTransport=d,this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._contentLength=f.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((y,E)=>{this._onReceiveData({begin:y,chunk:E})}),this._pdfDataRangeTransport.addProgressListener((y,E)=>{this._onProgress({loaded:y,total:E})}),this._pdfDataRangeTransport.addProgressiveReadListener(y=>{this._onReceiveData({chunk:y})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(f){const d=new Uint8Array(f.chunk).buffer;if(f.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(d):this._queuedChunks.push(d);else{const h=this._rangeReaders.some(function(y){return y._begin!==f.begin?!1:(y._enqueue(d),!0)});(0,t.assert)(h,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(f){if(f.total===void 0){const d=this._rangeReaders[0];d&&d.onProgress&&d.onProgress({loaded:f.loaded})}else{const d=this._fullRequestReader;d&&d.onProgress&&d.onProgress({loaded:f.loaded,total:f.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(f){const d=this._rangeReaders.indexOf(f);d>=0&&this._rangeReaders.splice(d,1)}getFullReader(){(0,t.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const f=this._queuedChunks;return this._queuedChunks=null,new a(this,f,this._progressiveDone)}getRangeReader(f,d){if(d<=this._progressiveDataLength)return null;const h=new l(this,f,d);return this._pdfDataRangeTransport.requestDataRange(f,d),this._rangeReaders.push(h),h}cancelAllRequests(f){this._fullRequestReader&&this._fullRequestReader.cancel(f),this._rangeReaders.slice(0).forEach(function(h){h.cancel(f)}),this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=n;class a{constructor(f,d,h=!1){this._stream=f,this._done=h||!1,this._filename=null,this._queuedChunks=d||[],this._loaded=0;for(const y of this._queuedChunks)this._loaded+=y.byteLength;this._requests=[],this._headersReady=Promise.resolve(),f._fullRequestReader=this,this.onProgress=null}_enqueue(f){this._done||(this._requests.length>0?this._requests.shift().resolve({value:f,done:!1}):this._queuedChunks.push(f),this._loaded+=f.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const f=(0,t.createPromiseCapability)();return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._requests.forEach(function(d){d.resolve({value:void 0,done:!0})}),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class l{constructor(f,d,h){this._stream=f,this._begin=d,this._end=h,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(f){this._done||(this._requests.length===0?this._queuedChunk=f:(this._requests.shift().resolve({value:f,done:!1}),this._requests.forEach(function(h){h.resolve({value:void 0,done:!0})}),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const d=this._queuedChunk;return this._queuedChunk=null,{value:d,done:!1}}if(this._done)return{value:void 0,done:!0};const f=(0,t.createPromiseCapability)();return this._requests.push(f),f.promise}cancel(f){this._done=!0,this._requests.forEach(function(d){d.resolve({value:void 0,done:!0})}),this._requests=[],this._stream._removeRangeReader(this)}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=void 0;var t=r(2);class n{constructor({enable:u=!1}){this._enabled=u===!0}get isEnabled(){let u=this._enabled;return u&&(u=a.tryInitGL()),(0,t.shadow)(this,"isEnabled",u)}composeSMask({layer:u,mask:f,properties:d}){return a.composeSMask(u,f,d)}drawFigures({width:u,height:f,backgroundColor:d,figures:h,context:y}){return a.drawFigures(u,f,d,h,y)}clear(){a.cleanup()}}e.WebGLContext=n;var a=function(){function u(k,D,F){var G=k.createShader(F);k.shaderSource(G,D),k.compileShader(G);var V=k.getShaderParameter(G,k.COMPILE_STATUS);if(!V){var W=k.getShaderInfoLog(G);throw new Error("Error during shader compilation: "+W)}return G}function f(k,D){return u(k,D,k.VERTEX_SHADER)}function d(k,D){return u(k,D,k.FRAGMENT_SHADER)}function h(k,D){for(var F=k.createProgram(),G=0,V=D.length;G<V;++G)k.attachShader(F,D[G]);k.linkProgram(F);var W=k.getProgramParameter(F,k.LINK_STATUS);if(!W){var ee=k.getProgramInfoLog(F);throw new Error("Error during program linking: "+ee)}return F}function y(k,D,F){k.activeTexture(F);var G=k.createTexture();return k.bindTexture(k.TEXTURE_2D,G),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,D),G}var E,p;function _(){E||(p=document.createElement("canvas"),E=p.getContext("webgl",{premultipliedalpha:!1}))}var g=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",x=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",C=null;function R(){var k,D;_(),k=p,p=null,D=E,E=null;var F=f(D,g),G=d(D,x),V=h(D,[F,G]);D.useProgram(V);var W={};W.gl=D,W.canvas=k,W.resolutionLocation=D.getUniformLocation(V,"u_resolution"),W.positionLocation=D.getAttribLocation(V,"a_position"),W.backdropLocation=D.getUniformLocation(V,"u_backdrop"),W.subtypeLocation=D.getUniformLocation(V,"u_subtype");var ee=D.getAttribLocation(V,"a_texCoord"),q=D.getUniformLocation(V,"u_image"),z=D.getUniformLocation(V,"u_mask"),U=D.createBuffer();D.bindBuffer(D.ARRAY_BUFFER,U),D.bufferData(D.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),D.STATIC_DRAW),D.enableVertexAttribArray(ee),D.vertexAttribPointer(ee,2,D.FLOAT,!1,0,0),D.uniform1i(q,0),D.uniform1i(z,1),C=W}function S(k,D,F){var G=k.width,V=k.height;C||R();var W=C,ee=W.canvas,q=W.gl;ee.width=G,ee.height=V,q.viewport(0,0,q.drawingBufferWidth,q.drawingBufferHeight),q.uniform2f(W.resolutionLocation,G,V),F.backdrop?q.uniform4f(W.resolutionLocation,F.backdrop[0],F.backdrop[1],F.backdrop[2],1):q.uniform4f(W.resolutionLocation,0,0,0,0),q.uniform1i(W.subtypeLocation,F.subtype==="Luminosity"?1:0);var z=y(q,k,q.TEXTURE0),U=y(q,D,q.TEXTURE1),$=q.createBuffer();return q.bindBuffer(q.ARRAY_BUFFER,$),q.bufferData(q.ARRAY_BUFFER,new Float32Array([0,0,G,0,0,V,0,V,G,0,G,V]),q.STATIC_DRAW),q.enableVertexAttribArray(W.positionLocation),q.vertexAttribPointer(W.positionLocation,2,q.FLOAT,!1,0,0),q.clearColor(0,0,0,0),q.enable(q.BLEND),q.blendFunc(q.ONE,q.ONE_MINUS_SRC_ALPHA),q.clear(q.COLOR_BUFFER_BIT),q.drawArrays(q.TRIANGLES,0,6),q.flush(),q.deleteTexture(z),q.deleteTexture(U),q.deleteBuffer($),ee}var A=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",T=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",w=null;function P(){var k,D;_(),k=p,p=null,D=E,E=null;var F=f(D,A),G=d(D,T),V=h(D,[F,G]);D.useProgram(V);var W={};W.gl=D,W.canvas=k,W.resolutionLocation=D.getUniformLocation(V,"u_resolution"),W.scaleLocation=D.getUniformLocation(V,"u_scale"),W.offsetLocation=D.getUniformLocation(V,"u_offset"),W.positionLocation=D.getAttribLocation(V,"a_position"),W.colorLocation=D.getAttribLocation(V,"a_color"),w=W}function O(k,D,F,G,V){w||P();var W=w,ee=W.canvas,q=W.gl;ee.width=k,ee.height=D,q.viewport(0,0,q.drawingBufferWidth,q.drawingBufferHeight),q.uniform2f(W.resolutionLocation,k,D);var z=0,U,$,I;for(U=0,$=G.length;U<$;U++)switch(G[U].type){case"lattice":I=G[U].coords.length/G[U].verticesPerRow|0,z+=(I-1)*(G[U].verticesPerRow-1)*6;break;case"triangles":z+=G[U].coords.length;break}var B=new Float32Array(z*2),X=new Uint8Array(z*3),Q=V.coords,J=V.colors,ne=0,ae=0;for(U=0,$=G.length;U<$;U++){var Z=G[U],se=Z.coords,oe=Z.colors;switch(Z.type){case"lattice":var fe=Z.verticesPerRow;I=se.length/fe|0;for(var de=1;de<I;de++)for(var ce=de*fe+1,Se=1;Se<fe;Se++,ce++)B[ne]=Q[se[ce-fe-1]],B[ne+1]=Q[se[ce-fe-1]+1],B[ne+2]=Q[se[ce-fe]],B[ne+3]=Q[se[ce-fe]+1],B[ne+4]=Q[se[ce-1]],B[ne+5]=Q[se[ce-1]+1],X[ae]=J[oe[ce-fe-1]],X[ae+1]=J[oe[ce-fe-1]+1],X[ae+2]=J[oe[ce-fe-1]+2],X[ae+3]=J[oe[ce-fe]],X[ae+4]=J[oe[ce-fe]+1],X[ae+5]=J[oe[ce-fe]+2],X[ae+6]=J[oe[ce-1]],X[ae+7]=J[oe[ce-1]+1],X[ae+8]=J[oe[ce-1]+2],B[ne+6]=B[ne+2],B[ne+7]=B[ne+3],B[ne+8]=B[ne+4],B[ne+9]=B[ne+5],B[ne+10]=Q[se[ce]],B[ne+11]=Q[se[ce]+1],X[ae+9]=X[ae+3],X[ae+10]=X[ae+4],X[ae+11]=X[ae+5],X[ae+12]=X[ae+6],X[ae+13]=X[ae+7],X[ae+14]=X[ae+8],X[ae+15]=J[oe[ce]],X[ae+16]=J[oe[ce]+1],X[ae+17]=J[oe[ce]+2],ne+=12,ae+=18;break;case"triangles":for(var Le=0,Ne=se.length;Le<Ne;Le++)B[ne]=Q[se[Le]],B[ne+1]=Q[se[Le]+1],X[ae]=J[oe[Le]],X[ae+1]=J[oe[Le]+1],X[ae+2]=J[oe[Le]+2],ne+=2,ae+=3;break}}F?q.clearColor(F[0]/255,F[1]/255,F[2]/255,1):q.clearColor(0,0,0,0),q.clear(q.COLOR_BUFFER_BIT);var He=q.createBuffer();q.bindBuffer(q.ARRAY_BUFFER,He),q.bufferData(q.ARRAY_BUFFER,B,q.STATIC_DRAW),q.enableVertexAttribArray(W.positionLocation),q.vertexAttribPointer(W.positionLocation,2,q.FLOAT,!1,0,0);var Ke=q.createBuffer();return q.bindBuffer(q.ARRAY_BUFFER,Ke),q.bufferData(q.ARRAY_BUFFER,X,q.STATIC_DRAW),q.enableVertexAttribArray(W.colorLocation),q.vertexAttribPointer(W.colorLocation,3,q.UNSIGNED_BYTE,!1,0,0),q.uniform2f(W.scaleLocation,V.scaleX,V.scaleY),q.uniform2f(W.offsetLocation,V.offsetX,V.offsetY),q.drawArrays(q.TRIANGLES,0,z),q.flush(),q.deleteBuffer(He),q.deleteBuffer(Ke),ee}return{tryInitGL(){try{return _(),!!E}catch{}return!1},composeSMask:S,drawFigures:O,cleanup(){C&&C.canvas&&(C.canvas.width=0,C.canvas.height=0),w&&w.canvas&&(w.canvas.width=0,w.canvas.height=0),C=null,w=null}}}()},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var t=r(1),n=r(2);class a{static create(z){switch(z.data.annotationType){case n.AnnotationType.LINK:return new u(z);case n.AnnotationType.TEXT:return new f(z);case n.AnnotationType.WIDGET:switch(z.data.fieldType){case"Tx":return new h(z);case"Btn":return z.data.radioButton?new E(z):z.data.checkBox?new y(z):new p(z);case"Ch":return new _(z)}return new d(z);case n.AnnotationType.POPUP:return new g(z);case n.AnnotationType.FREETEXT:return new C(z);case n.AnnotationType.LINE:return new R(z);case n.AnnotationType.SQUARE:return new S(z);case n.AnnotationType.CIRCLE:return new A(z);case n.AnnotationType.POLYLINE:return new T(z);case n.AnnotationType.CARET:return new P(z);case n.AnnotationType.INK:return new O(z);case n.AnnotationType.POLYGON:return new w(z);case n.AnnotationType.HIGHLIGHT:return new k(z);case n.AnnotationType.UNDERLINE:return new D(z);case n.AnnotationType.SQUIGGLY:return new F(z);case n.AnnotationType.STRIKEOUT:return new G(z);case n.AnnotationType.STAMP:return new V(z);case n.AnnotationType.FILEATTACHMENT:return new W(z);default:return new l(z)}}}class l{constructor(z,U=!1,$=!1){this.isRenderable=U,this.data=z.data,this.layer=z.layer,this.page=z.page,this.viewport=z.viewport,this.linkService=z.linkService,this.downloadManager=z.downloadManager,this.imageResourcesPath=z.imageResourcesPath,this.renderInteractiveForms=z.renderInteractiveForms,this.svgFactory=z.svgFactory,U&&(this.container=this._createContainer($))}_createContainer(z=!1){const U=this.data,$=this.page,I=this.viewport,B=document.createElement("section");let X=U.rect[2]-U.rect[0],Q=U.rect[3]-U.rect[1];B.setAttribute("data-annotation-id",U.id);const J=n.Util.normalizeRect([U.rect[0],$.view[3]-U.rect[1]+$.view[1],U.rect[2],$.view[3]-U.rect[3]+$.view[1]]);if(B.style.transform=`matrix(${I.transform.join(",")})`,B.style.transformOrigin=`-${J[0]}px -${J[1]}px`,!z&&U.borderStyle.width>0){B.style.borderWidth=`${U.borderStyle.width}px`,U.borderStyle.style!==n.AnnotationBorderStyleType.UNDERLINE&&(X=X-2*U.borderStyle.width,Q=Q-2*U.borderStyle.width);const ne=U.borderStyle.horizontalCornerRadius,ae=U.borderStyle.verticalCornerRadius;if(ne>0||ae>0){const Z=`${ne}px / ${ae}px`;B.style.borderRadius=Z}switch(U.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:B.style.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:B.style.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:B.style.borderBottomStyle="solid";break}U.color?B.style.borderColor=n.Util.makeCssRgb(U.color[0]|0,U.color[1]|0,U.color[2]|0):B.style.borderWidth=0}return B.style.left=`${J[0]}px`,B.style.top=`${J[1]}px`,B.style.width=`${X}px`,B.style.height=`${Q}px`,B}_createPopup(z,U,$){U||(U=document.createElement("div"),U.style.height=z.style.height,U.style.width=z.style.width,z.appendChild(U));const B=new x({container:z,trigger:U,color:$.color,title:$.title,modificationDate:$.modificationDate,contents:$.contents,hideWrapper:!0}).render();B.style.left=z.style.width,z.appendChild(B)}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}}class u extends l{constructor(z){const U=!!(z.data.url||z.data.dest||z.data.action);super(z,U)}render(){this.container.className="linkAnnotation";const{data:z,linkService:U}=this,$=document.createElement("a");return z.url?(0,t.addLinkAttributes)($,{url:z.url,target:z.newWindow?t.LinkTarget.BLANK:U.externalLinkTarget,rel:U.externalLinkRel,enabled:U.externalLinkEnabled}):z.action?this._bindNamedAction($,z.action):this._bindLink($,z.dest),this.container.appendChild($),this.container}_bindLink(z,U){z.href=this.linkService.getDestinationHash(U),z.onclick=()=>(U&&this.linkService.navigateTo(U),!1),U&&(z.className="internalLink")}_bindNamedAction(z,U){z.href=this.linkService.getAnchorUrl(""),z.onclick=()=>(this.linkService.executeNamedAction(U),!1),z.className="internalLink"}}class f extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U)}render(){this.container.className="textAnnotation";const z=document.createElement("img");return z.style.height=this.container.style.height,z.style.width=this.container.style.width,z.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",z.alt="[{{type}} Annotation]",z.dataset.l10nId="text_annotation_type",z.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,z,this.data),this.container.appendChild(z),this.container}}class d extends l{render(){return this.container}}class h extends d{constructor(z){const U=z.renderInteractiveForms||!z.data.hasAppearance&&!!z.data.fieldValue;super(z,U)}render(){const z=["left","center","right"];this.container.className="textWidgetAnnotation";let U=null;if(this.renderInteractiveForms){if(this.data.multiLine?(U=document.createElement("textarea"),U.textContent=this.data.fieldValue):(U=document.createElement("input"),U.type="text",U.setAttribute("value",this.data.fieldValue)),U.disabled=this.data.readOnly,U.name=this.data.fieldName,this.data.maxLen!==null&&(U.maxLength=this.data.maxLen),this.data.comb){const I=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;U.classList.add("comb"),U.style.letterSpacing=`calc(${I}px - 1ch)`}}else{U=document.createElement("div"),U.textContent=this.data.fieldValue,U.style.verticalAlign="middle",U.style.display="table-cell";let $=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&($=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(U,$)}return this.data.textAlignment!==null&&(U.style.textAlign=z[this.data.textAlignment]),this.container.appendChild(U),this.container}_setTextStyle(z,U){const $=z.style;if($.fontSize=`${this.data.fontSize}px`,$.direction=this.data.fontDirection<0?"rtl":"ltr",!U)return;let I="normal";U.black?I="900":U.bold&&(I="bold"),$.fontWeight=I,$.fontStyle=U.italic?"italic":"normal";const B=U.loadedName?`"${U.loadedName}", `:"",X=U.fallbackName||"Helvetica, sans-serif";$.fontFamily=B+X}}class y extends d{constructor(z){super(z,z.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation checkBox";const z=document.createElement("input");return z.disabled=this.data.readOnly,z.type="checkbox",z.name=this.data.fieldName,this.data.fieldValue&&this.data.fieldValue!=="Off"&&z.setAttribute("checked",!0),this.container.appendChild(z),this.container}}class E extends d{constructor(z){super(z,z.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const z=document.createElement("input");return z.disabled=this.data.readOnly,z.type="radio",z.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&z.setAttribute("checked",!0),this.container.appendChild(z),this.container}}class p extends u{render(){const z=super.render();return z.className="buttonWidgetAnnotation pushButton",z}}class _ extends d{constructor(z){super(z,z.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const z=document.createElement("select");z.disabled=this.data.readOnly,z.name=this.data.fieldName,this.data.combo||(z.size=this.data.options.length,this.data.multiSelect&&(z.multiple=!0));for(const U of this.data.options){const $=document.createElement("option");$.textContent=U.displayValue,$.value=U.exportValue,this.data.fieldValue.includes(U.displayValue)&&$.setAttribute("selected",!0),z.appendChild($)}return this.container.appendChild(z),this.container}}class g extends l{constructor(z){const U=!!(z.data.title||z.data.contents);super(z,U)}render(){const z=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",z.includes(this.data.parentType))return this.container;const U=`[data-annotation-id="${this.data.parentId}"]`,$=this.layer.querySelector(U);if(!$)return this.container;const I=new x({container:this.container,trigger:$,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),B=parseFloat($.style.left),X=parseFloat($.style.width);return this.container.style.transformOrigin=`-${B+X}px -${$.style.top}`,this.container.style.left=`${B+X}px`,this.container.appendChild(I.render()),this.container}}class x{constructor(z){this.container=z.container,this.trigger=z.trigger,this.color=z.color,this.title=z.title,this.modificationDate=z.modificationDate,this.contents=z.contents,this.hideWrapper=z.hideWrapper||!1,this.pinned=!1}render(){const U=document.createElement("div");U.className="popupWrapper",this.hideElement=this.hideWrapper?U:this.container,this.hideElement.setAttribute("hidden",!0);const $=document.createElement("div");$.className="popup";const I=this.color;if(I){const J=.7*(255-I[0])+I[0],ne=.7*(255-I[1])+I[1],ae=.7*(255-I[2])+I[2];$.style.backgroundColor=n.Util.makeCssRgb(J|0,ne|0,ae|0)}const B=document.createElement("h1");B.textContent=this.title,$.appendChild(B);const X=t.PDFDateString.toDateObject(this.modificationDate);if(X){const J=document.createElement("span");J.textContent="{{date}}, {{time}}",J.dataset.l10nId="annotation_date_string",J.dataset.l10nArgs=JSON.stringify({date:X.toLocaleDateString(),time:X.toLocaleTimeString()}),$.appendChild(J)}const Q=this._formatContents(this.contents);return $.appendChild(Q),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),$.addEventListener("click",this._hide.bind(this,!0)),U.appendChild($),U}_formatContents(z){const U=document.createElement("p"),$=z.split(/(?:\r\n?|\n)/);for(let I=0,B=$.length;I<B;++I){const X=$[I];U.appendChild(document.createTextNode(X)),I<B-1&&U.appendChild(document.createElement("br"))}return U}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(z=!1){z&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}_hide(z=!0){z&&(this.pinned=!1),!this.hideElement.hasAttribute("hidden")&&!this.pinned&&(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}class C extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class R extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){this.container.className="lineAnnotation";const z=this.data,U=z.rect[2]-z.rect[0],$=z.rect[3]-z.rect[1],I=this.svgFactory.create(U,$),B=this.svgFactory.createElement("svg:line");return B.setAttribute("x1",z.rect[2]-z.lineCoordinates[0]),B.setAttribute("y1",z.rect[3]-z.lineCoordinates[1]),B.setAttribute("x2",z.rect[2]-z.lineCoordinates[2]),B.setAttribute("y2",z.rect[3]-z.lineCoordinates[3]),B.setAttribute("stroke-width",z.borderStyle.width||1),B.setAttribute("stroke","transparent"),I.appendChild(B),this.container.append(I),this._createPopup(this.container,B,z),this.container}}class S extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){this.container.className="squareAnnotation";const z=this.data,U=z.rect[2]-z.rect[0],$=z.rect[3]-z.rect[1],I=this.svgFactory.create(U,$),B=z.borderStyle.width,X=this.svgFactory.createElement("svg:rect");return X.setAttribute("x",B/2),X.setAttribute("y",B/2),X.setAttribute("width",U-B),X.setAttribute("height",$-B),X.setAttribute("stroke-width",B||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),I.appendChild(X),this.container.append(I),this._createPopup(this.container,X,z),this.container}}class A extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){this.container.className="circleAnnotation";const z=this.data,U=z.rect[2]-z.rect[0],$=z.rect[3]-z.rect[1],I=this.svgFactory.create(U,$),B=z.borderStyle.width,X=this.svgFactory.createElement("svg:ellipse");return X.setAttribute("cx",U/2),X.setAttribute("cy",$/2),X.setAttribute("rx",U/2-B/2),X.setAttribute("ry",$/2-B/2),X.setAttribute("stroke-width",B||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),I.appendChild(X),this.container.append(I),this._createPopup(this.container,X,z),this.container}}class T extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const z=this.data,U=z.rect[2]-z.rect[0],$=z.rect[3]-z.rect[1],I=this.svgFactory.create(U,$);let B=[];for(const Q of z.vertices){const J=Q.x-z.rect[0],ne=z.rect[3]-Q.y;B.push(J+","+ne)}B=B.join(" ");const X=this.svgFactory.createElement(this.svgElementName);return X.setAttribute("points",B),X.setAttribute("stroke-width",z.borderStyle.width||1),X.setAttribute("stroke","transparent"),X.setAttribute("fill","none"),I.appendChild(X),this.container.append(I),this._createPopup(this.container,X,z),this.container}}class w extends T{constructor(z){super(z),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class P extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class O extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const z=this.data,U=z.rect[2]-z.rect[0],$=z.rect[3]-z.rect[1],I=this.svgFactory.create(U,$);for(const B of z.inkLists){let X=[];for(const J of B){const ne=J.x-z.rect[0],ae=z.rect[3]-J.y;X.push(`${ne},${ae}`)}X=X.join(" ");const Q=this.svgFactory.createElement(this.svgElementName);Q.setAttribute("points",X),Q.setAttribute("stroke-width",z.borderStyle.width||1),Q.setAttribute("stroke","transparent"),Q.setAttribute("fill","none"),this._createPopup(this.container,Q,z),I.appendChild(Q)}return this.container.append(I),this.container}}class k extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class D extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class F extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class G extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class V extends l{constructor(z){const U=!!(z.data.hasPopup||z.data.title||z.data.contents);super(z,U,!0)}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class W extends l{constructor(z){super(z,!0);const{filename:U,content:$}=this.data.file;this.filename=(0,t.getFilenameFromUrl)(U),this.content=$,this.linkService.eventBus&&this.linkService.eventBus.dispatch("fileattachmentannotation",{source:this,id:(0,n.stringToPDFString)(U),filename:U,content:$})}render(){this.container.className="fileAttachmentAnnotation";const z=document.createElement("div");return z.style.height=this.container.style.height,z.style.width=this.container.style.width,z.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(this.data.title||this.data.contents)&&this._createPopup(this.container,z,this.data),this.container.appendChild(z),this.container}_download(){if(!this.downloadManager){(0,n.warn)("Download cannot be started due to unavailable download manager");return}this.downloadManager.downloadData(this.content,this.filename,"")}}class ee{static render(z){const U=[],$=[];for(const I of z.annotations)if(I){if(I.annotationType===n.AnnotationType.POPUP){$.push(I);continue}U.push(I)}$.length&&U.push(...$);for(const I of U){const B=a.create({data:I,layer:z.div,page:z.page,viewport:z.viewport,linkService:z.linkService,downloadManager:z.downloadManager,imageResourcesPath:z.imageResourcesPath||"",renderInteractiveForms:z.renderInteractiveForms||!1,svgFactory:new t.DOMSVGFactory});B.isRenderable&&z.div.appendChild(B.render())}}static update(z){for(const U of z.annotations){const $=z.div.querySelector(`[data-annotation-id="${U.id}"]`);$&&($.style.transform=`matrix(${z.viewport.transform.join(",")})`)}z.div.removeAttribute("hidden")}}e.AnnotationLayer=ee},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.renderTextLayer=void 0;var t=r(2),n=function(){var l=1e5,u=/\S/;function f(C){return!u.test(C)}function d(C,R,S){var A=document.createElement("span"),T={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(C._textDivs.push(A),f(R.str)){T.isWhitespace=!0,C._textDivProperties.set(A,T);return}var w=t.Util.transform(C._viewport.transform,R.transform),P=Math.atan2(w[1],w[0]),O=S[R.fontName];O.vertical&&(P+=Math.PI/2);var k=Math.sqrt(w[2]*w[2]+w[3]*w[3]),D=k;O.ascent?D=O.ascent*D:O.descent&&(D=(1+O.descent)*D);let F,G;P===0?(F=w[4],G=w[5]-D):(F=w[4]+D*Math.sin(P),G=w[5]-D*Math.cos(P)),A.style.left=`${F}px`,A.style.top=`${G}px`,A.style.fontSize=`${k}px`,A.style.fontFamily=O.fontFamily,A.textContent=R.str,C._fontInspectorEnabled&&(A.dataset.fontName=R.fontName),P!==0&&(T.angle=P*(180/Math.PI));let V=!1;if(R.str.length>1)V=!0;else if(R.transform[0]!==R.transform[3]){const I=Math.abs(R.transform[0]),B=Math.abs(R.transform[3]);I!==B&&Math.max(I,B)/Math.min(I,B)>1.5&&(V=!0)}if(V&&(O.vertical?T.canvasWidth=R.height*C._viewport.scale:T.canvasWidth=R.width*C._viewport.scale),C._textDivProperties.set(A,T),C._textContentStream&&C._layoutText(A),C._enhanceTextSelection){var W=1,ee=0;P!==0&&(W=Math.cos(P),ee=Math.sin(P));var q=(O.vertical?R.height:R.width)*C._viewport.scale,z=k,U,$;P!==0?(U=[W,ee,-ee,W,F,G],$=t.Util.getAxialAlignedBoundingBox([0,0,q,z],U)):$=[F,G,F+q,G+z],C._bounds.push({left:$[0],top:$[1],right:$[2],bottom:$[3],div:A,size:[q,z],m:U})}}function h(C){if(!C._canceled){var R=C._textDivs,S=C._capability,A=R.length;if(A>l){C._renderingDone=!0,S.resolve();return}if(!C._textContentStream)for(var T=0;T<A;T++)C._layoutText(R[T]);C._renderingDone=!0,S.resolve()}}function y(C,R,S){let A=0;for(let T=0;T<S;T++){const w=C[R++];w>0&&(A=A?Math.min(w,A):w)}return A}function E(C){for(var R=C._bounds,S=C._viewport,A=p(S.width,S.height,R),T=0;T<A.length;T++){var w=R[T].div,P=C._textDivProperties.get(w);if(P.angle===0){P.paddingLeft=R[T].left-A[T].left,P.paddingTop=R[T].top-A[T].top,P.paddingRight=A[T].right-R[T].right,P.paddingBottom=A[T].bottom-R[T].bottom,C._textDivProperties.set(w,P);continue}var O=A[T],k=R[T],D=k.m,F=D[0],G=D[1],V=[[0,0],[0,k.size[1]],[k.size[0],0],k.size],W=new Float64Array(64);V.forEach(function(q,z){var U=t.Util.applyTransform(q,D);W[z+0]=F&&(O.left-U[0])/F,W[z+4]=G&&(O.top-U[1])/G,W[z+8]=F&&(O.right-U[0])/F,W[z+12]=G&&(O.bottom-U[1])/G,W[z+16]=G&&(O.left-U[0])/-G,W[z+20]=F&&(O.top-U[1])/F,W[z+24]=G&&(O.right-U[0])/-G,W[z+28]=F&&(O.bottom-U[1])/F,W[z+32]=F&&(O.left-U[0])/-F,W[z+36]=G&&(O.top-U[1])/-G,W[z+40]=F&&(O.right-U[0])/-F,W[z+44]=G&&(O.bottom-U[1])/-G,W[z+48]=G&&(O.left-U[0])/G,W[z+52]=F&&(O.top-U[1])/-F,W[z+56]=G&&(O.right-U[0])/G,W[z+60]=F&&(O.bottom-U[1])/-F});var ee=1+Math.min(Math.abs(F),Math.abs(G));P.paddingLeft=y(W,32,16)/ee,P.paddingTop=y(W,48,16)/ee,P.paddingRight=y(W,0,16)/ee,P.paddingBottom=y(W,16,16)/ee,C._textDivProperties.set(w,P)}}function p(C,R,S){var A=S.map(function(w,P){return{x1:w.left,y1:w.top,x2:w.right,y2:w.bottom,index:P,x1New:void 0,x2New:void 0}});_(C,A);var T=new Array(S.length);return A.forEach(function(w){var P=w.index;T[P]={left:w.x1New,top:0,right:w.x2New,bottom:0}}),S.map(function(w,P){var O=T[P],k=A[P];k.x1=w.top,k.y1=C-O.right,k.x2=w.bottom,k.y2=C-O.left,k.index=P,k.x1New=void 0,k.x2New=void 0}),_(R,A),A.forEach(function(w){var P=w.index;T[P].top=w.x1New,T[P].bottom=w.x2New}),T}function _(C,R){R.sort(function(T,w){return T.x1-w.x1||T.index-w.index});var S={x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0},A=[{start:-1/0,end:1/0,boundary:S}];R.forEach(function(T){for(var w=0;w<A.length&&A[w].end<=T.y1;)w++;for(var P=A.length-1;P>=0&&A[P].start>=T.y2;)P--;var O,k,D,F,G=-1/0;for(D=w;D<=P;D++){O=A[D],k=O.boundary;var V;k.x2>T.x1?V=k.index>T.index?k.x1New:T.x1:k.x2New===void 0?V=(k.x2+T.x1)/2:V=k.x2New,V>G&&(G=V)}for(T.x1New=G,D=w;D<=P;D++)O=A[D],k=O.boundary,k.x2New===void 0?k.x2>T.x1?k.index>T.index&&(k.x2New=k.x2):k.x2New=G:k.x2New>G&&(k.x2New=Math.max(G,k.x2));var W=[],ee=null;for(D=w;D<=P;D++){O=A[D],k=O.boundary;var q=k.x2>T.x2?k:T;ee===q?W[W.length-1].end=O.end:(W.push({start:O.start,end:O.end,boundary:q}),ee=q)}for(A[w].start<T.y1&&(W[0].start=T.y1,W.unshift({start:A[w].start,end:T.y1,boundary:A[w].boundary})),T.y2<A[P].end&&(W[W.length-1].end=T.y2,W.push({start:T.y2,end:A[P].end,boundary:A[P].boundary})),D=w;D<=P;D++)if(O=A[D],k=O.boundary,k.x2New===void 0){var z=!1;for(F=w-1;!z&&F>=0&&A[F].start>=k.y1;F--)z=A[F].boundary===k;for(F=P+1;!z&&F<A.length&&A[F].end<=k.y2;F++)z=A[F].boundary===k;for(F=0;!z&&F<W.length;F++)z=W[F].boundary===k;z||(k.x2New=G)}Array.prototype.splice.apply(A,[w,P-w+1].concat(W))}),A.forEach(function(T){var w=T.boundary;w.x2New===void 0&&(w.x2New=Math.max(C,w.x2))})}function g({textContent:C,textContentStream:R,container:S,viewport:A,textDivs:T,textContentItemsStr:w,enhanceTextSelection:P}){this._textContent=C,this._textContentStream=R,this._container=S,this._viewport=A,this._textDivs=T||[],this._textContentItemsStr=w||[],this._enhanceTextSelection=!!P,this._fontInspectorEnabled=!!(globalThis.FontInspector&&globalThis.FontInspector.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,t.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally(()=>{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}g.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new t.AbortException("TextLayer task cancelled.")),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(C,R){for(let S=0,A=C.length;S<A;S++)this._textContentItemsStr.push(C[S].str),d(this,C[S],R)},_layoutText(C){const R=this._textDivProperties.get(C);if(R.isWhitespace)return;let S="";if(R.canvasWidth!==0){const{fontSize:A,fontFamily:T}=C.style;(A!==this._layoutTextLastFontSize||T!==this._layoutTextLastFontFamily)&&(this._layoutTextCtx.font=`${A} ${T}`,this._layoutTextLastFontSize=A,this._layoutTextLastFontFamily=T);const{width:w}=this._layoutTextCtx.measureText(C.textContent);w>0&&(R.scale=R.canvasWidth/w,S=`scaleX(${R.scale})`)}R.angle!==0&&(S=`rotate(${R.angle}deg) ${S}`),S.length>0&&(this._enhanceTextSelection&&(R.originalTransform=S),C.style.transform=S),this._textDivProperties.set(C,R),this._container.appendChild(C)},_render:function(R){const S=(0,t.createPromiseCapability)();let A=Object.create(null);const T=document.createElement("canvas");if(T.mozOpaque=!0,this._layoutTextCtx=T.getContext("2d",{alpha:!1}),this._textContent){const w=this._textContent.items,P=this._textContent.styles;this._processItems(w,P),S.resolve()}else if(this._textContentStream){const w=()=>{this._reader.read().then(({value:P,done:O})=>{if(O){S.resolve();return}Object.assign(A,P.styles),this._processItems(P.items,A),w()},S.reject)};this._reader=this._textContentStream.getReader(),w()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');S.promise.then(()=>{A=null,R?this._renderTimer=setTimeout(()=>{h(this),this._renderTimer=null},R):h(this)},this._capability.reject)},expandTextDivs:function(R){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(E(this),this._bounds=null);const S=[],A=[];for(var T=0,w=this._textDivs.length;T<w;T++){const P=this._textDivs[T],O=this._textDivProperties.get(P);O.isWhitespace||(R?(S.length=0,A.length=0,O.originalTransform&&S.push(O.originalTransform),O.paddingTop>0?(A.push(`${O.paddingTop}px`),S.push(`translateY(${-O.paddingTop}px)`)):A.push(0),O.paddingRight>0?A.push(`${O.paddingRight/O.scale}px`):A.push(0),O.paddingBottom>0?A.push(`${O.paddingBottom}px`):A.push(0),O.paddingLeft>0?(A.push(`${O.paddingLeft/O.scale}px`),S.push(`translateX(${-O.paddingLeft/O.scale}px)`)):A.push(0),P.style.padding=A.join(" "),S.length&&(P.style.transform=S.join(" "))):(P.style.padding=null,P.style.transform=O.originalTransform))}}};function x(C){var R=new g({textContent:C.textContent,textContentStream:C.textContentStream,container:C.container,viewport:C.viewport,textDivs:C.textDivs,textContentItemsStr:C.textContentItemsStr,enhanceTextSelection:C.enhanceTextSelection});return R._render(C.timeout),R}return x}();e.renderTextLayer=n},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var t=r(2),n=r(1),a=r(4);let l=function(){throw new Error("Not implemented: SVGGraphics")};e.SVGGraphics=l;{let _=function(A){let T=[];const w=[];for(const P of A){if(P.fn==="save"){T.push({fnId:92,fn:"group",items:[]}),w.push(T),T=T[T.length-1].items;continue}P.fn==="restore"?T=w.pop():T.push(P)}return T},g=function(A){if(Number.isInteger(A))return A.toString();const T=A.toFixed(10);let w=T.length-1;if(T[w]!=="0")return T;do w--;while(T[w]==="0");return T.substring(0,T[w]==="."?w:w+1)},x=function(A){if(A[4]===0&&A[5]===0){if(A[1]===0&&A[2]===0)return A[0]===1&&A[3]===1?"":`scale(${g(A[0])} ${g(A[3])})`;if(A[0]===A[3]&&A[1]===-A[2]){const T=Math.acos(A[0])*180/Math.PI;return`rotate(${g(T)})`}}else if(A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1)return`translate(${g(A[4])} ${g(A[5])})`;return`matrix(${g(A[0])} ${g(A[1])} ${g(A[2])} ${g(A[3])} ${g(A[4])} ${g(A[5])})`};const u={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},f="http://www.w3.org/XML/1998/namespace",d="http://www.w3.org/1999/xlink",h=["butt","round","square"],y=["miter","round","bevel"],E=function(){const A=new Uint8Array([137,80,78,71,13,10,26,10]),T=12,w=new Int32Array(256);for(let V=0;V<256;V++){let W=V;for(let ee=0;ee<8;ee++)W&1?W=3988292384^W>>1&2147483647:W=W>>1&2147483647;w[V]=W}function P(V,W,ee){let q=-1;for(let z=W;z<ee;z++){const U=(q^V[z])&255,$=w[U];q=q>>>8^$}return q^-1}function O(V,W,ee,q){let z=q;const U=W.length;ee[z]=U>>24&255,ee[z+1]=U>>16&255,ee[z+2]=U>>8&255,ee[z+3]=U&255,z+=4,ee[z]=V.charCodeAt(0)&255,ee[z+1]=V.charCodeAt(1)&255,ee[z+2]=V.charCodeAt(2)&255,ee[z+3]=V.charCodeAt(3)&255,z+=4,ee.set(W,z),z+=W.length;const $=P(ee,q+4,z);ee[z]=$>>24&255,ee[z+1]=$>>16&255,ee[z+2]=$>>8&255,ee[z+3]=$&255}function k(V,W,ee){let q=1,z=0;for(let U=W;U<ee;++U)q=(q+(V[U]&255))%65521,z=(z+q)%65521;return z<<16|q}function D(V){if(!a.isNodeJS)return F(V);try{let W;parseInt(process.versions.node)>=8?W=V:W=Buffer.from(V);const ee=require$$4.deflateSync(W,{level:9});return ee instanceof Uint8Array?ee:new Uint8Array(ee)}catch(W){(0,t.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+W)}return F(V)}function F(V){let W=V.length;const ee=65535,q=Math.ceil(W/ee),z=new Uint8Array(2+W+q*5+4);let U=0;z[U++]=120,z[U++]=156;let $=0;for(;W>ee;)z[U++]=0,z[U++]=255,z[U++]=255,z[U++]=0,z[U++]=0,z.set(V.subarray($,$+ee),U),U+=ee,$+=ee,W-=ee;z[U++]=1,z[U++]=W&255,z[U++]=W>>8&255,z[U++]=~W&65535&255,z[U++]=(~W&65535)>>8&255,z.set(V.subarray($),U),U+=V.length-$;const I=k(V,0,V.length);return z[U++]=I>>24&255,z[U++]=I>>16&255,z[U++]=I>>8&255,z[U++]=I&255,z}function G(V,W,ee,q){const z=V.width,U=V.height;let $,I,B;const X=V.data;switch(W){case t.ImageKind.GRAYSCALE_1BPP:I=0,$=1,B=z+7>>3;break;case t.ImageKind.RGB_24BPP:I=2,$=8,B=z*3;break;case t.ImageKind.RGBA_32BPP:I=6,$=8,B=z*4;break;default:throw new Error("invalid format")}const Q=new Uint8Array((1+B)*U);let J=0,ne=0;for(let de=0;de<U;++de)Q[J++]=0,Q.set(X.subarray(ne,ne+B),J),ne+=B,J+=B;if(W===t.ImageKind.GRAYSCALE_1BPP&&q){J=0;for(let de=0;de<U;de++){J++;for(let ce=0;ce<B;ce++)Q[J++]^=255}}const ae=new Uint8Array([z>>24&255,z>>16&255,z>>8&255,z&255,U>>24&255,U>>16&255,U>>8&255,U&255,$,I,0,0,0]),Z=D(Q),se=A.length+T*3+ae.length+Z.length,oe=new Uint8Array(se);let fe=0;return oe.set(A,fe),fe+=A.length,O("IHDR",ae,oe,fe),fe+=T+ae.length,O("IDATA",Z,oe,fe),fe+=T+Z.length,O("IEND",new Uint8Array(0),oe,fe),(0,t.createObjectURL)(oe,"image/png",ee)}return function(W,ee,q){const z=W.kind===void 0?t.ImageKind.GRAYSCALE_1BPP:W.kind;return G(W,z,ee,q)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=u.fontWeight,this.fontSize=0,this.textMatrix=t.IDENTITY_MATRIX,this.fontMatrix=t.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=t.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=u.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(T,w){this.x=T,this.y=w}}let C=0,R=0,S=0;e.SVGGraphics=l=class{constructor(T,w,P=!1){this.svgFactory=new n.DOMSVGFactory,this.current=new p,this.transformMatrix=t.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=T,this.objs=w,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!P,this._operatorIdMapping=[];for(const O in t.OPS)this._operatorIdMapping[t.OPS[O]]=O}save(){this.transformStack.push(this.transformMatrix);const T=this.current;this.extraStack.push(T),this.current=T.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(T){this.save(),this.executeOpTree(T),this.restore()}loadDependencies(T){const w=T.fnArray,P=T.argsArray;for(let O=0,k=w.length;O<k;O++)if(w[O]===t.OPS.dependency)for(const D of P[O]){const F=D.startsWith("g_")?this.commonObjs:this.objs,G=new Promise(V=>{F.get(D,V)});this.current.dependencies.push(G)}return Promise.all(this.current.dependencies)}transform(T,w,P,O,k,D){const F=[T,w,P,O,k,D];this.transformMatrix=t.Util.transform(this.transformMatrix,F),this.tgrp=null}getSVG(T,w){this.viewport=w;const P=this._initialize(w);return this.loadDependencies(T).then(()=>(this.transformMatrix=t.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(T)),P))}convertOpList(T){const w=this._operatorIdMapping,P=T.argsArray,O=T.fnArray,k=[];for(let D=0,F=O.length;D<F;D++){const G=O[D];k.push({fnId:G,fn:w[G],args:P[D]})}return _(k)}executeOpTree(T){for(const w of T){const P=w.fn,O=w.fnId,k=w.args;switch(O|0){case t.OPS.beginText:this.beginText();break;case t.OPS.dependency:break;case t.OPS.setLeading:this.setLeading(k);break;case t.OPS.setLeadingMoveText:this.setLeadingMoveText(k[0],k[1]);break;case t.OPS.setFont:this.setFont(k);break;case t.OPS.showText:this.showText(k[0]);break;case t.OPS.showSpacedText:this.showText(k[0]);break;case t.OPS.endText:this.endText();break;case t.OPS.moveText:this.moveText(k[0],k[1]);break;case t.OPS.setCharSpacing:this.setCharSpacing(k[0]);break;case t.OPS.setWordSpacing:this.setWordSpacing(k[0]);break;case t.OPS.setHScale:this.setHScale(k[0]);break;case t.OPS.setTextMatrix:this.setTextMatrix(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.setTextRise:this.setTextRise(k[0]);break;case t.OPS.setTextRenderingMode:this.setTextRenderingMode(k[0]);break;case t.OPS.setLineWidth:this.setLineWidth(k[0]);break;case t.OPS.setLineJoin:this.setLineJoin(k[0]);break;case t.OPS.setLineCap:this.setLineCap(k[0]);break;case t.OPS.setMiterLimit:this.setMiterLimit(k[0]);break;case t.OPS.setFillRGBColor:this.setFillRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeRGBColor:this.setStrokeRGBColor(k[0],k[1],k[2]);break;case t.OPS.setStrokeColorN:this.setStrokeColorN(k);break;case t.OPS.setFillColorN:this.setFillColorN(k);break;case t.OPS.shadingFill:this.shadingFill(k[0]);break;case t.OPS.setDash:this.setDash(k[0],k[1]);break;case t.OPS.setRenderingIntent:this.setRenderingIntent(k[0]);break;case t.OPS.setFlatness:this.setFlatness(k[0]);break;case t.OPS.setGState:this.setGState(k[0]);break;case t.OPS.fill:this.fill();break;case t.OPS.eoFill:this.eoFill();break;case t.OPS.stroke:this.stroke();break;case t.OPS.fillStroke:this.fillStroke();break;case t.OPS.eoFillStroke:this.eoFillStroke();break;case t.OPS.clip:this.clip("nonzero");break;case t.OPS.eoClip:this.clip("evenodd");break;case t.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case t.OPS.paintImageXObject:this.paintImageXObject(k[0]);break;case t.OPS.paintInlineImageXObject:this.paintInlineImageXObject(k[0]);break;case t.OPS.paintImageMaskXObject:this.paintImageMaskXObject(k[0]);break;case t.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(k[0],k[1]);break;case t.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case t.OPS.closePath:this.closePath();break;case t.OPS.closeStroke:this.closeStroke();break;case t.OPS.closeFillStroke:this.closeFillStroke();break;case t.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case t.OPS.nextLine:this.nextLine();break;case t.OPS.transform:this.transform(k[0],k[1],k[2],k[3],k[4],k[5]);break;case t.OPS.constructPath:this.constructPath(k[0],k[1]);break;case t.OPS.endPath:this.endPath();break;case 92:this.group(w.items);break;default:(0,t.warn)(`Unimplemented operator ${P}`);break}}}setWordSpacing(T){this.current.wordSpacing=T}setCharSpacing(T){this.current.charSpacing=T}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(T,w,P,O,k,D){const F=this.current;F.textMatrix=F.lineMatrix=[T,w,P,O,k,D],F.textMatrixScale=Math.sqrt(T*T+w*w),F.x=F.lineX=0,F.y=F.lineY=0,F.xcoords=[],F.ycoords=[],F.tspan=this.svgFactory.createElement("svg:tspan"),F.tspan.setAttributeNS(null,"font-family",F.fontFamily),F.tspan.setAttributeNS(null,"font-size",`${g(F.fontSize)}px`),F.tspan.setAttributeNS(null,"y",g(-F.y)),F.txtElement=this.svgFactory.createElement("svg:text"),F.txtElement.appendChild(F.tspan)}beginText(){const T=this.current;T.x=T.lineX=0,T.y=T.lineY=0,T.textMatrix=t.IDENTITY_MATRIX,T.lineMatrix=t.IDENTITY_MATRIX,T.textMatrixScale=1,T.tspan=this.svgFactory.createElement("svg:tspan"),T.txtElement=this.svgFactory.createElement("svg:text"),T.txtgrp=this.svgFactory.createElement("svg:g"),T.xcoords=[],T.ycoords=[]}moveText(T,w){const P=this.current;P.x=P.lineX+=T,P.y=P.lineY+=w,P.xcoords=[],P.ycoords=[],P.tspan=this.svgFactory.createElement("svg:tspan"),P.tspan.setAttributeNS(null,"font-family",P.fontFamily),P.tspan.setAttributeNS(null,"font-size",`${g(P.fontSize)}px`),P.tspan.setAttributeNS(null,"y",g(-P.y))}showText(T){const w=this.current,P=w.font,O=w.fontSize;if(O===0)return;const k=w.fontSizeScale,D=w.charSpacing,F=w.wordSpacing,G=w.fontDirection,V=w.textHScale*G,W=P.vertical,ee=W?1:-1,q=P.defaultVMetrics,z=O*w.fontMatrix[0];let U=0;for(const B of T){if(B===null){U+=G*F;continue}else if((0,t.isNum)(B)){U+=ee*B*O/1e3;continue}const X=(B.isSpace?F:0)+D,Q=B.fontChar;let J,ne,ae=B.width;if(W){let se;const oe=B.vmetric||q;se=B.vmetric?oe[1]:ae*.5,se=-se*z;const fe=oe[2]*z;ae=oe?-oe[0]:ae,J=se/k,ne=(U+fe)/k}else J=U/k,ne=0;(B.isInFont||P.missingFile)&&(w.xcoords.push(w.x+J),W&&w.ycoords.push(-w.y+ne),w.tspan.textContent+=Q);let Z;W?Z=ae*z-X*G:Z=ae*z+X*G,U+=Z}w.tspan.setAttributeNS(null,"x",w.xcoords.map(g).join(" ")),W?w.tspan.setAttributeNS(null,"y",w.ycoords.map(g).join(" ")):w.tspan.setAttributeNS(null,"y",g(-w.y)),W?w.y-=U:w.x+=U*V,w.tspan.setAttributeNS(null,"font-family",w.fontFamily),w.tspan.setAttributeNS(null,"font-size",`${g(w.fontSize)}px`),w.fontStyle!==u.fontStyle&&w.tspan.setAttributeNS(null,"font-style",w.fontStyle),w.fontWeight!==u.fontWeight&&w.tspan.setAttributeNS(null,"font-weight",w.fontWeight);const $=w.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;if($===t.TextRenderingMode.FILL||$===t.TextRenderingMode.FILL_STROKE?(w.fillColor!==u.fillColor&&w.tspan.setAttributeNS(null,"fill",w.fillColor),w.fillAlpha<1&&w.tspan.setAttributeNS(null,"fill-opacity",w.fillAlpha)):w.textRenderingMode===t.TextRenderingMode.ADD_TO_PATH?w.tspan.setAttributeNS(null,"fill","transparent"):w.tspan.setAttributeNS(null,"fill","none"),$===t.TextRenderingMode.STROKE||$===t.TextRenderingMode.FILL_STROKE){const B=1/(w.textMatrixScale||1);this._setStrokeAttributes(w.tspan,B)}let I=w.textMatrix;w.textRise!==0&&(I=I.slice(),I[5]+=w.textRise),w.txtElement.setAttributeNS(null,"transform",`${x(I)} scale(${g(V)}, -1)`),w.txtElement.setAttributeNS(f,"xml:space","preserve"),w.txtElement.appendChild(w.tspan),w.txtgrp.appendChild(w.txtElement),this._ensureTransformGroup().appendChild(w.txtElement)}setLeadingMoveText(T,w){this.setLeading(-w),this.moveText(T,w)}addFontStyle(T){if(!T.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const w=(0,t.createObjectURL)(T.data,T.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${T.loadedName}"; src: url(${w}); }
31
+ `}setFont(T){const w=this.current,P=this.commonObjs.get(T[0]);let O=T[1];w.font=P,this.embedFonts&&!P.missingFile&&!this.embeddedFonts[P.loadedName]&&(this.addFontStyle(P),this.embeddedFonts[P.loadedName]=P),w.fontMatrix=P.fontMatrix?P.fontMatrix:t.FONT_IDENTITY_MATRIX;let k="normal";P.black?k="900":P.bold&&(k="bold");const D=P.italic?"italic":"normal";O<0?(O=-O,w.fontDirection=-1):w.fontDirection=1,w.fontSize=O,w.fontFamily=P.loadedName,w.fontWeight=k,w.fontStyle=D,w.tspan=this.svgFactory.createElement("svg:tspan"),w.tspan.setAttributeNS(null,"y",g(-w.y)),w.xcoords=[],w.ycoords=[]}endText(){const T=this.current;T.textRenderingMode&t.TextRenderingMode.ADD_TO_PATH_FLAG&&T.txtElement&&T.txtElement.hasChildNodes()&&(T.element=T.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(T){T>0&&(this.current.lineWidth=T)}setLineCap(T){this.current.lineCap=h[T]}setLineJoin(T){this.current.lineJoin=y[T]}setMiterLimit(T){this.current.miterLimit=T}setStrokeAlpha(T){this.current.strokeAlpha=T}setStrokeRGBColor(T,w,P){this.current.strokeColor=t.Util.makeCssRgb(T,w,P)}setFillAlpha(T){this.current.fillAlpha=T}setFillRGBColor(T,w,P){this.current.fillColor=t.Util.makeCssRgb(T,w,P),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(T){this.current.strokeColor=this._makeColorN_Pattern(T)}setFillColorN(T){this.current.fillColor=this._makeColorN_Pattern(T)}shadingFill(T){const w=this.viewport.width,P=this.viewport.height,O=t.Util.inverseTransform(this.transformMatrix),k=t.Util.applyTransform([0,0],O),D=t.Util.applyTransform([0,P],O),F=t.Util.applyTransform([w,0],O),G=t.Util.applyTransform([w,P],O),V=Math.min(k[0],D[0],F[0],G[0]),W=Math.min(k[1],D[1],F[1],G[1]),ee=Math.max(k[0],D[0],F[0],G[0]),q=Math.max(k[1],D[1],F[1],G[1]),z=this.svgFactory.createElement("svg:rect");z.setAttributeNS(null,"x",V),z.setAttributeNS(null,"y",W),z.setAttributeNS(null,"width",ee-V),z.setAttributeNS(null,"height",q-W),z.setAttributeNS(null,"fill",this._makeShadingPattern(T)),this.current.fillAlpha<1&&z.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(z)}_makeColorN_Pattern(T){return T[0]==="TilingPattern"?this._makeTilingPattern(T):this._makeShadingPattern(T)}_makeTilingPattern(T){const w=T[1],P=T[2],O=T[3]||t.IDENTITY_MATRIX,[k,D,F,G]=T[4],V=T[5],W=T[6],ee=T[7],q=`shading${S++}`,[z,U]=t.Util.applyTransform([k,D],O),[$,I]=t.Util.applyTransform([F,G],O),[B,X]=t.Util.singularValueDecompose2dScale(O),Q=V*B,J=W*X,ne=this.svgFactory.createElement("svg:pattern");ne.setAttributeNS(null,"id",q),ne.setAttributeNS(null,"patternUnits","userSpaceOnUse"),ne.setAttributeNS(null,"width",Q),ne.setAttributeNS(null,"height",J),ne.setAttributeNS(null,"x",`${z}`),ne.setAttributeNS(null,"y",`${U}`);const ae=this.svg,Z=this.transformMatrix,se=this.current.fillColor,oe=this.current.strokeColor,fe=this.svgFactory.create($-z,I-U);if(this.svg=fe,this.transformMatrix=O,ee===2){const de=t.Util.makeCssRgb(...w);this.current.fillColor=de,this.current.strokeColor=de}return this.executeOpTree(this.convertOpList(P)),this.svg=ae,this.transformMatrix=Z,this.current.fillColor=se,this.current.strokeColor=oe,ne.appendChild(fe.childNodes[0]),this.defs.appendChild(ne),`url(#${q})`}_makeShadingPattern(T){switch(T[0]){case"RadialAxial":const w=`shading${S++}`,P=T[3];let O;switch(T[1]){case"axial":const k=T[4],D=T[5];O=this.svgFactory.createElement("svg:linearGradient"),O.setAttributeNS(null,"id",w),O.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),O.setAttributeNS(null,"x1",k[0]),O.setAttributeNS(null,"y1",k[1]),O.setAttributeNS(null,"x2",D[0]),O.setAttributeNS(null,"y2",D[1]);break;case"radial":const F=T[4],G=T[5],V=T[6],W=T[7];O=this.svgFactory.createElement("svg:radialGradient"),O.setAttributeNS(null,"id",w),O.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),O.setAttributeNS(null,"cx",G[0]),O.setAttributeNS(null,"cy",G[1]),O.setAttributeNS(null,"r",W),O.setAttributeNS(null,"fx",F[0]),O.setAttributeNS(null,"fy",F[1]),O.setAttributeNS(null,"fr",V);break;default:throw new Error(`Unknown RadialAxial type: ${T[1]}`)}for(const k of P){const D=this.svgFactory.createElement("svg:stop");D.setAttributeNS(null,"offset",k[0]),D.setAttributeNS(null,"stop-color",k[1]),O.appendChild(D)}return this.defs.appendChild(O),`url(#${w})`;case"Mesh":return(0,t.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${T[0]}`)}}setDash(T,w){this.current.dashArray=T,this.current.dashPhase=w}constructPath(T,w){const P=this.current;let O=P.x,k=P.y,D=[],F=0;for(const G of T)switch(G|0){case t.OPS.rectangle:O=w[F++],k=w[F++];const V=w[F++],W=w[F++],ee=O+V,q=k+W;D.push("M",g(O),g(k),"L",g(ee),g(k),"L",g(ee),g(q),"L",g(O),g(q),"Z");break;case t.OPS.moveTo:O=w[F++],k=w[F++],D.push("M",g(O),g(k));break;case t.OPS.lineTo:O=w[F++],k=w[F++],D.push("L",g(O),g(k));break;case t.OPS.curveTo:O=w[F+4],k=w[F+5],D.push("C",g(w[F]),g(w[F+1]),g(w[F+2]),g(w[F+3]),g(O),g(k)),F+=6;break;case t.OPS.curveTo2:D.push("C",g(O),g(k),g(w[F]),g(w[F+1]),g(w[F+2]),g(w[F+3])),O=w[F+2],k=w[F+3],F+=4;break;case t.OPS.curveTo3:O=w[F+2],k=w[F+3],D.push("C",g(w[F]),g(w[F+1]),g(O),g(k),g(O),g(k)),F+=4;break;case t.OPS.closePath:D.push("Z");break}D=D.join(" "),P.path&&T.length>0&&T[0]!==t.OPS.rectangle&&T[0]!==t.OPS.moveTo?D=P.path.getAttributeNS(null,"d")+D:(P.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(P.path)),P.path.setAttributeNS(null,"d",D),P.path.setAttributeNS(null,"fill","none"),P.element=P.path,P.setCurrentPoint(O,k)}endPath(){const T=this.current;if(T.path=null,!this.pendingClip)return;if(!T.element){this.pendingClip=null;return}const w=`clippath${C++}`,P=this.svgFactory.createElement("svg:clipPath");P.setAttributeNS(null,"id",w),P.setAttributeNS(null,"transform",x(this.transformMatrix));const O=T.element.cloneNode(!0);this.pendingClip==="evenodd"?O.setAttributeNS(null,"clip-rule","evenodd"):O.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,P.appendChild(O),this.defs.appendChild(P),T.activeClipUrl&&(T.clipGroup=null,this.extraStack.forEach(function(k){k.clipGroup=null}),P.setAttributeNS(null,"clip-path",T.activeClipUrl)),T.activeClipUrl=`url(#${w})`,this.tgrp=null}clip(T){this.pendingClip=T}closePath(){const T=this.current;if(T.path){const w=`${T.path.getAttributeNS(null,"d")}Z`;T.path.setAttributeNS(null,"d",w)}}setLeading(T){this.current.leading=-T}setTextRise(T){this.current.textRise=T}setTextRenderingMode(T){this.current.textRenderingMode=T}setHScale(T){this.current.textHScale=T/100}setRenderingIntent(T){}setFlatness(T){}setGState(T){for(const[w,P]of T)switch(w){case"LW":this.setLineWidth(P);break;case"LC":this.setLineCap(P);break;case"LJ":this.setLineJoin(P);break;case"ML":this.setMiterLimit(P);break;case"D":this.setDash(P[0],P[1]);break;case"RI":this.setRenderingIntent(P);break;case"FL":this.setFlatness(P);break;case"Font":this.setFont(P);break;case"CA":this.setStrokeAlpha(P);break;case"ca":this.setFillAlpha(P);break;default:(0,t.warn)(`Unimplemented graphic state operator ${w}`);break}}fill(){const T=this.current;T.element&&(T.element.setAttributeNS(null,"fill",T.fillColor),T.element.setAttributeNS(null,"fill-opacity",T.fillAlpha),this.endPath())}stroke(){const T=this.current;T.element&&(this._setStrokeAttributes(T.element),T.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(T,w=1){const P=this.current;let O=P.dashArray;w!==1&&O.length>0&&(O=O.map(function(k){return w*k})),T.setAttributeNS(null,"stroke",P.strokeColor),T.setAttributeNS(null,"stroke-opacity",P.strokeAlpha),T.setAttributeNS(null,"stroke-miterlimit",g(P.miterLimit)),T.setAttributeNS(null,"stroke-linecap",P.lineCap),T.setAttributeNS(null,"stroke-linejoin",P.lineJoin),T.setAttributeNS(null,"stroke-width",g(w*P.lineWidth)+"px"),T.setAttributeNS(null,"stroke-dasharray",O.map(g).join(" ")),T.setAttributeNS(null,"stroke-dashoffset",g(w*P.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x","0"),T.setAttributeNS(null,"y","0"),T.setAttributeNS(null,"width","1px"),T.setAttributeNS(null,"height","1px"),T.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(T)}paintImageXObject(T){const w=this.objs.get(T);if(!w){(0,t.warn)(`Dependent image with object ID ${T} is not ready yet`);return}this.paintInlineImageXObject(w)}paintInlineImageXObject(T,w){const P=T.width,O=T.height,k=E(T,this.forceDataSchema,!!w),D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x","0"),D.setAttributeNS(null,"y","0"),D.setAttributeNS(null,"width",g(P)),D.setAttributeNS(null,"height",g(O)),this.current.element=D,this.clip("nonzero");const F=this.svgFactory.createElement("svg:image");F.setAttributeNS(d,"xlink:href",k),F.setAttributeNS(null,"x","0"),F.setAttributeNS(null,"y",g(-O)),F.setAttributeNS(null,"width",g(P)+"px"),F.setAttributeNS(null,"height",g(O)+"px"),F.setAttributeNS(null,"transform",`scale(${g(1/P)} ${g(-1/O)})`),w?w.appendChild(F):this._ensureTransformGroup().appendChild(F)}paintImageMaskXObject(T){const w=this.current,P=T.width,O=T.height,k=w.fillColor;w.maskId=`mask${R++}`;const D=this.svgFactory.createElement("svg:mask");D.setAttributeNS(null,"id",w.maskId);const F=this.svgFactory.createElement("svg:rect");F.setAttributeNS(null,"x","0"),F.setAttributeNS(null,"y","0"),F.setAttributeNS(null,"width",g(P)),F.setAttributeNS(null,"height",g(O)),F.setAttributeNS(null,"fill",k),F.setAttributeNS(null,"mask",`url(#${w.maskId})`),this.defs.appendChild(D),this._ensureTransformGroup().appendChild(F),this.paintInlineImageXObject(T,D)}paintFormXObjectBegin(T,w){if(Array.isArray(T)&&T.length===6&&this.transform(T[0],T[1],T[2],T[3],T[4],T[5]),w){const P=w[2]-w[0],O=w[3]-w[1],k=this.svgFactory.createElement("svg:rect");k.setAttributeNS(null,"x",w[0]),k.setAttributeNS(null,"y",w[1]),k.setAttributeNS(null,"width",g(P)),k.setAttributeNS(null,"height",g(O)),this.current.element=k,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(T){const w=this.svgFactory.create(T.width,T.height),P=this.svgFactory.createElement("svg:defs");w.appendChild(P),this.defs=P;const O=this.svgFactory.createElement("svg:g");return O.setAttributeNS(null,"transform",x(T.transform)),w.appendChild(O),this.svg=O,w}_ensureClipGroup(){if(!this.current.clipGroup){const T=this.svgFactory.createElement("svg:g");T.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(T),this.current.clipGroup=T}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",x(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var t=r(2),n=r(20);const a=require$$4,l=require$$4,u=require$$4,f=require$$4,d=/^file:\/\/\/[a-zA-Z]:\//;function h(S){const A=f.parse(S);return A.protocol==="file:"||A.host?A:/^[a-z]:[/\\]/i.test(S)?f.parse(`file:///${S}`):(A.host||(A.protocol="file:"),A)}class y{constructor(A){this.source=A,this.url=h(A.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&A.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new C(this):new g(this),this._fullRequestReader}getRangeReader(A,T){if(T<=this._progressiveDataLength)return null;const w=this.isFsUrl?new R(this,A,T):new x(this,A,T);return this._rangeRequestReaders.push(w),w}cancelAllRequests(A){this._fullRequestReader&&this._fullRequestReader.cancel(A),this._rangeRequestReaders.slice(0).forEach(function(w){w.cancel(A)})}}e.PDFNodeStream=y;class E{constructor(A){this._url=A.url,this._done=!1,this._storedError=null,this.onProgress=null;const T=A.source;this._contentLength=T.length,this._loaded=0,this._filename=null,this._disableRange=T.disableRange||!1,this._rangeChunkSize=T.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!T.disableStream,this._isRangeSupported=!T.disableRange,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)(),this._headersCapability=(0,t.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const A=this._readableStream.read();return A===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=A.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(A).buffer,done:!1})}cancel(A){if(!this._readableStream){this._error(A);return}this._readableStream.destroy(A)}_error(A){this._storedError=A,this._readCapability.resolve()}_setReadableStream(A){this._readableStream=A,A.on("readable",()=>{this._readCapability.resolve()}),A.on("end",()=>{A.destroy(),this._done=!0,this._readCapability.resolve()}),A.on("error",T=>{this._error(T)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new t.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class p{constructor(A){this._url=A.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)();const T=A.source;this._isStreamingSupported=!T.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const A=this._readableStream.read();return A===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=A.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(A).buffer,done:!1})}cancel(A){if(!this._readableStream){this._error(A);return}this._readableStream.destroy(A)}_error(A){this._storedError=A,this._readCapability.resolve()}_setReadableStream(A){this._readableStream=A,A.on("readable",()=>{this._readCapability.resolve()}),A.on("end",()=>{A.destroy(),this._done=!0,this._readCapability.resolve()}),A.on("error",T=>{this._error(T)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function _(S,A){return{protocol:S.protocol,auth:S.auth,host:S.hostname,port:S.port,path:S.path,method:"GET",headers:A}}class g extends E{constructor(A){super(A);const T=w=>{if(w.statusCode===404){const D=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=D,this._headersCapability.reject(D);return}this._headersCapability.resolve(),this._setReadableStream(w);const P=D=>this._readableStream.headers[D.toLowerCase()],{allowRangeRequests:O,suggestedLength:k}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:P,isHttp:A.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=O,this._contentLength=k||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(P)};this._request=null,this._url.protocol==="http:"?this._request=l.request(_(this._url,A.httpHeaders),T):this._request=u.request(_(this._url,A.httpHeaders),T),this._request.on("error",w=>{this._storedError=w,this._headersCapability.reject(w)}),this._request.end()}}class x extends p{constructor(A,T,w){super(A),this._httpHeaders={};for(const O in A.httpHeaders){const k=A.httpHeaders[O];typeof k>"u"||(this._httpHeaders[O]=k)}this._httpHeaders.Range=`bytes=${T}-${w-1}`;const P=O=>{if(O.statusCode===404){const k=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=k;return}this._setReadableStream(O)};this._request=null,this._url.protocol==="http:"?this._request=l.request(_(this._url,this._httpHeaders),P):this._request=u.request(_(this._url,this._httpHeaders),P),this._request.on("error",O=>{this._storedError=O}),this._request.end()}}class C extends E{constructor(A){super(A);let T=decodeURIComponent(this._url.path);d.test(this._url.href)&&(T=T.replace(/^\//,"")),a.lstat(T,(w,P)=>{if(w){w.code==="ENOENT"&&(w=new t.MissingPDFException(`Missing PDF "${T}".`)),this._storedError=w,this._headersCapability.reject(w);return}this._contentLength=P.size,this._setReadableStream(a.createReadStream(T)),this._headersCapability.resolve()})}}class R extends p{constructor(A,T,w){super(A);let P=decodeURIComponent(this._url.path);d.test(this._url.href)&&(P=P.replace(/^\//,"")),this._setReadableStream(a.createReadStream(P,{start:T,end:w-1}))}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=u,e.extractFilenameFromHeader=l,e.validateRangeRequestCapabilities=a,e.validateResponseStatus=f;var t=r(2),n=r(21);function a({getResponseHeader:d,isHttp:h,rangeChunkSize:y,disableRange:E}){(0,t.assert)(y>0,"Range chunk size must be larger than zero");const p={allowRangeRequests:!1,suggestedLength:void 0},_=parseInt(d("Content-Length"),10);return!Number.isInteger(_)||(p.suggestedLength=_,_<=2*y)||E||!h||d("Accept-Ranges")!=="bytes"||(d("Content-Encoding")||"identity")!=="identity"||(p.allowRangeRequests=!0),p}function l(d){const h=d("Content-Disposition");if(h){let y=(0,n.getFilenameFromContentDispositionHeader)(h);if(y.includes("%"))try{y=decodeURIComponent(y)}catch{}if(/\.pdf$/i.test(y))return y}return null}function u(d,h){return d===404||d===0&&h.startsWith("file:")?new t.MissingPDFException('Missing PDF "'+h+'".'):new t.UnexpectedResponseException("Unexpected server response ("+d+') while retrieving PDF "'+h+'".',d)}function f(d){return d===200||d===206}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=t;function t(n){let a=!0,l=u("filename\\*","i").exec(n);if(l){l=l[1];let _=y(l);return _=unescape(_),_=E(_),_=p(_),d(_)}if(l=h(n),l){const _=p(l);return d(_)}if(l=u("filename","i").exec(n),l){l=l[1];let _=y(l);return _=p(_),d(_)}function u(_,g){return new RegExp("(?:^|;)\\s*"+_+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',g)}function f(_,g){if(_){if(!/^[\x00-\xFF]+$/.test(g))return g;try{const x=new TextDecoder(_,{fatal:!0}),C=Array.from(g,function(R){return R.charCodeAt(0)&255});g=x.decode(new Uint8Array(C)),a=!1}catch{if(/^utf-?8$/i.test(_))try{g=decodeURIComponent(escape(g)),a=!1}catch{}}}return g}function d(_){return a&&/[\x80-\xff]/.test(_)&&(_=f("utf-8",_),a&&(_=f("iso-8859-1",_))),_}function h(_){const g=[];let x;const C=u("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(x=C.exec(_))!==null;){let[,S,A,T]=x;if(S=parseInt(S,10),S in g){if(S===0)break;continue}g[S]=[A,T]}const R=[];for(let S=0;S<g.length&&S in g;++S){let[A,T]=g[S];T=y(T),A&&(T=unescape(T),S===0&&(T=E(T))),R.push(T)}return R.join("")}function y(_){if(_.startsWith('"')){const g=_.slice(1).split('\\"');for(let x=0;x<g.length;++x){const C=g[x].indexOf('"');C!==-1&&(g[x]=g[x].slice(0,C),g.length=x+1),g[x]=g[x].replace(/\\(.)/g,"$1")}_=g.join('"')}return _}function E(_){const g=_.indexOf("'");if(g===-1)return _;const x=_.slice(0,g),R=_.slice(g+1).replace(/^[^']*'/,"");return f(x,R)}function p(_){return!_.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(_)?_:_.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(g,x,C,R){if(C==="q"||C==="Q")return R=R.replace(/_/g," "),R=R.replace(/=([0-9a-fA-F]{2})/g,function(S,A){return String.fromCharCode(parseInt(A,16))}),f(x,R);try{R=atob(R)}catch{}return f(x,R)})}return""}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var t=r(2),n=r(20);const a=200,l=206;function u(E){const p=E.response;return typeof p!="string"?p:(0,t.stringToBytes)(p).buffer}class f{constructor(p,_){this.url=p,_=_||{},this.isHttp=/^https?:/i.test(p),this.httpHeaders=this.isHttp&&_.httpHeaders||{},this.withCredentials=_.withCredentials||!1,this.getXhr=_.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(p,_,g){const x={begin:p,end:_};for(const C in g)x[C]=g[C];return this.request(x)}requestFull(p){return this.request(p)}request(p){const _=this.getXhr(),g=this.currXhrId++,x=this.pendingRequests[g]={xhr:_};_.open("GET",this.url),_.withCredentials=this.withCredentials;for(const C in this.httpHeaders){const R=this.httpHeaders[C];typeof R>"u"||_.setRequestHeader(C,R)}return this.isHttp&&"begin"in p&&"end"in p?(_.setRequestHeader("Range",`bytes=${p.begin}-${p.end-1}`),x.expectedStatus=l):x.expectedStatus=a,_.responseType="arraybuffer",p.onError&&(_.onerror=function(C){p.onError(_.status)}),_.onreadystatechange=this.onStateChange.bind(this,g),_.onprogress=this.onProgress.bind(this,g),x.onHeadersReceived=p.onHeadersReceived,x.onDone=p.onDone,x.onError=p.onError,x.onProgress=p.onProgress,_.send(null),g}onProgress(p,_){const g=this.pendingRequests[p];g&&g.onProgress&&g.onProgress(_)}onStateChange(p,_){const g=this.pendingRequests[p];if(!g)return;const x=g.xhr;if(x.readyState>=2&&g.onHeadersReceived&&(g.onHeadersReceived(),delete g.onHeadersReceived),x.readyState!==4||!(p in this.pendingRequests))return;if(delete this.pendingRequests[p],x.status===0&&this.isHttp){g.onError&&g.onError(x.status);return}const C=x.status||a;if(!(C===a&&g.expectedStatus===l)&&C!==g.expectedStatus){g.onError&&g.onError(x.status);return}const S=u(x);if(C===l){const A=x.getResponseHeader("Content-Range"),T=/bytes (\d+)-(\d+)\/(\d+)/.exec(A);g.onDone({begin:parseInt(T[1],10),chunk:S})}else S?g.onDone({begin:0,chunk:S}):g.onError&&g.onError(x.status)}hasPendingRequests(){for(const p in this.pendingRequests)return!0;return!1}getRequestXhr(p){return this.pendingRequests[p].xhr}isPendingRequest(p){return p in this.pendingRequests}abortAllRequests(){for(const p in this.pendingRequests)this.abortRequest(p|0)}abortRequest(p){const _=this.pendingRequests[p].xhr;delete this.pendingRequests[p],_.abort()}}class d{constructor(p){this._source=p,this._manager=new f(p.url,{httpHeaders:p.httpHeaders,withCredentials:p.withCredentials}),this._rangeChunkSize=p.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(p){const _=this._rangeRequestReaders.indexOf(p);_>=0&&this._rangeRequestReaders.splice(_,1)}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new h(this._manager,this._source),this._fullRequestReader}getRangeReader(p,_){const g=new y(this._manager,p,_);return g.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(g),g}cancelAllRequests(p){this._fullRequestReader&&this._fullRequestReader.cancel(p),this._rangeRequestReaders.slice(0).forEach(function(g){g.cancel(p)})}}e.PDFNetworkStream=d;class h{constructor(p,_){this._manager=p;const g={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=_.url,this._fullRequestId=p.requestFull(g),this._headersReceivedCapability=(0,t.createPromiseCapability)(),this._disableRange=_.disableRange||!1,this._contentLength=_.length,this._rangeChunkSize=_.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const p=this._fullRequestId,_=this._manager.getRequestXhr(p),g=R=>_.getResponseHeader(R),{allowRangeRequests:x,suggestedLength:C}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:g,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});x&&(this._isRangeSupported=!0),this._contentLength=C||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(g),this._isRangeSupported&&this._manager.abortRequest(p),this._headersReceivedCapability.resolve()}_onDone(p){p&&(this._requests.length>0?this._requests.shift().resolve({value:p.chunk,done:!1}):this._cachedChunks.push(p.chunk)),this._done=!0,!(this._cachedChunks.length>0)&&(this._requests.forEach(function(_){_.resolve({value:void 0,done:!0})}),this._requests=[])}_onError(p){const _=this._url,g=(0,n.createResponseStatusError)(p,_);this._storedError=g,this._headersReceivedCapability.reject(g),this._requests.forEach(function(x){x.reject(g)}),this._requests=[],this._cachedChunks=[]}_onProgress(p){this.onProgress&&this.onProgress({loaded:p.loaded,total:p.lengthComputable?p.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const p=(0,t.createPromiseCapability)();return this._requests.push(p),p.promise}cancel(p){this._done=!0,this._headersReceivedCapability.reject(p),this._requests.forEach(function(_){_.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class y{constructor(p,_,g){this._manager=p;const x={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=p.requestRange(_,g,x),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(p){const _=p.chunk;this._requests.length>0?this._requests.shift().resolve({value:_,done:!1}):this._queuedChunk=_,this._done=!0,this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}_onProgress(p){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:p.loaded})}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk!==null){const _=this._queuedChunk;return this._queuedChunk=null,{value:_,done:!1}}if(this._done)return{value:void 0,done:!0};const p=(0,t.createPromiseCapability)();return this._requests.push(p),p.promise}cancel(p){this._done=!0,this._requests.forEach(function(_){_.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},function(o,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var t=r(2),n=r(20);function a(h,y,E){return{method:"GET",headers:h,signal:E&&E.signal,mode:"cors",credentials:y?"include":"same-origin",redirect:"follow"}}function l(h){const y=new Headers;for(const E in h){const p=h[E];typeof p>"u"||y.append(E,p)}return y}class u{constructor(y){this.source=y,this.isHttp=/^https?:/i.test(y.url),this.httpHeaders=this.isHttp&&y.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new f(this),this._fullRequestReader}getRangeReader(y,E){if(E<=this._progressiveDataLength)return null;const p=new d(this,y,E);return this._rangeRequestReaders.push(p),p}cancelAllRequests(y){this._fullRequestReader&&this._fullRequestReader.cancel(y),this._rangeRequestReaders.slice(0).forEach(function(p){p.cancel(y)})}}e.PDFFetchStream=u;class f{constructor(y){this._stream=y,this._reader=null,this._loaded=0,this._filename=null;const E=y.source;this._withCredentials=E.withCredentials||!1,this._contentLength=E.length,this._headersCapability=(0,t.createPromiseCapability)(),this._disableRange=E.disableRange||!1,this._rangeChunkSize=E.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!E.disableStream,this._isRangeSupported=!E.disableRange,this._headers=l(this._stream.httpHeaders);const p=E.url;fetch(p,a(this._headers,this._withCredentials,this._abortController)).then(_=>{if(!(0,n.validateResponseStatus)(_.status))throw(0,n.createResponseStatusError)(_.status,p);this._reader=_.body.getReader(),this._headersCapability.resolve();const g=R=>_.headers.get(R),{allowRangeRequests:x,suggestedLength:C}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:g,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=x,this._contentLength=C||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(g),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new t.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:y,done:E}=await this._reader.read();return E?{value:y,done:E}:(this._loaded+=y.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(y).buffer,done:!1})}cancel(y){this._reader&&this._reader.cancel(y),this._abortController&&this._abortController.abort()}}class d{constructor(y,E,p){this._stream=y,this._reader=null,this._loaded=0;const _=y.source;this._withCredentials=_.withCredentials||!1,this._readCapability=(0,t.createPromiseCapability)(),this._isStreamingSupported=!_.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${E}-${p-1}`);const g=_.url;fetch(g,a(this._headers,this._withCredentials,this._abortController)).then(x=>{if(!(0,n.validateResponseStatus)(x.status))throw(0,n.createResponseStatusError)(x.status,g);this._readCapability.resolve(),this._reader=x.body.getReader()}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:y,done:E}=await this._reader.read();return E?{value:y,done:E}:(this._loaded+=y.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(y).buffer,done:!1})}cancel(y){this._reader&&this._reader.cancel(y),this._abortController&&this._abortController.abort()}}}])})})(pdf);var pdfExports=pdf.exports;function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(o[t]=r[t])}return o},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(o,e){if(o==null)return{};var r={},t=Object.keys(o),n,a;for(a=0;a<t.length;a++)n=t[a],!(e.indexOf(n)>=0)&&(r[n]=o[n]);return r}function _objectWithoutProperties(o,e){if(o==null)return{};var r=_objectWithoutPropertiesLoose(o,e),t,n;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(o);for(n=0;n<a.length;n++)t=a[n],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(o,t)&&(r[t]=o[t])}return r}function _typeof$1(o){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(o)}var regeneratorRuntime$1={exports:{}},_typeof={exports:{}};(function(o){function e(r){"@babel/helpers - typeof";return o.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o.exports.__esModule=!0,o.exports.default=o.exports,e(r)}o.exports=e,o.exports.__esModule=!0,o.exports.default=o.exports})(_typeof);var _typeofExports=_typeof.exports;(function(o){var e=_typeofExports.default;function r(){o.exports=r=function(){return n},o.exports.__esModule=!0,o.exports.default=o.exports;var t,n={},a=Object.prototype,l=a.hasOwnProperty,u=Object.defineProperty||function($,I,B){$[I]=B.value},f=typeof Symbol=="function"?Symbol:{},d=f.iterator||"@@iterator",h=f.asyncIterator||"@@asyncIterator",y=f.toStringTag||"@@toStringTag";function E($,I,B){return Object.defineProperty($,I,{value:B,enumerable:!0,configurable:!0,writable:!0}),$[I]}try{E({},"")}catch{E=function(B,X,Q){return B[X]=Q}}function p($,I,B,X){var Q=I&&I.prototype instanceof A?I:A,J=Object.create(Q.prototype),ne=new z(X||[]);return u(J,"_invoke",{value:V($,B,ne)}),J}function _($,I,B){try{return{type:"normal",arg:$.call(I,B)}}catch(X){return{type:"throw",arg:X}}}n.wrap=p;var g="suspendedStart",x="suspendedYield",C="executing",R="completed",S={};function A(){}function T(){}function w(){}var P={};E(P,d,function(){return this});var O=Object.getPrototypeOf,k=O&&O(O(U([])));k&&k!==a&&l.call(k,d)&&(P=k);var D=w.prototype=A.prototype=Object.create(P);function F($){["next","throw","return"].forEach(function(I){E($,I,function(B){return this._invoke(I,B)})})}function G($,I){function B(Q,J,ne,ae){var Z=_($[Q],$,J);if(Z.type!=="throw"){var se=Z.arg,oe=se.value;return oe&&e(oe)=="object"&&l.call(oe,"__await")?I.resolve(oe.__await).then(function(fe){B("next",fe,ne,ae)},function(fe){B("throw",fe,ne,ae)}):I.resolve(oe).then(function(fe){se.value=fe,ne(se)},function(fe){return B("throw",fe,ne,ae)})}ae(Z.arg)}var X;u(this,"_invoke",{value:function(J,ne){function ae(){return new I(function(Z,se){B(J,ne,Z,se)})}return X=X?X.then(ae,ae):ae()}})}function V($,I,B){var X=g;return function(Q,J){if(X===C)throw new Error("Generator is already running");if(X===R){if(Q==="throw")throw J;return{value:t,done:!0}}for(B.method=Q,B.arg=J;;){var ne=B.delegate;if(ne){var ae=W(ne,B);if(ae){if(ae===S)continue;return ae}}if(B.method==="next")B.sent=B._sent=B.arg;else if(B.method==="throw"){if(X===g)throw X=R,B.arg;B.dispatchException(B.arg)}else B.method==="return"&&B.abrupt("return",B.arg);X=C;var Z=_($,I,B);if(Z.type==="normal"){if(X=B.done?R:x,Z.arg===S)continue;return{value:Z.arg,done:B.done}}Z.type==="throw"&&(X=R,B.method="throw",B.arg=Z.arg)}}}function W($,I){var B=I.method,X=$.iterator[B];if(X===t)return I.delegate=null,B==="throw"&&$.iterator.return&&(I.method="return",I.arg=t,W($,I),I.method==="throw")||B!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+B+"' method")),S;var Q=_(X,$.iterator,I.arg);if(Q.type==="throw")return I.method="throw",I.arg=Q.arg,I.delegate=null,S;var J=Q.arg;return J?J.done?(I[$.resultName]=J.value,I.next=$.nextLoc,I.method!=="return"&&(I.method="next",I.arg=t),I.delegate=null,S):J:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,S)}function ee($){var I={tryLoc:$[0]};1 in $&&(I.catchLoc=$[1]),2 in $&&(I.finallyLoc=$[2],I.afterLoc=$[3]),this.tryEntries.push(I)}function q($){var I=$.completion||{};I.type="normal",delete I.arg,$.completion=I}function z($){this.tryEntries=[{tryLoc:"root"}],$.forEach(ee,this),this.reset(!0)}function U($){if($||$===""){var I=$[d];if(I)return I.call($);if(typeof $.next=="function")return $;if(!isNaN($.length)){var B=-1,X=function Q(){for(;++B<$.length;)if(l.call($,B))return Q.value=$[B],Q.done=!1,Q;return Q.value=t,Q.done=!0,Q};return X.next=X}}throw new TypeError(e($)+" is not iterable")}return T.prototype=w,u(D,"constructor",{value:w,configurable:!0}),u(w,"constructor",{value:T,configurable:!0}),T.displayName=E(w,y,"GeneratorFunction"),n.isGeneratorFunction=function($){var I=typeof $=="function"&&$.constructor;return!!I&&(I===T||(I.displayName||I.name)==="GeneratorFunction")},n.mark=function($){return Object.setPrototypeOf?Object.setPrototypeOf($,w):($.__proto__=w,E($,y,"GeneratorFunction")),$.prototype=Object.create(D),$},n.awrap=function($){return{__await:$}},F(G.prototype),E(G.prototype,h,function(){return this}),n.AsyncIterator=G,n.async=function($,I,B,X,Q){Q===void 0&&(Q=Promise);var J=new G(p($,I,B,X),Q);return n.isGeneratorFunction(I)?J:J.next().then(function(ne){return ne.done?ne.value:J.next()})},F(D),E(D,y,"Generator"),E(D,d,function(){return this}),E(D,"toString",function(){return"[object Generator]"}),n.keys=function($){var I=Object($),B=[];for(var X in I)B.push(X);return B.reverse(),function Q(){for(;B.length;){var J=B.pop();if(J in I)return Q.value=J,Q.done=!1,Q}return Q.done=!0,Q}},n.values=U,z.prototype={constructor:z,reset:function(I){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!I)for(var B in this)B.charAt(0)==="t"&&l.call(this,B)&&!isNaN(+B.slice(1))&&(this[B]=t)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var B=this;function X(se,oe){return ne.type="throw",ne.arg=I,B.next=se,oe&&(B.method="next",B.arg=t),!!oe}for(var Q=this.tryEntries.length-1;Q>=0;--Q){var J=this.tryEntries[Q],ne=J.completion;if(J.tryLoc==="root")return X("end");if(J.tryLoc<=this.prev){var ae=l.call(J,"catchLoc"),Z=l.call(J,"finallyLoc");if(ae&&Z){if(this.prev<J.catchLoc)return X(J.catchLoc,!0);if(this.prev<J.finallyLoc)return X(J.finallyLoc)}else if(ae){if(this.prev<J.catchLoc)return X(J.catchLoc,!0)}else{if(!Z)throw new Error("try statement without catch or finally");if(this.prev<J.finallyLoc)return X(J.finallyLoc)}}}},abrupt:function(I,B){for(var X=this.tryEntries.length-1;X>=0;--X){var Q=this.tryEntries[X];if(Q.tryLoc<=this.prev&&l.call(Q,"finallyLoc")&&this.prev<Q.finallyLoc){var J=Q;break}}J&&(I==="break"||I==="continue")&&J.tryLoc<=B&&B<=J.finallyLoc&&(J=null);var ne=J?J.completion:{};return ne.type=I,ne.arg=B,J?(this.method="next",this.next=J.finallyLoc,S):this.complete(ne)},complete:function(I,B){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&B&&(this.next=B),S},finish:function(I){for(var B=this.tryEntries.length-1;B>=0;--B){var X=this.tryEntries[B];if(X.finallyLoc===I)return this.complete(X.completion,X.afterLoc),q(X),S}},catch:function(I){for(var B=this.tryEntries.length-1;B>=0;--B){var X=this.tryEntries[B];if(X.tryLoc===I){var Q=X.completion;if(Q.type==="throw"){var J=Q.arg;q(X)}return J}}throw new Error("illegal catch attempt")},delegateYield:function(I,B,X){return this.delegate={iterator:U(I),resultName:B,nextLoc:X},this.method==="next"&&(this.arg=t),S}},n}o.exports=r,o.exports.__esModule=!0,o.exports.default=o.exports})(regeneratorRuntime$1);var regeneratorRuntimeExports=regeneratorRuntime$1.exports,runtime=regeneratorRuntimeExports(),regenerator=runtime;try{regeneratorRuntime=runtime}catch(o){typeof globalThis=="object"?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}const _regeneratorRuntime=getDefaultExportFromCjs(regenerator);function asyncGeneratorStep(o,e,r,t,n,a,l){try{var u=o[a](l),f=u.value}catch(d){r(d);return}u.done?e(f):Promise.resolve(f).then(t,n)}function _asyncToGenerator(o){return function(){var e=this,r=arguments;return new Promise(function(t,n){var a=o.apply(e,r);function l(f){asyncGeneratorStep(a,t,n,l,u,"next",f)}function u(f){asyncGeneratorStep(a,t,n,l,u,"throw",f)}l(void 0)})}}function _classCallCheck(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function toPrimitive(o,e){if(_typeof$1(o)!="object"||!o)return o;var r=o[Symbol.toPrimitive];if(r!==void 0){var t=r.call(o,e||"default");if(_typeof$1(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function toPropertyKey(o){var e=toPrimitive(o,"string");return _typeof$1(e)=="symbol"?e:String(e)}function _defineProperties(o,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,toPropertyKey(t.key),t)}}function _createClass(o,e,r){return e&&_defineProperties(o.prototype,e),r&&_defineProperties(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}function _assertThisInitialized$1(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function _setPrototypeOf(o,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_setPrototypeOf(o,e)}function _inherits(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&_setPrototypeOf(o,e)}function _possibleConstructorReturn(o,e){if(e&&(_typeof$1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(o)}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(o)}function _defineProperty(o,e,r){return e=toPropertyKey(e),e in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}var propTypes$1={exports:{}},reactIs={exports:{}},reactIs_production_min={};/** @license React v16.13.1
32
+ * react-is.production.min.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 hasRequiredReactIs_production_min;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var o=typeof Symbol=="function"&&Symbol.for,e=o?Symbol.for("react.element"):60103,r=o?Symbol.for("react.portal"):60106,t=o?Symbol.for("react.fragment"):60107,n=o?Symbol.for("react.strict_mode"):60108,a=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,u=o?Symbol.for("react.context"):60110,f=o?Symbol.for("react.async_mode"):60111,d=o?Symbol.for("react.concurrent_mode"):60111,h=o?Symbol.for("react.forward_ref"):60112,y=o?Symbol.for("react.suspense"):60113,E=o?Symbol.for("react.suspense_list"):60120,p=o?Symbol.for("react.memo"):60115,_=o?Symbol.for("react.lazy"):60116,g=o?Symbol.for("react.block"):60121,x=o?Symbol.for("react.fundamental"):60117,C=o?Symbol.for("react.responder"):60118,R=o?Symbol.for("react.scope"):60119;function S(T){if(typeof T=="object"&&T!==null){var w=T.$$typeof;switch(w){case e:switch(T=T.type,T){case f:case d:case t:case a:case n:case y:return T;default:switch(T=T&&T.$$typeof,T){case u:case h:case _:case p:case l:return T;default:return w}}case r:return w}}}function A(T){return S(T)===d}return reactIs_production_min.AsyncMode=f,reactIs_production_min.ConcurrentMode=d,reactIs_production_min.ContextConsumer=u,reactIs_production_min.ContextProvider=l,reactIs_production_min.Element=e,reactIs_production_min.ForwardRef=h,reactIs_production_min.Fragment=t,reactIs_production_min.Lazy=_,reactIs_production_min.Memo=p,reactIs_production_min.Portal=r,reactIs_production_min.Profiler=a,reactIs_production_min.StrictMode=n,reactIs_production_min.Suspense=y,reactIs_production_min.isAsyncMode=function(T){return A(T)||S(T)===f},reactIs_production_min.isConcurrentMode=A,reactIs_production_min.isContextConsumer=function(T){return S(T)===u},reactIs_production_min.isContextProvider=function(T){return S(T)===l},reactIs_production_min.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===e},reactIs_production_min.isForwardRef=function(T){return S(T)===h},reactIs_production_min.isFragment=function(T){return S(T)===t},reactIs_production_min.isLazy=function(T){return S(T)===_},reactIs_production_min.isMemo=function(T){return S(T)===p},reactIs_production_min.isPortal=function(T){return S(T)===r},reactIs_production_min.isProfiler=function(T){return S(T)===a},reactIs_production_min.isStrictMode=function(T){return S(T)===n},reactIs_production_min.isSuspense=function(T){return S(T)===y},reactIs_production_min.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===t||T===d||T===a||T===n||T===y||T===E||typeof T=="object"&&T!==null&&(T.$$typeof===_||T.$$typeof===p||T.$$typeof===l||T.$$typeof===u||T.$$typeof===h||T.$$typeof===x||T.$$typeof===C||T.$$typeof===R||T.$$typeof===g)},reactIs_production_min.typeOf=S,reactIs_production_min}var reactIs_development={};/** @license React v16.13.1
39
+ * react-is.development.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 hasRequiredReactIs_development;function requireReactIs_development(){return hasRequiredReactIs_development||(hasRequiredReactIs_development=1,process.env.NODE_ENV!=="production"&&function(){var o=typeof Symbol=="function"&&Symbol.for,e=o?Symbol.for("react.element"):60103,r=o?Symbol.for("react.portal"):60106,t=o?Symbol.for("react.fragment"):60107,n=o?Symbol.for("react.strict_mode"):60108,a=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,u=o?Symbol.for("react.context"):60110,f=o?Symbol.for("react.async_mode"):60111,d=o?Symbol.for("react.concurrent_mode"):60111,h=o?Symbol.for("react.forward_ref"):60112,y=o?Symbol.for("react.suspense"):60113,E=o?Symbol.for("react.suspense_list"):60120,p=o?Symbol.for("react.memo"):60115,_=o?Symbol.for("react.lazy"):60116,g=o?Symbol.for("react.block"):60121,x=o?Symbol.for("react.fundamental"):60117,C=o?Symbol.for("react.responder"):60118,R=o?Symbol.for("react.scope"):60119;function S(ce){return typeof ce=="string"||typeof ce=="function"||ce===t||ce===d||ce===a||ce===n||ce===y||ce===E||typeof ce=="object"&&ce!==null&&(ce.$$typeof===_||ce.$$typeof===p||ce.$$typeof===l||ce.$$typeof===u||ce.$$typeof===h||ce.$$typeof===x||ce.$$typeof===C||ce.$$typeof===R||ce.$$typeof===g)}function A(ce){if(typeof ce=="object"&&ce!==null){var Se=ce.$$typeof;switch(Se){case e:var Le=ce.type;switch(Le){case f:case d:case t:case a:case n:case y:return Le;default:var Ne=Le&&Le.$$typeof;switch(Ne){case u:case h:case _:case p:case l:return Ne;default:return Se}}case r:return Se}}}var T=f,w=d,P=u,O=l,k=e,D=h,F=t,G=_,V=p,W=r,ee=a,q=n,z=y,U=!1;function $(ce){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),I(ce)||A(ce)===f}function I(ce){return A(ce)===d}function B(ce){return A(ce)===u}function X(ce){return A(ce)===l}function Q(ce){return typeof ce=="object"&&ce!==null&&ce.$$typeof===e}function J(ce){return A(ce)===h}function ne(ce){return A(ce)===t}function ae(ce){return A(ce)===_}function Z(ce){return A(ce)===p}function se(ce){return A(ce)===r}function oe(ce){return A(ce)===a}function fe(ce){return A(ce)===n}function de(ce){return A(ce)===y}reactIs_development.AsyncMode=T,reactIs_development.ConcurrentMode=w,reactIs_development.ContextConsumer=P,reactIs_development.ContextProvider=O,reactIs_development.Element=k,reactIs_development.ForwardRef=D,reactIs_development.Fragment=F,reactIs_development.Lazy=G,reactIs_development.Memo=V,reactIs_development.Portal=W,reactIs_development.Profiler=ee,reactIs_development.StrictMode=q,reactIs_development.Suspense=z,reactIs_development.isAsyncMode=$,reactIs_development.isConcurrentMode=I,reactIs_development.isContextConsumer=B,reactIs_development.isContextProvider=X,reactIs_development.isElement=Q,reactIs_development.isForwardRef=J,reactIs_development.isFragment=ne,reactIs_development.isLazy=ae,reactIs_development.isMemo=Z,reactIs_development.isPortal=se,reactIs_development.isProfiler=oe,reactIs_development.isStrictMode=fe,reactIs_development.isSuspense=de,reactIs_development.isValidElementType=S,reactIs_development.typeOf=A}()),reactIs_development}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs||(hasRequiredReactIs=1,process.env.NODE_ENV==="production"?reactIs.exports=requireReactIs_production_min():reactIs.exports=requireReactIs_development()),reactIs.exports}/*
46
+ object-assign
47
+ (c) Sindre Sorhus
48
+ @license MIT
49
+ */var objectAssign,hasRequiredObjectAssign;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var o=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function t(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function n(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var l={},u=0;u<10;u++)l["_"+String.fromCharCode(u)]=u;var f=Object.getOwnPropertyNames(l).map(function(h){return l[h]});if(f.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(h){d[h]=h}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return objectAssign=n()?Object.assign:function(a,l){for(var u,f=t(a),d,h=1;h<arguments.length;h++){u=Object(arguments[h]);for(var y in u)e.call(u,y)&&(f[y]=u[y]);if(o){d=o(u);for(var E=0;E<d.length;E++)r.call(u,d[E])&&(f[d[E]]=u[d[E]])}}return f},objectAssign}var ReactPropTypesSecret_1$1,hasRequiredReactPropTypesSecret$1;function requireReactPropTypesSecret$1(){if(hasRequiredReactPropTypesSecret$1)return ReactPropTypesSecret_1$1;hasRequiredReactPropTypesSecret$1=1;var o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1$1=o,ReactPropTypesSecret_1$1}var has,hasRequiredHas;function requireHas(){return hasRequiredHas||(hasRequiredHas=1,has=Function.call.bind(Object.prototype.hasOwnProperty)),has}var checkPropTypes_1$1,hasRequiredCheckPropTypes$1;function requireCheckPropTypes$1(){if(hasRequiredCheckPropTypes$1)return checkPropTypes_1$1;hasRequiredCheckPropTypes$1=1;var o=function(){};if(process.env.NODE_ENV!=="production"){var e=requireReactPropTypesSecret$1(),r={},t=requireHas();o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function n(a,l,u,f,d){if(process.env.NODE_ENV!=="production"){for(var h in a)if(t(a,h)){var y;try{if(typeof a[h]!="function"){var E=Error((f||"React class")+": "+u+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}y=a[h](l,h,f,u,null,e)}catch(_){y=_}if(y&&!(y instanceof Error)&&o((f||"React class")+": type specification of "+u+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof y+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),y instanceof Error&&!(y.message in r)){r[y.message]=!0;var p=d?d():"";o("Failed "+u+" type: "+y.message+(p??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},checkPropTypes_1$1=n,checkPropTypes_1$1}var factoryWithTypeCheckers$1,hasRequiredFactoryWithTypeCheckers$1;function requireFactoryWithTypeCheckers$1(){if(hasRequiredFactoryWithTypeCheckers$1)return factoryWithTypeCheckers$1;hasRequiredFactoryWithTypeCheckers$1=1;var o=requireReactIs(),e=requireObjectAssign(),r=requireReactPropTypesSecret$1(),t=requireHas(),n=requireCheckPropTypes$1(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(u){var f="Warning: "+u;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function l(){return null}return factoryWithTypeCheckers$1=function(u,f){var d=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function y(I){var B=I&&(d&&I[d]||I[h]);if(typeof B=="function")return B}var E="<<anonymous>>",p={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:R(),arrayOf:S,element:A(),elementType:T(),instanceOf:w,node:D(),objectOf:O,oneOf:P,oneOfType:k,shape:G,exact:V};function _(I,B){return I===B?I!==0||1/I===1/B:I!==I&&B!==B}function g(I,B){this.message=I,this.data=B&&typeof B=="object"?B:{},this.stack=""}g.prototype=Error.prototype;function x(I){if(process.env.NODE_ENV!=="production")var B={},X=0;function Q(ne,ae,Z,se,oe,fe,de){if(se=se||E,fe=fe||Z,de!==r){if(f){var ce=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 ce.name="Invariant Violation",ce}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=se+":"+Z;!B[Se]&&X<3&&(a("You are manually calling a React.PropTypes validation function for the `"+fe+"` prop on `"+se+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),B[Se]=!0,X++)}}return ae[Z]==null?ne?ae[Z]===null?new g("The "+oe+" `"+fe+"` is marked as required "+("in `"+se+"`, but its value is `null`.")):new g("The "+oe+" `"+fe+"` is marked as required in "+("`"+se+"`, but its value is `undefined`.")):null:I(ae,Z,se,oe,fe)}var J=Q.bind(null,!1);return J.isRequired=Q.bind(null,!0),J}function C(I){function B(X,Q,J,ne,ae,Z){var se=X[Q],oe=q(se);if(oe!==I){var fe=z(se);return new g("Invalid "+ne+" `"+ae+"` of type "+("`"+fe+"` supplied to `"+J+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return x(B)}function R(){return x(l)}function S(I){function B(X,Q,J,ne,ae){if(typeof I!="function")return new g("Property `"+ae+"` of component `"+J+"` has invalid PropType notation inside arrayOf.");var Z=X[Q];if(!Array.isArray(Z)){var se=q(Z);return new g("Invalid "+ne+" `"+ae+"` of type "+("`"+se+"` supplied to `"+J+"`, expected an array."))}for(var oe=0;oe<Z.length;oe++){var fe=I(Z,oe,J,ne,ae+"["+oe+"]",r);if(fe instanceof Error)return fe}return null}return x(B)}function A(){function I(B,X,Q,J,ne){var ae=B[X];if(!u(ae)){var Z=q(ae);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return x(I)}function T(){function I(B,X,Q,J,ne){var ae=B[X];if(!o.isValidElementType(ae)){var Z=q(ae);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return x(I)}function w(I){function B(X,Q,J,ne,ae){if(!(X[Q]instanceof I)){var Z=I.name||E,se=$(X[Q]);return new g("Invalid "+ne+" `"+ae+"` of type "+("`"+se+"` supplied to `"+J+"`, expected ")+("instance of `"+Z+"`."))}return null}return x(B)}function P(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),l;function B(X,Q,J,ne,ae){for(var Z=X[Q],se=0;se<I.length;se++)if(_(Z,I[se]))return null;var oe=JSON.stringify(I,function(de,ce){var Se=z(ce);return Se==="symbol"?String(ce):ce});return new g("Invalid "+ne+" `"+ae+"` of value `"+String(Z)+"` "+("supplied to `"+J+"`, expected one of "+oe+"."))}return x(B)}function O(I){function B(X,Q,J,ne,ae){if(typeof I!="function")return new g("Property `"+ae+"` of component `"+J+"` has invalid PropType notation inside objectOf.");var Z=X[Q],se=q(Z);if(se!=="object")return new g("Invalid "+ne+" `"+ae+"` of type "+("`"+se+"` supplied to `"+J+"`, expected an object."));for(var oe in Z)if(t(Z,oe)){var fe=I(Z,oe,J,ne,ae+"."+oe,r);if(fe instanceof Error)return fe}return null}return x(B)}function k(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var B=0;B<I.length;B++){var X=I[B];if(typeof X!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(X)+" at index "+B+"."),l}function Q(J,ne,ae,Z,se){for(var oe=[],fe=0;fe<I.length;fe++){var de=I[fe],ce=de(J,ne,ae,Z,se,r);if(ce==null)return null;ce.data&&t(ce.data,"expectedType")&&oe.push(ce.data.expectedType)}var Se=oe.length>0?", expected one of type ["+oe.join(", ")+"]":"";return new g("Invalid "+Z+" `"+se+"` supplied to "+("`"+ae+"`"+Se+"."))}return x(Q)}function D(){function I(B,X,Q,J,ne){return W(B[X])?null:new g("Invalid "+J+" `"+ne+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return x(I)}function F(I,B,X,Q,J){return new g((I||"React class")+": "+B+" type `"+X+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+J+"`.")}function G(I){function B(X,Q,J,ne,ae){var Z=X[Q],se=q(Z);if(se!=="object")return new g("Invalid "+ne+" `"+ae+"` of type `"+se+"` "+("supplied to `"+J+"`, expected `object`."));for(var oe in I){var fe=I[oe];if(typeof fe!="function")return F(J,ne,ae,oe,z(fe));var de=fe(Z,oe,J,ne,ae+"."+oe,r);if(de)return de}return null}return x(B)}function V(I){function B(X,Q,J,ne,ae){var Z=X[Q],se=q(Z);if(se!=="object")return new g("Invalid "+ne+" `"+ae+"` of type `"+se+"` "+("supplied to `"+J+"`, expected `object`."));var oe=e({},X[Q],I);for(var fe in oe){var de=I[fe];if(t(I,fe)&&typeof de!="function")return F(J,ne,ae,fe,z(de));if(!de)return new g("Invalid "+ne+" `"+ae+"` key `"+fe+"` supplied to `"+J+"`.\nBad object: "+JSON.stringify(X[Q],null," ")+`
50
+ Valid keys: `+JSON.stringify(Object.keys(I),null," "));var ce=de(Z,fe,J,ne,ae+"."+fe,r);if(ce)return ce}return null}return x(B)}function W(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(W);if(I===null||u(I))return!0;var B=y(I);if(B){var X=B.call(I),Q;if(B!==I.entries){for(;!(Q=X.next()).done;)if(!W(Q.value))return!1}else for(;!(Q=X.next()).done;){var J=Q.value;if(J&&!W(J[1]))return!1}}else return!1;return!0;default:return!1}}function ee(I,B){return I==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function q(I){var B=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":ee(B,I)?"symbol":B}function z(I){if(typeof I>"u"||I===null)return""+I;var B=q(I);if(B==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return B}function U(I){var B=z(I);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function $(I){return!I.constructor||!I.constructor.name?E:I.constructor.name}return p.checkPropTypes=n,p.resetWarningCache=n.resetWarningCache,p.PropTypes=p,p},factoryWithTypeCheckers$1}var factoryWithThrowingShims$1,hasRequiredFactoryWithThrowingShims$1;function requireFactoryWithThrowingShims$1(){if(hasRequiredFactoryWithThrowingShims$1)return factoryWithThrowingShims$1;hasRequiredFactoryWithThrowingShims$1=1;var o=requireReactPropTypesSecret$1();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims$1=function(){function t(l,u,f,d,h,y){if(y!==o){var E=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 E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims$1}if(process.env.NODE_ENV!=="production"){var ReactIs$1=requireReactIs(),throwOnDirectAccess$1=!0;propTypes$1.exports=requireFactoryWithTypeCheckers$1()(ReactIs$1.isElement,throwOnDirectAccess$1)}else propTypes$1.exports=requireFactoryWithThrowingShims$1()();var propTypesExports$1=propTypes$1.exports;const PropTypes$1=getDefaultExportFromCjs(propTypesExports$1);var __spreadArray=globalThis&&globalThis.__spreadArray||function(o,e,r){if(r||arguments.length===2)for(var t=0,n=e.length,a;t<n;t++)(a||!(t in e))&&(a||(a=Array.prototype.slice.call(e,0,t)),a[t]=e[t]);return o.concat(a||Array.prototype.slice.call(e))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(o,e){var r={};return allEvents.forEach(function(t){var n=o[t];n&&(e?r[t]=function(a){return n(a,e(t))}:r[t]=n)}),r}function makeCancellablePromise(o){var e=!1,r=new Promise(function(t,n){o.then(function(a){return!e&&t(a)}).catch(function(a){return!e&&n(a)})});return{promise:r,cancel:function(){e=!0}}}function mergeClassNames(){return Array.prototype.slice.call(arguments).reduce(function(o,e){return o.concat(e)},[]).filter(function(o){return typeof o=="string"}).join(" ")}const DocumentContext=React$2.createContext(null);function Message$1(o){var e=o.children,r=o.type;return React$2.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(r)},e)}Message$1.propTypes={children:PropTypes$1.node,type:PropTypes$1.oneOf(["error","loading","no-data"]).isRequired};var pdf_link_service={},ui_utils={};Object.defineProperty(ui_utils,"__esModule",{value:!0});ui_utils.isValidRotation=isValidRotation;ui_utils.isValidScrollMode=isValidScrollMode;ui_utils.isValidSpreadMode=isValidSpreadMode;ui_utils.isPortraitOrientation=isPortraitOrientation;ui_utils.clamp=clamp$1;ui_utils.getPDFFileNameFromURL=getPDFFileNameFromURL;ui_utils.noContextMenuHandler=noContextMenuHandler;ui_utils.parseQueryString=parseQueryString;ui_utils.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements;ui_utils.getVisibleElements=getVisibleElements;ui_utils.roundToDivide=roundToDivide;ui_utils.getPageSizeInches=getPageSizeInches;ui_utils.approximateFraction=approximateFraction;ui_utils.getOutputScale=getOutputScale;ui_utils.scrollIntoView=scrollIntoView;ui_utils.watchScroll=watchScroll;ui_utils.binarySearchFirstItem=binarySearchFirstItem;ui_utils.normalizeWheelEventDelta=normalizeWheelEventDelta;ui_utils.waitOnEventOrTimeout=waitOnEventOrTimeout;ui_utils.moveToEndOfArray=moveToEndOfArray;ui_utils.WaitOnType=ui_utils.animationStarted=ui_utils.ProgressBar=EventBus_1=ui_utils.EventBus=ui_utils.NullL10n=ui_utils.SpreadMode=ui_utils.ScrollMode=ui_utils.TextLayerMode=ui_utils.RendererType=ui_utils.PresentationModeState=ui_utils.VERTICAL_PADDING=ui_utils.SCROLLBAR_PADDING=ui_utils.MAX_AUTO_SCALE=ui_utils.UNKNOWN_SCALE=ui_utils.MAX_SCALE=ui_utils.MIN_SCALE=ui_utils.DEFAULT_SCALE=ui_utils.DEFAULT_SCALE_VALUE=ui_utils.CSS_UNITS=ui_utils.AutoPrintRegExp=void 0;const CSS_UNITS=96/72;ui_utils.CSS_UNITS=CSS_UNITS;const DEFAULT_SCALE_VALUE="auto";ui_utils.DEFAULT_SCALE_VALUE=DEFAULT_SCALE_VALUE;const DEFAULT_SCALE=1;ui_utils.DEFAULT_SCALE=DEFAULT_SCALE;const MIN_SCALE=.1;ui_utils.MIN_SCALE=MIN_SCALE;const MAX_SCALE=10;ui_utils.MAX_SCALE=MAX_SCALE;const UNKNOWN_SCALE=0;ui_utils.UNKNOWN_SCALE=UNKNOWN_SCALE;const MAX_AUTO_SCALE=1.25;ui_utils.MAX_AUTO_SCALE=MAX_AUTO_SCALE;const SCROLLBAR_PADDING=40;ui_utils.SCROLLBAR_PADDING=SCROLLBAR_PADDING;const VERTICAL_PADDING=5;ui_utils.VERTICAL_PADDING=VERTICAL_PADDING;const PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};ui_utils.PresentationModeState=PresentationModeState;const RendererType={CANVAS:"canvas",SVG:"svg"};ui_utils.RendererType=RendererType;const TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};ui_utils.TextLayerMode=TextLayerMode;const ScrollMode={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};ui_utils.ScrollMode=ScrollMode;const SpreadMode={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};ui_utils.SpreadMode=SpreadMode;const AutoPrintRegExp=/\bprint\s*\(/;ui_utils.AutoPrintRegExp=AutoPrintRegExp;function formatL10nValue(o,e){return e?o.replace(/\{\{\s*(\w+)\s*\}\}/g,(r,t)=>t in e?e[t]:"{{"+t+"}}"):o}const NullL10n={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(o,e,r){return formatL10nValue(r,e)},async translate(o){}};ui_utils.NullL10n=NullL10n;function getOutputScale(o){const e=window.devicePixelRatio||1,r=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1,t=e/r;return{sx:t,sy:t,scaled:t!==1}}function scrollIntoView(o,e,r=!1){let t=o.offsetParent;if(!t){console.error("offsetParent is not set -- cannot scroll");return}let n=o.offsetTop+o.clientTop,a=o.offsetLeft+o.clientLeft;for(;t.clientHeight===t.scrollHeight&&t.clientWidth===t.scrollWidth||r&&getComputedStyle(t).overflow==="hidden";)if(t.dataset._scaleY&&(n/=t.dataset._scaleY,a/=t.dataset._scaleX),n+=t.offsetTop,a+=t.offsetLeft,t=t.offsetParent,!t)return;e&&(e.top!==void 0&&(n+=e.top),e.left!==void 0&&(a+=e.left,t.scrollLeft=a)),t.scrollTop=n}function watchScroll(o,e){const r=function(a){n||(n=window.requestAnimationFrame(function(){n=null;const u=o.scrollLeft,f=t.lastX;u!==f&&(t.right=u>f),t.lastX=u;const d=o.scrollTop,h=t.lastY;d!==h&&(t.down=d>h),t.lastY=d,e(t)}))},t={right:!0,down:!0,lastX:o.scrollLeft,lastY:o.scrollTop,_eventHandler:r};let n=null;return o.addEventListener("scroll",r,!0),t}function parseQueryString(o){const e=o.split("&"),r=Object.create(null);for(let t=0,n=e.length;t<n;++t){const a=e[t].split("="),l=a[0].toLowerCase(),u=a.length>1?a[1]:null;r[decodeURIComponent(l)]=decodeURIComponent(u)}return r}function binarySearchFirstItem(o,e){let r=0,t=o.length-1;if(t<0||!e(o[t]))return o.length;if(e(o[r]))return r;for(;r<t;){const n=r+t>>1,a=o[n];e(a)?t=n:r=n+1}return r}function approximateFraction(o){if(Math.floor(o)===o)return[o,1];const e=1/o,r=8;if(e>r)return[1,r];if(Math.floor(e)===e)return[1,e];const t=o>1?e:o;let n=0,a=1,l=1,u=1;for(;;){const d=n+l,h=a+u;if(h>r)break;t<=d/h?(l=d,u=h):(n=d,a=h)}let f;return t-n/a<l/u-t?f=t===o?[n,a]:[a,n]:f=t===o?[l,u]:[u,l],f}function roundToDivide(o,e){const r=o%e;return r===0?o:Math.round(o-r+e)}function getPageSizeInches({view:o,userUnit:e,rotate:r}){const[t,n,a,l]=o,u=r%180!==0,f=(a-t)/72*e,d=(l-n)/72*e;return{width:u?d:f,height:u?f:d}}function backtrackBeforeAllVisibleElements(o,e,r){if(o<2)return o;let t=e[o].div,n=t.offsetTop+t.clientTop;n>=r&&(t=e[o-1].div,n=t.offsetTop+t.clientTop);for(let a=o-2;a>=0&&(t=e[a].div,!(t.offsetTop+t.clientTop+t.clientHeight<=n));--a)o=a;return o}function getVisibleElements(o,e,r=!1,t=!1){const n=o.scrollTop,a=n+o.clientHeight,l=o.scrollLeft,u=l+o.clientWidth;function f(x){const C=x.div;return C.offsetTop+C.clientTop+C.clientHeight>n}function d(x){const C=x.div;return C.offsetLeft+C.clientLeft+C.clientWidth>l}const h=[],y=e.length;let E=y===0?0:binarySearchFirstItem(e,t?d:f);E>0&&E<y&&!t&&(E=backtrackBeforeAllVisibleElements(E,e,n));let p=t?u:-1;for(let x=E;x<y;x++){const C=e[x],R=C.div,S=R.offsetLeft+R.clientLeft,A=R.offsetTop+R.clientTop,T=R.clientWidth,w=R.clientHeight,P=S+T,O=A+w;if(p===-1)O>=a&&(p=O);else if((t?S:A)>p)break;if(O<=n||A>=a||P<=l||S>=u)continue;const k=Math.max(0,n-A)+Math.max(0,O-a),D=Math.max(0,l-S)+Math.max(0,P-u),F=(w-k)*(T-D)*100/w/T|0;h.push({id:C.id,x:S,y:A,view:C,percent:F})}const _=h[0],g=h[h.length-1];return r&&h.sort(function(x,C){const R=x.percent-C.percent;return Math.abs(R)>.001?-R:x.id-C.id}),{first:_,last:g,views:h}}function noContextMenuHandler(o){o.preventDefault()}function isDataSchema(o){let e=0;const r=o.length;for(;e<r&&o[e].trim()==="";)e++;return o.substring(e,e+5).toLowerCase()==="data:"}function getPDFFileNameFromURL(o,e="document.pdf"){if(typeof o!="string")return e;if(isDataSchema(o))return console.warn('getPDFFileNameFromURL: ignoring "data:" URL for performance reasons.'),e;const r=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,t=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=r.exec(o);let a=t.exec(n[1])||t.exec(n[2])||t.exec(n[3]);if(a&&(a=a[0],a.includes("%")))try{a=t.exec(decodeURIComponent(a))[0]}catch{}return a||e}function normalizeWheelEventDelta(o){let e=Math.sqrt(o.deltaX*o.deltaX+o.deltaY*o.deltaY);const r=Math.atan2(o.deltaY,o.deltaX);-.25*Math.PI<r&&r<.75*Math.PI&&(e=-e);const t=0,n=1,a=30,l=30;return o.deltaMode===t?e/=a*l:o.deltaMode===n&&(e/=l),e}function isValidRotation(o){return Number.isInteger(o)&&o%90===0}function isValidScrollMode(o){return Number.isInteger(o)&&Object.values(ScrollMode).includes(o)&&o!==ScrollMode.UNKNOWN}function isValidSpreadMode(o){return Number.isInteger(o)&&Object.values(SpreadMode).includes(o)&&o!==SpreadMode.UNKNOWN}function isPortraitOrientation(o){return o.width<=o.height}const WaitOnType={EVENT:"event",TIMEOUT:"timeout"};ui_utils.WaitOnType=WaitOnType;function waitOnEventOrTimeout({target:o,name:e,delay:r=0}){return new Promise(function(t,n){if(typeof o!="object"||!(e&&typeof e=="string")||!(Number.isInteger(r)&&r>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function a(d){o instanceof EventBus?o._off(e,l):o.removeEventListener(e,l),f&&clearTimeout(f),t(d)}const l=a.bind(null,WaitOnType.EVENT);o instanceof EventBus?o._on(e,l):o.addEventListener(e,l);const u=a.bind(null,WaitOnType.TIMEOUT),f=setTimeout(u,r)})}const animationStarted=new Promise(function(o){window.requestAnimationFrame(o)});ui_utils.animationStarted=animationStarted;class EventBus{constructor(e){this._listeners=Object.create(null)}on(e,r){this._on(e,r,{external:!0})}off(e,r){this._off(e,r,{external:!0})}dispatch(e){const r=this._listeners[e];if(!r||r.length===0)return;const t=Array.prototype.slice.call(arguments,1);let n;r.slice(0).forEach(function({listener:a,external:l}){if(l){n||(n=[]),n.push(a);return}a.apply(null,t)}),n&&(n.forEach(function(a){a.apply(null,t)}),n=null)}_on(e,r,t=null){let n=this._listeners[e];n||(this._listeners[e]=n=[]),n.push({listener:r,external:(t&&t.external)===!0})}_off(e,r,t=null){const n=this._listeners[e];if(n){for(let a=0,l=n.length;a<l;a++)if(n[a].listener===r){n.splice(a,1);return}}}}var EventBus_1=ui_utils.EventBus=EventBus;function clamp$1(o,e,r){return Math.min(Math.max(o,e),r)}let ProgressBar$1=class{constructor(e,{height:r,width:t,units:n}={}){this.visible=!0,this.div=document.querySelector(e+" .progress"),this.bar=this.div.parentNode,this.height=r||100,this.width=t||100,this.units=n||"%",this.div.style.height=this.height+this.units,this.percent=0}_updateBar(){if(this._indeterminate){this.div.classList.add("indeterminate"),this.div.style.width=this.width+this.units;return}this.div.classList.remove("indeterminate");const e=this.width*this._percent/100;this.div.style.width=e+this.units}get percent(){return this._percent}set percent(e){this._indeterminate=isNaN(e),this._percent=clamp$1(e,0,100),this._updateBar()}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}};ui_utils.ProgressBar=ProgressBar$1;function moveToEndOfArray(o,e){const r=[],t=o.length;let n=0;for(let a=0;a<t;++a)e(o[a])?r.push(o[a]):(o[n]=o[a],++n);for(let a=0;n<t;++a,++n)o[n]=r[a]}Object.defineProperty(pdf_link_service,"__esModule",{value:!0});pdf_link_service.SimpleLinkService=PDFLinkService_1=pdf_link_service.PDFLinkService=void 0;var _ui_utils=ui_utils;class PDFLinkService{constructor({eventBus:e,externalLinkTarget:r=null,externalLinkRel:t=null,externalLinkEnabled:n=!0,ignoreDestinationZoom:a=!1}={}){this.eventBus=e,this.externalLinkTarget=r,this.externalLinkRel=t,this.externalLinkEnabled=n,this._ignoreDestinationZoom=a,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}setDocument(e,r=null){this.baseUrl=r,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}navigateTo(e){const r=({namedDest:t,explicitDest:n})=>{const a=n[0];let l;if(a instanceof Object){if(l=this._cachedPageNumber(a),l===null){this.pdfDocument.getPageIndex(a).then(u=>{this.cachePageRef(u+1,a),r({namedDest:t,explicitDest:n})}).catch(()=>{console.error(`PDFLinkService.navigateTo: "${a}" is not a valid page reference, for dest="${e}".`)});return}}else if(Number.isInteger(a))l=a+1;else{console.error(`PDFLinkService.navigateTo: "${a}" is not a valid destination reference, for dest="${e}".`);return}if(!l||l<1||l>this.pagesCount){console.error(`PDFLinkService.navigateTo: "${l}" is not a valid page number, for dest="${e}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:n,pageNumber:l})),this.pdfViewer.scrollPageIntoView({pageNumber:l,destArray:n,ignoreDestinationZoom:this._ignoreDestinationZoom})};new Promise((t,n)=>{if(typeof e=="string"){this.pdfDocument.getDestination(e).then(a=>{t({namedDest:e,explicitDest:a})});return}t({namedDest:"",explicitDest:e})}).then(t=>{if(!Array.isArray(t.explicitDest)){console.error(`PDFLinkService.navigateTo: "${t.explicitDest}" is not a valid destination array, for dest="${e}".`);return}r(t)})}getDestinationHash(e){if(typeof e=="string")return this.getAnchorUrl("#"+escape(e));if(Array.isArray(e)){const r=JSON.stringify(e);return this.getAnchorUrl("#"+escape(r))}return this.getAnchorUrl("")}getAnchorUrl(e){return(this.baseUrl||"")+e}setHash(e){let r,t;if(e.includes("=")){const n=(0,_ui_utils.parseQueryString)(e);if("search"in n&&this.eventBus.dispatch("findfromurlhash",{source:this,query:n.search.replace(/"/g,""),phraseSearch:n.phrase==="true"}),"page"in n&&(r=n.page|0||1),"zoom"in n){const a=n.zoom.split(","),l=a[0],u=parseFloat(l);l.includes("Fit")?l==="Fit"||l==="FitB"?t=[null,{name:l}]:l==="FitH"||l==="FitBH"||l==="FitV"||l==="FitBV"?t=[null,{name:l},a.length>1?a[1]|0:null]:l==="FitR"?a.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):t=[null,{name:l},a[1]|0,a[2]|0,a[3]|0,a[4]|0]:console.error(`PDFLinkService.setHash: "${l}" is not a valid zoom value.`):t=[null,{name:"XYZ"},a.length>1?a[1]|0:null,a.length>2?a[2]|0:null,u?u/100:l]}t?this.pdfViewer.scrollPageIntoView({pageNumber:r||this.page,destArray:t,allowNegativeOffset:!0}):r&&(this.page=r),"pagemode"in n&&this.eventBus.dispatch("pagemode",{source:this,mode:n.pagemode}),"nameddest"in n&&this.navigateTo(n.nameddest)}else{t=unescape(e);try{t=JSON.parse(t),Array.isArray(t)||(t=t.toString())}catch{}if(typeof t=="string"||isValidExplicitDestination(t)){this.navigateTo(t);return}console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page<this.pagesCount&&this.page++;break;case"PrevPage":this.page>1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break}this.eventBus.dispatch("namedaction",{source:this,action:e})}cachePageRef(e,r){if(!r)return;const t=r.gen===0?`${r.num}R`:`${r.num}R${r.gen}`;this._pagesRefCache[t]=e}_cachedPageNumber(e){const r=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this._pagesRefCache&&this._pagesRefCache[r]||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}}var PDFLinkService_1=pdf_link_service.PDFLinkService=PDFLinkService;function isValidExplicitDestination(o){if(!Array.isArray(o))return!1;const e=o.length;if(e<2)return!1;const r=o[0];if(!(typeof r=="object"&&Number.isInteger(r.num)&&Number.isInteger(r.gen))&&!(Number.isInteger(r)&&r>=0))return!1;const t=o[1];if(!(typeof t=="object"&&typeof t.name=="string"))return!1;let n=!0;switch(t.name){case"XYZ":if(e!==5)return!1;break;case"Fit":case"FitB":return e===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(e!==3)return!1;break;case"FitR":if(e!==6)return!1;n=!1;break;default:return!1}for(let a=2;a<e;a++){const l=o[a];if(!(typeof l=="number"||n&&l===null))return!1}return!0}class SimpleLinkService{constructor(){this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=!1}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}navigateTo(e){}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,r){}isPageVisible(e){return!0}}pdf_link_service.SimpleLinkService=SimpleLinkService;const LinkService=PDFLinkService_1;var PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};const eventBus=new EventBus_1;function _arrayWithHoles$1(o){if(Array.isArray(o))return o}function _iterableToArrayLimit$1(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t,n,a,l,u=[],f=!0,d=!1;try{if(a=(r=r.call(o)).next,e===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(t=a.call(r)).done)&&(u.push(t.value),u.length!==e);f=!0);}catch(h){d=!0,n=h}finally{try{if(!f&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(d)throw n}}return u}}function _arrayLikeToArray$1(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _unsupportedIterableToArray$1(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray$1(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$1(o,e)}}function _nonIterableRest$1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _slicedToArray$1(o,e){return _arrayWithHoles$1(o)||_iterableToArrayLimit$1(o,e)||_unsupportedIterableToArray$1(o,e)||_nonIterableRest$1()}var isBrowser=typeof window<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:",isProduction=process.env.NODE_ENV==="production",isDefined=function o(e){return typeof e<"u"},isProvided=function o(e){return isDefined(e)&&e!==null},isString=function o(e){return typeof e=="string"},isArrayBuffer=function o(e){return e instanceof ArrayBuffer},isBlob=function o(e){if(!isBrowser)throw new Error("Attempted to check if a variable is a Blob on a non-browser environment.");return e instanceof Blob},isFile=function o(e){if(!isBrowser)throw new Error("Attempted to check if a variable is a File on a non-browser environment.");return e instanceof File},isDataURI=function o(e){return isString(e)&&/^data:/.test(e)},dataURItoByteString=function o(e){if(!isDataURI(e))throw new Error("Invalid data URI.");var r=e.split(";"),t=_slicedToArray$1(r,2),n=t[1];return n.indexOf("base64")===0?atob(n.slice(7)):unescape(n)},getPixelRatio=function o(){return isBrowser&&window.devicePixelRatio||1},consoleOnDev=function o(e){if(!isProduction){for(var r,t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];(r=console)[e].apply(r,n)}},warnOnDev=function o(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return consoleOnDev.apply(void 0,["warn"].concat(r))},errorOnDev=function o(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return consoleOnDev.apply(void 0,["error"].concat(r))},displayCORSWarning=function o(){isLocalFileSystem&&warnOnDev("Loading PDF as base64 strings/URLs might not work on protocols other than HTTP/HTTPS. On Google Chrome, you can use --allow-file-access-from-files flag for debugging purposes.")},cancelRunningTask=function o(e){e&&e.cancel&&e.cancel()},makePageCallback=function o(e,r){return Object.defineProperty(e,"width",{get:function(){return this.view[2]*r},configurable:!0}),Object.defineProperty(e,"height",{get:function(){return this.view[3]*r},configurable:!0}),Object.defineProperty(e,"originalWidth",{get:function(){return this.view[2]},configurable:!0}),Object.defineProperty(e,"originalHeight",{get:function(){return this.view[3]},configurable:!0}),e},isCancelException=function o(e){return e.name==="RenderingCancelledException"},loadFromFile=function o(e){return new Promise(function(r,t){var n=new FileReader;return n.onload=function(){return r(new Uint8Array(n.result))},n.onerror=function(a){switch(a.target.error.code){case a.target.error.NOT_FOUND_ERR:return t(new Error("Error while reading a file: File not found."));case a.target.error.NOT_READABLE_ERR:return t(new Error("Error while reading a file: File not readable."));case a.target.error.SECURITY_ERR:return t(new Error("Error while reading a file: Security error."));case a.target.error.ABORT_ERR:return t(new Error("Error while reading a file: Aborted."));default:return t(new Error("Error while reading a file."))}},n.readAsArrayBuffer(e),null})};function _arrayWithoutHoles(o){if(Array.isArray(o))return _arrayLikeToArray$1(o)}function _iterableToArray(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
52
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toConsumableArray(o){return _arrayWithoutHoles(o)||_iterableToArray(o)||_unsupportedIterableToArray$1(o)||_nonIterableSpread()}var eventProps=function(){var o={};return[].concat(_toConsumableArray(mouseEvents),_toConsumableArray(touchEvents),_toConsumableArray(keyboardEvents)).forEach(function(e){o[e]=PropTypes$1.func}),o}(),fileTypes=[PropTypes$1.string,PropTypes$1.instanceOf(ArrayBuffer),PropTypes$1.shape({data:PropTypes$1.object,httpHeaders:PropTypes$1.object,range:PropTypes$1.object,url:PropTypes$1.string,withCredentials:PropTypes$1.bool})];typeof File<"u"&&fileTypes.push(PropTypes$1.instanceOf(File));typeof Blob<"u"&&fileTypes.push(PropTypes$1.instanceOf(Blob));var isClassName=PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.arrayOf(PropTypes$1.string)]);PropTypes$1.oneOfType(fileTypes);var isLinkService=PropTypes$1.instanceOf(LinkService);PropTypes$1.oneOf(["_self","_blank","_parent","_top"]);var isPage=PropTypes$1.shape({_transport:PropTypes$1.shape({fontLoader:PropTypes$1.object.isRequired}).isRequired,commonObjs:PropTypes$1.shape({_objs:PropTypes$1.object.isRequired}).isRequired,getAnnotations:PropTypes$1.func.isRequired,getTextContent:PropTypes$1.func.isRequired,getViewport:PropTypes$1.func.isRequired,render:PropTypes$1.func.isRequired}),isPageIndex=function o(e,r,t){var n=e[r],a=e.pageNumber,l=e.pdf;if(!isDefined(l))return null;if(isDefined(n)){if(typeof n!="number")return new Error("`".concat(r,"` of type `").concat(_typeof$1(n),"` supplied to `").concat(t,"`, expected `number`."));if(n<0)return new Error("Expected `".concat(r,"` to be greater or equal to 0."));var u=l.numPages;if(n+1>u)return new Error("Expected `".concat(r,"` to be less or equal to ").concat(u-1,"."))}else if(!isDefined(a))return new Error("`".concat(r,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(t,"`."));return null},isPageNumber=function o(e,r,t){var n=e[r],a=e.pageIndex,l=e.pdf;if(!isDefined(l))return null;if(isDefined(n)){if(typeof n!="number")return new Error("`".concat(r,"` of type `").concat(_typeof$1(n),"` supplied to `").concat(t,"`, expected `number`."));if(n<1)return new Error("Expected `".concat(r,"` to be greater or equal to 1."));var u=l.numPages;if(n>u)return new Error("Expected `".concat(r,"` to be less or equal to ").concat(u,"."))}else if(!isDefined(a))return new Error("`".concat(r,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(t,"`."));return null},isPdf=PropTypes$1.oneOfType([PropTypes$1.shape({getDestination:PropTypes$1.func.isRequired,getOutline:PropTypes$1.func.isRequired,getPage:PropTypes$1.func.isRequired,numPages:PropTypes$1.number.isRequired}),PropTypes$1.bool]),isRef=PropTypes$1.oneOfType([PropTypes$1.func,PropTypes$1.shape({current:PropTypes$1.any})]),isRenderMode=PropTypes$1.oneOf(["canvas","none","svg"]),isRotate=PropTypes$1.oneOf([0,90,180,270]);function ownKeys$2(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function _objectSpread$2(o){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$2(Object(r),!0).forEach(function(t){_defineProperty(o,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}function _createSuper$6(o){var e=_isNativeReflectConstruct$6();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var PDFDataRangeTransport=pdfExports.PDFDataRangeTransport,Document$1=function(o){_inherits(r,o);var e=_createSuper$6(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"state",{pdf:null}),_defineProperty(_assertThisInitialized$1(t),"viewer",{scrollPageIntoView:function(f){var d=f.pageNumber,h=t.props.onItemClick;if(h){h({pageNumber:d});return}var y=t.pages[d-1];if(y){y.scrollIntoView();return}warnOnDev("Warning: An internal link leading to page ".concat(d," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}}),_defineProperty(_assertThisInitialized$1(t),"linkService",new LinkService({eventBus})),_defineProperty(_assertThisInitialized$1(t),"loadDocument",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var f,d,h,y,E,p,_;return _regeneratorRuntime.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return f=null,x.prev=1,x.next=4,t.findDocumentSource();case 4:f=x.sent,t.onSourceSuccess(),x.next=11;break;case 8:x.prev=8,x.t0=x.catch(1),t.onSourceError(x.t0);case 11:if(f){x.next=13;break}return x.abrupt("return");case 13:return t.setState(function(C){return C.pdf?{pdf:null}:null}),d=t.props,h=d.options,y=d.onLoadProgress,E=d.onPassword,x.prev=15,cancelRunningTask(t.runningTask),t.loadingTask=pdfExports.getDocument(_objectSpread$2(_objectSpread$2({},f),h)),t.loadingTask.onPassword=E,y&&(t.loadingTask.onProgress=y),p=makeCancellablePromise(t.loadingTask.promise),t.runningTask=p,x.next=24,p.promise;case 24:_=x.sent,t.setState(function(C){return C.pdf&&C.pdf.fingerprint===_.fingerprint?null:{pdf:_}},t.onLoadSuccess),x.next=31;break;case 28:x.prev=28,x.t1=x.catch(15),t.onLoadError(x.t1);case 31:case"end":return x.stop()}},u,null,[[1,8],[15,28]])}))),_defineProperty(_assertThisInitialized$1(t),"setupLinkService",function(){t.linkService.setViewer(t.viewer);var u=_assertThisInitialized$1(t);Object.defineProperty(t.linkService,"externalLinkTarget",{get:function(){var d=u.props.externalLinkTarget;switch(d){case"_self":return 1;case"_blank":return 2;case"_parent":return 3;case"_top":return 4;default:return 0}}})}),_defineProperty(_assertThisInitialized$1(t),"onSourceSuccess",function(){var u=t.props.onSourceSuccess;u&&u()}),_defineProperty(_assertThisInitialized$1(t),"onSourceError",function(u){errorOnDev(u);var f=t.props.onSourceError;f&&f(u)}),_defineProperty(_assertThisInitialized$1(t),"onLoadSuccess",function(){var u=t.props.onLoadSuccess,f=t.state.pdf;u&&u(f),t.pages=new Array(f.numPages),t.linkService.setDocument(f)}),_defineProperty(_assertThisInitialized$1(t),"onLoadError",function(u){t.setState({pdf:!1}),errorOnDev(u);var f=t.props.onLoadError;f&&f(u)}),_defineProperty(_assertThisInitialized$1(t),"findDocumentSource",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var f,d,h,y,E;return _regeneratorRuntime.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(f=t.props.file,f){_.next=3;break}return _.abrupt("return",null);case 3:if(typeof f!="string"){_.next=9;break}if(!isDataURI(f)){_.next=7;break}return d=dataURItoByteString(f),_.abrupt("return",{data:d});case 7:return displayCORSWarning(),_.abrupt("return",{url:f});case 9:if(!(f instanceof PDFDataRangeTransport)){_.next=11;break}return _.abrupt("return",{range:f});case 11:if(!isArrayBuffer(f)){_.next=13;break}return _.abrupt("return",{data:f});case 13:if(!isBrowser){_.next=19;break}if(!(isBlob(f)||isFile(f))){_.next=19;break}return _.next=17,loadFromFile(f);case 17:return _.t0=_.sent,_.abrupt("return",{data:_.t0});case 19:if(_typeof$1(f)==="object"){_.next=21;break}throw new Error("Invalid parameter in file, need either Uint8Array, string or a parameter object");case 21:if(!(!f.url&&!f.data&&!f.range)){_.next=23;break}throw new Error("Invalid parameter object: need either .data, .range or .url");case 23:if(typeof f.url!="string"){_.next=29;break}if(!isDataURI(f.url)){_.next=28;break}return h=f.url,y=_objectWithoutProperties(f,["url"]),E=dataURItoByteString(h),_.abrupt("return",_objectSpread$2({data:E},y));case 28:displayCORSWarning();case 29:return _.abrupt("return",f);case 30:case"end":return _.stop()}},u)}))),_defineProperty(_assertThisInitialized$1(t),"registerPage",function(u,f){t.pages[u]=f}),_defineProperty(_assertThisInitialized$1(t),"unregisterPage",function(u){delete t.pages[u]}),t}return _createClass(r,[{key:"componentDidMount",value:function(){this.loadDocument(),this.setupLinkService()}},{key:"componentDidUpdate",value:function(n){var a=this.props.file;a!==n.file&&this.loadDocument()}},{key:"componentWillUnmount",value:function(){this.loadingTask&&this.loadingTask.destroy(),cancelRunningTask(this.runningTask)}},{key:"renderChildren",value:function(){var n=this.props.children;return React$2.createElement(DocumentContext.Provider,{value:this.childContext},n)}},{key:"renderContent",value:function(){var n=this.props.file,a=this.state.pdf;if(!n){var l=this.props.noData;return React$2.createElement(Message$1,{type:"no-data"},typeof l=="function"?l():l)}if(a===null){var u=this.props.loading;return React$2.createElement(Message$1,{type:"loading"},typeof u=="function"?u():u)}if(a===!1){var f=this.props.error;return React$2.createElement(Message$1,{type:"error"},typeof f=="function"?f():f)}return this.renderChildren()}},{key:"render",value:function(){var n=this.props,a=n.className,l=n.inputRef;return React$2.createElement("div",_extends({className:mergeClassNames("react-pdf__Document",a),ref:l},this.eventProps),this.renderContent())}},{key:"childContext",get:function(){var n=this.linkService,a=this.registerPage,l=this.unregisterPage,u=this.props,f=u.imageResourcesPath,d=u.renderMode,h=u.rotate,y=this.state.pdf;return{imageResourcesPath:f,linkService:n,pdf:y,registerPage:a,renderMode:d,rotate:h,unregisterPage:l}}},{key:"eventProps",get:function(){var n=this;return makeEventProps(this.props,function(){return n.state.pdf})}}]),r}(React$2.PureComponent);Document$1.defaultProps={error:"Failed to load PDF file.",loading:"Loading PDF…",noData:"No PDF file specified.",onPassword:function o(e,r){switch(r){case PasswordResponses.NEED_PASSWORD:{var t=prompt("Enter the password to open this PDF file.");e(t);break}case PasswordResponses.INCORRECT_PASSWORD:{var n=prompt("Invalid password. Please try again.");e(n);break}}}};var isFunctionOrNode$1=PropTypes$1.oneOfType([PropTypes$1.func,PropTypes$1.node]);Document$1.propTypes=_objectSpread$2(_objectSpread$2({},eventProps),{},{children:PropTypes$1.node,className:isClassName,error:isFunctionOrNode$1,file:isFile,imageResourcesPath:PropTypes$1.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes$1.func,onLoadError:PropTypes$1.func,onLoadProgress:PropTypes$1.func,onLoadSuccess:PropTypes$1.func,onPassword:PropTypes$1.func,onSourceError:PropTypes$1.func,onSourceSuccess:PropTypes$1.func,rotate:PropTypes$1.number});var isDestination=PropTypes$1.oneOfType([PropTypes$1.string,PropTypes$1.arrayOf(PropTypes$1.any)]);PropTypes$1.shape({dest:isDestination,items:PropTypes$1.arrayOf(PropTypes$1.shape({dest:isDestination,title:PropTypes$1.string})),title:PropTypes$1.string}).isRequired,PropTypes$1.func,isPdf.isRequired;function ownKeys$1(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function _objectSpread$1(o){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$1(Object(r),!0).forEach(function(t){_defineProperty(o,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}_objectSpread$1({className:isClassName,inputRef:isRef,onItemClick:PropTypes$1.func,onLoadError:PropTypes$1.func,onLoadSuccess:PropTypes$1.func,pdf:isPdf},eventProps);function mergeRefs(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var r=o.filter(Boolean);if(r.length<=1){var t=r[0];return t||null}return function(a){r.forEach(function(l){typeof l=="function"?l(a):l&&(l.current=a)})}}const PageContext=React$2.createContext(null);function _createSuper$5(o){var e=_isNativeReflectConstruct$5();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var PageCanvasInternal=function(o){_inherits(r,o);var e=_createSuper$5(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"onRenderSuccess",function(){t.renderer=null;var u=t.props,f=u.onRenderSuccess,d=u.page,h=u.scale;f&&f(makePageCallback(d,h))}),_defineProperty(_assertThisInitialized$1(t),"onRenderError",function(u){if(!isCancelException(u)){errorOnDev(u);var f=t.props.onRenderError;f&&f(u)}}),_defineProperty(_assertThisInitialized$1(t),"drawPageOnCanvas",function(){var u=_assertThisInitialized$1(t),f=u.canvasLayer;if(!f)return null;var d=_assertThisInitialized$1(t),h=d.renderViewport,y=d.viewport,E=t.props,p=E.page,_=E.renderInteractiveForms;f.width=h.width,f.height=h.height,f.style.width="".concat(Math.floor(y.width),"px"),f.style.height="".concat(Math.floor(y.height),"px");var g={get canvasContext(){return f.getContext("2d")},viewport:h,renderInteractiveForms:_};return t.cancelRenderingTask(),t.renderer=p.render(g),t.renderer.promise.then(t.onRenderSuccess).catch(t.onRenderError)}),t}return _createClass(r,[{key:"componentDidMount",value:function(){this.drawPageOnCanvas()}},{key:"componentDidUpdate",value:function(n){var a=this.props,l=a.page,u=a.renderInteractiveForms;u!==n.renderInteractiveForms&&(l.cleanup(),this.drawPageOnCanvas())}},{key:"componentWillUnmount",value:function(){this.cancelRenderingTask(),this.canvasLayer&&(this.canvasLayer.width=0,this.canvasLayer.height=0,this.canvasLayer=null)}},{key:"cancelRenderingTask",value:function(){this.renderer&&this.renderer._internalRenderTask.running&&this.renderer._internalRenderTask.cancel()}},{key:"render",value:function(){var n=this,a=this.props.canvasRef;return React$2.createElement("canvas",{className:"react-pdf__Page__canvas",dir:"ltr",ref:mergeRefs(a,function(l){n.canvasLayer=l}),style:{display:"block",userSelect:"none"}})}},{key:"renderViewport",get:function(){var n=this.props,a=n.page,l=n.rotate,u=n.scale,f=getPixelRatio();return a.getViewport({scale:u*f,rotation:l})}},{key:"viewport",get:function(){var n=this.props,a=n.page,l=n.rotate,u=n.scale;return a.getViewport({scale:u,rotation:l})}}]),r}(React$2.PureComponent);PageCanvasInternal.propTypes={canvasRef:isRef,onRenderError:PropTypes$1.func,onRenderSuccess:PropTypes$1.func,page:isPage.isRequired,renderInteractiveForms:PropTypes$1.bool,rotate:isRotate,scale:PropTypes$1.number};function PageCanvas(o){return React$2.createElement(PageContext.Consumer,null,function(e){return React$2.createElement(PageCanvasInternal,_extends({},e,o))})}function _createSuper$4(o){var e=_isNativeReflectConstruct$4();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var PageSVGInternal=function(o){_inherits(r,o);var e=_createSuper$4(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"state",{svg:null}),_defineProperty(_assertThisInitialized$1(t),"onRenderSuccess",function(){t.renderer=null;var u=t.props,f=u.onRenderSuccess,d=u.page,h=u.scale;f&&f(makePageCallback(d,h))}),_defineProperty(_assertThisInitialized$1(t),"onRenderError",function(u){if(!isCancelException(u)){errorOnDev(u);var f=t.props.onRenderError;f&&f(u)}}),_defineProperty(_assertThisInitialized$1(t),"renderSVG",function(){var u=t.props.page;return t.renderer=u.getOperatorList(),t.renderer.then(function(f){var d=new pdfExports.SVGGraphics(u.commonObjs,u.objs);t.renderer=d.getSVG(f,t.viewport).then(function(h){t.setState({svg:h},t.onRenderSuccess)}).catch(t.onRenderError)}).catch(t.onRenderError)}),_defineProperty(_assertThisInitialized$1(t),"drawPageOnContainer",function(u){var f=t.state.svg;if(!(!u||!f)){u.firstElementChild||u.appendChild(f);var d=t.viewport,h=d.width,y=d.height;f.setAttribute("width",h),f.setAttribute("height",y)}}),t}return _createClass(r,[{key:"componentDidMount",value:function(){this.renderSVG()}},{key:"render",value:function(){var n=this,a=this.viewport,l=a.width,u=a.height;return React$2.createElement("div",{className:"react-pdf__Page__svg",ref:function(d){return n.drawPageOnContainer(d)},style:{display:"block",backgroundColor:"white",overflow:"hidden",width:l,height:u,userSelect:"none"}})}},{key:"viewport",get:function(){var n=this.props,a=n.page,l=n.rotate,u=n.scale;return a.getViewport({scale:u,rotation:l})}}]),r}(React$2.PureComponent);PageSVGInternal.propTypes={onRenderError:PropTypes$1.func,onRenderSuccess:PropTypes$1.func,page:isPage.isRequired,rotate:isRotate,scale:PropTypes$1.number};function PageSVG(o){return React$2.createElement(PageContext.Consumer,null,function(e){return React$2.createElement(PageSVGInternal,_extends({},e,o))})}function _createSuper$3(o){var e=_isNativeReflectConstruct$3();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var TextLayerItemInternal=function(o){_inherits(r,o);var e=_createSuper$3(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"getElementWidth",function(u){var f=_assertThisInitialized$1(t),d=f.sideways;return u.getBoundingClientRect()[d?"height":"width"]}),t}return _createClass(r,[{key:"componentDidMount",value:function(){this.alignTextItem()}},{key:"componentDidUpdate",value:function(){this.alignTextItem()}},{key:"getFontData",value:function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function a(l){var u,f;return _regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.props.page,h.next=3,new Promise(function(y){u.commonObjs.get(l,y)});case 3:return f=h.sent,h.abrupt("return",f);case 5:case"end":return h.stop()}},a,this)}));function n(a){return t.apply(this,arguments)}return n}()},{key:"alignTextItem",value:function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function a(){var l,u,f,d,h,y,E,p,_,g,x;return _regeneratorRuntime.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(l=this.item,l){R.next=3;break}return R.abrupt("return");case 3:return l.style.transform="",u=this.props,f=u.fontName,d=u.scale,h=u.width,l.style.fontFamily="".concat(f,", sans-serif"),R.next=8,this.getFontData(f);case 8:y=R.sent,E=y?y.fallbackName:"sans-serif",l.style.fontFamily="".concat(f,", ").concat(E),p=h*d,_=this.getElementWidth(l),g="scaleX(".concat(p/_,")"),x=y?y.ascent:0,x&&(g+=" translateY(".concat((1-x)*100,"%)")),l.style.transform=g,l.style.WebkitTransform=g;case 18:case"end":return R.stop()}},a,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"render",value:function(){var n=this,a=this.fontSize,l=this.top,u=this.left,f=this.props,d=f.customTextRenderer,h=f.scale,y=f.str;return React$2.createElement("span",{ref:function(p){n.item=p},style:{height:"1em",fontFamily:"sans-serif",fontSize:"".concat(a*h,"px"),position:"absolute",top:"".concat(l*h,"px"),left:"".concat(u*h,"px"),transformOrigin:"left bottom",whiteSpace:"pre",pointerEvents:"all"}},d?d(this.props):y)}},{key:"unrotatedViewport",get:function(){var n=this.props,a=n.page,l=n.scale;return a.getViewport({scale:l})}},{key:"rotate",get:function(){var n=this.props,a=n.page,l=n.rotate;return l-a.rotate}},{key:"sideways",get:function(){var n=this.rotate;return n%180!==0}},{key:"defaultSideways",get:function(){var n=this.unrotatedViewport.rotation;return n%180!==0}},{key:"fontSize",get:function(){var n=this.props.transform,a=this.defaultSideways,l=_slicedToArray$1(n,2),u=l[0],f=l[1];return a?f:u}},{key:"top",get:function(){var n=this.props.transform,a=this.unrotatedViewport,l=this.defaultSideways,u=_slicedToArray$1(n,6),f=u[2],d=u[3],h=u[4],y=u[5],E=_slicedToArray$1(a.viewBox,4),p=E[1],_=E[3];return l?h+f+p:_-(y+d)}},{key:"left",get:function(){var n=this.props.transform,a=this.unrotatedViewport,l=this.defaultSideways,u=_slicedToArray$1(n,6),f=u[4],d=u[5],h=_slicedToArray$1(a.viewBox,1),y=h[0];return l?d-y:f-y}}]),r}(React$2.PureComponent);TextLayerItemInternal.propTypes={customTextRenderer:PropTypes$1.func,fontName:PropTypes$1.string.isRequired,itemIndex:PropTypes$1.number.isRequired,page:isPage.isRequired,rotate:isRotate,scale:PropTypes$1.number,str:PropTypes$1.string.isRequired,transform:PropTypes$1.arrayOf(PropTypes$1.number).isRequired,width:PropTypes$1.number.isRequired};function TextLayerItem(o){return React$2.createElement(PageContext.Consumer,null,function(e){return React$2.createElement(TextLayerItemInternal,_extends({},e,o))})}function _createSuper$2(o){var e=_isNativeReflectConstruct$2();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var TextLayerInternal=function(o){_inherits(r,o);var e=_createSuper$2(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"state",{textItems:null}),_defineProperty(_assertThisInitialized$1(t),"loadTextItems",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var f,d,h,y;return _regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return f=t.props.page,p.prev=1,d=makeCancellablePromise(f.getTextContent()),t.runningTask=d,p.next=6,d.promise;case 6:h=p.sent,y=h.items,t.setState({textItems:y},t.onLoadSuccess),p.next=14;break;case 11:p.prev=11,p.t0=p.catch(1),t.onLoadError(p.t0);case 14:case"end":return p.stop()}},u,null,[[1,11]])}))),_defineProperty(_assertThisInitialized$1(t),"onLoadSuccess",function(){var u=t.props.onGetTextSuccess,f=t.state.textItems;u&&u(f)}),_defineProperty(_assertThisInitialized$1(t),"onLoadError",function(u){t.setState({textItems:!1}),errorOnDev(u);var f=t.props.onGetTextError;f&&f(u)}),t}return _createClass(r,[{key:"componentDidMount",value:function(){var n=this.props.page;if(!n)throw new Error("Attempted to load page text content, but no page was specified.");this.loadTextItems()}},{key:"componentDidUpdate",value:function(n){var a=this.props.page;n.page&&a!==n.page&&this.loadTextItems()}},{key:"componentWillUnmount",value:function(){cancelRunningTask(this.runningTask)}},{key:"renderTextItems",value:function(){var n=this.state.textItems;return n?n.map(function(a,l){return React$2.createElement(TextLayerItem,_extends({key:l,itemIndex:l},a))}):null}},{key:"render",value:function(){var n=this.unrotatedViewport,a=this.rotate;return React$2.createElement("div",{className:"react-pdf__Page__textContent",style:{position:"absolute",top:"50%",left:"50%",width:"".concat(n.width,"px"),height:"".concat(n.height,"px"),color:"transparent",transform:"translate(-50%, -50%) rotate(".concat(a,"deg)"),WebkitTransform:"translate(-50%, -50%) rotate(".concat(a,"deg)"),pointerEvents:"none"}},this.renderTextItems())}},{key:"unrotatedViewport",get:function(){var n=this.props,a=n.page,l=n.scale;return a.getViewport({scale:l})}},{key:"rotate",get:function(){var n=this.props,a=n.page,l=n.rotate;return l-a.rotate}}]),r}(React$2.PureComponent);TextLayerInternal.propTypes={onGetTextError:PropTypes$1.func,onGetTextSuccess:PropTypes$1.func,page:isPage.isRequired,rotate:isRotate,scale:PropTypes$1.number};function TextLayer(o){return React$2.createElement(PageContext.Consumer,null,function(e){return React$2.createElement(TextLayerInternal,_extends({},e,o))})}function _createSuper$1(o){var e=_isNativeReflectConstruct$1();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var AnnotationLayerInternal=function(o){_inherits(r,o);var e=_createSuper$1(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"state",{annotations:null}),_defineProperty(_assertThisInitialized$1(t),"loadAnnotations",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var f,d,h;return _regeneratorRuntime.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return f=t.props.page,E.prev=1,d=makeCancellablePromise(f.getAnnotations()),t.runningTask=d,E.next=6,d.promise;case 6:h=E.sent,t.setState({annotations:h},t.onLoadSuccess),E.next=13;break;case 10:E.prev=10,E.t0=E.catch(1),t.onLoadError(E.t0);case 13:case"end":return E.stop()}},u,null,[[1,10]])}))),_defineProperty(_assertThisInitialized$1(t),"onLoadSuccess",function(){var u=t.props.onGetAnnotationsSuccess,f=t.state.annotations;u&&u(f)}),_defineProperty(_assertThisInitialized$1(t),"onLoadError",function(u){t.setState({annotations:!1}),errorOnDev(u);var f=t.props.onGetAnnotationsError;f&&f(u)}),_defineProperty(_assertThisInitialized$1(t),"onRenderSuccess",function(){var u=t.props.onRenderAnnotationLayerSuccess;u&&u()}),_defineProperty(_assertThisInitialized$1(t),"onRenderError",function(u){errorOnDev(u);var f=t.props.onRenderAnnotationLayerError;f&&f(u)}),t}return _createClass(r,[{key:"componentDidMount",value:function(){var n=this.props.page;if(!n)throw new Error("Attempted to load page annotations, but no page was specified.");this.loadAnnotations()}},{key:"componentDidUpdate",value:function(n){var a=this.props,l=a.page,u=a.renderInteractiveForms;(n.page&&l!==n.page||u!==n.renderInteractiveForms)&&this.loadAnnotations()}},{key:"componentWillUnmount",value:function(){cancelRunningTask(this.runningTask)}},{key:"renderAnnotationLayer",value:function(){var n=this.state.annotations;if(n){var a=this.props,l=a.imageResourcesPath,u=a.linkService,f=a.page,d=a.renderInteractiveForms,h=this.viewport.clone({dontFlip:!0}),y={annotations:n,div:this.annotationLayer,imageResourcesPath:l,linkService:u,page:f,renderInteractiveForms:d,viewport:h};this.annotationLayer.innerHTML="";try{pdfExports.AnnotationLayer.render(y),this.onRenderSuccess()}catch(E){this.onRenderError(E)}}}},{key:"render",value:function(){var n=this;return React$2.createElement("div",{className:"react-pdf__Page__annotations annotationLayer",ref:function(l){n.annotationLayer=l}},this.renderAnnotationLayer())}},{key:"viewport",get:function(){var n=this.props,a=n.page,l=n.rotate,u=n.scale;return a.getViewport({scale:u,rotation:l})}}]),r}(React$2.PureComponent);AnnotationLayerInternal.propTypes={imageResourcesPath:PropTypes$1.string,linkService:isLinkService.isRequired,onGetAnnotationsError:PropTypes$1.func,onGetAnnotationsSuccess:PropTypes$1.func,onRenderAnnotationLayerError:PropTypes$1.func,onRenderAnnotationLayerSuccess:PropTypes$1.func,page:isPage,renderInteractiveForms:PropTypes$1.bool,rotate:isRotate,scale:PropTypes$1.number};var AnnotationLayer=function o(e){return React$2.createElement(DocumentContext.Consumer,null,function(r){return React$2.createElement(PageContext.Consumer,null,function(t){return React$2.createElement(AnnotationLayerInternal,_extends({},r,t,e))})})};function ownKeys(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function _objectSpread(o){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(o,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}function _createSuper(o){var e=_isNativeReflectConstruct();return function(){var t=_getPrototypeOf(o),n;if(e){var a=_getPrototypeOf(this).constructor;n=Reflect.construct(t,arguments,a)}else n=t.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var defaultScale=1,PageInternal=function(o){_inherits(r,o);var e=_createSuper(r);function r(){var t;_classCallCheck(this,r);for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return t=e.call.apply(e,[this].concat(a)),_defineProperty(_assertThisInitialized$1(t),"state",{page:null}),_defineProperty(_assertThisInitialized$1(t),"onLoadSuccess",function(){var u=t.props,f=u.onLoadSuccess,d=u.registerPage,h=t.state.page;f&&f(makePageCallback(h,t.scale)),d&&d(t.pageIndex,t.ref)}),_defineProperty(_assertThisInitialized$1(t),"onLoadError",function(u){errorOnDev(u);var f=t.props.onLoadError;f&&f(u)}),_defineProperty(_assertThisInitialized$1(t),"loadPage",_asyncToGenerator(_regeneratorRuntime.mark(function u(){var f,d,h,y;return _regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(f=t.props.pdf,d=t.getPageNumber(),d){p.next=4;break}return p.abrupt("return");case 4:return t.setState(function(_){return _.page?{page:null}:null}),p.prev=5,h=makeCancellablePromise(f.getPage(d)),t.runningTask=h,p.next=10,h.promise;case 10:y=p.sent,t.setState({page:y},t.onLoadSuccess),p.next=18;break;case 14:p.prev=14,p.t0=p.catch(5),t.setState({page:!1}),t.onLoadError(p.t0);case 18:case"end":return p.stop()}},u,null,[[5,14]])}))),t}return _createClass(r,[{key:"componentDidMount",value:function(){var n=this.props.pdf;if(!n)throw new Error("Attempted to load a page, but no document was specified.");this.loadPage()}},{key:"componentDidUpdate",value:function(n){var a=this.props.pdf;if(n.pdf&&a!==n.pdf||this.getPageNumber()!==this.getPageNumber(n)){var l=this.props.unregisterPage;l&&l(this.getPageIndex(n)),this.loadPage()}}},{key:"componentWillUnmount",value:function(){var n=this.props.unregisterPage;n&&n(this.pageIndex),cancelRunningTask(this.runningTask)}},{key:"getPageIndex",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return isProvided(n.pageNumber)?n.pageNumber-1:isProvided(n.pageIndex)?n.pageIndex:null}},{key:"getPageNumber",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return isProvided(n.pageNumber)?n.pageNumber:isProvided(n.pageIndex)?n.pageIndex+1:null}},{key:"renderMainLayer",value:function(){var n=this.props,a=n.canvasRef,l=n.renderMode;switch(l){case"none":return null;case"svg":return React$2.createElement(PageSVG,{key:"".concat(this.pageKeyNoScale,"_svg")});case"canvas":default:return React$2.createElement(PageCanvas,{key:"".concat(this.pageKey,"_canvas"),canvasRef:a})}}},{key:"renderTextLayer",value:function(){var n=this.props.renderTextLayer;return n?React$2.createElement(TextLayer,{key:"".concat(this.pageKey,"_text")}):null}},{key:"renderAnnotationLayer",value:function(){var n=this.props.renderAnnotationLayer;return n?React$2.createElement(AnnotationLayer,{key:"".concat(this.pageKey,"_annotations")}):null}},{key:"renderChildren",value:function(){var n=this.props.children;return React$2.createElement(PageContext.Provider,{value:this.childContext},this.renderMainLayer(),this.renderTextLayer(),this.renderAnnotationLayer(),n)}},{key:"renderContent",value:function(){var n=this.pageNumber,a=this.props.pdf,l=this.state.page;if(!n){var u=this.props.noData;return React$2.createElement(Message$1,{type:"no-data"},typeof u=="function"?u():u)}if(a===null||l===null){var f=this.props.loading;return React$2.createElement(Message$1,{type:"loading"},typeof f=="function"?f():f)}if(a===!1||l===!1){var d=this.props.error;return React$2.createElement(Message$1,{type:"error"},typeof d=="function"?d():d)}return this.renderChildren()}},{key:"render",value:function(){var n=this.pageNumber,a=this.props,l=a.className,u=a.inputRef;return React$2.createElement("div",_extends({className:mergeClassNames("react-pdf__Page",l),"data-page-number":n,ref:mergeRefs(u,this.ref),style:{position:"relative"}},this.eventProps),this.renderContent())}},{key:"childContext",get:function(){var n=this.state.page;if(!n)return{};var a=this.props,l=a.customTextRenderer,u=a.onGetAnnotationsError,f=a.onGetAnnotationsSuccess,d=a.onGetTextError,h=a.onGetTextSuccess,y=a.onRenderAnnotationLayerError,E=a.onRenderAnnotationLayerSuccess,p=a.onRenderError,_=a.onRenderSuccess,g=a.renderInteractiveForms;return{customTextRenderer:l,onGetAnnotationsError:u,onGetAnnotationsSuccess:f,onGetTextError:d,onGetTextSuccess:h,onRenderAnnotationLayerError:y,onRenderAnnotationLayerSuccess:E,onRenderError:p,onRenderSuccess:_,page:n,renderInteractiveForms:g,rotate:this.rotate,scale:this.scale}}},{key:"pageIndex",get:function(){return this.getPageIndex()}},{key:"pageNumber",get:function(){return this.getPageNumber()}},{key:"rotate",get:function(){var n=this.props.rotate;if(isProvided(n))return n;var a=this.state.page;return a?a.rotate:null}},{key:"scale",get:function(){var n=this.state.page;if(!n)return null;var a=this.props,l=a.scale,u=a.width,f=a.height,d=this.rotate,h=1,y=l===null?defaultScale:l;if(u||f){var E=n.getViewport({scale:1,rotation:d});h=u?u/E.width:f/E.height}return y*h}},{key:"eventProps",get:function(){var n=this;return makeEventProps(this.props,function(){var a=n.state.page;return a&&makePageCallback(a,n.scale)})}},{key:"pageKey",get:function(){var n=this.state.page;return"".concat(n.pageIndex,"@").concat(this.scale,"/").concat(this.rotate)}},{key:"pageKeyNoScale",get:function(){var n=this.state.page;return"".concat(n.pageIndex,"/").concat(this.rotate)}}]),r}(React$2.PureComponent);PageInternal.defaultProps={error:"Failed to load the page.",loading:"Loading page…",noData:"No page specified.",renderAnnotationLayer:!0,renderInteractiveForms:!1,renderMode:"canvas",renderTextLayer:!0,scale:defaultScale};var isFunctionOrNode=PropTypes$1.oneOfType([PropTypes$1.func,PropTypes$1.node]);PageInternal.propTypes=_objectSpread(_objectSpread({},eventProps),{},{children:PropTypes$1.node,className:isClassName,customTextRenderer:PropTypes$1.func,error:isFunctionOrNode,height:PropTypes$1.number,imageResourcesPath:PropTypes$1.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes$1.func,onGetTextSuccess:PropTypes$1.func,onLoadError:PropTypes$1.func,onLoadSuccess:PropTypes$1.func,onRenderError:PropTypes$1.func,onRenderSuccess:PropTypes$1.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,registerPage:PropTypes$1.func,renderAnnotationLayer:PropTypes$1.bool,renderInteractiveForms:PropTypes$1.bool,renderMode:isRenderMode,renderTextLayer:PropTypes$1.bool,rotate:isRotate,scale:PropTypes$1.number,unregisterPage:PropTypes$1.func,width:PropTypes$1.number});function Page(o,e){return React$2.createElement(DocumentContext.Consumer,null,function(r){return React$2.createElement(PageInternal,_extends({ref:e},r,o))})}const Page$1=React$2.forwardRef(Page);isLocalFileSystem&&warnOnDev("You are running React-PDF from your local file system. PDF.js Worker may fail to load due to browser's security policies. If you're on Google Chrome, you can use --allow-file-access-from-files flag for debugging purposes.");pdfExports.GlobalWorkerOptions.workerSrc="pdf.worker.js";const DeviceDetection=()=>navigator.userAgent.match(/(android)/i)||["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,BrowserDetection=()=>{const o=navigator.userAgent.toLowerCase(),e=o.indexOf("firefox")>-1,r=o.indexOf("safari")>-1&&o.indexOf("chrome")<=-1;let t="default";return e?t="firefox":r&&(t="safari"),t};pdfExports.GlobalWorkerOptions.workerSrc=`//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfExports.version}/pdf.worker.js`;const SCALE_LIMIT=2,maxValues={default:{area:268435456,sideBig:65535},firefox:{area:124992400,sideBig:32767},safari:{area:16777216,sideBig:4194303}},getMaxPermitted=()=>{const o=BrowserDetection();return maxValues[o]},formatScale=o=>o>1?Math.floor(o):Math.floor(o*100)/100,getMaxScaleByArea=(o,e,r)=>{const t=e*r*window.devicePixelRatio**2,n=Math.sqrt(o/t);return formatScale(n)},getMaxScaleBySide=(o,e,r)=>{const t=e>r?e:r,a=o/window.devicePixelRatio/t;return formatScale(a)};function PdfVisor({url:o,endPdf:e,emitNumberOfPages:r,translate:t,soundActions:n,keyboardControl:a}){const l=React$2.useRef(),[u,f]=React$2.useState(1),[d,h]=React$2.useState(!0),[y,E]=React$2.useState(),[p,_]=React$2.useState(1),[g]=n,x=React$2.useCallback(A=>{A.getPage(1).then(w=>{const P=w.getViewport(1),O=P.viewBox[2]-P.viewBox[0],k=P.viewBox[3]-P.viewBox[1],D=getMaxPermitted(),F=getMaxScaleByArea(D.area,O,k),G=getMaxScaleBySide(D.sideBig,O,k),V=F<G?F:G;_(V>SCALE_LIMIT?SCALE_LIMIT:V)}),f(A.numPages),A.numPages&&r({numPages:A.numPages,currentPage:y});const T=()=>(setTimeout(()=>{l.current&&l.current.scrollHeight<=l.current.offsetHeight&&h(!1)},1e3),()=>{T&&clearTimeout(T)});T()},[y,r]);React$2.useEffect(()=>{E(1)},[]);const C={file:o,loading:"Loading file...",onLoadSuccess:x,onLoadError:A=>console.error(A)},R=A=>{g("click-ui"),l.current.scrollTo(0,0),h(!1),E(y+A),r({numPages:u,currentPage:y+A}),y===u-1&&e()};a(u>1&&y!==1?()=>R(-1):null,u>1&&y!==u?()=>R(1):null);const S=()=>{h(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"pdf-box",dir:LangIsRtl()?"rtl":"auto",children:[jsxRuntimeExports.jsxs("div",{className:"pdf-box__scrollwrap",children:[jsxRuntimeExports.jsxs("div",{tabIndex:"0",onScroll:S,ref:l,className:`pdf-box__scroll ${d?"pdf-box__scroll--overlay":""}`,children:[jsxRuntimeExports.jsx(Document$1,{...C,children:jsxRuntimeExports.jsx(Page$1,{renderTextLayer:!1,scale:p,pageNumber:y})}),jsxRuntimeExports.jsx("div",{className:"pdf-box__mouse icon-scroll-down-black"})]}),u>1&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"pdf-box__paginator",children:jsxRuntimeExports.jsxs("span",{children:[t("storylines.misc.page")," ",y," ",t("storylines.misc.of")," ",u]})})})]}),u>1&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{className:`pdf-box__arrow pdf-box__arrow--left gat--btn__round ${y===1?"pdf-box__arrow--hidden":""}`,type:"button",disabled:y===1,onClick:()=>R(-1),"aria-label":LangIsRtl()?t("storylines.misc.nextPage"):t("storylines.misc.previousPage"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{className:`pdf-box__arrow pdf-box__arrow--right gat--btn__round ${y===u?"pdf-box__arrow--hidden":""}`,type:"button",disabled:y===u,onClick:()=>R(1),"aria-label":LangIsRtl()?t("storylines.misc.previousPage"):t("storylines.misc.nextPage"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})})}function PdfComponent({emitEvent:o,soundActions:e,keyboardControl:r,documentType:t,name:n,required:a,viewed:l,visible:u,documentId:f,documentId_labelId:d,...h}){const y=k=>o({type:"translate",payload:k}),[E]=e,p=h.document,{url:_}=p||"",[g,x]=React$2.useState(!1),C=React$2.useMemo(()=>({documentType:t,name:n,documentId:d,type:"pdf"}),[t,n,d]),R=React$2.useCallback(()=>{o({type:"finishMedia",payload:C})},[C,o]),[S,A]=React$2.useState(!1),[T,w]=React$2.useState(!1);if(React$2.useEffect(()=>{u||R(),a||x(!0)},[u,R,a]),!u)return null;const P=()=>{x(!0)},O=k=>{k.numPages===k.currentPage?w(!0):w(!1),k.numPages===1&&A(!0)};return r(null,S||!l&&T||T&&!a?R:null,S||!l&&T||!a?R:null),jsxRuntimeExports.jsxs("div",{className:`${l?"notes--results":""}`,children:[(S||!l&&g)&&jsxRuntimeExports.jsx("div",{className:"position--absolute top right z-index1",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__round gat--btn__close",onClick:()=>{R(),E("click-ui")},"aria-label":y("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),_&&jsxRuntimeExports.jsx(PdfVisor,{soundActions:e,emitNumberOfPages:k=>O(k),url:_,endPdf:P,translate:y,keyboardControl:r})]})}function UrlComponent({emitEvent:o,name:e,name_labelId:r,link:t,link_labelId:n,text:a,text_labelId:l,textForLink:u,viewed:f,documentType:d,soundActions:h,keyboardControl:y}){const E=S=>o({type:"translate",payload:S}),p={documentType:d,name:r,text:l,link:n,type:"url"},[_]=h,g=()=>{_("click-ui"),o({type:"finishMedia",payload:p})},[x,C]=React$2.useState(!1);y(null,!f&&x?g:null,!f&&x?g:null);const R=t.indexOf("http")!==0?`http://${t}`:t;return jsxRuntimeExports.jsx("div",{className:"popup--layer",children:jsxRuntimeExports.jsxs("div",{className:"popup popup--link",children:[!f&&x?jsxRuntimeExports.jsx("button",{className:"popup--close unset-button","data-testid":"close",type:"button","aria-label":E("storylines.misc.closePiece"),onClick:()=>g(),children:jsxRuntimeExports.jsx("span",{className:"icon-close"})}):null,jsxRuntimeExports.jsx("span",{className:"popup--link__title",children:e}),jsxRuntimeExports.jsx("span",{className:"popup--link__desc",children:a}),jsxRuntimeExports.jsx("a",{className:"popup--link__lineclamp popup--link__url",href:R,target:"_blank",rel:"noopener noreferrer",onClick:()=>{_("click-ui"),C(!0)},children:u||t})]})})}var hls={exports:{}};(function(o,e){typeof window<"u"&&function(t,n){o.exports=n()}(commonjsGlobal,function(){return function(r){var t={};function n(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return r[a].call(l.exports,l,l.exports,n),l.l=!0,l.exports}return n.m=r,n.c=t,n.d=function(a,l,u){n.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:u})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,l){if(l&1&&(a=n(a)),l&8||l&4&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(n.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),l&2&&typeof a!="string")for(var f in a)n.d(u,f,(function(d){return a[d]}).bind(null,f));return u},n.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(l,"a",l),l},n.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},n.p="/dist/",n(n.s="./src/hls.js")}({"./node_modules/eventemitter3/index.js":function(r,t,n){var a=Object.prototype.hasOwnProperty,l="~";function u(){}Object.create&&(u.prototype=Object.create(null),new u().__proto__||(l=!1));function f(E,p,_){this.fn=E,this.context=p,this.once=_||!1}function d(E,p,_,g,x){if(typeof _!="function")throw new TypeError("The listener must be a function");var C=new f(_,g||E,x),R=l?l+p:p;return E._events[R]?E._events[R].fn?E._events[R]=[E._events[R],C]:E._events[R].push(C):(E._events[R]=C,E._eventsCount++),E}function h(E,p){--E._eventsCount===0?E._events=new u:delete E._events[p]}function y(){this._events=new u,this._eventsCount=0}y.prototype.eventNames=function(){var p=[],_,g;if(this._eventsCount===0)return p;for(g in _=this._events)a.call(_,g)&&p.push(l?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(_)):p},y.prototype.listeners=function(p){var _=l?l+p:p,g=this._events[_];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,C=g.length,R=new Array(C);x<C;x++)R[x]=g[x].fn;return R},y.prototype.listenerCount=function(p){var _=l?l+p:p,g=this._events[_];return g?g.fn?1:g.length:0},y.prototype.emit=function(p,_,g,x,C,R){var S=l?l+p:p;if(!this._events[S])return!1;var A=this._events[S],T=arguments.length,w,P;if(A.fn){switch(A.once&&this.removeListener(p,A.fn,void 0,!0),T){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,_),!0;case 3:return A.fn.call(A.context,_,g),!0;case 4:return A.fn.call(A.context,_,g,x),!0;case 5:return A.fn.call(A.context,_,g,x,C),!0;case 6:return A.fn.call(A.context,_,g,x,C,R),!0}for(P=1,w=new Array(T-1);P<T;P++)w[P-1]=arguments[P];A.fn.apply(A.context,w)}else{var O=A.length,k;for(P=0;P<O;P++)switch(A[P].once&&this.removeListener(p,A[P].fn,void 0,!0),T){case 1:A[P].fn.call(A[P].context);break;case 2:A[P].fn.call(A[P].context,_);break;case 3:A[P].fn.call(A[P].context,_,g);break;case 4:A[P].fn.call(A[P].context,_,g,x);break;default:if(!w)for(k=1,w=new Array(T-1);k<T;k++)w[k-1]=arguments[k];A[P].fn.apply(A[P].context,w)}}return!0},y.prototype.on=function(p,_,g){return d(this,p,_,g,!1)},y.prototype.once=function(p,_,g){return d(this,p,_,g,!0)},y.prototype.removeListener=function(p,_,g,x){var C=l?l+p:p;if(!this._events[C])return this;if(!_)return h(this,C),this;var R=this._events[C];if(R.fn)R.fn===_&&(!x||R.once)&&(!g||R.context===g)&&h(this,C);else{for(var S=0,A=[],T=R.length;S<T;S++)(R[S].fn!==_||x&&!R[S].once||g&&R[S].context!==g)&&A.push(R[S]);A.length?this._events[C]=A.length===1?A[0]:A:h(this,C)}return this},y.prototype.removeAllListeners=function(p){var _;return p?(_=l?l+p:p,this._events[_]&&h(this,_)):(this._events=new u,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prefixed=l,y.EventEmitter=y,r.exports=y},"./node_modules/node-libs-browser/node_modules/events/events.js":function(r,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}r.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(d){if(!l(d)||d<0||isNaN(d))throw TypeError("n must be a positive number");return this._maxListeners=d,this},n.prototype.emit=function(d){var h,y,E,p,_,g;if(this._events||(this._events={}),d==="error"&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if(h=arguments[1],h instanceof Error)throw h;var x=new Error('Uncaught, unspecified "error" event. ('+h+")");throw x.context=h,x}if(y=this._events[d],f(y))return!1;if(a(y))switch(arguments.length){case 1:y.call(this);break;case 2:y.call(this,arguments[1]);break;case 3:y.call(this,arguments[1],arguments[2]);break;default:p=Array.prototype.slice.call(arguments,1),y.apply(this,p)}else if(u(y))for(p=Array.prototype.slice.call(arguments,1),g=y.slice(),E=g.length,_=0;_<E;_++)g[_].apply(this,p);return!0},n.prototype.addListener=function(d,h){var y;if(!a(h))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",d,a(h.listener)?h.listener:h),this._events[d]?u(this._events[d])?this._events[d].push(h):this._events[d]=[this._events[d],h]:this._events[d]=h,u(this._events[d])&&!this._events[d].warned&&(f(this._maxListeners)?y=n.defaultMaxListeners:y=this._maxListeners,y&&y>0&&this._events[d].length>y&&(this._events[d].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[d].length),typeof console.trace=="function"&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(d,h){if(!a(h))throw TypeError("listener must be a function");var y=!1;function E(){this.removeListener(d,E),y||(y=!0,h.apply(this,arguments))}return E.listener=h,this.on(d,E),this},n.prototype.removeListener=function(d,h){var y,E,p,_;if(!a(h))throw TypeError("listener must be a function");if(!this._events||!this._events[d])return this;if(y=this._events[d],p=y.length,E=-1,y===h||a(y.listener)&&y.listener===h)delete this._events[d],this._events.removeListener&&this.emit("removeListener",d,h);else if(u(y)){for(_=p;_-- >0;)if(y[_]===h||y[_].listener&&y[_].listener===h){E=_;break}if(E<0)return this;y.length===1?(y.length=0,delete this._events[d]):y.splice(E,1),this._events.removeListener&&this.emit("removeListener",d,h)}return this},n.prototype.removeAllListeners=function(d){var h,y;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[d]&&delete this._events[d],this;if(arguments.length===0){for(h in this._events)h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events={},this}if(y=this._events[d],a(y))this.removeListener(d,y);else if(y)for(;y.length;)this.removeListener(d,y[y.length-1]);return delete this._events[d],this},n.prototype.listeners=function(d){var h;return!this._events||!this._events[d]?h=[]:a(this._events[d])?h=[this._events[d]]:h=this._events[d].slice(),h},n.prototype.listenerCount=function(d){if(this._events){var h=this._events[d];if(a(h))return 1;if(h)return h.length}return 0},n.listenerCount=function(d,h){return d.listenerCount(h)};function a(d){return typeof d=="function"}function l(d){return typeof d=="number"}function u(d){return typeof d=="object"&&d!==null}function f(d){return d===void 0}},"./node_modules/url-toolkit/src/url-toolkit.js":function(r,t,n){(function(a){var l=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,u=/^([^\/?#]*)(.*)$/,f=/(?:\/|^)\.(?=\/)/g,d=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,h={buildAbsoluteURL:function(y,E,p){if(p=p||{},y=y.trim(),E=E.trim(),!E){if(!p.alwaysNormalize)return y;var _=h.parseURL(y);if(!_)throw new Error("Error trying to parse base URL.");return _.path=h.normalizePath(_.path),h.buildURLFromParts(_)}var g=h.parseURL(E);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return p.alwaysNormalize?(g.path=h.normalizePath(g.path),h.buildURLFromParts(g)):E;var x=h.parseURL(y);if(!x)throw new Error("Error trying to parse base URL.");if(!x.netLoc&&x.path&&x.path[0]!=="/"){var C=u.exec(x.path);x.netLoc=C[1],x.path=C[2]}x.netLoc&&!x.path&&(x.path="/");var R={scheme:x.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(R.netLoc=x.netLoc,g.path[0]!=="/"))if(!g.path)R.path=x.path,g.params||(R.params=x.params,g.query||(R.query=x.query));else{var S=x.path,A=S.substring(0,S.lastIndexOf("/")+1)+g.path;R.path=h.normalizePath(A)}return R.path===null&&(R.path=p.alwaysNormalize?h.normalizePath(g.path):g.path),h.buildURLFromParts(R)},parseURL:function(y){var E=l.exec(y);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(y){for(y=y.split("").reverse().join("").replace(f,"");y.length!==(y=y.replace(d,"")).length;);return y.split("").reverse().join("")},buildURLFromParts:function(y){return y.scheme+y.netLoc+y.path+y.params+y.query+y.fragment}};r.exports=h})()},"./node_modules/webworkify-webpack/index.js":function(r,t,n){function a(p){var _={};function g(C){if(_[C])return _[C].exports;var R=_[C]={i:C,l:!1,exports:{}};return p[C].call(R.exports,R,R.exports,g),R.l=!0,R.exports}g.m=p,g.c=_,g.i=function(C){return C},g.d=function(C,R,S){g.o(C,R)||Object.defineProperty(C,R,{configurable:!1,enumerable:!0,get:S})},g.r=function(C){Object.defineProperty(C,"__esModule",{value:!0})},g.n=function(C){var R=C&&C.__esModule?function(){return C.default}:function(){return C};return g.d(R,"a",R),R},g.o=function(C,R){return Object.prototype.hasOwnProperty.call(C,R)},g.p="/",g.oe=function(C){throw console.error(C),C};var x=g(g.s=ENTRY_MODULE);return x.default||x}var l="[\\.|\\-|\\+|\\w|/|@]+",u="\\((/\\*.*?\\*/)?s?.*?("+l+").*?\\)";function f(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function d(p){return!isNaN(1*p)}function h(p,_,g){var x={};x[g]=[];var C=_.toString(),R=C.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!R)return x;for(var S=R[1],A=new RegExp("(\\\\n|\\W)"+f(S)+u,"g"),T;T=A.exec(C);)T[3]!=="dll-reference"&&x[g].push(T[3]);for(A=new RegExp("\\("+f(S)+'\\("(dll-reference\\s('+l+'))"\\)\\)'+u,"g");T=A.exec(C);)p[T[2]]||(x[g].push(T[1]),p[T[2]]=n(T[1]).m),x[T[2]]=x[T[2]]||[],x[T[2]].push(T[4]);for(var w=Object.keys(x),P=0;P<w.length;P++)for(var O=0;O<x[w[P]].length;O++)d(x[w[P]][O])&&(x[w[P]][O]=1*x[w[P]][O]);return x}function y(p){var _=Object.keys(p);return _.reduce(function(g,x){return g||p[x].length>0},!1)}function E(p,_){for(var g={main:[_]},x={main:[]},C={main:{}};y(g);)for(var R=Object.keys(g),S=0;S<R.length;S++){var A=R[S],T=g[A],w=T.pop();if(C[A]=C[A]||{},!(C[A][w]||!p[A][w])){C[A][w]=!0,x[A]=x[A]||[],x[A].push(w);for(var P=h(p,p[A][w],A),O=Object.keys(P),k=0;k<O.length;k++)g[O[k]]=g[O[k]]||[],g[O[k]]=g[O[k]].concat(P[O[k]])}}return x}r.exports=function(p,_){_=_||{};var g={main:n.m},x=_.all?{main:Object.keys(g.main)}:E(g,p),C="";Object.keys(x).filter(function(w){return w!=="main"}).forEach(function(w){for(var P=0;x[w][P];)P++;x[w].push(P),g[w][P]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",C=C+"var "+w+" = ("+a.toString().replace("ENTRY_MODULE",JSON.stringify(P))+")({"+x[w].map(function(O){return""+JSON.stringify(O)+": "+g[w][O].toString()}).join(",")+`});
53
+ `}),C=C+"new (("+a.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+x.main.map(function(w){return""+JSON.stringify(w)+": "+g.main[w].toString()}).join(",")+"}))(self);";var R=new window.Blob([C],{type:"text/javascript"});if(_.bare)return R;var S=window.URL||window.webkitURL||window.mozURL||window.msURL,A=S.createObjectURL(R),T=new window.Worker(A);return T.objectURL=A,T}},"./src/config.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/controller/abr-controller.js"),l=n("./src/controller/buffer-controller.js"),u=n("./src/controller/cap-level-controller.js"),f=n("./src/controller/fps-controller.js"),d=n("./src/utils/xhr-loader.js"),h=n("./src/controller/audio-track-controller.js"),y=n("./src/controller/audio-stream-controller.js"),E=n("./src/utils/cues.js"),p=n("./src/controller/timeline-controller.js"),_=n("./src/controller/subtitle-track-controller.js"),g=n("./src/controller/subtitle-stream-controller.js"),x=n("./src/controller/eme-controller.js"),C=n("./src/utils/mediakeys-helper.js");t.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:60*1e3*1e3,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:d.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:a.default,bufferController:l.default,capLevelController:u.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:C.requestMediaKeySystemAccess},t.hlsDefaultConfig.subtitleStreamController=g.SubtitleStreamController,t.hlsDefaultConfig.subtitleTrackController=_.default,t.hlsDefaultConfig.timelineController=p.default,t.hlsDefaultConfig.cueHandler=E,t.hlsDefaultConfig.enableCEA708Captions=!0,t.hlsDefaultConfig.enableWebVTT=!0,t.hlsDefaultConfig.captionsTextTrack1Label="English",t.hlsDefaultConfig.captionsTextTrack1LanguageCode="en",t.hlsDefaultConfig.captionsTextTrack2Label="Spanish",t.hlsDefaultConfig.captionsTextTrack2LanguageCode="es",t.hlsDefaultConfig.audioStreamController=y.default,t.hlsDefaultConfig.audioTrackController=h.default,t.hlsDefaultConfig.emeController=x.default},"./src/controller/abr-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,C){x.__proto__=C}||function(x,C){for(var R in C)C.hasOwnProperty(R)&&(x[R]=C[R])};return function(x,C){g(x,C);function R(){this.constructor=x}x.prototype=C===null?Object.create(C):(R.prototype=C.prototype,new R)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/utils/buffer-helper.js"),h=n("./src/errors.js"),y=n("./src/utils/logger.js"),E=n("./src/utils/ewma-bandwidth-estimator.js"),p=window.performance,_=function(g){l(x,g);function x(C){var R=g.call(this,C,u.default.FRAG_LOADING,u.default.FRAG_LOADED,u.default.FRAG_BUFFERED,u.default.ERROR)||this;return R.lastLoadedFragLevel=0,R._nextAutoLevel=-1,R.hls=C,R.timer=null,R._bwEstimator=null,R.onCheck=R._abandonRulesCheck.bind(R),R}return x.prototype.destroy=function(){this.clearTimer(),f.default.prototype.destroy.call(this)},x.prototype.onFragLoading=function(C){var R=C.frag;if(R.type==="main"&&(this.timer||(this.fragCurrent=R,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var S=this.hls,A=S.config,T=R.level,w=S.levels[T].details.live,P=void 0,O=void 0;w?(P=A.abrEwmaFastLive,O=A.abrEwmaSlowLive):(P=A.abrEwmaFastVoD,O=A.abrEwmaSlowVoD),this._bwEstimator=new E.default(S,O,P,A.abrEwmaDefaultEstimate)}},x.prototype._abandonRulesCheck=function(){var C=this.hls,R=C.media,S=this.fragCurrent;if(S){var A=S.loader,T=C.minAutoLevel;if(!A||A.stats&&A.stats.aborted){y.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}var w=A.stats;if(R&&w&&(!R.paused&&R.playbackRate!==0||!R.readyState)&&S.autoLevel&&S.level){var P=p.now()-w.trequest,O=Math.abs(R.playbackRate);if(P>500*S.duration/O){var k=C.levels,D=Math.max(1,w.bw?w.bw/8:w.loaded*1e3/P),F=k[S.level],G=F.realBitrate?Math.max(F.realBitrate,F.bitrate):F.bitrate,V=w.total?w.total:Math.max(w.loaded,Math.round(S.duration*G/8)),W=R.currentTime,ee=(V-w.loaded)/D,q=(d.BufferHelper.bufferInfo(R,W,C.config.maxBufferHole).end-W)/O;if(q<2*S.duration/O&&ee>q){var z=void 0,U=void 0;for(U=S.level-1;U>T;U--){var $=k[U].realBitrate?Math.max(k[U].realBitrate,k[U].bitrate):k[U].bitrate;if(z=S.duration*$/(8*.8*D),z<q)break}z<ee&&(y.logger.warn("loading too slow, abort fragment loading and switch to level "+U+":fragLoadedDelay["+U+"]<fragLoadedDelay["+(S.level-1)+"];bufferStarvationDelay:"+z.toFixed(1)+"<"+ee.toFixed(1)+":"+q.toFixed(1)),C.nextLoadLevel=U,this._bwEstimator.sample(P,w.loaded),A.abort(),this.clearTimer(),C.trigger(u.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:S,stats:w}))}}}}},x.prototype.onFragLoaded=function(C){var R=C.frag;if(R.type==="main"&&a.isFinite(R.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=R.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[R.level],A=(S.loaded?S.loaded.bytes:0)+C.stats.loaded,T=(S.loaded?S.loaded.duration:0)+C.frag.duration;S.loaded={bytes:A,duration:T},S.realBitrate=Math.round(8*A/T)}if(C.frag.bitrateTest){var w=C.stats;w.tparsed=w.tbuffered=w.tload,this.onFragBuffered(C)}}},x.prototype.onFragBuffered=function(C){var R=C.stats,S=C.frag;if(R.aborted!==!0&&S.type==="main"&&a.isFinite(S.sn)&&(!S.bitrateTest||R.tload===R.tbuffered)){var A=R.tparsed-R.trequest;y.logger.log("latency/loading/parsing/append/kbps:"+Math.round(R.tfirst-R.trequest)+"/"+Math.round(R.tload-R.tfirst)+"/"+Math.round(R.tparsed-R.tload)+"/"+Math.round(R.tbuffered-R.tparsed)+"/"+Math.round(8*R.loaded/(R.tbuffered-R.trequest))),this._bwEstimator.sample(A,R.loaded),R.bwEstimate=this._bwEstimator.getEstimate(),S.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0}},x.prototype.onError=function(C){switch(C.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break}},x.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},Object.defineProperty(x.prototype,"nextAutoLevel",{get:function(){var C=this._nextAutoLevel,R=this._bwEstimator;if(C!==-1&&(!R||!R.canEstimate()))return C;var S=this._nextABRAutoLevel;return C!==-1&&(S=Math.min(C,S)),S},set:function(C){this._nextAutoLevel=C},enumerable:!0,configurable:!0}),Object.defineProperty(x.prototype,"_nextABRAutoLevel",{get:function(){var C=this.hls,R=C.maxAutoLevel,S=C.levels,A=C.config,T=C.minAutoLevel,w=C.media,P=this.lastLoadedFragLevel,O=this.fragCurrent?this.fragCurrent.duration:0,k=w?w.currentTime:0,D=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,F=this._bwEstimator?this._bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,G=(d.BufferHelper.bufferInfo(w,k,A.maxBufferHole).end-k)/D,V=this._findBestLevel(P,O,F,T,R,G,A.abrBandWidthFactor,A.abrBandWidthUpFactor,S);if(V>=0)return V;y.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var W=O?Math.min(O,A.maxStarvationDelay):A.maxStarvationDelay,ee=A.abrBandWidthFactor,q=A.abrBandWidthUpFactor;if(G===0){var z=this.bitrateTestDelay;if(z){var U=O?Math.min(O,A.maxLoadingDelay):A.maxLoadingDelay;W=U-z,y.logger.trace("bitrate test took "+Math.round(1e3*z)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*W)+" ms"),ee=q=1}}return V=this._findBestLevel(P,O,F,T,R,G+W,ee,q,S),Math.max(V,0)},enumerable:!0,configurable:!0}),x.prototype._findBestLevel=function(C,R,S,A,T,w,P,O,k){for(var D=T;D>=A;D--){var F=k[D];if(F){var G=F.details,V=G?G.totalduration/G.fragments.length:R,W=G?G.live:!1,ee=void 0;D<=C?ee=P*S:ee=O*S;var q=k[D].realBitrate?Math.max(k[D].realBitrate,k[D].bitrate):k[D].bitrate,z=q*V/ee;if(y.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(ee)+"/"+q+"/"+V+"/"+w+"/"+z),ee>q&&(!z||W&&!this.bitrateTestDelay||z<w))return D}}return-1},x}(f.default);t.default=_}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/audio-stream-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,O){P.__proto__=O}||function(P,O){for(var k in O)O.hasOwnProperty(k)&&(P[k]=O[k])};return function(P,O){w(P,O);function k(){this.constructor=P}P.prototype=O===null?Object.create(O):(k.prototype=O.prototype,new k)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/utils/binary-search.js"),f=n("./src/utils/buffer-helper.js"),d=n("./src/demux/demuxer.js"),h=n("./src/events.js"),y=n("./src/controller/level-helper.js"),E=n("./src/utils/time-ranges.js"),p=n("./src/errors.js"),_=n("./src/utils/logger.js"),g=n("./src/utils/discontinuities.js"),x=n("./src/controller/fragment-tracker.js"),C=n("./src/loader/fragment.js"),R=n("./src/controller/base-stream-controller.js"),S=window.performance,A=100,T=function(w){l(P,w);function P(O,k){var D=w.call(this,O,h.default.MEDIA_ATTACHED,h.default.MEDIA_DETACHING,h.default.AUDIO_TRACKS_UPDATED,h.default.AUDIO_TRACK_SWITCHING,h.default.AUDIO_TRACK_LOADED,h.default.KEY_LOADED,h.default.FRAG_LOADED,h.default.FRAG_PARSING_INIT_SEGMENT,h.default.FRAG_PARSING_DATA,h.default.FRAG_PARSED,h.default.ERROR,h.default.BUFFER_RESET,h.default.BUFFER_CREATED,h.default.BUFFER_APPENDED,h.default.BUFFER_FLUSHED,h.default.INIT_PTS_FOUND)||this;return D.fragmentTracker=k,D.config=O.config,D.audioCodecSwap=!1,D._state=R.State.STOPPED,D.initPTS=[],D.waitingFragment=null,D.videoTrackCC=null,D}return P.prototype.onInitPtsFound=function(O){var k=O.id,D=O.frag.cc,F=O.initPTS;k==="main"&&(this.initPTS[D]=F,this.videoTrackCC=D,_.logger.log("InitPTS for cc: "+D+" found from video track: "+F),this.state===R.State.WAITING_INIT_PTS&&this.tick())},P.prototype.startLoad=function(O){if(this.tracks){var k=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,k>0&&O===-1?(_.logger.log("audio:override startPosition with lastCurrentTime @"+k.toFixed(3)),this.state=R.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:O,this.state=R.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=O,this.state=R.State.STOPPED},Object.defineProperty(P.prototype,"state",{get:function(){return this._state},set:function(O){if(this.state!==O){var k=this.state;this._state=O,_.logger.log("audio stream:"+k+"->"+O)}},enumerable:!0,configurable:!0}),P.prototype.doTick=function(){var O,k,D,F=this.hls,G=F.config;switch(this.state){case R.State.ERROR:case R.State.PAUSED:case R.State.BUFFER_FLUSHING:break;case R.State.STARTING:this.state=R.State.WAITING_TRACK,this.loadedmetadata=!1;break;case R.State.IDLE:var V=this.tracks;if(!V||!this.media&&(this.startFragRequested||!G.startFragPrefetch))break;if(this.loadedmetadata)O=this.media.currentTime;else if(O=this.nextLoadPosition,O===void 0)break;var W=this.mediaBuffer?this.mediaBuffer:this.media,ee=this.videoBuffer?this.videoBuffer:this.media,q=f.BufferHelper.bufferInfo(W,O,G.maxBufferHole),z=f.BufferHelper.bufferInfo(ee,O,G.maxBufferHole),U=q.len,$=q.end,I=this.fragPrevious,B=Math.min(G.maxBufferLength,G.maxMaxBufferLength),X=Math.max(B,z.len),Q=this.audioSwitch,J=this.trackId;if((U<X||Q)&&J<V.length){if(D=V[J].details,typeof D>"u"){this.state=R.State.WAITING_TRACK;break}if(!Q&&this._streamEnded(q,D)){this.hls.trigger(h.default.BUFFER_EOS,{type:"audio"}),this.state=R.State.ENDED;return}var ne=D.fragments,ae=ne.length,Z=ne[0].start,se=ne[ae-1].start+ne[ae-1].duration,oe=void 0;if(Q){if(D.live&&!D.PTSKnown)_.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),$=0;else if($=O,D.PTSKnown&&O<Z)if(q.end>Z||q.nextStart)_.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=Z+.05;else return}if(D.initSegment&&!D.initSegment.data)oe=D.initSegment;else if($<=Z){if(oe=ne[0],this.videoTrackCC!==null&&oe.cc!==this.videoTrackCC&&(oe=g.findFragWithCC(ne,this.videoTrackCC)),D.live&&oe.loadIdx&&oe.loadIdx===this.fragLoadIdx){var fe=q.nextStart?q.nextStart:Z;_.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(fe+.05)),this.media.currentTime=fe+.05;return}}else{var de=void 0,ce=G.maxFragLookUpTolerance,Se=I?ne[I.sn-ne[0].sn+1]:void 0,Le=function(ut){var ft=Math.min(ce,ut.duration);return ut.start+ut.duration-ft<=$?1:ut.start-ft>$&&ut.start?-1:0};$<se?($>se-ce&&(ce=0),Se&&!Le(Se)?de=Se:de=u.default.search(ne,Le)):de=ne[ae-1],de&&(oe=de,Z=de.start,I&&oe.level===I.level&&oe.sn===I.sn&&(oe.sn<D.endSN?(oe=ne[oe.sn+1-D.startSN],_.logger.log("SN just loaded, load next one: "+oe.sn)):oe=null))}oe&&(oe.encrypted?(_.logger.log("Loading key for "+oe.sn+" of ["+D.startSN+" ,"+D.endSN+"],track "+J),this.state=R.State.KEY_LOADING,F.trigger(h.default.KEY_LOADING,{frag:oe})):(_.logger.log("Loading "+oe.sn+", cc: "+oe.cc+" of ["+D.startSN+" ,"+D.endSN+"],track "+J+", currentTime:"+O+",bufferEnd:"+$.toFixed(3)),this.fragCurrent=oe,(Q||this.fragmentTracker.getState(oe)===x.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,a.isFinite(oe.sn)&&(this.nextLoadPosition=oe.start+oe.duration),F.trigger(h.default.FRAG_LOADING,{frag:oe}),this.state=R.State.FRAG_LOADING)))}break;case R.State.WAITING_TRACK:k=this.tracks[this.trackId],k&&k.details&&(this.state=R.State.IDLE);break;case R.State.FRAG_LOADING_WAITING_RETRY:var Ne=S.now(),He=this.retryDate;W=this.media;var Ke=W&&W.seeking;(!He||Ne>=He||Ke)&&(_.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=R.State.IDLE);break;case R.State.WAITING_INIT_PTS:var Qe=this.videoTrackCC;if(this.initPTS[Qe]===void 0)break;var dt=this.waitingFragment;if(dt){var yt=dt.frag.cc;Qe!==yt?(k=this.tracks[this.trackId],k.details&&k.details.live&&(_.logger.warn("Waiting fragment CC ("+yt+") does not match video track CC ("+Qe+")"),this.waitingFragment=null,this.state=R.State.IDLE)):(this.state=R.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=R.State.IDLE;break;case R.State.STOPPED:case R.State.FRAG_LOADING:case R.State.PARSING:case R.State.PARSED:case R.State.ENDED:break}},P.prototype.onMediaAttached=function(O){var k=this.media=this.mediaBuffer=O.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),k.addEventListener("seeking",this.onvseeking),k.addEventListener("ended",this.onvended);var D=this.config;this.tracks&&D.autoStartLoad&&this.startLoad(D.startPosition)},P.prototype.onMediaDetaching=function(){var O=this.media;O&&O.ended&&(_.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),O&&(O.removeEventListener("seeking",this.onvseeking),O.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},P.prototype.onAudioTracksUpdated=function(O){_.logger.log("audio tracks updated"),this.tracks=O.audioTracks},P.prototype.onAudioTrackSwitching=function(O){var k=!!O.url;this.trackId=O.id,this.fragCurrent=null,this.state=R.State.PAUSED,this.waitingFragment=null,k?this.setInterval(A):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),k&&(this.audioSwitch=!0,this.state=R.State.IDLE),this.tick()},P.prototype.onAudioTrackLoaded=function(O){var k=O.details,D=O.id,F=this.tracks[D],G=k.totalduration,V=0;if(_.logger.log("track "+D+" loaded ["+k.startSN+","+k.endSN+"],duration:"+G),k.live){var W=F.details;W&&k.fragments.length>0?(y.mergeDetails(W,k),V=k.fragments[0].start,k.PTSKnown?_.logger.log("live audio playlist sliding:"+V.toFixed(3)):_.logger.log("live audio playlist - outdated PTS, unknown sliding")):(k.PTSKnown=!1,_.logger.log("live audio playlist - first load, unknown sliding"))}else k.PTSKnown=!1;if(F.details=k,!this.startFragRequested){if(this.startPosition===-1){var ee=k.startTimeOffset;a.isFinite(ee)?(_.logger.log("start time offset found in playlist, adjust startPosition to "+ee),this.startPosition=ee):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===R.State.WAITING_TRACK&&(this.state=R.State.IDLE),this.tick()},P.prototype.onKeyLoaded=function(){this.state===R.State.KEY_LOADING&&(this.state=R.State.IDLE,this.tick())},P.prototype.onFragLoaded=function(O){var k=this.fragCurrent,D=O.frag;if(this.state===R.State.FRAG_LOADING&&k&&D.type==="audio"&&D.level===k.level&&D.sn===k.sn){var F=this.tracks[this.trackId],G=F.details,V=G.totalduration,W=k.level,ee=k.sn,q=k.cc,z=this.config.defaultAudioCodec||F.audioCodec||"mp4a.40.2",U=this.stats=O.stats;if(ee==="initSegment")this.state=R.State.IDLE,U.tparsed=U.tbuffered=S.now(),G.initSegment.data=O.payload,this.hls.trigger(h.default.FRAG_BUFFERED,{stats:U,frag:k,id:"audio"}),this.tick();else{this.state=R.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new d.default(this.hls,"audio"));var $=this.initPTS[q],I=G.initSegment?G.initSegment.data:[];if(G.initSegment||$!==void 0){this.pendingBuffering=!0,_.logger.log("Demuxing "+ee+" of ["+G.startSN+" ,"+G.endSN+"],track "+W);var B=!1;this.demuxer.push(O.payload,I,z,null,k,V,B,$)}else _.logger.log("unknown video PTS for continuity counter "+q+", waiting for video PTS before demuxing audio frag "+ee+" of ["+G.startSN+" ,"+G.endSN+"],track "+W),this.waitingFragment=O,this.state=R.State.WAITING_INIT_PTS}}this.fragLoadError=0},P.prototype.onFragParsingInitSegment=function(O){var k=this.fragCurrent,D=O.frag;if(k&&O.id==="audio"&&D.sn===k.sn&&D.level===k.level&&this.state===R.State.PARSING){var F=O.tracks,G=void 0;if(F.video&&delete F.video,G=F.audio,G){G.levelCodec=G.codec,G.id=O.id,this.hls.trigger(h.default.BUFFER_CODECS,F),_.logger.log("audio track:audio,container:"+G.container+",codecs[level/parsed]=["+G.levelCodec+"/"+G.codec+"]");var V=G.initSegment;if(V){var W={type:"audio",data:V,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[W]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(h.default.BUFFER_APPENDING,W))}this.tick()}}},P.prototype.onFragParsingData=function(O){var k=this,D=this.fragCurrent,F=O.frag;if(D&&O.id==="audio"&&O.type==="audio"&&F.sn===D.sn&&F.level===D.level&&this.state===R.State.PARSING){var G=this.trackId,V=this.tracks[G],W=this.hls;a.isFinite(O.endPTS)||(O.endPTS=O.startPTS+D.duration,O.endDTS=O.startDTS+D.duration),D.addElementaryStream(C.default.ElementaryStreamTypes.AUDIO),_.logger.log("parsed "+O.type+",PTS:["+O.startPTS.toFixed(3)+","+O.endPTS.toFixed(3)+"],DTS:["+O.startDTS.toFixed(3)+"/"+O.endDTS.toFixed(3)+"],nb:"+O.nb),y.updateFragPTSDTS(V.details,D,O.startPTS,O.endPTS);var ee=this.audioSwitch,q=this.media,z=!1;if(ee&&q)if(q.readyState){var U=q.currentTime;_.logger.log("switching audio track : currentTime:"+U),U>=O.startPTS&&(_.logger.log("switching audio track : flushing all audio"),this.state=R.State.BUFFER_FLUSHING,W.trigger(h.default.BUFFER_FLUSHING,{startOffset:0,endOffset:a.POSITIVE_INFINITY,type:"audio"}),z=!0,this.audioSwitch=!1,W.trigger(h.default.AUDIO_TRACK_SWITCHED,{id:G}))}else this.audioSwitch=!1,W.trigger(h.default.AUDIO_TRACK_SWITCHED,{id:G});var $=this.pendingData;if(!$){_.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),W.trigger(h.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([O.data1,O.data2].forEach(function(I){I&&I.length&&$.push({type:O.type,data:I,parent:"audio",content:"data"})}),!z&&$.length&&($.forEach(function(I){k.state===R.State.PARSING&&(k.pendingBuffering=!0,k.hls.trigger(h.default.BUFFER_APPENDING,I))}),this.pendingData=[],this.appended=!0)),this.tick()}},P.prototype.onFragParsed=function(O){var k=this.fragCurrent,D=O.frag;k&&O.id==="audio"&&D.sn===k.sn&&D.level===k.level&&this.state===R.State.PARSING&&(this.stats.tparsed=S.now(),this.state=R.State.PARSED,this._checkAppendedParsed())},P.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},P.prototype.onBufferCreated=function(O){var k=O.tracks.audio;k&&(this.mediaBuffer=k.buffer,this.loadedmetadata=!0),O.tracks.video&&(this.videoBuffer=O.tracks.video.buffer)},P.prototype.onBufferAppended=function(O){if(O.parent==="audio"){var k=this.state;(k===R.State.PARSING||k===R.State.PARSED)&&(this.pendingBuffering=O.pending>0,this._checkAppendedParsed())}},P.prototype._checkAppendedParsed=function(){if(this.state===R.State.PARSED&&(!this.appended||!this.pendingBuffering)){var O=this.fragCurrent,k=this.stats,D=this.hls;if(O){this.fragPrevious=O,k.tbuffered=S.now(),D.trigger(h.default.FRAG_BUFFERED,{stats:k,frag:O,id:"audio"});var F=this.mediaBuffer?this.mediaBuffer:this.media;_.logger.log("audio buffered : "+E.default.toString(F.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,D.trigger(h.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=R.State.IDLE}this.tick()}},P.prototype.onError=function(O){var k=O.frag;if(!(k&&k.type!=="audio"))switch(O.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:var D=O.frag;if(D&&D.type!=="audio")break;if(!O.fatal){var F=this.fragLoadError;F?F++:F=1;var G=this.config;if(F<=G.fragLoadingMaxRetry){this.fragLoadError=F;var V=Math.min(Math.pow(2,F-1)*G.fragLoadingRetryDelay,G.fragLoadingMaxRetryTimeout);_.logger.warn("AudioStreamController: frag loading failed, retry in "+V+" ms"),this.retryDate=S.now()+V,this.state=R.State.FRAG_LOADING_WAITING_RETRY}else _.logger.error("AudioStreamController: "+O.details+" reaches max retry, redispatch as fatal ..."),O.fatal=!0,this.state=R.State.ERROR}break;case p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==R.State.ERROR&&(this.state=O.fatal?R.State.ERROR:R.State.IDLE,_.logger.warn("AudioStreamController: "+O.details+" while loading frag, now switching to "+this.state+" state ..."));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(O.parent==="audio"&&(this.state===R.State.PARSING||this.state===R.State.PARSED)){var W=this.mediaBuffer,ee=this.media.currentTime,q=W&&f.BufferHelper.isBuffered(W,ee)&&f.BufferHelper.isBuffered(W,ee+.5);if(q){var G=this.config;G.maxMaxBufferLength>=G.maxBufferLength&&(G.maxMaxBufferLength/=2,_.logger.warn("AudioStreamController: reduce max buffer length to "+G.maxMaxBufferLength+"s")),this.state=R.State.IDLE}else _.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=R.State.BUFFER_FLUSHING,this.hls.trigger(h.default.BUFFER_FLUSHING,{startOffset:0,endOffset:a.POSITIVE_INFINITY,type:"audio"})}break}},P.prototype.onBufferFlushed=function(){var O=this,k=this.pendingData;k&&k.length?(_.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),k.forEach(function(D){O.hls.trigger(h.default.BUFFER_APPENDING,D)}),this.appended=!0,this.pendingData=[],this.state=R.State.PARSED):(this.state=R.State.IDLE,this.fragPrevious=null,this.tick())},P}(R.default);t.default=T}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/audio-track-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,p){E.__proto__=p}||function(E,p){for(var _ in p)p.hasOwnProperty(_)&&(E[_]=p[_])};return function(E,p){y(E,p);function _(){this.constructor=E}E.prototype=p===null?Object.create(p):(_.prototype=p.prototype,new _)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/task-loop.js"),f=n("./src/utils/logger.js"),d=n("./src/errors.js"),h=function(y){a(E,y);function E(p){var _=y.call(this,p,l.default.MANIFEST_LOADING,l.default.MANIFEST_PARSED,l.default.AUDIO_TRACK_LOADED,l.default.AUDIO_TRACK_SWITCHED,l.default.LEVEL_LOADED,l.default.ERROR)||this;return _._trackId=-1,_._selectDefaultTrack=!0,_.tracks=[],_.trackIdBlacklist=Object.create(null),_.audioGroupId=null,_}return E.prototype.onManifestLoading=function(){this.tracks=[],this._trackId=-1,this._selectDefaultTrack=!0},E.prototype.onManifestParsed=function(p){var _=this.tracks=p.audioTracks||[];this.hls.trigger(l.default.AUDIO_TRACKS_UPDATED,{audioTracks:_})},E.prototype.onAudioTrackLoaded=function(p){if(p.id>=this.tracks.length){f.logger.warn("Invalid audio track id:",p.id);return}if(f.logger.log("audioTrack "+p.id+" loaded"),this.tracks[p.id].details=p.details,p.details.live&&!this.hasInterval()){var _=p.details.targetduration*1e3;this.setInterval(_)}!p.details.live&&this.hasInterval()&&this.clearInterval()},E.prototype.onAudioTrackSwitched=function(p){var _=this.tracks[p.id].groupId;_&&this.audioGroupId!==_&&(this.audioGroupId=_)},E.prototype.onLevelLoaded=function(p){var _=this.hls.levels[p.level];if(_.audioGroupIds){var g=_.audioGroupIds[_.urlId];this.audioGroupId!==g&&(this.audioGroupId=g,this._selectInitialAudioTrack())}},E.prototype.onError=function(p){p.type===d.ErrorTypes.NETWORK_ERROR&&(p.fatal&&this.clearInterval(),p.details===d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(f.logger.warn("Network failure on audio-track id:",p.context.id),this._handleLoadError()))},Object.defineProperty(E.prototype,"audioTracks",{get:function(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"audioTrack",{get:function(){return this._trackId},set:function(p){this._setAudioTrack(p),this._selectDefaultTrack=!1},enumerable:!0,configurable:!0}),E.prototype._setAudioTrack=function(p){if(this._trackId===p&&this.tracks[this._trackId].details){f.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(p<0||p>=this.tracks.length){f.logger.warn("Invalid id passed to audio-track controller");return}var _=this.tracks[p];f.logger.log("Now switching to audio-track index "+p),this.clearInterval(),this._trackId=p;var g=_.url,x=_.type,C=_.id;this.hls.trigger(l.default.AUDIO_TRACK_SWITCHING,{id:C,type:x,url:g}),this._loadTrackDetailsIfNeeded(_)},E.prototype.doTick=function(){this._updateTrack(this._trackId)},E.prototype._selectInitialAudioTrack=function(){var p=this,_=this.tracks;if(_.length){var g=this.tracks[this._trackId],x=null;if(g&&(x=g.name),this._selectDefaultTrack){var C=_.filter(function(A){return A.default});C.length?_=C:f.logger.warn("No default audio tracks defined")}var R=!1,S=function(){_.forEach(function(A){R||(!p.audioGroupId||A.groupId===p.audioGroupId)&&(!x||x===A.name)&&(p._setAudioTrack(A.id),R=!0)})};S(),R||(x=null,S()),R||(f.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},E.prototype._needsTrackLoading=function(p){var _=p.details,g=p.url;return!_||_.live?!!g:!1},E.prototype._loadTrackDetailsIfNeeded=function(p){if(this._needsTrackLoading(p)){var _=p.url,g=p.id;f.logger.log("loading audio-track playlist for id: "+g),this.hls.trigger(l.default.AUDIO_TRACK_LOADING,{url:_,id:g})}},E.prototype._updateTrack=function(p){if(!(p<0||p>=this.tracks.length)){this.clearInterval(),this._trackId=p,f.logger.log("trying to update audio-track "+p);var _=this.tracks[p];this._loadTrackDetailsIfNeeded(_)}},E.prototype._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var p=this._trackId,_=this.tracks[p],g=_.name,x=_.language,C=_.groupId;f.logger.warn("Loading failed on audio track id: "+p+", group-id: "+C+', name/language: "'+g+'" / "'+x+'"');for(var R=p,S=0;S<this.tracks.length;S++)if(!this.trackIdBlacklist[S]){var A=this.tracks[S];if(A.name===g){R=S;break}}if(R===p){f.logger.warn('No fallback audio-track found for name/language: "'+g+'" / "'+x+'"');return}f.logger.log("Attempting audio-track fallback id:",R,"group-id:",this.tracks[R].groupId),this._setAudioTrack(R)},E}(u.default);t.default=h},"./src/controller/base-stream-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,_){p.__proto__=_}||function(p,_){for(var g in _)_.hasOwnProperty(g)&&(p[g]=_[g])};return function(p,_){E(p,_);function g(){this.constructor=p}p.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/task-loop.js"),f=n("./src/controller/fragment-tracker.js"),d=n("./src/utils/buffer-helper.js"),h=n("./src/utils/logger.js");t.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};var y=function(E){l(p,E);function p(){return E!==null&&E.apply(this,arguments)||this}return p.prototype.doTick=function(){},p.prototype.startLoad=function(){},p.prototype.stopLoad=function(){var _=this.fragCurrent;_&&(_.loader&&_.loader.abort(),this.fragmentTracker.removeFragment(_)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=t.State.STOPPED},p.prototype._streamEnded=function(_,g){var x=this,C=x.fragCurrent,R=x.fragmentTracker;if(!g.live&&C&&!C.backtracked&&C.sn===g.endSN&&!_.nextStart){var S=R.getState(C);return S===f.FragmentState.PARTIAL||S===f.FragmentState.OK}return!1},p.prototype.onMediaSeeking=function(){var _=this,g=_.config,x=_.media,C=_.mediaBuffer,R=_.state,S=x?x.currentTime:null,A=d.BufferHelper.bufferInfo(C||x,S,this.config.maxBufferHole);if(a.isFinite(S)&&h.logger.log("media seeking to "+S.toFixed(3)),R===t.State.FRAG_LOADING){var T=this.fragCurrent;if(A.len===0&&T){var w=g.maxFragLookUpTolerance,P=T.start-w,O=T.start+T.duration+w;S<P||S>O?(T.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=t.State.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else R===t.State.ENDED&&(A.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=t.State.IDLE);x&&(this.lastCurrentTime=S),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=S),this.tick()},p.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.prototype.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},p.prototype.onHandlerDestroyed=function(){this.state=t.State.STOPPED,this.fragmentTracker=null},p}(u.default);t.default=y}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/buffer-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var C in x)x.hasOwnProperty(C)&&(g[C]=x[C])};return function(g,x){_(g,x);function C(){this.constructor=g}g.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/utils/logger.js"),h=n("./src/errors.js"),y=n("./src/utils/mediasource-helper.js"),E=y.getMediaSource(),p=function(_){l(g,_);function g(x){var C=_.call(this,x,u.default.MEDIA_ATTACHING,u.default.MEDIA_DETACHING,u.default.MANIFEST_PARSED,u.default.BUFFER_RESET,u.default.BUFFER_APPENDING,u.default.BUFFER_CODECS,u.default.BUFFER_EOS,u.default.BUFFER_FLUSHING,u.default.LEVEL_PTS_UPDATED,u.default.LEVEL_UPDATED)||this;return C._msDuration=null,C._levelDuration=null,C._levelTargetDuration=10,C._live=null,C._objectUrl=null,C.bufferCodecEventsExpected=0,C.onsbue=C.onSBUpdateEnd.bind(C),C.onsbe=C.onSBUpdateError.bind(C),C.pendingTracks={},C.tracks={},C}return g.prototype.destroy=function(){f.default.prototype.destroy.call(this)},g.prototype.onLevelPtsUpdated=function(x){var C=x.type,R=this.tracks.audio;if(C==="audio"&&R&&R.container==="audio/mpeg"){var S=this.sourceBuffer.audio,A=Math.abs(S.timestampOffset-x.start);if(A>.1){var T=S.updating;try{S.abort()}catch(w){d.logger.warn("can not abort audio buffer: "+w)}T?this.audioTimestampOffset=x.start:(d.logger.warn("change mpeg audio timestamp offset from "+S.timestampOffset+" to "+x.start),S.timestampOffset=x.start)}}},g.prototype.onManifestParsed=function(x){this.bufferCodecEventsExpected=x.altAudio?2:1,d.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.prototype.onMediaAttaching=function(x){var C=this.media=x.media;if(C){var R=this.mediaSource=new E;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),R.addEventListener("sourceopen",this.onmso),R.addEventListener("sourceended",this.onmse),R.addEventListener("sourceclose",this.onmsc),C.src=window.URL.createObjectURL(R),this._objectUrl=C.src}},g.prototype.onMediaDetaching=function(){d.logger.log("media source detaching");var x=this.mediaSource;if(x){if(x.readyState==="open")try{x.endOfStream()}catch(C){d.logger.warn("onMediaDetaching:"+C.message+" while calling endOfStream")}x.removeEventListener("sourceopen",this.onmso),x.removeEventListener("sourceended",this.onmse),x.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):d.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)},g.prototype.onMediaSourceOpen=function(){d.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var x=this.mediaSource;x&&x.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},g.prototype.checkPendingTracks=function(){var x=this,C=x.bufferCodecEventsExpected,R=x.pendingTracks,S=Object.keys(R).length;(S&&!C||S===2)&&(this.createSourceBuffers(R),this.pendingTracks={},this.doAppending())},g.prototype.onMediaSourceClose=function(){d.logger.log("media source closed")},g.prototype.onMediaSourceEnded=function(){d.logger.log("media source ended")},g.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var x=this.sourceBuffer.audio;d.logger.warn("change mpeg audio timestamp offset from "+x.timestampOffset+" to "+this.audioTimestampOffset),x.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var C=this.parent,R=this.segments.reduce(function(w,P){return P.parent===C?w+1:w},0),S={},A=this.sourceBuffer;for(var T in A)S[T]=A[T].buffered;this.hls.trigger(u.default.BUFFER_APPENDED,{parent:C,pending:R,timeRanges:S}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),R===0&&this.flushLiveBackBuffer()},g.prototype.onSBUpdateError=function(x){d.logger.error("sourceBuffer error:",x),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},g.prototype.onBufferReset=function(){var x=this.sourceBuffer;for(var C in x){var R=x[C];try{this.mediaSource.removeSourceBuffer(R),R.removeEventListener("updateend",this.onsbue),R.removeEventListener("error",this.onsbe)}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},g.prototype.onBufferCodecs=function(x){var C=this;if(!Object.keys(this.sourceBuffer).length){Object.keys(x).forEach(function(S){C.pendingTracks[S]=x[S]});var R=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),R&&R.readyState==="open"&&this.checkPendingTracks()}},g.prototype.createSourceBuffers=function(x){var C=this.sourceBuffer,R=this.mediaSource;for(var S in x)if(!C[S]){var A=x[S],T=A.levelCodec||A.codec,w=A.container+";codecs="+T;d.logger.log("creating sourceBuffer("+w+")");try{var P=C[S]=R.addSourceBuffer(w);P.addEventListener("updateend",this.onsbue),P.addEventListener("error",this.onsbe),this.tracks[S]={codec:T,container:A.container},A.buffer=P}catch(O){d.logger.error("error while trying to add sourceBuffer:"+O.message),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:O,mimeType:w})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:x})},g.prototype.onBufferAppending=function(x){this._needsFlush||(this.segments?this.segments.push(x):this.segments=[x],this.doAppending())},g.prototype.onBufferAppendFail=function(x){d.logger.error("sourceBuffer error:",x.event),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},g.prototype.onBufferEos=function(x){var C=this.sourceBuffer,R=x.type;for(var S in C)(!R||S===R)&&(C[S].ended||(C[S].ended=!0,d.logger.log(S+" sourceBuffer now EOS")));this.checkEos()},g.prototype.checkEos=function(){var x=this.sourceBuffer,C=this.mediaSource;if(!C||C.readyState!=="open"){this._needsEos=!1;return}for(var R in x){var S=x[R];if(!S.ended)return;if(S.updating){this._needsEos=!0;return}}d.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{C.endOfStream()}catch{d.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},g.prototype.onBufferFlushing=function(x){this.flushRange.push({start:x.startOffset,end:x.endOffset,type:x.type}),this.flushBufferCounter=0,this.doFlush()},g.prototype.flushLiveBackBuffer=function(){if(this._live){var x=this.hls.config.liveBackBufferLength;if(!(!isFinite(x)||x<0))for(var C=this.media.currentTime,R=this.sourceBuffer,S=Object.keys(R),A=C-Math.max(x,this._levelTargetDuration),T=S.length-1;T>=0;T--){var w=S[T],P=R[w].buffered;P.length>0&&A>P.start(0)&&this.removeBufferRange(w,R[w],0,A)}}},g.prototype.onLevelUpdated=function(x){var C=x.details;C.fragments.length>0&&(this._levelDuration=C.totalduration+C.fragments[0].start,this._levelTargetDuration=C.averagetargetduration||C.targetduration||10,this._live=C.live,this.updateMediaElementDuration())},g.prototype.updateMediaElementDuration=function(){var x=this.hls.config,C;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var R in this.sourceBuffer)if(this.sourceBuffer[R].updating===!0)return;C=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&x.liveDurationInfinity===!0?(d.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>C||!a.isFinite(C))&&(d.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},g.prototype.doFlush=function(){for(;this.flushRange.length;){var x=this.flushRange[0];if(this.flushBuffer(x.start,x.end,x.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var C=0,R=this.sourceBuffer;try{for(var S in R)C+=R[S].buffered.length}catch{d.logger.error("error while accessing sourceBuffer.buffered")}this.appended=C,this.hls.trigger(u.default.BUFFER_FLUSHED)}},g.prototype.doAppending=function(){var x=this,C=x.hls,R=x.segments,S=x.sourceBuffer;if(Object.keys(S).length){if(this.media.error){this.segments=[],d.logger.error("trying to append although a media error occured, flush segment and abort");return}if(this.appending)return;if(R&&R.length){var A=R.shift();try{var T=A.type,w=S[T];w?w.updating?R.unshift(A):(w.ended=!1,this.parent=A.parent,w.appendBuffer(A.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(O){d.logger.error("error while trying to append buffer:"+O.message),R.unshift(A);var P={type:h.ErrorTypes.MEDIA_ERROR,parent:A.parent};O.code!==22?(this.appendError?this.appendError++:this.appendError=1,P.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>C.config.appendErrorMaxRetry?(d.logger.log("fail "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],P.fatal=!0,C.trigger(u.default.ERROR,P)):(P.fatal=!1,C.trigger(u.default.ERROR,P))):(this.segments=[],P.details=h.ErrorDetails.BUFFER_FULL_ERROR,P.fatal=!1,C.trigger(u.default.ERROR,P))}}}},g.prototype.flushBuffer=function(x,C,R){var S,A=this.sourceBuffer;if(Object.keys(A).length){if(d.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+x+"/"+C),this.flushBufferCounter<this.appended){for(var T in A)if(!(R&&T!==R)){if(S=A[T],S.ended=!1,S.updating)return d.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(T,S,x,C))return this.flushBufferCounter++,!1}}else d.logger.warn("abort flushing too many retries");d.logger.log("buffer flushed")}return!0},g.prototype.removeBufferRange=function(x,C,R,S){try{for(var A=0;A<C.buffered.length;A++){var T=C.buffered.start(A),w=C.buffered.end(A),P=Math.max(T,R),O=Math.min(w,S);if(Math.min(O,w)-P>.5)return d.logger.log("sb remove "+x+" ["+P+","+O+"], of ["+T+","+w+"], pos:"+this.media.currentTime),C.remove(P,O),!0}}catch(k){d.logger.warn("removeBufferRange failed",k)}return!1},g}(f.default);t.default=p}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/cap-level-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,E){y.__proto__=E}||function(y,E){for(var p in E)E.hasOwnProperty(p)&&(y[p]=E[p])};return function(y,E){h(y,E);function p(){this.constructor=y}y.prototype=E===null?Object.create(E):(p.prototype=E.prototype,new p)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=function(h){l(y,h);function y(E){var p=h.call(this,E,u.default.FPS_DROP_LEVEL_CAPPING,u.default.MEDIA_ATTACHING,u.default.MANIFEST_PARSED,u.default.BUFFER_CODECS,u.default.MEDIA_DETACHING)||this;return p.autoLevelCapping=a.POSITIVE_INFINITY,p.firstLevel=null,p.levels=[],p.media=null,p.restrictedLevels=[],p.timer=null,p}return y.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},y.prototype.onFpsDropLevelCapping=function(E){y.isLevelAllowed(E.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(E.droppedLevel)},y.prototype.onMediaAttaching=function(E){this.media=E.media instanceof window.HTMLVideoElement?E.media:null},y.prototype.onManifestParsed=function(E){var p=this.hls;this.restrictedLevels=[],this.levels=E.levels,this.firstLevel=E.firstLevel,p.config.capLevelToPlayerSize&&E.video&&this._startCapping()},y.prototype.onBufferCodecs=function(E){var p=this.hls;p.config.capLevelToPlayerSize&&E.video&&this._startCapping()},y.prototype.onLevelsUpdated=function(E){this.levels=E.levels},y.prototype.onMediaDetaching=function(){this._stopCapping()},y.prototype.detectPlayerSize=function(){if(this.media){var E=this.levels?this.levels.length:0;if(E){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(E-1),p.autoLevelCapping>this.autoLevelCapping&&p.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},y.prototype.getMaxLevel=function(E){var p=this;if(!this.levels)return-1;var _=this.levels.filter(function(g,x){return y.isLevelAllowed(x,p.restrictedLevels)&&x<=E});return y.getMaxLevelByMediaSize(_,this.mediaWidth,this.mediaHeight)},y.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=a.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},y.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=a.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(y.prototype,"mediaWidth",{get:function(){var E,p=this.media;return p&&(E=p.width||p.clientWidth||p.offsetWidth,E*=y.contentScaleFactor),E},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"mediaHeight",{get:function(){var E,p=this.media;return p&&(E=p.height||p.clientHeight||p.offsetHeight,E*=y.contentScaleFactor),E},enumerable:!0,configurable:!0}),Object.defineProperty(y,"contentScaleFactor",{get:function(){var E=1;try{E=window.devicePixelRatio}catch{}return E},enumerable:!0,configurable:!0}),y.isLevelAllowed=function(E,p){return p===void 0&&(p=[]),p.indexOf(E)===-1},y.getMaxLevelByMediaSize=function(E,p,_){if(!E||E&&!E.length)return-1;for(var g=function(S,A){return A?S.width!==A.width||S.height!==A.height:!0},x=E.length-1,C=0;C<E.length;C+=1){var R=E[C];if((R.width>=p||R.height>=_)&&g(R,E[C+1])){x=C;break}}return x},y}(f.default);t.default=d}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/eme-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,R){C.__proto__=R}||function(C,R){for(var S in R)R.hasOwnProperty(S)&&(C[S]=R[S])};return function(C,R){x(C,R);function S(){this.constructor=C}C.prototype=R===null?Object.create(R):(S.prototype=R.prototype,new S)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/event-handler.js"),u=n("./src/events.js"),f=n("./src/errors.js"),d=n("./src/utils/logger.js"),h=window.XMLHttpRequest,y=3,E={WIDEVINE:"com.widevine.alpha",PLAYREADY:"com.microsoft.playready"},p=function(x,C,R){var S={videoCapabilities:[]};return C.forEach(function(A){S.videoCapabilities.push({contentType:'video/mp4; codecs="'+A+'"'})}),[S]},_=function(x,C,R){switch(x){case E.WIDEVINE:return p(C,R);default:throw Error("Unknown key-system: "+x)}},g=function(x){a(C,x);function C(R){var S=x.call(this,R,u.default.MEDIA_ATTACHED,u.default.MANIFEST_PARSED)||this;return S._widevineLicenseUrl=R.config.widevineLicenseUrl,S._licenseXhrSetup=R.config.licenseXhrSetup,S._emeEnabled=R.config.emeEnabled,S._requestMediaKeySystemAccess=R.config.requestMediaKeySystemAccessFunc,S._mediaKeysList=[],S._media=null,S._hasSetMediaKeys=!1,S._isMediaEncrypted=!1,S._requestLicenseFailureCount=0,S}return C.prototype.getLicenseServerUrl=function(R){var S;switch(R){case E.WIDEVINE:S=this._widevineLicenseUrl;break;default:S=null;break}return S||(d.logger.error('No license server URL configured for key-system "'+R+'"'),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})),S},C.prototype._attemptKeySystemAccess=function(R,S,A){var T=this,w=_(R,S,A);if(!w){d.logger.warn("Can not create config for key-system (maybe because platform is not supported):",R);return}d.logger.log("Requesting encrypted media key-system access"),this.requestMediaKeySystemAccess(R,w).then(function(P){T._onMediaKeySystemAccessObtained(R,P)}).catch(function(P){d.logger.error('Failed to obtain key-system "'+R+'" access:',P)})},Object.defineProperty(C.prototype,"requestMediaKeySystemAccess",{get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess},enumerable:!0,configurable:!0}),C.prototype._onMediaKeySystemAccessObtained=function(R,S){var A=this;d.logger.log('Access for key-system "'+R+'" obtained');var T={mediaKeys:null,mediaKeysSession:null,mediaKeysSessionInitialized:!1,mediaKeySystemAccess:S,mediaKeySystemDomain:R};this._mediaKeysList.push(T),S.createMediaKeys().then(function(w){T.mediaKeys=w,d.logger.log('Media-keys created for key-system "'+R+'"'),A._onMediaKeysCreated()}).catch(function(w){d.logger.error("Failed to create media-keys:",w)})},C.prototype._onMediaKeysCreated=function(){var R=this;this._mediaKeysList.forEach(function(S){S.mediaKeysSession||(S.mediaKeysSession=S.mediaKeys.createSession(),R._onNewMediaKeySession(S.mediaKeysSession))})},C.prototype._onNewMediaKeySession=function(R){var S=this;d.logger.log("New key-system session "+R.sessionId),R.addEventListener("message",function(A){S._onKeySessionMessage(R,A.message)},!1)},C.prototype._onKeySessionMessage=function(R,S){d.logger.log("Got EME message event, creating license request"),this._requestLicense(S,function(A){d.logger.log("Received license data, updating key-session"),R.update(A)})},C.prototype._onMediaEncrypted=function(R,S){d.logger.log('Media is encrypted using "'+R+'" init data type'),this._isMediaEncrypted=!0,this._mediaEncryptionInitDataType=R,this._mediaEncryptionInitData=S,this._attemptSetMediaKeys(),this._generateRequestWithPreferredKeySession()},C.prototype._attemptSetMediaKeys=function(){if(!this._hasSetMediaKeys){var R=this._mediaKeysList[0];if(!R||!R.mediaKeys){d.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}d.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(R.mediaKeys),this._hasSetMediaKeys=!0}},C.prototype._generateRequestWithPreferredKeySession=function(){var R=this,S=this._mediaKeysList[0];if(!S){d.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(S.mediaKeysSessionInitialized){d.logger.warn("Key-Session already initialized but requested again");return}var A=S.mediaKeysSession;A||(d.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0}));var T=this._mediaEncryptionInitDataType,w=this._mediaEncryptionInitData;d.logger.log('Generating key-session request for "'+T+'" init data type'),S.mediaKeysSessionInitialized=!0,A.generateRequest(T,w).then(function(){d.logger.debug("Key-session generation succeeded")}).catch(function(P){d.logger.error("Error generating key-session request:",P),R.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},C.prototype._createLicenseXhr=function(R,S,A){var T=new h,w=this._licenseXhrSetup;try{if(w)try{w(T,R)}catch{T.open("POST",R,!0),w(T,R)}T.readyState||T.open("POST",R,!0)}catch(P){d.logger.error("Error setting up key-system license XHR",P),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}return T.responseType="arraybuffer",T.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,T,R,S,A),T},C.prototype._onLicenseRequestReadyStageChange=function(R,S,A,T){switch(R.readyState){case 4:if(R.status===200)this._requestLicenseFailureCount=0,d.logger.log("License request succeeded"),T(R.response);else{if(d.logger.error("License Request XHR failed ("+S+"). Status: "+R.status+" ("+R.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount<=y){var w=y-this._requestLicenseFailureCount+1;d.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(A,T);return}this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}break}},C.prototype._generateLicenseRequestChallenge=function(R,S){var A;return R.mediaKeySystemDomain===E.PLAYREADY?d.logger.error("PlayReady is not supported (yet)"):R.mediaKeySystemDomain===E.WIDEVINE?A=S:d.logger.error("Unsupported key-system:",R.mediaKeySystemDomain),A},C.prototype._requestLicense=function(R,S){d.logger.log("Requesting content license for key-system");var A=this._mediaKeysList[0];if(!A){d.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(u.default.ERROR,{type:f.ErrorTypes.KEY_SYSTEM_ERROR,details:f.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}var T=this.getLicenseServerUrl(A.mediaKeySystemDomain),w=this._createLicenseXhr(T,R,S);d.logger.log("Sending license request to URL: "+T),w.send(this._generateLicenseRequestChallenge(A,R))},C.prototype.onMediaAttached=function(R){var S=this;if(this._emeEnabled){var A=R.media;this._media=A,A.addEventListener("encrypted",function(T){S._onMediaEncrypted(T.initDataType,T.initData)})}},C.prototype.onManifestParsed=function(R){if(this._emeEnabled){var S=R.levels.map(function(T){return T.audioCodec}),A=R.levels.map(function(T){return T.videoCodec});this._attemptKeySystemAccess(E.WIDEVINE,S,A)}},C}(l.default);t.default=g},"./src/controller/fps-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,p){E.__proto__=p}||function(E,p){for(var _ in p)p.hasOwnProperty(_)&&(E[_]=p[_])};return function(E,p){y(E,p);function _(){this.constructor=E}E.prototype=p===null?Object.create(p):(_.prototype=p.prototype,new _)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/event-handler.js"),f=n("./src/utils/logger.js"),d=window.performance,h=function(y){a(E,y);function E(p){return y.call(this,p,l.default.MEDIA_ATTACHING)||this}return E.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},E.prototype.onMediaAttaching=function(p){var _=this.hls.config;if(_.capLevelOnFPSDrop){var g=this.video=p.media instanceof window.HTMLVideoElement?p.media:null;typeof g.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),_.fpsDroppedMonitoringPeriod)}},E.prototype.checkFPS=function(p,_,g){var x=d.now();if(_){if(this.lastTime){var C=x-this.lastTime,R=g-this.lastDroppedFrames,S=_-this.lastDecodedFrames,A=1e3*R/C,T=this.hls;if(T.trigger(l.default.FPS_DROP,{currentDropped:R,currentDecoded:S,totalDroppedFrames:g}),A>0&&R>T.config.fpsDroppedMonitoringThreshold*S){var w=T.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+w),w>0&&(T.autoLevelCapping===-1||T.autoLevelCapping>=w)&&(w=w-1,T.trigger(l.default.FPS_DROP_LEVEL_CAPPING,{level:w,droppedLevel:T.currentLevel}),T.autoLevelCapping=w,T.streamController.nextLevelSwitch())}}this.lastTime=x,this.lastDroppedFrames=g,this.lastDecodedFrames=_}},E.prototype.checkFPSInterval=function(){var p=this.video;if(p)if(this.isVideoPlaybackQualityAvailable){var _=p.getVideoPlaybackQuality();this.checkFPS(p,_.totalVideoFrames,_.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},E}(u.default);t.default=h},"./src/controller/fragment-finders.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/utils/binary-search.js");function u(y,E,p){if(!Array.isArray(y)||!y.length||!a.isFinite(E)||E<y[0].programDateTime||E>=y[y.length-1].endProgramDateTime)return null;p=p||0;for(var _=0;_<y.length;++_){var g=y[_];if(h(E,p,g))return g}return null}t.findFragmentByPDT=u;function f(y,E,p,_){p===void 0&&(p=0),_===void 0&&(_=0);var g=y?E[y.sn-E[0].sn+1]:null;return g&&!d(p,_,g)?g:l.default.search(E,d.bind(null,p,_))}t.findFragmentByPTS=f;function d(y,E,p){y===void 0&&(y=0),E===void 0&&(E=0);var _=Math.min(E,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-_<=y?1:p.start-_>y&&p.start?-1:0}t.fragmentWithinToleranceTest=d;function h(y,E,p){var _=Math.min(E,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3;return p.endProgramDateTime-_>y}t.pdtWithinToleranceTest=h}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/fragment-tracker.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,E){y.__proto__=E}||function(y,E){for(var p in E)E.hasOwnProperty(p)&&(y[p]=E[p])};return function(y,E){h(y,E);function p(){this.constructor=y}y.prototype=E===null?Object.create(E):(p.prototype=E.prototype,new p)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/event-handler.js"),f=n("./src/events.js");t.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};var d=function(h){l(y,h);function y(E){var p=h.call(this,E,f.default.BUFFER_APPENDED,f.default.FRAG_BUFFERED,f.default.FRAG_LOADED)||this;return p.bufferPadding=.2,p.fragments=Object.create(null),p.timeRanges=Object.create(null),p.config=E.config,p}return y.prototype.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,u.default.prototype.destroy.call(this),h.prototype.destroy.call(this)},y.prototype.getBufferedFrag=function(E,p){var _=this.fragments,g=Object.keys(_).filter(function(C){var R=_[C];if(R.body.type!==p||!R.buffered)return!1;var S=R.body;return S.startPTS<=E&&E<=S.endPTS});if(g.length===0)return null;var x=g.pop();return _[x].body},y.prototype.detectEvictedFragments=function(E,p){var _=this,g,x;Object.keys(this.fragments).forEach(function(C){var R=_.fragments[C];if(R.buffered===!0){var S=R.range[E];if(S){g=S.time;for(var A=0;A<g.length;A++)if(x=g[A],_.isTimeBuffered(x.startPTS,x.endPTS,p)===!1){_.removeFragment(R.body);break}}}})},y.prototype.detectPartialFragments=function(E){var p=this,_=this.getFragmentKey(E),g=this.fragments[_];g&&(g.buffered=!0,Object.keys(this.timeRanges).forEach(function(x){if(E.hasElementaryStream(x)){var C=p.timeRanges[x];g.range[x]=p.getBufferedTimes(E.startPTS,E.endPTS,C)}}))},y.prototype.getBufferedTimes=function(E,p,_){for(var g=[],x,C,R=!1,S=0;S<_.length;S++)if(x=_.start(S)-this.bufferPadding,C=_.end(S)+this.bufferPadding,E>=x&&p<=C){g.push({startPTS:Math.max(E,_.start(S)),endPTS:Math.min(p,_.end(S))});break}else if(E<C&&p>x)g.push({startPTS:Math.max(E,_.start(S)),endPTS:Math.min(p,_.end(S))}),R=!0;else if(p<=x)break;return{time:g,partial:R}},y.prototype.getFragmentKey=function(E){return E.type+"_"+E.level+"_"+E.urlId+"_"+E.sn},y.prototype.getPartialFragment=function(E){var p=this,_,g,x,C=null,R=0;return Object.keys(this.fragments).forEach(function(S){var A=p.fragments[S];p.isPartial(A)&&(g=A.body.startPTS-p.bufferPadding,x=A.body.endPTS+p.bufferPadding,E>=g&&E<=x&&(_=Math.min(E-g,x-E),R<=_&&(C=A.body,R=_)))}),C},y.prototype.getState=function(E){var p=this.getFragmentKey(E),_=this.fragments[p],g=t.FragmentState.NOT_LOADED;return _!==void 0&&(_.buffered?this.isPartial(_)===!0?g=t.FragmentState.PARTIAL:g=t.FragmentState.OK:g=t.FragmentState.APPENDING),g},y.prototype.isPartial=function(E){return E.buffered===!0&&(E.range.video!==void 0&&E.range.video.partial===!0||E.range.audio!==void 0&&E.range.audio.partial===!0)},y.prototype.isTimeBuffered=function(E,p,_){for(var g,x,C=0;C<_.length;C++){if(g=_.start(C)-this.bufferPadding,x=_.end(C)+this.bufferPadding,E>=g&&p<=x)return!0;if(p<=g)return!1}return!1},y.prototype.onFragLoaded=function(E){var p=E.frag;!a.isFinite(p.sn)||p.bitrateTest||(this.fragments[this.getFragmentKey(p)]={body:p,range:Object.create(null),buffered:!1})},y.prototype.onBufferAppended=function(E){var p=this;this.timeRanges=E.timeRanges,Object.keys(this.timeRanges).forEach(function(_){var g=p.timeRanges[_];p.detectEvictedFragments(_,g)})},y.prototype.onFragBuffered=function(E){this.detectPartialFragments(E.frag)},y.prototype.hasFragment=function(E){var p=this.getFragmentKey(E);return this.fragments[p]!==void 0},y.prototype.removeFragment=function(E){var p=this.getFragmentKey(E);delete this.fragments[p]},y.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},y}(u.default);t.FragmentTracker=d}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/gap-controller.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/buffer-helper.js"),l=n("./src/errors.js"),u=n("./src/events.js"),f=n("./src/utils/logger.js"),d=1e3,h=.5,y=function(){function E(p,_,g,x){this.config=p,this.media=_,this.fragmentTracker=g,this.hls=x,this.stallReported=!1}return E.prototype.poll=function(p,_){var g=this,x=g.config,C=g.media,R=C.currentTime,S=window.performance.now();if(R!==p){this.stallReported&&(f.logger.warn("playback not stuck anymore @"+R+", after "+Math.round(S-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,this.nudgeRetry=0;return}if(!(C.ended||!C.buffered.length||C.readyState>2)&&!(C.seeking&&a.BufferHelper.isBuffered(C,R))){var A=S-this.stalled,T=a.BufferHelper.bufferInfo(C,R,x.maxBufferHole);if(this.stalled)A>=d&&this._reportStall(T.len);else{this.stalled=S;return}this._tryFixBufferStall(T,A)}},E.prototype._tryFixBufferStall=function(p,_){var g=this,x=g.config,C=g.fragmentTracker,R=g.media,S=R.currentTime,A=C.getPartialFragment(S);A&&this._trySkipBufferHole(A),p.len>h&&_>x.highBufferWatchdogPeriod*1e3&&(this.stalled=null,this._tryNudgeBuffer())},E.prototype._reportStall=function(p){var _=this,g=_.hls,x=_.media,C=_.stallReported;C||(this.stallReported=!0,f.logger.warn("Playback stalling at @"+x.currentTime+" due to low buffer"),g.trigger(u.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},E.prototype._trySkipBufferHole=function(p){for(var _=this,g=_.hls,x=_.media,C=x.currentTime,R=0,S=0;S<x.buffered.length;S++){var A=x.buffered.start(S);if(C>=R&&C<A){x.currentTime=Math.max(A,x.currentTime+.1),f.logger.warn("skipping hole, adjusting currentTime from "+C+" to "+x.currentTime),this.stalled=null,g.trigger(u.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+C+" to "+x.currentTime,frag:p});return}R=x.buffered.end(S)}},E.prototype._tryNudgeBuffer=function(){var p=this,_=p.config,g=p.hls,x=p.media,C=x.currentTime,R=(this.nudgeRetry||0)+1;if(this.nudgeRetry=R,R<_.nudgeMaxRetry){var S=C+R*_.nudgeOffset;f.logger.log("adjust currentTime from "+C+" to "+S),x.currentTime=S,g.trigger(u.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else f.logger.error("still stuck in high buffer @"+C+" after "+_.nudgeMaxRetry+", raise fatal error"),g.trigger(u.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},E}();t.default=y},"./src/controller/id3-track-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,p){E.__proto__=p}||function(E,p){for(var _ in p)p.hasOwnProperty(_)&&(E[_]=p[_])};return function(E,p){y(E,p);function _(){this.constructor=E}E.prototype=p===null?Object.create(p):(_.prototype=p.prototype,new _)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/event-handler.js"),f=n("./src/demux/id3.js"),d=n("./src/utils/texttrack-utils.js"),h=function(y){a(E,y);function E(p){var _=y.call(this,p,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.FRAG_PARSING_METADATA)||this;return _.id3Track=void 0,_.media=void 0,_}return E.prototype.destroy=function(){u.default.prototype.destroy.call(this)},E.prototype.onMediaAttached=function(p){this.media=p.media,this.media},E.prototype.onMediaDetaching=function(){d.clearCurrentCues(this.id3Track),this.id3Track=void 0,this.media=void 0},E.prototype.getID3Track=function(p){for(var _=0;_<p.length;_++){var g=p[_];if(g.kind==="metadata"&&g.label==="id3")return d.sendAddTrackEvent(g,this.media),g}return this.media.addTextTrack("metadata","id3")},E.prototype.onFragParsingMetadata=function(p){var _=p.frag,g=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var x=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,C=0;C<g.length;C++){var R=f.default.getID3Frames(g[C].data);if(R){var S=g[C].pts,A=C<g.length-1?g[C+1].pts:_.endPTS;S===A&&(A+=1e-4);for(var T=0;T<R.length;T++){var w=R[T];if(!f.default.isTimeStampFrame(w)){var P=new x(S,A,"");P.value=w,this.id3Track.addCue(P)}}}}},E}(u.default);t.default=h},"./src/controller/level-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var C in x)x.hasOwnProperty(C)&&(g[C]=x[C])};return function(g,x){_(g,x);function C(){this.constructor=g}g.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/event-handler.js"),f=n("./src/utils/logger.js"),d=n("./src/errors.js"),h=n("./src/utils/codecs.js"),y=n("./src/controller/level-helper.js"),E,p=function(_){a(g,_);function g(x){var C=_.call(this,x,l.default.MANIFEST_LOADED,l.default.LEVEL_LOADED,l.default.AUDIO_TRACK_SWITCHED,l.default.FRAG_LOADED,l.default.ERROR)||this;return C.canload=!1,C.currentLevelIndex=null,C.manualLevelIndex=-1,C.timer=null,E=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),C}return g.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},g.prototype.clearTimer=function(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)},g.prototype.startLoad=function(){var x=this._levels;this.canload=!0,this.levelRetryCount=0,x&&x.forEach(function(C){C.loadError=0;var R=C.details;R&&R.live&&(C.details=void 0)}),this.timer!==null&&this.loadLevel()},g.prototype.stopLoad=function(){this.canload=!1},g.prototype.onManifestLoaded=function(x){var C=[],R=[],S,A={},T=null,w=!1,P=!1;if(x.levels.forEach(function(k){var D=k.attrs;k.loadError=0,k.fragmentError=!1,w=w||!!k.videoCodec,P=P||!!k.audioCodec,E&&k.audioCodec&&k.audioCodec.indexOf("mp4a.40.34")!==-1&&(k.audioCodec=void 0),T=A[k.bitrate],T?T.url.push(k.url):(k.url=[k.url],k.urlId=0,A[k.bitrate]=k,C.push(k)),D&&(D.AUDIO&&(P=!0,y.addGroupId(T||k,"audio",D.AUDIO)),D.SUBTITLES&&y.addGroupId(T||k,"text",D.SUBTITLES))}),w&&P&&(C=C.filter(function(k){var D=k.videoCodec;return!!D})),C=C.filter(function(k){var D=k.audioCodec,F=k.videoCodec;return(!D||h.isCodecSupportedInMp4(D,"audio"))&&(!F||h.isCodecSupportedInMp4(F,"video"))}),x.audioTracks&&(R=x.audioTracks.filter(function(k){return!k.audioCodec||h.isCodecSupportedInMp4(k.audioCodec,"audio")}),R.forEach(function(k,D){k.id=D})),C.length>0){S=C[0].bitrate,C.sort(function(k,D){return k.bitrate-D.bitrate}),this._levels=C;for(var O=0;O<C.length;O++)if(C[O].bitrate===S){this._firstLevel=O,f.logger.log("manifest loaded,"+C.length+" level(s) found, first bitrate:"+S);break}this.hls.trigger(l.default.MANIFEST_PARSED,{levels:C,audioTracks:R,firstLevel:this._firstLevel,stats:x.stats,audio:P,video:w,altAudio:R.some(function(k){return!!k.url})})}else this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},Object.defineProperty(g.prototype,"levels",{get:function(){return this._levels},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"level",{get:function(){return this.currentLevelIndex},set:function(x){var C=this._levels;C&&(x=Math.min(x,C.length-1),(this.currentLevelIndex!==x||!C[x].details)&&this.setLevelInternal(x))},enumerable:!0,configurable:!0}),g.prototype.setLevelInternal=function(x){var C=this._levels,R=this.hls;if(x>=0&&x<C.length){if(this.clearTimer(),this.currentLevelIndex!==x){f.logger.log("switching to level "+x),this.currentLevelIndex=x;var S=C[x];S.level=x,R.trigger(l.default.LEVEL_SWITCHING,S)}var A=C[x],T=A.details;if(!T||T.live){var w=A.urlId;R.trigger(l.default.LEVEL_LOADING,{url:A.url[w],level:x,id:w})}}else R.trigger(l.default.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:!1,reason:"invalid level idx"})},Object.defineProperty(g.prototype,"manualLevel",{get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"firstLevel",{get:function(){return this._firstLevel},set:function(x){this._firstLevel=x},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"startLevel",{get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x},enumerable:!0,configurable:!0}),g.prototype.onError=function(x){if(x.fatal){x.type===d.ErrorTypes.NETWORK_ERROR&&this.clearTimer();return}var C=!1,R=!1,S;switch(x.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:S=x.frag.level,R=!0;break;case d.ErrorDetails.LEVEL_LOAD_ERROR:case d.ErrorDetails.LEVEL_LOAD_TIMEOUT:S=x.context.level,C=!0;break;case d.ErrorDetails.REMUX_ALLOC_ERROR:S=x.level,C=!0;break}S!==void 0&&this.recoverLevel(x,S,C,R)},g.prototype.recoverLevel=function(x,C,R,S){var A=this,T=this.hls.config,w=x.details,P=this._levels[C],O,k,D;if(P.loadError++,P.fragmentError=S,R)if(this.levelRetryCount+1<=T.levelLoadingMaxRetry)k=Math.min(Math.pow(2,this.levelRetryCount)*T.levelLoadingRetryDelay,T.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return A.loadLevel()},k),x.levelRetry=!0,this.levelRetryCount++,f.logger.warn("level controller, "+w+", retry in "+k+" ms, current retry count is "+this.levelRetryCount);else{f.logger.error("level controller, cannot recover from "+w+" error"),this.currentLevelIndex=null,this.clearTimer(),x.fatal=!0;return}(R||S)&&(O=P.url.length,O>1&&P.loadError<O?(P.urlId=(P.urlId+1)%O,P.details=void 0,f.logger.warn("level controller, "+w+" for level "+C+": switching to redundant URL-id "+P.urlId)):this.manualLevelIndex===-1?(D=C===0?this._levels.length-1:C-1,f.logger.warn("level controller, "+w+": switch to "+D),this.hls.nextAutoLevel=this.currentLevelIndex=D):S&&(f.logger.warn("level controller, "+w+": reload a fragment"),this.currentLevelIndex=null))},g.prototype.onFragLoaded=function(x){var C=x.frag;if(C!==void 0&&C.type==="main"){var R=this._levels[C.level];R!==void 0&&(R.fragmentError=!1,R.loadError=0,this.levelRetryCount=0)}},g.prototype.onLevelLoaded=function(x){var C=this,R=x.level,S=x.details;if(R===this.currentLevelIndex){var A=this._levels[R];if(A.fragmentError||(A.loadError=0,this.levelRetryCount=0),S.live){var T=y.computeReloadInterval(A.details,S,x.stats.trequest);f.logger.log("live playlist, reload in "+Math.round(T)+" ms"),this.timer=setTimeout(function(){return C.loadLevel()},T)}else this.clearTimer()}},g.prototype.onAudioTrackSwitched=function(x){var C=this.hls.audioTracks[x.id].groupId,R=this.hls.levels[this.currentLevelIndex];if(R&&R.audioGroupIds){for(var S=-1,A=0;A<R.audioGroupIds.length;A++)if(R.audioGroupIds[A]===C){S=A;break}S!==R.urlId&&(R.urlId=S,this.startLoad())}},g.prototype.loadLevel=function(){if(f.logger.debug("call to loadLevel"),this.currentLevelIndex!==null&&this.canload){var x=this._levels[this.currentLevelIndex];if(typeof x=="object"&&x.url.length>0){var C=this.currentLevelIndex,R=x.urlId,S=x.url[R];f.logger.log("Attempt loading level index "+C+" with URL-id "+R),this.hls.trigger(l.default.LEVEL_LOADING,{url:S,level:C,id:R})}}},Object.defineProperty(g.prototype,"nextLoadLevel",{get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)},enumerable:!0,configurable:!0}),g}(u.default);t.default=p},"./src/controller/level-helper.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/utils/logger.js");function u(g,x,C){switch(x){case"audio":g.audioGroupIds||(g.audioGroupIds=[]),g.audioGroupIds.push(C);break;case"text":g.textGroupIds||(g.textGroupIds=[]),g.textGroupIds.push(C);break}}t.addGroupId=u;function f(g,x,C){var R=g[x],S=g[C],A=S.startPTS;a.isFinite(A)?C>x?(R.duration=A-R.start,R.duration<0&&l.logger.warn("negative duration computed for frag "+R.sn+",level "+R.level+", there should be some duration drift between playlist and fragment!")):(S.duration=R.start-A,S.duration<0&&l.logger.warn("negative duration computed for frag "+S.sn+",level "+S.level+", there should be some duration drift between playlist and fragment!")):C>x?S.start=R.start+R.duration:S.start=Math.max(R.start-S.duration,0)}t.updatePTS=f;function d(g,x,C,R,S,A){var T=C;if(a.isFinite(x.startPTS)){var w=Math.abs(x.startPTS-C);a.isFinite(x.deltaPTS)?x.deltaPTS=Math.max(w,x.deltaPTS):x.deltaPTS=w,T=Math.max(C,x.startPTS),C=Math.min(C,x.startPTS),R=Math.max(R,x.endPTS),S=Math.min(S,x.startDTS),A=Math.max(A,x.endDTS)}var P=C-x.start;x.start=x.startPTS=C,x.maxStartPTS=T,x.endPTS=R,x.startDTS=S,x.endDTS=A,x.duration=R-C;var O=x.sn;if(!g||O<g.startSN||O>g.endSN)return 0;var k,D,F;for(k=O-g.startSN,D=g.fragments,D[k]=x,F=k;F>0;F--)f(D,F,F-1);for(F=k;F<D.length-1;F++)f(D,F,F+1);return g.PTSKnown=!0,P}t.updateFragPTSDTS=d;function h(g,x){x.initSegment&&g.initSegment&&(x.initSegment=g.initSegment);var C=0,R;if(E(g,x,function(T,w){C=T.cc-w.cc,a.isFinite(T.startPTS)&&(w.start=w.startPTS=T.startPTS,w.endPTS=T.endPTS,w.duration=T.duration,w.backtracked=T.backtracked,w.dropped=T.dropped,R=w),x.PTSKnown=!0}),!!x.PTSKnown){if(C){l.logger.log("discontinuity sliding from playlist, take drift into account");for(var S=x.fragments,A=0;A<S.length;A++)S[A].cc+=C}R?d(x,R,R.startPTS,R.endPTS,R.startDTS,R.endDTS):p(g,x),x.PTSKnown=g.PTSKnown}}t.mergeDetails=h;function y(g,x,C){C===void 0&&(C=0);var R=-1;E(g,x,function(T,w,P){w.start=T.start,R=P});var S=x.fragments;if(R<0){S.forEach(function(T){T.start+=C});return}for(var A=R+1;A<S.length;A++)S[A].start=S[A-1].start+S[A-1].duration}t.mergeSubtitlePlaylists=y;function E(g,x,C){if(!(!g||!x))for(var R=Math.max(g.startSN,x.startSN)-x.startSN,S=Math.min(g.endSN,x.endSN)-x.startSN,A=x.startSN-g.startSN,T=R;T<=S;T++){var w=g.fragments[A+T],P=x.fragments[T];if(!w||!P)break;C(w,P,T)}}t.mapFragmentIntersection=E;function p(g,x){var C=x.startSN-g.startSN,R=g.fragments,S=x.fragments;if(!(C<0||C>R.length))for(var A=0;A<S.length;A++)S[A].start+=R[C].start}t.adjustSliding=p;function _(g,x,C){var R=1e3*(x.averagetargetduration?x.averagetargetduration:x.targetduration),S=R/2;return g&&x.endSN===g.endSN&&(R=S),C&&(R=Math.max(S,R-(window.performance.now()-C))),Math.round(R)}t.computeReloadInterval=_}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/stream-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,D){k.__proto__=D}||function(k,D){for(var F in D)D.hasOwnProperty(F)&&(k[F]=D[F])};return function(k,D){O(k,D);function F(){this.constructor=k}k.prototype=D===null?Object.create(D):(F.prototype=D.prototype,new F)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/utils/binary-search.js"),f=n("./src/utils/buffer-helper.js"),d=n("./src/demux/demuxer.js"),h=n("./src/events.js"),y=n("./src/controller/fragment-tracker.js"),E=n("./src/loader/fragment.js"),p=n("./src/loader/playlist-loader.js"),_=n("./src/controller/level-helper.js"),g=n("./src/utils/time-ranges.js"),x=n("./src/errors.js"),C=n("./src/utils/logger.js"),R=n("./src/utils/discontinuities.js"),S=n("./src/controller/fragment-finders.js"),A=n("./src/controller/gap-controller.js"),T=n("./src/controller/base-stream-controller.js"),w=100,P=function(O){l(k,O);function k(D,F){var G=O.call(this,D,h.default.MEDIA_ATTACHED,h.default.MEDIA_DETACHING,h.default.MANIFEST_LOADING,h.default.MANIFEST_PARSED,h.default.LEVEL_LOADED,h.default.KEY_LOADED,h.default.FRAG_LOADED,h.default.FRAG_LOAD_EMERGENCY_ABORTED,h.default.FRAG_PARSING_INIT_SEGMENT,h.default.FRAG_PARSING_DATA,h.default.FRAG_PARSED,h.default.ERROR,h.default.AUDIO_TRACK_SWITCHING,h.default.AUDIO_TRACK_SWITCHED,h.default.BUFFER_CREATED,h.default.BUFFER_APPENDED,h.default.BUFFER_FLUSHED)||this;return G.fragmentTracker=F,G.config=D.config,G.audioCodecSwap=!1,G._state=T.State.STOPPED,G.stallReported=!1,G.gapController=null,G}return k.prototype.startLoad=function(D){if(this.levels){var F=this.lastCurrentTime,G=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var V=G.startLevel;V===-1&&(V=0,this.bitrateTest=!0),this.level=G.nextLoadLevel=V,this.loadedmetadata=!1}F>0&&D===-1&&(C.logger.log("override startPosition with lastCurrentTime @"+F.toFixed(3)),D=F),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=D,this.tick()}else this.forceStartLoad=!0,this.state=T.State.STOPPED},k.prototype.stopLoad=function(){this.forceStartLoad=!1,O.prototype.stopLoad.call(this)},k.prototype.doTick=function(){switch(this.state){case T.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case T.State.IDLE:this._doTickIdle();break;case T.State.WAITING_LEVEL:var D=this.levels[this.level];D&&D.details&&(this.state=T.State.IDLE);break;case T.State.FRAG_LOADING_WAITING_RETRY:var F=window.performance.now(),G=this.retryDate;(!G||F>=G||this.media&&this.media.seeking)&&(C.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break;case T.State.ERROR:case T.State.STOPPED:case T.State.FRAG_LOADING:case T.State.PARSING:case T.State.PARSED:case T.State.ENDED:break}this._checkBuffer(),this._checkFragmentChanged()},k.prototype._doTickIdle=function(){var D=this.hls,F=D.config,G=this.media;if(!(this.levelLastLoaded===void 0||!G&&(this.startFragRequested||!F.startFragPrefetch))){var V;this.loadedmetadata?V=G.currentTime:V=this.nextLoadPosition;var W=D.nextLoadLevel,ee=this.levels[W];if(ee){var q=ee.bitrate,z;q?z=Math.max(8*F.maxBufferSize/q,F.maxBufferLength):z=F.maxBufferLength,z=Math.min(z,F.maxMaxBufferLength);var U=f.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:G,V,F.maxBufferHole),$=U.len;if(!($>=z)){C.logger.trace("buffer length of "+$.toFixed(3)+" is below max of "+z.toFixed(3)+". checking for more payload ..."),this.level=D.nextLoadLevel=W;var I=ee.details;if(!I||I.live&&this.levelLastLoaded!==W){this.state=T.State.WAITING_LEVEL;return}if(this._streamEnded(U,I)){var B={};this.altAudio&&(B.type="video"),this.hls.trigger(h.default.BUFFER_EOS,B),this.state=T.State.ENDED;return}this._fetchPayloadOrEos(V,U,I)}}}},k.prototype._fetchPayloadOrEos=function(D,F,G){var V=this.fragPrevious,W=this.level,ee=G.fragments,q=ee.length;if(q!==0){var z=ee[0].start,U=ee[q-1].start+ee[q-1].duration,$=F.end,I;if(G.initSegment&&!G.initSegment.data)I=G.initSegment;else if(G.live){var B=this.config.initialLiveManifestSize;if(q<B){C.logger.warn("Can not start playback of a level, reason: not enough fragments "+q+" < "+B);return}if(I=this._ensureFragmentAtLivePoint(G,$,z,U,V,ee,q),I===null)return}else $<z&&(I=ee[0]);I||(I=this._findFragment(z,V,q,ee,$,U,G)),I&&(I.encrypted?(C.logger.log("Loading key for "+I.sn+" of ["+G.startSN+" ,"+G.endSN+"],level "+W),this._loadKey(I)):(C.logger.log("Loading "+I.sn+" of ["+G.startSN+" ,"+G.endSN+"],level "+W+", currentTime:"+D.toFixed(3)+",bufferEnd:"+$.toFixed(3)),this._loadFragment(I)))}},k.prototype._ensureFragmentAtLivePoint=function(D,F,G,V,W,ee,q){var z=this.hls.config,U=this.media,$,I=z.liveMaxLatencyDuration!==void 0?z.liveMaxLatencyDuration:z.liveMaxLatencyDurationCount*D.targetduration;if(F<Math.max(G-z.maxFragLookUpTolerance,V-I)){var B=this.liveSyncPosition=this.computeLivePosition(G,D);C.logger.log("buffer end: "+F.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+B.toFixed(3)),F=B,U&&U.readyState&&U.duration>B&&(U.currentTime=B),this.nextLoadPosition=B}if(D.PTSKnown&&F>V&&U&&U.readyState)return null;if(this.startFragRequested&&!D.PTSKnown){if(W)if(D.hasProgramDateTime)C.logger.log("live playlist, switching playlist, load frag with same PDT: "+W.programDateTime),$=S.findFragmentByPDT(ee,W.endProgramDateTime,z.maxFragLookUpTolerance);else{var X=W.sn+1;if(X>=D.startSN&&X<=D.endSN){var Q=ee[X-D.startSN];W.cc===Q.cc&&($=Q,C.logger.log("live playlist, switching playlist, load frag with next SN: "+$.sn))}$||($=u.default.search(ee,function(J){return W.cc-J.cc}),$&&C.logger.log("live playlist, switching playlist, load frag with same CC: "+$.sn))}$||($=ee[Math.min(q-1,Math.round(q/2))],C.logger.log("live playlist, switching playlist, unknown, load middle frag : "+$.sn))}return $},k.prototype._findFragment=function(D,F,G,V,W,ee,q){var z=this.hls.config,U;if(W<ee){var $=W>ee-z.maxFragLookUpTolerance?0:z.maxFragLookUpTolerance;U=S.findFragmentByPTS(F,V,W,$)}else U=V[G-1];if(U){var I=U.sn-q.startSN,B=F&&U.level===F.level,X=V[I-1],Q=V[I+1];if(F&&U.sn===F.sn)if(B&&!U.backtracked)if(U.sn<q.endSN){var J=F.deltaPTS;J&&J>z.maxBufferHole&&F.dropped&&I?(U=X,C.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(U=Q,C.logger.log("SN just loaded, load next one: "+U.sn,U))}else U=null;else U.backtracked&&(Q&&Q.backtracked?(C.logger.warn("Already backtracked from fragment "+Q.sn+", will not backtrack to fragment "+U.sn+". Loading fragment "+Q.sn),U=Q):(C.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),U.dropped=0,X?(U=X,U.backtracked=!0):I&&(U=null)))}return U},k.prototype._loadKey=function(D){this.state=T.State.KEY_LOADING,this.hls.trigger(h.default.KEY_LOADING,{frag:D})},k.prototype._loadFragment=function(D){var F=this.fragmentTracker.getState(D);this.fragCurrent=D,this.startFragRequested=!0,a.isFinite(D.sn)&&!D.bitrateTest&&(this.nextLoadPosition=D.start+D.duration),D.backtracked||F===y.FragmentState.NOT_LOADED||F===y.FragmentState.PARTIAL?(D.autoLevel=this.hls.autoLevelEnabled,D.bitrateTest=this.bitrateTest,this.hls.trigger(h.default.FRAG_LOADING,{frag:D}),this.demuxer||(this.demuxer=new d.default(this.hls,"main")),this.state=T.State.FRAG_LOADING):F===y.FragmentState.APPENDING&&this._reduceMaxBufferLength(D.duration)&&this.fragmentTracker.removeFragment(D)},Object.defineProperty(k.prototype,"state",{get:function(){return this._state},set:function(D){if(this.state!==D){var F=this.state;this._state=D,C.logger.log("main stream:"+F+"->"+D),this.hls.trigger(h.default.STREAM_STATE_TRANSITION,{previousState:F,nextState:D})}},enumerable:!0,configurable:!0}),k.prototype.getBufferedFrag=function(D){return this.fragmentTracker.getBufferedFrag(D,p.default.LevelType.MAIN)},Object.defineProperty(k.prototype,"currentLevel",{get:function(){var D=this.media;if(D){var F=this.getBufferedFrag(D.currentTime);if(F)return F.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"nextBufferedFrag",{get:function(){var D=this.media;return D?this.followingBufferedFrag(this.getBufferedFrag(D.currentTime)):null},enumerable:!0,configurable:!0}),k.prototype.followingBufferedFrag=function(D){return D?this.getBufferedFrag(D.endPTS+.5):null},Object.defineProperty(k.prototype,"nextLevel",{get:function(){var D=this.nextBufferedFrag;return D?D.level:-1},enumerable:!0,configurable:!0}),k.prototype._checkFragmentChanged=function(){var D,F,G=this.media;if(G&&G.readyState&&G.seeking===!1&&(F=G.currentTime,F>this.lastCurrentTime&&(this.lastCurrentTime=F),f.BufferHelper.isBuffered(G,F)?D=this.getBufferedFrag(F):f.BufferHelper.isBuffered(G,F+.1)&&(D=this.getBufferedFrag(F+.1)),D)){var V=D;if(V!==this.fragPlaying){this.hls.trigger(h.default.FRAG_CHANGED,{frag:V});var W=V.level;(!this.fragPlaying||this.fragPlaying.level!==W)&&this.hls.trigger(h.default.LEVEL_SWITCHED,{level:W}),this.fragPlaying=V}}},k.prototype.immediateLevelSwitch=function(){if(C.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var D=this.media,F=void 0;D?(F=D.paused,D.pause()):F=!0,this.previouslyPaused=F}var G=this.fragCurrent;G&&G.loader&&G.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,a.POSITIVE_INFINITY)},k.prototype.immediateLevelSwitchEnd=function(){var D=this.media;D&&D.buffered.length&&(this.immediateSwitch=!1,f.BufferHelper.isBuffered(D,D.currentTime)&&(D.currentTime-=1e-4),this.previouslyPaused||D.play())},k.prototype.nextLevelSwitch=function(){var D=this.media;if(D&&D.readyState){var F=void 0,G=void 0,V=void 0;if(G=this.getBufferedFrag(D.currentTime),G&&G.startPTS>1&&this.flushMainBuffer(0,G.startPTS-1),D.paused)F=0;else{var W=this.hls.nextLoadLevel,ee=this.levels[W],q=this.fragLastKbps;q&&this.fragCurrent?F=this.fragCurrent.duration*ee.bitrate/(1e3*q)+1:F=0}if(V=this.getBufferedFrag(D.currentTime+F),V&&(V=this.followingBufferedFrag(V),V)){var z=this.fragCurrent;z&&z.loader&&z.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(V.maxStartPTS,a.POSITIVE_INFINITY)}}},k.prototype.flushMainBuffer=function(D,F){this.state=T.State.BUFFER_FLUSHING;var G={startOffset:D,endOffset:F};this.altAudio&&(G.type="video"),this.hls.trigger(h.default.BUFFER_FLUSHING,G)},k.prototype.onMediaAttached=function(D){var F=this.media=this.mediaBuffer=D.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("seeked",this.onvseeked),F.addEventListener("ended",this.onvended);var G=this.config;this.levels&&G.autoStartLoad&&this.hls.startLoad(G.startPosition),this.gapController=new A.default(G,F,this.fragmentTracker,this.hls)},k.prototype.onMediaDetaching=function(){var D=this.media;D&&D.ended&&(C.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var F=this.levels;F&&F.forEach(function(G){G.details&&G.details.fragments.forEach(function(V){V.backtracked=void 0})}),D&&(D.removeEventListener("seeking",this.onvseeking),D.removeEventListener("seeked",this.onvseeked),D.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},k.prototype.onMediaSeeked=function(){var D=this.media,F=D?D.currentTime:void 0;a.isFinite(F)&&C.logger.log("media seeked to "+F.toFixed(3)),this.tick()},k.prototype.onManifestLoading=function(){C.logger.log("trigger BUFFER_RESET"),this.hls.trigger(h.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},k.prototype.onManifestParsed=function(D){var F=!1,G=!1,V;D.levels.forEach(function(ee){V=ee.audioCodec,V&&(V.indexOf("mp4a.40.2")!==-1&&(F=!0),V.indexOf("mp4a.40.5")!==-1&&(G=!0))}),this.audioCodecSwitch=F&&G,this.audioCodecSwitch&&C.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=D.levels,this.startFragRequested=!1;var W=this.config;(W.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(W.startPosition)},k.prototype.onLevelLoaded=function(D){var F=D.details,G=D.level,V=this.levels[this.levelLastLoaded],W=this.levels[G],ee=F.totalduration,q=0;if(C.logger.log("level "+G+" loaded ["+F.startSN+","+F.endSN+"],duration:"+ee),F.live){var z=W.details;z&&F.fragments.length>0?(_.mergeDetails(z,F),q=F.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(q,z),F.PTSKnown&&a.isFinite(q)?C.logger.log("live playlist sliding:"+q.toFixed(3)):(C.logger.log("live playlist - outdated PTS, unknown sliding"),R.alignStream(this.fragPrevious,V,F))):(C.logger.log("live playlist - first load, unknown sliding"),F.PTSKnown=!1,R.alignStream(this.fragPrevious,V,F))}else F.PTSKnown=!1;if(W.details=F,this.levelLastLoaded=G,this.hls.trigger(h.default.LEVEL_UPDATED,{details:F,level:G}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var U=F.startTimeOffset;a.isFinite(U)?(U<0&&(C.logger.log("negative start time offset "+U+", count from end of last fragment"),U=q+ee+U),C.logger.log("start time offset found in playlist, adjust startPosition to "+U),this.startPosition=U):F.live?(this.startPosition=this.computeLivePosition(q,F),C.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE),this.tick()},k.prototype.onKeyLoaded=function(){this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE,this.tick())},k.prototype.onFragLoaded=function(D){var F=this,G=F.fragCurrent,V=F.hls,W=F.levels,ee=F.media,q=D.frag;if(this.state===T.State.FRAG_LOADING&&G&&q.type==="main"&&q.level===G.level&&q.sn===G.sn){var z=D.stats,U=W[G.level],$=U.details;if(this.bitrateTest=!1,this.stats=z,C.logger.log("Loaded "+G.sn+" of ["+$.startSN+" ,"+$.endSN+"],level "+G.level),q.bitrateTest&&V.nextLoadLevel)this.state=T.State.IDLE,this.startFragRequested=!1,z.tparsed=z.tbuffered=window.performance.now(),V.trigger(h.default.FRAG_BUFFERED,{stats:z,frag:G,id:"main"}),this.tick();else if(q.sn==="initSegment")this.state=T.State.IDLE,z.tparsed=z.tbuffered=window.performance.now(),$.initSegment.data=D.payload,V.trigger(h.default.FRAG_BUFFERED,{stats:z,frag:G,id:"main"}),this.tick();else{C.logger.log("Parsing "+G.sn+" of ["+$.startSN+" ,"+$.endSN+"],level "+G.level+", cc "+G.cc),this.state=T.State.PARSING,this.pendingBuffering=!0,this.appended=!1,q.bitrateTest&&(q.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:q}));var I=!(ee&&ee.seeking)&&($.PTSKnown||!$.live),B=$.initSegment?$.initSegment.data:[],X=this._getAudioCodec(U),Q=this.demuxer=this.demuxer||new d.default(this.hls,"main");Q.push(D.payload,B,X,U.videoCodec,G,$.totalduration,I)}}this.fragLoadError=0},k.prototype.onFragParsingInitSegment=function(D){var F=this.fragCurrent,G=D.frag;if(F&&D.id==="main"&&G.sn===F.sn&&G.level===F.level&&this.state===T.State.PARSING){var V=D.tracks,W=void 0,ee=void 0;if(V.audio&&this.altAudio&&delete V.audio,ee=V.audio,ee){var q=this.levels[this.level].audioCodec,z=navigator.userAgent.toLowerCase();q&&this.audioCodecSwap&&(C.logger.log("swapping playlist audio codec"),q.indexOf("mp4a.40.5")!==-1?q="mp4a.40.2":q="mp4a.40.5"),this.audioCodecSwitch&&ee.metadata.channelCount!==1&&z.indexOf("firefox")===-1&&(q="mp4a.40.5"),z.indexOf("android")!==-1&&ee.container!=="audio/mpeg"&&(q="mp4a.40.2",C.logger.log("Android: force audio codec to "+q)),ee.levelCodec=q,ee.id=D.id}ee=V.video,ee&&(ee.levelCodec=this.levels[this.level].videoCodec,ee.id=D.id),this.hls.trigger(h.default.BUFFER_CODECS,V);for(W in V){ee=V[W],C.logger.log("main track:"+W+",container:"+ee.container+",codecs[level/parsed]=["+ee.levelCodec+"/"+ee.codec+"]");var U=ee.initSegment;U&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(h.default.BUFFER_APPENDING,{type:W,data:U,parent:"main",content:"initSegment"}))}this.tick()}},k.prototype.onFragParsingData=function(D){var F=this,G=this.fragCurrent,V=D.frag;if(G&&D.id==="main"&&V.sn===G.sn&&V.level===G.level&&!(D.type==="audio"&&this.altAudio)&&this.state===T.State.PARSING){var W=this.levels[this.level],ee=G;if(a.isFinite(D.endPTS)||(D.endPTS=D.startPTS+G.duration,D.endDTS=D.startDTS+G.duration),D.hasAudio===!0&&ee.addElementaryStream(E.default.ElementaryStreamTypes.AUDIO),D.hasVideo===!0&&ee.addElementaryStream(E.default.ElementaryStreamTypes.VIDEO),C.logger.log("Parsed "+D.type+",PTS:["+D.startPTS.toFixed(3)+","+D.endPTS.toFixed(3)+"],DTS:["+D.startDTS.toFixed(3)+"/"+D.endDTS.toFixed(3)+"],nb:"+D.nb+",dropped:"+(D.dropped||0)),D.type==="video")if(ee.dropped=D.dropped,ee.dropped)if(ee.backtracked)C.logger.warn("Already backtracked on this fragment, appending with the gap",ee.sn);else{var q=W.details;if(q&&ee.sn===q.startSN)C.logger.warn("missing video frame(s) on first frag, appending with gap",ee.sn);else{C.logger.warn("missing video frame(s), backtracking fragment",ee.sn),this.fragmentTracker.removeFragment(ee),ee.backtracked=!0,this.nextLoadPosition=D.startPTS,this.state=T.State.IDLE,this.fragPrevious=ee,this.tick();return}}else ee.backtracked=!1;var z=_.updateFragPTSDTS(W.details,ee,D.startPTS,D.endPTS,D.startDTS,D.endDTS),U=this.hls;U.trigger(h.default.LEVEL_PTS_UPDATED,{details:W.details,level:this.level,drift:z,type:D.type,start:D.startPTS,end:D.endPTS}),[D.data1,D.data2].forEach(function($){$&&$.length&&F.state===T.State.PARSING&&(F.appended=!0,F.pendingBuffering=!0,U.trigger(h.default.BUFFER_APPENDING,{type:D.type,data:$,parent:"main",content:"data"}))}),this.tick()}},k.prototype.onFragParsed=function(D){var F=this.fragCurrent,G=D.frag;F&&D.id==="main"&&G.sn===F.sn&&G.level===F.level&&this.state===T.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=T.State.PARSED,this._checkAppendedParsed())},k.prototype.onAudioTrackSwitching=function(D){var F=!!D.url,G=D.id;if(!F){if(this.mediaBuffer!==this.media){C.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var V=this.fragCurrent;V.loader&&(C.logger.log("switching to main audio track, cancel main fragment load"),V.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=T.State.IDLE}var W=this.hls;W.trigger(h.default.BUFFER_FLUSHING,{startOffset:0,endOffset:a.POSITIVE_INFINITY,type:"audio"}),W.trigger(h.default.AUDIO_TRACK_SWITCHED,{id:G}),this.altAudio=!1}},k.prototype.onAudioTrackSwitched=function(D){var F=D.id,G=!!this.hls.audioTracks[F].url;if(G){var V=this.videoBuffer;V&&this.mediaBuffer!==V&&(C.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=V)}this.altAudio=G,this.tick()},k.prototype.onBufferCreated=function(D){var F=D.tracks,G,V,W=!1;for(var ee in F){var q=F[ee];q.id==="main"?(V=ee,G=q,ee==="video"&&(this.videoBuffer=F[ee].buffer)):W=!0}W&&G?(C.logger.log("alternate track found, use "+V+".buffered to schedule main fragment loading"),this.mediaBuffer=G.buffer):this.mediaBuffer=this.media},k.prototype.onBufferAppended=function(D){if(D.parent==="main"){var F=this.state;(F===T.State.PARSING||F===T.State.PARSED)&&(this.pendingBuffering=D.pending>0,this._checkAppendedParsed())}},k.prototype._checkAppendedParsed=function(){if(this.state===T.State.PARSED&&(!this.appended||!this.pendingBuffering)){var D=this.fragCurrent;if(D){var F=this.mediaBuffer?this.mediaBuffer:this.media;C.logger.log("main buffered : "+g.default.toString(F.buffered)),this.fragPrevious=D;var G=this.stats;G.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*G.total/(G.tbuffered-G.tfirst)),this.hls.trigger(h.default.FRAG_BUFFERED,{stats:G,frag:D,id:"main"}),this.state=T.State.IDLE}this.tick()}},k.prototype.onError=function(D){var F=D.frag||this.fragCurrent;if(!(F&&F.type!=="main")){var G=!!this.media&&f.BufferHelper.isBuffered(this.media,this.media.currentTime)&&f.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(D.details){case x.ErrorDetails.FRAG_LOAD_ERROR:case x.ErrorDetails.FRAG_LOAD_TIMEOUT:case x.ErrorDetails.KEY_LOAD_ERROR:case x.ErrorDetails.KEY_LOAD_TIMEOUT:if(!D.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var V=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);C.logger.warn("mediaController: frag loading failed, retry in "+V+" ms"),this.retryDate=window.performance.now()+V,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=T.State.FRAG_LOADING_WAITING_RETRY}else C.logger.error("mediaController: "+D.details+" reaches max retry, redispatch as fatal ..."),D.fatal=!0,this.state=T.State.ERROR;break;case x.ErrorDetails.LEVEL_LOAD_ERROR:case x.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(D.fatal?(this.state=T.State.ERROR,C.logger.warn("streamController: "+D.details+",switch to "+this.state+" state ...")):!D.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case x.ErrorDetails.BUFFER_FULL_ERROR:D.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)&&(G?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=T.State.IDLE):(C.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,a.POSITIVE_INFINITY)));break}}},k.prototype._reduceMaxBufferLength=function(D){var F=this.config;return F.maxMaxBufferLength>=D?(F.maxMaxBufferLength/=2,C.logger.warn("main:reduce max buffer length to "+F.maxMaxBufferLength+"s"),!0):!1},k.prototype._checkBuffer=function(){var D=this.media;if(!(!D||D.readyState===0)){var F=this.mediaBuffer?this.mediaBuffer:D,G=F.buffered;!this.loadedmetadata&&G.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,G)}},k.prototype.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},k.prototype.onBufferFlushed=function(){var D=this.mediaBuffer?this.mediaBuffer:this.media;D&&this.fragmentTracker.detectEvictedFragments(E.default.ElementaryStreamTypes.VIDEO,D.buffered),this.state=T.State.IDLE,this.fragPrevious=null},k.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},k.prototype.computeLivePosition=function(D,F){var G=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*F.targetduration;return D+Math.max(0,F.totalduration-G)},k.prototype._seekToStartPos=function(){var D=this.media,F=D.currentTime,G=D.seeking?F:this.startPosition;F!==G&&(C.logger.log("target start position not buffered, seek to buffered.start(0) "+G+" from current time "+F+" "),D.currentTime=G)},k.prototype._getAudioCodec=function(D){var F=this.config.defaultAudioCodec||D.audioCodec;return this.audioCodecSwap&&(C.logger.log("swapping playlist audio codec"),F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5")),F},Object.defineProperty(k.prototype,"liveSyncPosition",{get:function(){return this._liveSyncPosition},set:function(D){this._liveSyncPosition=D},enumerable:!0,configurable:!0}),k}(T.default);t.default=P}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/subtitle-stream-controller.js":function(r,t,n){var a=this&&this.__extends||function(){var C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,S){R.__proto__=S}||function(R,S){for(var A in S)S.hasOwnProperty(A)&&(R[A]=S[A])};return function(R,S){C(R,S);function A(){this.constructor=R}R.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/utils/logger.js"),f=n("./src/crypt/decrypter.js"),d=n("./src/utils/buffer-helper.js"),h=n("./src/controller/fragment-finders.js"),y=n("./src/controller/fragment-tracker.js"),E=n("./src/controller/base-stream-controller.js"),p=n("./src/controller/level-helper.js"),_=window.performance,g=500,x=function(C){a(R,C);function R(S,A){var T=C.call(this,S,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.ERROR,l.default.KEY_LOADED,l.default.FRAG_LOADED,l.default.SUBTITLE_TRACKS_UPDATED,l.default.SUBTITLE_TRACK_SWITCH,l.default.SUBTITLE_TRACK_LOADED,l.default.SUBTITLE_FRAG_PROCESSED,l.default.LEVEL_UPDATED)||this;return T.fragmentTracker=A,T.config=S.config,T.state=E.State.STOPPED,T.tracks=[],T.tracksBuffered=[],T.currentTrackId=-1,T.decrypter=new f.default(S,S.config),T.lastAVStart=0,T._onMediaSeeking=T.onMediaSeeking.bind(T),T}return R.prototype.onSubtitleFragProcessed=function(S){var A=S.frag,T=S.success;if(this.fragPrevious=A,this.state=E.State.IDLE,!!T){var w=this.tracksBuffered[this.currentTrackId];if(w){for(var P,O=A.start,k=0;k<w.length;k++)if(O>=w[k].start&&O<=w[k].end){P=w[k];break}var D=A.start+A.duration;P?P.end=D:(P={start:O,end:D},w.push(P))}}},R.prototype.onMediaAttached=function(S){var A=S.media;this.media=A,A.addEventListener("seeking",this._onMediaSeeking),this.state=E.State.IDLE},R.prototype.onMediaDetaching=function(){this.media.removeEventListener("seeking",this._onMediaSeeking),this.media=null,this.state=E.State.STOPPED},R.prototype.onError=function(S){var A=S.frag;!A||A.type!=="subtitle"||(this.state=E.State.IDLE)},R.prototype.onSubtitleTracksUpdated=function(S){var A=this;u.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=S.subtitleTracks,this.tracks.forEach(function(T){A.tracksBuffered[T.id]=[]})},R.prototype.onSubtitleTrackSwitch=function(S){if(this.currentTrackId=S.id,!this.tracks||this.currentTrackId===-1){this.clearInterval();return}var A=this.tracks[this.currentTrackId];A&&A.details&&this.setInterval(g)},R.prototype.onSubtitleTrackLoaded=function(S){var A=S.id,T=S.details,w=this,P=w.currentTrackId,O=w.tracks,k=O[P];A>=O.length||A!==P||!k||(T.live&&p.mergeSubtitlePlaylists(k.details,T,this.lastAVStart),k.details=T,this.setInterval(g))},R.prototype.onKeyLoaded=function(){this.state===E.State.KEY_LOADING&&(this.state=E.State.IDLE)},R.prototype.onFragLoaded=function(S){var A=this.fragCurrent,T=S.frag.decryptdata,w=S.frag,P=this.hls;if(this.state===E.State.FRAG_LOADING&&A&&S.frag.type==="subtitle"&&A.sn===S.frag.sn&&S.payload.byteLength>0&&T&&T.key&&T.method==="AES-128"){var O=_.now();this.decrypter.decrypt(S.payload,T.key.buffer,T.iv.buffer,function(k){var D=_.now();P.trigger(l.default.FRAG_DECRYPTED,{frag:w,payload:k,stats:{tstart:O,tdecrypt:D}})})}},R.prototype.onLevelUpdated=function(S){var A=S.details,T=A.fragments;this.lastAVStart=T.length?T[0].start:0},R.prototype.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}switch(this.state){case E.State.IDLE:{var S=this,A=S.config,T=S.currentTrackId,w=S.fragmentTracker,P=S.media,O=S.tracks;if(!O||!O[T]||!O[T].details)break;var k=A.maxBufferHole,D=A.maxFragLookUpTolerance,F=Math.min(A.maxBufferLength,A.maxMaxBufferLength),G=d.BufferHelper.bufferedInfo(this._getBuffered(),P.currentTime,k),V=G.end,W=G.len,ee=O[T].details,q=ee.fragments,z=q.length,U=q[z-1].start+q[z-1].duration;if(W>F)return;var $=void 0,I=this.fragPrevious;V<U?(I&&ee.hasProgramDateTime&&($=h.findFragmentByPDT(q,I.endProgramDateTime,D)),$||($=h.findFragmentByPTS(I,q,V,D))):$=q[z-1],$&&$.encrypted?(u.logger.log("Loading key for "+$.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(l.default.KEY_LOADING,{frag:$})):$&&w.getState($)===y.FragmentState.NOT_LOADED&&(this.fragCurrent=$,this.state=E.State.FRAG_LOADING,this.hls.trigger(l.default.FRAG_LOADING,{frag:$}))}}},R.prototype.stopLoad=function(){this.lastAVStart=0,C.prototype.stopLoad.call(this)},R.prototype._getBuffered=function(){return this.tracksBuffered[this.currentTrackId]||[]},R.prototype.onMediaSeeking=function(){this.fragPrevious=null},R}(E.default);t.SubtitleStreamController=x},"./src/controller/subtitle-track-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,g){_.__proto__=g}||function(_,g){for(var x in g)g.hasOwnProperty(x)&&(_[x]=g[x])};return function(_,g){p(_,g);function x(){this.constructor=_}_.prototype=g===null?Object.create(g):(x.prototype=g.prototype,new x)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/utils/logger.js"),h=n("./src/controller/level-helper.js"),y=function(p){l(_,p);function _(g){var x=p.call(this,g,u.default.MEDIA_ATTACHED,u.default.MEDIA_DETACHING,u.default.MANIFEST_LOADED,u.default.SUBTITLE_TRACK_LOADED)||this;return x.tracks=[],x.trackId=-1,x.media=null,x.stopped=!0,x.subtitleDisplay=!0,x}return _.prototype.destroy=function(){f.default.prototype.destroy.call(this)},_.prototype.onMediaAttached=function(g){var x=this;this.media=g.media,this.media&&(this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval(function(){x.trackChangeListener()},500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},_.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=null)},_.prototype.onManifestLoaded=function(g){var x=this,C=g.subtitles||[];this.tracks=C,this.hls.trigger(u.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:C}),C.forEach(function(R){R.default&&(x.media?x.subtitleTrack=R.id:x.queuedDefaultTrack=R.id)})},_.prototype.onSubtitleTrackLoaded=function(g){var x=this,C=g.id,R=g.details,S=this,A=S.trackId,T=S.tracks,w=T[A];if(C>=T.length||C!==A||!w||this.stopped){this._clearReloadTimer();return}if(d.logger.log("subtitle track "+C+" loaded"),R.live){var P=h.computeReloadInterval(w.details,R,g.stats.trequest);d.logger.log("Reloading live subtitle playlist in "+P+"ms"),this.timer=setTimeout(function(){x._loadCurrentTrack()},P)}else this._clearReloadTimer()},_.prototype.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},_.prototype.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},Object.defineProperty(_.prototype,"subtitleTracks",{get:function(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"subtitleTrack",{get:function(){return this.trackId},set:function(g){this.trackId!==g&&(this._toggleTrackModes(g),this._setSubtitleTrackInternal(g))},enumerable:!0,configurable:!0}),_.prototype._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},_.prototype._loadCurrentTrack=function(){var g=this,x=g.trackId,C=g.tracks,R=g.hls,S=C[x];x<0||!S||S.details&&!S.details.live||(d.logger.log("Loading subtitle track "+x),R.trigger(u.default.SUBTITLE_TRACK_LOADING,{url:S.url,id:x}))},_.prototype._toggleTrackModes=function(g){var x=this,C=x.media,R=x.subtitleDisplay,S=x.trackId;if(C){var A=E(C.textTracks);if(g===-1)[].slice.call(A).forEach(function(P){P.mode="disabled"});else{var T=A[S];T&&(T.mode="disabled")}var w=A[g];w&&(w.mode=R?"showing":"hidden")}},_.prototype._setSubtitleTrackInternal=function(g){var x=this,C=x.hls,R=x.tracks;!a.isFinite(g)||g<-1||g>=R.length||(this.trackId=g,d.logger.log("Switching to subtitle track "+g),C.trigger(u.default.SUBTITLE_TRACK_SWITCH,{id:g}),this._loadCurrentTrack())},_.prototype._onTextTracksChanged=function(){if(this.media){for(var g=-1,x=E(this.media.textTracks),C=0;C<x.length;C++)if(x[C].mode==="hidden")g=C;else if(x[C].mode==="showing"){g=C;break}this.subtitleTrack=g}},_}(f.default);function E(p){for(var _=[],g=0;g<p.length;g++){var x=p[g];x.kind==="subtitles"&&x.label&&_.push(p[g])}return _}t.default=y}).call(this,n("./src/polyfills/number.js").Number)},"./src/controller/timeline-controller.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,S){R.__proto__=S}||function(R,S){for(var A in S)S.hasOwnProperty(A)&&(R[A]=S[A])};return function(R,S){C(R,S);function A(){this.constructor=R}R.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/utils/cea-608-parser.js"),h=n("./src/utils/output-filter.js"),y=n("./src/utils/webvtt-parser.js"),E=n("./src/utils/logger.js"),p=n("./src/utils/texttrack-utils.js");function _(C,R){return C&&C.label===R.name&&!(C.textTrack1||C.textTrack2)}function g(C,R,S,A){return Math.min(R,A)-Math.max(C,S)}var x=function(C){l(R,C);function R(S){var A=C.call(this,S,u.default.MEDIA_ATTACHING,u.default.MEDIA_DETACHING,u.default.FRAG_PARSING_USERDATA,u.default.FRAG_DECRYPTED,u.default.MANIFEST_LOADING,u.default.MANIFEST_LOADED,u.default.FRAG_LOADED,u.default.LEVEL_SWITCHING,u.default.INIT_PTS_FOUND)||this;if(A.hls=S,A.config=S.config,A.enabled=!0,A.Cues=S.config.cueHandler,A.textTracks=[],A.tracks=[],A.unparsedVttFrags=[],A.initPTS=[],A.cueRanges=[],A.captionsTracks={},A.captionsProperties={textTrack1:{label:A.config.captionsTextTrack1Label,languageCode:A.config.captionsTextTrack1LanguageCode},textTrack2:{label:A.config.captionsTextTrack2Label,languageCode:A.config.captionsTextTrack2LanguageCode}},A.config.enableCEA708Captions){var T=new h.default(A,"textTrack1"),w=new h.default(A,"textTrack2");A.cea608Parser=new d.default(0,T,w)}return A}return R.prototype.addCues=function(S,A,T,w){for(var P=this.cueRanges,O=!1,k=P.length;k--;){var D=P[k],F=g(D[0],D[1],A,T);if(F>=0&&(D[0]=Math.min(D[0],A),D[1]=Math.max(D[1],T),O=!0,F/(T-A)>.5))return}O||P.push([A,T]),this.Cues.newCue(this.captionsTracks[S],A,T,w)},R.prototype.onInitPtsFound=function(S){var A=this;if(S.id==="main"&&(this.initPTS[S.frag.cc]=S.initPTS),this.unparsedVttFrags.length){var T=this.unparsedVttFrags;this.unparsedVttFrags=[],T.forEach(function(w){A.onFragLoaded(w)})}},R.prototype.getExistingTrack=function(S){var A=this.media;if(A)for(var T=0;T<A.textTracks.length;T++){var w=A.textTracks[T];if(w[S])return w}return null},R.prototype.createCaptionsTrack=function(S){var A=this.captionsProperties[S],T=A.label,w=A.languageCode,P=this.captionsTracks;if(!P[S]){var O=this.getExistingTrack(S);if(O)P[S]=O,p.clearCurrentCues(P[S]),p.sendAddTrackEvent(P[S],this.media);else{var k=this.createTextTrack("captions",T,w);k&&(k[S]=!0,P[S]=k)}}},R.prototype.createTextTrack=function(S,A,T){var w=this.media;if(w)return w.addTextTrack(S,A,T)},R.prototype.destroy=function(){f.default.prototype.destroy.call(this)},R.prototype.onMediaAttaching=function(S){this.media=S.media,this._cleanTracks()},R.prototype.onMediaDetaching=function(){var S=this.captionsTracks;Object.keys(S).forEach(function(A){p.clearCurrentCues(S[A]),delete S[A]})},R.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks()},R.prototype._cleanTracks=function(){var S=this.media;if(S){var A=S.textTracks;if(A)for(var T=0;T<A.length;T++)p.clearCurrentCues(A[T])}},R.prototype.onManifestLoaded=function(S){var A=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cueRanges=[],this.config.enableWebVTT){this.tracks=S.subtitles||[];var T=this.media?this.media.textTracks:[];this.tracks.forEach(function(w,P){var O;if(P<T.length){for(var k=null,D=0;D<T.length;D++)if(_(T[D],w)){k=T[D];break}k&&(O=k)}O||(O=A.createTextTrack("subtitles",w.name,w.lang)),w.default?O.mode=A.hls.subtitleDisplay?"showing":"hidden":O.mode="disabled",A.textTracks.push(O)})}},R.prototype.onLevelSwitching=function(){this.enabled=this.hls.currentLevel.closedCaptions!=="NONE"},R.prototype.onFragLoaded=function(S){var A=S.frag,T=S.payload;if(A.type==="main"){var w=A.sn;if(w!==this.lastSn+1){var P=this.cea608Parser;P&&P.reset()}this.lastSn=w}else if(A.type==="subtitle")if(T.byteLength){if(!a.isFinite(this.initPTS[A.cc])){this.unparsedVttFrags.push(S),this.initPTS.length&&this.hls.trigger(u.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A});return}var O=A.decryptdata;(O==null||O.key==null||O.method!=="AES-128")&&this._parseVTTs(A,T)}else this.hls.trigger(u.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A})},R.prototype._parseVTTs=function(S,A){var T=this.vttCCs;T[S.cc]||(T[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc);var w=this.textTracks,P=this.hls;y.default.parse(A,this.initPTS[S.cc],T,S.cc,function(O){var k=w[S.level];if(k.mode==="disabled"){P.trigger(u.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S});return}O.forEach(function(D){if(!k.cues.getCueById(D.id))try{k.addCue(D)}catch{var F=new window.TextTrackCue(D.startTime,D.endTime,D.text);F.id=D.id,k.addCue(F)}}),P.trigger(u.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:S})},function(O){E.logger.log("Failed to parse VTT cue: "+O),P.trigger(u.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S})})},R.prototype.onFragDecrypted=function(S){var A=S.payload,T=S.frag;if(T.type==="subtitle"){if(!a.isFinite(this.initPTS[T.cc])){this.unparsedVttFrags.push(S);return}this._parseVTTs(T,A)}},R.prototype.onFragParsingUserdata=function(S){if(this.enabled&&this.config.enableCEA708Captions)for(var A=0;A<S.samples.length;A++){var T=this.extractCea608Data(S.samples[A].bytes);this.cea608Parser.addData(S.samples[A].pts,T)}},R.prototype.extractCea608Data=function(S){for(var A=S[0]&31,T=2,w,P,O,k,D,F=[],G=0;G<A;G++)w=S[T++],P=127&S[T++],O=127&S[T++],k=(4&w)!==0,D=3&w,!(P===0&&O===0)&&k&&D===0&&(F.push(P),F.push(O));return F},R}(f.default);t.default=x}).call(this,n("./src/polyfills/number.js").Number)},"./src/crypt/aes-crypto.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(u,f){this.subtle=u,this.aesIV=f}return l.prototype.decrypt=function(u,f){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},f,u)},l}();t.default=a},"./src/crypt/aes-decryptor.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});function a(u){var f=u.byteLength,d=f&&new DataView(u).getUint8(f-1);return d?u.slice(0,f-d):u}t.removePadding=a;var l=function(){function u(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return u.prototype.uint8ArrayToUint32Array_=function(f){for(var d=new DataView(f),h=new Uint32Array(4),y=0;y<4;y++)h[y]=d.getUint32(y*4);return h},u.prototype.initTable=function(){var f=this.sBox,d=this.invSBox,h=this.subMix,y=h[0],E=h[1],p=h[2],_=h[3],g=this.invSubMix,x=g[0],C=g[1],R=g[2],S=g[3],A=new Uint32Array(256),T=0,w=0,P=0;for(P=0;P<256;P++)P<128?A[P]=P<<1:A[P]=P<<1^283;for(P=0;P<256;P++){var O=w^w<<1^w<<2^w<<3^w<<4;O=O>>>8^O&255^99,f[T]=O,d[O]=T;var k=A[T],D=A[k],F=A[D],G=A[O]*257^O*16843008;y[T]=G<<24|G>>>8,E[T]=G<<16|G>>>16,p[T]=G<<8|G>>>24,_[T]=G,G=F*16843009^D*65537^k*257^T*16843008,x[O]=G<<24|G>>>8,C[O]=G<<16|G>>>16,R[O]=G<<8|G>>>24,S[O]=G,T?(T=k^A[A[A[F^k]]],w^=A[A[w]]):T=w=1}},u.prototype.expandKey=function(f){for(var d=this.uint8ArrayToUint32Array_(f),h=!0,y=0;y<d.length&&h;)h=d[y]===this.key[y],y++;if(!h){this.key=d;var E=this.keySize=d.length;if(E!==4&&E!==6&&E!==8)throw new Error("Invalid aes key size="+E);var p=this.ksRows=(E+6+1)*4,_,g,x=this.keySchedule=new Uint32Array(p),C=this.invKeySchedule=new Uint32Array(p),R=this.sBox,S=this.rcon,A=this.invSubMix,T=A[0],w=A[1],P=A[2],O=A[3],k,D;for(_=0;_<p;_++){if(_<E){k=x[_]=d[_];continue}D=k,_%E===0?(D=D<<8|D>>>24,D=R[D>>>24]<<24|R[D>>>16&255]<<16|R[D>>>8&255]<<8|R[D&255],D^=S[_/E|0]<<24):E>6&&_%E===4&&(D=R[D>>>24]<<24|R[D>>>16&255]<<16|R[D>>>8&255]<<8|R[D&255]),x[_]=k=(x[_-E]^D)>>>0}for(g=0;g<p;g++)_=p-g,g&3?D=x[_]:D=x[_-4],g<4||_<=4?C[g]=D:C[g]=T[R[D>>>24]]^w[R[D>>>16&255]]^P[R[D>>>8&255]]^O[R[D&255]],C[g]=C[g]>>>0}},u.prototype.networkToHostOrderSwap=function(f){return f<<24|(f&65280)<<8|(f&16711680)>>8|f>>>24},u.prototype.decrypt=function(f,d,h,y){for(var E=this.keySize+6,p=this.invKeySchedule,_=this.invSBox,g=this.invSubMix,x=g[0],C=g[1],R=g[2],S=g[3],A=this.uint8ArrayToUint32Array_(h),T=A[0],w=A[1],P=A[2],O=A[3],k=new Int32Array(f),D=new Int32Array(k.length),F,G,V,W,ee,q,z,U,$,I,B,X,Q,J,ne=this.networkToHostOrderSwap;d<k.length;){for($=ne(k[d]),I=ne(k[d+1]),B=ne(k[d+2]),X=ne(k[d+3]),ee=$^p[0],q=X^p[1],z=B^p[2],U=I^p[3],Q=4,J=1;J<E;J++)F=x[ee>>>24]^C[q>>16&255]^R[z>>8&255]^S[U&255]^p[Q],G=x[q>>>24]^C[z>>16&255]^R[U>>8&255]^S[ee&255]^p[Q+1],V=x[z>>>24]^C[U>>16&255]^R[ee>>8&255]^S[q&255]^p[Q+2],W=x[U>>>24]^C[ee>>16&255]^R[q>>8&255]^S[z&255]^p[Q+3],ee=F,q=G,z=V,U=W,Q=Q+4;F=_[ee>>>24]<<24^_[q>>16&255]<<16^_[z>>8&255]<<8^_[U&255]^p[Q],G=_[q>>>24]<<24^_[z>>16&255]<<16^_[U>>8&255]<<8^_[ee&255]^p[Q+1],V=_[z>>>24]<<24^_[U>>16&255]<<16^_[ee>>8&255]<<8^_[q&255]^p[Q+2],W=_[U>>>24]<<24^_[ee>>16&255]<<16^_[q>>8&255]<<8^_[z&255]^p[Q+3],Q=Q+3,D[d]=ne(F^T),D[d+1]=ne(W^w),D[d+2]=ne(V^P),D[d+3]=ne(G^O),T=$,w=I,P=B,O=X,d=d+4}return y?a(D.buffer):D.buffer},u.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},u}();t.default=l},"./src/crypt/decrypter.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/crypt/aes-crypto.js"),l=n("./src/crypt/fast-aes-key.js"),u=n("./src/crypt/aes-decryptor.js"),f=n("./src/errors.js"),d=n("./src/utils/logger.js"),h=n("./src/events.js"),y=n("./src/utils/get-self-scope.js"),E=y.getSelfScope(),p=function(){function _(g,x,C){var R=(C===void 0?{}:C).removePKCS7Padding,S=R===void 0?!0:R;if(this.logEnabled=!0,this.observer=g,this.config=x,this.removePKCS7Padding=S,S)try{var A=E.crypto;A&&(this.subtle=A.subtle||A.webkitSubtle)}catch{}this.disableWebCrypto=!this.subtle}return _.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},_.prototype.decrypt=function(g,x,C,R){var S=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(d.logger.log("JS AES decrypt"),this.logEnabled=!1);var A=this.decryptor;A||(this.decryptor=A=new u.default),A.expandKey(x),R(A.decrypt(g,0,C,this.removePKCS7Padding))}else{this.logEnabled&&(d.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var T=this.subtle;this.key!==x&&(this.key=x,this.fastAesKey=new l.default(T,x)),this.fastAesKey.expandKey().then(function(w){var P=new a.default(T,C);P.decrypt(g,w).catch(function(O){S.onWebCryptoError(O,g,x,C,R)}).then(function(O){R(O)})}).catch(function(w){S.onWebCryptoError(w,g,x,C,R)})}},_.prototype.onWebCryptoError=function(g,x,C,R,S){this.config.enableSoftwareAES?(d.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(x,C,R,S)):(d.logger.error("decrypting error : "+g.message),this.observer.trigger(h.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:g.message}))},_.prototype.destroy=function(){var g=this.decryptor;g&&(g.destroy(),this.decryptor=void 0)},_}();t.default=p},"./src/crypt/fast-aes-key.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(u,f){this.subtle=u,this.key=f}return l.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},l}();t.default=a},"./src/demux/aacdemuxer.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/demux/adts.js"),u=n("./src/utils/logger.js"),f=n("./src/demux/id3.js"),d=function(){function h(y,E,p){this.observer=y,this.config=p,this.remuxer=E}return h.prototype.resetInitSegment=function(y,E,p,_){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:E,duration:_,inputTimeScale:9e4}},h.prototype.resetTimeStamp=function(){},h.probe=function(y){if(!y)return!1;for(var E=f.default.getID3Data(y,0)||[],p=E.length,_=y.length;p<_;p++)if(l.probe(y,p))return u.logger.log("ADTS sync word found !"),!0;return!1},h.prototype.append=function(y,E,p,_){for(var g=this._audioTrack,x=f.default.getID3Data(y,0)||[],C=f.default.getTimeStamp(x),R=a.isFinite(C)?C*90:E*9e4,S=0,A=R,T=y.length,w=x.length,P=[{pts:A,dts:A,data:x}];w<T-1;)if(l.isHeader(y,w)&&w+5<T){l.initTrackConfig(g,this.observer,y,w,g.manifestCodec);var O=l.appendFrame(g,y,w,R,S);if(O)w+=O.length,A=O.sample.pts,S++;else{u.logger.log("Unable to parse AAC frame");break}}else f.default.isHeader(y,w)?(x=f.default.getID3Data(y,w),P.push({pts:A,dts:A,data:x}),w+=x.length):w++;this.remuxer.remux(g,{samples:[]},{samples:P,inputTimeScale:9e4},{samples:[]},E,p,_)},h.prototype.destroy=function(){},h}();t.default=d}).call(this,n("./src/polyfills/number.js").Number)},"./src/demux/adts.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),l=n("./src/errors.js"),u=n("./src/events.js");function f(R,S,A,T){var w,P,O,k,D,F=navigator.userAgent.toLowerCase(),G=T,V=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(w=((S[A+2]&192)>>>6)+1,P=(S[A+2]&60)>>>2,P>V.length-1){R.trigger(u.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+P});return}return k=(S[A+2]&1)<<2,k|=(S[A+3]&192)>>>6,a.logger.log("manifest codec:"+T+",ADTS data:type:"+w+",sampleingIndex:"+P+"["+V[P]+"Hz],channelConfig:"+k),/firefox/i.test(F)?P>=6?(w=5,D=new Array(4),O=P-3):(w=2,D=new Array(2),O=P):F.indexOf("android")!==-1?(w=2,D=new Array(2),O=P):(w=5,D=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&P>=6?O=P-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(P>=6&&k===1||/vivaldi/i.test(F))||!T&&k===1)&&(w=2,D=new Array(2)),O=P)),D[0]=w<<3,D[0]|=(P&14)>>1,D[1]|=(P&1)<<7,D[1]|=k<<3,w===5&&(D[1]|=(O&14)>>1,D[2]=(O&1)<<7,D[2]|=8,D[3]=0),{config:D,samplerate:V[P],channelCount:k,codec:"mp4a.40."+w,manifestCodec:G}}t.getAudioConfig=f;function d(R,S){return R[S]===255&&(R[S+1]&246)===240}t.isHeaderPattern=d;function h(R,S){return R[S+1]&1?7:9}t.getHeaderLength=h;function y(R,S){return(R[S+3]&3)<<11|R[S+4]<<3|(R[S+5]&224)>>>5}t.getFullFrameLength=y;function E(R,S){return!!(S+1<R.length&&d(R,S))}t.isHeader=E;function p(R,S){if(S+1<R.length&&d(R,S)){var A=h(R,S),T=A;S+5<R.length&&(T=y(R,S));var w=S+T;if(w===R.length||w+1<R.length&&d(R,w))return!0}return!1}t.probe=p;function _(R,S,A,T,w){if(!R.samplerate){var P=f(S,A,T,w);R.config=P.config,R.samplerate=P.samplerate,R.channelCount=P.channelCount,R.codec=P.codec,R.manifestCodec=P.manifestCodec,a.logger.log("parsed codec:"+R.codec+",rate:"+P.samplerate+",nb channel:"+P.channelCount)}}t.initTrackConfig=_;function g(R){return 1024*9e4/R}t.getFrameDuration=g;function x(R,S,A,T,w){var P,O,k,D=R.length;if(P=h(R,S),O=y(R,S),O-=P,O>0&&S+P+O<=D)return k=A+T*w,{headerLength:P,frameLength:O,stamp:k}}t.parseFrameHeader=x;function C(R,S,A,T,w){var P=g(R.samplerate),O=x(S,A,T,w,P);if(O){var k=O.stamp,D=O.headerLength,F=O.frameLength,G={unit:S.subarray(A+D,A+D+F),pts:k,dts:k};return R.samples.push(G),R.len+=F,{sample:G,length:F+D}}}t.appendFrame=C},"./src/demux/demuxer-inline.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/events.js"),l=n("./src/errors.js"),u=n("./src/crypt/decrypter.js"),f=n("./src/demux/aacdemuxer.js"),d=n("./src/demux/mp4demuxer.js"),h=n("./src/demux/tsdemuxer.js"),y=n("./src/demux/mp3demuxer.js"),E=n("./src/remux/mp4-remuxer.js"),p=n("./src/remux/passthrough-remuxer.js"),_=n("./src/utils/get-self-scope.js"),g=n("./src/utils/logger.js"),x=_.getSelfScope(),C;try{C=x.performance.now.bind(x.performance)}catch{g.logger.debug("Unable to use Performance API on this environment"),C=x.Date.now}var R=function(){function S(A,T,w,P){this.observer=A,this.typeSupported=T,this.config=w,this.vendor=P}return S.prototype.destroy=function(){var A=this.demuxer;A&&A.destroy()},S.prototype.push=function(A,T,w,P,O,k,D,F,G,V,W,ee){var q=this;if(A.byteLength>0&&T!=null&&T.key!=null&&T.method==="AES-128"){var z=this.decrypter;z==null&&(z=this.decrypter=new u.default(this.observer,this.config));var U=C();z.decrypt(A,T.key.buffer,T.iv.buffer,function($){var I=C();q.observer.trigger(a.default.FRAG_DECRYPTED,{stats:{tstart:U,tdecrypt:I}}),q.pushDecrypted(new Uint8Array($),T,new Uint8Array(w),P,O,k,D,F,G,V,W,ee)})}else this.pushDecrypted(new Uint8Array(A),T,new Uint8Array(w),P,O,k,D,F,G,V,W,ee)},S.prototype.pushDecrypted=function(A,T,w,P,O,k,D,F,G,V,W,ee){var q=this.demuxer;if(!q||(D||F)&&!this.probe(A)){for(var z=this.observer,U=this.typeSupported,$=this.config,I=[{demux:h.default,remux:E.default},{demux:d.default,remux:p.default},{demux:f.default,remux:E.default},{demux:y.default,remux:E.default}],B=0,X=I.length;B<X;B++){var Q=I[B],J=Q.demux.probe;if(J(A)){var ne=this.remuxer=new Q.remux(z,$,U,this.vendor);q=new Q.demux(z,ne,$,U),this.probe=J;break}}if(!q){z.trigger(a.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});return}this.demuxer=q}var ae=this.remuxer;(D||F)&&(q.resetInitSegment(w,P,O,V),ae.resetInitSegment()),D&&(q.resetTimeStamp(ee),ae.resetTimeStamp(ee)),typeof q.setDecryptData=="function"&&q.setDecryptData(T),q.append(A,k,G,W)},S}();t.default=R},"./src/demux/demuxer-worker.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/demux/demuxer-inline.js"),l=n("./src/events.js"),u=n("./src/utils/logger.js"),f=n("./node_modules/node-libs-browser/node_modules/events/events.js"),d=function(h){var y=new f.EventEmitter;y.trigger=function(_){for(var g=[],x=1;x<arguments.length;x++)g[x-1]=arguments[x];y.emit.apply(y,[_,_].concat(g))},y.off=function(_){for(var g=[],x=1;x<arguments.length;x++)g[x-1]=arguments[x];y.removeListener.apply(y,[_].concat(g))};var E=function(p,_){h.postMessage({event:p,data:_})};h.addEventListener("message",function(p){var _=p.data;switch(_.cmd){case"init":var g=JSON.parse(_.config);h.demuxer=new a.default(y,_.typeSupported,g,_.vendor),u.enableLogs(g.debug),E("init",null);break;case"demux":h.demuxer.push(_.data,_.decryptdata,_.initSegment,_.audioCodec,_.videoCodec,_.timeOffset,_.discontinuity,_.trackSwitch,_.contiguous,_.duration,_.accurateTimeOffset,_.defaultInitPTS);break}}),y.on(l.default.FRAG_DECRYPTED,E),y.on(l.default.FRAG_PARSING_INIT_SEGMENT,E),y.on(l.default.FRAG_PARSED,E),y.on(l.default.ERROR,E),y.on(l.default.FRAG_PARSING_METADATA,E),y.on(l.default.FRAG_PARSING_USERDATA,E),y.on(l.default.INIT_PTS_FOUND,E),y.on(l.default.FRAG_PARSING_DATA,function(p,_){var g=[],x={event:p,data:_};_.data1&&(x.data1=_.data1.buffer,g.push(_.data1.buffer),delete _.data1),_.data2&&(x.data2=_.data2.buffer,g.push(_.data2.buffer),delete _.data2),h.postMessage(x,g)})};t.default=d},"./src/demux/demuxer.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./node_modules/webworkify-webpack/index.js"),u=n("./src/events.js"),f=n("./src/demux/demuxer-inline.js"),d=n("./src/utils/logger.js"),h=n("./src/errors.js"),y=n("./src/utils/mediasource-helper.js"),E=n("./src/utils/get-self-scope.js"),p=n("./src/observer.js"),_=E.getSelfScope(),g=y.getMediaSource(),x=function(){function C(R,S){var A=this;this.hls=R,this.id=S;var T=this.observer=new p.Observer,w=R.config,P=function(F,G){G=G||{},G.frag=A.frag,G.id=A.id,R.trigger(F,G)};T.on(u.default.FRAG_DECRYPTED,P),T.on(u.default.FRAG_PARSING_INIT_SEGMENT,P),T.on(u.default.FRAG_PARSING_DATA,P),T.on(u.default.FRAG_PARSED,P),T.on(u.default.ERROR,P),T.on(u.default.FRAG_PARSING_METADATA,P),T.on(u.default.FRAG_PARSING_USERDATA,P),T.on(u.default.INIT_PTS_FOUND,P);var O={mp4:g.isTypeSupported("video/mp4"),mpeg:g.isTypeSupported("audio/mpeg"),mp3:g.isTypeSupported('audio/mp4; codecs="mp3"')},k=navigator.vendor;if(w.enableWorker&&typeof Worker<"u"){d.logger.log("demuxing in webworker");var D=void 0;try{D=this.w=l("./src/demux/demuxer-worker.js"),this.onwmsg=this.onWorkerMessage.bind(this),D.addEventListener("message",this.onwmsg),D.onerror=function(F){R.trigger(u.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:F.message+" ("+F.filename+":"+F.lineno+")"}})},D.postMessage({cmd:"init",typeSupported:O,vendor:k,id:S,config:JSON.stringify(w)})}catch(F){d.logger.warn("Error in worker:",F),d.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),D&&_.URL.revokeObjectURL(D.objectURL),this.demuxer=new f.default(T,O,w,k),this.w=void 0}}else this.demuxer=new f.default(T,O,w,k)}return C.prototype.destroy=function(){var R=this.w;if(R)R.removeEventListener("message",this.onwmsg),R.terminate(),this.w=null;else{var S=this.demuxer;S&&(S.destroy(),this.demuxer=null)}var A=this.observer;A&&(A.removeAllListeners(),this.observer=null)},C.prototype.push=function(R,S,A,T,w,P,O,k){var D=this.w,F=a.isFinite(w.startPTS)?w.startPTS:w.start,G=w.decryptdata,V=this.frag,W=!(V&&w.cc===V.cc),ee=!(V&&w.level===V.level),q=V&&w.sn===V.sn+1,z=!ee&&q;if(W&&d.logger.log(this.id+":discontinuity detected"),ee&&d.logger.log(this.id+":switch detected"),this.frag=w,D)D.postMessage({cmd:"demux",data:R,decryptdata:G,initSegment:S,audioCodec:A,videoCodec:T,timeOffset:F,discontinuity:W,trackSwitch:ee,contiguous:z,duration:P,accurateTimeOffset:O,defaultInitPTS:k},R instanceof ArrayBuffer?[R]:[]);else{var U=this.demuxer;U&&U.push(R,G,S,A,T,F,W,ee,z,P,O,k)}},C.prototype.onWorkerMessage=function(R){var S=R.data,A=this.hls;switch(S.event){case"init":_.URL.revokeObjectURL(this.w.objectURL);break;case u.default.FRAG_PARSING_DATA:S.data.data1=new Uint8Array(S.data1),S.data2&&(S.data.data2=new Uint8Array(S.data2));default:S.data=S.data||{},S.data.frag=this.frag,S.data.id=this.id,A.trigger(S.event,S.data);break}},C}();t.default=x}).call(this,n("./src/polyfills/number.js").Number)},"./src/demux/exp-golomb.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),l=function(){function u(f){this.data=f,this.bytesAvailable=f.byteLength,this.word=0,this.bitsAvailable=0}return u.prototype.loadWord=function(){var f=this.data,d=this.bytesAvailable,h=f.byteLength-d,y=new Uint8Array(4),E=Math.min(4,d);if(E===0)throw new Error("no bytes available");y.set(f.subarray(h,h+E)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=E*8,this.bytesAvailable-=E},u.prototype.skipBits=function(f){var d;this.bitsAvailable>f?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,d=f>>3,f-=d>>3,this.bytesAvailable-=d,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},u.prototype.readBits=function(f){var d=Math.min(this.bitsAvailable,f),h=this.word>>>32-d;return f>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=d,this.bitsAvailable>0?this.word<<=d:this.bytesAvailable>0&&this.loadWord(),d=f-d,d>0&&this.bitsAvailable?h<<d|this.readBits(d):h},u.prototype.skipLZ=function(){var f;for(f=0;f<this.bitsAvailable;++f)if(this.word&2147483648>>>f)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},u.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},u.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},u.prototype.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},u.prototype.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},u.prototype.readBoolean=function(){return this.readBits(1)===1},u.prototype.readUByte=function(){return this.readBits(8)},u.prototype.readUShort=function(){return this.readBits(16)},u.prototype.readUInt=function(){return this.readBits(32)},u.prototype.skipScalingList=function(f){var d=8,h=8,y,E;for(y=0;y<f;y++)h!==0&&(E=this.readEG(),h=(d+E+256)%256),d=h===0?d:h},u.prototype.readSPS=function(){var f=0,d=0,h=0,y=0,E,p,_,g,x,C,R,S=this.readUByte.bind(this),A=this.readBits.bind(this),T=this.readUEG.bind(this),w=this.readBoolean.bind(this),P=this.skipBits.bind(this),O=this.skipEG.bind(this),k=this.skipUEG.bind(this),D=this.skipScalingList.bind(this);if(S(),E=S(),A(5),P(3),S(),k(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var F=T();if(F===3&&P(1),k(),k(),P(1),w())for(C=F!==3?8:12,R=0;R<C;R++)w()&&(R<6?D(16):D(64))}k();var G=T();if(G===0)T();else if(G===1)for(P(1),O(),O(),p=T(),R=0;R<p;R++)O();k(),P(1),_=T(),g=T(),x=A(1),x===0&&P(1),P(1),w()&&(f=T(),d=T(),h=T(),y=T());var V=[1,1];if(w()&&w()){var W=S();switch(W){case 1:V=[1,1];break;case 2:V=[12,11];break;case 3:V=[10,11];break;case 4:V=[16,11];break;case 5:V=[40,33];break;case 6:V=[24,11];break;case 7:V=[20,11];break;case 8:V=[32,11];break;case 9:V=[80,33];break;case 10:V=[18,11];break;case 11:V=[15,11];break;case 12:V=[64,33];break;case 13:V=[160,99];break;case 14:V=[4,3];break;case 15:V=[3,2];break;case 16:V=[2,1];break;case 255:{V=[S()<<8|S(),S()<<8|S()];break}}}return{width:Math.ceil((_+1)*16-f*2-d*2),height:(2-x)*(g+1)*16-(x?2:4)*(h+y),pixelRatio:V}},u.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},u}();t.default=l},"./src/demux/id3.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function u(){}return u.isHeader=function(f,d){return d+10<=f.length&&f[d]===73&&f[d+1]===68&&f[d+2]===51&&f[d+3]<255&&f[d+4]<255&&f[d+6]<128&&f[d+7]<128&&f[d+8]<128&&f[d+9]<128},u.isFooter=function(f,d){return d+10<=f.length&&f[d]===51&&f[d+1]===68&&f[d+2]===73&&f[d+3]<255&&f[d+4]<255&&f[d+6]<128&&f[d+7]<128&&f[d+8]<128&&f[d+9]<128},u.getID3Data=function(f,d){for(var h=d,y=0;u.isHeader(f,d);){y+=10;var E=u._readSize(f,d+6);y+=E,u.isFooter(f,d+10)&&(y+=10),d+=y}if(y>0)return f.subarray(h,h+y)},u._readSize=function(f,d){var h=0;return h=(f[d]&127)<<21,h|=(f[d+1]&127)<<14,h|=(f[d+2]&127)<<7,h|=f[d+3]&127,h},u.getTimeStamp=function(f){for(var d=u.getID3Frames(f),h=0;h<d.length;h++){var y=d[h];if(u.isTimeStampFrame(y))return u._readTimeStamp(y)}},u.isTimeStampFrame=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},u._getFrameData=function(f){var d=String.fromCharCode(f[0],f[1],f[2],f[3]),h=u._readSize(f,4),y=10;return{type:d,size:h,data:f.subarray(y,y+h)}},u.getID3Frames=function(f){for(var d=0,h=[];u.isHeader(f,d);){var y=u._readSize(f,d+6);d+=10;for(var E=d+y;d+8<E;){var p=u._getFrameData(f.subarray(d)),_=u._decodeFrame(p);_&&h.push(_),d+=p.size+10}u.isFooter(f,d)&&(d+=10)}return h},u._decodeFrame=function(f){if(f.type==="PRIV")return u._decodePrivFrame(f);if(f.type[0]==="T")return u._decodeTextFrame(f);if(f.type[0]==="W")return u._decodeURLFrame(f)},u._readTimeStamp=function(f){if(f.data.byteLength===8){var d=new Uint8Array(f.data),h=d[3]&1,y=(d[4]<<23)+(d[5]<<15)+(d[6]<<7)+d[7];return y/=45,h&&(y+=4772185884e-2),Math.round(y)}},u._decodePrivFrame=function(f){if(!(f.size<2)){var d=u._utf8ArrayToStr(f.data,!0),h=new Uint8Array(f.data.subarray(d.length+1));return{key:f.type,info:d,data:h.buffer}}},u._decodeTextFrame=function(f){if(!(f.size<2))if(f.type==="TXXX"){var d=1,h=u._utf8ArrayToStr(f.data.subarray(d));d+=h.length+1;var y=u._utf8ArrayToStr(f.data.subarray(d));return{key:f.type,info:h,data:y}}else{var E=u._utf8ArrayToStr(f.data.subarray(1));return{key:f.type,data:E}}},u._decodeURLFrame=function(f){if(f.type==="WXXX"){if(f.size<2)return;var d=1,h=u._utf8ArrayToStr(f.data.subarray(d));d+=h.length+1;var y=u._utf8ArrayToStr(f.data.subarray(d));return{key:f.type,info:h,data:y}}else{var E=u._utf8ArrayToStr(f.data);return{key:f.type,data:E}}},u._utf8ArrayToStr=function(f,d){d===void 0&&(d=!1);for(var h=f.length,y,E,p,_="",g=0;g<h;){if(y=f[g++],y===0&&d)return _;if(y===0||y===3)continue;switch(y>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(y);break;case 12:case 13:E=f[g++],_+=String.fromCharCode((y&31)<<6|E&63);break;case 14:E=f[g++],p=f[g++],_+=String.fromCharCode((y&15)<<12|(E&63)<<6|(p&63)<<0);break}}return _},u}(),l=a._utf8ArrayToStr;t.utf8ArrayToStr=l,t.default=a},"./src/demux/mp3demuxer.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/demux/id3.js"),l=n("./src/utils/logger.js"),u=n("./src/demux/mpegaudio.js"),f=function(){function d(h,y,E){this.observer=h,this.config=E,this.remuxer=y}return d.prototype.resetInitSegment=function(h,y,E,p){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:y,duration:p,inputTimeScale:9e4}},d.prototype.resetTimeStamp=function(){},d.probe=function(h){var y,E,p=a.default.getID3Data(h,0);if(p&&a.default.getTimeStamp(p)!==void 0){for(y=p.length,E=Math.min(h.length-1,y+100);y<E;y++)if(u.default.probe(h,y))return l.logger.log("MPEG Audio sync word found !"),!0}return!1},d.prototype.append=function(h,y,E,p){for(var _=a.default.getID3Data(h,0),g=a.default.getTimeStamp(_),x=g?90*g:y*9e4,C=_.length,R=h.length,S=0,A=0,T=this._audioTrack,w=[{pts:x,dts:x,data:_}];C<R;)if(u.default.isHeader(h,C)){var P=u.default.appendFrame(T,h,C,x,S);if(P)C+=P.length,A=P.sample.pts,S++;else break}else a.default.isHeader(h,C)?(_=a.default.getID3Data(h,C),w.push({pts:A,dts:A,data:_}),C+=_.length):C++;this.remuxer.remux(T,{samples:[]},{samples:w,inputTimeScale:9e4},{samples:[]},y,E,p)},d.prototype.destroy=function(){},d}();t.default=f},"./src/demux/mp4demuxer.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),l=n("./src/events.js"),u=Math.pow(2,32)-1,f=function(){function d(h,y){this.observer=h,this.remuxer=y}return d.prototype.resetTimeStamp=function(h){this.initPTS=h},d.prototype.resetInitSegment=function(h,y,E,p){if(h&&h.byteLength){var _=this.initData=d.parseInitSegment(h);y==null&&(y="mp4a.40.5"),E==null&&(E="avc1.42e01e");var g={};_.audio&&_.video?g.audiovideo={container:"video/mp4",codec:y+","+E,initSegment:p?h:null}:(_.audio&&(g.audio={container:"audio/mp4",codec:y,initSegment:p?h:null}),_.video&&(g.video={container:"video/mp4",codec:E,initSegment:p?h:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:g})}else y&&(this.audioCodec=y),E&&(this.videoCodec=E)},d.probe=function(h){return d.findBox({data:h,start:0,end:Math.min(h.length,16384)},["moof"]).length>0},d.bin2str=function(h){return String.fromCharCode.apply(null,h)},d.readUint16=function(h,y){h.data&&(y+=h.start,h=h.data);var E=h[y]<<8|h[y+1];return E<0?65536+E:E},d.readUint32=function(h,y){h.data&&(y+=h.start,h=h.data);var E=h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3];return E<0?4294967296+E:E},d.writeUint32=function(h,y,E){h.data&&(y+=h.start,h=h.data),h[y]=E>>24,h[y+1]=E>>16&255,h[y+2]=E>>8&255,h[y+3]=E&255},d.findBox=function(h,y){var E=[],p,_,g,x,C,R,S;if(h.data?(R=h.start,x=h.end,h=h.data):(R=0,x=h.byteLength),!y.length)return null;for(p=R;p<x;)_=d.readUint32(h,p),g=d.bin2str(h.subarray(p+4,p+8)),S=_>1?p+_:x,g===y[0]&&(y.length===1?E.push({data:h,start:p+8,end:S}):(C=d.findBox({data:h,start:p+8,end:S},y.slice(1)),C.length&&(E=E.concat(C)))),p=S;return E},d.parseSegmentIndex=function(h){var y=d.findBox(h,["moov"])[0],E=y?y.end:null,p=0,_=d.findBox(h,["sidx"]),g;if(!_||!_[0])return null;g=[],_=_[0];var x=_.data[0];p=x===0?8:16;var C=d.readUint32(_,p);p+=4;var R=0,S=0;x===0?p+=8:p+=16,p+=2;var A=_.end+S,T=d.readUint16(_,p);p+=2;for(var w=0;w<T;w++){var P=p,O=d.readUint32(_,P);P+=4;var k=O&2147483647,D=(O&2147483648)>>>31;if(D===1){console.warn("SIDX has hierarchical references (not supported)");return}var F=d.readUint32(_,P);P+=4,g.push({referenceSize:k,subsegmentDuration:F,info:{duration:F/C,start:A,end:A+k-1}}),A+=k,P+=4,p=P}return{earliestPresentationTime:R,timescale:C,version:x,referencesCount:T,references:g,moovEndOffset:E}},d.parseInitSegment=function(h){var y=[],E=d.findBox(h,["moov","trak"]);return E.forEach(function(p){var _=d.findBox(p,["tkhd"])[0];if(_){var g=_.data[_.start],x=g===0?12:20,C=d.readUint32(_,x),R=d.findBox(p,["mdia","mdhd"])[0];if(R){g=R.data[R.start],x=g===0?12:20;var S=d.readUint32(R,x),A=d.findBox(p,["mdia","hdlr"])[0];if(A){var T=d.bin2str(A.data.subarray(A.start+8,A.start+12)),w={soun:"audio",vide:"video"}[T];if(w){var P=d.findBox(p,["mdia","minf","stbl","stsd"]);if(P.length){P=P[0];var O=d.bin2str(P.data.subarray(P.start+12,P.start+16));a.logger.log("MP4Demuxer:"+w+":"+O+" found")}y[C]={timescale:S,type:w},y[w]={timescale:S,id:C}}}}}}),y},d.getStartDTS=function(h,y){var E,p,_;return E=d.findBox(y,["moof","traf"]),p=[].concat.apply([],E.map(function(g){return d.findBox(g,["tfhd"]).map(function(x){var C,R,S;return C=d.readUint32(x,4),R=h[C].timescale||9e4,S=d.findBox(g,["tfdt"]).map(function(A){var T,w;return T=A.data[A.start],w=d.readUint32(A,4),T===1&&(w*=Math.pow(2,32),w+=d.readUint32(A,8)),w})[0],S/R})})),_=Math.min.apply(null,p),isFinite(_)?_:0},d.offsetStartDTS=function(h,y,E){d.findBox(y,["moof","traf"]).map(function(p){return d.findBox(p,["tfhd"]).map(function(_){var g=d.readUint32(_,4),x=h[g].timescale||9e4;d.findBox(p,["tfdt"]).map(function(C){var R=C.data[C.start],S=d.readUint32(C,4);if(R===0)d.writeUint32(C,4,S-E*x);else{S*=Math.pow(2,32),S+=d.readUint32(C,8),S-=E*x,S=Math.max(S,0);var A=Math.floor(S/(u+1)),T=Math.floor(S%(u+1));d.writeUint32(C,4,A),d.writeUint32(C,8,T)}})})})},d.prototype.append=function(h,y,E,p){var _=this.initData;_||(this.resetInitSegment(h,this.audioCodec,this.videoCodec,!1),_=this.initData);var g,x=this.initPTS;if(x===void 0){var C=d.getStartDTS(_,h);this.initPTS=x=C-y,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:x})}d.offsetStartDTS(_,h,x),g=d.getStartDTS(_,h),this.remuxer.remux(_.audio,_.video,null,null,g,E,p,h)},d.prototype.destroy=function(){},d}();t.default=f},"./src/demux/mpegaudio.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(l,u,f,d,h){if(!(f+24>u.length)){var y=this.parseHeader(u,f);if(y&&f+y.frameLength<=u.length){var E=y.samplesPerFrame*9e4/y.sampleRate,p=d+h*E,_={unit:u.subarray(f,f+y.frameLength),pts:p,dts:p};return l.config=[],l.channelCount=y.channelCount,l.samplerate=y.sampleRate,l.samples.push(_),l.len+=y.frameLength,{sample:_,length:y.frameLength}}}},parseHeader:function(l,u){var f=l[u+1]>>3&3,d=l[u+1]>>1&3,h=l[u+2]>>4&15,y=l[u+2]>>2&3,E=l[u+2]>>1&1;if(f!==1&&h!==0&&h!==15&&y!==3){var p=f===3?3-d:d===3?3:4,_=a.BitratesMap[p*14+h-1]*1e3,g=f===3?0:f===2?1:2,x=a.SamplingRateMap[g*3+y],C=l[u+3]>>6===3?1:2,R=a.SamplesCoefficients[f][d],S=a.BytesInSlot[d],A=R*8*S,T=parseInt(R*_/x+E,10)*S;return{sampleRate:x,channelCount:C,frameLength:T,samplesPerFrame:A}}},isHeaderPattern:function(l,u){return l[u]===255&&(l[u+1]&224)===224&&(l[u+1]&6)!==0},isHeader:function(l,u){return!!(u+1<l.length&&this.isHeaderPattern(l,u))},probe:function(l,u){if(u+1<l.length&&this.isHeaderPattern(l,u)){var f=4,d=this.parseHeader(l,u),h=f;d&&d.frameLength&&(h=d.frameLength);var y=u+h;if(y===l.length||y+1<l.length&&this.isHeaderPattern(l,y))return!0}return!1}};t.default=a},"./src/demux/sample-aes.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/crypt/decrypter.js"),l=function(){function u(f,d,h,y){this.decryptdata=h,this.discardEPB=y,this.decrypter=new a.default(f,d,{removePKCS7Padding:!1})}return u.prototype.decryptBuffer=function(f,d){this.decrypter.decrypt(f,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,d)},u.prototype.decryptAacSample=function(f,d,h,y){var E=f[d].unit,p=E.subarray(16,E.length-E.length%16),_=p.buffer.slice(p.byteOffset,p.byteOffset+p.length),g=this;this.decryptBuffer(_,function(x){x=new Uint8Array(x),E.set(x,16),y||g.decryptAacSamples(f,d+1,h)})},u.prototype.decryptAacSamples=function(f,d,h){for(;;d++){if(d>=f.length){h();return}if(!(f[d].unit.length<32)){var y=this.decrypter.isSync();if(this.decryptAacSample(f,d,h,y),!y)return}}},u.prototype.getAvcEncryptedData=function(f){for(var d=Math.floor((f.length-48)/160)*16+16,h=new Int8Array(d),y=0,E=32;E<=f.length-16;E+=160,y+=16)h.set(f.subarray(E,E+16),y);return h},u.prototype.getAvcDecryptedUnit=function(f,d){d=new Uint8Array(d);for(var h=0,y=32;y<=f.length-16;y+=160,h+=16)f.set(d.subarray(h,h+16),y);return f},u.prototype.decryptAvcSample=function(f,d,h,y,E,p){var _=this.discardEPB(E.data),g=this.getAvcEncryptedData(_),x=this;this.decryptBuffer(g.buffer,function(C){E.data=x.getAvcDecryptedUnit(_,C),p||x.decryptAvcSamples(f,d,h+1,y)})},u.prototype.decryptAvcSamples=function(f,d,h,y){for(;;d++,h=0){if(d>=f.length){y();return}for(var E=f[d].units;!(h>=E.length);h++){var p=E[h];if(!(p.length<=48||p.type!==1&&p.type!==5)){var _=this.decrypter.isSync();if(this.decryptAvcSample(f,d,h,y,p,_),!_)return}}}},u}();t.default=l},"./src/demux/tsdemuxer.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/demux/adts.js"),l=n("./src/demux/mpegaudio.js"),u=n("./src/events.js"),f=n("./src/demux/exp-golomb.js"),d=n("./src/demux/sample-aes.js"),h=n("./src/utils/logger.js"),y=n("./src/errors.js"),E={video:1,audio:2,id3:3,text:4},p=function(){function _(g,x,C,R){this.observer=g,this.config=C,this.typeSupported=R,this.remuxer=x,this.sampleAes=null}return _.prototype.setDecryptData=function(g){g!=null&&g.key!=null&&g.method==="SAMPLE-AES"?this.sampleAes=new d.default(this.observer,this.config,g,this.discardEPB):this.sampleAes=null},_.probe=function(g){var x=_._syncOffset(g);return x<0?!1:(x&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},_._syncOffset=function(g){for(var x=Math.min(1e3,g.length-564),C=0;C<x;){if(g[C]===71&&g[C+188]===71&&g[C+2*188]===71)return C;C++}return-1},_.createTrack=function(g,x){return{container:g==="video"||g==="audio"?"video/mp2t":void 0,type:g,id:E[g],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:g==="video"?0:void 0,isAAC:g==="audio"?!0:void 0,duration:g==="audio"?x:void 0}},_.prototype.resetInitSegment=function(g,x,C,R){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=_.createTrack("video",R),this._audioTrack=_.createTrack("audio",R),this._id3Track=_.createTrack("id3",R),this._txtTrack=_.createTrack("text",R),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=x,this.videoCodec=C,this._duration=R},_.prototype.resetTimeStamp=function(){},_.prototype.append=function(g,x,C,R){var S,A=g.length,T,w,P,O,k,D=!1;this.contiguous=C;var F=this.pmtParsed,G=this._avcTrack,V=this._audioTrack,W=this._id3Track,ee=G.pid,q=V.pid,z=W.pid,U=this._pmtId,$=G.pesData,I=V.pesData,B=W.pesData,X=this._parsePAT,Q=this._parsePMT,J=this._parsePES,ne=this._parseAVCPES.bind(this),ae=this._parseAACPES.bind(this),Z=this._parseMPEGPES.bind(this),se=this._parseID3PES.bind(this),oe=_._syncOffset(g);for(A-=(A+oe)%188,S=oe;S<A;S+=188)if(g[S]===71){if(T=!!(g[S+1]&64),w=((g[S+1]&31)<<8)+g[S+2],P=(g[S+3]&48)>>4,P>1){if(O=S+5+g[S+4],O===S+188)continue}else O=S+4;switch(w){case ee:T&&($&&(k=J($))&&k.pts!==void 0&&ne(k,!1),$={data:[],size:0}),$&&($.data.push(g.subarray(O,S+188)),$.size+=S+188-O);break;case q:T&&(I&&(k=J(I))&&k.pts!==void 0&&(V.isAAC?ae(k):Z(k)),I={data:[],size:0}),I&&(I.data.push(g.subarray(O,S+188)),I.size+=S+188-O);break;case z:T&&(B&&(k=J(B))&&k.pts!==void 0&&se(k),B={data:[],size:0}),B&&(B.data.push(g.subarray(O,S+188)),B.size+=S+188-O);break;case 0:T&&(O+=g[O]+1),U=this._pmtId=X(g,O);break;case U:T&&(O+=g[O]+1);var fe=Q(g,O,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);ee=fe.avc,ee>0&&(G.pid=ee),q=fe.audio,q>0&&(V.pid=q,V.isAAC=fe.isAAC),z=fe.id3,z>0&&(W.pid=z),D&&!F&&(h.logger.log("reparse from beginning"),D=!1,S=oe-188),F=this.pmtParsed=!0;break;case 17:case 8191:break;default:D=!0;break}}else this.observer.trigger(u.default.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});$&&(k=J($))&&k.pts!==void 0?(ne(k,!0),G.pesData=null):G.pesData=$,I&&(k=J(I))&&k.pts!==void 0?(V.isAAC?ae(k):Z(k),V.pesData=null):(I&&I.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),V.pesData=I),B&&(k=J(B))&&k.pts!==void 0?(se(k),W.pesData=null):W.pesData=B,this.sampleAes==null?this.remuxer.remux(V,G,W,this._txtTrack,x,C,R):this.decryptAndRemux(V,G,W,this._txtTrack,x,C,R)},_.prototype.decryptAndRemux=function(g,x,C,R,S,A,T){if(g.samples&&g.isAAC){var w=this;this.sampleAes.decryptAacSamples(g.samples,0,function(){w.decryptAndRemuxAvc(g,x,C,R,S,A,T)})}else this.decryptAndRemuxAvc(g,x,C,R,S,A,T)},_.prototype.decryptAndRemuxAvc=function(g,x,C,R,S,A,T){if(x.samples){var w=this;this.sampleAes.decryptAvcSamples(x.samples,0,0,function(){w.remuxer.remux(g,x,C,R,S,A,T)})}else this.remuxer.remux(g,x,C,R,S,A,T)},_.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},_.prototype._parsePAT=function(g,x){return(g[x+10]&31)<<8|g[x+11]},_.prototype._parsePMT=function(g,x,C,R){var S,A,T,w,P={audio:-1,avc:-1,id3:-1,isAAC:!0};for(S=(g[x+1]&15)<<8|g[x+2],A=x+3+S-4,T=(g[x+10]&15)<<8|g[x+11],x+=12+T;x<A;){switch(w=(g[x+1]&31)<<8|g[x+2],g[x]){case 207:if(!R){h.logger.log("unkown stream type:"+g[x]);break}case 15:P.audio===-1&&(P.audio=w);break;case 21:P.id3===-1&&(P.id3=w);break;case 219:if(!R){h.logger.log("unkown stream type:"+g[x]);break}case 27:P.avc===-1&&(P.avc=w);break;case 3:case 4:C?P.audio===-1&&(P.audio=w,P.isAAC=!1):h.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:h.logger.warn("HEVC stream type found, not supported for now");break;default:h.logger.log("unkown stream type:"+g[x]);break}x+=((g[x+3]&15)<<8|g[x+4])+5}return P},_.prototype._parsePES=function(g){var x=0,C,R,S,A,T,w,P,O,k,D=g.data;if(!g||g.size===0)return null;for(;D[0].length<19&&D.length>1;){var F=new Uint8Array(D[0].length+D[1].length);F.set(D[0]),F.set(D[1],D[0].length),D[0]=F,D.splice(1,1)}if(C=D[0],S=(C[0]<<16)+(C[1]<<8)+C[2],S===1){if(A=(C[4]<<8)+C[5],A&&A>g.size-6)return null;R=C[7],R&192&&(P=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,P>4294967295&&(P-=8589934592),R&64?(O=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,O>4294967295&&(O-=8589934592),P-O>60*9e4&&(h.logger.warn(Math.round((P-O)/9e4)+"s delta between PTS and DTS, align them"),P=O)):O=P),T=C[8],k=T+9,g.size-=k,w=new Uint8Array(g.size);for(var G=0,V=D.length;G<V;G++){C=D[G];var W=C.byteLength;if(k)if(k>W){k-=W;continue}else C=C.subarray(k),W-=k,k=0;w.set(C,x),x+=W}return A&&(A-=T+3),{data:w,pts:P,dts:O,len:A}}else return null},_.prototype.pushAccesUnit=function(g,x){if(g.units.length&&g.frame){var C=x.samples,R=C.length;!this.config.forceKeyFrameOnDiscontinuity||g.key===!0||x.sps&&(R||this.contiguous)?(g.id=R,C.push(g)):x.dropped++}g.debug.length&&h.logger.log(g.pts+"/"+g.dts+":"+g.debug)},_.prototype._parseAVCPES=function(g,x){var C=this,R=this._avcTrack,S=this._parseAVCNALu(g.data),A,T=this.avcSample,w,P=!1,O,k=this.pushAccesUnit.bind(this),D=function(F,G,V,W){return{key:F,pts:G,dts:V,units:[],debug:W}};g.data=null,T&&S.length&&!R.audFound&&(k(T,R),T=this.avcSample=D(!1,g.pts,g.dts,"")),S.forEach(function(F){switch(F.type){case 1:w=!0,T||(T=C.avcSample=D(!0,g.pts,g.dts,"")),T.frame=!0;var G=F.data;if(P&&G.length>4){var V=new f.default(G).readSliceType();(V===2||V===4||V===7||V===9)&&(T.key=!0)}break;case 5:w=!0,T||(T=C.avcSample=D(!0,g.pts,g.dts,"")),T.key=!0,T.frame=!0;break;case 6:w=!0,A=new f.default(C.discardEPB(F.data)),A.readUByte();for(var W=0,ee=0,q=!1,z=0;!q&&A.bytesAvailable>1;){W=0;do z=A.readUByte(),W+=z;while(z===255);ee=0;do z=A.readUByte(),ee+=z;while(z===255);if(W===4&&A.bytesAvailable!==0){q=!0;var U=A.readUByte();if(U===181){var $=A.readUShort();if($===49){var I=A.readUInt();if(I===1195456820){var B=A.readUByte();if(B===3){var X=A.readUByte(),Q=A.readUByte(),J=31&X,ne=[X,Q];for(O=0;O<J;O++)ne.push(A.readUByte()),ne.push(A.readUByte()),ne.push(A.readUByte());C._insertSampleInOrder(C._txtTrack.samples,{type:3,pts:g.pts,bytes:ne})}}}}}else if(ee<A.bytesAvailable)for(O=0;O<ee;O++)A.readUByte()}break;case 7:if(w=!0,P=!0,!R.sps){A=new f.default(F.data);var ae=A.readSPS();R.width=ae.width,R.height=ae.height,R.pixelRatio=ae.pixelRatio,R.sps=[F.data],R.duration=C._duration;var Z=F.data.subarray(1,4),se="avc1.";for(O=0;O<3;O++){var oe=Z[O].toString(16);oe.length<2&&(oe="0"+oe),se+=oe}R.codec=se}break;case 8:w=!0,R.pps||(R.pps=[F.data]);break;case 9:w=!1,R.audFound=!0,T&&k(T,R),T=C.avcSample=D(!1,g.pts,g.dts,"");break;case 12:w=!1;break;default:w=!1,T&&(T.debug+="unknown NAL "+F.type+" ");break}if(T&&w){var fe=T.units;fe.push(F)}}),x&&T&&(k(T,R),this.avcSample=null)},_.prototype._insertSampleInOrder=function(g,x){var C=g.length;if(C>0){if(x.pts>=g[C-1].pts)g.push(x);else for(var R=C-1;R>=0;R--)if(x.pts<g[R].pts){g.splice(R,0,x);break}}else g.push(x)},_.prototype._getLastNalUnit=function(){var g=this.avcSample,x;if(!g||g.units.length===0){var C=this._avcTrack,R=C.samples;g=R[R.length-1]}if(g){var S=g.units;x=S[S.length-1]}return x},_.prototype._parseAVCNALu=function(g){var x=0,C=g.byteLength,R,S,A=this._avcTrack,T=A.naluState||0,w=T,P=[],O,k,D=-1,F;for(T===-1&&(D=0,F=g[0]&31,T=0,x=1);x<C;){if(R=g[x++],!T){T=R?0:1;continue}if(T===1){T=R?0:2;continue}if(!R)T=3;else if(R===1){if(D>=0)O={data:g.subarray(D,x-T-1),type:F},P.push(O);else{var G=this._getLastNalUnit();if(G&&(w&&x<=4-w&&G.state&&(G.data=G.data.subarray(0,G.data.byteLength-w)),S=x-T-1,S>0)){var V=new Uint8Array(G.data.byteLength+S);V.set(G.data,0),V.set(g.subarray(0,S),G.data.byteLength),G.data=V}}x<C?(k=g[x]&31,D=x,F=k,T=0):T=-1}else T=0}if(D>=0&&T>=0&&(O={data:g.subarray(D,C),type:F,state:T},P.push(O)),P.length===0){var G=this._getLastNalUnit();if(G){var V=new Uint8Array(G.data.byteLength+g.byteLength);V.set(G.data,0),V.set(g,G.data.byteLength),G.data=V}}return A.naluState=T,P},_.prototype.discardEPB=function(g){for(var x=g.byteLength,C=[],R=1,S,A;R<x-2;)g[R]===0&&g[R+1]===0&&g[R+2]===3?(C.push(R+2),R+=2):R++;if(C.length===0)return g;S=x-C.length,A=new Uint8Array(S);var T=0;for(R=0;R<S;T++,R++)T===C[0]&&(T++,C.shift()),A[R]=g[T];return A},_.prototype._parseAACPES=function(g){var x=this._audioTrack,C=g.data,R=g.pts,S=0,A=this.aacOverFlow,T=this.aacLastPTS,w,P,O,k,D;if(A){var F=new Uint8Array(A.byteLength+C.byteLength);F.set(A,0),F.set(C,A.byteLength),C=F}for(O=S,D=C.length;O<D-1&&!a.isHeader(C,O);O++);if(O){var G=void 0,V=void 0;if(O<D-1?(G="AAC PES did not start with ADTS header,offset:"+O,V=!1):(G="no ADTS header found in AAC PES",V=!0),h.logger.warn("parsing error:"+G),this.observer.trigger(u.default.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:V,reason:G}),V)return}if(a.initTrackConfig(x,this.observer,C,O,this.audioCodec),P=0,w=a.getFrameDuration(x.samplerate),A&&T){var W=T+w;Math.abs(W-R)>1&&(h.logger.log("AAC: align PTS for overlapping frames by "+Math.round((W-R)/90)),R=W)}for(;O<D;)if(a.isHeader(C,O)&&O+5<D){var ee=a.appendFrame(x,C,O,R,P);if(ee)O+=ee.length,k=ee.sample.pts,P++;else break}else O++;O<D?A=C.subarray(O,D):A=null,this.aacOverFlow=A,this.aacLastPTS=k},_.prototype._parseMPEGPES=function(g){for(var x=g.data,C=x.length,R=0,S=0,A=g.pts;S<C;)if(l.default.isHeader(x,S)){var T=l.default.appendFrame(this._audioTrack,x,S,A,R);if(T)S+=T.length,R++;else break}else S++},_.prototype._parseID3PES=function(g){this._id3Track.samples.push(g)},_}();t.default=p},"./src/errors.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},"./src/event-handler.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),l=n("./src/errors.js"),u=n("./src/events.js"),f={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},d=function(){function h(y){for(var E=[],p=1;p<arguments.length;p++)E[p-1]=arguments[p];this.hls=y,this.onEvent=this.onEvent.bind(this),this.handledEvents=E,this.useGenericHandler=!0,this.registerListeners()}return h.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},h.prototype.onHandlerDestroying=function(){},h.prototype.onHandlerDestroyed=function(){},h.prototype.isEventHandler=function(){return typeof this.handledEvents=="object"&&this.handledEvents.length&&typeof this.onEvent=="function"},h.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(y){if(f[y])throw new Error("Forbidden event-name: "+y);this.hls.on(y,this.onEvent)},this)},h.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(y){this.hls.off(y,this.onEvent)},this)},h.prototype.onEvent=function(y,E){this.onEventGeneric(y,E)},h.prototype.onEventGeneric=function(y,E){var p=function(_,g){var x="on"+_.replace("hls","");if(typeof this[x]!="function")throw new Error("Event "+_+" has no generic handler in this "+this.constructor.name+" class (tried "+x+")");return this[x].bind(this,g)};try{p.call(this,y,E).call()}catch(_){a.logger.error("An internal error happened while handling event "+y+'. Error message: "'+_.message+'". Here is a stacktrace:',_),this.hls.trigger(u.default.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,err:_})}},h}();t.default=d},"./src/events.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"};t.default=a},"./src/hls.js":function(r,t,n){var a=this&&this.__extends||function(){var T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,P){w.__proto__=P}||function(w,P){for(var O in P)P.hasOwnProperty(O)&&(w[O]=P[O])};return function(w,P){T(w,P);function O(){this.constructor=w}w.prototype=P===null?Object.create(P):(O.prototype=P.prototype,new O)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./node_modules/url-toolkit/src/url-toolkit.js"),u=n("./src/errors.js"),f=n("./src/loader/playlist-loader.js"),d=n("./src/loader/fragment-loader.js"),h=n("./src/loader/key-loader.js"),y=n("./src/controller/fragment-tracker.js"),E=n("./src/controller/stream-controller.js"),p=n("./src/controller/level-controller.js"),_=n("./src/controller/id3-track-controller.js"),g=n("./src/is-supported.js"),x=n("./src/utils/logger.js"),C=n("./src/config.js"),R=n("./src/events.js"),S=n("./src/observer.js"),A=function(T){a(w,T);function w(P){P===void 0&&(P={});var O=T.call(this)||this,k=w.DefaultConfig;if((P.liveSyncDurationCount||P.liveMaxLatencyDurationCount)&&(P.liveSyncDuration||P.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var D in k)D in P||(P[D]=k[D]);if(P.liveMaxLatencyDurationCount!==void 0&&P.liveMaxLatencyDurationCount<=P.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(P.liveMaxLatencyDuration!==void 0&&(P.liveMaxLatencyDuration<=P.liveSyncDuration||P.liveSyncDuration===void 0))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');x.enableLogs(P.debug),O.config=P,O._autoLevelCapping=-1;var F=O.abrController=new P.abrController(O),G=new P.bufferController(O),V=new P.capLevelController(O),W=new P.fpsController(O),ee=new f.default(O),q=new d.default(O),z=new h.default(O),U=new _.default(O),$=O.levelController=new p.default(O),I=new y.FragmentTracker(O),B=O.streamController=new E.default(O,I),X=[$,B],Q=P.audioStreamController;Q&&X.push(new Q(O,I)),O.networkControllers=X;var J=[ee,q,z,F,G,V,W,U,I];if(Q=P.audioTrackController,Q){var ne=new Q(O);O.audioTrackController=ne,J.push(ne)}if(Q=P.subtitleTrackController,Q){var ae=new Q(O);O.subtitleTrackController=ae,X.push(ae)}if(Q=P.emeController,Q){var Z=new Q(O);O.emeController=Z,J.push(Z)}return Q=P.subtitleStreamController,Q&&X.push(new Q(O,I)),Q=P.timelineController,Q&&J.push(new Q(O)),O.coreComponents=J,O}return Object.defineProperty(w,"version",{get:function(){return"0.12.4"},enumerable:!0,configurable:!0}),w.isSupported=function(){return g.isSupported()},Object.defineProperty(w,"Events",{get:function(){return R.default},enumerable:!0,configurable:!0}),Object.defineProperty(w,"ErrorTypes",{get:function(){return u.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(w,"ErrorDetails",{get:function(){return u.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(w,"DefaultConfig",{get:function(){return w.defaultConfig?w.defaultConfig:C.hlsDefaultConfig},set:function(P){w.defaultConfig=P},enumerable:!0,configurable:!0}),w.prototype.destroy=function(){x.logger.log("destroy"),this.trigger(R.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(P){P.destroy()}),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},w.prototype.attachMedia=function(P){x.logger.log("attachMedia"),this.media=P,this.trigger(R.default.MEDIA_ATTACHING,{media:P})},w.prototype.detachMedia=function(){x.logger.log("detachMedia"),this.trigger(R.default.MEDIA_DETACHING),this.media=null},w.prototype.loadSource=function(P){P=l.buildAbsoluteURL(window.location.href,P,{alwaysNormalize:!0}),x.logger.log("loadSource:"+P),this.url=P,this.trigger(R.default.MANIFEST_LOADING,{url:P})},w.prototype.startLoad=function(P){P===void 0&&(P=-1),x.logger.log("startLoad("+P+")"),this.networkControllers.forEach(function(O){O.startLoad(P)})},w.prototype.stopLoad=function(){x.logger.log("stopLoad"),this.networkControllers.forEach(function(P){P.stopLoad()})},w.prototype.swapAudioCodec=function(){x.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.prototype.recoverMediaError=function(){x.logger.log("recoverMediaError");var P=this.media;this.detachMedia(),this.attachMedia(P)},Object.defineProperty(w.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(P){x.logger.log("set currentLevel:"+P),this.loadLevel=P,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(P){x.logger.log("set nextLevel:"+P),this.levelController.manualLevel=P,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(P){x.logger.log("set loadLevel:"+P),this.levelController.manualLevel=P},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(P){this.levelController.nextLoadLevel=P},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(P){x.logger.log("set firstLevel:"+P),this.levelController.firstLevel=P},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(P){x.logger.log("set startLevel:"+P);var O=this;P!==-1&&(P=Math.max(P,O.minAutoLevel)),O.levelController.startLevel=P},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(P){x.logger.log("set autoLevelCapping:"+P),this._autoLevelCapping=P},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"autoLevelEnabled",{get:function(){return this.levelController.manualLevel===-1},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"minAutoLevel",{get:function(){for(var P=this,O=P.levels,k=P.config.minAutoBitrate,D=O?O.length:0,F=0;F<D;F++){var G=O[F].realBitrate?Math.max(O[F].realBitrate,O[F].bitrate):O[F].bitrate;if(G>k)return F}return 0},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"maxAutoLevel",{get:function(){var P=this,O=P.levels,k=P.autoLevelCapping,D;return k===-1&&O&&O.length?D=O.length-1:D=k,D},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"nextAutoLevel",{get:function(){var P=this;return Math.min(Math.max(P.abrController.nextAutoLevel,P.minAutoLevel),P.maxAutoLevel)},set:function(P){var O=this;O.abrController.nextAutoLevel=Math.max(O.minAutoLevel,P)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"audioTracks",{get:function(){var P=this.audioTrackController;return P?P.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"audioTrack",{get:function(){var P=this.audioTrackController;return P?P.audioTrack:-1},set:function(P){var O=this.audioTrackController;O&&(O.audioTrack=P)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"subtitleTracks",{get:function(){var P=this.subtitleTrackController;return P?P.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"subtitleTrack",{get:function(){var P=this.subtitleTrackController;return P?P.subtitleTrack:-1},set:function(P){var O=this.subtitleTrackController;O&&(O.subtitleTrack=P)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"subtitleDisplay",{get:function(){var P=this.subtitleTrackController;return P?P.subtitleDisplay:!1},set:function(P){var O=this.subtitleTrackController;O&&(O.subtitleDisplay=P)},enumerable:!0,configurable:!0}),w}(S.Observer);t.default=A},"./src/is-supported.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/mediasource-helper.js");function l(){var u=a.getMediaSource(),f=window.SourceBuffer||window.WebKitSourceBuffer,d=u&&typeof u.isTypeSupported=="function"&&u.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),h=!f||f.prototype&&typeof f.prototype.appendBuffer=="function"&&typeof f.prototype.remove=="function";return!!d&&!!h}t.isSupported=l},"./src/loader/fragment-loader.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,_){p.__proto__=_}||function(p,_){for(var g in _)_.hasOwnProperty(g)&&(p[g]=_[g])};return function(p,_){E(p,_);function g(){this.constructor=p}p.prototype=_===null?Object.create(_):(g.prototype=_.prototype,new g)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/errors.js"),h=n("./src/utils/logger.js"),y=function(E){l(p,E);function p(_){var g=E.call(this,_,u.default.FRAG_LOADING)||this;return g.loaders={},g}return p.prototype.destroy=function(){var _=this.loaders;for(var g in _){var x=_[g];x&&x.destroy()}this.loaders={},E.prototype.destroy.call(this)},p.prototype.onFragLoading=function(_){var g=_.frag,x=g.type,C=this.loaders,R=this.hls.config,S=R.fLoader,A=R.loader;g.loaded=0;var T=C[x];T&&(h.logger.warn("abort previous fragment loader for type: "+x),T.abort()),T=C[x]=g.loader=R.fLoader?new S(R):new A(R);var w,P,O;w={url:g.url,frag:g,responseType:"arraybuffer",progressData:!1};var k=g.byteRangeStartOffset,D=g.byteRangeEndOffset;a.isFinite(k)&&a.isFinite(D)&&(w.rangeStart=k,w.rangeEnd=D),P={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},T.load(w,P,O)},p.prototype.loadsuccess=function(_,g,x,C){C===void 0&&(C=null);var R=_.data,S=x.frag;S.loader=void 0,this.loaders[S.type]=void 0,this.hls.trigger(u.default.FRAG_LOADED,{payload:R,frag:S,stats:g,networkDetails:C})},p.prototype.loaderror=function(_,g,x){x===void 0&&(x=null);var C=g.frag,R=C.loader;R&&R.abort(),this.loaders[C.type]=void 0,this.hls.trigger(u.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g.frag,response:_,networkDetails:x})},p.prototype.loadtimeout=function(_,g,x){x===void 0&&(x=null);var C=g.frag,R=C.loader;R&&R.abort(),this.loaders[C.type]=void 0,this.hls.trigger(u.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:g.frag,networkDetails:x})},p.prototype.loadprogress=function(_,g,x,C){C===void 0&&(C=null);var R=g.frag;R.loaded=_.loaded,this.hls.trigger(u.default.FRAG_LOAD_PROGRESS,{frag:R,stats:_,networkDetails:C})},p}(f.default);t.default=y}).call(this,n("./src/polyfills/number.js").Number)},"./src/loader/fragment.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./node_modules/url-toolkit/src/url-toolkit.js"),u=n("./src/loader/level-key.js"),f=function(){function d(){var h;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=(h={},h[d.ElementaryStreamTypes.AUDIO]=!1,h[d.ElementaryStreamTypes.VIDEO]=!1,h)}return Object.defineProperty(d,"ElementaryStreamTypes",{get:function(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"url",{get:function(){return!this._url&&this.relurl&&(this._url=l.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(h){this._url=h},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"byteRange",{get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var h=[];if(this.rawByteRange){var y=this.rawByteRange.split("@",2);if(y.length===1){var E=this.lastByteRangeEndOffset;h[0]=E||0}else h[0]=parseInt(y[1]);h[1]=parseInt(y[0])+h[0],this._byteRange=h}return h},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"byteRangeStartOffset",{get:function(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"byteRangeEndOffset",{get:function(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"decryptdata",{get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"endProgramDateTime",{get:function(){if(!a.isFinite(this.programDateTime))return null;var h=a.isFinite(this.duration)?this.duration:0;return this.programDateTime+h*1e3},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"encrypted",{get:function(){return!!(this.decryptdata&&this.decryptdata.uri!==null&&this.decryptdata.key===null)},enumerable:!0,configurable:!0}),d.prototype.addElementaryStream=function(h){this._elementaryStreams[h]=!0},d.prototype.hasElementaryStream=function(h){return this._elementaryStreams[h]===!0},d.prototype.createInitializationVector=function(h){for(var y=new Uint8Array(16),E=12;E<16;E++)y[E]=h>>8*(15-E)&255;return y},d.prototype.fragmentDecryptdataFromLevelkey=function(h,y){var E=h;return h&&h.method&&h.uri&&!h.iv&&(E=new u.default,E.method=h.method,E.baseuri=h.baseuri,E.reluri=h.reluri,E.iv=this.createInitializationVector(y)),E},d}();t.default=f}).call(this,n("./src/polyfills/number.js").Number)},"./src/loader/key-loader.js":function(r,t,n){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,p){E.__proto__=p}||function(E,p){for(var _ in p)p.hasOwnProperty(_)&&(E[_]=p[_])};return function(E,p){y(E,p);function _(){this.constructor=E}E.prototype=p===null?Object.create(p):(_.prototype=p.prototype,new _)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/events.js"),u=n("./src/event-handler.js"),f=n("./src/errors.js"),d=n("./src/utils/logger.js"),h=function(y){a(E,y);function E(p){var _=y.call(this,p,l.default.KEY_LOADING)||this;return _.loaders={},_.decryptkey=null,_.decrypturl=null,_}return E.prototype.destroy=function(){for(var p in this.loaders){var _=this.loaders[p];_&&_.destroy()}this.loaders={},u.default.prototype.destroy.call(this)},E.prototype.onKeyLoading=function(p){var _=p.frag,g=_.type,x=this.loaders[g],C=_.decryptdata,R=C.uri;if(R!==this.decrypturl||this.decryptkey===null){var S=this.hls.config;x&&(d.logger.warn("abort previous key loader for type:"+g),x.abort()),_.loader=this.loaders[g]=new S.loader(S),this.decrypturl=R,this.decryptkey=null;var A=void 0,T=void 0,w=void 0;A={url:R,frag:_,responseType:"arraybuffer"},T={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:S.fragLoadingRetryDelay,maxRetryDelay:S.fragLoadingMaxRetryTimeout},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},_.loader.load(A,T,w)}else this.decryptkey&&(C.key=this.decryptkey,this.hls.trigger(l.default.KEY_LOADED,{frag:_}))},E.prototype.loadsuccess=function(p,_,g){var x=g.frag;this.decryptkey=x.decryptdata.key=new Uint8Array(p.data),x.loader=void 0,this.loaders[x.type]=void 0,this.hls.trigger(l.default.KEY_LOADED,{frag:x})},E.prototype.loaderror=function(p,_){var g=_.frag,x=g.loader;x&&x.abort(),this.loaders[_.type]=void 0,this.hls.trigger(l.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:g,response:p})},E.prototype.loadtimeout=function(p,_){var g=_.frag,x=g.loader;x&&x.abort(),this.loaders[_.type]=void 0,this.hls.trigger(l.default.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:g})},E}(u.default);t.default=h},"./src/loader/level-key.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./node_modules/url-toolkit/src/url-toolkit.js"),l=function(){function u(){this.method=null,this.key=null,this.iv=null,this._uri=null}return Object.defineProperty(u.prototype,"uri",{get:function(){return!this._uri&&this.reluri&&(this._uri=a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),u}();t.default=l},"./src/loader/level.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function u(f){this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=f,this.version=null}return Object.defineProperty(u.prototype,"hasProgramDateTime",{get:function(){return!!(this.fragments[0]&&a.isFinite(this.fragments[0].programDateTime))},enumerable:!0,configurable:!0}),u}();t.default=l}).call(this,n("./src/polyfills/number.js").Number)},"./src/loader/m3u8-parser.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./node_modules/url-toolkit/src/url-toolkit.js"),u=n("./src/loader/fragment.js"),f=n("./src/loader/level.js"),d=n("./src/loader/level-key.js"),h=n("./src/utils/attr-list.js"),y=n("./src/utils/logger.js"),E=n("./src/utils/codecs.js"),p=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,_=/#EXT-X-MEDIA:(.*)/g,g=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),x=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,C=/\.(mp4|m4s|m4v|m4a)$/i,R=function(){function T(){}return T.findGroup=function(w,P){if(!w)return null;for(var O=null,k=0;k<w.length;k++){var D=w[k];D.id===P&&(O=D)}return O},T.convertAVC1ToAVCOTI=function(w){var P,O=w.split(".");return O.length>2?(P=O.shift()+".",P+=parseInt(O.shift()).toString(16),P+=("000"+parseInt(O.shift()).toString(16)).substr(-4)):P=w,P},T.resolve=function(w,P){return l.buildAbsoluteURL(P,w,{alwaysNormalize:!0})},T.parseMasterPlaylist=function(w,P){var O=[],k;p.lastIndex=0;function D(W,ee){["video","audio"].forEach(function(q){var z=W.filter(function($){return E.isCodecType($,q)});if(z.length){var U=z.filter(function($){return $.lastIndexOf("avc1",0)===0||$.lastIndexOf("mp4a",0)===0});ee[q+"Codec"]=U.length>0?U[0]:z[0],W=W.filter(function($){return z.indexOf($)===-1})}}),ee.unknownCodecs=W}for(;(k=p.exec(w))!=null;){var F={},G=F.attrs=new h.default(k[1]);F.url=T.resolve(k[2],P);var V=G.decimalResolution("RESOLUTION");V&&(F.width=V.width,F.height=V.height),F.bitrate=G.decimalInteger("AVERAGE-BANDWIDTH")||G.decimalInteger("BANDWIDTH"),F.name=G.NAME,D([].concat((G.CODECS||"").split(/[ ,]+/)),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=T.convertAVC1ToAVCOTI(F.videoCodec)),O.push(F)}return O},T.parseMasterPlaylistMedia=function(w,P,O,k){k===void 0&&(k=[]);var D,F=[],G=0;for(_.lastIndex=0;(D=_.exec(w))!==null;){var V={},W=new h.default(D[1]);if(W.TYPE===O){if(V.groupId=W["GROUP-ID"],V.name=W.NAME,V.type=O,V.default=W.DEFAULT==="YES",V.autoselect=W.AUTOSELECT==="YES",V.forced=W.FORCED==="YES",W.URI&&(V.url=T.resolve(W.URI,P)),V.lang=W.LANGUAGE,V.name||(V.name=V.lang),k.length){var ee=T.findGroup(k,V.groupId);V.audioCodec=ee?ee.codec:k[0].codec}V.id=G++,F.push(V)}}return F},T.parseLevelPlaylist=function(w,P,O,k,D){var F=0,G=0,V=new f.default(P),W=new d.default,ee=0,q=null,z=new u.default,U,$,I=null;for(g.lastIndex=0;(U=g.exec(w))!==null;){var B=U[1];if(B){z.duration=parseFloat(B);var X=(" "+U[2]).slice(1);z.title=X||null,z.tagList.push(X?["INF",B,X]:["INF",B])}else if(U[3]){if(a.isFinite(z.duration)){var Q=F++;z.type=k,z.start=G,z.levelkey=W,z.sn=Q,z.level=O,z.cc=ee,z.urlId=D,z.baseurl=P,z.relurl=(" "+U[3]).slice(1),A(z,q),V.fragments.push(z),q=z,G+=z.duration,z=new u.default}}else if(U[4]){if(z.rawByteRange=(" "+U[4]).slice(1),q){var J=q.byteRangeEndOffset;J&&(z.lastByteRangeEndOffset=J)}}else if(U[5])z.rawProgramDateTime=(" "+U[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),I===null&&(I=V.fragments.length);else{for(U=U[0].match(x),$=1;$<U.length&&U[$]===void 0;$++);var ne=(" "+U[$+1]).slice(1),ae=(" "+U[$+2]).slice(1);switch(U[$]){case"#":z.tagList.push(ae?[ne,ae]:[ne]);break;case"PLAYLIST-TYPE":V.type=ne.toUpperCase();break;case"MEDIA-SEQUENCE":F=V.startSN=parseInt(ne);break;case"TARGETDURATION":V.targetduration=parseFloat(ne);break;case"VERSION":V.version=parseInt(ne);break;case"EXTM3U":break;case"ENDLIST":V.live=!1;break;case"DIS":ee++,z.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":ee=parseInt(ne);break;case"KEY":var Z=ne,se=new h.default(Z),oe=se.enumeratedString("METHOD"),fe=se.URI,de=se.hexadecimalInteger("IV");oe&&(W=new d.default,fe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(oe)>=0&&(W.method=oe,W.baseuri=P,W.reluri=fe,W.key=null,W.iv=de));break;case"START":var ce=ne,Se=new h.default(ce),Le=Se.decimalFloatingPoint("TIME-OFFSET");a.isFinite(Le)&&(V.startTimeOffset=Le);break;case"MAP":var Ne=new h.default(ne);z.relurl=Ne.URI,z.rawByteRange=Ne.BYTERANGE,z.baseurl=P,z.level=O,z.type=k,z.sn="initSegment",V.initSegment=z,z=new u.default,z.rawProgramDateTime=V.initSegment.rawProgramDateTime;break;default:y.logger.warn("line parsed but not handled: "+U);break}}}return z=q,z&&!z.relurl&&(V.fragments.pop(),G-=z.duration),V.totalduration=G,V.averagetargetduration=G/V.fragments.length,V.endSN=F-1,V.startCC=V.fragments[0]?V.fragments[0].cc:0,V.endCC=ee,!V.initSegment&&V.fragments.length&&V.fragments.every(function(He){return C.test(He.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new u.default,z.relurl=V.fragments[0].relurl,z.baseurl=P,z.level=O,z.type=k,z.sn="initSegment",V.initSegment=z,V.needSidxRanges=!0),I&&S(V.fragments,I),V},T}();t.default=R;function S(T,w){for(var P=T[w],O=w-1;O>=0;O--){var k=T[O];k.programDateTime=P.programDateTime-k.duration*1e3,P=k}}function A(T,w){T.rawProgramDateTime?T.programDateTime=Date.parse(T.rawProgramDateTime):w&&w.programDateTime&&(T.programDateTime=w.endProgramDateTime),a.isFinite(T.programDateTime)||(T.programDateTime=null,T.rawProgramDateTime=null)}}).call(this,n("./src/polyfills/number.js").Number)},"./src/loader/playlist-loader.js":function(r,t,n){(function(a){var l=this&&this.__extends||function(){var C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,S){R.__proto__=S}||function(R,S){for(var A in S)S.hasOwnProperty(A)&&(R[A]=S[A])};return function(R,S){C(R,S);function A(){this.constructor=R}R.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var u=n("./src/events.js"),f=n("./src/event-handler.js"),d=n("./src/errors.js"),h=n("./src/utils/logger.js"),y=n("./src/demux/mp4demuxer.js"),E=n("./src/loader/m3u8-parser.js"),p=window.performance,_={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},g={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},x=function(C){l(R,C);function R(S){var A=C.call(this,S,u.default.MANIFEST_LOADING,u.default.LEVEL_LOADING,u.default.AUDIO_TRACK_LOADING,u.default.SUBTITLE_TRACK_LOADING)||this;return A.loaders={},A}return Object.defineProperty(R,"ContextType",{get:function(){return _},enumerable:!0,configurable:!0}),Object.defineProperty(R,"LevelType",{get:function(){return g},enumerable:!0,configurable:!0}),R.canHaveQualityLevels=function(S){return S!==_.AUDIO_TRACK&&S!==_.SUBTITLE_TRACK},R.mapContextToLevelType=function(S){var A=S.type;switch(A){case _.AUDIO_TRACK:return g.AUDIO;case _.SUBTITLE_TRACK:return g.SUBTITLE;default:return g.MAIN}},R.getResponseUrl=function(S,A){var T=S.url;return(T===void 0||T.indexOf("data:")===0)&&(T=A.url),T},R.prototype.createInternalLoader=function(S){var A=this.hls.config,T=A.pLoader,w=A.loader,P=T||w,O=new P(A);return S.loader=O,this.loaders[S.type]=O,O},R.prototype.getInternalLoader=function(S){return this.loaders[S.type]},R.prototype.resetInternalLoader=function(S){this.loaders[S]&&delete this.loaders[S]},R.prototype.destroyInternalLoaders=function(){for(var S in this.loaders){var A=this.loaders[S];A&&A.destroy(),this.resetInternalLoader(S)}},R.prototype.destroy=function(){this.destroyInternalLoaders(),C.prototype.destroy.call(this)},R.prototype.onManifestLoading=function(S){this.load(S.url,{type:_.MANIFEST,level:0,id:null})},R.prototype.onLevelLoading=function(S){this.load(S.url,{type:_.LEVEL,level:S.level,id:S.id})},R.prototype.onAudioTrackLoading=function(S){this.load(S.url,{type:_.AUDIO_TRACK,level:null,id:S.id})},R.prototype.onSubtitleTrackLoading=function(S){this.load(S.url,{type:_.SUBTITLE_TRACK,level:null,id:S.id})},R.prototype.load=function(S,A){var T=this.hls.config;h.logger.debug("Loading playlist of type "+A.type+", level: "+A.level+", id: "+A.id);var w=this.getInternalLoader(A);if(w){var P=w.context;if(P&&P.url===S)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+A.type),w.abort()}var O,k,D,F;switch(A.type){case _.MANIFEST:O=T.manifestLoadingMaxRetry,k=T.manifestLoadingTimeOut,D=T.manifestLoadingRetryDelay,F=T.manifestLoadingMaxRetryTimeout;break;case _.LEVEL:O=0,k=T.levelLoadingTimeOut;break;default:O=T.levelLoadingMaxRetry,k=T.levelLoadingTimeOut,D=T.levelLoadingRetryDelay,F=T.levelLoadingMaxRetryTimeout;break}w=this.createInternalLoader(A),A.url=S,A.responseType=A.responseType||"";var G={timeout:k,maxRetry:O,retryDelay:D,maxRetryDelay:F},V={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return h.logger.debug("Calling internal loader delegate for URL: "+S),w.load(A,G,V),!0},R.prototype.loadsuccess=function(S,A,T,w){if(w===void 0&&(w=null),T.isSidxRequest){this._handleSidxRequest(S,T),this._handlePlaylistLoaded(S,A,T,w);return}this.resetInternalLoader(T.type);var P=S.data;if(A.tload=p.now(),P.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(S,T,"no EXTM3U delimiter",w);return}P.indexOf("#EXTINF:")>0||P.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(S,A,T,w):this._handleMasterPlaylist(S,A,T,w)},R.prototype.loaderror=function(S,A,T){T===void 0&&(T=null),this._handleNetworkError(A,T,!1,S)},R.prototype.loadtimeout=function(S,A,T){T===void 0&&(T=null),this._handleNetworkError(A,T,!0)},R.prototype._handleMasterPlaylist=function(S,A,T,w){var P=this.hls,O=S.data,k=R.getResponseUrl(S,T),D=E.default.parseMasterPlaylist(O,k);if(!D.length){this._handleManifestParsingError(S,T,"no level found in manifest",w);return}var F=D.map(function(ee){return{id:ee.attrs.AUDIO,codec:ee.audioCodec}}),G=E.default.parseMasterPlaylistMedia(O,k,"AUDIO",F),V=E.default.parseMasterPlaylistMedia(O,k,"SUBTITLES");if(G.length){var W=!1;G.forEach(function(ee){ee.url||(W=!0)}),W===!1&&D[0].audioCodec&&!D[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),G.unshift({type:"main",name:"main"}))}P.trigger(u.default.MANIFEST_LOADED,{levels:D,audioTracks:G,subtitles:V,url:k,stats:A,networkDetails:w})},R.prototype._handleTrackOrLevelPlaylist=function(S,A,T,w){var P=this.hls,O=T.id,k=T.level,D=T.type,F=R.getResponseUrl(S,T),G=a.isFinite(O)?O:0,V=a.isFinite(k)?k:G,W=R.mapContextToLevelType(T),ee=E.default.parseLevelPlaylist(S.data,F,V,W,G);if(ee.tload=A.tload,D===_.MANIFEST){var q={url:F,details:ee};P.trigger(u.default.MANIFEST_LOADED,{levels:[q],audioTracks:[],url:F,stats:A,networkDetails:w})}if(A.tparsed=p.now(),ee.needSidxRanges){var z=ee.initSegment.url;this.load(z,{isSidxRequest:!0,type:D,level:k,levelDetails:ee,id:O,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}T.levelDetails=ee,this._handlePlaylistLoaded(S,A,T,w)},R.prototype._handleSidxRequest=function(S,A){var T=y.default.parseSegmentIndex(new Uint8Array(S.data));if(T){var w=T.references,P=A.levelDetails;w.forEach(function(O,k){var D=O.info,F=P.fragments[k];F.byteRange.length===0&&(F.rawByteRange=String(1+D.end-D.start)+"@"+String(D.start))}),P.initSegment.rawByteRange=String(T.moovEndOffset)+"@0"}},R.prototype._handleManifestParsingError=function(S,A,T,w){this.hls.trigger(u.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:S.url,reason:T,networkDetails:w})},R.prototype._handleNetworkError=function(S,A,T,w){T===void 0&&(T=!1),w===void 0&&(w=null),h.logger.info("A network error occured while loading a "+S.type+"-type playlist");var P,O,k=this.getInternalLoader(S);switch(S.type){case _.MANIFEST:P=T?d.ErrorDetails.MANIFEST_LOAD_TIMEOUT:d.ErrorDetails.MANIFEST_LOAD_ERROR,O=!0;break;case _.LEVEL:P=T?d.ErrorDetails.LEVEL_LOAD_TIMEOUT:d.ErrorDetails.LEVEL_LOAD_ERROR,O=!1;break;case _.AUDIO_TRACK:P=T?d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,O=!1;break;default:O=!1}k&&(k.abort(),this.resetInternalLoader(S.type));var D={type:d.ErrorTypes.NETWORK_ERROR,details:P,fatal:O,url:k.url,loader:k,context:S,networkDetails:A};w&&(D.response=w),this.hls.trigger(u.default.ERROR,D)},R.prototype._handlePlaylistLoaded=function(S,A,T,w){var P=T.type,O=T.level,k=T.id,D=T.levelDetails;if(!D.targetduration){this._handleManifestParsingError(S,T,"invalid target duration",w);return}var F=R.canHaveQualityLevels(T.type);if(F)this.hls.trigger(u.default.LEVEL_LOADED,{details:D,level:O||0,id:k||0,stats:A,networkDetails:w});else switch(P){case _.AUDIO_TRACK:this.hls.trigger(u.default.AUDIO_TRACK_LOADED,{details:D,id:k,stats:A,networkDetails:w});break;case _.SUBTITLE_TRACK:this.hls.trigger(u.default.SUBTITLE_TRACK_LOADED,{details:D,id:k,stats:A,networkDetails:w});break}},R}(f.default);t.default=x}).call(this,n("./src/polyfills/number.js").Number)},"./src/observer.js":function(r,t,n){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var y in h)h.hasOwnProperty(y)&&(d[y]=h[y])};return function(d,h){f(d,h);function y(){this.constructor=d}d.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./node_modules/eventemitter3/index.js"),u=function(f){a(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.trigger=function(h){for(var y=[],E=1;E<arguments.length;E++)y[E-1]=arguments[E];this.emit.apply(this,[h,h].concat(y))},d}(l.EventEmitter);t.Observer=u},"./src/polyfills/number.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/get-self-scope.js"),l=a.getSelfScope(),u=l.Number;t.Number=u,u.isFinite=u.isFinite||function(f){return typeof f=="number"&&isFinite(f)}},"./src/remux/aac-helper.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(){}return l.getSilentFrame=function(u,f){switch(u){case"mp4a.40.2":if(f===1)return new Uint8Array([0,200,0,128,35,128]);if(f===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(f===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(f===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(f===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(f===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(f===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(f===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(f===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return null},l}();t.default=a},"./src/remux/mp4-generator.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=Math.pow(2,32)-1,l=function(){function u(){}return u.init=function(){u.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var f;for(f in u.types)u.types.hasOwnProperty(f)&&(u.types[f]=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)]);var d=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),h=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);u.HDLR_TYPES={video:d,audio:h};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0]);u.STTS=u.STSC=u.STCO=E,u.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),u.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),u.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),u.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),_=new Uint8Array([97,118,99,49]),g=new Uint8Array([0,0,0,1]);u.FTYP=u.box(u.types.ftyp,p,g,p,_),u.DINF=u.box(u.types.dinf,u.box(u.types.dref,y))},u.box=function(f){for(var d=Array.prototype.slice.call(arguments,1),h=8,y=d.length,E=y,p;y--;)h+=d[y].byteLength;for(p=new Uint8Array(h),p[0]=h>>24&255,p[1]=h>>16&255,p[2]=h>>8&255,p[3]=h&255,p.set(f,4),y=0,h=8;y<E;y++)p.set(d[y],h),h+=d[y].byteLength;return p},u.hdlr=function(f){return u.box(u.types.hdlr,u.HDLR_TYPES[f])},u.mdat=function(f){return u.box(u.types.mdat,f)},u.mdhd=function(f,d){d*=f;var h=Math.floor(d/(a+1)),y=Math.floor(d%(a+1));return u.box(u.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,f>>24&255,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},u.mdia=function(f){return u.box(u.types.mdia,u.mdhd(f.timescale,f.duration),u.hdlr(f.type),u.minf(f))},u.mfhd=function(f){return u.box(u.types.mfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255]))},u.minf=function(f){return f.type==="audio"?u.box(u.types.minf,u.box(u.types.smhd,u.SMHD),u.DINF,u.stbl(f)):u.box(u.types.minf,u.box(u.types.vmhd,u.VMHD),u.DINF,u.stbl(f))},u.moof=function(f,d,h){return u.box(u.types.moof,u.mfhd(f),u.traf(h,d))},u.moov=function(f){for(var d=f.length,h=[];d--;)h[d]=u.trak(f[d]);return u.box.apply(null,[u.types.moov,u.mvhd(f[0].timescale,f[0].duration)].concat(h).concat(u.mvex(f)))},u.mvex=function(f){for(var d=f.length,h=[];d--;)h[d]=u.trex(f[d]);return u.box.apply(null,[u.types.mvex].concat(h))},u.mvhd=function(f,d){d*=f;var h=Math.floor(d/(a+1)),y=Math.floor(d%(a+1)),E=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,f>>24&255,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return u.box(u.types.mvhd,E)},u.sdtp=function(f){var d=f.samples||[],h=new Uint8Array(4+d.length),y,E;for(E=0;E<d.length;E++)y=d[E].flags,h[E+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return u.box(u.types.sdtp,h)},u.stbl=function(f){return u.box(u.types.stbl,u.stsd(f),u.box(u.types.stts,u.STTS),u.box(u.types.stsc,u.STSC),u.box(u.types.stsz,u.STSZ),u.box(u.types.stco,u.STCO))},u.avc1=function(f){var d=[],h=[],y,E,p;for(y=0;y<f.sps.length;y++)E=f.sps[y],p=E.byteLength,d.push(p>>>8&255),d.push(p&255),d=d.concat(Array.prototype.slice.call(E));for(y=0;y<f.pps.length;y++)E=f.pps[y],p=E.byteLength,h.push(p>>>8&255),h.push(p&255),h=h.concat(Array.prototype.slice.call(E));var _=u.box(u.types.avcC,new Uint8Array([1,d[3],d[4],d[5],255,224|f.sps.length].concat(d).concat([f.pps.length]).concat(h))),g=f.width,x=f.height,C=f.pixelRatio[0],R=f.pixelRatio[1];return u.box(u.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g>>8&255,g&255,x>>8&255,x&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),_,u.box(u.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),u.box(u.types.pasp,new Uint8Array([C>>24,C>>16&255,C>>8&255,C&255,R>>24,R>>16&255,R>>8&255,R&255])))},u.esds=function(f){var d=f.config.length;return new Uint8Array([0,0,0,0,3,23+d,0,1,0,4,15+d,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([d]).concat(f.config).concat([6,1,2]))},u.mp4a=function(f){var d=f.samplerate;return u.box(u.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,f.channelCount,0,16,0,0,0,0,d>>8&255,d&255,0,0]),u.box(u.types.esds,u.esds(f)))},u.mp3=function(f){var d=f.samplerate;return u.box(u.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,f.channelCount,0,16,0,0,0,0,d>>8&255,d&255,0,0]))},u.stsd=function(f){return f.type==="audio"?!f.isAAC&&f.codec==="mp3"?u.box(u.types.stsd,u.STSD,u.mp3(f)):u.box(u.types.stsd,u.STSD,u.mp4a(f)):u.box(u.types.stsd,u.STSD,u.avc1(f))},u.tkhd=function(f){var d=f.id,h=f.duration*f.timescale,y=f.width,E=f.height,p=Math.floor(h/(a+1)),_=Math.floor(h%(a+1));return u.box(u.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,d>>24&255,d>>16&255,d>>8&255,d&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,_>>24,_>>16&255,_>>8&255,_&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,E>>8&255,E&255,0,0]))},u.traf=function(f,d){var h=u.sdtp(f),y=f.id,E=Math.floor(d/(a+1)),p=Math.floor(d%(a+1));return u.box(u.types.traf,u.box(u.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),u.box(u.types.tfdt,new Uint8Array([1,0,0,0,E>>24,E>>16&255,E>>8&255,E&255,p>>24,p>>16&255,p>>8&255,p&255])),u.trun(f,h.length+16+20+8+16+8+8),h)},u.trak=function(f){return f.duration=f.duration||4294967295,u.box(u.types.trak,u.tkhd(f),u.mdia(f))},u.trex=function(f){var d=f.id;return u.box(u.types.trex,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},u.trun=function(f,d){var h=f.samples||[],y=h.length,E=12+16*y,p=new Uint8Array(E),_,g,x,C,R,S;for(d+=8+E,p.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255],0),_=0;_<y;_++)g=h[_],x=g.duration,C=g.size,R=g.flags,S=g.cts,p.set([x>>>24&255,x>>>16&255,x>>>8&255,x&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255,R.isLeading<<2|R.dependsOn,R.isDependedOn<<6|R.hasRedundancy<<4|R.paddingValue<<1|R.isNonSync,R.degradPrio&61440,R.degradPrio&15,S>>>24&255,S>>>16&255,S>>>8&255,S&255],12+16*_);return u.box(u.types.trun,p)},u.initSegment=function(f){u.types||u.init();var d=u.moov(f),h;return h=new Uint8Array(u.FTYP.byteLength+d.byteLength),h.set(u.FTYP),h.set(d,u.FTYP.byteLength),h},u}();t.default=l},"./src/remux/mp4-remuxer.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/remux/aac-helper.js"),l=n("./src/remux/mp4-generator.js"),u=n("./src/events.js"),f=n("./src/errors.js"),d=n("./src/utils/logger.js"),h=10*1e3,y=function(){function E(p,_,g,x){this.observer=p,this.config=_,this.typeSupported=g;var C=navigator.userAgent;this.isSafari=x&&x.indexOf("Apple")>-1&&C&&!C.match("CriOS"),this.ISGenerated=!1}return E.prototype.destroy=function(){},E.prototype.resetTimeStamp=function(p){this._initPTS=this._initDTS=p},E.prototype.resetInitSegment=function(){this.ISGenerated=!1},E.prototype.remux=function(p,_,g,x,C,R,S){if(this.ISGenerated||this.generateIS(p,_,C),this.ISGenerated){var A=p.samples.length,T=_.samples.length,w=C,P=C;if(A&&T){var O=(p.samples[0].pts-_.samples[0].pts)/_.inputTimeScale;w+=Math.max(0,O),P+=Math.max(0,-O)}if(A){p.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(p,_,C));var k=this.remuxAudio(p,w,R,S);if(T){var D=void 0;k&&(D=k.endPTS-k.startPTS),_.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(p,_,C)),this.remuxVideo(_,P,R,D,S)}}else if(T){var F=this.remuxVideo(_,P,R,0,S);F&&p.codec&&this.remuxEmptyAudio(p,w,R,F)}}g.samples.length&&this.remuxID3(g,C),x.samples.length&&this.remuxText(x,C),this.observer.trigger(u.default.FRAG_PARSED)},E.prototype.generateIS=function(p,_,g){var x=this.observer,C=p.samples,R=_.samples,S=this.typeSupported,A="audio/mp4",T={},w={tracks:T},P=this._initPTS===void 0,O,k;if(P&&(O=k=1/0),p.config&&C.length&&(p.timescale=p.samplerate,d.logger.log("audio sampling rate : "+p.samplerate),p.isAAC||(S.mpeg?(A="audio/mpeg",p.codec=""):S.mp3&&(p.codec="mp3")),T.audio={container:A,codec:p.codec,initSegment:!p.isAAC&&S.mpeg?new Uint8Array:l.default.initSegment([p]),metadata:{channelCount:p.channelCount}},P&&(O=k=C[0].pts-p.inputTimeScale*g)),_.sps&&_.pps&&R.length){var D=_.inputTimeScale;_.timescale=D,T.video={container:"video/mp4",codec:_.codec,initSegment:l.default.initSegment([_]),metadata:{width:_.width,height:_.height}},P&&(O=Math.min(O,R[0].pts-D*g),k=Math.min(k,R[0].dts-D*g),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:O}))}Object.keys(T).length?(x.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,w),this.ISGenerated=!0,P&&(this._initPTS=O,this._initDTS=k)):x.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},E.prototype.remuxVideo=function(p,_,g,x,C){var R=8,S,A,T,w,P,O,k,D=p.timescale,F=p.samples,G=[],V=F.length,W=this._PTSNormalize,ee=this._initPTS,q=this.nextAvcDts,z=this.isSafari;if(V!==0){z&&(g|=F.length&&q&&(C&&Math.abs(_-q/D)<.1||Math.abs(F[0].pts-q-ee)<D/5)),g||(q=_*D),F.forEach(function(Ze){Ze.pts=W(Ze.pts-ee,q),Ze.dts=W(Ze.dts-ee,q)}),F.sort(function(Ze,rt){var qt=Ze.dts-rt.dts,We=Ze.pts-rt.pts;return qt||We||Ze.id-rt.id});var U=F.reduce(function(Ze,rt){return Math.max(Math.min(Ze,rt.pts-rt.dts),-18e3)},0);if(U<0){d.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(U/90)+" ms to overcome this issue");for(var $=0;$<F.length;$++)F[$].dts+=U}var I=F[0];P=Math.max(I.dts,0),w=Math.max(I.pts,0);var B=Math.round((P-q)/90);g&&B&&(B>1?d.logger.log("AVC:"+B+" ms hole between fragments detected,filling it"):B<-1&&d.logger.log("AVC:"+-B+" ms overlapping between fragments detected"),P=q,F[0].dts=P,w=Math.max(w-B,q),F[0].pts=w,d.logger.log("Video/PTS/DTS adjusted: "+Math.round(w/90)+"/"+Math.round(P/90)+",delta:"+B+" ms")),I=F[F.length-1],k=Math.max(I.dts,0),O=Math.max(I.pts,0,k),z&&(S=Math.round((k-P)/(F.length-1)));for(var X=0,Q=0,$=0;$<V;$++){for(var J=F[$],ne=J.units,ae=ne.length,Z=0,se=0;se<ae;se++)Z+=ne[se].data.length;Q+=Z,X+=ae,J.length=Z,z?J.dts=P+$*S:J.dts=Math.max(J.dts,P),J.pts=Math.max(J.pts,J.dts)}var oe=Q+4*X+8;try{A=new Uint8Array(oe)}catch{this.observer.trigger(u.default.ERROR,{type:f.ErrorTypes.MUX_ERROR,details:f.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:oe,reason:"fail allocating video mdat "+oe});return}var fe=new DataView(A.buffer);fe.setUint32(0,oe),A.set(l.default.types.mdat,4);for(var $=0;$<V;$++){for(var de=F[$],ce=de.units,Se=0,Le=void 0,se=0,ae=ce.length;se<ae;se++){var Ne=ce[se],He=Ne.data,Ke=Ne.data.byteLength;fe.setUint32(R,Ke),R+=4,A.set(He,R),R+=Ke,Se+=4+Ke}if(z)Le=Math.max(0,S*Math.round((de.pts-de.dts)/S));else{if($<V-1)S=F[$+1].dts-de.dts;else{var Qe=this.config,dt=de.dts-F[$>0?$-1:$].dts;if(Qe.stretchShortVideoTrack){var yt=Qe.maxBufferHole,ut=Math.floor(yt*D),ft=(x?w+x*D:this.nextAudioPts)-de.pts;ft>ut?(S=ft-dt,S<0&&(S=dt),d.logger.log("It is approximately "+ft/90+" ms to the next segment; using duration "+S/90+" ms for the last video frame.")):S=dt}else S=dt}Le=Math.round(de.pts-de.dts)}G.push({size:Se,duration:S,cts:Le,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:de.key?2:1,isNonSync:de.key?0:1}})}this.nextAvcDts=k+S;var Xt=p.dropped;if(p.len=0,p.nbNalu=0,p.dropped=0,G.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var kt=G[0].flags;kt.dependsOn=2,kt.isNonSync=0}p.samples=G,T=l.default.moof(p.sequenceNumber++,P,p),p.samples=[];var Ge={data1:T,data2:A,startPTS:w/D,endPTS:(O+S)/D,startDTS:P/D,endDTS:this.nextAvcDts/D,type:"video",hasAudio:!1,hasVideo:!0,nb:G.length,dropped:Xt};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Ge),Ge}},E.prototype.remuxAudio=function(p,_,g,x){var C=p.inputTimeScale,R=p.timescale,S=C/R,A=p.isAAC?1024:1152,T=A*S,w=this._PTSNormalize,P=this._initPTS,O=!p.isAAC&&this.typeSupported.mpeg,k,D,F,G,V,W,ee,q=p.samples,z=[],U=this.nextAudioPts;if(g|=q.length&&U&&(x&&Math.abs(_-U/C)<.1||Math.abs(q[0].pts-U-P)<20*T),q.forEach(function(ft){ft.pts=ft.dts=w(ft.pts-P,_*C)}),q=q.filter(function(ft){return ft.pts>=0}),q.length!==0){if(g||(x?U=_*C:U=q[0].pts),p.isAAC)for(var $=this.config.maxAudioFramesDrift,I=0,B=U;I<q.length;){var X=q[I],Q,J=X.pts;Q=J-B;var ne=Math.abs(1e3*Q/C);if(Q<=-$*T)d.logger.warn("Dropping 1 audio frame @ "+(B/C).toFixed(3)+"s due to "+Math.round(ne)+" ms overlap."),q.splice(I,1),p.len-=X.unit.length;else if(Q>=$*T&&ne<h&&B){var ae=Math.round(Q/T);d.logger.warn("Injecting "+ae+" audio frame @ "+(B/C).toFixed(3)+"s due to "+Math.round(1e3*Q/C)+" ms gap.");for(var Z=0;Z<ae;Z++){var se=Math.max(B,0);F=a.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount),F||(d.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),F=X.unit.subarray()),q.splice(I,0,{unit:F,pts:se,dts:se}),p.len+=F.length,B+=T,I++}X.pts=X.dts=B,B+=T,I++}else X.pts=X.dts=B,B+=T,I++}for(var Z=0,oe=q.length;Z<oe;Z++){var fe=q[Z],de=fe.unit,J=fe.pts;if(ee!==void 0)D.duration=Math.round((J-ee)/S);else{var ce=Math.round(1e3*(J-U)/C),Se=0;if(g&&p.isAAC&&ce){if(ce>0&&ce<h)Se=Math.round((J-U)/T),d.logger.log(ce+" ms hole between AAC samples detected,filling it"),Se>0&&(F=a.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount),F||(F=de.subarray()),p.len+=Se*F.length);else if(ce<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(U/C).toFixed(3)+"s/"+(J/C).toFixed(3)+"s/"+-ce+"ms"),p.len-=de.byteLength;continue}J=U}if(W=J,p.len>0){var Le=O?p.len:p.len+8;k=O?0:8;try{G=new Uint8Array(Le)}catch{this.observer.trigger(u.default.ERROR,{type:f.ErrorTypes.MUX_ERROR,details:f.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Le,reason:"fail allocating audio mdat "+Le});return}if(!O){var Ne=new DataView(G.buffer);Ne.setUint32(0,Le),G.set(l.default.types.mdat,4)}}else return;for(var I=0;I<Se;I++)F=a.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount),F||(d.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),F=de.subarray()),G.set(F,k),k+=F.byteLength,D={size:F.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},z.push(D)}G.set(de,k);var He=de.byteLength;k+=He,D={size:He,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},z.push(D),ee=J}var Ke=0,Qe=z.length;if(Qe>=2&&(Ke=z[Qe-2].duration,D.duration=Ke),Qe){this.nextAudioPts=U=ee+S*Ke,p.len=0,p.samples=z,O?V=new Uint8Array:V=l.default.moof(p.sequenceNumber++,W/S,p),p.samples=[];var dt=W/C,yt=U/C,ut={data1:V,data2:G,startPTS:dt,endPTS:yt,startDTS:dt,endDTS:yt,type:"audio",hasAudio:!0,hasVideo:!1,nb:Qe};return this.observer.trigger(u.default.FRAG_PARSING_DATA,ut),ut}return null}},E.prototype.remuxEmptyAudio=function(p,_,g,x){var C=p.inputTimeScale,R=p.samplerate?p.samplerate:C,S=C/R,A=this.nextAudioPts,T=(A!==void 0?A:x.startDTS*C)+this._initDTS,w=x.endDTS*C+this._initDTS,P=1024,O=S*P,k=Math.ceil((w-T)/O),D=a.default.getSilentFrame(p.manifestCodec||p.codec,p.channelCount);if(d.logger.warn("remux empty Audio"),!D){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var F=[],G=0;G<k;G++){var V=T+G*O;F.push({unit:D,pts:V,dts:V}),p.len+=D.length}p.samples=F,this.remuxAudio(p,_,g)},E.prototype.remuxID3=function(p){var _=p.samples.length,g,x=p.inputTimeScale,C=this._initPTS,R=this._initDTS;if(_){for(var S=0;S<_;S++)g=p.samples[S],g.pts=(g.pts-C)/x,g.dts=(g.dts-R)/x;this.observer.trigger(u.default.FRAG_PARSING_METADATA,{samples:p.samples})}p.samples=[]},E.prototype.remuxText=function(p){p.samples.sort(function(S,A){return S.pts-A.pts});var _=p.samples.length,g,x=p.inputTimeScale,C=this._initPTS;if(_){for(var R=0;R<_;R++)g=p.samples[R],g.pts=(g.pts-C)/x;this.observer.trigger(u.default.FRAG_PARSING_USERDATA,{samples:p.samples})}p.samples=[]},E.prototype._PTSNormalize=function(p,_){var g;if(_===void 0)return p;for(_<p?g=-8589934592:g=8589934592;Math.abs(p-_)>4294967296;)p+=g;return p},E}();t.default=y},"./src/remux/passthrough-remuxer.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/events.js"),l=function(){function u(f){this.observer=f}return u.prototype.destroy=function(){},u.prototype.resetTimeStamp=function(){},u.prototype.resetInitSegment=function(){},u.prototype.remux=function(f,d,h,y,E,p,_,g){var x=this.observer,C="";f&&(C+="audio"),d&&(C+="video"),x.trigger(a.default.FRAG_PARSING_DATA,{data1:g,startPTS:E,startDTS:E,type:C,hasAudio:!!f,hasVideo:!!d,nb:1,dropped:0}),x.trigger(a.default.FRAG_PARSED)},u}();t.default=l},"./src/task-loop.js":function(r,t,n){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var y in h)h.hasOwnProperty(y)&&(d[y]=h[y])};return function(d,h){f(d,h);function y(){this.constructor=d}d.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}}();Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/event-handler.js"),u=function(f){a(d,f);function d(h){for(var y=[],E=1;E<arguments.length;E++)y[E-1]=arguments[E];var p=f.apply(this,[h].concat(y))||this;return p._tickInterval=null,p._tickTimer=null,p._tickCallCount=0,p._boundTick=p.tick.bind(p),p}return d.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},d.prototype.hasInterval=function(){return!!this._tickInterval},d.prototype.hasNextTick=function(){return!!this._tickTimer},d.prototype.setInterval=function(h){return this._tickInterval?!1:(this._tickInterval=setInterval(this._boundTick,h),!0)},d.prototype.clearInterval=function(){return this._tickInterval?(clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},d.prototype.clearNextTick=function(){return this._tickTimer?(clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},d.prototype.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},d.prototype.doTick=function(){},d}(l.default);t.default=u},"./src/utils/attr-list.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=/^(\d+)x(\d+)$/,u=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,f=function(){function d(h){typeof h=="string"&&(h=d.parseAttrList(h));for(var y in h)h.hasOwnProperty(y)&&(this[y]=h[y])}return d.prototype.decimalInteger=function(h){var y=parseInt(this[h],10);return y>a.MAX_SAFE_INTEGER?1/0:y},d.prototype.hexadecimalInteger=function(h){if(this[h]){var y=(this[h]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var E=new Uint8Array(y.length/2),p=0;p<y.length/2;p++)E[p]=parseInt(y.slice(p*2,p*2+2),16);return E}else return null},d.prototype.hexadecimalIntegerAsNumber=function(h){var y=parseInt(this[h],16);return y>a.MAX_SAFE_INTEGER?1/0:y},d.prototype.decimalFloatingPoint=function(h){return parseFloat(this[h])},d.prototype.enumeratedString=function(h){return this[h]},d.prototype.decimalResolution=function(h){var y=l.exec(this[h]);if(y!==null)return{width:parseInt(y[1],10),height:parseInt(y[2],10)}},d.parseAttrList=function(h){var y,E={};for(u.lastIndex=0;(y=u.exec(h))!==null;){var p=y[2],_='"';p.indexOf(_)===0&&p.lastIndexOf(_)===p.length-1&&(p=p.slice(1,-1)),E[y[1]]=p}return E},d}();t.default=f}).call(this,n("./src/polyfills/number.js").Number)},"./src/utils/binary-search.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={search:function(l,u){for(var f=0,d=l.length-1,h=null,y=null;f<=d;){h=(f+d)/2|0,y=l[h];var E=u(y);if(E>0)f=h+1;else if(E<0)d=h-1;else return y}return null}};t.default=a},"./src/utils/buffer-helper.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(){}return l.isBuffered=function(u,f){try{if(u){for(var d=u.buffered,h=0;h<d.length;h++)if(f>=d.start(h)&&f<=d.end(h))return!0}}catch{}return!1},l.bufferInfo=function(u,f,d){try{if(u){var h=u.buffered,y=[],E=void 0;for(E=0;E<h.length;E++)y.push({start:h.start(E),end:h.end(E)});return this.bufferedInfo(y,f,d)}}catch{}return{len:0,start:f,end:f,nextStart:void 0}},l.bufferedInfo=function(u,f,d){var h=[],y,E,p,_,g;for(u.sort(function(A,T){var w=A.start-T.start;return w||T.end-A.end}),g=0;g<u.length;g++){var x=h.length;if(x){var C=h[x-1].end;u[g].start-C<d?u[g].end>C&&(h[x-1].end=u[g].end):h.push(u[g])}else h.push(u[g])}for(g=0,y=0,E=p=f;g<h.length;g++){var R=h[g].start,S=h[g].end;if(f+d>=R&&f<S)E=R,p=S,y=p-f;else if(f+d<R){_=R;break}}return{len:y,start:E,end:p,nextStart:_}},l}();t.BufferHelper=a},"./src/utils/cea-608-parser.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},l=function(w){var P=w;return a.hasOwnProperty(w)&&(P=a[w]),String.fromCharCode(P)},u=15,f=100,d={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},h={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},E={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],_={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(w){this.time=w},log:function(w,P){var O=this.verboseFilter[w];this.verboseLevel>=O}},g=function(w){for(var P=[],O=0;O<w.length;O++)P.push(w[O].toString(16));return P},x=function(){function w(P,O,k,D,F){this.foreground=P||"white",this.underline=O||!1,this.italics=k||!1,this.background=D||"black",this.flash=F||!1}return w.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},w.prototype.setStyles=function(P){for(var O=["foreground","underline","italics","background","flash"],k=0;k<O.length;k++){var D=O[k];P.hasOwnProperty(D)&&(this[D]=P[D])}},w.prototype.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},w.prototype.equals=function(P){return this.foreground===P.foreground&&this.underline===P.underline&&this.italics===P.italics&&this.background===P.background&&this.flash===P.flash},w.prototype.copy=function(P){this.foreground=P.foreground,this.underline=P.underline,this.italics=P.italics,this.background=P.background,this.flash=P.flash},w.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),C=function(){function w(P,O,k,D,F,G){this.uchar=P||" ",this.penState=new x(O,k,D,F,G)}return w.prototype.reset=function(){this.uchar=" ",this.penState.reset()},w.prototype.setChar=function(P,O){this.uchar=P,this.penState.copy(O)},w.prototype.setPenState=function(P){this.penState.copy(P)},w.prototype.equals=function(P){return this.uchar===P.uchar&&this.penState.equals(P.penState)},w.prototype.copy=function(P){this.uchar=P.uchar,this.penState.copy(P.penState)},w.prototype.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),R=function(){function w(){this.chars=[];for(var P=0;P<f;P++)this.chars.push(new C);this.pos=0,this.currPenState=new x}return w.prototype.equals=function(P){for(var O=!0,k=0;k<f;k++)if(!this.chars[k].equals(P.chars[k])){O=!1;break}return O},w.prototype.copy=function(P){for(var O=0;O<f;O++)this.chars[O].copy(P.chars[O])},w.prototype.isEmpty=function(){for(var P=!0,O=0;O<f;O++)if(!this.chars[O].isEmpty()){P=!1;break}return P},w.prototype.setCursor=function(P){this.pos!==P&&(this.pos=P),this.pos<0?(_.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>f&&(_.log("ERROR","Too large cursor position "+this.pos),this.pos=f)},w.prototype.moveCursor=function(P){var O=this.pos+P;if(P>1)for(var k=this.pos+1;k<O+1;k++)this.chars[k].setPenState(this.currPenState);this.setCursor(O)},w.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},w.prototype.insertChar=function(P){P>=144&&this.backSpace();var O=l(P);if(this.pos>=f){_.log("ERROR","Cannot insert "+P.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},w.prototype.clearFromPos=function(P){var O;for(O=P;O<f;O++)this.chars[O].reset()},w.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},w.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},w.prototype.getTextString=function(){for(var P=[],O=!0,k=0;k<f;k++){var D=this.chars[k].uchar;D!==" "&&(O=!1),P.push(D)}return O?"":P.join("")},w.prototype.setPenStyles=function(P){this.currPenState.setStyles(P);var O=this.chars[this.pos];O.setPenState(this.currPenState)},w}(),S=function(){function w(){this.rows=[];for(var P=0;P<u;P++)this.rows.push(new R);this.currRow=u-1,this.nrRollUpRows=null,this.reset()}return w.prototype.reset=function(){for(var P=0;P<u;P++)this.rows[P].clear();this.currRow=u-1},w.prototype.equals=function(P){for(var O=!0,k=0;k<u;k++)if(!this.rows[k].equals(P.rows[k])){O=!1;break}return O},w.prototype.copy=function(P){for(var O=0;O<u;O++)this.rows[O].copy(P.rows[O])},w.prototype.isEmpty=function(){for(var P=!0,O=0;O<u;O++)if(!this.rows[O].isEmpty()){P=!1;break}return P},w.prototype.backSpace=function(){var P=this.rows[this.currRow];P.backSpace()},w.prototype.clearToEndOfRow=function(){var P=this.rows[this.currRow];P.clearToEndOfRow()},w.prototype.insertChar=function(P){var O=this.rows[this.currRow];O.insertChar(P)},w.prototype.setPen=function(P){var O=this.rows[this.currRow];O.setPenStyles(P)},w.prototype.moveCursor=function(P){var O=this.rows[this.currRow];O.moveCursor(P)},w.prototype.setCursor=function(P){_.log("INFO","setCursor: "+P);var O=this.rows[this.currRow];O.setCursor(P)},w.prototype.setPAC=function(P){_.log("INFO","pacData = "+JSON.stringify(P));var O=P.row-1;if(this.nrRollUpRows&&O<this.nrRollUpRows-1&&(O=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==O){for(var k=0;k<u;k++)this.rows[k].clear();var D=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var G=F.rows[D].cueStartTime;if(G&&G<_.time)for(var k=0;k<this.nrRollUpRows;k++)this.rows[O-this.nrRollUpRows+k+1].copy(F.rows[D+k])}}this.currRow=O;var V=this.rows[this.currRow];if(P.indent!==null){var W=P.indent,ee=Math.max(W-1,0);V.setCursor(P.indent),P.color=V.chars[ee].penState.foreground}var q={foreground:P.color,underline:P.underline,italics:P.italics,background:"black",flash:!1};this.setPen(q)},w.prototype.setBkgData=function(P){_.log("INFO","bkgData = "+JSON.stringify(P)),this.backSpace(),this.setPen(P),this.insertChar(32)},w.prototype.setRollUpRows=function(P){this.nrRollUpRows=P},w.prototype.rollUp=function(){if(this.nrRollUpRows===null){_.log("DEBUG","roll_up but nrRollUpRows not set yet");return}_.log("TEXT",this.getDisplayText());var P=this.currRow+1-this.nrRollUpRows,O=this.rows.splice(P,1)[0];O.clear(),this.rows.splice(this.currRow,0,O),_.log("INFO","Rolling up")},w.prototype.getDisplayText=function(P){P=P||!1;for(var O=[],k="",D=-1,F=0;F<u;F++){var G=this.rows[F].getTextString();G&&(D=F+1,P?O.push("Row "+D+": '"+G+"'"):O.push(G.trim()))}return O.length>0&&(P?k="["+O.join(" | ")+"]":k=O.join(`
54
+ `)),k},w.prototype.getTextAndFormat=function(){return this.rows},w}(),A=function(){function w(P,O){this.chNr=P,this.outputFilter=O,this.mode=null,this.verbose=0,this.displayedMemory=new S,this.nonDisplayedMemory=new S,this.lastOutputScreen=new S,this.currRollUpRow=this.displayedMemory.rows[u-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return w.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[u-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},w.prototype.getHandler=function(){return this.outputFilter},w.prototype.setHandler=function(P){this.outputFilter=P},w.prototype.setPAC=function(P){this.writeScreen.setPAC(P)},w.prototype.setBkgData=function(P){this.writeScreen.setBkgData(P)},w.prototype.setMode=function(P){P!==this.mode&&(this.mode=P,_.log("INFO","MODE="+P),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=P)},w.prototype.insertChars=function(P){for(var O=0;O<P.length;O++)this.writeScreen.insertChar(P[O]);var k=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";_.log("INFO",k+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(_.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},w.prototype.ccRCL=function(){_.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},w.prototype.ccBS=function(){_.log("INFO","BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},w.prototype.ccAOF=function(){},w.prototype.ccAON=function(){},w.prototype.ccDER=function(){_.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},w.prototype.ccRU=function(P){_.log("INFO","RU("+P+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(P)},w.prototype.ccFON=function(){_.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},w.prototype.ccRDC=function(){_.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},w.prototype.ccTR=function(){_.log("INFO","TR"),this.setMode("MODE_TEXT")},w.prototype.ccRTD=function(){_.log("INFO","RTD"),this.setMode("MODE_TEXT")},w.prototype.ccEDM=function(){_.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},w.prototype.ccCR=function(){_.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},w.prototype.ccENM=function(){_.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},w.prototype.ccEOC=function(){if(_.log("INFO","EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var P=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=P,this.writeScreen=this.nonDisplayedMemory,_.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},w.prototype.ccTO=function(P){_.log("INFO","TO("+P+") - Tab Offset"),this.writeScreen.moveCursor(P)},w.prototype.ccMIDROW=function(P){var O={flash:!1};if(O.underline=P%2===1,O.italics=P>=46,O.italics)O.foreground="white";else{var k=Math.floor(P/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=D[k]}_.log("INFO","MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},w.prototype.outputDataUpdate=function(P){P===void 0&&(P=!1);var O=_.time;O!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),P===!0&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},w.prototype.cueSplitAtTime=function(P){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,P,this.displayedMemory),this.cueStartTime=P))},w}(),T=function(){function w(P,O,k){this.field=P||1,this.outputs=[O,k],this.channels=[new A(1,O),new A(2,k)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return w.prototype.getHandler=function(P){return this.channels[P].getHandler()},w.prototype.setHandler=function(P,O){this.channels[P].setHandler(O)},w.prototype.addData=function(P,O){var k,D,F,G=!1;this.lastTime=P,_.setTime(P);for(var V=0;V<O.length;V+=2){if(D=O[V]&127,F=O[V+1]&127,D===0&&F===0){this.dataCounters.padding+=2;continue}else _.log("DATA","["+g([O[V],O[V+1]])+"] -> ("+g([D,F])+")");if(k=this.parseCmd(D,F),k||(k=this.parseMidrow(D,F)),k||(k=this.parsePAC(D,F)),k||(k=this.parseBackgroundAttributes(D,F)),!k&&(G=this.parseChars(D,F),G))if(this.currChNr&&this.currChNr>=0){var W=this.channels[this.currChNr-1];W.insertChars(G)}else _.log("WARNING","No channel found yet. TEXT-MODE?");k?this.dataCounters.cmd+=2:G?this.dataCounters.char+=2:(this.dataCounters.other+=2,_.log("WARNING","Couldn't parse cleaned data "+g([D,F])+" orig: "+g([O[V],O[V+1]])))}},w.prototype.parseCmd=function(P,O){var k=null,D=(P===20||P===28)&&O>=32&&O<=47,F=(P===23||P===31)&&O>=33&&O<=35;if(!(D||F))return!1;if(P===this.lastCmdA&&O===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,_.log("DEBUG","Repeated command ("+g([P,O])+") is dropped"),!0;P===20||P===23?k=1:k=2;var G=this.channels[k-1];return P===20||P===28?O===32?G.ccRCL():O===33?G.ccBS():O===34?G.ccAOF():O===35?G.ccAON():O===36?G.ccDER():O===37?G.ccRU(2):O===38?G.ccRU(3):O===39?G.ccRU(4):O===40?G.ccFON():O===41?G.ccRDC():O===42?G.ccTR():O===43?G.ccRTD():O===44?G.ccEDM():O===45?G.ccCR():O===46?G.ccENM():O===47&&G.ccEOC():G.ccTO(O-32),this.lastCmdA=P,this.lastCmdB=O,this.currChNr=k,!0},w.prototype.parseMidrow=function(P,O){var k=null;if((P===17||P===25)&&O>=32&&O<=47){if(P===17?k=1:k=2,k!==this.currChNr)return _.log("ERROR","Mismatch channel in midrow parsing"),!1;var D=this.channels[k-1];return D.ccMIDROW(O),_.log("DEBUG","MIDROW ("+g([P,O])+")"),!0}return!1},w.prototype.parsePAC=function(P,O){var k=null,D=null,F=(P>=17&&P<=23||P>=25&&P<=31)&&O>=64&&O<=127,G=(P===16||P===24)&&O>=64&&O<=95;if(!(F||G))return!1;if(P===this.lastCmdA&&O===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;k=P<=23?1:2,O>=64&&O<=95?D=k===1?d[P]:y[P]:D=k===1?h[P]:E[P];var V=this.interpretPAC(D,O),W=this.channels[k-1];return W.setPAC(V),this.lastCmdA=P,this.lastCmdB=O,this.currChNr=k,!0},w.prototype.interpretPAC=function(P,O){var k=O,D={color:null,italics:!1,indent:null,underline:!1,row:P};return O>95?k=O-96:k=O-64,D.underline=(k&1)===1,k<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(k/2)]:k<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((k-16)/2)*4,D},w.prototype.parseChars=function(P,O){var k=null,D=null,F=null;if(P>=25?(k=2,F=P-8):(k=1,F=P),F>=17&&F<=19){var G=O;F===17?G=O+80:F===18?G=O+112:G=O+144,_.log("INFO","Special char '"+l(G)+"' in channel "+k),D=[G]}else P>=32&&P<=127&&(D=O===0?[P]:[P,O]);if(D){var V=g(D);_.log("DEBUG","Char codes = "+V.join(",")),this.lastCmdA=null,this.lastCmdB=null}return D},w.prototype.parseBackgroundAttributes=function(P,O){var k,D,F,G,V=(P===16||P===24)&&O>=32&&O<=47,W=(P===23||P===31)&&O>=45&&O<=47;return V||W?(k={},P===16||P===24?(D=Math.floor((O-32)/2),k.background=p[D],O%2===1&&(k.background=k.background+"_semi")):O===45?k.background="transparent":(k.foreground="black",O===47&&(k.underline=!0)),F=P<24?1:2,G=this.channels[F-1],G.setBkgData(k),this.lastCmdA=null,this.lastCmdB=null,!0):!1},w.prototype.reset=function(){for(var P=0;P<this.channels.length;P++)this.channels[P]&&this.channels[P].reset();this.lastCmdA=null,this.lastCmdB=null},w.prototype.cueSplitAtTime=function(P){for(var O=0;O<this.channels.length;O++)this.channels[O]&&this.channels[O].cueSplitAtTime(P)},w}();t.default=T},"./src/utils/codecs.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function l(f,d){var h=a[d];return!!h&&h[f.slice(0,4)]===!0}t.isCodecType=l;function u(f,d){return window.MediaSource.isTypeSupported((d||"video")+'/mp4;codecs="'+f+'"')}t.isCodecSupportedInMp4=u},"./src/utils/cues.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/vttparser.js");function l(u,f,d,h){for(var y,E,p,_,g,x=window.VTTCue||window.TextTrackCue,C=0;C<h.rows.length;C++)if(y=h.rows[C],p=!0,_=0,g="",!y.isEmpty()){for(var R=0;R<y.chars.length;R++)y.chars[R].uchar.match(/\s/)&&p?_++:(g+=y.chars[R].uchar,p=!1);y.cueStartTime=f,f===d&&(d+=1e-4),E=new x(f,d,a.fixLineBreaks(g.trim())),_>=16?_--:_++,navigator.userAgent.match(/Firefox\//)?E.line=C+1:E.line=C>7?C-2:C+1,E.align="left",E.position=Math.max(0,Math.min(100,100*(_/32)+(navigator.userAgent.match(/Firefox\//)?50:0))),u.addCue(E)}}t.newCue=l},"./src/utils/discontinuities.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/utils/binary-search.js"),u=n("./src/utils/logger.js");function f(x,C){for(var R=null,S=0;S<x.length;S+=1){var A=x[S];if(A&&A.cc===C){R=A;break}}return R}t.findFirstFragWithCC=f;function d(x,C){return l.default.search(x,function(R){return R.cc<C?1:R.cc>C?-1:0})}t.findFragWithCC=d;function h(x,C,R){var S=!1;return C&&C.details&&R&&(R.endCC>R.startCC||x&&x.cc<R.startCC)&&(S=!0),S}t.shouldAlignOnDiscontinuities=h;function y(x,C){var R=x.fragments,S=C.fragments;if(!S.length||!R.length){u.logger.log("No fragments to align");return}var A=f(R,S[0].cc);if(!A||A&&!A.startPTS){u.logger.log("No frag in previous level to align on");return}return A}t.findDiscontinuousReferenceFrag=y;function E(x,C){C.fragments.forEach(function(R){if(R){var S=R.start+x;R.start=R.startPTS=S,R.endPTS=S+R.duration}}),C.PTSKnown=!0}t.adjustPts=E;function p(x,C,R){_(x,R,C),!R.PTSKnown&&C&&g(R,C.details)}t.alignStream=p;function _(x,C,R){if(h(x,R,C)){var S=y(R.details,C);S&&(u.logger.log("Adjusting PTS using last level due to CC increase within current level"),E(S.start,C))}}t.alignDiscontinuities=_;function g(x,C){if(C&&C.fragments.length){if(!x.hasProgramDateTime||!C.hasProgramDateTime)return;var R=C.fragments[0].programDateTime,S=x.fragments[0].programDateTime,A=(S-R)/1e3+C.fragments[0].start;a.isFinite(A)&&(u.logger.log("adjusting PTS using programDateTime delta, sliding:"+A.toFixed(3)),E(A,x))}}t.alignPDT=g}).call(this,n("./src/polyfills/number.js").Number)},"./src/utils/ewma-bandwidth-estimator.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/ewma.js"),l=function(){function u(f,d,h,y){this.hls=f,this.defaultEstimate_=y,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new a.default(d),this.fast_=new a.default(h)}return u.prototype.sample=function(f,d){f=Math.max(f,this.minDelayMs_);var h=8e3*d/f,y=f/1e3;this.fast_.sample(y,h),this.slow_.sample(y,h)},u.prototype.canEstimate=function(){var f=this.fast_;return f&&f.getTotalWeight()>=this.minWeight_},u.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},u.prototype.destroy=function(){},u}();t.default=l},"./src/utils/ewma.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(u){this.alpha_=u?Math.exp(Math.log(.5)/u):0,this.estimate_=0,this.totalWeight_=0}return l.prototype.sample=function(u,f){var d=Math.pow(this.alpha_,u);this.estimate_=f*(1-d)+d*this.estimate_,this.totalWeight_+=u},l.prototype.getTotalWeight=function(){return this.totalWeight_},l.prototype.getEstimate=function(){if(this.alpha_){var u=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/u}else return this.estimate_},l}();t.default=a},"./src/utils/get-self-scope.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});function a(){return typeof window>"u"?self:window}t.getSelfScope=a},"./src/utils/logger.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/get-self-scope.js");function l(){}var u={trace:l,debug:l,log:l,warn:l,info:l,error:l},f=u;function d(p,_){return _="["+p+"] > "+_,_}var h=a.getSelfScope();function y(p){var _=h.console[p];return _?function(){for(var g=[],x=0;x<arguments.length;x++)g[x]=arguments[x];g[0]&&(g[0]=d(p,g[0])),_.apply(h.console,g)}:l}function E(p){for(var _=[],g=1;g<arguments.length;g++)_[g-1]=arguments[g];_.forEach(function(x){f[x]=p[x]?p[x].bind(p):y(x)})}t.enableLogs=function(p){if(p===!0||typeof p=="object"){E(p,"debug","log","info","warn","error");try{f.log()}catch{f=u}}else f=u},t.logger=f},"./src/utils/mediakeys-helper.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){return typeof window<"u"&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null}();t.requestMediaKeySystemAccess=a},"./src/utils/mediasource-helper.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});function a(){if(typeof window<"u")return window.MediaSource||window.WebKitMediaSource}t.getMediaSource=a},"./src/utils/output-filter.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function l(u,f){this.timelineController=u,this.trackName=f,this.startTime=null,this.endTime=null,this.screen=null}return l.prototype.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen),this.startTime=null)},l.prototype.newCue=function(u,f,d){(this.startTime===null||this.startTime>u)&&(this.startTime=u),this.endTime=f,this.screen=d,this.timelineController.createCaptionsTrack(this.trackName)},l}();t.default=a},"./src/utils/texttrack-utils.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});function a(u,f){var d=null;try{d=new window.Event("addtrack")}catch{d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=u,f.dispatchEvent(d)}t.sendAddTrackEvent=a;function l(u){if(u&&u.cues)for(;u.cues.length>0;)u.removeCue(u.cues[0])}t.clearCurrentCues=l},"./src/utils/time-ranges.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a={toString:function(l){for(var u="",f=l.length,d=0;d<f;d++)u+="["+l.start(d).toFixed(3)+","+l.end(d).toFixed(3)+"]";return u}};t.default=a},"./src/utils/vttcue.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(typeof window<"u"&&window.VTTCue)return window.VTTCue;var a="auto",l={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};function f(E){if(typeof E!="string")return!1;var p=l[E.toLowerCase()];return p?E.toLowerCase():!1}function d(E){if(typeof E!="string")return!1;var p=u[E.toLowerCase()];return p?E.toLowerCase():!1}function h(E){for(var p=1;p<arguments.length;p++){var _=arguments[p];for(var g in _)E[g]=_[g]}return E}function y(E,p,_){var g=this,x=function(){if(!(typeof navigator>"u"))return/MSIE\s8\.0/.test(navigator.userAgent)}(),C={};x?g=document.createElement("custom"):C.enumerable=!0,g.hasBeenReset=!1;var R="",S=!1,A=E,T=p,w=_,P=null,O="",k=!0,D="auto",F="start",G=50,V="middle",W=50,ee="middle";if(Object.defineProperty(g,"id",h({},C,{get:function(){return R},set:function(q){R=""+q}})),Object.defineProperty(g,"pauseOnExit",h({},C,{get:function(){return S},set:function(q){S=!!q}})),Object.defineProperty(g,"startTime",h({},C,{get:function(){return A},set:function(q){if(typeof q!="number")throw new TypeError("Start time must be set to a number.");A=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"endTime",h({},C,{get:function(){return T},set:function(q){if(typeof q!="number")throw new TypeError("End time must be set to a number.");T=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"text",h({},C,{get:function(){return w},set:function(q){w=""+q,this.hasBeenReset=!0}})),Object.defineProperty(g,"region",h({},C,{get:function(){return P},set:function(q){P=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"vertical",h({},C,{get:function(){return O},set:function(q){var z=f(q);if(z===!1)throw new SyntaxError("An invalid or illegal string was specified.");O=z,this.hasBeenReset=!0}})),Object.defineProperty(g,"snapToLines",h({},C,{get:function(){return k},set:function(q){k=!!q,this.hasBeenReset=!0}})),Object.defineProperty(g,"line",h({},C,{get:function(){return D},set:function(q){if(typeof q!="number"&&q!==a)throw new SyntaxError("An invalid number or illegal string was specified.");D=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"lineAlign",h({},C,{get:function(){return F},set:function(q){var z=d(q);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");F=z,this.hasBeenReset=!0}})),Object.defineProperty(g,"position",h({},C,{get:function(){return G},set:function(q){if(q<0||q>100)throw new Error("Position must be between 0 and 100.");G=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"positionAlign",h({},C,{get:function(){return V},set:function(q){var z=d(q);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");V=z,this.hasBeenReset=!0}})),Object.defineProperty(g,"size",h({},C,{get:function(){return W},set:function(q){if(q<0||q>100)throw new Error("Size must be between 0 and 100.");W=q,this.hasBeenReset=!0}})),Object.defineProperty(g,"align",h({},C,{get:function(){return ee},set:function(q){var z=d(q);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");ee=z,this.hasBeenReset=!0}})),g.displayState=void 0,x)return g}return y.prototype.getCueAsHTML=function(){var E=window.WebVTT;return E.convertCueToDOMTree(window,this.text)},y}()},"./src/utils/vttparser.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/vttcue.js"),l=function(){return{decode:function(x){if(!x)return"";if(typeof x!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(x))}}};function u(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new l,this.regionList=[]}function f(g){function x(R,S,A,T){return(R|0)*3600+(S|0)*60+(A|0)+(T|0)/1e3}var C=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return C?C[3]?x(C[1],C[2],C[3].replace(":",""),C[4]):C[1]>59?x(C[1],C[2],0,C[4]):x(0,C[1],C[2],C[4]):null}function d(){this.values=Object.create(null)}d.prototype={set:function(g,x){!this.get(g)&&x!==""&&(this.values[g]=x)},get:function(g,x,C){return C?this.has(g)?this.values[g]:x[C]:this.has(g)?this.values[g]:x},has:function(g){return g in this.values},alt:function(g,x,C){for(var R=0;R<C.length;++R)if(x===C[R]){this.set(g,x);break}},integer:function(g,x){/^-?\d+$/.test(x)&&this.set(g,parseInt(x,10))},percent:function(g,x){return x.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(x=parseFloat(x),x>=0&&x<=100)?(this.set(g,x),!0):!1}};function h(g,x,C,R){var S=R?g.split(R):[g];for(var A in S)if(typeof S[A]=="string"){var T=S[A].split(C);if(T.length===2){var w=T[0],P=T[1];x(w,P)}}}var y=new a.default(0,0,0),E=y.align==="middle"?"middle":"center";function p(g,x,C){var R=g;function S(){var w=f(g);if(w===null)throw new Error("Malformed timestamp: "+R);return g=g.replace(/^[^\sa-zA-Z-]+/,""),w}function A(w,P){var O=new d;h(w,function(F,G){switch(F){case"region":for(var V=C.length-1;V>=0;V--)if(C[V].id===G){O.set(F,C[V].region);break}break;case"vertical":O.alt(F,G,["rl","lr"]);break;case"line":var W=G.split(","),ee=W[0];O.integer(F,ee),O.percent(F,ee)&&O.set("snapToLines",!1),O.alt(F,ee,["auto"]),W.length===2&&O.alt("lineAlign",W[1],["start",E,"end"]);break;case"position":W=G.split(","),O.percent(F,W[0]),W.length===2&&O.alt("positionAlign",W[1],["start",E,"end","line-left","line-right","auto"]);break;case"size":O.percent(F,G);break;case"align":O.alt(F,G,["start",E,"end","left","right"]);break}},/:/,/\s/),P.region=O.get("region",null),P.vertical=O.get("vertical","");var k=O.get("line","auto");k==="auto"&&y.line===-1&&(k=-1),P.line=k,P.lineAlign=O.get("lineAlign","start"),P.snapToLines=O.get("snapToLines",!0),P.size=O.get("size",100),P.align=O.get("align",E);var D=O.get("position","auto");D==="auto"&&y.position===50&&(D=P.align==="start"||P.align==="left"?0:P.align==="end"||P.align==="right"?100:50),P.position=D}function T(){g=g.replace(/^\s+/,"")}if(T(),x.startTime=S(),T(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+R);g=g.substr(3),T(),x.endTime=S(),T(),A(g,x)}function _(g){return g.replace(/<br(?: \/)?>/gi,`
55
+ `)}t.fixLineBreaks=_,u.prototype={parse:function(g){var x=this;g&&(x.buffer+=x.decoder.decode(g,{stream:!0}));function C(){var P=x.buffer,O=0;for(P=_(P);O<P.length&&P[O]!=="\r"&&P[O]!==`
56
+ `;)++O;var k=P.substr(0,O);return P[O]==="\r"&&++O,P[O]===`
57
+ `&&++O,x.buffer=P.substr(O),k}function R(P){h(P,function(O,k){},/:/)}try{var S=void 0;if(x.state==="INITIAL"){if(!/\r\n|\n/.test(x.buffer))return this;S=C();var A=S.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");x.state="HEADER"}for(var T=!1;x.buffer;){if(!/\r\n|\n/.test(x.buffer))return this;switch(T?T=!1:S=C(),x.state){case"HEADER":/:/.test(S)?R(S):S||(x.state="ID");continue;case"NOTE":S||(x.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){x.state="NOTE";break}if(!S)continue;if(x.cue=new a.default(0,0,""),x.state="CUE",S.indexOf("-->")===-1){x.cue.id=S;continue}case"CUE":try{p(S,x.cue,x.regionList)}catch{x.cue=null,x.state="BADCUE";continue}x.state="CUETEXT";continue;case"CUETEXT":var w=S.indexOf("-->")!==-1;if(!S||w&&(T=!0)){x.oncue&&x.oncue(x.cue),x.cue=null,x.state="ID";continue}x.cue.text&&(x.cue.text+=`
58
+ `),x.cue.text+=S;continue;case"BADCUE":S||(x.state="ID");continue}}}catch{x.state==="CUETEXT"&&x.cue&&x.oncue&&x.oncue(x.cue),x.cue=null,x.state=x.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var g=this;try{if(g.buffer+=g.decoder.decode(),(g.cue||g.state==="HEADER")&&(g.buffer+=`
59
+
60
+ `,g.parse()),g.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(x){throw x}return g.onflush&&g.onflush(),this}},t.default=u},"./src/utils/webvtt-parser.js":function(r,t,n){(function(a){Object.defineProperty(t,"__esModule",{value:!0});var l=n("./src/utils/vttparser.js"),u=n("./src/demux/id3.js"),f=function(p,_,g){return p.substr(g||0,_.length)===_},d=function(p){var _=parseInt(p.substr(-3)),g=parseInt(p.substr(-6,2)),x=parseInt(p.substr(-9,2)),C=p.length>9?parseInt(p.substr(0,p.indexOf(":"))):0;return!a.isFinite(_)||!a.isFinite(g)||!a.isFinite(x)||!a.isFinite(C)?-1:(_+=1e3*g,_+=60*1e3*x,_+=60*60*1e3*C,_)},h=function(p){for(var _=5381,g=p.length;g;)_=_*33^p.charCodeAt(--g);return(_>>>0).toString()},y=function(p,_,g){var x=p[_],C=p[x.prevCC];if(!C||!C.new&&x.new){p.ccOffset=p.presentationOffset=x.start,x.new=!1;return}for(;C&&C.new;)p.ccOffset+=x.start-C.start,x.new=!1,x=C,C=p[x.prevCC];p.presentationOffset=g},E={parse:function(p,_,g,x,C,R){var S=/\r\n|\n\r|\n|\r/g,A=u.utf8ArrayToStr(new Uint8Array(p)).trim().replace(S,`
61
+ `).split(`
62
+ `),T="00:00.000",w=0,P=0,O=0,k=[],D,F=!0,G=new l.default;G.oncue=function(V){var W=g[x],ee=g.ccOffset;W&&W.new&&(P!==void 0?ee=g.ccOffset=W.start:y(g,x,O)),O&&(ee=O-g.presentationOffset),V.startTime+=ee-P,V.endTime+=ee-P,V.id=h(V.startTime.toString())+h(V.endTime.toString())+h(V.text),V.text=decodeURIComponent(encodeURIComponent(V.text)),V.endTime>0&&k.push(V)},G.onparsingerror=function(V){D=V},G.onflush=function(){if(D&&R){R(D);return}C(k)},A.forEach(function(V){if(F)if(f(V,"X-TIMESTAMP-MAP=")){F=!1,V.substr(16).split(",").forEach(function(W){f(W,"LOCAL:")?T=W.substr(6):f(W,"MPEGTS:")&&(w=parseInt(W.substr(7)))});try{_+(g[x].start*9e4||0)<0&&(_+=8589934592),w-=_,P=d(T)/1e3,O=w/9e4,P===-1&&(D=new Error("Malformed X-TIMESTAMP-MAP: "+V))}catch{D=new Error("Malformed X-TIMESTAMP-MAP: "+V)}return}else V===""&&(F=!1);G.parse(V+`
63
+ `)}),G.flush()}};t.default=E}).call(this,n("./src/polyfills/number.js").Number)},"./src/utils/xhr-loader.js":function(r,t,n){Object.defineProperty(t,"__esModule",{value:!0});var a=n("./src/utils/logger.js"),l=window.performance,u=window.XMLHttpRequest,f=function(){function d(h){h&&h.xhrSetup&&(this.xhrSetup=h.xhrSetup)}return d.prototype.destroy=function(){this.abort(),this.loader=null},d.prototype.abort=function(){var h=this.loader;h&&h.readyState!==4&&(this.stats.aborted=!0,h.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},d.prototype.load=function(h,y,E){this.context=h,this.config=y,this.callbacks=E,this.stats={trequest:l.now(),retry:0},this.retryDelay=y.retryDelay,this.loadInternal()},d.prototype.loadInternal=function(){var h,y=this.context;h=this.loader=new u;var E=this.stats;E.tfirst=0,E.loaded=0;var p=this.xhrSetup;try{if(p)try{p(h,y.url)}catch{h.open("GET",y.url,!0),p(h,y.url)}h.readyState||h.open("GET",y.url,!0)}catch(_){this.callbacks.onError({code:h.status,text:_.message},y,h);return}y.rangeEnd&&h.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=y.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),h.send()},d.prototype.readystatechange=function(h){var y=h.currentTarget,E=y.readyState,p=this.stats,_=this.context,g=this.config;if(!p.aborted&&E>=2)if(window.clearTimeout(this.requestTimeout),p.tfirst===0&&(p.tfirst=Math.max(l.now(),p.trequest)),E===4){var x=y.status;if(x>=200&&x<300){p.tload=Math.max(p.tfirst,l.now());var C=void 0,R=void 0;_.responseType==="arraybuffer"?(C=y.response,R=C.byteLength):(C=y.responseText,R=C.length),p.loaded=p.total=R;var S={url:y.responseURL,data:C};this.callbacks.onSuccess(S,p,_,y)}else p.retry>=g.maxRetry||x>=400&&x<499?(a.logger.error(x+" while loading "+_.url),this.callbacks.onError({code:x,text:y.statusText},_,y)):(a.logger.warn(x+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,g.maxRetryDelay),p.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),g.timeout)},d.prototype.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},d.prototype.loadprogress=function(h){var y=h.currentTarget,E=this.stats;E.loaded=h.loaded,h.lengthComputable&&(E.total=h.total);var p=this.callbacks.onProgress;p&&p(E,this.context,null,y)},d}();t.default=f}}).default})})(hls);var hlsExports=hls.exports;const Hls=getDefaultExportFromCjs(hlsExports);var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=o,ReactPropTypesSecret_1}var checkPropTypes_1,hasRequiredCheckPropTypes;function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var o=function(){};if(process.env.NODE_ENV!=="production"){var e=requireReactPropTypesSecret(),r={},t=Function.call.bind(Object.prototype.hasOwnProperty);o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function n(a,l,u,f,d){if(process.env.NODE_ENV!=="production"){for(var h in a)if(t(a,h)){var y;try{if(typeof a[h]!="function"){var E=Error((f||"React class")+": "+u+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.");throw E.name="Invariant Violation",E}y=a[h](l,h,f,u,null,e)}catch(_){y=_}if(y&&!(y instanceof Error)&&o((f||"React class")+": type specification of "+u+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof y+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),y instanceof Error&&!(y.message in r)){r[y.message]=!0;var p=d?d():"";o("Failed "+u+" type: "+y.message+(p??""))}}}}return n.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},checkPropTypes_1=n,checkPropTypes_1}var factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers;function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var o=requireReactIs(),e=requireObjectAssign(),r=requireReactPropTypesSecret(),t=requireCheckPropTypes(),n=Function.call.bind(Object.prototype.hasOwnProperty),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(u){var f="Warning: "+u;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function l(){return null}return factoryWithTypeCheckers=function(u,f){var d=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function y($){var I=$&&(d&&$[d]||$[h]);if(typeof I=="function")return I}var E="<<anonymous>>",p={array:C("array"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:R(),arrayOf:S,element:A(),elementType:T(),instanceOf:w,node:D(),objectOf:O,oneOf:P,oneOfType:k,shape:F,exact:G};function _($,I){return $===I?$!==0||1/$===1/I:$!==$&&I!==I}function g($){this.message=$,this.stack=""}g.prototype=Error.prototype;function x($){if(process.env.NODE_ENV!=="production")var I={},B=0;function X(J,ne,ae,Z,se,oe,fe){if(Z=Z||E,oe=oe||ae,fe!==r){if(f){var de=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 de.name="Invariant Violation",de}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ce=Z+":"+ae;!I[ce]&&B<3&&(a("You are manually calling a React.PropTypes validation function for the `"+oe+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),I[ce]=!0,B++)}}return ne[ae]==null?J?ne[ae]===null?new g("The "+se+" `"+oe+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new g("The "+se+" `"+oe+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:$(ne,ae,Z,se,oe)}var Q=X.bind(null,!1);return Q.isRequired=X.bind(null,!0),Q}function C($){function I(B,X,Q,J,ne,ae){var Z=B[X],se=ee(Z);if(se!==$){var oe=q(Z);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+oe+"` supplied to `"+Q+"`, expected ")+("`"+$+"`."))}return null}return x(I)}function R(){return x(l)}function S($){function I(B,X,Q,J,ne){if(typeof $!="function")return new g("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside arrayOf.");var ae=B[X];if(!Array.isArray(ae)){var Z=ee(ae);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected an array."))}for(var se=0;se<ae.length;se++){var oe=$(ae,se,Q,J,ne+"["+se+"]",r);if(oe instanceof Error)return oe}return null}return x(I)}function A(){function $(I,B,X,Q,J){var ne=I[B];if(!u(ne)){var ae=ee(ne);return new g("Invalid "+Q+" `"+J+"` of type "+("`"+ae+"` supplied to `"+X+"`, expected a single ReactElement."))}return null}return x($)}function T(){function $(I,B,X,Q,J){var ne=I[B];if(!o.isValidElementType(ne)){var ae=ee(ne);return new g("Invalid "+Q+" `"+J+"` of type "+("`"+ae+"` supplied to `"+X+"`, expected a single ReactElement type."))}return null}return x($)}function w($){function I(B,X,Q,J,ne){if(!(B[X]instanceof $)){var ae=$.name||E,Z=U(B[X]);return new g("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected ")+("instance of `"+ae+"`."))}return null}return x(I)}function P($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),l;function I(B,X,Q,J,ne){for(var ae=B[X],Z=0;Z<$.length;Z++)if(_(ae,$[Z]))return null;var se=JSON.stringify($,function(fe,de){var ce=q(de);return ce==="symbol"?String(de):de});return new g("Invalid "+J+" `"+ne+"` of value `"+String(ae)+"` "+("supplied to `"+Q+"`, expected one of "+se+"."))}return x(I)}function O($){function I(B,X,Q,J,ne){if(typeof $!="function")return new g("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside objectOf.");var ae=B[X],Z=ee(ae);if(Z!=="object")return new g("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected an object."));for(var se in ae)if(n(ae,se)){var oe=$(ae,se,Q,J,ne+"."+se,r);if(oe instanceof Error)return oe}return null}return x(I)}function k($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var I=0;I<$.length;I++){var B=$[I];if(typeof B!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(B)+" at index "+I+"."),l}function X(Q,J,ne,ae,Z){for(var se=0;se<$.length;se++){var oe=$[se];if(oe(Q,J,ne,ae,Z,r)==null)return null}return new g("Invalid "+ae+" `"+Z+"` supplied to "+("`"+ne+"`."))}return x(X)}function D(){function $(I,B,X,Q,J){return V(I[B])?null:new g("Invalid "+Q+" `"+J+"` supplied to "+("`"+X+"`, expected a ReactNode."))}return x($)}function F($){function I(B,X,Q,J,ne){var ae=B[X],Z=ee(ae);if(Z!=="object")return new g("Invalid "+J+" `"+ne+"` of type `"+Z+"` "+("supplied to `"+Q+"`, expected `object`."));for(var se in $){var oe=$[se];if(oe){var fe=oe(ae,se,Q,J,ne+"."+se,r);if(fe)return fe}}return null}return x(I)}function G($){function I(B,X,Q,J,ne){var ae=B[X],Z=ee(ae);if(Z!=="object")return new g("Invalid "+J+" `"+ne+"` of type `"+Z+"` "+("supplied to `"+Q+"`, expected `object`."));var se=e({},B[X],$);for(var oe in se){var fe=$[oe];if(!fe)return new g("Invalid "+J+" `"+ne+"` key `"+oe+"` supplied to `"+Q+"`.\nBad object: "+JSON.stringify(B[X],null," ")+`
64
+ Valid keys: `+JSON.stringify(Object.keys($),null," "));var de=fe(ae,oe,Q,J,ne+"."+oe,r);if(de)return de}return null}return x(I)}function V($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(V);if($===null||u($))return!0;var I=y($);if(I){var B=I.call($),X;if(I!==$.entries){for(;!(X=B.next()).done;)if(!V(X.value))return!1}else for(;!(X=B.next()).done;){var Q=X.value;if(Q&&!V(Q[1]))return!1}}else return!1;return!0;default:return!1}}function W($,I){return $==="symbol"?!0:I?I["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&I instanceof Symbol:!1}function ee($){var I=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":W(I,$)?"symbol":I}function q($){if(typeof $>"u"||$===null)return""+$;var I=ee($);if(I==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return I}function z($){var I=q($);switch(I){case"array":case"object":return"an "+I;case"boolean":case"date":case"regexp":return"a "+I;default:return I}}function U($){return!$.constructor||!$.constructor.name?E:$.constructor.name}return p.checkPropTypes=t,p.resetWarningCache=t.resetWarningCache,p.PropTypes=p,p},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var o=requireReactPropTypesSecret();function e(){}function r(){}return r.resetWarningCache=e,factoryWithThrowingShims=function(){function t(l,u,f,d,h,y){if(y!==o){var E=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 E.name="Invariant Violation",E}}t.isRequired=t;function n(){return t}var a={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},factoryWithThrowingShims}if(process.env.NODE_ENV!=="production"){var ReactIs=requireReactIs(),throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function BufferBar({time:o,setTimePoint:e,mandatory:r,mandatoryHasBeenViewed:t,viewed:n}){const a=Math.trunc(o.current*1e3/o.duration)/10,l=React$2.useRef(),[u,f]=React$2.useState(!1),d=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),h=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),y=(g,x)=>{f(!0);let C=g.offsetX;g.changedTouches&&(C=g.changedTouches[0].clientX);const R=x.offsetWidth+x.offsetLeft;C<=R&&C>=x.offsetLeft&&e(C,x.offsetWidth,x.offsetLeft)},E=()=>{window.onmousemove=null,window.onmouseup=null,f(!1)},p=g=>{window.onmousemove=x=>y(x,g),window.onmouseup=x=>E()},_=(g,x)=>{(!r||r&&t||n)&&(g.preventDefault(),e(g.clientX,x.offsetWidth,x.offsetLeft),p(x),f(!0))};return jsxRuntimeExports.jsx("div",{id:"buffer",ref:l,className:"video--controls__bar",onMouseDown:g=>{const x=l.current;_(g,x)},onTouchMove:g=>{const x=l.current;y(g,x)},onTouchStart:g=>{const x=l.current;f(!0),e(g.changedTouches[0].clientX,x.offsetWidth,x.offsetLeft)},children:jsxRuntimeExports.jsx("div",{className:"video--controls__progress",style:{width:`${a}%`},children:jsxRuntimeExports.jsx("span",{className:u?"video--controls__handle active":"video--controls__handle",children:u?jsxRuntimeExports.jsxs("div",{className:"video--current__time active",children:[d,":",h]}):null})})})}BufferBar.defaultProps={time:{current:0,duration:0},setTimePoint:()=>{}};BufferBar.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number}),setTimePoint:PropTypes.func};function Timer({time:o}){const e=Math.trunc(o.current/60)<10?["0",Math.trunc(o.current/60)].join("").trim():Math.trunc(o.current/60),r=Math.trunc(o.current%60)<10?["0",Math.trunc(o.current%60)].join("").trim():Math.trunc(o.current%60),t=Math.trunc(o.duration/60)<10?["0",Math.trunc(o.duration/60)].join("").trim():Math.trunc(o.duration/60),n=Math.trunc(o.duration%60)<10?["0",Math.trunc(o.duration%60)].join("").trim():Math.trunc(o.duration%60);return jsxRuntimeExports.jsxs("div",{className:"video--time",children:[jsxRuntimeExports.jsxs("span",{className:"time",children:[e,":",r]}),jsxRuntimeExports.jsxs("span",{className:"duration",children:[t,":",n]})]})}Timer.defaultProps={time:{current:0,duration:0}};Timer.propTypes={time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};function ControlButtons({pauseVideo:o,paused:e,translate:r}){return jsxRuntimeExports.jsx("div",{className:"video--controls__buttons",children:jsxRuntimeExports.jsx("button",{id:"playPause","aria-label":r(e?"storylines.misc.play":"storylines.misc.pause"),className:e?"unset-button icon-play":"unset-button icon-pause",type:"button",onClick:()=>{o(),document.querySelector("#playPause").blur()}})})}ControlButtons.defaultProps={paused:!1,pauseVideo:()=>{}};function FinishedVideoButtons({restart:o,translate:e}){return jsxRuntimeExports.jsx("div",{className:"video--extra__actions video--extra__actions--widthTransparencyLayer position--absolute z-index1",children:jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>{o()},className:"gat--btn gat--btn__secondary","aria-label":e("video.replay"),children:[jsxRuntimeExports.jsx("span",{className:"icon-rewind"}),jsxRuntimeExports.jsx("span",{id:"video.replay"})]})})}FinishedVideoButtons.defaultProps={restart:()=>{},finished:!1};function PlayInitButton({play:o,finished:e,paused:r}){return e||!r?jsxRuntimeExports.jsx("div",{}):jsxRuntimeExports.jsx("div",{className:"video--extra__actions position--absolute z-index1",children:jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":"play video",onKeyUp:()=>{},onClick:()=>{o()},className:"play--video__button",children:jsxRuntimeExports.jsx("span",{className:"icon-play-outline"})})})}PlayInitButton.defaultProps={play:()=>{},finished:!1,paused:!1};function skipButton({viewed:o,mandatory:e,finished:r,skip:t,mandatoryHasBeenViewed:n,translate:a}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&o||!e||r||n?jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{className:"gat--btn__round gat--btn__close",type:"button","aria-label":a("storylines.misc.closePiece"),onKeyUp:()=>{},onClick:()=>{t()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}):null})}skipButton.defaultProps={mandatory:!1,viewed:!1,finished:!1,skip:()=>{}};function VolumeBar({volume:o,muted:e,setVolume:r,mute:t}){const n=React$2.useRef(),a=e?0:Math.floor(o*100),l=(h,y)=>{const E=y.offsetWidth+y.offsetLeft;let p=h.clientX;h.changedTouches&&(p=h.changedTouches[0].clientX),p<=E&&p>=y.offsetLeft&&r(p,y.offsetWidth,y.offsetLeft)},u=()=>{window.onmousemove=null,window.onmouseup=null},f=h=>{window.onmousemove=y=>l(y,h),window.onmouseup=y=>u()},d=(h,y)=>{h.preventDefault(),r(h.clientX,y.offsetWidth,y.offsetLeft),f(y)};return jsxRuntimeExports.jsxs("div",{className:"video--sound",children:[jsxRuntimeExports.jsx("span",{onClick:()=>t(),className:a===0?"icon-sound-off":"icon-sound"}),jsxRuntimeExports.jsx("div",{ref:n,onMouseDown:h=>{const y=n.current;d(h,y)},onTouchMove:h=>{const y=n.current;l(h,y)},onTouchStart:h=>{const y=n.current;r(h.changedTouches[0].clientX,y.offsetWidth,y.offsetLeft)},id:"volume",className:"video--sound__level",children:jsxRuntimeExports.jsx("span",{style:{width:`${a<10?10:a}%`},className:"video--sound__progress",children:jsxRuntimeExports.jsx("span",{className:"video--handle"})})})]})}VolumeBar.defaultProps={volume:0,muted:!1,setVolume:()=>{},mute:()=>{}};VolumeBar.propTypes={volume:PropTypes.number,setVolume:PropTypes.func,mute:PropTypes.func,muted:PropTypes.bool};function VideoControllers({pause:o,mandatory:e,viewed:r,skip:t,rewind:n,paused:a,time:l,finished:u,restart:f,volume:d,muted:h,mute:y,setVolume:E,setTimePoint:p,audioAnimation:_,mandatoryHasBeenViewed:g,translate:x,visibility:C}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(skipButton,{mandatory:e,finished:u,viewed:r,skip:t,rewind:n,mandatoryHasBeenViewed:g,translate:x}),jsxRuntimeExports.jsxs("div",{className:`video--controls-wrap ${C?"video--controls-wrap--hidden":""}`,children:[_?null:jsxRuntimeExports.jsx(PlayInitButton,{play:o,paused:a,finished:u}),u?jsxRuntimeExports.jsx(FinishedVideoButtons,{restart:f,translate:x}):null,jsxRuntimeExports.jsxs("div",{className:"video--controls",children:[jsxRuntimeExports.jsx(BufferBar,{mandatory:e,mandatoryHasBeenViewed:g,time:l,setTimePoint:p,finished:u,viewed:r}),jsxRuntimeExports.jsxs("div",{className:"video--controls__actions",children:[jsxRuntimeExports.jsx(Timer,{time:l}),_?jsxRuntimeExports.jsx("div",{className:"audio-animation-wrap",children:jsxRuntimeExports.jsx("div",{className:`audio-animation ${a?"audio-animation--notAnimate ":null}`})}):null,jsxRuntimeExports.jsx(ControlButtons,{paused:a,pauseVideo:o,translate:x}),jsxRuntimeExports.jsx(VolumeBar,{muted:h,mute:y,volume:d,setVolume:E})]})]})]})]})}VideoControllers.defaultProps={audioAnimation:!1,paused:!1,mandatory:!1,viewed:!1,volume:0,muted:!1,finished:!1,restart:()=>{},pause:()=>{},skip:()=>{},rewind:()=>{},setTimePoint:()=>{},setVolume:()=>{},mute:()=>{},time:{current:0,duration:0}};VideoControllers.propTypes={audioAnimation:PropTypes.bool,paused:PropTypes.bool,mandatory:PropTypes.bool,muted:PropTypes.bool,volume:PropTypes.number,viewed:PropTypes.bool,pause:PropTypes.func,finished:PropTypes.bool,restart:PropTypes.func,skip:PropTypes.func,rewind:PropTypes.func,mute:PropTypes.func,setTimePoint:PropTypes.func,setVolume:PropTypes.func,time:PropTypes.shape({current:PropTypes.number,duration:PropTypes.number})};const defaultBgImageForAudio="https://min.gamelearn.io/css-resources/gamelearn/resources/bgAudioPiece.jpg";function VideoVisor({documentType:o,url:e,required:r,viewed:t,backgroundImage:n,soundActions:a,endVideo:l,translate:u}){const[f,d]=React$2.useState(!1),[h]=a,[y,E]=React$2.useState(0),[p,_]=React$2.useState(0),[g,x]=React$2.useState(!1),[C,R]=React$2.useState(!0),[S,A]=React$2.useState(!1),[T,w]=React$2.useState(),[P,O]=React$2.useState(0),[k,D]=React$2.useState(!1),F=e&&e.match(/\.m3u8(\?.+=.+)*$/i)&&Hls.isSupported(),G=e&&(e.match(/youtube/i)||e.match(/vimeo/i)),V=e&&(e.match(/.mp3/i)||e.match(/.ogg/i)||e.match(/.wav/i)||e.match(/.m4a/i)),W={ref:fe=>{w(fe)},src:e,style:{height:"100%",width:"100%"}},ee=()=>{r&&d(!0),x(!1),T.pause(),R(!0),A(!0),D(!1),o!=="document"&&o!=="lesson"&&l()},q=()=>{l()},z=()=>{R(!1),x(!1)},U=()=>{x(!0)},$=()=>{x(!1),E(T.duration)};React$2.useEffect(()=>{let fe;if(T){if(F){fe=new Hls;const de=`${e}?v=${Math.floor(Math.random()*99999999)}`;fe.loadSource(de),fe.attachMedia(T),fe.on(Hls.Events.FRAG_LOAD_PROGRESS,(ce,Se)=>{const{stats:Le}=Se;_(Le.loaded*100/Le.total)})}return()=>{fe&&fe.destroy(),fe=null}}},[F,e,T]);const I=()=>{T.currentTime-=15},B=()=>{h("click-ui"),C?(T.play(),A(!1)):T.pause(),R(!C)},X=(fe,de,ce)=>{A(!1),T.currentTime=de?parseFloat((fe-ce)/de*T.duration):0},Q=()=>{A(!1),T.currentTime=0,B()},J=()=>{h("click-ui"),T.muted=!T.muted},ne=(fe,de,ce)=>{T.muted=!1;const Se=fe-ce>=0?(fe-ce)/de:0;T.volume=Se*100>10?Se:0,O(T.volume)};React$2.useEffect(()=>{let fe;return!k&&!C&&(fe=setTimeout(()=>{D(!0),clearTimeout(fe)},3e3)),()=>clearTimeout(fe)},[k,C]);const ae=()=>{k&&D(!1)},Z=n||defaultBgImageForAudio,se=Z===defaultBgImageForAudio?"cover":"contain",oe={backgroundImage:`url("${Z}")`,backgroundSize:se,backgroundRepeat:"no-repeat",backgroundPosition:"center center"};return jsxRuntimeExports.jsx("div",{className:`video ${r&&!f&&!t?"forward-disabled":""}`,style:V?oe:null,children:G?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"position--absolute right top z-index2",children:jsxRuntimeExports.jsx("button",{type:"button","aria-label":u("storylines.misc.closePiece"),className:"gat--btn__round gat--btn__close",onClick:()=>{h("click-ui"),l()},children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})}),jsxRuntimeExports.jsx("iframe",{className:"embeddedVideo",title:"title",...W})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(VideoControllers,{visibility:k,mandatoryHasBeenViewed:f,audioAnimation:!!V,skip:l,mandatory:r,viewed:t,volume:T?T.volume:0,mute:J,muted:T?T.muted:!1,paused:C,finished:S,restart:Q,setTimePoint:X,time:{duration:y,current:T?T.currentTime:0},rewind:I,pause:B,volumeState:P,setVolume:ne,translate:u}),jsxRuntimeExports.jsx("video",{onMouseMove:()=>ae(),onClick:()=>{ae()},onFocus:()=>{ae()},onCanPlayThrough:$,onWaiting:U,onEnded:ee,onError:q,onPlaying:z,...W,children:jsxRuntimeExports.jsx("track",{kind:"captions"})}),g?jsxRuntimeExports.jsxs("div",{className:"video-loading-container",style:{top:0,left:0},children:[jsxRuntimeExports.jsx("div",{className:"video-loading-container-bg opacity-wrapper"}),jsxRuntimeExports.jsx("div",{className:"popup-alert warning",children:jsxRuntimeExports.jsx("div",{className:"popup-message",children:jsxRuntimeExports.jsx("p",{children:Math.floor(p)})})})]}):null]})})}VideoVisor.defaultProps={url:"",name:"",backgroundImage:null,documentType:"",required:!1,viewed:!1,endVideo:()=>{}};function VideoComponent({emitEvent:o,name:e,documentType:r,document:t,documentId_labelId:n,soundActions:a,required:l,viewed:u,visible:f,img:d,imgId_labelId:h,keyboardControl:y}){const E=x=>o({type:"translate",payload:x}),{url:p}=t,_=React$2.useMemo(()=>({documentId:n,imgId:h,required:l,name:e,type:"video",viewed:u,documentType:r}),[n,h,l,e,u,r]),g=React$2.useCallback(()=>{o({type:"finishMedia",payload:_})},[o,_]);return React$2.useEffect(()=>{f||g()},[g,f]),f?(y(null,u?null:g,u?null:g),jsxRuntimeExports.jsx(VideoVisor,{backgroundImage:d==null?void 0:d.url,url:p,soundActions:a,documentType:r,required:l,viewed:u,endVideo:()=>g(),translate:E})):null}var htmlReactParser={exports:{}},lib$4={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib$4,"__esModule",{value:!0});function _slicedToArray(o,e){return _arrayWithHoles(o)||_iterableToArrayLimit(o,e)||_unsupportedIterableToArray(o,e)||_nonIterableRest()}function _arrayWithHoles(o){if(Array.isArray(o))return o}function _iterableToArrayLimit(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t=[],n=!0,a=!1,l,u;try{for(r=r.call(o);!(n=(l=r.next()).done)&&(t.push(l.value),!(e&&t.length===e));n=!0);}catch(f){a=!0,u=f}finally{try{!n&&r.return!=null&&r.return()}finally{if(a)throw u}}return t}}function _unsupportedIterableToArray(o,e){if(o){if(typeof o=="string")return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(o,e)}}function _arrayLikeToArray(o,e){(e==null||e>o.length)&&(e=o.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=o[r];return t}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(o){return properties.hasOwnProperty(o)?properties[o]:null}function PropertyInfoRecord(o,e,r,t,n,a,l){this.acceptsBooleans=e===BOOLEANISH_STRING||e===BOOLEAN||e===OVERLOADED_BOOLEAN,this.attributeName=t,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=o,this.type=e,this.sanitizeURL=a,this.removeEmptyString=l}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(o){properties[o]=new PropertyInfoRecord(o,RESERVED,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var e=_slicedToArray(o,2),r=e[0],t=e[1];properties[r]=new PropertyInfoRecord(r,STRING,!1,t,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEANISH_STRING,!1,o,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,BOOLEAN,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,OVERLOADED_BOOLEAN,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,POSITIVE_NUMERIC,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,NUMERIC,!1,o.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function o(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var e=o.replace(CAMELIZE,capitalize$1);properties[e]=new PropertyInfoRecord(e,STRING,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){properties[o]=new PropertyInfoRecord(o,STRING,!1,o.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(o,e){var r=possibleStandardNamesOptimized[e];return r===SAME?o[e]=e:r===CAMELCASE?o[e.toLowerCase()]=e:o[e]=r,o},{});lib$4.BOOLEAN=BOOLEAN;lib$4.BOOLEANISH_STRING=BOOLEANISH_STRING;lib$4.NUMERIC=NUMERIC;lib$4.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib$4.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib$4.RESERVED=RESERVED;lib$4.STRING=STRING;lib$4.getPropertyInfo=getPropertyInfo;lib$4.isCustomAttribute=isCustomAttribute;lib$4.possibleStandardNames=possibleStandardNames;var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
66
+ `,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING$1="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];e=e||{};var r=1,t=1;function n(_){var g=_.match(NEWLINE_REGEX);g&&(r+=g.length);var x=_.lastIndexOf(NEWLINE);t=~x?_.length-x:t+_.length}function a(){var _={line:r,column:t};return function(g){return g.position=new l(_),d(),g}}function l(_){this.start=_,this.end={line:r,column:t},this.source=e.source}l.prototype.content=o;function u(_){var g=new Error(e.source+":"+r+":"+t+": "+_);if(g.reason=_,g.filename=e.source,g.line=r,g.column=t,g.source=o,!e.silent)throw g}function f(_){var g=_.exec(o);if(g){var x=g[0];return n(x),o=o.slice(x.length),g}}function d(){f(WHITESPACE_REGEX)}function h(_){var g;for(_=_||[];g=y();)g!==!1&&_.push(g);return _}function y(){var _=a();if(!(FORWARD_SLASH!=o.charAt(0)||ASTERISK!=o.charAt(1))){for(var g=2;EMPTY_STRING$1!=o.charAt(g)&&(ASTERISK!=o.charAt(g)||FORWARD_SLASH!=o.charAt(g+1));)++g;if(g+=2,EMPTY_STRING$1===o.charAt(g-1))return u("End of comment missing");var x=o.slice(2,g-2);return t+=2,n(x),o=o.slice(g),t+=2,_({type:TYPE_COMMENT,comment:x})}}function E(){var _=a(),g=f(PROPERTY_REGEX);if(g){if(y(),!f(COLON_REGEX))return u("property missing ':'");var x=f(VALUE_REGEX),C=_({type:TYPE_DECLARATION,property:trim(g[0].replace(COMMENT_REGEX,EMPTY_STRING$1)),value:x?trim(x[0].replace(COMMENT_REGEX,EMPTY_STRING$1)):EMPTY_STRING$1});return f(SEMICOLON_REGEX),C}}function p(){var _=[];h(_);for(var g;g=E();)g!==!1&&(_.push(g),h(_));return _}return d(),p()};function trim(o){return o?o.replace(TRIM_REGEX,EMPTY_STRING$1):EMPTY_STRING$1}var parse=inlineStyleParser;function StyleToObject(o,e){var r=null;if(!o||typeof o!="string")return r;for(var t,n=parse(o),a=typeof e=="function",l,u,f=0,d=n.length;f<d;f++)t=n[f],l=t.property,u=t.value,a?e(l,u,t):u&&(r||(r={}),r[l]=u);return r}var styleToObject=StyleToObject,utilities$4={};utilities$4.__esModule=!0;utilities$4.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(o){return!o||NO_HYPHEN_REGEX.test(o)||CUSTOM_PROPERTY_REGEX.test(o)},capitalize=function(o,e){return e.toUpperCase()},trimHyphen=function(o,e){return"".concat(e,"-")},camelCase=function(o,e){return e===void 0&&(e={}),skipCamelCase(o)?o:(o=o.toLowerCase(),e.reactCompat?o=o.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):o=o.replace(VENDOR_PREFIX_REGEX,trimHyphen),o.replace(HYPHEN_REGEX,capitalize))};utilities$4.camelCase=camelCase;(function(o){var e=commonjsGlobal&&commonjsGlobal.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};o.__esModule=!0;var r=e(styleToObject),t=utilities$4;function n(a,l){var u={};return!a||typeof a!="string"||(0,r.default)(a,function(f,d){f&&d&&(u[(0,t.camelCase)(f,l)]=d)}),u}o.default=n})(cjs);var React$1=React$2,styleToJS=cjs.default;function invertObject(o,e){if(!o||typeof o!="object")throw new TypeError("First argument must be an object");var r,t,n=typeof e=="function",a={},l={};for(r in o){if(t=o[r],n&&(a=e(r,t),a&&a.length===2)){l[a[0]]=a[1];continue}typeof t=="string"&&(l[t]=r)}return l}function isCustomComponent(o,e){if(o.indexOf("-")===-1)return e&&typeof e.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var styleToJSOptions={reactCompat:!0};function setStyleProp$1(o,e){if(o!=null)try{e.style=styleToJS(o,styleToJSOptions)}catch{e.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$1.version.split(".")[0]>=16,elementsWithNoTextChildren=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(o){return!elementsWithNoTextChildren.has(o.name)}var utilities$3={PRESERVE_CUSTOM_ATTRIBUTES,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,elementsWithNoTextChildren},reactProperty=lib$4,utilities$2=utilities$3,attributesToProps$2=function o(e){e=e||{};var r={reset:!0,submit:!0},t,n,a,l,u,f={},d=e.type&&r[e.type];for(t in e){if(a=e[t],reactProperty.isCustomAttribute(t)){f[t]=a;continue}if(n=t.toLowerCase(),l=getPropName(n),l){switch(u=reactProperty.getPropertyInfo(l),(l==="checked"||l==="value")&&!d&&(l=getPropName("default"+n)),f[l]=a,u&&u.type){case reactProperty.BOOLEAN:f[l]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:a===""&&(f[l]=!0);break}continue}utilities$2.PRESERVE_CUSTOM_ATTRIBUTES&&(f[t]=a)}return utilities$2.setStyleProp(e.style,f),f};function getPropName(o){return reactProperty.possibleStandardNames[o]}var React=React$2,attributesToProps$1=attributesToProps$2,utilities$1=utilities$3,setStyleProp=utilities$1.setStyleProp,canTextBeChildOfNode=utilities$1.canTextBeChildOfNode;function domToReact$1(o,e){e=e||{};for(var r=e.library||React,t=r.cloneElement,n=r.createElement,a=r.isValidElement,l=[],u,f,d=typeof e.replace=="function",h,y,E,p=e.trim,_=0,g=o.length;_<g;_++){if(u=o[_],d&&(h=e.replace(u),a(h))){g>1&&(h=t(h,{key:h.key||_})),l.push(h);continue}if(u.type==="text"){if(f=!u.data.trim().length,f&&u.parent&&!canTextBeChildOfNode(u.parent)||p&&f)continue;l.push(u.data);continue}switch(y=u.attribs,skipAttributesToProps(u)?setStyleProp(y.style,y):y&&(y=attributesToProps$1(y)),E=null,u.type){case"script":case"style":u.children[0]&&(y.dangerouslySetInnerHTML={__html:u.children[0].data});break;case"tag":u.name==="textarea"&&u.children[0]?y.defaultValue=u.children[0].data:u.children&&u.children.length&&(E=domToReact$1(u.children,e));break;default:continue}g>1&&(y.key=_),l.push(n(u.name,y,E))}return l.length===1?l[0]:l}function skipAttributesToProps(o){return utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&o.type==="tag"&&utilities$1.isCustomComponent(o.name,o.attribs)}var domToReact_1=domToReact$1,CASE_SENSITIVE_TAG_NAMES$1=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],constants$2={CASE_SENSITIVE_TAG_NAMES:CASE_SENSITIVE_TAG_NAMES$1},node={},lib$3={},hasRequiredLib$1;function requireLib$1(){return hasRequiredLib$1||(hasRequiredLib$1=1,function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Doctype=o.CDATA=o.Tag=o.Style=o.Script=o.Comment=o.Directive=o.Text=o.Root=o.isTag=o.ElementType=void 0;var e;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(e=o.ElementType||(o.ElementType={}));function r(t){return t.type===e.Tag||t.type===e.Script||t.type===e.Style}o.isTag=r,o.Root=e.Root,o.Text=e.Text,o.Directive=e.Directive,o.Comment=e.Comment,o.Script=e.Script,o.Style=e.Style,o.Tag=e.Tag,o.CDATA=e.CDATA,o.Doctype=e.Doctype}(lib$3)),lib$3}var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var o=function(e,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},o(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(o){for(var e,r=1,t=arguments.length;r<t;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])}return o},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=requireLib$1(),nodeTypes=new Map([[domelementtype_1.ElementType.Tag,1],[domelementtype_1.ElementType.Script,1],[domelementtype_1.ElementType.Style,1],[domelementtype_1.ElementType.Directive,1],[domelementtype_1.ElementType.Text,3],[domelementtype_1.ElementType.CDATA,4],[domelementtype_1.ElementType.Comment,8],[domelementtype_1.ElementType.Root,9]]),Node$2=function(){function o(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(o.prototype,"nodeType",{get:function(){var e;return(e=nodeTypes.get(this.type))!==null&&e!==void 0?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),o.prototype.cloneNode=function(e){return e===void 0&&(e=!1),cloneNode(this,e)},o}();node.Node=Node$2;var DataNode=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.data=t,n}return Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),e}(Node$2);node.DataNode=DataNode;var Text$4=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Text,r)||this}return e}(DataNode);node.Text=Text$4;var Comment$1=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Comment,r)||this}return e}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(o){__extends(e,o);function e(r,t){var n=o.call(this,domelementtype_1.ElementType.Directive,t)||this;return n.name=r,n}return e}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(o){__extends(e,o);function e(r,t){var n=o.call(this,r)||this;return n.children=t,n}return Object.defineProperty(e.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),e}(Node$2);node.NodeWithChildren=NodeWithChildren;var Document=function(o){__extends(e,o);function e(r){return o.call(this,domelementtype_1.ElementType.Root,r)||this}return e}(NodeWithChildren);node.Document=Document;var Element$1=function(o){__extends(e,o);function e(r,t,n,a){n===void 0&&(n=[]),a===void 0&&(a=r==="script"?domelementtype_1.ElementType.Script:r==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var l=o.call(this,a,n)||this;return l.name=r,l.attribs=t,l}return Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(t){var n,a;return{name:t,value:r.attribs[t],namespace:(n=r["x-attribsNamespace"])===null||n===void 0?void 0:n[t],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[t]}})},enumerable:!1,configurable:!0}),e}(NodeWithChildren);node.Element=Element$1;function isTag(o){return(0,domelementtype_1.isTag)(o)}node.isTag=isTag;function isCDATA(o){return o.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(o){return o.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(o){return o.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(o){return o.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(o){return o.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(o){return Object.prototype.hasOwnProperty.call(o,"children")}node.hasChildren=hasChildren;function cloneNode(o,e){e===void 0&&(e=!1);var r;if(isText(o))r=new Text$4(o.data);else if(isComment(o))r=new Comment$1(o.data);else if(isTag(o)){var t=e?cloneChildren(o.children):[],n=new Element$1(o.name,__assign({},o.attribs),t);t.forEach(function(f){return f.parent=n}),o.namespace!=null&&(n.namespace=o.namespace),o["x-attribsNamespace"]&&(n["x-attribsNamespace"]=__assign({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(n["x-attribsPrefix"]=__assign({},o["x-attribsPrefix"])),r=n}else if(isCDATA(o)){var t=e?cloneChildren(o.children):[],a=new NodeWithChildren(domelementtype_1.ElementType.CDATA,t);t.forEach(function(d){return d.parent=a}),r=a}else if(isDocument(o)){var t=e?cloneChildren(o.children):[],l=new Document(t);t.forEach(function(d){return d.parent=l}),o["x-mode"]&&(l["x-mode"]=o["x-mode"]),r=l}else if(isDirective(o)){var u=new ProcessingInstruction$1(o.name,o.data);o["x-name"]!=null&&(u["x-name"]=o["x-name"],u["x-publicId"]=o["x-publicId"],u["x-systemId"]=o["x-systemId"]),r=u}else throw new Error("Not implemented yet: ".concat(o.type));return r.startIndex=o.startIndex,r.endIndex=o.endIndex,o.sourceCodeLocation!=null&&(r.sourceCodeLocation=o.sourceCodeLocation),r}node.cloneNode=cloneNode;function cloneChildren(o){for(var e=o.map(function(t){return cloneNode(t,!0)}),r=1;r<e.length;r++)e[r].prev=e[r-1],e[r-1].next=e[r];return e}var constants$1=constants$2,domhandler=node,CASE_SENSITIVE_TAG_NAMES=constants$1.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler.Comment,Element=domhandler.Element,ProcessingInstruction=domhandler.ProcessingInstruction,Text$3=domhandler.Text,caseSensitiveTagNamesMap={},tagName;for(var i$1=0,len=CASE_SENSITIVE_TAG_NAMES.length;i$1<len;i$1++)tagName=CASE_SENSITIVE_TAG_NAMES[i$1],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(o){return caseSensitiveTagNamesMap[o]}function formatAttributes(o){for(var e={},r,t=0,n=o.length;t<n;t++)r=o[t],e[r.name]=r.value;return e}function formatTagName(o){o=o.toLowerCase();var e=getCaseSensitiveTagName(o);return e||o}function formatDOM$1(o,e,r){e=e||null;for(var t=[],n=0,a=o.length;n<a;n++){var l=o[n],u;switch(l.nodeType){case 1:u=new Element(formatTagName(l.nodeName),formatAttributes(l.attributes)),u.children=formatDOM$1(l.childNodes,u);break;case 3:u=new Text$3(l.nodeValue);break;case 8:u=new Comment(l.nodeValue);break;default:continue}var f=t[n-1]||null;f&&(f.next=u),u.parent=e,u.prev=f,u.next=null,t.push(u)}return r&&(u=new ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),u.next=t[0]||null,u.parent=e,t.unshift(u),t[1]&&(t[1].prev=t[0])),t}function isIE$1(){return/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}var utilities={formatAttributes,formatDOM:formatDOM$1,isIE:isIE$1},HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head.*>/i,BODY_TAG_REGEX=/<body.*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if(typeof window.DOMParser=="function"){var domParser=new window.DOMParser,mimeType="text/html";parseFromString=function(o,e){return e&&(o="<"+e+">"+o+"</"+e+">"),domParser.parseFromString(o,mimeType)},parseFromDocument=parseFromString}if(document.implementation){var isIE=utilities.isIE,doc=document.implementation.createHTMLDocument(isIE()?"html-dom-parser":void 0);parseFromDocument=function(o,e){return e?(doc.documentElement.getElementsByTagName(e)[0].innerHTML=o,doc):(doc.documentElement.innerHTML=o,doc)}}var template=document.createElement("template"),parseFromTemplate;template.content&&(parseFromTemplate=function(o){return template.innerHTML=o,template.content.childNodes});function domparser$1(o){var e,r=o.match(FIRST_TAG_REGEX);r&&r[1]&&(e=r[1].toLowerCase());var t,n,a;switch(e){case HTML:return t=parseFromString(o),HEAD_TAG_REGEX.test(o)||(n=t.getElementsByTagName(HEAD)[0],n&&n.parentNode.removeChild(n)),BODY_TAG_REGEX.test(o)||(n=t.getElementsByTagName(BODY)[0],n&&n.parentNode.removeChild(n)),t.getElementsByTagName(HTML);case HEAD:case BODY:return a=parseFromDocument(o).getElementsByTagName(e),BODY_TAG_REGEX.test(o)&&HEAD_TAG_REGEX.test(o)?a[0].parentNode.childNodes:a;default:return parseFromTemplate?parseFromTemplate(o):parseFromDocument(o,BODY).getElementsByTagName(BODY)[0].childNodes}}var domparser_1=domparser$1,domparser=domparser_1,formatDOM=utilities.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(o){if(typeof o!="string")throw new TypeError("First argument must be a string");if(o==="")return[];var e=o.match(DIRECTIVE_REGEX),r;return e&&e[1]&&(r=e[1]),formatDOM(domparser(o),null,r)}var htmlToDom=HTMLDOMParser,lib$2={},hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(o){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(f,d,h,y){y===void 0&&(y=h);var E=Object.getOwnPropertyDescriptor(d,h);(!E||("get"in E?!d.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:function(){return d[h]}}),Object.defineProperty(f,y,E)}:function(f,d,h,y){y===void 0&&(y=h),f[y]=d[h]}),r=commonjsGlobal&&commonjsGlobal.__exportStar||function(f,d){for(var h in f)h!=="default"&&!Object.prototype.hasOwnProperty.call(d,h)&&e(d,f,h)};Object.defineProperty(o,"__esModule",{value:!0}),o.DomHandler=void 0;var t=requireLib$1(),n=node;r(node,o);var a=/\s+/g,l={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1,xmlMode:!1},u=function(){function f(d,h,y){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof h=="function"&&(y=h,h=l),typeof d=="object"&&(h=d,d=void 0),this.callback=d??null,this.options=h??l,this.elementCB=y??null}return f.prototype.onparserinit=function(d){this.parser=d},f.prototype.onreset=function(){this.dom=[],this.root=new n.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(d){this.handleCallback(d)},f.prototype.onclosetag=function(){this.lastNode=null;var d=this.tagStack.pop();this.options.withEndIndices&&(d.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(d)},f.prototype.onopentag=function(d,h){var y=this.options.xmlMode?t.ElementType.Tag:void 0,E=new n.Element(d,h,void 0,y);this.addNode(E),this.tagStack.push(E)},f.prototype.ontext=function(d){var h=this.options.normalizeWhitespace,y=this.lastNode;if(y&&y.type===t.ElementType.Text)h?y.data=(y.data+d).replace(a," "):y.data+=d,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{h&&(d=d.replace(a," "));var E=new n.Text(d);this.addNode(E),this.lastNode=E}},f.prototype.oncomment=function(d){if(this.lastNode&&this.lastNode.type===t.ElementType.Comment){this.lastNode.data+=d;return}var h=new n.Comment(d);this.addNode(h),this.lastNode=h},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var d=new n.Text(""),h=new n.NodeWithChildren(t.ElementType.CDATA,[d]);this.addNode(h),d.parent=h,this.lastNode=d},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(d,h){var y=new n.ProcessingInstruction(d,h);this.addNode(y)},f.prototype.handleCallback=function(d){if(typeof this.callback=="function")this.callback(d,this.dom);else if(d)throw d},f.prototype.addNode=function(d){var h=this.tagStack[this.tagStack.length-1],y=h.children[h.children.length-1];this.options.withStartIndices&&(d.startIndex=this.parser.startIndex),this.options.withEndIndices&&(d.endIndex=this.parser.endIndex),h.children.push(d),y&&(d.prev=y,y.next=d),d.parent=h,this.lastNode=null},f}();o.DomHandler=u,o.default=u}(lib$2)),lib$2}var domToReact=domToReact_1,attributesToProps=attributesToProps$2,htmlToDOM=htmlToDom;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(o,e){if(typeof o!="string")throw new TypeError("First argument must be a string");return o===""?[]:(e=e||{},domToReact(htmlToDOM(o,e.htmlparser2||domParserOptions),e))}HTMLReactParser.domToReact=domToReact;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps;HTMLReactParser.Element=requireLib().Element;htmlReactParser.exports=HTMLReactParser;htmlReactParser.exports.default=HTMLReactParser;var htmlReactParserExports=htmlReactParser.exports;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParserExports);HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Element;function LectureButtons({goToLecture:o,close:e,minutes:r,seconds:t,btnText:n}){return jsxRuntimeExports.jsx("div",{className:"lectures--buttons",children:o?jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:()=>e(),"aria-label":n,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__count","data-testid":"countdown",children:jsxRuntimeExports.jsxs("span",{children:[r<10?`0${r}`:r,":",t<10?`0${t}`:t]})})})}LectureButtons.defaultProps={goToLecture:!1,close:()=>{},minutes:0,seconds:0};const noop$1=()=>{},useEkho=({voice:o,text:e,audioType:r,loop:t=!1,started:n=!0,slide:a=0,audio:l,soundActions:u,emitEvent:f,volume:d=.5,onFinish:h=noop$1,onError:y=noop$1,onStart:E=noop$1,pauseTTS:p})=>{const[_,g,x,C]=u,R=!l&&!o,[S,A]=React$2.useState(!1),T=React$2.useRef({url:"",cc:"tts"}),w=React$2.useCallback(F=>f({type:"translate",payload:F}),[f]),P=React$2.useCallback(({id:F,type:G="base"})=>{var ee;const V=w("usedVoices"),W=w("gameCharacters");return G==="base"?V==null?void 0:V[F]:G==="character"?(ee=W==null?void 0:W[F])==null?void 0:ee.voiceId:null},[w]),O=React$2.useCallback((F,G="tts")=>{T.current.url===F&&a===T.current.slide||(T.current={url:F,cc:G,slide:a},_(F,G,t,d,h,E))},[a,_,t,d,h,E]),k=React$2.useCallback(async F=>{if(S&&F.voiceId&&F.text){const G=await f({type:"getSpeech",payload:F});G?O(G):y()}else y()},[f,S,y,O]),D=React$2.useCallback(()=>{T.current.url&&g(T.current.cc)},[g]);return React$2.useEffect(()=>(A(!0),()=>{A(!1),D()}),[D]),React$2.useEffect(()=>{p?x():C()},[x,p,C]),React$2.useEffect(()=>{R&&D()},[R,D]),React$2.useEffect(()=>{if(S&&n)if(r==="voice"&&(o!=null&&o.id)){const F=P(o);k({voiceId:F,text:e})}else(r==="file"||!r)&&l?O(l==null?void 0:l.url):y()},[P,k,S,o,e,r,l==null?void 0:l.url,l,O,y,n]),D},READING_TIME=.2;function LecturesComponent({emitEvent:o,name:e,name_labelId:r,required:t,text:n,text_labelId:a,visible:l,documentType:u,viewed:f,soundActions:d,backgroundImage:h,keyboardControl:y,audio:E,audioType:p,audioVolume:_,voice:g,pause:x,styles:C}){const[R,S]=React$2.useState(),[A,T]=React$2.useState(!1),[w,P]=React$2.useState(0),O=n,k=Math.trunc(O.split(" ").length*READING_TIME),D=!t||t&&w>=k||t&&!l,[F]=d,G=/<\/p>|<\/h1>|<\/h2>|<\/h3>|<\/h4>|<\/h5>|<\/h6>|<\/li>/gi,V=/&quot;|&#39;/gi,q=n.replace(G,". </p>").replace(V,"").replace(/(<([^>]+)>)/gi,""),z=`${e}. ${q}`;useEkho({audioType:p,voice:g,text:z,audio:E,soundActions:d,emitEvent:o,volume:_,pauseTTS:x});const U=Q=>o({type:"translate",payload:Q}),$=React$2.useCallback(()=>{D&&(F("click-ui"),o({type:"finishMedia",payload:{name:r,type:"text",text:a,documentType:u}}))},[u,o,D,r,a,F]);y(null,f?null:$,f?null:$),React$2.useEffect(()=>{if(!l&&!A&&($(),T(!0)),t&&l){const Q=setInterval(()=>{P(J=>J+1)},1e3);return S(Q),()=>{clearInterval(Q)}}},[$,t,A,l]),React$2.useEffect(()=>{w===k&&clearInterval(R)},[R,w,k]);const I=k-w,B=Math.floor(I/60),X=I%60;return l?jsxRuntimeExports.jsx("div",{className:`${f?"notes--results":`lectures--container lectures--container--${C}`} ${!f&&(h!=null&&h.url)?"lectures--container--with-custom-bg":""}`,style:!f&&(h!=null&&h.url)?{backgroundImage:`url('${h.url}')`}:{},children:jsxRuntimeExports.jsx("div",{className:f?"":"lectures__overlay",children:jsxRuntimeExports.jsxs("div",{className:f?"notes--results__text":`lectures lectures--${C}`,children:[jsxRuntimeExports.jsx("div",{className:"lectures--title",children:e}),jsxRuntimeExports.jsxs("div",{className:"lectures--text",dir:"auto",children:[jsxRuntimeExports.jsx("div",{children:O?HTMLReactParser$1(O):null}),f?null:jsxRuntimeExports.jsx(LectureButtons,{goToLecture:D,close:$,minutes:B,seconds:X,btnText:U("screens.continue")})]})]})})}):null}LecturesComponent.defaultProps={emitEvent:()=>{},name:"",text:"",visible:!1,documentType:"",viewed:!1,required:!1,context:{},styles:""};function Slot({character:o,active:e,slot:r,lowQuality:t}){var E;const n=o.type==="image",a=o.type==="character",l=o.type==="object",u=(E=o==null?void 0:o.resource)==null?void 0:E.url,f=()=>n?`url(${u})`:a&&t?`url(${u.replace("character.glb","face.png")})`:l&&t?`url(${u.replace("object.glb","thumbnail.png")})`:"",d=()=>n?"contain":a||l?"auto 95%":"",h=()=>n?"center":a||l?"center bottom":"",y=n||t?{backgroundImage:f(),backgroundRepeat:"no-repeat",backgroundPosition:h(),backgroundSize:d()}:{};return jsxRuntimeExports.jsx("div",{className:`conversation--character__item ${e?"active":""} ${r}`,style:y,children:e&&o.name?jsxRuntimeExports.jsx("span",{className:"conversation--character__name",children:o.name}):null},o.name)}Slot.propTypes={character:PropTypes.shape({name:PropTypes.string,url:PropTypes.string,type:PropTypes.string,emotion:PropTypes.string,uid:PropTypes.string,resource:PropTypes.shape({resourceId:PropTypes.string,url:PropTypes.string})}),active:PropTypes.bool,slot:PropTypes.number};Slot.defaultProps={character:{name:"",url:"",type:"",resource:{resourceId:""}},active:!1,slot:0};const defaultCamPos=[0,14.63,16],boneWhiteList=["l_eye_jnt","l_eye","eye_l","head_m"],isMobile=DeviceDetection(),loader$1=new GLTFLoader;function Panel({character:o,ttsStarted:e,active:r,emitEvent:t}){var g,x,C,R,S;const n=React$2.useRef(null),a=React$2.useRef(null),l=o.type==="character",u=React$2.useRef(),[f,d]=React$2.useState(!1),h=React$2.useMemo(()=>t({type:"currentLod"}),[t]),y=React$2.useRef(),E=React$2.useMemo(()=>{var A,T,w,P,O,k,D,F;return l?o.animationId&&((A=o.animation)!=null&&A.url)?o.animation:(P=(w=(T=o==null?void 0:o.resource)==null?void 0:T.animations)==null?void 0:w[o.emotion])!=null&&P.url?(k=(O=o==null?void 0:o.resource)==null?void 0:O.animations)==null?void 0:k[o.emotion]:(F=(D=o==null?void 0:o.resource)==null?void 0:D.animations)==null?void 0:F.neutral:{}},[o.emotion,o==null?void 0:o.animationId,o==null?void 0:o.animation,(g=o==null?void 0:o.resource)==null?void 0:g.animations,l]),p=React$2.useCallback(()=>{const{clipAction:A,defaultAnim:T}=y.current.userData.animation;T&&A(T,y.current)},[]);React$2.useEffect(()=>{var A,T,w;if(y.current)if(r)if(e){const P=(w=(T=(A=o==null?void 0:o.resource)==null?void 0:A.animations)==null?void 0:T.talking)==null?void 0:w.url;P&&loader$1.load(P,({animations:O})=>{const{defaultAnim:k,clipAction:D}=y.current.userData.animation;D(mixWithTalkingClip(O[0],k),y.current),d(!0)})}else p();else f&&p()},[(R=(C=(x=o==null?void 0:o.resource)==null?void 0:x.animations)==null?void 0:C.talking)==null?void 0:R.url,e,r,p,f]);const _=React$2.useCallback(A=>{var T;if(n.current){const w=new three.Box3;w.setFromObject(A);const P=w.getSize(new three.Vector3);if(n.current.position.fromArray(defaultCamPos),n.current.rotation.set(0,0,0),n.current.updateProjectionMatrix(),n.current.layers.enableAll(),o.type==="character"){y.current=A;let O;const k=(T=o.emotion)==null?void 0:T.includes("seated");n.current.position.setY(P.y-1.5*1.3),A.traverse(D=>{const F=D.name.toLowerCase();if(D.isBone&&boneWhiteList.includes(F)){const G=k?1:0,V=new three.Vector3().setFromMatrixPosition(D.matrixWorld);if(F==="head_m"){O=V;return}n.current.position.setY(V.y-G),n.current.position.setX(V.x-.5)}}),O&&!k&&n.current.lookAt(O),n.current.zoom=1.5}else o.type==="object"&&(cameraFitAnyObject(A,n.current),n.current.zoom=1);n.current.updateProjectionMatrix()}},[o.type,o.emotion]);return fiber.useFrame(({gl:A})=>{if(n.current&&a.current){const T=document.getElementsByClassName("conversation--character__item")[o.slot];if(T){const w=T.getBoundingClientRect(),P=T.parentNode.getBoundingClientRect(),[O,k]=[w.right-w.left,w.bottom-w.top];n.current.aspect=O/k,n.current.updateProjectionMatrix();const D={top:w.top-P.top,right:w.right-P.right,left:w.left-P.left,bottom:w.bottom-P.bottom};u.current&&_(u.current);const F=isMobile?24:40;D.bottom+=r?-F:F,A.setViewport(D.left,D.bottom,O,k),A.setScissor(D.left,D.bottom,O,k),A.render(a.current,n.current)}}},1),o.type==="image"?null:jsxRuntimeExports.jsxs("scene",{ref:a,children:[(S=o.resource)!=null&&S.url?jsxRuntimeExports.jsx(arcadeThreeCore.QualityManager,{lod:h,children:jsxRuntimeExports.jsx(arcadeThreeCore.SceneResource,{ref:u,name:`char_${o.uid}`,url:o.resource.url,animationUrl:E.url,type:o.type,position:[0,0,0],onLoad:_,interactive:!1})}):null,jsxRuntimeExports.jsx(drei.PerspectiveCamera,{name:`camera_${o.uid}`,fov:35,focus:10,ref:n,position:defaultCamPos,makeDefault:!0,defaultCamera:!0}),jsxRuntimeExports.jsx(LightSet,{})]})}const Panels=({characters:o,slots:e,ttsStarted:r,activeIndex:t,flex:n,lodSettings:a,emitEvent:l})=>e.map((u,f)=>{let d=null;const h=o.findIndex(y=>y&&y.uid===u.uid);if(h>=0){const y=n?h:f;return d={...o[h]},d.slot=y,jsxRuntimeExports.jsx(Panel,{character:d,active:t===y,lodSettings:a,ttsStarted:r,emitEvent:l},`${`${d.uid}_${f}`}_${h}`)}return null});function PanelsWrapper({characters:o,slots:e,ttsStarted:r,slotRefs:t,flex:n,currentMessage:a,emitEvent:l}){return fiber.useFrame(({gl:u})=>{u.setScissorTest(!1),u.clear(!0,!0),u.setScissorTest(!0)}),jsxRuntimeExports.jsx(Panels,{ttsStarted:r,characters:o,slots:e,slotRefs:t,flex:n,activeIndex:a.position,emitEvent:l})}function Scene(o){return o.lowQuality?null:jsxRuntimeExports.jsxs(arcadeThreeCore.Renderer,{className:"conversation--canvas",style:{position:"absolute",width:"100%",height:"100%"},gl:{antialias:!0},fullscreen:!1,onCreated:({gl:e})=>{e.setClearColor("white",0)},frameloop:"demand",children:[jsxRuntimeExports.jsx(arcadeThreeCore.SettingsController,{current:{animate:o.pause}}),jsxRuntimeExports.jsx(React$2.Suspense,{fallback:null,children:jsxRuntimeExports.jsx(PanelsWrapper,{...o})})]})}function SlotList({characters:o,actors:e,lodSettings:r,ttsStarted:t,currentMessage:n,flex:a,slots:l,children:u,pause:f,emitEvent:d}){const h=({character:C,active:R,slot:S})=>({character:C,active:R,emotion:R?n.emotion:"neutral",slot:S}),E=React$2.useMemo(()=>d({type:"currentLod"}),[d])==="divideby64",p=l.reduce((C,R)=>{var T,w;const S=e==null?void 0:e.find(P=>P.uid===R.uid),A={...R};if(R.character)A.name=R.alias||R.character.name,A.resource=A.character.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type="character",C.push(A);else if(S){const{resource:P}=S;A.name=R.alias||R.name,A.position=A.position>=0?A.position:-1,A.resource=P,A.type=S.type,C.push(A)}else R.type?(A.name=R.alias||((T=R.character)==null?void 0:T.name)||R.name,A.resource=((w=A.character)==null?void 0:w.resource)||R.resource,A.position=A.position>=0?A.position:-1,delete A.character,A.type=R.type,C.push(A)):a||C.push(null);return C},[]),_=p.length&&p.some(C=>C),g=o.filter(C=>l.find(R=>C.uid===R.uid));function x(){return _?p.map((C,R)=>C?jsxRuntimeExports.jsx(Slot,{emitEvent:d,lowQuality:E,...h({character:C,active:n.position===C.position,slot:R})},`${C.uid+R}`):jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`void_${0+R}`)):a?g.map((C,R)=>{const S=n.position===R;return jsxRuntimeExports.jsx(Slot,{...h({character:C,active:S,slot:R})},`${C.uid+R}`)}):l.length>0?l.map((C,R)=>{const S=o.find(A=>A.uid===C.uid);if(S){const A=n.position===R;return S.name=C.alias||S.name,jsxRuntimeExports.jsx(Slot,{...h({character:S,active:A,slot:R})},`${S.uid+R}`)}return jsxRuntimeExports.jsx("div",{className:`conversation--character__item void ${R}`},`${0+R}`)}):null}return jsxRuntimeExports.jsxs("div",{className:"conversation--characters",children:[jsxRuntimeExports.jsx(Scene,{characters:_?p:g,slots:l,flex:a,currentMessage:n,lodSettings:r,ttsStarted:t,pause:f,emitEvent:d,lowQuality:E}),u||jsxRuntimeExports.jsx(x,{})]})}SlotList.defaultProps={characters:[],currentMessage:{},flex:!0,slots:[]};function Options({inherited:o,options:e,selectedChoice:r,selectChoice:t,showingResults:n,simplifiedOptions:a,required:l}){const[u,f]=React$2.useState(null),d=y=>{a?(f(y.id),setTimeout(()=>{t(y)},1e3)):t(y)},h=y=>!!(n&&r.id===y.id||r.right===!0||n&&!l);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&e.filter(y=>y.text).map(y=>jsxRuntimeExports.jsxs("div",{className:`${o?"conversation--question custom-radio":"custom-radio"}
67
+ ${u===y.id?"radio-text-clicked":""}`,children:[jsxRuntimeExports.jsx("input",{onChange:()=>{d(y)},className:"radio",type:"radio",id:y.text,name:y.id,defaultChecked:r.id===y.id,disabled:h(y)}),jsxRuntimeExports.jsx("label",{className:`${y.right?"radio-text-success":"radio-text-fail"}`,htmlFor:y.text,children:y.text})]},y.id))})}const noop=()=>{};function BasicDecision({children:o,question:e,showingResults:r,selected:t,required:n,failed:a,onNext:l,translate:u,hasRewards:f,options:d}){return jsxRuntimeExports.jsxs("div",{className:`popup popup__large popup__basicDecision ${r&&t.feedback?"popup__feedback":""}`,children:[jsxRuntimeExports.jsx("div",{className:"popup--info",children:r?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[o,!t.feedback&&f.length===0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e!==""&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e})}),!t.feedback&&f.length>0&&jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})]}):jsxRuntimeExports.jsx("span",{className:"popup--info__title",children:e})}),jsxRuntimeExports.jsx("div",{className:"popup__questions",dir:"auto",children:jsxRuntimeExports.jsx(Options,{...d})}),jsxRuntimeExports.jsx("div",{className:"popup--buttons",children:(n?!a:t.id!==void 0)?jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn__navigation ${t.id!==void 0?"":"disabled"}`,onClick:()=>t.id!==void 0&&l(),"aria-label":u("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null})]})}function ComplexDecision({question:o,inScene:e,disabled:r,onNext:t,children:n}){return jsxRuntimeExports.jsxs("div",{dir:"auto",className:`conversation--body ${e?"conversation--body--inScene":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"conversation--message",children:[o!==""&&jsxRuntimeExports.jsx("span",{className:"conversation--main__text",children:o}),n]}),jsxRuntimeExports.jsxs("div",{className:"conversation--controls conversation--controls--fixedbottom",children:[jsxRuntimeExports.jsx("div",{className:"gat--btn__round disabled",children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${r?"disabled":""}`,type:"button",onClick:()=>!r&&t(),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})}function DecisionBody({options:o,question:e,inherited:r,branched:t,changeOption:n,onNext:a,failed:l,showingResults:u,currentSelectedChoice:f,children:d,translate:h,hasRewards:y,inScene:E,required:p,simplifiedOptions:_}){const[g,x]=React$2.useState(f),C=A=>{x(A),u&&l&&n(A),a(A)},R=!u&&g.id!==void 0||!l,S={inherited:r,selectedChoice:g,selectChoice:(!p||t)&&g.id!==void 0||p&&!l?noop:C,options:o,showingResults:u,simplifiedOptions:_,required:p};return r?jsxRuntimeExports.jsx(ComplexDecision,{disabled:!R,question:e,inScene:E,onNext:()=>a(g),children:jsxRuntimeExports.jsx(Options,{...S})}):jsxRuntimeExports.jsx(BasicDecision,{question:e,showingResults:u,selected:g,required:p,failed:l,onNext:()=>a(g),translate:h,hasRewards:y,options:S,children:d})}function Wrapper({children:o,inherit:e,feedback:r}){return e?jsxRuntimeExports.jsx("div",{className:`conversation--feedback ${r?"":"only--rewards"}`,children:o}):r?o:jsxRuntimeExports.jsx("div",{className:"popup__basicDecision__only--rewards only--rewards",children:o})}function FeedBack({choice:o,inherited:e,question:r}){return o.feedback?jsxRuntimeExports.jsx(Wrapper,{inherit:e,feedback:o.feedback,children:o.feedback?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"conversation--feedback__title",children:r}),jsxRuntimeExports.jsxs("div",{className:"conversation--feedback__text",dir:"auto",children:[o.right?jsxRuntimeExports.jsx("span",{className:"icon-check-circle-black color--success"}):jsxRuntimeExports.jsx("span",{className:"icon-error-circle-black color--error"}),jsxRuntimeExports.jsx("p",{children:o.feedback})]})]}):null}):null}function DecisionComponent({emitEvent:o,soundActions:e,keyboardControl:r,inScene:t,...n}){const{inheritProps:a={},decisionNumber:l,required:u,question:f,onAddPoints:d,onFinish:h,branched:y,simplifiedOptions:E}=n,p=Object.keys(a).length>0,[_,g]=React$2.useState("options"),[x,C]=React$2.useState({}),[R]=e,S=u&&!x.right,A=V=>{var W;(W=V.audio)!=null&&W.url&&R(V.audio.url,"audio_file",!1,V.audioVolume)},T={...a,slots:a.slots?a.slots:a.characters,currentMessage:{position:null,emotion:""},emitEvent:o};a&&a.flex&&T.slots&&(T.characters=T.characters.filter(V=>T.slots.find(W=>W.uid===V.uid)));const w=V=>{o({type:"decisionJournal",payload:{choice:V,decisionNumber:l}})},P=V=>{!S&&_==="results"?(R("click-ui"),p?E?h&&(w(V),h(V,()=>{C({}),g("options")})):(d&&d(V),w(V),o({type:"addPoints",payload:V.rewards,finish:!1,complex:!0,onFinish:()=>{h?h(V,()=>{C({}),g("options")}):o({type:"success"}),C({}),g("options")}})):(w(V),o({type:"addPoints",payload:V.rewards,finish:!0,complex:!0}))):Object.keys(V).length>0&&(R("click-ui"),E?(w({...V,simplified:!0}),h(V,()=>{C({}),g("options")})):(V.right?R("score"):(R("fail"),y||(p||u?(w(V),o({type:"addPoints",payload:V.rewards,finish:!1,complex:!0})):u||(C({}),g("options")))),C(V),A(V),g("results")))},O={...n,selectView:g,selectedView:_,emitEvent:o,inherited:p,branched:y,soundActions:e,showingResults:_==="results",currentSelectedChoice:x,hasRewards:x.rewards||[],failed:S,inScene:t,required:u,simplifiedOptions:E,changeOption:V=>{R("click-ui"),C(V),g("options")},onNext:P,translate:V=>o({type:"translate",payload:V})};r(null,_==="results"&&!S?()=>{P(x)}:null);const k=({children:V})=>p?jsxRuntimeExports.jsx("div",{className:`conversation--layer
68
+ ${x.feedback?"":"conversation--layer__defaultFeedback"}
69
+ ${_==="results"?"conversation--layer__feedback":""}`,children:V}):V,D=({children:V})=>jsxRuntimeExports.jsx("div",{className:"popup--layer",children:V}),F=({children:V})=>{var ee,q;let W={};return W=(ee=a.background)!=null&&ee.img?{backgroundImage:`url("${(q=a.background.img)==null?void 0:q.url}")`}:null,jsxRuntimeExports.jsxs("div",{className:`conversation ${t?"conversation--inScene":""}`,style:W,children:[jsxRuntimeExports.jsx(SlotList,{...T,children:V}),jsxRuntimeExports.jsx(DecisionBody,{...O})]})},G=()=>p?jsxRuntimeExports.jsx(F,{children:_==="results"&&x.feedback?jsxRuntimeExports.jsx(FeedBack,{question:f,soundActions:e,inherited:p,choice:x,rewards:x.rewards||[],emitEvent:o}):null}):jsxRuntimeExports.jsx(D,{children:jsxRuntimeExports.jsx(DecisionBody,{...O,children:jsxRuntimeExports.jsx(FeedBack,{question:f,soundActions:e,inherited:p,choice:x,rewards:x.rewards||[],emitEvent:o})})});return jsxRuntimeExports.jsx(k,{children:jsxRuntimeExports.jsx(G,{})})}function ImageComponent({emitEvent:o,img:e,imgName:r,documentType:t,visible:n,viewed:a,imgId_labelId:l,soundActions:u,keyboardControl:f}){const d=g=>o({type:"translate",payload:g}),[h,y]=React$2.useState(!1),E=e.url,[p]=u,_=React$2.useCallback(()=>{p("click-ui"),o({type:"finishMedia",payload:{imgId:l,name:r,imgName:r,documentType:t,type:"image"}})},[p,l,r,t,o]);return f(null,a?null:_,a?null:_),React$2.useEffect(()=>{!n&&!h&&(y(!0),_())},[_,n,h]),n?jsxRuntimeExports.jsx("div",{className:a?"notes--results":"readings--container readings--container--darkopacity",children:jsxRuntimeExports.jsxs("div",{className:a?"notes--results__text":"readings readings--image",children:[E&&jsxRuntimeExports.jsx("img",{src:E,alt:r}),a?null:jsxRuntimeExports.jsx("div",{className:E?"readings--image--closeBtn":"position--absolute top right",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__round gat--btn__close",onClick:_,"aria-label":d("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})})]})}):null}function VoiceOver({name:o}){return jsxRuntimeExports.jsx("div",{className:"conversation--voice__over",children:jsxRuntimeExports.jsx("span",{children:o||"Voice-Over"})})}function ThinkFul({text:o}){return jsxRuntimeExports.jsxs("div",{className:"conversation--voice__over",children:[jsxRuntimeExports.jsx("span",{className:"icon-bubble-thinkful-black"}),jsxRuntimeExports.jsxs("span",{children:["[",o,"]"]})]})}function Message({current:o,translate:e}){var t,n;const r=o.text;return jsxRuntimeExports.jsxs("div",{className:`conversation--message ${o.voiceOver||(t=o==null?void 0:o.emotion)!=null&&t.includes("think")?"voice--over":""}`,children:[o.voiceOver?jsxRuntimeExports.jsx(VoiceOver,{name:o.name}):null,(n=o==null?void 0:o.emotion)!=null&&n.includes("think")?jsxRuntimeExports.jsx(ThinkFul,{text:e("emotion.thinking")}):null,jsxRuntimeExports.jsx("span",{className:"conversation--main__text",children:r})]})}Message.defaultProps={current:{},voiceOver:!1};const characterMs$2=75,minMs$1=1400;function ConversationalProComponent({keyboardControl:o,emitEvent:e,pause:r,lines:t,edges:n,characters:a,actors:l,background:u,soundActions:f,lodSettings:d,autoPlay:h,autoEnd:y,progress:E}){var Ze,rt,qt;const p=(E==null?void 0:E.line)||0,[_,g]=React$2.useState(!1),[x,C]=React$2.useState(!0),[R,S]=React$2.useState(!!h),[A,T]=React$2.useState(!1),[w,P]=React$2.useState(p),[O,k]=React$2.useState(!1),[D]=f,{start:F,stop:G}=useTimeout(),V=((Ze=u==null?void 0:u.img)==null?void 0:Ze.url)||null,W=t[w],{voiceOver:ee,decision:q}=W;let z=[];const U=!!n,$=ee||W.type==="conversationalNarration",I=q||W.type==="conversationalDecision";let{flex:B}=W;const[X,Q]=React$2.useState([]),J=React$2.useMemo(()=>X[X.length-1],[X]),ne=React$2.useCallback(()=>{const We=n.find(pe=>pe.fromId===J)||n.find(pe=>pe.toId===J),at=t.find(pe=>pe.id===(We==null?void 0:We.fromId));return!J&&(E==null?void 0:E.line)>=0?{decision:!0}:at},[n,t,J,E==null?void 0:E.line]),ae=React$2.useCallback(()=>{if(U){const at=ne();return at==null?void 0:at.decision}const We=t[w-1]?t[w-1]:{};return w>0&&(We==null?void 0:We.decision)},[U,ne,t,w]),Z=React$2.useCallback(We=>e({type:"translate",payload:We}),[e]),se=React$2.useMemo(()=>{var at,pe;if(I)return{};if($)return W;const We=(at=W==null?void 0:W.slots)==null?void 0:at.find(me=>me.uid&&me.talking);return We||((pe=W==null?void 0:W.slots)==null?void 0:pe.find(me=>me.uid&&me.text))},[W,$,I]),oe=t.slice(0,w+1).reverse().find(We=>We.slots),fe=!I&&((rt=W.slots)==null?void 0:rt.filter(We=>We.uid).length),de=characterMs$2*(((qt=se==null?void 0:se.text)==null?void 0:qt.length)||0);let ce=[];W.slots?ce=W.slots:oe&&(ce=oe.slots);const Se=ce.filter(We=>We.uid).map(We=>{const at=(a||l||[]).find(pe=>pe.uid===We.uid);return at&&(We.resource=at.resource,We.type=at.type),We.resource||(We.resource={}),We}),Le={characters:Se,lodSettings:d,actors:l,currentMessage:se||{},slots:$?z:W.slots,flex:B,pause:r,emitEvent:e};if($){const We=t.slice(w).find(pe=>pe.slots),at=oe||We;at&&(z=at.slots,B=at.flex)}else if(!I&&fe&&(W.slots.forEach(We=>{const at=Se.findIndex(pe=>pe.uid===We.uid);at>=0&&(Se[at].emotion=We.emotion)}),se&&se.uid)){const We=W.slots.findIndex(pe=>pe.uid===se.uid),at=Se.findIndex(pe=>pe.uid===se.uid);Se.forEach(pe=>{pe.uid===se.uid&&(pe.name=se.alias)}),se.position=B?at:We}const Ne=React$2.useCallback(()=>{e({type:"success"})},[e]),He=React$2.useCallback((We,at)=>{const pe=[3,2,1][We.id],ye=n.filter(De=>De.fromId===W.id).find(De=>parseInt(De.fromPointIndex)===pe);if(ye){const De=t.findIndex(Be=>Be.id===ye.toId);ye.fromId===ye.toId?at():De>=0?(P(De),e({type:"notifyProgress",payload:{line:De}})):Ne()}else Ne()},[W.id,n,e,Ne,t]),Ke=React$2.useCallback((We=!0)=>{const at=We?["fromId","toId"]:["toId","fromId"],pe=n.filter(De=>De[at[0]]===W.id),me=pe.length===1?pe[0]:pe.find(De=>De[at[1]]===J);if(!(me!=null&&me[at[0]]))return;We||Q(X.slice(0,-1));const ye=t.findIndex(De=>De.id===me[at[1]]);ye>=0?(P(ye),e({type:"notifyProgress",payload:{line:ye}})):Ne()},[W.id,n,X,e,Ne,J,t]),Qe=React$2.useCallback(We=>{if(U){if(We){const at=[3,2,1][We.id],me=n.filter(ye=>ye.fromId===W.id).find(ye=>parseInt(ye.fromPointIndex)===at);if(me){const ye=t.findIndex(De=>De.id===me.toId);ye>=0&&e({type:"notifyProgress",payload:{line:ye}})}else e({type:"saveNode"})}}else if(w<t.length-1){const pe=w+1;e({type:"notifyProgress",payload:{line:pe}})}else e({type:"saveNode"})},[n,t,e,w,W.id,U]),dt=React$2.useCallback((We,at)=>{let pe=!1;if(k(!1),Q([...X,W.id]),C(!1),T(!1),U)We?He(We,at):Ke();else if(w<t.length-1){const ye=w+1;P(ye),e({type:"notifyProgress",payload:{line:ye}})}else y||W.decision?Ne():pe=!0;pe||C(!0)},[y,e,w,W.decision,W.id,Ne,Ke,He,U,t.length,X]),yt=()=>{if(C(!1),k(!1),T(!1),U)Ke(!1);else if(!ae()){const We=w-1;P(We),e({type:"notifyProgress",payload:{line:We}})}C(!0)},ut=React$2.useCallback(()=>U?W&&W.type!=="conversationalDecision"&&!n.find(We=>We.fromId===W.id):w===t.length-1,[w,W,n,U,t.length]),ft=()=>{D("click-ui"),ut()?Ne():(S(!1),dt())},Xt=()=>{D("click-ui"),S(!1),yt()},kt=R&&!I&&!r,Ge=React$2.useMemo(()=>w===0||ae(),[w,ae]);if(useEkho({audioType:W==null?void 0:W.audioType,volume:W==null?void 0:W.audioVolume,voice:W==null?void 0:W.voice,started:x,slide:w,text:se==null?void 0:se.text,audio:W==null?void 0:W.audio,soundActions:f,emitEvent:e,pauseTTS:r,onStart:()=>{var We;(We=se==null?void 0:se.emotion)!=null&&We.includes("think")||k(!0)},onError:()=>{T(!0)},onFinish:()=>{k(!1),kt&&dt()}}),React$2.useEffect(()=>{var at;let We;return I?()=>{}:(((W==null?void 0:W.audioType)==="none"||A)&&!((at=se==null?void 0:se.emotion)!=null&&at.includes("think"))&&(k(!0),We=setTimeout(()=>{k(!1)},de<minMs$1?minMs$1:de)),()=>{We&&clearTimeout(We)})},[A,W,se==null?void 0:se.emotion,de,I]),React$2.useEffect(()=>(kt&&((W==null?void 0:W.audioType)==="none"||A)&&(!ut()||ut()&&y)&&F(dt,de<minMs$1?minMs$1:de),()=>{G()}),[se,F,G,dt,W==null?void 0:W.audioType,kt,A,y,t,ut,de]),React$2.useEffect(()=>{if(U&&!_){const We=E==null?void 0:E.line;if(We>=0){g(!0),P(We);return}const at=t.filter(pe=>!n.find(me=>me.toId===pe.id));if(at.length){const pe=at[0],me=t.indexOf(pe);me>=0&&(g(!0),P(me))}}},[n,U,t,_,E==null?void 0:E.line]),o(I||Ge?null:Xt,I?null:ft),I){const We={...W.payload,decisionNumber:t.filter(at=>at.decision).findIndex(at=>at.id===t[w].id)+1,required:!U,branched:U,onAddPoints:Qe,onFinish:dt,keyboardControl:o,emitEvent:e,soundActions:f,inheritProps:{characters:Se,background:u,flex:oe?oe.flex:!0,slots:oe?oe.slots:[]}};return jsxRuntimeExports.jsx(DecisionComponent,{...We})}return jsxRuntimeExports.jsx("div",{className:"conversation--layer",children:jsxRuntimeExports.jsxs("div",{className:"conversation",style:V?{backgroundImage:`url("${V}")`}:null,children:[jsxRuntimeExports.jsx(SlotList,{...Le,ttsStarted:O}),jsxRuntimeExports.jsxs("div",{className:"conversation--body",dir:"auto",children:[se?jsxRuntimeExports.jsx(Message,{current:se,translate:Z}):null,jsxRuntimeExports.jsxs("div",{className:"conversation--controls",children:[jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${Ge?"disabled":""}`,disabled:Ge?!0:"",type:"button",onClick:Xt,"aria-label":LangIsRtl()?Z("storylines.misc.forward"):Z("storylines.misc.rewind"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${R&&ut()?"glowing-animation":""}`,type:"button",onClick:ft,"aria-label":LangIsRtl()?Z("storylines.misc.rewind"):Z("storylines.misc.forward"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]})]})})}ConversationalProComponent.defaultProps={background:{},emitEvent:()=>{},soundActions:[()=>{},()=>{}]};function ConversationalComponent({emitEvent:o,soundActions:e,messages:r,characters:t,alias:n,background:a,lodSettings:l}){var g;const[u,f]=React$2.useState(0),[d]=e,h=((g=a==null?void 0:a.img)==null?void 0:g.url)||null,y=r[u],E=t.map((x,C)=>({...x,name:n[C]?n[C]:x.name,uid:C})),p=()=>{const x=r.length-1;d("click-ui"),u+1<=x?f(u+1):o({type:"success"})},_=()=>{u>0&&(f(u-1),d("click-ui"))};return jsxRuntimeExports.jsx("div",{className:"conversation--layer",children:jsxRuntimeExports.jsxs("div",{className:"conversation arcade-conversation",style:h?{backgroundImage:`url("${h}")`}:{},children:[jsxRuntimeExports.jsx(SlotList,{characters:E,lodSettings:l,currentMessage:y,slots:E,emitEvent:o,flex:!0}),jsxRuntimeExports.jsxs("div",{className:"conversation--body",children:[y?jsxRuntimeExports.jsx(Message,{current:y,voiceOver:y.emotion===null}):jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsxs("div",{className:"conversation--controls arcade-conversation--controls",children:[jsxRuntimeExports.jsx("button",{className:`gat--btn__round ${u>0?"":"visibility--hidden"}`,type:"button",onClick:_,children:jsxRuntimeExports.jsx("span",{className:"icon-back"})}),jsxRuntimeExports.jsx("button",{className:"gat--btn__round",type:"button",onClick:p,children:jsxRuntimeExports.jsx("span",{className:"icon-next"})})]})]})]})})}function Vignette({vignette:o,alias:e,translate:r}){var f;const n=(o.img||{url:"https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg"}).url,[a,l]=React$2.useState(!0),u=d=>{document.querySelector(`#${d}`).focus(),l(!a)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"comic--image",children:n&&jsxRuntimeExports.jsx("img",{src:n,alt:"comic pic"})}),(f=o==null?void 0:o.textData)!=null&&f.text?jsxRuntimeExports.jsxs("div",{className:`comic-collapsable ${a?"comic-collapsable--opened":""}`,children:[jsxRuntimeExports.jsx("button",{id:"buttonDown",onClick:()=>u("buttonUp"),type:"button",className:"un-btn comic-collapsable__headertoggle","aria-label":r("comic.toggleText"),children:jsxRuntimeExports.jsx("span",{className:"icon-down-arrow"})}),jsxRuntimeExports.jsxs("div",{className:"comic-collapsable__text",children:[e?jsxRuntimeExports.jsxs("b",{children:[e,": "]}):null,o.textData.text]})]}):null,jsxRuntimeExports.jsx("button",{id:"buttonUp",tabIndex:a?"-1":"0","aria-hidden":a,className:`unset-button comic-buttonup
70
+ ${a?"":"comic-buttonup--visible"}`,type:"button",onClick:()=>u("buttonDown"),"aria-label":r("comic.toggleText"),children:jsxRuntimeExports.jsx("span",{className:"icon-up-arrow"})})]})}function Slide({slide:o,transition:e,translate:r}){const t=o.transitionEffects||e;return jsxRuntimeExports.jsx("div",{className:`comic--slide__item ${t}`,"aria-label":"comic slide item",children:o.vignettes.map(n=>jsxRuntimeExports.jsx(Vignette,{vignette:n,alias:o.alias,"aria-hidden":"true",translate:r},`Vignete ${n.vignetteOrder}`))})}const characterMs$1=75;function ComicComponent({slides:o,emitEvent:e,soundActions:r=[()=>{},()=>{}],autoPlay:t,autoEnd:n,pause:a,progress:l,keyboardControl:u}){var V,W,ee,q,z,U,$,I;const f=(l==null?void 0:l.slide)||0,d=B=>e({type:"translate",payload:B}),[h,y]=React$2.useState(!0),[E,p]=React$2.useState(!!t),[_,g]=React$2.useState(!1),{start:x,stop:C}=useTimeout(),[R,S]=React$2.useState(f),[A,T]=React$2.useState("slide-animation"),[w]=r,P=o==null?void 0:o[R],O=React$2.useCallback(()=>{y(!1),e({type:"success"})},[e]),k=React$2.useCallback(()=>{if(y(!1),g(!1),R+1<o.length&&!a){const B=R+1;T("slide-animation"),S(B),y(!0),e({type:"notifyProgress",payload:{slide:B}})}else n&&!a&&O()},[R,o.length,a,n,e,O]),D=React$2.useCallback(()=>{if(y(!1),g(!1),R-1>=0){const B=R-1;T("slide-animation"),S(B),y(!0),w("click-ui"),e({type:"notifyProgress",payload:{slide:B}})}},[w,R,e]),F=()=>{w("click-ui"),p(!1),k()},G=()=>{w("click-ui"),p(!1),D()};return u(R>0?G:null,R+1>=o.length&&O||(R+1<o.length?F:null),R+1>=o.length?O:null),useEkho({audioType:(V=o==null?void 0:o[R])==null?void 0:V.audioType,voice:(W=o==null?void 0:o[R])==null?void 0:W.voice,text:(q=(ee=o==null?void 0:o[R])==null?void 0:ee.vignettes[0].textData)==null?void 0:q.text,audio:(z=o==null?void 0:o[R])==null?void 0:z.audio,slide:R,started:h,soundActions:r,emitEvent:e,pauseTTS:a,volume:(U=o==null?void 0:o[R])!=null&&U.audioVolume||(($=o==null?void 0:o[R])==null?void 0:$.audioVolume)===0?(I=o==null?void 0:o[R])==null?void 0:I.audioVolume:.5,onError:()=>{g(!0)},onFinish:()=>{E&&!(P!=null&&P.slideTimer)&&k()}}),React$2.useEffect(()=>{var B,X;if(E){if(P!=null&&P.slideTimer)x(k,P.slideTimer*1e3);else if((P==null?void 0:P.audioType)==="none"&&!a||_&&!a){const Q=characterMs$1*(((X=(B=P==null?void 0:P.vignettes[0])==null?void 0:B.textData)==null?void 0:X.text.length)||0);x(k,Q<1400?1400:Q)}}return()=>{C()}},[_,E,k,a,P==null?void 0:P.audio,P==null?void 0:P.audioType,P==null?void 0:P.slideTimer,P==null?void 0:P.vignettes,x,C]),o!=null&&o.length?jsxRuntimeExports.jsx("div",{dir:LangIsRtl()?"rtl":"auto",className:"comic component growIn-animation",role:"main","aria-label":"Comic",children:jsxRuntimeExports.jsxs("div",{className:"comic--slider",role:"navigation","aria-label":"Slider",children:[o[R]&&jsxRuntimeExports.jsx(Slide,{slide:o[R],transition:A,soundActions:r,emitEvent:e,role:"complementary","aria-hidden":"true",translate:d},`comic page ${o[R].slideOrder}`),R>0&&jsxRuntimeExports.jsx("button",{type:"button",className:"comic-control comic-control--left gat--btn__round","data-testid":"btn-bck",onClick:G,"aria-label":LangIsRtl()?d("comic.next"):d("comic.previous"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),R<o.length&&jsxRuntimeExports.jsx("button",{type:"button",className:`comic-control comic-control--right gat--btn__round
71
+ ${E&&R+1>=o.length?"glowing-animation":""}`,"data-testid":"btn-nxt",onClick:()=>{R+1<o.length?F():(w("click-ui"),O())},"aria-label":LangIsRtl()?d("comic.previous"):d("comic.next"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})}):null}function CartelComponent({img:o,text:e,audio:r,audioType:t,voice:n,emitEvent:a,soundActions:l,audioVolume:u,pause:f,keyboardControl:d}){const h=R=>a({type:"translate",payload:R}),y=(o==null?void 0:o.url)||"https://min.gamelearn.io/css-resources/gamelearn/resources/conversation.jpg",E=React$2.useRef(),p=React$2.useRef(),[_]=l;useEkho({audioType:t,voice:n,text:e,audio:r,soundActions:l,emitEvent:a,volume:u,pauseTTS:f});const g=()=>{_("click-ui"),a({type:"success"})};d(null,g,g);const x=(R,S)=>window.matchMedia("(min-width: 1280px)").matches?S:R,C=React$2.useCallback(()=>{if(e&&p.current){const R=p.current.naturalWidth/p.current.naturalHeight;let S=p.current.height*R,A=p.current.height;if(S>p.current.width&&(S=p.current.width,A=p.current.width/R),E.current.style.width=`${S}px`,window.innerHeight<p.current.width)E.current.style.bottom=`${x(24,48)+x(36,100)}px`;else{const T=(window.innerHeight-A)/2+x(36,100);E.current.style.bottom=`${T}px`}}},[e]);return React$2.useEffect(()=>{p.current&&new ResizeObserver(()=>x(24,48)&&C()).observe(p.current)}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"cartel",children:jsxRuntimeExports.jsxs("div",{className:"cartel__imagewrap",children:[jsxRuntimeExports.jsx("img",{ref:p,onLoad:C,className:"cartel__image",src:y,alt:"cartel pic"}),e?jsxRuntimeExports.jsx("div",{ref:E,className:"cartel__textwrap",children:jsxRuntimeExports.jsx("div",{className:"cartel__text",children:jsxRuntimeExports.jsx("span",{children:e})})}):null]})}),jsxRuntimeExports.jsx("div",{className:"position--absolute center right",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__round",onClick:()=>g(),"aria-label":h("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})})]})}var Typist$1={exports:{}};(function(o){o.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}return t.m=e,t.c=r,t.p="",t(0)}([function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(k){for(var D=1;D<arguments.length;D++){var F=arguments[D];for(var G in F)Object.prototype.hasOwnProperty.call(F,G)&&(k[G]=F[G])}return k},a=function(){function k(D,F){for(var G=0;G<F.length;G++){var V=F[G];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(D,V.key,V)}}return function(D,F,G){return F&&k(D.prototype,F),G&&k(D,G),D}}(),l=t(1),u=S(l),f=t(2),d=S(f),h=t(10),y=S(h),E=t(12),p=S(E),_=t(13),g=S(_),x=t(14),C=R(x);function R(k){if(k&&k.__esModule)return k;var D={};if(k!=null)for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(D[F]=k[F]);return D.default=k,D}function S(k){return k&&k.__esModule?k:{default:k}}function A(k,D){if(!(k instanceof D))throw new TypeError("Cannot call a class as a function")}function T(k,D){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:k}function w(k,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);k.prototype=Object.create(D&&D.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(k,D):k.__proto__=D)}var P=["🔙","⏰"],O=function(k){w(D,k);function D(F){A(this,D);var G=T(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,F));return G.state={textLines:[],isDone:!1},G.onTypingDone=function(){G.mounted&&(G.setState({isDone:!0}),G.props.onTypingDone())},G.delayGenerator=function(V,W,ee,q){var z=G.props.avgTypingDelay,U=G.props.stdTypingDelay;return G.props.delayGenerator(z,U,{line:V,lineIdx:W,character:ee,charIdx:q,defDelayGenerator:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U;return C.gaussianRnd(I,B)}})},G.typeLine=function(V,W){if(!G.mounted)return Promise.resolve();var ee=V,q=G.props.onLineTyped;return C.isBackspaceElement(V)?(V.props.delay>0&&(G.introducedDelay=V.props.delay),ee="🔙".repeat(V.props.count)):C.isDelayElement(V)&&(G.introducedDelay=V.props.ms,ee="⏰"),new Promise(function(z,U){G.setState({textLines:G.state.textLines.concat([""])},function(){C.eachPromise(ee,G.typeCharacter,ee,W).then(function(){return q(ee,W)}).then(z).catch(U)})})},G.typeCharacter=function(V,W,ee,q){if(!G.mounted)return Promise.resolve();var z=G.props.onCharacterTyped;return new Promise(function(U){var $=G.state.textLines.slice();C.sleep(G.introducedDelay).then(function(){G.introducedDelay=null;var I=V==="🔙",B=V==="⏰";if(B){U();return}if(I&&q>0){for(var X=q-1,Q=$[X],J=X;J>=0&&!(Q.length>0&&!P.includes(Q[0]));J--)X=J,Q=$[X];$[X]=Q.substr(0,Q.length-1)}else $[q]+=V;G.setState({textLines:$},function(){var ne=G.delayGenerator(ee,q,V,W);z(V,W),setTimeout(U,ne)})})})},G.mounted=!1,G.linesToType=[],G.introducedDelay=null,F.children&&(G.linesToType=C.extractTextFromElement(F.children)),G}return a(D,[{key:"componentDidMount",value:function(){this.mounted=!0;var G=this.props,V=G.children,W=G.startDelay;V?W>0&&typeof window<"u"?setTimeout(this.typeAllLines.bind(this),W):this.typeAllLines():this.onTypingDone()}},{key:"shouldComponentUpdate",value:function(G,V){if(V.textLines.length!==this.state.textLines.length)return!0;for(var W=0;W<V.textLines.length;W++){var ee=this.state.textLines[W],q=V.textLines[W];if(ee!==q)return!0}return this.state.isDone!==V.isDone}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"typeAllLines",value:function(){var G=this,V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.linesToType;return C.eachPromise(V,this.typeLine).then(function(){return G.onTypingDone()})}},{key:"render",value:function(){var G=this.props,V=G.className,W=G.cursor,ee=this.state.isDone,q=C.cloneElementWithSpecifiedText({element:this.props.children,textLines:this.state.textLines});return u.default.createElement("div",{className:"Typist "+V},q,u.default.createElement(y.default,n({isDone:ee},W)))}}]),D}(l.Component);O.propTypes={children:d.default.node,className:d.default.string,avgTypingDelay:d.default.number,stdTypingDelay:d.default.number,startDelay:d.default.number,cursor:d.default.object,onCharacterTyped:d.default.func,onLineTyped:d.default.func,onTypingDone:d.default.func,delayGenerator:d.default.func},O.defaultProps={className:"",avgTypingDelay:70,stdTypingDelay:25,startDelay:0,cursor:{},onCharacterTyped:function(){},onLineTyped:function(){},onTypingDone:function(){},delayGenerator:C.gaussianRnd},r.default=O,O.Backspace=p.default,O.Delay=g.default},function(e,r){e.exports=React$2},function(e,r,t){if(process.env.NODE_ENV!=="production"){var n=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103,a=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===n},l=!0;e.exports=t(3)(a,l)}else e.exports=t(9)()},function(e,r,t){var n=t(4),a=t(5),l=t(6),u=t(7),f=t(8);e.exports=function(d,h){var y=typeof Symbol=="function"&&Symbol.iterator,E="@@iterator";function p($){var I=$&&(y&&$[y]||$[E]);if(typeof I=="function")return I}var _="<<anonymous>>",g={array:S("array"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:A(),arrayOf:T,element:w(),instanceOf:P,node:F(),objectOf:k,oneOf:O,oneOfType:D,shape:G};function x($,I){return $===I?$!==0||1/$===1/I:$!==$&&I!==I}function C($){this.message=$,this.stack=""}C.prototype=Error.prototype;function R($){if(process.env.NODE_ENV!=="production")var I={},B=0;function X(J,ne,ae,Z,se,oe,fe){if(Z=Z||_,oe=oe||ae,fe!==u){if(h)a(!1,"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");else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=Z+":"+ae;!I[de]&&B<3&&(l(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",oe,Z),I[de]=!0,B++)}}return ne[ae]==null?J?ne[ae]===null?new C("The "+se+" `"+oe+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new C("The "+se+" `"+oe+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:$(ne,ae,Z,se,oe)}var Q=X.bind(null,!1);return Q.isRequired=X.bind(null,!0),Q}function S($){function I(B,X,Q,J,ne,ae){var Z=B[X],se=ee(Z);if(se!==$){var oe=q(Z);return new C("Invalid "+J+" `"+ne+"` of type "+("`"+oe+"` supplied to `"+Q+"`, expected ")+("`"+$+"`."))}return null}return R(I)}function A(){return R(n.thatReturnsNull)}function T($){function I(B,X,Q,J,ne){if(typeof $!="function")return new C("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside arrayOf.");var ae=B[X];if(!Array.isArray(ae)){var Z=ee(ae);return new C("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected an array."))}for(var se=0;se<ae.length;se++){var oe=$(ae,se,Q,J,ne+"["+se+"]",u);if(oe instanceof Error)return oe}return null}return R(I)}function w(){function $(I,B,X,Q,J){var ne=I[B];if(!d(ne)){var ae=ee(ne);return new C("Invalid "+Q+" `"+J+"` of type "+("`"+ae+"` supplied to `"+X+"`, expected a single ReactElement."))}return null}return R($)}function P($){function I(B,X,Q,J,ne){if(!(B[X]instanceof $)){var ae=$.name||_,Z=U(B[X]);return new C("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected ")+("instance of `"+ae+"`."))}return null}return R(I)}function O($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&l(!1,"Invalid argument supplied to oneOf, expected an instance of array."),n.thatReturnsNull;function I(B,X,Q,J,ne){for(var ae=B[X],Z=0;Z<$.length;Z++)if(x(ae,$[Z]))return null;var se=JSON.stringify($);return new C("Invalid "+J+" `"+ne+"` of value `"+ae+"` "+("supplied to `"+Q+"`, expected one of "+se+"."))}return R(I)}function k($){function I(B,X,Q,J,ne){if(typeof $!="function")return new C("Property `"+ne+"` of component `"+Q+"` has invalid PropType notation inside objectOf.");var ae=B[X],Z=ee(ae);if(Z!=="object")return new C("Invalid "+J+" `"+ne+"` of type "+("`"+Z+"` supplied to `"+Q+"`, expected an object."));for(var se in ae)if(ae.hasOwnProperty(se)){var oe=$(ae,se,Q,J,ne+"."+se,u);if(oe instanceof Error)return oe}return null}return R(I)}function D($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&l(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),n.thatReturnsNull;for(var I=0;I<$.length;I++){var B=$[I];if(typeof B!="function")return l(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",z(B),I),n.thatReturnsNull}function X(Q,J,ne,ae,Z){for(var se=0;se<$.length;se++){var oe=$[se];if(oe(Q,J,ne,ae,Z,u)==null)return null}return new C("Invalid "+ae+" `"+Z+"` supplied to "+("`"+ne+"`."))}return R(X)}function F(){function $(I,B,X,Q,J){return V(I[B])?null:new C("Invalid "+Q+" `"+J+"` supplied to "+("`"+X+"`, expected a ReactNode."))}return R($)}function G($){function I(B,X,Q,J,ne){var ae=B[X],Z=ee(ae);if(Z!=="object")return new C("Invalid "+J+" `"+ne+"` of type `"+Z+"` "+("supplied to `"+Q+"`, expected `object`."));for(var se in $){var oe=$[se];if(oe){var fe=oe(ae,se,Q,J,ne+"."+se,u);if(fe)return fe}}return null}return R(I)}function V($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(V);if($===null||d($))return!0;var I=p($);if(I){var B=I.call($),X;if(I!==$.entries){for(;!(X=B.next()).done;)if(!V(X.value))return!1}else for(;!(X=B.next()).done;){var Q=X.value;if(Q&&!V(Q[1]))return!1}}else return!1;return!0;default:return!1}}function W($,I){return $==="symbol"||I["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&I instanceof Symbol}function ee($){var I=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":W(I,$)?"symbol":I}function q($){if(typeof $>"u"||$===null)return""+$;var I=ee($);if(I==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return I}function z($){var I=q($);switch(I){case"array":case"object":return"an "+I;case"boolean":case"date":case"regexp":return"a "+I;default:return I}}function U($){return!$.constructor||!$.constructor.name?_:$.constructor.name}return g.checkPropTypes=f,g.PropTypes=g,g}},function(e,r){function t(a){return function(){return a}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(a){return a},e.exports=n},function(e,r){var t=function(l){};process.env.NODE_ENV!=="production"&&(t=function(l){if(l===void 0)throw new Error("invariant requires an error message argument")});function n(a,l,u,f,d,h,y,E){if(t(l),!a){var p;if(l===void 0)p=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var _=[u,f,d,h,y,E],g=0;p=new Error(l.replace(/%s/g,function(){return _[g++]})),p.name="Invariant Violation"}throw p.framesToPop=1,p}}e.exports=n},function(e,r,t){var n=t(4),a=n;process.env.NODE_ENV!=="production"&&function(){var l=function(f){for(var d=arguments.length,h=Array(d>1?d-1:0),y=1;y<d;y++)h[y-1]=arguments[y];var E=0,p="Warning: "+f.replace(/%s/g,function(){return h[E++]});typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}};a=function(f,d){if(d===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(d.indexOf("Failed Composite propType: ")!==0&&!f){for(var h=arguments.length,y=Array(h>2?h-2:0),E=2;E<h;E++)y[E-2]=arguments[E];l.apply(void 0,[d].concat(y))}}}(),e.exports=a},function(e,r){var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t},function(e,r,t){if(process.env.NODE_ENV!=="production")var n=t(5),a=t(6),l=t(7),u={};function f(d,h,y,E,p){if(process.env.NODE_ENV!=="production"){for(var _ in d)if(d.hasOwnProperty(_)){var g;try{n(typeof d[_]=="function","%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",E||"React class",y,_),g=d[_](h,_,E,y,null,l)}catch(C){g=C}if(a(!g||g instanceof Error,"%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).",E||"React class",y,_,typeof g),g instanceof Error&&!(g.message in u)){u[g.message]=!0;var x=p?p():"";a(!1,"Failed %s type: %s%s",y,g.message,x??"")}}}}e.exports=f},function(e,r,t){var n=t(4),a=t(5),l=t(7);e.exports=function(){function u(h,y,E,p,_,g){g!==l&&a(!1,"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")}u.isRequired=u;function f(){return u}var d={array:u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:f,element:u,instanceOf:f,node:u,objectOf:f,oneOf:f,oneOfType:f,shape:f};return d.checkPropTypes=n,d.PropTypes=d,d}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function _(g,x){for(var C=0;C<x.length;C++){var R=x[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(g,R.key,R)}}return function(g,x,C){return x&&_(g.prototype,x),C&&_(g,C),g}}(),a=t(1),l=d(a),u=t(2),f=d(u);t(11);function d(_){return _&&_.__esModule?_:{default:_}}function h(_,g){if(!(_ instanceof g))throw new TypeError("Cannot call a class as a function")}function y(_,g){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:_}function E(_,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);_.prototype=Object.create(g&&g.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(_,g):_.__proto__=g)}var p=function(_){E(g,_);function g(x){h(this,g);var C=y(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,x));return C._isReRenderingCursor=!1,C.state={shouldRender:C.props.show},C}return n(g,[{key:"componentWillReceiveProps",value:function(C){var R=this,S=!this.props.isDone&&C.isDone&&this.props.hideWhenDone;S&&setTimeout(function(){return R.setState({shouldRender:!1})},this.props.hideWhenDoneDelay)}},{key:"componentDidUpdate",value:function(){var C=this.props,R=C.show,S=C.isDone;R&&(S||this._isReRenderingCursor||this._reRenderCursor())}},{key:"_reRenderCursor",value:function(){var C=this;this._isReRenderingCursor=!0,this.setState({shouldRender:!1},function(){C.setState({shouldRender:!0},function(){C._isReRenderingCursor=!1})})}},{key:"render",value:function(){if(this.state.shouldRender){var C=this.props.blink?" Cursor--blinking":"";return l.default.createElement("span",{className:"Cursor"+C},this.props.element)}return null}}]),g}(a.Component);p.propTypes={blink:f.default.bool,show:f.default.bool,element:f.default.node,hideWhenDone:f.default.bool,hideWhenDoneDelay:f.default.number,isDone:f.default.bool},p.defaultProps={blink:!0,show:!0,element:"|",hideWhenDone:!1,hideWhenDoneDelay:1e3,isDone:!1},r.default=p},function(e,r){},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=f(n),l=t(2),u=f(l);function f(h){return h&&h.__esModule?h:{default:h}}var d=function(){return a.default.createElement("noscript",null)};d.componentName="Backspace",d.propTypes={count:u.default.number,delay:u.default.number},d.defaultProps={count:1,delay:0},r.default=d},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=f(n),l=t(2),u=f(l);function f(h){return h&&h.__esModule?h:{default:h}}var d=function(){return a.default.createElement("noscript",null)};d.componentName="Delay",d.propTypes={ms:u.default.number.isRequired},r.default=d},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.sleep=void 0;var n=function(){function R(S,A){var T=[],w=!0,P=!1,O=void 0;try{for(var k=S[Symbol.iterator](),D;!(w=(D=k.next()).done)&&(T.push(D.value),!(A&&T.length===A));w=!0);}catch(F){P=!0,O=F}finally{try{!w&&k.return&&k.return()}finally{if(P)throw O}}return T}return function(S,A){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return R(S,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();r.gaussianRnd=d,r.eachPromise=h,r.exclude=y,r.isBackspaceElement=E,r.isDelayElement=p,r.extractTextFromElement=_,r.cloneElement=g,r.cloneElementWithSpecifiedText=C;var a=t(1),l=u(a);function u(R){return R&&R.__esModule?R:{default:R}}function f(R){if(Array.isArray(R)){for(var S=0,A=Array(R.length);S<R.length;S++)A[S]=R[S];return A}else return Array.from(R)}r.sleep=function(S){return new Promise(function(A){return S!=null?setTimeout(A,S):A()})};function d(R,S){for(var A=12,T=0,w=0;w<A;w++)T+=Math.random();return T-=A/2,Math.round(T*S)+R}function h(R,S){for(var A=arguments.length,T=Array(A>2?A-2:0),w=2;w<A;w++)T[w-2]=arguments[w];var P=function(k,D,F){return k.then(function(){return S.apply(void 0,[D,F].concat(T))})};return Array.from(R).reduce(P,Promise.resolve())}function y(R,S){var A={};for(var T in R)S.indexOf(T)===-1&&(A[T]=R[T]);return A}function E(R){return R&&R.type&&R.type.componentName==="Backspace"}function p(R){return R&&R.type&&R.type.componentName==="Delay"}function _(R){for(var S=R?[R]:[],A=[];S.length>0;){var T=S.pop();if(l.default.isValidElement(T))E(T)||p(T)?A.unshift(T):l.default.Children.forEach(T.props.children,function(G){S.push(G)});else if(Array.isArray(T)){var w=!0,P=!1,O=void 0;try{for(var k=T[Symbol.iterator](),D;!(w=(D=k.next()).done);w=!0){var F=D.value;S.push(F)}}catch(G){P=!0,O=G}finally{try{!w&&k.return&&k.return()}finally{if(P)throw O}}}else A.unshift(T)}return A}function g(R,S){var A=R.type,T=y(R.props,["children"]),w=new Date().getUTCMilliseconds(),P=w+Math.random()+Math.random();return T.key="Typist-element-"+A+"-"+P,l.default.createElement.apply(l.default,[A,T].concat(f(S)))}function x(R,S,A){if(A>=S.length)return[null,A];var T=A,w=function(F){var G=x(F,S,T),V=n(G,2),W=V[0],ee=V[1];return T=ee,W},P=l.default.isValidElement(R)&&!(E(R)||p(R));if(P){var O=l.default.Children.map(R.props.children,w)||[];return[g(R,O),T]}if(Array.isArray(R)){var k=R.map(w);return[k,T]}return[S[T],T+1]}function C(R){var S=R.element,A=R.textLines;if(S)return x(S,A,0)[0]}}])})(Typist$1);var TypistExports=Typist$1.exports;const Typist=getDefaultExportFromCjs(TypistExports),languages={js:["var rows = prompt('How many rows for your multiplication table?');","var cols = prompt('How many columns for your multiplication table?');"," ","if(rows == '' || rows == null)"," rows = 10;"," ","if(cols== '' || cols== null)"," cols = 10;"," ","createTable(rows, cols);"," ","function createTable(rows, cols)","{"," var j=1;"," var output = '<table border='1' width='500' cellspacing='0'cellpadding='5'>';"," "," for(i=1;i<=rows;i++)"," {"," output = output + '<tr>';"," while(j<=cols)"," {"," output = output + '<td>' + i*j + '</td>';"," j = j+1;"," }"," output = output + '</tr>';"," j = 1;"," }"," "," output = output + '</table>';"," document.write(output);","}"],lua:["-- Ensure that that the element at i is in the right position,","-- and return a closure which can be used for continuing the sort."," ","function quicksorter(i, vec, low, high)"," if low >= high then"," return quicksorter"," else -- low < high"," -- partition the vector and initialize the child closures"," local middle = partition(vec, low, high)"," local left, right = quicksorter"," ","-- Create the promise"," local function self(i, vec, low, high)"," if i < middle then"," left = left(i, vec, low, middle-1)"," return self"," elseif i > middle then"," right = right(i, vec, middle+1, high)"," return self"," end"," end"," ","-- Force the promise until i is in the right position"," return self(i, vec, low, high)"," end","end"," ","function lazysort(vec, low, high)"," local sorter = quicksorter"," return function(i)"," sorter = sorter(i, vec, low, high)"," return vec[i]"," end","end"],python:["#ask the user to enter four pieces of information"," ","firstname = input('Enter your first name: ')","surname = input('Enter your surname: ')","email = input('Enter your email: ')","yearsteaching = input('Enter the number of years teaching: ')"," ","file = open('staff.csv','r') #opens the file in read mode","found=False #sets whether the user is found to False"," ","for line in file: #reads each line in the file"," staff = line.split(',') #splits the line into the list called staff"," if staff[2] == email: #checks if the email entered is in the list"," found=True #if it is changes found to True"," ","file.close() #closes the file"," ","if found==True: #after the loop checks if the user is found"," print('Staff member already exists in the file') #displays on screen","else:"," #if the email was not in the file"," writefile=open('staff.csv','a') #open the file in append mode"," writefile.write(firstname + ',' + surname + ',' + email + ',' + yearsteaching) #write the new information to the file"," writefile.close() #close the file"," print('Staff member added to file')"]},themes={theme1:{bg:1,color:1,typo:2},theme2:{bg:3,color:2,typo:3},theme3:{bg:5,color:4,typo:1},theme4:{bg:1,color:3,typo:2},theme5:{bg:2,color:5,typo:1},theme6:{bg:5,color:6,typo:2},theme7:{bg:1,color:7,typo:3}};function ProgressBar({progress:o,type:e}){const r=languages[e];if(r){const t=r.reduce((l,u)=>(l.length?l.length:l)+u.length),n=Math.floor(o*100/t),a=n===100?"puzzle--hacker__percentage percentage--label":"puzzle--hacker__percentage";return jsxRuntimeExports.jsx("div",{className:"puzzle--hacker__progress",children:jsxRuntimeExports.jsx("span",{className:"puzzle--hacker__progress--item",style:{width:`${Math.floor(o*100/t)}%`},children:jsxRuntimeExports.jsxs("span",{className:a,children:[n,"%"]})})})}return null}function Code({codeContainer:o}){const e=o,r=e.split("<br>");return r.length>0?r.map((t,n)=>{const a=t.replace(/ /g," ");return jsxRuntimeExports.jsx("p",{children:a},`line_${0+n}`)}):jsxRuntimeExports.jsx("p",{children:e})}function HackerPuzzleComponent({emitEvent:o,soundActions:e,info:r,themeNumber:t,type:n,writingSpeed:a,disableExit:l,setResolveAction:u}){const f=W=>o({type:"translate",payload:W}),[d]=e,{solution:h}=r,E=themes[`theme${t||1}`],[p,_]=React$2.useState(""),[g,x]=React$2.useState(0),[C,R]=React$2.useState(0),[S,A]=React$2.useState(!1),[T,w]=React$2.useState({start:0,end:0}),P=React$2.useRef(),O=React$2.useRef(),k=f("puzzle.hacker.congratulations"),D=(W,ee)=>W>ee.length?ee.length:W,F=()=>{d("click-ui");const{rewards:W}=h.right;o({type:"addPoints",complex:!0,finish:!0,payload:W}),o({type:"passPuzzle"})};React$2.useEffect(()=>{P.current.focus(),S&&l(!0)},[S]),React$2.useEffect(()=>{u(W=>{d("score"),A(!0),o({type:"hidePuzzleButtons",payload:!1}),W()})},[u]);const G=()=>{if(languages[n]&&!S){O.current&&(O.current.scrollTop=P.current.scrollHeight);const W=languages[n],ee=W[g],q=W.reduce((U,$)=>(U.length?U.length:U)+$.length),z=a>0?a:Math.floor(q/50)+g;if(ee){const U=ee.split(""),$=D(T.end,U),I=U.slice(T.start,$),B=p+I.join("");R(C+I.join("").length),_(B),$===U.length?g+1>=W.length?(d("score"),A(!0)):(x(g+1),_(`${p+I.join("")}<br>`),w({start:0,end:D(z,U)})):w({start:$,end:D($+z,U)})}}},V=W=>{W.preventDefault(),G()};return jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,"data-testid":"hacker",ref:P,onKeyDown:V,onTouchStart:V,className:`puzzle--hacker__container background-hacker-${E.bg}`,children:[jsxRuntimeExports.jsx("div",{className:"puzzle--hacker__header",children:jsxRuntimeExports.jsx("span",{className:"title",children:"Console"})}),jsxRuntimeExports.jsxs("div",{className:`puzzle--hacker__body color-hacker-${E.color} typography-hacker-${E.typo}`,children:[jsxRuntimeExports.jsxs("div",{className:"puzzle--hacker__code",ref:O,children:[jsxRuntimeExports.jsx(Code,{codeContainer:p}),S?jsxRuntimeExports.jsxs(Typist,{avgTypingDelay:110,onCharacterTyped:()=>{O.current&&(O.current.scrollTop=P.current.scrollHeight)},cursor:{hideWhenDone:!0},className:"puzzle--hacker__result",children:[jsxRuntimeExports.jsx(Typist.Delay,{ms:300}),h.right.desc?`// ${h.right.desc}`:`${k}`]}):null]}),jsxRuntimeExports.jsx(ProgressBar,{type:n,progress:C})]}),S?jsxRuntimeExports.jsx("div",{className:"position--absolute bottom center",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary gat--btn__cracker",onClick:F,children:f("screens.continue")})}):null]})}HackerPuzzleComponent.defaultProps={type:"",writingSpeed:0,context:{},info:{},themeNumber:1};const imagenPorDefecto="https://min.gamelearn.io/css-resources/gamelearn/resources/puzzle-login-low.png";function LoginPuzzleComponent({emitEvent:o,soundActions:e,info:r,user:t,login:n,password:a,image:l,setResolveAction:u,nodeId:f}){var $;const d=I=>o({type:"translate",payload:I}),h=`login-puzzle_${f}`,y=LangIsRtl(),[E,p]=React$2.useState(""),[_,g]=React$2.useState(""),[x,C]=React$2.useState(!1),[R,S]=React$2.useState(""),[A,T]=React$2.useState(""),[w,P]=React$2.useState(!1),[O,k]=React$2.useState(!1),[D,F]=React$2.useState(!1),[G]=e,[V,W]=React$2.useState([]),ee=(($=l.img)==null?void 0:$.url)||imagenPorDefecto,q=()=>{const{rewards:I}=r.solution.right,B=[...V,...I];o({type:"addPoints",complex:!0,finish:!0,payload:B}),o({type:"passPuzzle"})},z=()=>{G("click-ui");const I={login:!0,password:!1};n&&(I.login=t===E),I.password=a===_,I.login&&I.password?(T("success"),P(!0),k(!1),G("score"),setTimeout(()=>{q()},2e3)):(W([...V,...r.solution.wrong.rewards]),G("fail"),T("failed"),k(!0),o({type:"failPuzzle"}))},U=I=>{let B="";if(I.length>=0){for(let X=0;X<I.length;X+=1)B+="•";S(B)}};return React$2.useEffect(()=>{u(()=>{const I=[...V,...r.resolve.rewards];F(!0),setTimeout(()=>{o({type:"hidePuzzleButtons",payload:!1}),o({type:"puzzleAction",action:"resolve",payload:{element:h,rewards:I,finish:!0}})},2e3)})},[V,r.resolve.rewards,o,u,h]),jsxRuntimeExports.jsx("div",{className:"puzzle--layer",style:{backgroundImage:`url("${ee}")`},children:jsxRuntimeExports.jsxs("div",{className:`puzzle--login ${t?"puzzle--login--withuser":""}`,children:[jsxRuntimeExports.jsx("span",{className:"icon-login-puzzle",children:" "}),jsxRuntimeExports.jsx("span",{className:"puzzle--login__title",children:d("puzzle.initSession")}),jsxRuntimeExports.jsxs("div",{children:[n&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{dir:"auto",className:"puzzle--login__label",children:d("puzzle.user")}),jsxRuntimeExports.jsxs("div",{dir:"auto",className:"puzzle--login__group",children:[D?jsxRuntimeExports.jsx("input",{dir:y?"rtl":"auto",disabled:w,"data-testid":"username",className:"puzzle--login__input success",type:"text",placeholder:t,value:t}):jsxRuntimeExports.jsx("input",{dir:y?"rtl":"auto",disabled:w,"data-testid":"username",className:`puzzle--login__input ${A}`,type:"text",placeholder:d("puzzle.user"),onChange:I=>{p(I.target.value),T(""),k(!1)}}),jsxRuntimeExports.jsx("span",{className:"icon-circle-check",children:" "})]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{dir:"auto",className:"puzzle--login__label",children:jsxRuntimeExports.jsx("span",{children:d("puzzle.password")})}),jsxRuntimeExports.jsxs("div",{dir:"auto",className:"puzzle--login__group",children:[D?jsxRuntimeExports.jsx("input",{dir:y?"rtl":"auto",disabled:!0,"data-testid":"password",className:"puzzle--login__input puzzle--login__input--fakepassword success",type:"text",placeholder:a,value:a,style:{opacity:1}}):jsxRuntimeExports.jsx("input",{dir:y?"rtl":"auto",disabled:w,"data-testid":"password",className:`puzzle--login__input puzzle--login__input--fakepassword ${A}`,type:"text",placeholder:d("puzzle.password"),onFocus:()=>{C(!0)},onBlur:()=>{C(!1)},onChange:I=>{g(I.target.value),U(I.target.value),T(""),k(!1)}}),D?null:jsxRuntimeExports.jsx("div",{dir:y?"rtl":"auto",className:`login-fakepassword${x?" login-fakepassword--focus":""}${R.length?" login-fakepassword--fill":""} ${A||""}`,children:_?R:d("puzzle.password")}),jsxRuntimeExports.jsx("span",{className:"icon-circle-check",children:" "})]})]})]}),jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn gat--btn__primary ${_.length!==0&&!w?"":"disabled"}`,onClick:z,children:d("puzzle.loginIn")}),!D&&O&&r.solution.wrong.desc!==""&&jsxRuntimeExports.jsx("div",{className:"puzzle--login__label--error",children:r.solution.wrong.desc})]})})}function FeedbackComponent$1({text:o,success:e,playSound:r,additionalStyle:t,functionOnClose:n,secondText:a,translate:l,shortText:u,hasTimeout:f,delay:d,timeExpired:h,keyboardControl:y}){const[E,p]=React$2.useState();React$2.useEffect(()=>{let x;return r&&r(e?"score":"fail"),o&&!u&&(x=setTimeout(()=>{p(!0)},1e3)),()=>{x&&clearTimeout(x)}},[r,e,u,o]),React$2.useEffect(()=>{let x;return f&&n&&(x=setTimeout(n,d)),()=>{x&&clearTimeout(x)}},[d,n,f]);const _=()=>e?"success":"failed",g=()=>e?"icon-correct-thumb":h?"icon-times-up":"icon-incorrect-thumb";return y(null,o&&n&&E?n:null,o&&n&&E||n&&u?n:null),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`feedback-layer ${E?"feedback-layer--withexplain":""}`,children:[jsxRuntimeExports.jsxs("div",{className:`feedback-layer__header ${u?"feedback-layer__header--in-shortText":""} ${t||""} ${_()}`,children:[a&&jsxRuntimeExports.jsxs("span",{className:"puzzle--terminal__visor--file",children:[jsxRuntimeExports.jsx("span",{className:`puzzle--terminal__icon ${t||""}`}),jsxRuntimeExports.jsx("span",{children:a})]}),jsxRuntimeExports.jsx("span",{className:"feedback-layer__maintitle",children:!o||!u?jsxRuntimeExports.jsx("div",{title:l(`tooltip.${e?"correct":"incorrect"}`),className:`${g()}`}):o}),u&&jsxRuntimeExports.jsx("button",{type:"button",className:"feedback-layer__closeX",onClick:()=>n(),"aria-label":l("storylines.misc.closePiece"),children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})]}),!u&&o!==""&&jsxRuntimeExports.jsx("div",{className:"feedback-layer__explainwrap",children:jsxRuntimeExports.jsxs("div",{className:"feedback-layer__explain",children:[jsxRuntimeExports.jsx("div",{dir:"auto",children:o}),o&&n&&E&&jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn__navigation",onClick:()=>n(),"aria-label":l("storylines.misc.closePiece"),style:{display:"flex",margin:"auto",marginTop:"24px"},children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})})]})})}FeedbackComponent$1.defaultProps={text:"",hasTimeout:!1,delay:3e3,success:!1};const defaultImage$1="https://min.gamelearn.io/css-resources/gamelearn/resources/keyboard.jpg";function KeyboardPuzzleComponent({emitEvent:o,image:e,password:r,keyboard:t,info:n,disableExit:a,soundActions:l,setResolveAction:u,nodeId:f,keyboardControl:d}){var U;const[h,y]=React$2.useState(!1),[E,p]=React$2.useState(""),[_,g]=React$2.useState(""),[x,C]=React$2.useState(!1),[R,S]=React$2.useState(""),[A,T]=React$2.useState(!1),[w,P]=React$2.useState([]),O=$=>o({type:"translate",payload:$}),k=`keyboard-puzzle_${f}`,[D]=l,F=React$2.useCallback($=>{C(!1),T(!1),o({type:"hidePuzzleButtons",payload:!1}),o({type:"addPoints",complex:!0,finish:!0,payload:$})},[o]),G=()=>{if(x){y(!0);const{rewards:$}=n.solution.right,I=[...w,...$];D("score"),F(I)}else o({type:"hidePuzzleButtons",payload:!1}),C(!1),a(!1),T(!1);S("")},V=$=>{$===r?(a(!1),p("success"),D("score"),o({type:"passPuzzle"}),C(!0),T(!0),n.solution.right.desc?S(n.solution.right.desc):setTimeout(()=>{const{rewards:I}=n.solution.right,B=[...w,...I];F(B)},3e3)):(T(!0),p("failed"),D("fail"),o({type:"failPuzzle"}),C(!1),P([...w,...n.solution.wrong.rewards]),o({type:"hidePuzzleButtons",payload:!1}),p(""),g(""),T(!0),n.solution.wrong.desc?S(n.solution.wrong.desc):setTimeout(()=>{G()},3e3))};React$2.useEffect(()=>{u(()=>{a(!1),D("score"),p("success"),C(!0),S(n.solution.right.desc),g(r),y(!0);const $=[...w,...n.resolve.rewards];setTimeout(()=>{C(!1),T(!1),o({type:"hidePuzzleButtons",payload:!1}),o({type:"puzzleAction",action:"resolve",payload:{element:k,rewards:$,finish:!0}})},2e3)})},[u,a,n.solution.right.desc,D,n.resolve.rewards,w,r,o,k]);const W=($,I)=>{const B=t[$][I];D("click-ui"),_.length<r.length+1&&(g(_+B),_.length+1===r.length&&V(_+B))},ee=()=>{D("click-ui"),g(_.substring(0,_.length-1))},q=((U=e.img)==null?void 0:U.url)||defaultImage$1,z={backgroundSize:q?"cover":"contain",backgroundImage:`url("${q}")`,backgroudPosition:"center center"};return jsxRuntimeExports.jsxs("div",{className:"puzzle--keyboard",style:z,children:[jsxRuntimeExports.jsx("div",{className:"puzzle--keyboard__header",children:jsxRuntimeExports.jsxs("div",{className:"puzzle--keyboard__result",children:[r.split("").map(($,I)=>jsxRuntimeExports.jsx("div",{className:`puzzle--keyboard__result--item ${E}`,children:_.split("")[I]?_.split("")[I]:""},`${$+I}`)),h?jsxRuntimeExports.jsx("span",{className:"icon-circle-check"}):jsxRuntimeExports.jsx("button",{type:"button",onClick:ee,className:"puzzle--keyboard__delete","aria-label":O("puzzles.keyboard-puzzle.deleteButton"),children:jsxRuntimeExports.jsx("span",{className:"icon-delete-keyboard"})})]})}),jsxRuntimeExports.jsx("div",{className:"puzzle--keyboard__block",children:t.map(($,I)=>jsxRuntimeExports.jsx("div",{className:"puzzle--keyboard__row",children:(Array.isArray($)?$:Object.values($)).map((B,X)=>jsxRuntimeExports.jsx("button",{className:"puzzle--keyboard__character",type:"button",onClick:()=>W(I,X),children:B},B))},`row_${0+I}`))}),A&&jsxRuntimeExports.jsx(FeedbackComponent$1,{translate:O,text:R,success:x,functionOnClose:G,keyboardControl:d})]})}var lib$1={exports:{}},_FullInternals={},_CoreInternals={},Global={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o._registerNode=o.Konva=o.glob=void 0;const e=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}o.glob=typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},o.Konva={_global:o.glob,version:"9.3.0",isBrowser:r(),isUnminified:/param/.test((function(n){}).toString()),dblClickWindow:400,getAngle(n){return o.Konva.angleDeg?n*e:n},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return o.Konva.DD.isDragging},isDragReady(){return!!o.Konva.DD.node},releaseCanvasOnDestroy:!0,document:o.glob.document,_injectGlobal(n){o.glob.Konva=n}};const t=n=>{o.Konva[n.prototype.getClassName()]=n};o._registerNode=t,o.Konva._injectGlobal(o.Konva)})(Global);var Util={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Util=o.Transform=void 0;const e=Global;class r{constructor(A=[1,0,0,1,0,0]){this.dirty=!1,this.m=A&&A.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(A){A.m[0]=this.m[0],A.m[1]=this.m[1],A.m[2]=this.m[2],A.m[3]=this.m[3],A.m[4]=this.m[4],A.m[5]=this.m[5]}point(A){var T=this.m;return{x:T[0]*A.x+T[2]*A.y+T[4],y:T[1]*A.x+T[3]*A.y+T[5]}}translate(A,T){return this.m[4]+=this.m[0]*A+this.m[2]*T,this.m[5]+=this.m[1]*A+this.m[3]*T,this}scale(A,T){return this.m[0]*=A,this.m[1]*=A,this.m[2]*=T,this.m[3]*=T,this}rotate(A){var T=Math.cos(A),w=Math.sin(A),P=this.m[0]*T+this.m[2]*w,O=this.m[1]*T+this.m[3]*w,k=this.m[0]*-w+this.m[2]*T,D=this.m[1]*-w+this.m[3]*T;return this.m[0]=P,this.m[1]=O,this.m[2]=k,this.m[3]=D,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(A,T){var w=this.m[0]+this.m[2]*T,P=this.m[1]+this.m[3]*T,O=this.m[2]+this.m[0]*A,k=this.m[3]+this.m[1]*A;return this.m[0]=w,this.m[1]=P,this.m[2]=O,this.m[3]=k,this}multiply(A){var T=this.m[0]*A.m[0]+this.m[2]*A.m[1],w=this.m[1]*A.m[0]+this.m[3]*A.m[1],P=this.m[0]*A.m[2]+this.m[2]*A.m[3],O=this.m[1]*A.m[2]+this.m[3]*A.m[3],k=this.m[0]*A.m[4]+this.m[2]*A.m[5]+this.m[4],D=this.m[1]*A.m[4]+this.m[3]*A.m[5]+this.m[5];return this.m[0]=T,this.m[1]=w,this.m[2]=P,this.m[3]=O,this.m[4]=k,this.m[5]=D,this}invert(){var A=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),T=this.m[3]*A,w=-this.m[1]*A,P=-this.m[2]*A,O=this.m[0]*A,k=A*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),D=A*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=T,this.m[1]=w,this.m[2]=P,this.m[3]=O,this.m[4]=k,this.m[5]=D,this}getMatrix(){return this.m}decompose(){var A=this.m[0],T=this.m[1],w=this.m[2],P=this.m[3],O=this.m[4],k=this.m[5],D=A*P-T*w;let F={x:O,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(A!=0||T!=0){var G=Math.sqrt(A*A+T*T);F.rotation=T>0?Math.acos(A/G):-Math.acos(A/G),F.scaleX=G,F.scaleY=D/G,F.skewX=(A*w+T*P)/D,F.skewY=0}else if(w!=0||P!=0){var V=Math.sqrt(w*w+P*P);F.rotation=Math.PI/2-(P>0?Math.acos(-w/V):-Math.acos(w/V)),F.scaleX=D/V,F.scaleY=V,F.skewX=0,F.skewY=(A*w+T*P)/D}return F.rotation=o.Util._getRotation(F.rotation),F}}o.Transform=r;var t="[object Array]",n="[object Number]",a="[object String]",l="[object Boolean]",u=Math.PI/180,f=180/Math.PI,d="#",h="",y="0",E="Konva warning: ",p="Konva error: ",_="rgb(",g={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},x=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,C=[];const R=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(S){setTimeout(S,60)};o.Util={_isElement(S){return!!(S&&S.nodeType==1)},_isFunction(S){return!!(S&&S.constructor&&S.call&&S.apply)},_isPlainObject(S){return!!S&&S.constructor===Object},_isArray(S){return Object.prototype.toString.call(S)===t},_isNumber(S){return Object.prototype.toString.call(S)===n&&!isNaN(S)&&isFinite(S)},_isString(S){return Object.prototype.toString.call(S)===a},_isBoolean(S){return Object.prototype.toString.call(S)===l},isObject(S){return S instanceof Object},isValidSelector(S){if(typeof S!="string")return!1;var A=S[0];return A==="#"||A==="."||A===A.toUpperCase()},_sign(S){return S===0||S>0?1:-1},requestAnimFrame(S){C.push(S),C.length===1&&R(function(){const A=C;C=[],A.forEach(function(T){T()})})},createCanvasElement(){var S=document.createElement("canvas");try{S.style=S.style||{}}catch{}return S},createImageElement(){return document.createElement("img")},_isInDocument(S){for(;S=S.parentNode;)if(S==document)return!0;return!1},_urlToImage(S,A){var T=o.Util.createImageElement();T.onload=function(){A(T)},T.src=S},_rgbToHex(S,A,T){return((1<<24)+(S<<16)+(A<<8)+T).toString(16).slice(1)},_hexToRgb(S){S=S.replace(d,h);var A=parseInt(S,16);return{r:A>>16&255,g:A>>8&255,b:A&255}},getRandomColor(){for(var S=(Math.random()*16777215<<0).toString(16);S.length<6;)S=y+S;return d+S},getRGB(S){var A;return S in g?(A=g[S],{r:A[0],g:A[1],b:A[2]}):S[0]===d?this._hexToRgb(S.substring(1)):S.substr(0,4)===_?(A=x.exec(S.replace(/ /g,"")),{r:parseInt(A[1],10),g:parseInt(A[2],10),b:parseInt(A[3],10)}):{r:0,g:0,b:0}},colorToRGBA(S){return S=S||"black",o.Util._namedColorToRBA(S)||o.Util._hex3ColorToRGBA(S)||o.Util._hex4ColorToRGBA(S)||o.Util._hex6ColorToRGBA(S)||o.Util._hex8ColorToRGBA(S)||o.Util._rgbColorToRGBA(S)||o.Util._rgbaColorToRGBA(S)||o.Util._hslColorToRGBA(S)},_namedColorToRBA(S){var A=g[S.toLowerCase()];return A?{r:A[0],g:A[1],b:A[2],a:1}:null},_rgbColorToRGBA(S){if(S.indexOf("rgb(")===0){S=S.match(/rgb\(([^)]+)\)/)[1];var A=S.split(/ *, */).map(Number);return{r:A[0],g:A[1],b:A[2],a:1}}},_rgbaColorToRGBA(S){if(S.indexOf("rgba(")===0){S=S.match(/rgba\(([^)]+)\)/)[1];var A=S.split(/ *, */).map((T,w)=>T.slice(-1)==="%"?w===3?parseInt(T)/100:parseInt(T)/100*255:Number(T));return{r:A[0],g:A[1],b:A[2],a:A[3]}}},_hex8ColorToRGBA(S){if(S[0]==="#"&&S.length===9)return{r:parseInt(S.slice(1,3),16),g:parseInt(S.slice(3,5),16),b:parseInt(S.slice(5,7),16),a:parseInt(S.slice(7,9),16)/255}},_hex6ColorToRGBA(S){if(S[0]==="#"&&S.length===7)return{r:parseInt(S.slice(1,3),16),g:parseInt(S.slice(3,5),16),b:parseInt(S.slice(5,7),16),a:1}},_hex4ColorToRGBA(S){if(S[0]==="#"&&S.length===5)return{r:parseInt(S[1]+S[1],16),g:parseInt(S[2]+S[2],16),b:parseInt(S[3]+S[3],16),a:parseInt(S[4]+S[4],16)/255}},_hex3ColorToRGBA(S){if(S[0]==="#"&&S.length===4)return{r:parseInt(S[1]+S[1],16),g:parseInt(S[2]+S[2],16),b:parseInt(S[3]+S[3],16),a:1}},_hslColorToRGBA(S){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(S)){const[A,...T]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(S),w=Number(T[0])/360,P=Number(T[1])/100,O=Number(T[2])/100;let k,D,F;if(P===0)return F=O*255,{r:Math.round(F),g:Math.round(F),b:Math.round(F),a:1};O<.5?k=O*(1+P):k=O+P-O*P;const G=2*O-k,V=[0,0,0];for(let W=0;W<3;W++)D=w+1/3*-(W-1),D<0&&D++,D>1&&D--,6*D<1?F=G+(k-G)*6*D:2*D<1?F=k:3*D<2?F=G+(k-G)*(2/3-D)*6:F=G,V[W]=F*255;return{r:Math.round(V[0]),g:Math.round(V[1]),b:Math.round(V[2]),a:1}}},haveIntersection(S,A){return!(A.x>S.x+S.width||A.x+A.width<S.x||A.y>S.y+S.height||A.y+A.height<S.y)},cloneObject(S){var A={};for(var T in S)this._isPlainObject(S[T])?A[T]=this.cloneObject(S[T]):this._isArray(S[T])?A[T]=this.cloneArray(S[T]):A[T]=S[T];return A},cloneArray(S){return S.slice(0)},degToRad(S){return S*u},radToDeg(S){return S*f},_degToRad(S){return o.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),o.Util.degToRad(S)},_radToDeg(S){return o.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),o.Util.radToDeg(S)},_getRotation(S){return e.Konva.angleDeg?o.Util.radToDeg(S):S},_capitalize(S){return S.charAt(0).toUpperCase()+S.slice(1)},throw(S){throw new Error(p+S)},error(S){console.error(p+S)},warn(S){e.Konva.showWarnings&&console.warn(E+S)},each(S,A){for(var T in S)A(T,S[T])},_inRange(S,A,T){return A<=S&&S<T},_getProjectionToSegment(S,A,T,w,P,O){var k,D,F,G=(S-T)*(S-T)+(A-w)*(A-w);if(G==0)k=S,D=A,F=(P-T)*(P-T)+(O-w)*(O-w);else{var V=((P-S)*(T-S)+(O-A)*(w-A))/G;V<0?(k=S,D=A,F=(S-P)*(S-P)+(A-O)*(A-O)):V>1?(k=T,D=w,F=(T-P)*(T-P)+(w-O)*(w-O)):(k=S+V*(T-S),D=A+V*(w-A),F=(k-P)*(k-P)+(D-O)*(D-O))}return[k,D,F]},_getProjectionToLine(S,A,T){var w=o.Util.cloneObject(S),P=Number.MAX_VALUE;return A.forEach(function(O,k){if(!(!T&&k===A.length-1)){var D=A[(k+1)%A.length],F=o.Util._getProjectionToSegment(O.x,O.y,D.x,D.y,S.x,S.y),G=F[0],V=F[1],W=F[2];W<P&&(w.x=G,w.y=V,P=W)}}),w},_prepareArrayForTween(S,A,T){var w,P=[],O=[];if(S.length>A.length){var k=A;A=S,S=k}for(w=0;w<S.length;w+=2)P.push({x:S[w],y:S[w+1]});for(w=0;w<A.length;w+=2)O.push({x:A[w],y:A[w+1]});var D=[];return O.forEach(function(F){var G=o.Util._getProjectionToLine(F,P,T);D.push(G.x),D.push(G.y)}),D},_prepareToStringify(S){var A;S.visitedByCircularReferenceRemoval=!0;for(var T in S)if(S.hasOwnProperty(T)&&S[T]&&typeof S[T]=="object"){if(A=Object.getOwnPropertyDescriptor(S,T),S[T].visitedByCircularReferenceRemoval||o.Util._isElement(S[T]))if(A.configurable)delete S[T];else return null;else if(o.Util._prepareToStringify(S[T])===null)if(A.configurable)delete S[T];else return null}return delete S.visitedByCircularReferenceRemoval,S},_assign(S,A){for(var T in A)S[T]=A[T];return S},_getFirstPointerId(S){return S.touches?S.changedTouches[0].identifier:S.pointerId||999},releaseCanvas(...S){e.Konva.releaseCanvasOnDestroy&&S.forEach(A=>{A.width=0,A.height=0})},drawRoundedRectPath(S,A,T,w){let P=0,O=0,k=0,D=0;typeof w=="number"?P=O=k=D=Math.min(w,A/2,T/2):(P=Math.min(w[0]||0,A/2,T/2),O=Math.min(w[1]||0,A/2,T/2),D=Math.min(w[2]||0,A/2,T/2),k=Math.min(w[3]||0,A/2,T/2)),S.moveTo(P,0),S.lineTo(A-O,0),S.arc(A-O,O,O,Math.PI*3/2,0,!1),S.lineTo(A,T-D),S.arc(A-D,T-D,D,0,Math.PI/2,!1),S.lineTo(k,T),S.arc(k,T-k,k,Math.PI/2,Math.PI,!1),S.lineTo(0,P),S.arc(P,P,P,Math.PI,Math.PI*3/2,!1)}}})(Util);var Node$1={},Factory={},Validators={};Object.defineProperty(Validators,"__esModule",{value:!0});Validators.getComponentValidator=Validators.getBooleanValidator=Validators.getNumberArrayValidator=Validators.getFunctionValidator=Validators.getStringOrGradientValidator=Validators.getStringValidator=Validators.getNumberOrAutoValidator=Validators.getNumberOrArrayOfNumbersValidator=Validators.getNumberValidator=Validators.alphaComponent=Validators.RGBComponent=void 0;const Global_1$p=Global,Util_1$f=Util;function _formatValue(o){return Util_1$f.Util._isString(o)?'"'+o+'"':Object.prototype.toString.call(o)==="[object Number]"||Util_1$f.Util._isBoolean(o)?o:Object.prototype.toString.call(o)}function RGBComponent(o){return o>255?255:o<0?0:Math.round(o)}Validators.RGBComponent=RGBComponent;function alphaComponent(o){return o>1?1:o<1e-4?1e-4:o}Validators.alphaComponent=alphaComponent;function getNumberValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){return Util_1$f.Util._isNumber(o)||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),o}}Validators.getNumberValidator=getNumberValidator;function getNumberOrArrayOfNumbersValidator(o){if(Global_1$p.Konva.isUnminified)return function(e,r){let t=Util_1$f.Util._isNumber(e),n=Util_1$f.Util._isArray(e)&&e.length==o;return!t&&!n&&Util_1$f.Util.warn(_formatValue(e)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+o+")"),e}}Validators.getNumberOrArrayOfNumbersValidator=getNumberOrArrayOfNumbersValidator;function getNumberOrAutoValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){var r=Util_1$f.Util._isNumber(o),t=o==="auto";return r||t||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),o}}Validators.getNumberOrAutoValidator=getNumberOrAutoValidator;function getStringValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){return Util_1$f.Util._isString(o)||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),o}}Validators.getStringValidator=getStringValidator;function getStringOrGradientValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){const r=Util_1$f.Util._isString(o),t=Object.prototype.toString.call(o)==="[object CanvasGradient]"||o&&o.addColorStop;return r||t||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),o}}Validators.getStringOrGradientValidator=getStringOrGradientValidator;function getFunctionValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){return Util_1$f.Util._isFunction(o)||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),o}}Validators.getFunctionValidator=getFunctionValidator;function getNumberArrayValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&o instanceof r||(Util_1$f.Util._isArray(o)?o.forEach(function(t){Util_1$f.Util._isNumber(t)||Util_1$f.Util.warn('"'+e+'" attribute has non numeric element '+t+". Make sure that all elements are numbers.")}):Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),o}}Validators.getNumberArrayValidator=getNumberArrayValidator;function getBooleanValidator(){if(Global_1$p.Konva.isUnminified)return function(o,e){var r=o===!0||o===!1;return r||Util_1$f.Util.warn(_formatValue(o)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),o}}Validators.getBooleanValidator=getBooleanValidator;function getComponentValidator(o){if(Global_1$p.Konva.isUnminified)return function(e,r){return e==null||Util_1$f.Util.isObject(e)||Util_1$f.Util.warn(_formatValue(e)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+o),e}}Validators.getComponentValidator=getComponentValidator;(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Factory=void 0;const e=Util,r=Validators;var t="get",n="set";o.Factory={addGetterSetter(a,l,u,f,d){o.Factory.addGetter(a,l,u),o.Factory.addSetter(a,l,f,d),o.Factory.addOverloadedGetterSetter(a,l)},addGetter(a,l,u){var f=t+e.Util._capitalize(l);a.prototype[f]=a.prototype[f]||function(){var d=this.attrs[l];return d===void 0?u:d}},addSetter(a,l,u,f){var d=n+e.Util._capitalize(l);a.prototype[d]||o.Factory.overWriteSetter(a,l,u,f)},overWriteSetter(a,l,u,f){var d=n+e.Util._capitalize(l);a.prototype[d]=function(h){return u&&h!==void 0&&h!==null&&(h=u.call(this,h,l)),this._setAttr(l,h),f&&f.call(this),this}},addComponentsGetterSetter(a,l,u,f,d){var h=u.length,y=e.Util._capitalize,E=t+y(l),p=n+y(l),_,g;a.prototype[E]=function(){var C={};for(_=0;_<h;_++)g=u[_],C[g]=this.getAttr(l+y(g));return C};var x=(0,r.getComponentValidator)(u);a.prototype[p]=function(C){var R=this.attrs[l],S;f&&(C=f.call(this,C)),x&&x.call(this,C,l);for(S in C)C.hasOwnProperty(S)&&this._setAttr(l+y(S),C[S]);return C||u.forEach(A=>{this._setAttr(l+y(A),void 0)}),this._fireChangeEvent(l,R,C),d&&d.call(this),this},o.Factory.addOverloadedGetterSetter(a,l)},addOverloadedGetterSetter(a,l){var u=e.Util._capitalize(l),f=n+u,d=t+u;a.prototype[l]=function(){return arguments.length?(this[f](arguments[0]),this):this[d]()}},addDeprecatedGetterSetter(a,l,u,f){e.Util.error("Adding deprecated "+l);var d=t+e.Util._capitalize(l),h=l+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[d]=function(){e.Util.error(h);var y=this.attrs[l];return y===void 0?u:y},o.Factory.addSetter(a,l,f,function(){e.Util.error(h)}),o.Factory.addOverloadedGetterSetter(a,l)},backCompat(a,l){e.Util.each(l,function(u,f){var d=a.prototype[f],h=t+e.Util._capitalize(u),y=n+e.Util._capitalize(u);function E(){d.apply(this,arguments),e.Util.error('"'+u+'" method is deprecated and will be removed soon. Use ""'+f+'" instead.')}a.prototype[u]=E,a.prototype[h]=E,a.prototype[y]=E})},afterSetFilter(){this._filterUpToDate=!1}}})(Factory);var Canvas$1={},Context$2={};Object.defineProperty(Context$2,"__esModule",{value:!0});Context$2.HitContext=Context$2.SceneContext=Context$2.Context=void 0;const Util_1$e=Util,Global_1$o=Global;function simplifyArray(o){var e=[],r=o.length,t=Util_1$e.Util,n,a;for(n=0;n<r;n++)a=o[n],t._isNumber(a)?a=Math.round(a*1e3)/1e3:t._isString(a)||(a=a+""),e.push(a);return e}var COMMA=",",OPEN_PAREN="(",CLOSE_PAREN=")",OPEN_PAREN_BRACKET="([",CLOSE_BRACKET_PAREN="])",SEMICOLON=";",DOUBLE_PAREN="()",EQUALS="=",CONTEXT_METHODS=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],CONTEXT_PROPERTIES=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const traceArrMax=100;let Context$1=class{constructor(e){this.canvas=e,Global_1$o.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,r){var t=this.traceArr,n=t.length,a="",l,u,f,d;for(l=0;l<n;l++)u=t[l],f=u.method,f?(d=u.args,a+=f,e?a+=DOUBLE_PAREN:Util_1$e.Util._isArray(d[0])?a+=OPEN_PAREN_BRACKET+d.join(COMMA)+CLOSE_BRACKET_PAREN:(r&&(d=d.map(h=>typeof h=="number"?Math.floor(h):h)),a+=OPEN_PAREN+d.join(COMMA)+CLOSE_PAREN)):(a+=u.property,e||(a+=EQUALS+u.val)),a+=SEMICOLON;return a}clearTrace(){this.traceArr=[]}_trace(e){var r=this.traceArr,t;r.push(e),t=r.length,t>=traceArrMax&&r.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var r=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(e){const r=e.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(e){var r=e.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(e){const r=e.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(e,r){this._context[e]=r}arc(e,r,t,n,a,l){this._context.arc(e,r,t,n,a,l)}arcTo(e,r,t,n,a){this._context.arcTo(e,r,t,n,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,r,t,n,a,l){this._context.bezierCurveTo(e,r,t,n,a,l)}clearRect(e,r,t,n){this._context.clearRect(e,r,t,n)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,r){var t=arguments;if(t.length===2)return this._context.createImageData(e,r);if(t.length===1)return this._context.createImageData(e)}createLinearGradient(e,r,t,n){return this._context.createLinearGradient(e,r,t,n)}createPattern(e,r){return this._context.createPattern(e,r)}createRadialGradient(e,r,t,n,a,l){return this._context.createRadialGradient(e,r,t,n,a,l)}drawImage(e,r,t,n,a,l,u,f,d){var h=arguments,y=this._context;h.length===3?y.drawImage(e,r,t):h.length===5?y.drawImage(e,r,t,n,a):h.length===9&&y.drawImage(e,r,t,n,a,l,u,f,d)}ellipse(e,r,t,n,a,l,u,f){this._context.ellipse(e,r,t,n,a,l,u,f)}isPointInPath(e,r,t,n){return t?this._context.isPointInPath(t,e,r,n):this._context.isPointInPath(e,r,n)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,r,t,n){this._context.fillRect(e,r,t,n)}strokeRect(e,r,t,n){this._context.strokeRect(e,r,t,n)}fillText(e,r,t,n){n?this._context.fillText(e,r,t,n):this._context.fillText(e,r,t)}measureText(e){return this._context.measureText(e)}getImageData(e,r,t,n){return this._context.getImageData(e,r,t,n)}lineTo(e,r){this._context.lineTo(e,r)}moveTo(e,r){this._context.moveTo(e,r)}rect(e,r,t,n){this._context.rect(e,r,t,n)}putImageData(e,r,t){this._context.putImageData(e,r,t)}quadraticCurveTo(e,r,t,n){this._context.quadraticCurveTo(e,r,t,n)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,r){this._context.scale(e,r)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,r,t,n,a,l){this._context.setTransform(e,r,t,n,a,l)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,r,t,n){this._context.strokeText(e,r,t,n)}transform(e,r,t,n,a,l){this._context.transform(e,r,t,n,a,l)}translate(e,r){this._context.translate(e,r)}_enableTrace(){var e=this,r=CONTEXT_METHODS.length,t=this.setAttr,n,a,l=function(u){var f=e[u],d;e[u]=function(){return a=simplifyArray(Array.prototype.slice.call(arguments,0)),d=f.apply(e,arguments),e._trace({method:u,args:a}),d}};for(n=0;n<r;n++)l(CONTEXT_METHODS[n]);e.setAttr=function(){t.apply(e,arguments);var u=arguments[0],f=arguments[1];(u==="shadowOffsetX"||u==="shadowOffsetY"||u==="shadowBlur")&&(f=f/this.canvas.getPixelRatio()),e._trace({property:u,val:f})}}_applyGlobalCompositeOperation(e){const r=e.attrs.globalCompositeOperation;var t=!r||r==="source-over";t||this.setAttr("globalCompositeOperation",r)}};Context$2.Context=Context$1;CONTEXT_PROPERTIES.forEach(function(o){Object.defineProperty(Context$1.prototype,o,{get(){return this._context[o]},set(e){this._context[o]=e}})});class SceneContext extends Context$1{constructor(e,{willReadFrequently:r=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(e){var r=e.fill();this.setAttr("fillStyle",r),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){var r=e._getLinearGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fillRadialGradient(e){const r=e._getRadialGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fill(e){const r=e.fill(),t=e.getFillPriority();if(r&&t==="color"){this._fillColor(e);return}const n=e.getFillPatternImage();if(n&&t==="pattern"){this._fillPattern(e);return}const a=e.getFillLinearGradientColorStops();if(a&&t==="linear-gradient"){this._fillLinearGradient(e);return}const l=e.getFillRadialGradientColorStops();if(l&&t==="radial-gradient"){this._fillRadialGradient(e);return}r?this._fillColor(e):n?this._fillPattern(e):a?this._fillLinearGradient(e):l&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const r=e.getStrokeLinearGradientStartPoint(),t=e.getStrokeLinearGradientEndPoint(),n=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,t.x,t.y);if(n){for(var l=0;l<n.length;l+=2)a.addColorStop(n[l],n[l+1]);this.setAttr("strokeStyle",a)}}_stroke(e){var r=e.dash(),t=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!t){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(e),r&&e.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=e.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),t||this.restore()}}_applyShadow(e){var r,t,n,a=(r=e.getShadowRGBA())!==null&&r!==void 0?r:"black",l=(t=e.getShadowBlur())!==null&&t!==void 0?t:5,u=(n=e.getShadowOffset())!==null&&n!==void 0?n:{x:0,y:0},f=e.getAbsoluteScale(),d=this.canvas.getPixelRatio(),h=f.x*d,y=f.y*d;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",l*Math.min(Math.abs(h),Math.abs(y))),this.setAttr("shadowOffsetX",u.x*h),this.setAttr("shadowOffsetY",u.y*y)}}Context$2.SceneContext=SceneContext;class HitContext extends Context$1{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const a=e.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(e);var t=e.hitStrokeWidth(),n=t==="auto"?e.strokeWidth():t;this.setAttr("lineWidth",n),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),a||this.restore()}}}Context$2.HitContext=HitContext;Object.defineProperty(Canvas$1,"__esModule",{value:!0});Canvas$1.HitCanvas=Canvas$1.SceneCanvas=Canvas$1.Canvas=void 0;const Util_1$d=Util,Context_1=Context$2,Global_1$n=Global,Factory_1$z=Factory,Validators_1$y=Validators;var _pixelRatio;function getDevicePixelRatio(){if(_pixelRatio)return _pixelRatio;var o=Util_1$d.Util.createCanvasElement(),e=o.getContext("2d");return _pixelRatio=function(){var r=Global_1$n.Konva._global.devicePixelRatio||1,t=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/t}(),Util_1$d.Util.releaseCanvas(o),_pixelRatio}class Canvas{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=e||{},t=r.pixelRatio||Global_1$n.Konva.pixelRatio||getDevicePixelRatio();this.pixelRatio=t,this._canvas=Util_1$d.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){var r=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";var r=this.pixelRatio,t=this.getContext()._context;t.scale(r,r)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var r=this.pixelRatio,t=this.getContext()._context;t.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,r){this.setWidth(e||0),this.setHeight(r||0)}toDataURL(e,r){try{return this._canvas.toDataURL(e,r)}catch{try{return this._canvas.toDataURL()}catch(n){return Util_1$d.Util.error("Unable to get data URL. "+n.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Canvas$1.Canvas=Canvas;Factory_1$z.Factory.addGetterSetter(Canvas,"pixelRatio",void 0,(0,Validators_1$y.getNumberValidator)());class SceneCanvas extends Canvas{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new Context_1.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}Canvas$1.SceneCanvas=SceneCanvas;class HitCanvas extends Canvas{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Context_1.HitContext(this),this.setSize(e.width,e.height)}}Canvas$1.HitCanvas=HitCanvas;var DragAndDrop={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.DD=void 0;const e=Global,r=Util;o.DD={get isDragging(){var t=!1;return o.DD._dragElements.forEach(n=>{n.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){var t;return o.DD._dragElements.forEach(n=>{t=n.node}),t},_dragElements:new Map,_drag(t){const n=[];o.DD._dragElements.forEach((a,l)=>{const{node:u}=a,f=u.getStage();f.setPointersPositions(t),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(t));const d=f._changedPointerPositions.find(E=>E.id===a.pointerId);if(d){if(a.dragStatus!=="dragging"){var h=u.dragDistance(),y=Math.max(Math.abs(d.x-a.startPointerPos.x),Math.abs(d.y-a.startPointerPos.y));if(y<h||(u.startDrag({evt:t}),!u.isDragging()))return}u._setDragPosition(t,a),n.push(u)}}),n.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:t},!0)})},_endDragBefore(t){const n=[];o.DD._dragElements.forEach(a=>{const{node:l}=a,u=l.getStage();if(t&&u.setPointersPositions(t),!u._changedPointerPositions.find(h=>h.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(o.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,a.dragStatus="stopped");const d=a.node.getLayer()||a.node instanceof e.Konva.Stage&&a.node;d&&n.indexOf(d)===-1&&n.push(d)}),n.forEach(a=>{a.draw()})},_endDragAfter(t){o.DD._dragElements.forEach((n,a)=>{n.dragStatus==="stopped"&&n.node.fire("dragend",{type:"dragend",target:n.node,evt:t},!0),n.dragStatus!=="dragging"&&o.DD._dragElements.delete(a)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",o.DD._endDragBefore,!0),window.addEventListener("touchend",o.DD._endDragBefore,!0),window.addEventListener("mousemove",o.DD._drag),window.addEventListener("touchmove",o.DD._drag),window.addEventListener("mouseup",o.DD._endDragAfter,!1),window.addEventListener("touchend",o.DD._endDragAfter,!1))})(DragAndDrop);Object.defineProperty(Node$1,"__esModule",{value:!0});Node$1.Node=void 0;const Util_1$c=Util,Factory_1$y=Factory,Canvas_1$1=Canvas$1,Global_1$m=Global,DragAndDrop_1=DragAndDrop,Validators_1$x=Validators;var ABSOLUTE_OPACITY="absoluteOpacity",ALL_LISTENERS="allEventListeners",ABSOLUTE_TRANSFORM="absoluteTransform",ABSOLUTE_SCALE="absoluteScale",CANVAS="canvas",CHANGE="Change",CHILDREN="children",KONVA="konva",LISTENING="listening",MOUSEENTER="mouseenter",MOUSELEAVE="mouseleave",SET="set",SHAPE="Shape",SPACE$1=" ",STAGE="stage",TRANSFORM="transform",UPPER_STAGE="Stage",VISIBLE="visible",TRANSFORM_CHANGE_STR$1=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(SPACE$1);let idCounter=1;class Node{constructor(e){this._id=idCounter++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===TRANSFORM||e===ABSOLUTE_TRANSFORM)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,r){var t=this._cache.get(e),n=e===TRANSFORM||e===ABSOLUTE_TRANSFORM,a=t===void 0||n&&t.dirty===!0;return a&&(t=r.call(this),this._cache.set(e,t)),t}_calculate(e,r,t){if(!this._attachedDepsListeners.get(e)){const n=r.map(a=>a+"Change.konva").join(SPACE$1);this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,t)}_getCanvasCache(){return this._cache.get(CANVAS)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ABSOLUTE_TRANSFORM&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(CANVAS)){const{scene:e,filter:r,hit:t}=this._cache.get(CANVAS);Util_1$c.Util.releaseCanvas(e,r,t),this._cache.delete(CANVAS)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var r=e||{},t={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(t=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var n=Math.ceil(r.width||t.width),a=Math.ceil(r.height||t.height),l=r.pixelRatio,u=r.x===void 0?Math.floor(t.x):r.x,f=r.y===void 0?Math.floor(t.y):r.y,d=r.offset||0,h=r.drawBorder||!1,y=r.hitCanvasPixelRatio||1;if(!n||!a){Util_1$c.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}n+=d*2+1,a+=d*2+1,u-=d,f-=d;var E=new Canvas_1$1.SceneCanvas({pixelRatio:l,width:n,height:a}),p=new Canvas_1$1.SceneCanvas({pixelRatio:l,width:0,height:0,willReadFrequently:!0}),_=new Canvas_1$1.HitCanvas({pixelRatio:y,width:n,height:a}),g=E.getContext(),x=_.getContext();return _.isCache=!0,E.isCache=!0,this._cache.delete(CANVAS),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,p.getContext()._context.imageSmoothingEnabled=!1),g.save(),x.save(),g.translate(-u,-f),x.translate(-u,-f),this._isUnderCache=!0,this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY),this._clearSelfAndDescendantCache(ABSOLUTE_SCALE),this.drawScene(E,this),this.drawHit(_,this),this._isUnderCache=!1,g.restore(),x.restore(),h&&(g.save(),g.beginPath(),g.rect(0,0,n,a),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),this._cache.set(CANVAS,{scene:E,filter:p,hit:_,x:u,y:f}),this._requestDraw(),this}isCached(){return this._cache.has(CANVAS)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,r){var t=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],n=1/0,a=1/0,l=-1/0,u=-1/0,f=this.getAbsoluteTransform(r);return t.forEach(function(d){var h=f.point(d);n===void 0&&(n=l=h.x,a=u=h.y),n=Math.min(n,h.x),a=Math.min(a,h.y),l=Math.max(l,h.x),u=Math.max(u,h.y)}),{x:n,y:a,width:l-n,height:u-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();e.translate(r.x,r.y);var t=this._getCachedSceneCanvas(),n=t.pixelRatio;e.drawImage(t._canvas,0,0,t.width/n,t.height/n),e.restore()}_drawCachedHitCanvas(e){var r=this._getCanvasCache(),t=r.hit;e.save(),e.translate(r.x,r.y),e.drawImage(t._canvas,0,0,t.width/t.pixelRatio,t.height/t.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e=this.filters(),r=this._getCanvasCache(),t=r.scene,n=r.filter,a=n.getContext(),l,u,f,d;if(e){if(!this._filterUpToDate){var h=t.pixelRatio;n.setSize(t.width/t.pixelRatio,t.height/t.pixelRatio);try{for(l=e.length,a.clear(),a.drawImage(t._canvas,0,0,t.getWidth()/h,t.getHeight()/h),u=a.getImageData(0,0,n.getWidth(),n.getHeight()),f=0;f<l;f++){if(d=e[f],typeof d!="function"){Util_1$c.Util.error("Filter should be type of function, but got "+typeof d+" instead. Please check correct filters");continue}d.call(this,u),a.putImageData(u,0,0)}}catch(y){Util_1$c.Util.error("Unable to apply filter. "+y.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return n}return t}on(e,r){if(this._cache&&this._cache.delete(ALL_LISTENERS),arguments.length===3)return this._delegate.apply(this,arguments);var t=e.split(SPACE$1),n=t.length,a,l,u,f,d;for(a=0;a<n;a++)l=t[a],u=l.split("."),f=u[0],d=u[1]||"",this.eventListeners[f]||(this.eventListeners[f]=[]),this.eventListeners[f].push({name:d,handler:r});return this}off(e,r){var t=(e||"").split(SPACE$1),n=t.length,a,l,u,f,d,h;if(this._cache&&this._cache.delete(ALL_LISTENERS),!e)for(l in this.eventListeners)this._off(l);for(a=0;a<n;a++)if(u=t[a],f=u.split("."),d=f[0],h=f[1],d)this.eventListeners[d]&&this._off(d,h,r);else for(l in this.eventListeners)this._off(l,h,r);return this}dispatchEvent(e){var r={target:this,type:e.type,evt:e};return this.fire(e.type,r),this}addEventListener(e,r){return this.on(e,function(t){r.call(this,t.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,r,t){var n=this;this.on(e,function(a){for(var l=a.target.findAncestors(r,!0,n),u=0;u<l.length;u++)a=Util_1$c.Util.cloneObject(a),a.currentTarget=l[u],t.call(l[u],a)})}remove(){return this.isDragging()&&this.stopDrag(),DragAndDrop_1.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM),this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY),this._clearSelfAndDescendantCache(ABSOLUTE_SCALE),this._clearSelfAndDescendantCache(STAGE),this._clearSelfAndDescendantCache(VISIBLE),this._clearSelfAndDescendantCache(LISTENING)}_remove(){this._clearCaches();var e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){var r="get"+Util_1$c.Util._capitalize(e);return Util_1$c.Util._isFunction(this[r])?this[r]():this.attrs[e]}getAncestors(){for(var e=this.getParent(),r=[];e;)r.push(e),e=e.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{var r,t;if(!e)return this;for(r in e)r!==CHILDREN&&(t=SET+Util_1$c.Util._capitalize(r),Util_1$c.Util._isFunction(this[t])?this[t](e[r]):this._setAttr(r,e[r]))}),this}isListening(){return this._getCache(LISTENING,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return t&&t!==e&&this!==e?t._isListening(e):!0}isVisible(){return this._getCache(VISIBLE,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return t&&t!==e&&this!==e?t._isVisible(e):!0}shouldDrawHit(e,r=!1){if(e)return this._isVisible(e)&&this._isListening(e);var t=this.getLayer(),n=!1;DragAndDrop_1.DD._dragElements.forEach(l=>{l.dragStatus==="dragging"&&(l.node.nodeType==="Stage"||l.node.getLayer()===t)&&(n=!0)});var a=!r&&!Global_1$m.Konva.hitOnDragEnabled&&n;return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e=this.getDepth(),r=this,t=0,n,a,l,u;function f(h){for(n=[],a=h.length,l=0;l<a;l++)u=h[l],t++,u.nodeType!==SHAPE&&(n=n.concat(u.getChildren().slice())),u._id===r._id&&(l=a);n.length>0&&n[0].getDepth()<=e&&f(n)}const d=this.getStage();return r.nodeType!==UPPER_STAGE&&d&&f(d.getChildren()),t}getDepth(){for(var e=0,r=this.parent;r;)e++,r=r.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(TRANSFORM),this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;var r=e.getPointerPosition();if(!r)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(r)}getAbsolutePosition(e){let r=!1,t=this.parent;for(;t;){if(t.isCached()){r=!0;break}t=t.parent}r&&!e&&(e=!0);var n=this.getAbsoluteTransform(e).getMatrix(),a=new Util_1$c.Transform,l=this.offset();return a.m=n.slice(),a.translate(l.x,l.y),a.getTranslation()}setAbsolutePosition(e){const{x:r,y:t,...n}=this._clearTransform();this.attrs.x=r,this.attrs.y=t,this._clearCache(TRANSFORM);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(e.x,e.y),e={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(n),this.setPosition({x:e.x,y:e.y}),this._clearCache(TRANSFORM),this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM),this}_setTransform(e){var r;for(r in e)this.attrs[r]=e[r]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var r=e.x,t=e.y,n=this.x(),a=this.y();return r!==void 0&&(n+=r),t!==void 0&&(a+=t),this.setPosition({x:n,y:a}),this}_eachAncestorReverse(e,r){var t=[],n=this.getParent(),a,l;if(!(r&&r._id===this._id)){for(t.unshift(this);n&&(!r||n._id!==r._id);)t.unshift(n),n=n.parent;for(a=t.length,l=0;l<a;l++)e(t[l])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Util_1$c.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Util_1$c.Util.warn("Node has no parent. moveUp function is ignored."),!1;var e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Util_1$c.Util.warn("Node has no parent. moveDown function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Util_1$c.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Util_1$c.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Util_1$c.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(ABSOLUTE_OPACITY,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(e*=r.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e={},r=this.getAttrs(),t,n,a,l,u;e.attrs={};for(t in r)n=r[t],u=Util_1$c.Util.isObject(n)&&!Util_1$c.Util._isPlainObject(n)&&!Util_1$c.Util._isArray(n),!u&&(a=typeof this[t]=="function"&&this[t],delete r[t],l=a?a.call(this):null,r[t]=n,l!==n&&(e.attrs[t]=n));return e.className=this.getClassName(),Util_1$c.Util._prepareToStringify(e)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,r,t){var n=[];r&&this._isMatch(e)&&n.push(this);for(var a=this.parent;a;){if(a===t)return n;a._isMatch(e)&&n.push(a),a=a.parent}return n}isAncestorOf(e){return!1}findAncestor(e,r,t){return this.findAncestors(e,r,t)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var r=e.replace(/ /g,"").split(","),t=r.length,n,a;for(n=0;n<t;n++)if(a=r[n],Util_1$c.Util.isValidSelector(a)||(Util_1$c.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Util_1$c.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Util_1$c.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(STAGE,this._getStage)}_getStage(){var e=this.getParent();return e?e.getStage():null}fire(e,r={},t){return r.target=r.target||this,t?this._fireAndBubble(e,r):this._fire(e,r),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ABSOLUTE_TRANSFORM,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var r;if(e)return r=new Util_1$c.Transform,this._eachAncestorReverse(function(n){var a=n.transformsEnabled();a==="all"?r.multiply(n.getTransform()):a==="position"&&r.translate(n.x()-n.offsetX(),n.y()-n.offsetY())},e),r;r=this._cache.get(ABSOLUTE_TRANSFORM)||new Util_1$c.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var t=this.transformsEnabled();if(t==="all")r.multiply(this.getTransform());else if(t==="position"){const n=this.attrs.x||0,a=this.attrs.y||0,l=this.attrs.offsetX||0,u=this.attrs.offsetY||0;r.translate(n-l,a-u)}return r.dirty=!1,r}getAbsoluteScale(e){for(var r=this;r;)r._isUnderCache&&(e=r),r=r.getParent();const n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(TRANSFORM,this._getTransform)}_getTransform(){var e,r,t=this._cache.get(TRANSFORM)||new Util_1$c.Transform;t.reset();var n=this.x(),a=this.y(),l=Global_1$m.Konva.getAngle(this.rotation()),u=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,f=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,d=this.attrs.skewX||0,h=this.attrs.skewY||0,y=this.attrs.offsetX||0,E=this.attrs.offsetY||0;return(n!==0||a!==0)&&t.translate(n,a),l!==0&&t.rotate(l),(d!==0||h!==0)&&t.skew(d,h),(u!==1||f!==1)&&t.scale(u,f),(y!==0||E!==0)&&t.translate(-1*y,-1*E),t.dirty=!1,t}clone(e){var r=Util_1$c.Util.cloneObject(this.attrs),t,n,a,l,u;for(t in e)r[t]=e[t];var f=new this.constructor(r);for(t in this.eventListeners)for(n=this.eventListeners[t],a=n.length,l=0;l<a;l++)u=n[l],u.name.indexOf(KONVA)<0&&(f.eventListeners[t]||(f.eventListeners[t]=[]),f.eventListeners[t].push(u));return f}_toKonvaCanvas(e){e=e||{};var r=this.getClientRect(),t=this.getStage(),n=e.x!==void 0?e.x:Math.floor(r.x),a=e.y!==void 0?e.y:Math.floor(r.y),l=e.pixelRatio||1,u=new Canvas_1$1.SceneCanvas({width:e.width||Math.ceil(r.width)||(t?t.width():0),height:e.height||Math.ceil(r.height)||(t?t.height():0),pixelRatio:l}),f=u.getContext();return e.imageSmoothingEnabled===!1&&(f._context.imageSmoothingEnabled=!1),f.save(),(n||a)&&f.translate(-1*n,-1*a),this.drawScene(u),f.restore(),u}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};var r=e.mimeType||null,t=e.quality||null,n=this._toKonvaCanvas(e).toDataURL(r,t);return e.callback&&e.callback(n),n}toImage(e){return new Promise((r,t)=>{try{const n=e==null?void 0:e.callback;n&&delete e.callback,Util_1$c.Util._urlToImage(this.toDataURL(e),function(a){r(a),n==null||n(a)})}catch(n){t(n)}})}toBlob(e){return new Promise((r,t)=>{try{const n=e==null?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob(a=>{r(a),n==null||n(a)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(n){t(n)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Global_1$m.Konva.dragDistance}_off(e,r,t){var n=this.eventListeners[e],a,l,u;for(a=0;a<n.length;a++)if(l=n[a].name,u=n[a].handler,(l!=="konva"||r==="konva")&&(!r||l===r)&&(!t||t===u)){if(n.splice(a,1),n.length===0){delete this.eventListeners[e];break}a--}}_fireChangeEvent(e,r,t){this._fire(e+CHANGE,{oldVal:r,newVal:t})}addName(e){if(!this.hasName(e)){var r=this.name(),t=r?r+" "+e:e;this.name(t)}return this}hasName(e){if(!e)return!1;const r=this.name();if(!r)return!1;var t=(r||"").split(/\s/g);return t.indexOf(e)!==-1}removeName(e){var r=(this.name()||"").split(/\s/g),t=r.indexOf(e);return t!==-1&&(r.splice(t,1),this.name(r.join(" "))),this}setAttr(e,r){var t=this[SET+Util_1$c.Util._capitalize(e)];return Util_1$c.Util._isFunction(t)?t.call(this,r):this._setAttr(e,r),this}_requestDraw(){if(Global_1$m.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,r){var t=this.attrs[e];t===r&&!Util_1$c.Util.isObject(r)||(r==null?delete this.attrs[e]:this.attrs[e]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(e,t,r),this._requestDraw())}_setComponentAttr(e,r,t){var n;t!==void 0&&(n=this.attrs[e],n||(this.attrs[e]=this.getAttr(e)),this.attrs[e][r]=t,this._fireChangeEvent(e,n,t))}_fireAndBubble(e,r,t){r&&this.nodeType===SHAPE&&(r.target=this);var n=(e===MOUSEENTER||e===MOUSELEAVE)&&(t&&(this===t||this.isAncestorOf&&this.isAncestorOf(t))||this.nodeType==="Stage"&&!t);if(!n){this._fire(e,r);var a=(e===MOUSEENTER||e===MOUSELEAVE)&&t&&t.isAncestorOf&&t.isAncestorOf(this)&&!t.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(t&&t.parent?this._fireAndBubble.call(this.parent,e,r,t):this._fireAndBubble.call(this.parent,e,r))}}_getProtoListeners(e){var r,t,n;const a=(r=this._cache.get(ALL_LISTENERS))!==null&&r!==void 0?r:{};let l=a==null?void 0:a[e];if(l===void 0){l=[];let u=Object.getPrototypeOf(this);for(;u;){const f=(n=(t=u.eventListeners)===null||t===void 0?void 0:t[e])!==null&&n!==void 0?n:[];l.push(...f),u=Object.getPrototypeOf(u)}a[e]=l,this._cache.set(ALL_LISTENERS,a)}return l}_fire(e,r){r=r||{},r.currentTarget=this,r.type=e;const t=this._getProtoListeners(e);if(t)for(var n=0;n<t.length;n++)t[n].handler.call(this,r);const a=this.eventListeners[e];if(a)for(var n=0;n<a.length;n++)a[n].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){var r=e?e.pointerId:void 0,t=this.getStage(),n=this.getAbsolutePosition();if(t){var a=t._getPointerById(r)||t._changedPointerPositions[0]||n;DragAndDrop_1.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-n.x,y:a.y-n.y},dragStatus:"ready",pointerId:r})}}startDrag(e,r=!0){DragAndDrop_1.DD._dragElements.has(this._id)||this._createDragElement(e);const t=DragAndDrop_1.DD._dragElements.get(this._id);t.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},r)}_setDragPosition(e,r){const t=this.getStage()._getPointerById(r.pointerId);if(t){var n={x:t.x-r.offset.x,y:t.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const l=a.call(this,n,e);l?n=l:Util_1$c.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==n.x||this._lastPos.y!==n.y)&&(this.setAbsolutePosition(n),this._requestDraw()),this._lastPos=n}}stopDrag(e){const r=DragAndDrop_1.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),DragAndDrop_1.DD._endDragBefore(e),DragAndDrop_1.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=DragAndDrop_1.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){var r=e.evt.button!==void 0,t=!r||Global_1$m.Konva.dragButtons.indexOf(e.evt.button)>=0;if(t&&!this.isDragging()){var n=!1;DragAndDrop_1.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(n=!0)}),n||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const r=DragAndDrop_1.DD._dragElements.get(this._id),t=r&&r.dragStatus==="dragging",n=r&&r.dragStatus==="ready";t?this.stopDrag():n&&DragAndDrop_1.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const r=this.getStage();if(!r)return!1;const t={x:-e.x,y:-e.y,width:r.width()+2*e.x,height:r.height()+2*e.y};return Util_1$c.Util.haveIntersection(t,this.getClientRect())}static create(e,r){return Util_1$c.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,r)}static _createNode(e,r){var t=Node.prototype.getClassName.call(e),n=e.children,a,l,u;r&&(e.attrs.container=r),Global_1$m.Konva[t]||(Util_1$c.Util.warn('Can not find a node with class name "'+t+'". Fallback to "Shape".'),t="Shape");const f=Global_1$m.Konva[t];if(a=new f(e.attrs),n)for(l=n.length,u=0;u<l;u++)a.add(Node._createNode(n[u]));return a}}Node$1.Node=Node;Node.prototype.nodeType="Node";Node.prototype._attrsAffectingSize=[];Node.prototype.eventListeners={};Node.prototype.on.call(Node.prototype,TRANSFORM_CHANGE_STR$1,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(TRANSFORM),this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM)});Node.prototype.on.call(Node.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(VISIBLE)});Node.prototype.on.call(Node.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(LISTENING)});Node.prototype.on.call(Node.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY)});const addGetterSetter=Factory_1$y.Factory.addGetterSetter;addGetterSetter(Node,"zIndex");addGetterSetter(Node,"absolutePosition");addGetterSetter(Node,"position");addGetterSetter(Node,"x",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"y",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"globalCompositeOperation","source-over",(0,Validators_1$x.getStringValidator)());addGetterSetter(Node,"opacity",1,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"name","",(0,Validators_1$x.getStringValidator)());addGetterSetter(Node,"id","",(0,Validators_1$x.getStringValidator)());addGetterSetter(Node,"rotation",0,(0,Validators_1$x.getNumberValidator)());Factory_1$y.Factory.addComponentsGetterSetter(Node,"scale",["x","y"]);addGetterSetter(Node,"scaleX",1,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"scaleY",1,(0,Validators_1$x.getNumberValidator)());Factory_1$y.Factory.addComponentsGetterSetter(Node,"skew",["x","y"]);addGetterSetter(Node,"skewX",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"skewY",0,(0,Validators_1$x.getNumberValidator)());Factory_1$y.Factory.addComponentsGetterSetter(Node,"offset",["x","y"]);addGetterSetter(Node,"offsetX",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"offsetY",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"dragDistance",null,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"width",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"height",0,(0,Validators_1$x.getNumberValidator)());addGetterSetter(Node,"listening",!0,(0,Validators_1$x.getBooleanValidator)());addGetterSetter(Node,"preventDefault",!0,(0,Validators_1$x.getBooleanValidator)());addGetterSetter(Node,"filters",null,function(o){return this._filterUpToDate=!1,o});addGetterSetter(Node,"visible",!0,(0,Validators_1$x.getBooleanValidator)());addGetterSetter(Node,"transformsEnabled","all",(0,Validators_1$x.getStringValidator)());addGetterSetter(Node,"size");addGetterSetter(Node,"dragBoundFunc");addGetterSetter(Node,"draggable",!1,(0,Validators_1$x.getBooleanValidator)());Factory_1$y.Factory.backCompat(Node,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Container$2={};Object.defineProperty(Container$2,"__esModule",{value:!0});Container$2.Container=void 0;const Factory_1$x=Factory,Node_1$h=Node$1,Validators_1$w=Validators;let Container$1=class extends Node_1$h.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const r=this.children||[];var t=[];return r.forEach(function(n){e(n)&&t.push(n)}),t}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(var r=0;r<e.length;r++)this.add(e[r]);return this}const t=e[0];return t.getParent()?(t.moveTo(this),this):(this._validateAdd(t),t.index=this.getChildren().length,t.parent=this,t._clearCaches(),this.getChildren().push(t),this._fire("add",{child:t}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){var r=this._generalFind(e,!0);return r.length>0?r[0]:void 0}_generalFind(e,r){var t=[];return this._descendants(n=>{const a=n._isMatch(e);return a&&t.push(n),!!(a&&r)}),t}_descendants(e){let r=!1;const t=this.getChildren();for(const n of t){if(r=e(n),r)return!0;if(n.hasChildren()&&(r=n._descendants(e),r))return!0}return!1}toObject(){var e=Node_1$h.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(r=>{e.children.push(r.toObject())}),e}isAncestorOf(e){for(var r=e.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(e){var r=Node_1$h.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(t){r.add(t.clone())}),r}getAllIntersections(e){var r=[];return this.find("Shape").forEach(t=>{t.isVisible()&&t.intersects(e)&&r.push(t)}),r}_clearSelfAndDescendantCache(e){var r;super._clearSelfAndDescendantCache(e),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(r,t){r.index=t}),this._requestDraw()}drawScene(e,r){var t=this.getLayer(),n=e||t&&t.getCanvas(),a=n&&n.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=n&&n.isCache;if(!this.isVisible()&&!f)return this;if(u){a.save();var d=this.getAbsoluteTransform(r).getMatrix();a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",n,r);return this}drawHit(e,r){if(!this.shouldDrawHit(r))return this;var t=this.getLayer(),n=e||t&&t.hitCanvas,a=n&&n.getContext(),l=this._getCanvasCache(),u=l&&l.hit;if(u){a.save();var f=this.getAbsoluteTransform(r).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",n,r);return this}_drawChildren(e,r,t){var n,a=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),d=l&&u||f;const h=t===this;if(d){a.save();var y=this.getAbsoluteTransform(t),E=y.getMatrix();a.transform(E[0],E[1],E[2],E[3],E[4],E[5]),a.beginPath();let x;if(f)x=f.call(this,a,this);else{var p=this.clipX(),_=this.clipY();a.rect(p,_,l,u)}a.clip.apply(a,x),E=y.copy().invert().getMatrix(),a.transform(E[0],E[1],E[2],E[3],E[4],E[5])}var g=!h&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";g&&(a.save(),a._applyGlobalCompositeOperation(this)),(n=this.children)===null||n===void 0||n.forEach(function(x){x[e](r,t)}),g&&a.restore(),d&&a.restore()}getClientRect(e={}){var r,t=e.skipTransform,n=e.relativeTo,a,l,u,f,d={x:1/0,y:1/0,width:0,height:0},h=this;(r=this.children)===null||r===void 0||r.forEach(function(g){if(g.visible()){var x=g.getClientRect({relativeTo:h,skipShadow:e.skipShadow,skipStroke:e.skipStroke});x.width===0&&x.height===0||(a===void 0?(a=x.x,l=x.y,u=x.x+x.width,f=x.y+x.height):(a=Math.min(a,x.x),l=Math.min(l,x.y),u=Math.max(u,x.x+x.width),f=Math.max(f,x.y+x.height)))}});for(var y=this.find("Shape"),E=!1,p=0;p<y.length;p++){var _=y[p];if(_._isVisible(this)){E=!0;break}}return E&&a!==void 0?d={x:a,y:l,width:u-a,height:f-l}:d={x:0,y:0,width:0,height:0},t?d:this._transformedRect(d,n)}};Container$2.Container=Container$1;Factory_1$x.Factory.addComponentsGetterSetter(Container$1,"clip",["x","y","width","height"]);Factory_1$x.Factory.addGetterSetter(Container$1,"clipX",void 0,(0,Validators_1$w.getNumberValidator)());Factory_1$x.Factory.addGetterSetter(Container$1,"clipY",void 0,(0,Validators_1$w.getNumberValidator)());Factory_1$x.Factory.addGetterSetter(Container$1,"clipWidth",void 0,(0,Validators_1$w.getNumberValidator)());Factory_1$x.Factory.addGetterSetter(Container$1,"clipHeight",void 0,(0,Validators_1$w.getNumberValidator)());Factory_1$x.Factory.addGetterSetter(Container$1,"clipFunc");var Stage$1={},PointerEvents={};Object.defineProperty(PointerEvents,"__esModule",{value:!0});PointerEvents.releaseCapture=PointerEvents.setPointerCapture=PointerEvents.hasPointerCapture=PointerEvents.createEvent=PointerEvents.getCapturedShape=void 0;const Global_1$l=Global,Captures=new Map,SUPPORT_POINTER_EVENTS=Global_1$l.Konva._global.PointerEvent!==void 0;function getCapturedShape(o){return Captures.get(o)}PointerEvents.getCapturedShape=getCapturedShape;function createEvent(o){return{evt:o,pointerId:o.pointerId}}PointerEvents.createEvent=createEvent;function hasPointerCapture(o,e){return Captures.get(o)===e}PointerEvents.hasPointerCapture=hasPointerCapture;function setPointerCapture(o,e){releaseCapture(o),e.getStage()&&(Captures.set(o,e),SUPPORT_POINTER_EVENTS&&e._fire("gotpointercapture",createEvent(new PointerEvent("gotpointercapture"))))}PointerEvents.setPointerCapture=setPointerCapture;function releaseCapture(o,e){const r=Captures.get(o);if(!r)return;const t=r.getStage();t&&t.content,Captures.delete(o),SUPPORT_POINTER_EVENTS&&r._fire("lostpointercapture",createEvent(new PointerEvent("lostpointercapture")))}PointerEvents.releaseCapture=releaseCapture;(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Stage=o.stages=void 0;const e=Util,r=Factory,t=Container$2,n=Global,a=Canvas$1,l=DragAndDrop,u=Global,f=PointerEvents;var d="Stage",h="string",y="px",E="mouseout",p="mouseleave",_="mouseover",g="mouseenter",x="mousemove",C="mousedown",R="mouseup",S="pointermove",A="pointerdown",T="pointerup",w="pointercancel",P="lostpointercapture",O="pointerout",k="pointerleave",D="pointerover",F="pointerenter",G="contextmenu",V="touchstart",W="touchend",ee="touchmove",q="touchcancel",z="wheel",U=5,$=[[g,"_pointerenter"],[C,"_pointerdown"],[x,"_pointermove"],[R,"_pointerup"],[p,"_pointerleave"],[V,"_pointerdown"],[ee,"_pointermove"],[W,"_pointerup"],[q,"_pointercancel"],[_,"_pointerover"],[z,"_wheel"],[G,"_contextmenu"],[A,"_pointerdown"],[S,"_pointermove"],[T,"_pointerup"],[w,"_pointercancel"],[P,"_lostpointercapture"]];const I={mouse:{[O]:E,[k]:p,[D]:_,[F]:g,[S]:x,[A]:C,[T]:R,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[O]:"touchout",[k]:"touchleave",[D]:"touchover",[F]:"touchenter",[S]:ee,[A]:V,[T]:W,[w]:q,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[O]:O,[k]:k,[D]:D,[F]:F,[S]:S,[A]:A,[T]:T,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=ae=>ae.indexOf("pointer")>=0?"pointer":ae.indexOf("touch")>=0?"touch":"mouse",X=ae=>{const Z=B(ae);if(Z==="pointer")return n.Konva.pointerEventsEnabled&&I.pointer;if(Z==="touch")return I.touch;if(Z==="mouse")return I.mouse};function Q(ae={}){return(ae.clipFunc||ae.clipWidth||ae.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),ae}const J="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";o.stages=[];class ne extends t.Container{constructor(Z){super(Q(Z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),o.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Q(this.attrs)}),this._checkVisibility()}_validateAdd(Z){const se=Z.getType()==="Layer",oe=Z.getType()==="FastLayer";se||oe||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const Z=this.visible()?"":"none";this.content.style.display=Z}setContainer(Z){if(typeof Z===h){if(Z.charAt(0)==="."){var se=Z.slice(1);Z=document.getElementsByClassName(se)[0]}else{var oe;Z.charAt(0)!=="#"?oe=Z:oe=Z.slice(1),Z=document.getElementById(oe)}if(!Z)throw"Can not find container in document with id "+oe}return this._setAttr("container",Z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),Z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var Z=this.children,se=Z.length,oe;for(oe=0;oe<se;oe++)Z[oe].clear();return this}clone(Z){return Z||(Z={}),Z.container=typeof document<"u"&&document.createElement("div"),t.Container.prototype.clone.call(this,Z)}destroy(){super.destroy();var Z=this.content;Z&&e.Util._isInDocument(Z)&&this.container().removeChild(Z);var se=o.stages.indexOf(this);return se>-1&&o.stages.splice(se,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Z=this._pointerPositions[0]||this._changedPointerPositions[0];return Z?{x:Z.x,y:Z.y}:(e.Util.warn(J),null)}_getPointerById(Z){return this._pointerPositions.find(se=>se.id===Z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(Z){Z=Z||{},Z.x=Z.x||0,Z.y=Z.y||0,Z.width=Z.width||this.width(),Z.height=Z.height||this.height();var se=new a.SceneCanvas({width:Z.width,height:Z.height,pixelRatio:Z.pixelRatio||1}),oe=se.getContext()._context,fe=this.children;return(Z.x||Z.y)&&oe.translate(-1*Z.x,-1*Z.y),fe.forEach(function(de){if(de.isVisible()){var ce=de._toKonvaCanvas(Z);oe.drawImage(ce._canvas,Z.x,Z.y,ce.getWidth()/ce.getPixelRatio(),ce.getHeight()/ce.getPixelRatio())}}),se}getIntersection(Z){if(!Z)return null;var se=this.children,oe=se.length,fe=oe-1,de;for(de=fe;de>=0;de--){const ce=se[de].getIntersection(Z);if(ce)return ce}return null}_resizeDOM(){var Z=this.width(),se=this.height();this.content&&(this.content.style.width=Z+y,this.content.style.height=se+y),this.bufferCanvas.setSize(Z,se),this.bufferHitCanvas.setSize(Z,se),this.children.forEach(oe=>{oe.setSize({width:Z,height:se}),oe.draw()})}add(Z,...se){if(arguments.length>1){for(var oe=0;oe<arguments.length;oe++)this.add(arguments[oe]);return this}super.add(Z);var fe=this.children.length;return fe>U&&e.Util.warn("The stage has "+fe+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),Z.setSize({width:this.width(),height:this.height()}),Z.draw(),n.Konva.isBrowser&&this.content.appendChild(Z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Z){return f.hasPointerCapture(Z,this)}setPointerCapture(Z){f.setPointerCapture(Z,this)}releaseCapture(Z){f.releaseCapture(Z,this)}getLayers(){return this.children}_bindContentEvents(){n.Konva.isBrowser&&$.forEach(([Z,se])=>{this.content.addEventListener(Z,oe=>{this[se](oe)},{passive:!1})})}_pointerenter(Z){this.setPointersPositions(Z);const se=X(Z.type);se&&this._fire(se.pointerenter,{evt:Z,target:this,currentTarget:this})}_pointerover(Z){this.setPointersPositions(Z);const se=X(Z.type);se&&this._fire(se.pointerover,{evt:Z,target:this,currentTarget:this})}_getTargetShape(Z){let se=this[Z+"targetShape"];return se&&!se.getStage()&&(se=null),se}_pointerleave(Z){const se=X(Z.type),oe=B(Z.type);if(se){this.setPointersPositions(Z);var fe=this._getTargetShape(oe),de=!l.DD.isDragging||n.Konva.hitOnDragEnabled;fe&&de?(fe._fireAndBubble(se.pointerout,{evt:Z}),fe._fireAndBubble(se.pointerleave,{evt:Z}),this._fire(se.pointerleave,{evt:Z,target:this,currentTarget:this}),this[oe+"targetShape"]=null):de&&(this._fire(se.pointerleave,{evt:Z,target:this,currentTarget:this}),this._fire(se.pointerout,{evt:Z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(Z){const se=X(Z.type),oe=B(Z.type);if(se){this.setPointersPositions(Z);var fe=!1;this._changedPointerPositions.forEach(de=>{var ce=this.getIntersection(de);if(l.DD.justDragged=!1,n.Konva["_"+oe+"ListenClick"]=!0,!ce||!ce.isListening())return;n.Konva.capturePointerEventsEnabled&&ce.setPointerCapture(de.id),this[oe+"ClickStartShape"]=ce,ce._fireAndBubble(se.pointerdown,{evt:Z,pointerId:de.id}),fe=!0;const Se=Z.type.indexOf("touch")>=0;ce.preventDefault()&&Z.cancelable&&Se&&Z.preventDefault()}),fe||this._fire(se.pointerdown,{evt:Z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(Z){const se=X(Z.type),oe=B(Z.type);if(!se)return;l.DD.isDragging&&l.DD.node.preventDefault()&&Z.cancelable&&Z.preventDefault(),this.setPointersPositions(Z);var fe=!l.DD.isDragging||n.Konva.hitOnDragEnabled;if(!fe)return;var de={};let ce=!1;var Se=this._getTargetShape(oe);this._changedPointerPositions.forEach(Le=>{const Ne=f.getCapturedShape(Le.id)||this.getIntersection(Le),He=Le.id,Ke={evt:Z,pointerId:He};var Qe=Se!==Ne;if(Qe&&Se&&(Se._fireAndBubble(se.pointerout,{...Ke},Ne),Se._fireAndBubble(se.pointerleave,{...Ke},Ne)),Ne){if(de[Ne._id])return;de[Ne._id]=!0}Ne&&Ne.isListening()?(ce=!0,Qe&&(Ne._fireAndBubble(se.pointerover,{...Ke},Se),Ne._fireAndBubble(se.pointerenter,{...Ke},Se),this[oe+"targetShape"]=Ne),Ne._fireAndBubble(se.pointermove,{...Ke})):Se&&(this._fire(se.pointerover,{evt:Z,target:this,currentTarget:this,pointerId:He}),this[oe+"targetShape"]=null)}),ce||this._fire(se.pointermove,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Z){const se=X(Z.type),oe=B(Z.type);if(!se)return;this.setPointersPositions(Z);const fe=this[oe+"ClickStartShape"],de=this[oe+"ClickEndShape"];var ce={};let Se=!1;this._changedPointerPositions.forEach(Le=>{const Ne=f.getCapturedShape(Le.id)||this.getIntersection(Le);if(Ne){if(Ne.releaseCapture(Le.id),ce[Ne._id])return;ce[Ne._id]=!0}const He=Le.id,Ke={evt:Z,pointerId:He};let Qe=!1;n.Konva["_"+oe+"InDblClickWindow"]?(Qe=!0,clearTimeout(this[oe+"DblTimeout"])):l.DD.justDragged||(n.Konva["_"+oe+"InDblClickWindow"]=!0,clearTimeout(this[oe+"DblTimeout"])),this[oe+"DblTimeout"]=setTimeout(function(){n.Konva["_"+oe+"InDblClickWindow"]=!1},n.Konva.dblClickWindow),Ne&&Ne.isListening()?(Se=!0,this[oe+"ClickEndShape"]=Ne,Ne._fireAndBubble(se.pointerup,{...Ke}),n.Konva["_"+oe+"ListenClick"]&&fe&&fe===Ne&&(Ne._fireAndBubble(se.pointerclick,{...Ke}),Qe&&de&&de===Ne&&Ne._fireAndBubble(se.pointerdblclick,{...Ke}))):(this[oe+"ClickEndShape"]=null,n.Konva["_"+oe+"ListenClick"]&&this._fire(se.pointerclick,{evt:Z,target:this,currentTarget:this,pointerId:He}),Qe&&this._fire(se.pointerdblclick,{evt:Z,target:this,currentTarget:this,pointerId:He}))}),Se||this._fire(se.pointerup,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),n.Konva["_"+oe+"ListenClick"]=!1,Z.cancelable&&oe!=="touch"&&Z.preventDefault()}_contextmenu(Z){this.setPointersPositions(Z);var se=this.getIntersection(this.getPointerPosition());se&&se.isListening()?se._fireAndBubble(G,{evt:Z}):this._fire(G,{evt:Z,target:this,currentTarget:this})}_wheel(Z){this.setPointersPositions(Z);var se=this.getIntersection(this.getPointerPosition());se&&se.isListening()?se._fireAndBubble(z,{evt:Z}):this._fire(z,{evt:Z,target:this,currentTarget:this})}_pointercancel(Z){this.setPointersPositions(Z);const se=f.getCapturedShape(Z.pointerId)||this.getIntersection(this.getPointerPosition());se&&se._fireAndBubble(T,f.createEvent(Z)),f.releaseCapture(Z.pointerId)}_lostpointercapture(Z){f.releaseCapture(Z.pointerId)}setPointersPositions(Z){var se=this._getContentPosition(),oe=null,fe=null;Z=Z||window.event,Z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Z.touches,de=>{this._pointerPositions.push({id:de.identifier,x:(de.clientX-se.left)/se.scaleX,y:(de.clientY-se.top)/se.scaleY})}),Array.prototype.forEach.call(Z.changedTouches||Z.touches,de=>{this._changedPointerPositions.push({id:de.identifier,x:(de.clientX-se.left)/se.scaleX,y:(de.clientY-se.top)/se.scaleY})})):(oe=(Z.clientX-se.left)/se.scaleX,fe=(Z.clientY-se.top)/se.scaleY,this.pointerPos={x:oe,y:fe},this._pointerPositions=[{x:oe,y:fe,id:e.Util._getFirstPointerId(Z)}],this._changedPointerPositions=[{x:oe,y:fe,id:e.Util._getFirstPointerId(Z)}])}_setPointerPosition(Z){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(Z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var Z=this.content.getBoundingClientRect();return{top:Z.top,left:Z.left,scaleX:Z.width/this.content.clientWidth||1,scaleY:Z.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!n.Konva.isBrowser){var Z=this.container();if(!Z)throw"Stage has no container. A container is required.";Z.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),Z.appendChild(this.content),this._resizeDOM()}}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Z){Z.batchDraw()}),this}}o.Stage=ne,ne.prototype.nodeType=d,(0,u._registerNode)(ne),r.Factory.addGetterSetter(ne,"container")})(Stage$1);var Layer$2={},Shape={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Shape=o.shapes=void 0;const e=Global,r=Util,t=Factory,n=Node$1,a=Validators,l=Global,u=PointerEvents;var f="hasShadow",d="shadowRGBA",h="patternImage",y="linearGradient",E="radialGradient";let p;function _(){return p||(p=r.Util.createCanvasElement().getContext("2d"),p)}o.shapes={};function g(k){const D=this.attrs.fillRule;D?k.fill(D):k.fill()}function x(k){k.stroke()}function C(k){k.fill()}function R(k){k.stroke()}function S(){this._clearCache(f)}function A(){this._clearCache(d)}function T(){this._clearCache(h)}function w(){this._clearCache(y)}function P(){this._clearCache(E)}class O extends n.Node{constructor(D){super(D);let F;for(;F=r.Util.getRandomColor(),!(F&&!(F in o.shapes)););this.colorKey=F,o.shapes[F]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(f,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var D=_();const F=D.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(F&&F.setTransform){const G=new r.Transform;G.translate(this.fillPatternX(),this.fillPatternY()),G.rotate(e.Konva.getAngle(this.fillPatternRotation())),G.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),G.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const V=G.getMatrix(),W=typeof DOMMatrix>"u"?{a:V[0],b:V[1],c:V[2],d:V[3],e:V[4],f:V[5]}:new DOMMatrix(V);F.setTransform(W)}return F}}_getLinearGradient(){return this._getCache(y,this.__getLinearGradient)}__getLinearGradient(){var D=this.fillLinearGradientColorStops();if(D){for(var F=_(),G=this.fillLinearGradientStartPoint(),V=this.fillLinearGradientEndPoint(),W=F.createLinearGradient(G.x,G.y,V.x,V.y),ee=0;ee<D.length;ee+=2)W.addColorStop(D[ee],D[ee+1]);return W}}_getRadialGradient(){return this._getCache(E,this.__getRadialGradient)}__getRadialGradient(){var D=this.fillRadialGradientColorStops();if(D){for(var F=_(),G=this.fillRadialGradientStartPoint(),V=this.fillRadialGradientEndPoint(),W=F.createRadialGradient(G.x,G.y,this.fillRadialGradientStartRadius(),V.x,V.y,this.fillRadialGradientEndRadius()),ee=0;ee<D.length;ee+=2)W.addColorStop(D[ee],D[ee+1]);return W}}getShadowRGBA(){return this._getCache(d,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var D=r.Util.colorToRGBA(this.shadowColor());if(D)return"rgba("+D.r+","+D.g+","+D.b+","+D.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const D=this.hitStrokeWidth();return D==="auto"?this.hasStroke():this.strokeEnabled()&&!!D}intersects(D){var F=this.getStage();if(!F)return!1;const G=F.bufferHitCanvas;return G.getContext().clear(),this.drawHit(G,void 0,!0),G.context.getImageData(Math.round(D.x),Math.round(D.y),1,1).data[3]>0}destroy(){return n.Node.prototype.destroy.call(this),delete o.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(D){var F;if(!this.getStage()||!((F=this.attrs.perfectDrawEnabled)!==null&&F!==void 0?F:!0))return!1;const V=D||this.hasFill(),W=this.hasStroke(),ee=this.getAbsoluteOpacity()!==1;if(V&&W&&ee)return!0;const q=this.hasShadow(),z=this.shadowForStrokeEnabled();return!!(V&&W&&q&&z)}setStrokeHitEnabled(D){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),D?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var D=this.size();return{x:this._centroid?-D.width/2:0,y:this._centroid?-D.height/2:0,width:D.width,height:D.height}}getClientRect(D={}){const F=D.skipTransform,G=D.relativeTo,V=this.getSelfRect(),ee=!D.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,q=V.width+ee,z=V.height+ee,U=!D.skipShadow&&this.hasShadow(),$=U?this.shadowOffsetX():0,I=U?this.shadowOffsetY():0,B=q+Math.abs($),X=z+Math.abs(I),Q=U&&this.shadowBlur()||0,J=B+Q*2,ne=X+Q*2,ae={width:J,height:ne,x:-(ee/2+Q)+Math.min($,0)+V.x,y:-(ee/2+Q)+Math.min(I,0)+V.y};return F?ae:this._transformedRect(ae,G)}drawScene(D,F){var G=this.getLayer(),V=D||G.getCanvas(),W=V.getContext(),ee=this._getCanvasCache(),q=this.getSceneFunc(),z=this.hasShadow(),U,$,I,B=V.isCache,X=F===this;if(!this.isVisible()&&!X)return this;if(ee){W.save();var Q=this.getAbsoluteTransform(F).getMatrix();return W.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]),this._drawCachedSceneCanvas(W),W.restore(),this}if(!q)return this;if(W.save(),this._useBufferCanvas()&&!B){U=this.getStage(),$=U.bufferCanvas,I=$.getContext(),I.clear(),I.save(),I._applyLineJoin(this);var J=this.getAbsoluteTransform(F).getMatrix();I.transform(J[0],J[1],J[2],J[3],J[4],J[5]),q.call(this,I,this),I.restore();var ne=$.pixelRatio;z&&W._applyShadow(this),W._applyOpacity(this),W._applyGlobalCompositeOperation(this),W.drawImage($._canvas,0,0,$.width/ne,$.height/ne)}else{if(W._applyLineJoin(this),!X){var J=this.getAbsoluteTransform(F).getMatrix();W.transform(J[0],J[1],J[2],J[3],J[4],J[5]),W._applyOpacity(this),W._applyGlobalCompositeOperation(this)}z&&W._applyShadow(this),q.call(this,W,this)}return W.restore(),this}drawHit(D,F,G=!1){if(!this.shouldDrawHit(F,G))return this;var V=this.getLayer(),W=D||V.hitCanvas,ee=W&&W.getContext(),q=this.hitFunc()||this.sceneFunc(),z=this._getCanvasCache(),U=z&&z.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),U){ee.save();var $=this.getAbsoluteTransform(F).getMatrix();return ee.transform($[0],$[1],$[2],$[3],$[4],$[5]),this._drawCachedHitCanvas(ee),ee.restore(),this}if(!q)return this;if(ee.save(),ee._applyLineJoin(this),!(this===F)){var B=this.getAbsoluteTransform(F).getMatrix();ee.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return q.call(this,ee,this),ee.restore(),this}drawHitFromCache(D=0){var F=this._getCanvasCache(),G=this._getCachedSceneCanvas(),V=F.hit,W=V.getContext(),ee=V.getWidth(),q=V.getHeight(),z,U,$,I,B,X;W.clear(),W.drawImage(G._canvas,0,0,ee,q);try{for(z=W.getImageData(0,0,ee,q),U=z.data,$=U.length,I=r.Util._hexToRgb(this.colorKey),B=0;B<$;B+=4)X=U[B+3],X>D?(U[B]=I.r,U[B+1]=I.g,U[B+2]=I.b,U[B+3]=255):U[B+3]=0;W.putImageData(z,0,0)}catch(Q){r.Util.error("Unable to draw hit graph from cached scene canvas. "+Q.message)}return this}hasPointerCapture(D){return u.hasPointerCapture(D,this)}setPointerCapture(D){u.setPointerCapture(D,this)}releaseCapture(D){u.releaseCapture(D,this)}}o.Shape=O,O.prototype._fillFunc=g,O.prototype._strokeFunc=x,O.prototype._fillFuncHit=C,O.prototype._strokeFuncHit=R,O.prototype._centroid=!1,O.prototype.nodeType="Shape",(0,l._registerNode)(O),O.prototype.eventListeners={},O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",A),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",T),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",P),t.Factory.addGetterSetter(O,"stroke",void 0,(0,a.getStringOrGradientValidator)()),t.Factory.addGetterSetter(O,"strokeWidth",2,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillAfterStrokeEnabled",!1),t.Factory.addGetterSetter(O,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),t.Factory.addGetterSetter(O,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),t.Factory.addGetterSetter(O,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),t.Factory.addGetterSetter(O,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),t.Factory.addGetterSetter(O,"lineJoin"),t.Factory.addGetterSetter(O,"lineCap"),t.Factory.addGetterSetter(O,"sceneFunc"),t.Factory.addGetterSetter(O,"hitFunc"),t.Factory.addGetterSetter(O,"dash"),t.Factory.addGetterSetter(O,"dashOffset",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"shadowColor",void 0,(0,a.getStringValidator)()),t.Factory.addGetterSetter(O,"shadowBlur",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"shadowOpacity",1,(0,a.getNumberValidator)()),t.Factory.addComponentsGetterSetter(O,"shadowOffset",["x","y"]),t.Factory.addGetterSetter(O,"shadowOffsetX",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"shadowOffsetY",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillPatternImage"),t.Factory.addGetterSetter(O,"fill",void 0,(0,a.getStringOrGradientValidator)()),t.Factory.addGetterSetter(O,"fillPatternX",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillPatternY",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillLinearGradientColorStops"),t.Factory.addGetterSetter(O,"strokeLinearGradientColorStops"),t.Factory.addGetterSetter(O,"fillRadialGradientStartRadius",0),t.Factory.addGetterSetter(O,"fillRadialGradientEndRadius",0),t.Factory.addGetterSetter(O,"fillRadialGradientColorStops"),t.Factory.addGetterSetter(O,"fillPatternRepeat","repeat"),t.Factory.addGetterSetter(O,"fillEnabled",!0),t.Factory.addGetterSetter(O,"strokeEnabled",!0),t.Factory.addGetterSetter(O,"shadowEnabled",!0),t.Factory.addGetterSetter(O,"dashEnabled",!0),t.Factory.addGetterSetter(O,"strokeScaleEnabled",!0),t.Factory.addGetterSetter(O,"fillPriority","color"),t.Factory.addComponentsGetterSetter(O,"fillPatternOffset",["x","y"]),t.Factory.addGetterSetter(O,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),t.Factory.addComponentsGetterSetter(O,"fillPatternScale",["x","y"]),t.Factory.addGetterSetter(O,"fillPatternScaleX",1,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(O,"fillPatternScaleY",1,(0,a.getNumberValidator)()),t.Factory.addComponentsGetterSetter(O,"fillLinearGradientStartPoint",["x","y"]),t.Factory.addComponentsGetterSetter(O,"strokeLinearGradientStartPoint",["x","y"]),t.Factory.addGetterSetter(O,"fillLinearGradientStartPointX",0),t.Factory.addGetterSetter(O,"strokeLinearGradientStartPointX",0),t.Factory.addGetterSetter(O,"fillLinearGradientStartPointY",0),t.Factory.addGetterSetter(O,"strokeLinearGradientStartPointY",0),t.Factory.addComponentsGetterSetter(O,"fillLinearGradientEndPoint",["x","y"]),t.Factory.addComponentsGetterSetter(O,"strokeLinearGradientEndPoint",["x","y"]),t.Factory.addGetterSetter(O,"fillLinearGradientEndPointX",0),t.Factory.addGetterSetter(O,"strokeLinearGradientEndPointX",0),t.Factory.addGetterSetter(O,"fillLinearGradientEndPointY",0),t.Factory.addGetterSetter(O,"strokeLinearGradientEndPointY",0),t.Factory.addComponentsGetterSetter(O,"fillRadialGradientStartPoint",["x","y"]),t.Factory.addGetterSetter(O,"fillRadialGradientStartPointX",0),t.Factory.addGetterSetter(O,"fillRadialGradientStartPointY",0),t.Factory.addComponentsGetterSetter(O,"fillRadialGradientEndPoint",["x","y"]),t.Factory.addGetterSetter(O,"fillRadialGradientEndPointX",0),t.Factory.addGetterSetter(O,"fillRadialGradientEndPointY",0),t.Factory.addGetterSetter(O,"fillPatternRotation",0),t.Factory.addGetterSetter(O,"fillRule",void 0,(0,a.getStringValidator)()),t.Factory.backCompat(O,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Shape);Object.defineProperty(Layer$2,"__esModule",{value:!0});Layer$2.Layer=void 0;const Util_1$b=Util,Container_1$1=Container$2,Node_1$g=Node$1,Factory_1$w=Factory,Canvas_1=Canvas$1,Validators_1$v=Validators,Shape_1$g=Shape,Global_1$k=Global;var HASH="#",BEFORE_DRAW="beforeDraw",DRAW="draw",INTERSECTION_OFFSETS=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],INTERSECTION_OFFSETS_LEN=INTERSECTION_OFFSETS.length;let Layer$1=class extends Container_1$1.Container{constructor(e){super(e),this.canvas=new Canvas_1.SceneCanvas,this.hitCanvas=new Canvas_1.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),e<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[e+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Node_1$g.Node.prototype.moveToTop.call(this);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var e=Node_1$g.Node.prototype.moveUp.call(this);if(!e)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Node_1$g.Node.prototype.moveDown.call(this)){var e=this.getStage();if(e){var r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Node_1$g.Node.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var e=this.getNativeCanvasElement();return Node_1$g.Node.prototype.remove.call(this),e&&e.parentNode&&Util_1$b.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:r}){return this.canvas.setSize(e,r),this.hitCanvas.setSize(e,r),this._setSmoothEnabled(),this}_validateAdd(e){var r=e.getType();r!=="Group"&&r!=="Shape"&&Util_1$b.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Node_1$g.Node.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Util_1$b.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Util_1$b.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Util_1$b.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var r=1,t=!1;;){for(let n=0;n<INTERSECTION_OFFSETS_LEN;n++){const a=INTERSECTION_OFFSETS[n],l=this._getIntersection({x:e.x+a.x*r,y:e.y+a.y*r}),u=l.shape;if(u)return u;if(t=!!l.antialiased,!l.antialiased)break}if(t)r+=1;else return null}}_getIntersection(e){const r=this.hitCanvas.pixelRatio,t=this.hitCanvas.context.getImageData(Math.round(e.x*r),Math.round(e.y*r),1,1).data,n=t[3];if(n===255){const a=Util_1$b.Util._rgbToHex(t[0],t[1],t[2]),l=Shape_1$g.shapes[HASH+a];return l?{shape:l}:{antialiased:!0}}else if(n>0)return{antialiased:!0};return{}}drawScene(e,r){var t=this.getLayer(),n=e||t&&t.getCanvas();return this._fire(BEFORE_DRAW,{node:this}),this.clearBeforeDraw()&&n.getContext().clear(),Container_1$1.Container.prototype.drawScene.call(this,n,r),this._fire(DRAW,{node:this}),this}drawHit(e,r){var t=this.getLayer(),n=e||t&&t.hitCanvas;return t&&t.clearBeforeDraw()&&t.getHitCanvas().getContext().clear(),Container_1$1.Container.prototype.drawHit.call(this,n,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Util_1$b.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Util_1$b.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var e=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return Util_1$b.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Layer$2.Layer=Layer$1;Layer$1.prototype.nodeType="Layer";(0,Global_1$k._registerNode)(Layer$1);Factory_1$w.Factory.addGetterSetter(Layer$1,"imageSmoothingEnabled",!0);Factory_1$w.Factory.addGetterSetter(Layer$1,"clearBeforeDraw",!0);Factory_1$w.Factory.addGetterSetter(Layer$1,"hitGraphEnabled",!0,(0,Validators_1$v.getBooleanValidator)());var FastLayer$1={};Object.defineProperty(FastLayer$1,"__esModule",{value:!0});FastLayer$1.FastLayer=void 0;const Util_1$a=Util,Layer_1=Layer$2,Global_1$j=Global;class FastLayer extends Layer_1.Layer{constructor(e){super(e),this.listening(!1),Util_1$a.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}FastLayer$1.FastLayer=FastLayer;FastLayer.prototype.nodeType="FastLayer";(0,Global_1$j._registerNode)(FastLayer);var Group$2={};Object.defineProperty(Group$2,"__esModule",{value:!0});Group$2.Group=void 0;const Util_1$9=Util,Container_1=Container$2,Global_1$i=Global;let Group$1=class extends Container_1.Container{_validateAdd(e){var r=e.getType();r!=="Group"&&r!=="Shape"&&Util_1$9.Util.throw("You may only add groups and shapes to groups.")}};Group$2.Group=Group$1;Group$1.prototype.nodeType="Group";(0,Global_1$i._registerNode)(Group$1);var Animation$2={};Object.defineProperty(Animation$2,"__esModule",{value:!0});Animation$2.Animation=void 0;const Global_1$h=Global,Util_1$8=Util,now=function(){return Global_1$h.glob.performance&&Global_1$h.glob.performance.now?function(){return Global_1$h.glob.performance.now()}:function(){return new Date().getTime()}}();let Animation$1=class Hl{constructor(e,r){this.id=Hl.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:now(),frameRate:0},this.func=e,this.setLayers(r)}setLayers(e){let r=[];return e&&(r=Array.isArray(e)?e:[e]),this.layers=r,this}getLayers(){return this.layers}addLayer(e){const r=this.layers,t=r.length;for(let n=0;n<t;n++)if(r[n]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const r=Hl.animations,t=r.length;for(let n=0;n<t;n++)if(r[n].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=now(),Hl._addAnimation(this),this}stop(){return Hl._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const r=e.id,t=this.animations,n=t.length;for(let a=0;a<n;a++)if(t[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const e={},r=this.animations;for(let t=0;t<r.length;t++){const n=r[t],a=n.layers,l=n.func;n._updateFrameObject(now());const u=a.length;let f;if(l?f=l.call(n,n.frame)!==!1:f=!0,!!f)for(let d=0;d<u;d++){const h=a[d];h._id!==void 0&&(e[h._id]=h)}}for(let t in e)e.hasOwnProperty(t)&&e[t].batchDraw()}static _animationLoop(){const e=Hl;e.animations.length?(e._runFrames(),Util_1$8.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Util_1$8.Util.requestAnimFrame(this._animationLoop))}};Animation$2.Animation=Animation$1;Animation$1.animations=[];Animation$1.animIdCounter=0;Animation$1.animRunning=!1;var Tween$1={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Easings=o.Tween=void 0;const e=Util,r=Animation$2,t=Node$1,n=Global;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},l=1,u=2,f=3,d=0,h=["fill","stroke","shadowColor"];class y{constructor(_,g,x,C,R,S,A){this.prop=_,this.propFunc=g,this.begin=C,this._pos=C,this.duration=S,this._change=0,this.prevPos=0,this.yoyo=A,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=x,this._change=R-this.begin,this.pause()}fire(_){var g=this[_];g&&g()}setTime(_){_>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():_<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=_,this.update())}getTime(){return this._time}setPosition(_){this.prevPos=this._pos,this.propFunc(_),this._pos=_}getPosition(_){return _===void 0&&(_=this._time),this.func(_,this.begin,this._change,this.duration)}play(){this.state=u,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=f,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){this.pause(),this._time=_,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var _=this.getTimer()-this._startTime;this.state===u?this.setTime(_):this.state===f&&this.setTime(this.duration-_)}pause(){this.state=l,this.fire("onPause")}getTimer(){return new Date().getTime()}}class E{constructor(_){var g=this,x=_.node,C=x._id,R,S=_.easing||o.Easings.Linear,A=!!_.yoyo,T;typeof _.duration>"u"?R=.3:_.duration===0?R=.001:R=_.duration,this.node=x,this._id=d++;var w=x.getLayer()||(x instanceof n.Konva.Stage?x.getLayers():null);w||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){g.tween.onEnterFrame()},w),this.tween=new y(T,function(P){g._tweenFunc(P)},S,0,1,R*1e3,A),this._addListeners(),E.attrs[C]||(E.attrs[C]={}),E.attrs[C][this._id]||(E.attrs[C][this._id]={}),E.tweens[C]||(E.tweens[C]={});for(T in _)a[T]===void 0&&this._addAttr(T,_[T]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,g){var x=this.node,C=x._id,R,S,A,T,w,P,O,k;if(A=E.tweens[C][_],A&&delete E.attrs[C][A][_],R=x.getAttr(_),e.Util._isArray(g))if(S=[],w=Math.max(g.length,R.length),_==="points"&&g.length!==R.length&&(g.length>R.length?(O=R,R=e.Util._prepareArrayForTween(R,g,x.closed())):(P=g,g=e.Util._prepareArrayForTween(g,R,x.closed()))),_.indexOf("fill")===0)for(T=0;T<w;T++)if(T%2===0)S.push(g[T]-R[T]);else{var D=e.Util.colorToRGBA(R[T]);k=e.Util.colorToRGBA(g[T]),R[T]=D,S.push({r:k.r-D.r,g:k.g-D.g,b:k.b-D.b,a:k.a-D.a})}else for(T=0;T<w;T++)S.push(g[T]-R[T]);else h.indexOf(_)!==-1?(R=e.Util.colorToRGBA(R),k=e.Util.colorToRGBA(g),S={r:k.r-R.r,g:k.g-R.g,b:k.b-R.b,a:k.a-R.a}):S=g-R;E.attrs[C][this._id][_]={start:R,diff:S,end:g,trueEnd:P,trueStart:O},E.tweens[C][_]=this._id}_tweenFunc(_){var g=this.node,x=E.attrs[g._id][this._id],C,R,S,A,T,w,P,O;for(C in x){if(R=x[C],S=R.start,A=R.diff,O=R.end,e.Util._isArray(S))if(T=[],P=Math.max(S.length,O.length),C.indexOf("fill")===0)for(w=0;w<P;w++)w%2===0?T.push((S[w]||0)+A[w]*_):T.push("rgba("+Math.round(S[w].r+A[w].r*_)+","+Math.round(S[w].g+A[w].g*_)+","+Math.round(S[w].b+A[w].b*_)+","+(S[w].a+A[w].a*_)+")");else for(w=0;w<P;w++)T.push((S[w]||0)+A[w]*_);else h.indexOf(C)!==-1?T="rgba("+Math.round(S.r+A.r*_)+","+Math.round(S.g+A.g*_)+","+Math.round(S.b+A.b*_)+","+(S.a+A.a*_)+")":T=S+A*_;g.setAttr(C,T)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var _=this.node,g=E.attrs[_._id][this._id];g.points&&g.points.trueEnd&&_.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var _=this.node,g=E.attrs[_._id][this._id];g.points&&g.points.trueStart&&_.points(g.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(_){return this.tween.seek(_*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var _=this.node._id,g=this._id,x=E.tweens[_],C;this.pause();for(C in x)delete E.tweens[_][C];delete E.attrs[_][g]}}o.Tween=E,E.attrs={},E.tweens={},t.Node.prototype.to=function(p){var _=p.onFinish;p.node=this,p.onFinish=function(){this.destroy(),_&&_()};var g=new E(p);g.play()},o.Easings={BackEaseIn(p,_,g,x){var C=1.70158;return g*(p/=x)*p*((C+1)*p-C)+_},BackEaseOut(p,_,g,x){var C=1.70158;return g*((p=p/x-1)*p*((C+1)*p+C)+1)+_},BackEaseInOut(p,_,g,x){var C=1.70158;return(p/=x/2)<1?g/2*(p*p*(((C*=1.525)+1)*p-C))+_:g/2*((p-=2)*p*(((C*=1.525)+1)*p+C)+2)+_},ElasticEaseIn(p,_,g,x,C,R){var S=0;return p===0?_:(p/=x)===1?_+g:(R||(R=x*.3),!C||C<Math.abs(g)?(C=g,S=R/4):S=R/(2*Math.PI)*Math.asin(g/C),-(C*Math.pow(2,10*(p-=1))*Math.sin((p*x-S)*(2*Math.PI)/R))+_)},ElasticEaseOut(p,_,g,x,C,R){var S=0;return p===0?_:(p/=x)===1?_+g:(R||(R=x*.3),!C||C<Math.abs(g)?(C=g,S=R/4):S=R/(2*Math.PI)*Math.asin(g/C),C*Math.pow(2,-10*p)*Math.sin((p*x-S)*(2*Math.PI)/R)+g+_)},ElasticEaseInOut(p,_,g,x,C,R){var S=0;return p===0?_:(p/=x/2)===2?_+g:(R||(R=x*(.3*1.5)),!C||C<Math.abs(g)?(C=g,S=R/4):S=R/(2*Math.PI)*Math.asin(g/C),p<1?-.5*(C*Math.pow(2,10*(p-=1))*Math.sin((p*x-S)*(2*Math.PI)/R))+_:C*Math.pow(2,-10*(p-=1))*Math.sin((p*x-S)*(2*Math.PI)/R)*.5+g+_)},BounceEaseOut(p,_,g,x){return(p/=x)<1/2.75?g*(7.5625*p*p)+_:p<2/2.75?g*(7.5625*(p-=1.5/2.75)*p+.75)+_:p<2.5/2.75?g*(7.5625*(p-=2.25/2.75)*p+.9375)+_:g*(7.5625*(p-=2.625/2.75)*p+.984375)+_},BounceEaseIn(p,_,g,x){return g-o.Easings.BounceEaseOut(x-p,0,g,x)+_},BounceEaseInOut(p,_,g,x){return p<x/2?o.Easings.BounceEaseIn(p*2,0,g,x)*.5+_:o.Easings.BounceEaseOut(p*2-x,0,g,x)*.5+g*.5+_},EaseIn(p,_,g,x){return g*(p/=x)*p+_},EaseOut(p,_,g,x){return-g*(p/=x)*(p-2)+_},EaseInOut(p,_,g,x){return(p/=x/2)<1?g/2*p*p+_:-g/2*(--p*(p-2)-1)+_},StrongEaseIn(p,_,g,x){return g*(p/=x)*p*p*p*p+_},StrongEaseOut(p,_,g,x){return g*((p=p/x-1)*p*p*p*p+1)+_},StrongEaseInOut(p,_,g,x){return(p/=x/2)<1?g/2*p*p*p*p*p+_:g/2*((p-=2)*p*p*p*p+2)+_},Linear(p,_,g,x){return g*p/x+_}}})(Tween$1);(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Konva=void 0;const e=Global,r=Util,t=Node$1,n=Container$2,a=Stage$1,l=Layer$2,u=FastLayer$1,f=Group$2,d=DragAndDrop,h=Shape,y=Animation$2,E=Tween$1,p=Context$2,_=Canvas$1;o.Konva=r.Util._assign(e.Konva,{Util:r.Util,Transform:r.Transform,Node:t.Node,Container:n.Container,Stage:a.Stage,stages:a.stages,Layer:l.Layer,FastLayer:u.FastLayer,Group:f.Group,DD:d.DD,Shape:h.Shape,shapes:h.shapes,Animation:y.Animation,Tween:E.Tween,Easings:E.Easings,Context:p.Context,Canvas:_.Canvas}),o.default=o.Konva})(_CoreInternals);var Arc$1={};Object.defineProperty(Arc$1,"__esModule",{value:!0});Arc$1.Arc=void 0;const Factory_1$v=Factory,Shape_1$f=Shape,Global_1$g=Global,Validators_1$u=Validators,Global_2$2=Global;class Arc extends Shape_1$f.Shape{_sceneFunc(e){var r=Global_1$g.Konva.getAngle(this.angle()),t=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,r,t),e.arc(0,0,this.innerRadius(),r,0,!t),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),r=this.outerRadius(),t=this.clockwise(),n=Global_1$g.Konva.getAngle(t?360-this.angle():this.angle()),a=Math.cos(Math.min(n,Math.PI)),l=1,u=Math.sin(Math.min(Math.max(Math.PI,n),3*Math.PI/2)),f=Math.sin(Math.min(n,Math.PI/2)),d=a*(a>0?e:r),h=l*r,y=u*(u>0?e:r),E=f*(f>0?r:e);return{x:d,y:t?-1*E:y,width:h-d,height:E-y}}}Arc$1.Arc=Arc;Arc.prototype._centroid=!0;Arc.prototype.className="Arc";Arc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Global_2$2._registerNode)(Arc);Factory_1$v.Factory.addGetterSetter(Arc,"innerRadius",0,(0,Validators_1$u.getNumberValidator)());Factory_1$v.Factory.addGetterSetter(Arc,"outerRadius",0,(0,Validators_1$u.getNumberValidator)());Factory_1$v.Factory.addGetterSetter(Arc,"angle",0,(0,Validators_1$u.getNumberValidator)());Factory_1$v.Factory.addGetterSetter(Arc,"clockwise",!1,(0,Validators_1$u.getBooleanValidator)());var Arrow$1={},Line$2={};Object.defineProperty(Line$2,"__esModule",{value:!0});Line$2.Line=void 0;const Factory_1$u=Factory,Shape_1$e=Shape,Validators_1$t=Validators,Global_1$f=Global;function getControlPoints(o,e,r,t,n,a,l){var u=Math.sqrt(Math.pow(r-o,2)+Math.pow(t-e,2)),f=Math.sqrt(Math.pow(n-r,2)+Math.pow(a-t,2)),d=l*u/(u+f),h=l*f/(u+f),y=r-d*(n-o),E=t-d*(a-e),p=r+h*(n-o),_=t+h*(a-e);return[y,E,p,_]}function expandPoints(o,e){var r=o.length,t=[],n,a;for(n=2;n<r-2;n+=2)a=getControlPoints(o[n-2],o[n-1],o[n],o[n+1],o[n+2],o[n+3],e),!isNaN(a[0])&&(t.push(a[0]),t.push(a[1]),t.push(o[n]),t.push(o[n+1]),t.push(a[2]),t.push(a[3]));return t}let Line$1=class extends Shape_1$e.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){var r=this.points(),t=r.length,n=this.tension(),a=this.closed(),l=this.bezier(),u,f,d;if(t){if(e.beginPath(),e.moveTo(r[0],r[1]),n!==0&&t>4){for(u=this.getTensionPoints(),f=u.length,d=a?0:4,a||e.quadraticCurveTo(u[0],u[1],u[2],u[3]);d<f-2;)e.bezierCurveTo(u[d++],u[d++],u[d++],u[d++],u[d++],u[d++]);a||e.quadraticCurveTo(u[f-2],u[f-1],r[t-2],r[t-1])}else if(l)for(d=2;d<t;)e.bezierCurveTo(r[d++],r[d++],r[d++],r[d++],r[d++],r[d++]);else for(d=2;d<t;d+=2)e.lineTo(r[d],r[d+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():expandPoints(this.points(),this.tension())}_getTensionPointsClosed(){var e=this.points(),r=e.length,t=this.tension(),n=getControlPoints(e[r-2],e[r-1],e[0],e[1],e[2],e[3],t),a=getControlPoints(e[r-4],e[r-3],e[r-2],e[r-1],e[0],e[1],t),l=expandPoints(e,t),u=[n[2],n[3]].concat(l).concat([a[0],a[1],e[r-2],e[r-1],a[2],a[3],n[0],n[1],e[0],e[1]]);return u}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();for(var r=e[0],t=e[0],n=e[1],a=e[1],l,u,f=0;f<e.length/2;f++)l=e[f*2],u=e[f*2+1],r=Math.min(r,l),t=Math.max(t,l),n=Math.min(n,u),a=Math.max(a,u);return{x:r,y:n,width:t-r,height:a-n}}};Line$2.Line=Line$1;Line$1.prototype.className="Line";Line$1.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Global_1$f._registerNode)(Line$1);Factory_1$u.Factory.addGetterSetter(Line$1,"closed",!1);Factory_1$u.Factory.addGetterSetter(Line$1,"bezier",!1);Factory_1$u.Factory.addGetterSetter(Line$1,"tension",0,(0,Validators_1$t.getNumberValidator)());Factory_1$u.Factory.addGetterSetter(Line$1,"points",[],(0,Validators_1$t.getNumberArrayValidator)());var Path$1={},BezierFunctions={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.t2length=o.getQuadraticArcLength=o.getCubicArcLength=o.binomialCoefficients=o.cValues=o.tValues=void 0,o.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],o.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],o.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(l,u,f)=>{let d,h,y;d=f/2,h=0;for(let p=0;p<20;p++)y=d*o.tValues[20][p]+d,h+=o.cValues[20][p]*t(l,u,y);return d*h};o.getCubicArcLength=e;const r=(l,u,f)=>{f===void 0&&(f=1);const d=l[0]-2*l[1]+l[2],h=u[0]-2*u[1]+u[2],y=2*l[1]-2*l[0],E=2*u[1]-2*u[0],p=4*(d*d+h*h),_=4*(d*y+h*E),g=y*y+E*E;if(p===0)return f*Math.sqrt(Math.pow(l[2]-l[0],2)+Math.pow(u[2]-u[0],2));const x=_/(2*p),C=g/p,R=f+x,S=C-x*x,A=R*R+S>0?Math.sqrt(R*R+S):0,T=x*x+S>0?Math.sqrt(x*x+S):0,w=x+Math.sqrt(x*x+S)!==0?S*Math.log(Math.abs((R+A)/(x+T))):0;return Math.sqrt(p)/2*(R*A-x*T+w)};o.getQuadraticArcLength=r;function t(l,u,f){const d=n(1,f,l),h=n(1,f,u),y=d*d+h*h;return Math.sqrt(y)}const n=(l,u,f)=>{const d=f.length-1;let h,y;if(d===0)return 0;if(l===0){y=0;for(let E=0;E<=d;E++)y+=o.binomialCoefficients[d][E]*Math.pow(1-u,d-E)*Math.pow(u,E)*f[E];return y}else{h=new Array(d);for(let E=0;E<d;E++)h[E]=d*(f[E+1]-f[E]);return n(l-1,u,h)}},a=(l,u,f)=>{let d=1,h=l/u,y=(l-f(h))/u,E=0;for(;d>.001;){const p=f(h+y),_=Math.abs(l-p)/u;if(_<d)d=_,h+=y;else{const g=f(h-y),x=Math.abs(l-g)/u;x<d?(d=x,h-=y):y/=2}if(E++,E>500)break}return h};o.t2length=a})(BezierFunctions);Object.defineProperty(Path$1,"__esModule",{value:!0});Path$1.Path=void 0;const Factory_1$t=Factory,Shape_1$d=Shape,Global_1$e=Global,BezierFunctions_1=BezierFunctions;class Path extends Shape_1$d.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Path.parsePathData(this.data()),this.pathLength=Path.getPathLength(this.dataArray)}_sceneFunc(e){var r=this.dataArray;e.beginPath();for(var t=!1,n=0;n<r.length;n++){var a=r[n].command,l=r[n].points;switch(a){case"L":e.lineTo(l[0],l[1]);break;case"M":e.moveTo(l[0],l[1]);break;case"C":e.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]);break;case"Q":e.quadraticCurveTo(l[0],l[1],l[2],l[3]);break;case"A":var u=l[0],f=l[1],d=l[2],h=l[3],y=l[4],E=l[5],p=l[6],_=l[7],g=d>h?d:h,x=d>h?1:d/h,C=d>h?h/d:1;e.translate(u,f),e.rotate(p),e.scale(x,C),e.arc(0,0,g,y,y+E,1-_),e.scale(1/x,1/C),e.rotate(-p),e.translate(-u,-f);break;case"z":t=!0,e.closePath();break}}!t&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(d){if(d.command==="A"){var h=d.points[4],y=d.points[5],E=d.points[4]+y,p=Math.PI/180;if(Math.abs(h-E)<p&&(p=Math.abs(h-E)),y<0)for(let _=h-p;_>E;_-=p){const g=Path.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],_,0);e.push(g.x,g.y)}else for(let _=h+p;_<E;_+=p){const g=Path.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],_,0);e.push(g.x,g.y)}}else if(d.command==="C")for(let _=0;_<=1;_+=.01){const g=Path.getPointOnCubicBezier(_,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);e.push(g.x,g.y)}else e=e.concat(d.points)});for(var r=e[0],t=e[0],n=e[1],a=e[1],l,u,f=0;f<e.length/2;f++)l=e[f*2],u=e[f*2+1],isNaN(l)||(r=Math.min(r,l),t=Math.max(t,l)),isNaN(u)||(n=Math.min(n,u),a=Math.max(a,u));return{x:r,y:n,width:t-r,height:a-n}}getLength(){return this.pathLength}getPointAtLength(e){return Path.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,r,t,n){return Math.sqrt((t-e)*(t-e)+(n-r)*(n-r))}static getPathLength(e){let r=0;for(var t=0;t<e.length;++t)r+=e[t].pathLength;return r}static getPointAtLengthOfDataArray(e,r){var t,n=0,a=r.length;if(!a)return null;for(;n<a&&e>r[n].pathLength;)e-=r[n].pathLength,++n;if(n===a)return t=r[n-1].points.slice(-2),{x:t[0],y:t[1]};if(e<.01)return t=r[n].points.slice(0,2),{x:t[0],y:t[1]};var l=r[n],u=l.points;switch(l.command){case"L":return Path.getPointOnLine(e,l.start.x,l.start.y,u[0],u[1]);case"C":return Path.getPointOnCubicBezier((0,BezierFunctions_1.t2length)(e,Path.getPathLength(r),g=>(0,BezierFunctions_1.getCubicArcLength)([l.start.x,u[0],u[2],u[4]],[l.start.y,u[1],u[3],u[5]],g)),l.start.x,l.start.y,u[0],u[1],u[2],u[3],u[4],u[5]);case"Q":return Path.getPointOnQuadraticBezier((0,BezierFunctions_1.t2length)(e,Path.getPathLength(r),g=>(0,BezierFunctions_1.getQuadraticArcLength)([l.start.x,u[0],u[2]],[l.start.y,u[1],u[3]],g)),l.start.x,l.start.y,u[0],u[1],u[2],u[3]);case"A":var f=u[0],d=u[1],h=u[2],y=u[3],E=u[4],p=u[5],_=u[6];return E+=p*e/l.pathLength,Path.getPointOnEllipticalArc(f,d,h,y,E,_)}return null}static getPointOnLine(e,r,t,n,a,l,u){l===void 0&&(l=r),u===void 0&&(u=t);var f=(a-t)/(n-r+1e-8),d=Math.sqrt(e*e/(1+f*f));n<r&&(d*=-1);var h=f*d,y;if(n===r)y={x:l,y:u+h};else if((u-t)/(l-r+1e-8)===f)y={x:l+d,y:u+h};else{var E,p,_=this.getLineLength(r,t,n,a),g=(l-r)*(n-r)+(u-t)*(a-t);g=g/(_*_),E=r+g*(n-r),p=t+g*(a-t);var x=this.getLineLength(l,u,E,p),C=Math.sqrt(e*e-x*x);d=Math.sqrt(C*C/(1+f*f)),n<r&&(d*=-1),h=f*d,y={x:E+d,y:p+h}}return y}static getPointOnCubicBezier(e,r,t,n,a,l,u,f,d){function h(x){return x*x*x}function y(x){return 3*x*x*(1-x)}function E(x){return 3*x*(1-x)*(1-x)}function p(x){return(1-x)*(1-x)*(1-x)}var _=f*h(e)+l*y(e)+n*E(e)+r*p(e),g=d*h(e)+u*y(e)+a*E(e)+t*p(e);return{x:_,y:g}}static getPointOnQuadraticBezier(e,r,t,n,a,l,u){function f(p){return p*p}function d(p){return 2*p*(1-p)}function h(p){return(1-p)*(1-p)}var y=l*f(e)+n*d(e)+r*h(e),E=u*f(e)+a*d(e)+t*h(e);return{x:y,y:E}}static getPointOnEllipticalArc(e,r,t,n,a,l){var u=Math.cos(l),f=Math.sin(l),d={x:t*Math.cos(a),y:n*Math.sin(a)};return{x:e+(d.x*u-d.y*f),y:r+(d.x*f+d.y*u)}}static parsePathData(e){if(!e)return[];var r=e,t=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var n=0;n<t.length;n++)r=r.replace(new RegExp(t[n],"g"),"|"+t[n]);var a=r.split("|"),l=[],u=[],f=0,d=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,y;for(n=1;n<a.length;n++){var E=a[n],p=E.charAt(0);for(E=E.slice(1),u.length=0;y=h.exec(E);)u.push(y[0]);for(var _=[],g=0,x=u.length;g<x;g++){if(u[g]==="00"){_.push(0,0);continue}var C=parseFloat(u[g]);isNaN(C)?_.push(0):_.push(C)}for(;_.length>0&&!isNaN(_[0]);){var R="",S=[],A=f,T=d,w,P,O,k,D,F,G,V,W,ee;switch(p){case"l":f+=_.shift(),d+=_.shift(),R="L",S.push(f,d);break;case"L":f=_.shift(),d=_.shift(),S.push(f,d);break;case"m":var q=_.shift(),z=_.shift();if(f+=q,d+=z,R="M",l.length>2&&l[l.length-1].command==="z"){for(var U=l.length-2;U>=0;U--)if(l[U].command==="M"){f=l[U].points[0]+q,d=l[U].points[1]+z;break}}S.push(f,d),p="l";break;case"M":f=_.shift(),d=_.shift(),R="M",S.push(f,d),p="L";break;case"h":f+=_.shift(),R="L",S.push(f,d);break;case"H":f=_.shift(),R="L",S.push(f,d);break;case"v":d+=_.shift(),R="L",S.push(f,d);break;case"V":d=_.shift(),R="L",S.push(f,d);break;case"C":S.push(_.shift(),_.shift(),_.shift(),_.shift()),f=_.shift(),d=_.shift(),S.push(f,d);break;case"c":S.push(f+_.shift(),d+_.shift(),f+_.shift(),d+_.shift()),f+=_.shift(),d+=_.shift(),R="C",S.push(f,d);break;case"S":P=f,O=d,w=l[l.length-1],w.command==="C"&&(P=f+(f-w.points[2]),O=d+(d-w.points[3])),S.push(P,O,_.shift(),_.shift()),f=_.shift(),d=_.shift(),R="C",S.push(f,d);break;case"s":P=f,O=d,w=l[l.length-1],w.command==="C"&&(P=f+(f-w.points[2]),O=d+(d-w.points[3])),S.push(P,O,f+_.shift(),d+_.shift()),f+=_.shift(),d+=_.shift(),R="C",S.push(f,d);break;case"Q":S.push(_.shift(),_.shift()),f=_.shift(),d=_.shift(),S.push(f,d);break;case"q":S.push(f+_.shift(),d+_.shift()),f+=_.shift(),d+=_.shift(),R="Q",S.push(f,d);break;case"T":P=f,O=d,w=l[l.length-1],w.command==="Q"&&(P=f+(f-w.points[0]),O=d+(d-w.points[1])),f=_.shift(),d=_.shift(),R="Q",S.push(P,O,f,d);break;case"t":P=f,O=d,w=l[l.length-1],w.command==="Q"&&(P=f+(f-w.points[0]),O=d+(d-w.points[1])),f+=_.shift(),d+=_.shift(),R="Q",S.push(P,O,f,d);break;case"A":k=_.shift(),D=_.shift(),F=_.shift(),G=_.shift(),V=_.shift(),W=f,ee=d,f=_.shift(),d=_.shift(),R="A",S=this.convertEndpointToCenterParameterization(W,ee,f,d,G,V,k,D,F);break;case"a":k=_.shift(),D=_.shift(),F=_.shift(),G=_.shift(),V=_.shift(),W=f,ee=d,f+=_.shift(),d+=_.shift(),R="A",S=this.convertEndpointToCenterParameterization(W,ee,f,d,G,V,k,D,F);break}l.push({command:R||p,points:S,start:{x:A,y:T},pathLength:this.calcLength(A,T,R||p,S)})}(p==="z"||p==="Z")&&l.push({command:"z",points:[],start:void 0,pathLength:0})}return l}static calcLength(e,r,t,n){var a,l,u,f,d=Path;switch(t){case"L":return d.getLineLength(e,r,n[0],n[1]);case"C":return(0,BezierFunctions_1.getCubicArcLength)([e,n[0],n[2],n[4]],[r,n[1],n[3],n[5]],1);case"Q":return(0,BezierFunctions_1.getQuadraticArcLength)([e,n[0],n[2]],[r,n[1],n[3]],1);case"A":a=0;var h=n[4],y=n[5],E=n[4]+y,p=Math.PI/180;if(Math.abs(h-E)<p&&(p=Math.abs(h-E)),l=d.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],h,0),y<0)for(f=h-p;f>E;f-=p)u=d.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],f,0),a+=d.getLineLength(l.x,l.y,u.x,u.y),l=u;else for(f=h+p;f<E;f+=p)u=d.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],f,0),a+=d.getLineLength(l.x,l.y,u.x,u.y),l=u;return u=d.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],E,0),a+=d.getLineLength(l.x,l.y,u.x,u.y),a}return 0}static convertEndpointToCenterParameterization(e,r,t,n,a,l,u,f,d){var h=d*(Math.PI/180),y=Math.cos(h)*(e-t)/2+Math.sin(h)*(r-n)/2,E=-1*Math.sin(h)*(e-t)/2+Math.cos(h)*(r-n)/2,p=y*y/(u*u)+E*E/(f*f);p>1&&(u*=Math.sqrt(p),f*=Math.sqrt(p));var _=Math.sqrt((u*u*(f*f)-u*u*(E*E)-f*f*(y*y))/(u*u*(E*E)+f*f*(y*y)));a===l&&(_*=-1),isNaN(_)&&(_=0);var g=_*u*E/f,x=_*-f*y/u,C=(e+t)/2+Math.cos(h)*g-Math.sin(h)*x,R=(r+n)/2+Math.sin(h)*g+Math.cos(h)*x,S=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},A=function(D,F){return(D[0]*F[0]+D[1]*F[1])/(S(D)*S(F))},T=function(D,F){return(D[0]*F[1]<D[1]*F[0]?-1:1)*Math.acos(A(D,F))},w=T([1,0],[(y-g)/u,(E-x)/f]),P=[(y-g)/u,(E-x)/f],O=[(-1*y-g)/u,(-1*E-x)/f],k=T(P,O);return A(P,O)<=-1&&(k=Math.PI),A(P,O)>=1&&(k=0),l===0&&k>0&&(k=k-2*Math.PI),l===1&&k<0&&(k=k+2*Math.PI),[C,R,u,f,w,k,h,l]}}Path$1.Path=Path;Path.prototype.className="Path";Path.prototype._attrsAffectingSize=["data"];(0,Global_1$e._registerNode)(Path);Factory_1$t.Factory.addGetterSetter(Path,"data");Object.defineProperty(Arrow$1,"__esModule",{value:!0});Arrow$1.Arrow=void 0;const Factory_1$s=Factory,Line_1$1=Line$2,Validators_1$s=Validators,Global_1$d=Global,Path_1$2=Path$1;class Arrow extends Line_1$1.Line{_sceneFunc(e){super._sceneFunc(e);var r=Math.PI*2,t=this.points(),n=t,a=this.tension()!==0&&t.length>4;a&&(n=this.getTensionPoints());var l=this.pointerLength(),u=t.length,f,d;if(a){const E=[n[n.length-4],n[n.length-3],n[n.length-2],n[n.length-1],t[u-2],t[u-1]],p=Path_1$2.Path.calcLength(n[n.length-4],n[n.length-3],"C",E),_=Path_1$2.Path.getPointOnQuadraticBezier(Math.min(1,1-l/p),E[0],E[1],E[2],E[3],E[4],E[5]);f=t[u-2]-_.x,d=t[u-1]-_.y}else f=t[u-2]-t[u-4],d=t[u-1]-t[u-3];var h=(Math.atan2(d,f)+r)%r,y=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(t[u-2],t[u-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-l,y/2),e.lineTo(-l,-y/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(t[0],t[1]),a?(f=(n[0]+n[2])/2-t[0],d=(n[1]+n[3])/2-t[1]):(f=t[2]-t[0],d=t[3]-t[1]),e.rotate((Math.atan2(-d,-f)+r)%r),e.moveTo(0,0),e.lineTo(-l,y/2),e.lineTo(-l,-y/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),r=this.pointerWidth()/2;return{x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2}}}Arrow$1.Arrow=Arrow;Arrow.prototype.className="Arrow";(0,Global_1$d._registerNode)(Arrow);Factory_1$s.Factory.addGetterSetter(Arrow,"pointerLength",10,(0,Validators_1$s.getNumberValidator)());Factory_1$s.Factory.addGetterSetter(Arrow,"pointerWidth",10,(0,Validators_1$s.getNumberValidator)());Factory_1$s.Factory.addGetterSetter(Arrow,"pointerAtBeginning",!1);Factory_1$s.Factory.addGetterSetter(Arrow,"pointerAtEnding",!0);var Circle$1={};Object.defineProperty(Circle$1,"__esModule",{value:!0});Circle$1.Circle=void 0;const Factory_1$r=Factory,Shape_1$c=Shape,Validators_1$r=Validators,Global_1$c=Global;class Circle extends Shape_1$c.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Circle$1.Circle=Circle;Circle.prototype._centroid=!0;Circle.prototype.className="Circle";Circle.prototype._attrsAffectingSize=["radius"];(0,Global_1$c._registerNode)(Circle);Factory_1$r.Factory.addGetterSetter(Circle,"radius",0,(0,Validators_1$r.getNumberValidator)());var Ellipse$1={};Object.defineProperty(Ellipse$1,"__esModule",{value:!0});Ellipse$1.Ellipse=void 0;const Factory_1$q=Factory,Shape_1$b=Shape,Validators_1$q=Validators,Global_1$b=Global;class Ellipse extends Shape_1$b.Shape{_sceneFunc(e){var r=this.radiusX(),t=this.radiusY();e.beginPath(),e.save(),r!==t&&e.scale(1,t/r),e.arc(0,0,r,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Ellipse$1.Ellipse=Ellipse;Ellipse.prototype.className="Ellipse";Ellipse.prototype._centroid=!0;Ellipse.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,Global_1$b._registerNode)(Ellipse);Factory_1$q.Factory.addComponentsGetterSetter(Ellipse,"radius",["x","y"]);Factory_1$q.Factory.addGetterSetter(Ellipse,"radiusX",0,(0,Validators_1$q.getNumberValidator)());Factory_1$q.Factory.addGetterSetter(Ellipse,"radiusY",0,(0,Validators_1$q.getNumberValidator)());var Image$4={};Object.defineProperty(Image$4,"__esModule",{value:!0});Image$4.Image=void 0;const Util_1$7=Util,Factory_1$p=Factory,Shape_1$a=Shape,Global_1$a=Global,Validators_1$p=Validators;let Image$3=class wv extends Shape_1$a.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const r=this.getWidth(),t=this.getHeight(),n=this.cornerRadius(),a=this.attrs.image;let l;if(a){const u=this.attrs.cropWidth,f=this.attrs.cropHeight;u&&f?l=[a,this.cropX(),this.cropY(),u,f,0,0,r,t]:l=[a,0,0,r,t]}(this.hasFill()||this.hasStroke()||n)&&(e.beginPath(),n?Util_1$7.Util.drawRoundedRectPath(e,r,t,n):e.rect(0,0,r,t),e.closePath(),e.fillStrokeShape(this)),a&&(n&&e.clip(),e.drawImage.apply(e,l))}_hitFunc(e){var r=this.width(),t=this.height(),n=this.cornerRadius();e.beginPath(),n?Util_1$7.Util.drawRoundedRectPath(e,r,t,n):e.rect(0,0,r,t),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,r;return(e=this.attrs.width)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var e,r;return(e=this.attrs.height)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(e,r,t=null){var n=Util_1$7.Util.createImageElement();n.onload=function(){var a=new wv({image:n});r(a)},n.onerror=t,n.crossOrigin="Anonymous",n.src=e}};Image$4.Image=Image$3;Image$3.prototype.className="Image";(0,Global_1$a._registerNode)(Image$3);Factory_1$p.Factory.addGetterSetter(Image$3,"cornerRadius",0,(0,Validators_1$p.getNumberOrArrayOfNumbersValidator)(4));Factory_1$p.Factory.addGetterSetter(Image$3,"image");Factory_1$p.Factory.addComponentsGetterSetter(Image$3,"crop",["x","y","width","height"]);Factory_1$p.Factory.addGetterSetter(Image$3,"cropX",0,(0,Validators_1$p.getNumberValidator)());Factory_1$p.Factory.addGetterSetter(Image$3,"cropY",0,(0,Validators_1$p.getNumberValidator)());Factory_1$p.Factory.addGetterSetter(Image$3,"cropWidth",0,(0,Validators_1$p.getNumberValidator)());Factory_1$p.Factory.addGetterSetter(Image$3,"cropHeight",0,(0,Validators_1$p.getNumberValidator)());var Label$1={};Object.defineProperty(Label$1,"__esModule",{value:!0});Label$1.Tag=Label$1.Label=void 0;const Factory_1$o=Factory,Shape_1$9=Shape,Group_1$1=Group$2,Validators_1$o=Validators,Global_1$9=Global;var ATTR_CHANGE_LIST$2=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],CHANGE_KONVA$1="Change.konva",NONE$1="none",UP="up",RIGHT$1="right",DOWN="down",LEFT$1="left",attrChangeListLen$1=ATTR_CHANGE_LIST$2.length;class Label extends Group_1$1.Group{constructor(e){super(e),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var r=this,t,n=function(){r._sync()};for(t=0;t<attrChangeListLen$1;t++)e.on(ATTR_CHANGE_LIST$2[t]+CHANGE_KONVA$1,n)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var e=this.getText(),r=this.getTag(),t,n,a,l,u,f,d;if(e&&r){switch(t=e.width(),n=e.height(),a=r.pointerDirection(),l=r.pointerWidth(),d=r.pointerHeight(),u=0,f=0,a){case UP:u=t/2,f=-1*d;break;case RIGHT$1:u=t+l,f=n/2;break;case DOWN:u=t/2,f=n+d;break;case LEFT$1:u=-1*l,f=n/2;break}r.setAttrs({x:-1*u,y:-1*f,width:t,height:n}),e.setAttrs({x:-1*u,y:-1*f})}}}Label$1.Label=Label;Label.prototype.className="Label";(0,Global_1$9._registerNode)(Label);class Tag extends Shape_1$9.Shape{_sceneFunc(e){var r=this.width(),t=this.height(),n=this.pointerDirection(),a=this.pointerWidth(),l=this.pointerHeight(),u=this.cornerRadius();let f=0,d=0,h=0,y=0;typeof u=="number"?f=d=h=y=Math.min(u,r/2,t/2):(f=Math.min(u[0]||0,r/2,t/2),d=Math.min(u[1]||0,r/2,t/2),y=Math.min(u[2]||0,r/2,t/2),h=Math.min(u[3]||0,r/2,t/2)),e.beginPath(),e.moveTo(f,0),n===UP&&(e.lineTo((r-a)/2,0),e.lineTo(r/2,-1*l),e.lineTo((r+a)/2,0)),e.lineTo(r-d,0),e.arc(r-d,d,d,Math.PI*3/2,0,!1),n===RIGHT$1&&(e.lineTo(r,(t-l)/2),e.lineTo(r+a,t/2),e.lineTo(r,(t+l)/2)),e.lineTo(r,t-y),e.arc(r-y,t-y,y,0,Math.PI/2,!1),n===DOWN&&(e.lineTo((r+a)/2,t),e.lineTo(r/2,t+l),e.lineTo((r-a)/2,t)),e.lineTo(h,t),e.arc(h,t-h,h,Math.PI/2,Math.PI,!1),n===LEFT$1&&(e.lineTo(0,(t+l)/2),e.lineTo(-1*a,t/2),e.lineTo(0,(t-l)/2)),e.lineTo(0,f),e.arc(f,f,f,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){var e=0,r=0,t=this.pointerWidth(),n=this.pointerHeight(),a=this.pointerDirection(),l=this.width(),u=this.height();return a===UP?(r-=n,u+=n):a===DOWN?u+=n:a===LEFT$1?(e-=t*1.5,l+=t):a===RIGHT$1&&(l+=t*1.5),{x:e,y:r,width:l,height:u}}}Label$1.Tag=Tag;Tag.prototype.className="Tag";(0,Global_1$9._registerNode)(Tag);Factory_1$o.Factory.addGetterSetter(Tag,"pointerDirection",NONE$1);Factory_1$o.Factory.addGetterSetter(Tag,"pointerWidth",0,(0,Validators_1$o.getNumberValidator)());Factory_1$o.Factory.addGetterSetter(Tag,"pointerHeight",0,(0,Validators_1$o.getNumberValidator)());Factory_1$o.Factory.addGetterSetter(Tag,"cornerRadius",0,(0,Validators_1$o.getNumberOrArrayOfNumbersValidator)(4));var Rect$2={};Object.defineProperty(Rect$2,"__esModule",{value:!0});Rect$2.Rect=void 0;const Factory_1$n=Factory,Shape_1$8=Shape,Global_1$8=Global,Util_1$6=Util,Validators_1$n=Validators;let Rect$1=class extends Shape_1$8.Shape{_sceneFunc(e){var r=this.cornerRadius(),t=this.width(),n=this.height();e.beginPath(),r?Util_1$6.Util.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}};Rect$2.Rect=Rect$1;Rect$1.prototype.className="Rect";(0,Global_1$8._registerNode)(Rect$1);Factory_1$n.Factory.addGetterSetter(Rect$1,"cornerRadius",0,(0,Validators_1$n.getNumberOrArrayOfNumbersValidator)(4));var RegularPolygon$1={};Object.defineProperty(RegularPolygon$1,"__esModule",{value:!0});RegularPolygon$1.RegularPolygon=void 0;const Factory_1$m=Factory,Shape_1$7=Shape,Validators_1$m=Validators,Global_1$7=Global;class RegularPolygon extends Shape_1$7.Shape{_sceneFunc(e){const r=this._getPoints();e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var t=1;t<r.length;t++)e.lineTo(r[t].x,r[t].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,r=this.attrs.radius||0,t=[];for(var n=0;n<e;n++)t.push({x:r*Math.sin(n*2*Math.PI/e),y:-1*r*Math.cos(n*2*Math.PI/e)});return t}getSelfRect(){const e=this._getPoints();var r=e[0].x,t=e[0].y,n=e[0].x,a=e[0].y;return e.forEach(l=>{r=Math.min(r,l.x),t=Math.max(t,l.x),n=Math.min(n,l.y),a=Math.max(a,l.y)}),{x:r,y:n,width:t-r,height:a-n}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}RegularPolygon$1.RegularPolygon=RegularPolygon;RegularPolygon.prototype.className="RegularPolygon";RegularPolygon.prototype._centroid=!0;RegularPolygon.prototype._attrsAffectingSize=["radius"];(0,Global_1$7._registerNode)(RegularPolygon);Factory_1$m.Factory.addGetterSetter(RegularPolygon,"radius",0,(0,Validators_1$m.getNumberValidator)());Factory_1$m.Factory.addGetterSetter(RegularPolygon,"sides",0,(0,Validators_1$m.getNumberValidator)());var Ring$1={};Object.defineProperty(Ring$1,"__esModule",{value:!0});Ring$1.Ring=void 0;const Factory_1$l=Factory,Shape_1$6=Shape,Validators_1$l=Validators,Global_1$6=Global;var PIx2=Math.PI*2;class Ring extends Shape_1$6.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,PIx2,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),PIx2,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Ring$1.Ring=Ring;Ring.prototype.className="Ring";Ring.prototype._centroid=!0;Ring.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Global_1$6._registerNode)(Ring);Factory_1$l.Factory.addGetterSetter(Ring,"innerRadius",0,(0,Validators_1$l.getNumberValidator)());Factory_1$l.Factory.addGetterSetter(Ring,"outerRadius",0,(0,Validators_1$l.getNumberValidator)());var Sprite$1={};Object.defineProperty(Sprite$1,"__esModule",{value:!0});Sprite$1.Sprite=void 0;const Factory_1$k=Factory,Shape_1$5=Shape,Animation_1=Animation$2,Validators_1$k=Validators,Global_1$5=Global;class Sprite extends Shape_1$5.Shape{constructor(e){super(e),this._updated=!0,this.anim=new Animation_1.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){var r=this.animation(),t=this.frameIndex(),n=t*4,a=this.animations()[r],l=this.frameOffsets(),u=a[n+0],f=a[n+1],d=a[n+2],h=a[n+3],y=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,d,h),e.closePath(),e.fillStrokeShape(this)),y)if(l){var E=l[r],p=t*2;e.drawImage(y,u,f,d,h,E[p+0],E[p+1],d,h)}else e.drawImage(y,u,f,d,h,0,0,d,h)}_hitFunc(e){var r=this.animation(),t=this.frameIndex(),n=t*4,a=this.animations()[r],l=this.frameOffsets(),u=a[n+2],f=a[n+3];if(e.beginPath(),l){var d=l[r],h=t*2;e.rect(d[h+0],d[h+1],u,f)}else e.rect(0,0,u,f);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),r=this.animation(),t=this.animations(),n=t[r],a=n.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}}Sprite$1.Sprite=Sprite;Sprite.prototype.className="Sprite";(0,Global_1$5._registerNode)(Sprite);Factory_1$k.Factory.addGetterSetter(Sprite,"animation");Factory_1$k.Factory.addGetterSetter(Sprite,"animations");Factory_1$k.Factory.addGetterSetter(Sprite,"frameOffsets");Factory_1$k.Factory.addGetterSetter(Sprite,"image");Factory_1$k.Factory.addGetterSetter(Sprite,"frameIndex",0,(0,Validators_1$k.getNumberValidator)());Factory_1$k.Factory.addGetterSetter(Sprite,"frameRate",17,(0,Validators_1$k.getNumberValidator)());Factory_1$k.Factory.backCompat(Sprite,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var Star$1={};Object.defineProperty(Star$1,"__esModule",{value:!0});Star$1.Star=void 0;const Factory_1$j=Factory,Shape_1$4=Shape,Validators_1$j=Validators,Global_1$4=Global;class Star extends Shape_1$4.Shape{_sceneFunc(e){var r=this.innerRadius(),t=this.outerRadius(),n=this.numPoints();e.beginPath(),e.moveTo(0,0-t);for(var a=1;a<n*2;a++){var l=a%2===0?t:r,u=l*Math.sin(a*Math.PI/n),f=-1*l*Math.cos(a*Math.PI/n);e.lineTo(u,f)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Star$1.Star=Star;Star.prototype.className="Star";Star.prototype._centroid=!0;Star.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Global_1$4._registerNode)(Star);Factory_1$j.Factory.addGetterSetter(Star,"numPoints",5,(0,Validators_1$j.getNumberValidator)());Factory_1$j.Factory.addGetterSetter(Star,"innerRadius",0,(0,Validators_1$j.getNumberValidator)());Factory_1$j.Factory.addGetterSetter(Star,"outerRadius",0,(0,Validators_1$j.getNumberValidator)());var Text$2={};Object.defineProperty(Text$2,"__esModule",{value:!0});Text$2.Text=Text$2.stringToArray=void 0;const Util_1$5=Util,Factory_1$i=Factory,Shape_1$3=Shape,Validators_1$i=Validators,Global_1$3=Global;function stringToArray(o){return Array.from(o)}Text$2.stringToArray=stringToArray;var AUTO="auto",CENTER="center",INHERIT="inherit",JUSTIFY="justify",CHANGE_KONVA="Change.konva",CONTEXT_2D="2d",DASH="-",LEFT="left",TEXT="text",TEXT_UPPER="Text",TOP="top",BOTTOM="bottom",MIDDLE="middle",NORMAL$1="normal",PX_SPACE="px ",SPACE=" ",RIGHT="right",RTL="rtl",WORD="word",CHAR="char",NONE="none",ELLIPSIS="…",ATTR_CHANGE_LIST$1=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],attrChangeListLen=ATTR_CHANGE_LIST$1.length;function normalizeFontFamily(o){return o.split(",").map(e=>{e=e.trim();const r=e.indexOf(" ")>=0,t=e.indexOf('"')>=0||e.indexOf("'")>=0;return r&&!t&&(e=`"${e}"`),e}).join(", ")}var dummyContext;function getDummyContext(){return dummyContext||(dummyContext=Util_1$5.Util.createCanvasElement().getContext(CONTEXT_2D),dummyContext)}function _fillFunc$1(o){o.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _strokeFunc$1(o){o.setAttr("miterLimit",2),o.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function checkDefaultFill(o){return o=o||{},!o.fillLinearGradientColorStops&&!o.fillRadialGradientColorStops&&!o.fillPatternImage&&(o.fill=o.fill||"black"),o}let Text$1=class extends Shape_1$3.Shape{constructor(e){super(checkDefaultFill(e)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<attrChangeListLen;r++)this.on(ATTR_CHANGE_LIST$1[r]+CHANGE_KONVA,this._setTextData);this._setTextData()}_sceneFunc(e){var r=this.textArr,t=r.length;if(this.text()){var n=this.padding(),a=this.fontSize(),l=this.lineHeight()*a,u=this.verticalAlign(),f=this.direction(),d=0,h=this.align(),y=this.getWidth(),E=this.letterSpacing(),p=this.fill(),_=this.textDecoration(),g=_.indexOf("underline")!==-1,x=_.indexOf("line-through")!==-1,C;f=f===INHERIT?e.direction:f;var R=0,R=l/2,S=0,A=0;for(f===RTL&&e.setAttr("direction",f),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",MIDDLE),e.setAttr("textAlign",LEFT),u===MIDDLE?d=(this.getHeight()-t*l-n*2)/2:u===BOTTOM&&(d=this.getHeight()-t*l-n*2),e.translate(n,d+n),C=0;C<t;C++){var S=0,A=0,T=r[C],w=T.text,P=T.width,O=T.lastInParagraph,k,D,F;if(e.save(),h===RIGHT?S+=y-P-n*2:h===CENTER&&(S+=(y-P-n*2)/2),g){e.save(),e.beginPath(),e.moveTo(S,R+A+Math.round(a/2)),k=w.split(" ").length-1,D=k===0,F=h===JUSTIFY&&!O?y-n*2:P,e.lineTo(S+Math.round(F),R+A+Math.round(a/2)),e.lineWidth=a/15;const z=this._getLinearGradient();e.strokeStyle=z||p,e.stroke(),e.restore()}if(x){e.save(),e.beginPath(),e.moveTo(S,R+A),k=w.split(" ").length-1,D=k===0,F=h===JUSTIFY&&O&&!D?y-n*2:P,e.lineTo(S+Math.round(F),R+A),e.lineWidth=a/15;const z=this._getLinearGradient();e.strokeStyle=z||p,e.stroke(),e.restore()}if(f!==RTL&&(E!==0||h===JUSTIFY)){k=w.split(" ").length-1;for(var G=stringToArray(w),V=0;V<G.length;V++){var W=G[V];W===" "&&!O&&h===JUSTIFY&&(S+=(y-n*2-P)/k),this._partialTextX=S,this._partialTextY=R+A,this._partialText=W,e.fillStrokeShape(this),S+=this.measureSize(W).width+E}}else E!==0&&e.setAttr("letterSpacing",`${E}px`),this._partialTextX=S,this._partialTextY=R+A,this._partialText=w,e.fillStrokeShape(this);e.restore(),t>1&&(R+=l)}}}_hitFunc(e){var r=this.getWidth(),t=this.getHeight();e.beginPath(),e.rect(0,0,r,t),e.closePath(),e.fillStrokeShape(this)}setText(e){var r=Util_1$5.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(TEXT,r),this}getWidth(){var e=this.attrs.width===AUTO||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===AUTO||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Util_1$5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var r=getDummyContext(),t=this.fontSize(),n;return r.save(),r.font=this._getContextFont(),n=r.measureText(e),r.restore(),{width:n.width,height:t}}_getContextFont(){return this.fontStyle()+SPACE+this.fontVariant()+SPACE+(this.fontSize()+PX_SPACE)+normalizeFontFamily(this.fontFamily())}_addTextLine(e){this.align()===JUSTIFY&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var r=this.letterSpacing(),t=e.length;return getDummyContext().measureText(e).width+(t?r*(t-1):0)}_setTextData(){var e=this.text().split(`
72
+ `),r=+this.fontSize(),t=0,n=this.lineHeight()*r,a=this.attrs.width,l=this.attrs.height,u=a!==AUTO&&a!==void 0,f=l!==AUTO&&l!==void 0,d=this.padding(),h=a-d*2,y=l-d*2,E=0,p=this.wrap(),_=p!==NONE,g=p!==CHAR&&_,x=this.ellipsis();this.textArr=[],getDummyContext().font=this._getContextFont();for(var C=x?this._getTextWidth(ELLIPSIS):0,R=0,S=e.length;R<S;++R){var A=e[R],T=this._getTextWidth(A);if(u&&T>h)for(;A.length>0;){for(var w=0,P=A.length,O="",k=0;w<P;){var D=w+P>>>1,F=A.slice(0,D+1),G=this._getTextWidth(F)+C;G<=h?(w=D+1,O=F,k=G):P=D}if(O){if(g){var V,W=A[O.length],ee=W===SPACE||W===DASH;ee&&k<=h?V=O.length:V=Math.max(O.lastIndexOf(SPACE),O.lastIndexOf(DASH))+1,V>0&&(w=V,O=O.slice(0,w),k=this._getTextWidth(O))}O=O.trimRight(),this._addTextLine(O),t=Math.max(t,k),E+=n;var q=this._shouldHandleEllipsis(E);if(q){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(w),A=A.trimLeft(),A.length>0&&(T=this._getTextWidth(A),T<=h)){this._addTextLine(A),E+=n,t=Math.max(t,T);break}}else break}else this._addTextLine(A),E+=n,t=Math.max(t,T),this._shouldHandleEllipsis(E)&&R<S-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),f&&E+n>y)break}this.textHeight=r,this.textWidth=t}_shouldHandleEllipsis(e){var r=+this.fontSize(),t=this.lineHeight()*r,n=this.attrs.height,a=n!==AUTO&&n!==void 0,l=this.padding(),u=n-l*2,f=this.wrap(),d=f!==NONE;return!d||a&&e+t>u}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,r=e!==AUTO&&e!==void 0,t=this.padding(),n=e-t*2,a=this.ellipsis(),l=this.textArr[this.textArr.length-1];if(!(!l||!a)){if(r){var u=this._getTextWidth(l.text+ELLIPSIS)<n;u||(l.text=l.text.slice(0,l.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(l.text+ELLIPSIS)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return e&&r?!0:super._useBufferCanvas()}};Text$2.Text=Text$1;Text$1.prototype._fillFunc=_fillFunc$1;Text$1.prototype._strokeFunc=_strokeFunc$1;Text$1.prototype.className=TEXT_UPPER;Text$1.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,Global_1$3._registerNode)(Text$1);Factory_1$i.Factory.overWriteSetter(Text$1,"width",(0,Validators_1$i.getNumberOrAutoValidator)());Factory_1$i.Factory.overWriteSetter(Text$1,"height",(0,Validators_1$i.getNumberOrAutoValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"direction",INHERIT);Factory_1$i.Factory.addGetterSetter(Text$1,"fontFamily","Arial");Factory_1$i.Factory.addGetterSetter(Text$1,"fontSize",12,(0,Validators_1$i.getNumberValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"fontStyle",NORMAL$1);Factory_1$i.Factory.addGetterSetter(Text$1,"fontVariant",NORMAL$1);Factory_1$i.Factory.addGetterSetter(Text$1,"padding",0,(0,Validators_1$i.getNumberValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"align",LEFT);Factory_1$i.Factory.addGetterSetter(Text$1,"verticalAlign",TOP);Factory_1$i.Factory.addGetterSetter(Text$1,"lineHeight",1,(0,Validators_1$i.getNumberValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"wrap",WORD);Factory_1$i.Factory.addGetterSetter(Text$1,"ellipsis",!1,(0,Validators_1$i.getBooleanValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"letterSpacing",0,(0,Validators_1$i.getNumberValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"text","",(0,Validators_1$i.getStringValidator)());Factory_1$i.Factory.addGetterSetter(Text$1,"textDecoration","");var TextPath$1={};Object.defineProperty(TextPath$1,"__esModule",{value:!0});TextPath$1.TextPath=void 0;const Util_1$4=Util,Factory_1$h=Factory,Shape_1$2=Shape,Path_1$1=Path$1,Text_1$1=Text$2,Validators_1$h=Validators,Global_1$2=Global;var EMPTY_STRING="",NORMAL="normal";function _fillFunc(o){o.fillText(this.partialText,0,0)}function _strokeFunc(o){o.strokeText(this.partialText,0,0)}class TextPath extends Shape_1$2.Shape{constructor(e){super(e),this.dummyCanvas=Util_1$4.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Path_1$1.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const r=this.pathLength;return e-1>r?null:Path_1$1.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Path_1$1.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var r=this.textDecoration(),t=this.fill(),n=this.fontSize(),a=this.glyphInfo;r==="underline"&&e.beginPath();for(var l=0;l<a.length;l++){e.save();var u=a[l].p0;e.translate(u.x,u.y),e.rotate(a[l].rotation),this.partialText=a[l].text,e.fillStrokeShape(this),r==="underline"&&(l===0&&e.moveTo(0,n/2+1),e.lineTo(n,n/2+1)),e.restore()}r==="underline"&&(e.strokeStyle=t,e.lineWidth=n/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();var r=this.glyphInfo;if(r.length>=1){var t=r[0].p0;e.moveTo(t.x,t.y)}for(var n=0;n<r.length;n++){var a=r[n].p1;e.lineTo(a.x,a.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Util_1$4.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Text_1$1.Text.prototype.setText.call(this,e)}_getContextFont(){return Text_1$1.Text.prototype._getContextFont.call(this)}_getTextSize(e){var r=this.dummyCanvas,t=r.getContext("2d");t.save(),t.font=this._getContextFont();var n=t.measureText(e);return t.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const t=this.letterSpacing(),n=this.align(),a=this.kerningFunc(),l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*t,0);let u=0;n==="center"&&(u=Math.max(0,this.pathLength/2-l/2)),n==="right"&&(u=Math.max(0,this.pathLength-l));const f=(0,Text_1$1.stringToArray)(this.text());let d=u;for(var h=0;h<f.length;h++){const y=this._getPointAtLength(d);if(!y)return;let E=this._getTextSize(f[h]).width+t;if(f[h]===" "&&n==="justify"){const R=this.text().split(" ").length-1;E+=(this.pathLength-l)/R}const p=this._getPointAtLength(d+E);if(!p)return;const _=Path_1$1.Path.getLineLength(y.x,y.y,p.x,p.y);let g=0;if(a)try{g=a(f[h-1],f[h])*this.fontSize()}catch{g=0}y.x+=g,p.x+=g,this.textWidth+=g;const x=Path_1$1.Path.getPointOnLine(g+_/2,y.x,y.y,p.x,p.y),C=Math.atan2(p.y-y.y,p.x-y.x);this.glyphInfo.push({transposeX:x.x,transposeY:x.y,text:f[h],rotation:C,p0:y,p1:p}),d+=E}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});for(var r=e[0]||0,t=e[0]||0,n=e[1]||0,a=e[1]||0,l,u,f=0;f<e.length/2;f++)l=e[f*2],u=e[f*2+1],r=Math.min(r,l),t=Math.max(t,l),n=Math.min(n,u),a=Math.max(a,u);var d=this.fontSize();return{x:r-d/2,y:n-d/2,width:t-r+d,height:a-n+d}}destroy(){return Util_1$4.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}TextPath$1.TextPath=TextPath;TextPath.prototype._fillFunc=_fillFunc;TextPath.prototype._strokeFunc=_strokeFunc;TextPath.prototype._fillFuncHit=_fillFunc;TextPath.prototype._strokeFuncHit=_strokeFunc;TextPath.prototype.className="TextPath";TextPath.prototype._attrsAffectingSize=["text","fontSize","data"];(0,Global_1$2._registerNode)(TextPath);Factory_1$h.Factory.addGetterSetter(TextPath,"data");Factory_1$h.Factory.addGetterSetter(TextPath,"fontFamily","Arial");Factory_1$h.Factory.addGetterSetter(TextPath,"fontSize",12,(0,Validators_1$h.getNumberValidator)());Factory_1$h.Factory.addGetterSetter(TextPath,"fontStyle",NORMAL);Factory_1$h.Factory.addGetterSetter(TextPath,"align","left");Factory_1$h.Factory.addGetterSetter(TextPath,"letterSpacing",0,(0,Validators_1$h.getNumberValidator)());Factory_1$h.Factory.addGetterSetter(TextPath,"textBaseline","middle");Factory_1$h.Factory.addGetterSetter(TextPath,"fontVariant",NORMAL);Factory_1$h.Factory.addGetterSetter(TextPath,"text",EMPTY_STRING);Factory_1$h.Factory.addGetterSetter(TextPath,"textDecoration",null);Factory_1$h.Factory.addGetterSetter(TextPath,"kerningFunc",null);var Transformer$1={};Object.defineProperty(Transformer$1,"__esModule",{value:!0});Transformer$1.Transformer=void 0;const Util_1$3=Util,Factory_1$g=Factory,Node_1$f=Node$1,Shape_1$1=Shape,Rect_1$1=Rect$2,Group_1=Group$2,Global_1$1=Global,Validators_1$g=Validators,Global_2$1=Global;var EVENTS_NAME="tr-konva",ATTR_CHANGE_LIST=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(o=>o+`.${EVENTS_NAME}`).join(" "),NODES_RECT="nodesRect",TRANSFORM_CHANGE_STR=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],ANGLES={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const TOUCH_DEVICE="ontouchstart"in Global_1$1.Konva._global;function getCursor(o,e,r){if(o==="rotater")return r;e+=Util_1$3.Util.degToRad(ANGLES[o]||0);var t=(Util_1$3.Util.radToDeg(e)%360+360)%360;return Util_1$3.Util._inRange(t,315+22.5,360)||Util_1$3.Util._inRange(t,0,22.5)?"ns-resize":Util_1$3.Util._inRange(t,45-22.5,45+22.5)?"nesw-resize":Util_1$3.Util._inRange(t,90-22.5,90+22.5)?"ew-resize":Util_1$3.Util._inRange(t,135-22.5,135+22.5)?"nwse-resize":Util_1$3.Util._inRange(t,180-22.5,180+22.5)?"ns-resize":Util_1$3.Util._inRange(t,225-22.5,225+22.5)?"nesw-resize":Util_1$3.Util._inRange(t,270-22.5,270+22.5)?"ew-resize":Util_1$3.Util._inRange(t,315-22.5,315+22.5)?"nwse-resize":(Util_1$3.Util.error("Transformer has unknown angle for cursor detection: "+t),"pointer")}var ANCHORS_NAMES=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],MAX_SAFE_INTEGER=1e8;function getCenter(o){return{x:o.x+o.width/2*Math.cos(o.rotation)+o.height/2*Math.sin(-o.rotation),y:o.y+o.height/2*Math.cos(o.rotation)+o.width/2*Math.sin(o.rotation)}}function rotateAroundPoint(o,e,r){const t=r.x+(o.x-r.x)*Math.cos(e)-(o.y-r.y)*Math.sin(e),n=r.y+(o.x-r.x)*Math.sin(e)+(o.y-r.y)*Math.cos(e);return{...o,rotation:o.rotation+e,x:t,y:n}}function rotateAroundCenter(o,e){const r=getCenter(o);return rotateAroundPoint(o,e,r)}function getSnap(o,e,r){let t=e;for(let n=0;n<o.length;n++){const a=Global_1$1.Konva.getAngle(o[n]),l=Math.abs(a-e)%(Math.PI*2);Math.min(l,Math.PI*2-l)<r&&(t=a)}return t}class Transformer extends Group_1.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(ATTR_CHANGE_LIST,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Util_1$3.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return EVENTS_NAME+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const r=e.filter(n=>n.isAncestorOf(this)?(Util_1$3.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=e=r,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(n=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},l=n._attrsAffectingSize.map(u=>u+"Change."+this._getEventNamespace()).join(" ");n.on(l,a),n.on(TRANSFORM_CHANGE_STR.map(u=>u+`.${this._getEventNamespace()}`).join(" "),a),n.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(n)}),this._resetTransformCache();var t=!!this.findOne(".top-left");return t&&this.update(),this}_proxyDrag(e){let r;e.on(`dragstart.${this._getEventNamespace()}`,t=>{r=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(t,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,t=>{if(!r)return;const n=e.getAbsolutePosition(),a=n.x-r.x,l=n.y-r.y;this.nodes().forEach(u=>{if(u===e||u.isDragging())return;const f=u.getAbsolutePosition();u.setAbsolutePosition({x:f.x+a,y:f.y+l}),u.startDrag(t)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(NODES_RECT),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(NODES_RECT,this.__getNodeRect)}__getNodeShape(e,r=this.rotation(),t){var n=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(t),l=e.getAbsolutePosition(t),u=n.x*a.x-e.offsetX()*a.x,f=n.y*a.y-e.offsetY()*a.y;const d=(Global_1$1.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:l.x+u*Math.cos(d)+f*Math.sin(-d),y:l.y+f*Math.cos(d)+u*Math.sin(d),width:n.width*a.x,height:n.height*a.y,rotation:d};return rotateAroundPoint(h,-Global_1$1.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-MAX_SAFE_INTEGER,y:-MAX_SAFE_INTEGER,width:0,height:0,rotation:0};const r=[];this.nodes().map(d=>{const h=d.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var y=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],E=d.getAbsoluteTransform();y.forEach(function(p){var _=E.point(p);r.push(_)})});const t=new Util_1$3.Transform;t.rotate(-Global_1$1.Konva.getAngle(this.rotation()));var n=1/0,a=1/0,l=-1/0,u=-1/0;r.forEach(function(d){var h=t.point(d);n===void 0&&(n=l=h.x,a=u=h.y),n=Math.min(n,h.x),a=Math.min(a,h.y),l=Math.max(l,h.x),u=Math.max(u,h.y)}),t.invert();const f=t.point({x:n,y:a});return{x:f.x,y:f.y,width:l-n,height:u-a,rotation:Global_1$1.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),ANCHORS_NAMES.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){var r=new Rect_1$1.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:TOUCH_DEVICE?10:"auto"}),t=this;r.on("mousedown touchstart",function(n){t._handleMouseDown(n)}),r.on("dragstart",n=>{r.stopDrag(),n.cancelBubble=!0}),r.on("dragend",n=>{n.cancelBubble=!0}),r.on("mouseenter",()=>{var n=Global_1$1.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),l=getCursor(e,n,a);r.getStage().content&&(r.getStage().content.style.cursor=l),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var e=new Shape_1$1.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,t){var n=t.getParent(),a=n.padding();r.beginPath(),r.rect(-a,-a,t.width()+a*2,t.height()+a*2),r.moveTo(t.width()/2,-a),n.rotateEnabled()&&n.rotateLineVisible()&&r.lineTo(t.width()/2,-n.rotateAnchorOffset()*Util_1$3.Util._sign(t.height())-a),r.fillStrokeShape(t)},hitFunc:(r,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();r.beginPath(),r.rect(-n,-n,t.width()+n*2,t.height()+n*2),r.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",r=>{r.cancelBubble=!0}),e.on("dragmove",r=>{r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var r=this._getNodeRect(),t=r.width,n=r.height,a=Math.sqrt(Math.pow(t,2)+Math.pow(n,2));this.sin=Math.abs(n/a),this.cos=Math.abs(t/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var l=e.target.getAbsolutePosition(),u=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:u.x-l.x,y:u.y-l.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(f=>{f._fire("transformstart",{evt:e.evt,target:f})})}_handleMouseMove(e){var r,t,n,a=this.findOne("."+this._movingAnchorName),l=a.getStage();l.setPointersPositions(e);const u=l.getPointerPosition();let f={x:u.x-this._anchorDragOffset.x,y:u.y-this._anchorDragOffset.y};const d=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(f=this.anchorDragBoundFunc()(d,f,e)),a.setAbsolutePosition(f);const h=a.getAbsolutePosition();if(!(d.x===h.x&&d.y===h.y)){if(this._movingAnchorName==="rotater"){var y=this._getNodeRect();r=a.x()-y.width/2,t=-a.y()+y.height/2;let V=Math.atan2(-t,r)+Math.PI/2;y.height<0&&(V-=Math.PI);var E=Global_1$1.Konva.getAngle(this.rotation());const W=E+V,ee=Global_1$1.Konva.getAngle(this.rotationSnapTolerance()),z=getSnap(this.rotationSnaps(),W,ee)-y.rotation,U=rotateAroundCenter(y,z);this._fitNodesInto(U,e);return}var p=this.shiftBehavior(),_;p==="inverted"?_=this.keepRatio()&&!e.shiftKey:p==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;var S=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){var g=S?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};n=Math.sqrt(Math.pow(g.x-a.x(),2)+Math.pow(g.y-a.y(),2));var x=this.findOne(".top-left").x()>g.x?-1:1,C=this.findOne(".top-left").y()>g.y?-1:1;r=n*this.cos*x,t=n*this.sin*C,this.findOne(".top-left").x(g.x-r),this.findOne(".top-left").y(g.y-t)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(_){var g=S?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};n=Math.sqrt(Math.pow(a.x()-g.x,2)+Math.pow(g.y-a.y(),2));var x=this.findOne(".top-right").x()<g.x?-1:1,C=this.findOne(".top-right").y()>g.y?-1:1;r=n*this.cos*x,t=n*this.sin*C,this.findOne(".top-right").x(g.x+r),this.findOne(".top-right").y(g.y-t)}var R=a.position();this.findOne(".top-left").y(R.y),this.findOne(".bottom-right").x(R.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(_){var g=S?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};n=Math.sqrt(Math.pow(g.x-a.x(),2)+Math.pow(a.y()-g.y,2));var x=g.x<a.x()?-1:1,C=a.y()<g.y?-1:1;r=n*this.cos*x,t=n*this.sin*C,a.x(g.x-r),a.y(g.y+t)}R=a.position(),this.findOne(".top-left").x(R.x),this.findOne(".bottom-right").y(R.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(_){var g=S?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};n=Math.sqrt(Math.pow(a.x()-g.x,2)+Math.pow(a.y()-g.y,2));var x=this.findOne(".bottom-right").x()<g.x?-1:1,C=this.findOne(".bottom-right").y()<g.y?-1:1;r=n*this.cos*x,t=n*this.sin*C,this.findOne(".bottom-right").x(g.x+r),this.findOne(".bottom-right").y(g.y+t)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var S=this.centeredScaling()||e.altKey;if(S){var A=this.findOne(".top-left"),T=this.findOne(".bottom-right"),w=A.x(),P=A.y(),O=this.getWidth()-T.x(),k=this.getHeight()-T.y();T.move({x:-w,y:-P}),A.move({x:O,y:k})}var D=this.findOne(".top-left").getAbsolutePosition();r=D.x,t=D.y;var F=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),G=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:t,width:F,height:G,rotation:Global_1$1.Konva.getAngle(this.rotation())},e)}}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var r=this.getNode();this._fire("transformend",{evt:e,target:r}),r&&this._nodes.forEach(t=>{t._fire("transformend",{evt:e,target:t})}),this._movingAnchorName=null}}_fitNodesInto(e,r){var t=this._getNodeRect();const n=1;if(Util_1$3.Util._inRange(e.width,-this.padding()*2-n,n)){this.update();return}if(Util_1$3.Util._inRange(e.height,-this.padding()*2-n,n)){this.update();return}var a=new Util_1$3.Transform;if(a.rotate(Global_1$1.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const E=a.point({x:-this.padding()*2,y:0});e.x+=E.x,e.y+=E.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=E.x,this._anchorDragOffset.y-=E.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const E=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=E.x,this._anchorDragOffset.y-=E.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const E=a.point({x:0,y:-this.padding()*2});e.x+=E.x,e.y+=E.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=E.x,this._anchorDragOffset.y-=E.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const E=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=E.x,this._anchorDragOffset.y-=E.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const E=this.boundBoxFunc()(t,e);E?e=E:Util_1$3.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const l=1e7,u=new Util_1$3.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/l,t.height/l);const f=new Util_1$3.Transform,d=e.width/l,h=e.height/l;this.flipEnabled()===!1?(f.translate(e.x,e.y),f.rotate(e.rotation),f.translate(e.width<0?e.width:0,e.height<0?e.height:0),f.scale(Math.abs(d),Math.abs(h))):(f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(d,h));const y=f.multiply(u.invert());this._nodes.forEach(E=>{var p;const _=E.getParent().getAbsoluteTransform(),g=E.getTransform().copy();g.translate(E.offsetX(),E.offsetY());const x=new Util_1$3.Transform;x.multiply(_.copy().invert()).multiply(y).multiply(_).multiply(g);const C=x.decompose();E.setAttrs(C),this._fire("transform",{evt:r,target:E}),E._fire("transform",{evt:r,target:E}),(p=E.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(Util_1$3.Util._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,r){this.findOne(e).setAttrs(r)}update(){var e,r=this._getNodeRect();this.rotation(Util_1$3.Util._getRotation(r.rotation));var t=r.width,n=r.height,a=this.enabledAnchors(),l=this.resizeEnabled(),u=this.padding(),f=this.anchorSize();const d=this.find("._anchor");d.forEach(y=>{y.setAttrs({width:f,height:f,offsetX:f/2,offsetY:f/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:f/2+u,offsetY:f/2+u,visible:l&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:t/2,y:0,offsetY:f/2+u,visible:l&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:t,y:0,offsetX:f/2-u,offsetY:f/2+u,visible:l&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:n/2,offsetX:f/2+u,visible:l&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:t,y:n/2,offsetX:f/2-u,visible:l&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:n,offsetX:f/2+u,offsetY:f/2-u,visible:l&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:t/2,y:n,offsetY:f/2-u,visible:l&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:t,y:n,offsetX:f/2-u,offsetY:f/2-u,visible:l&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:t/2,y:-this.rotateAnchorOffset()*Util_1$3.Util._sign(n)-u,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:t,height:n,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const h=this.anchorStyleFunc();h&&d.forEach(y=>{h(y)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Group_1.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Node_1$f.Node.prototype.toObject.call(this)}clone(e){var r=Node_1$f.Node.prototype.clone.call(this,e);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Transformer$1.Transformer=Transformer;function validateAnchors(o){return o instanceof Array||Util_1$3.Util.warn("enabledAnchors value should be an array"),o instanceof Array&&o.forEach(function(e){ANCHORS_NAMES.indexOf(e)===-1&&Util_1$3.Util.warn("Unknown anchor name: "+e+". Available names are: "+ANCHORS_NAMES.join(", "))}),o||[]}Transformer.prototype.className="Transformer";(0,Global_2$1._registerNode)(Transformer);Factory_1$g.Factory.addGetterSetter(Transformer,"enabledAnchors",ANCHORS_NAMES,validateAnchors);Factory_1$g.Factory.addGetterSetter(Transformer,"flipEnabled",!0,(0,Validators_1$g.getBooleanValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"resizeEnabled",!0);Factory_1$g.Factory.addGetterSetter(Transformer,"anchorSize",10,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"rotateEnabled",!0);Factory_1$g.Factory.addGetterSetter(Transformer,"rotateLineVisible",!0);Factory_1$g.Factory.addGetterSetter(Transformer,"rotationSnaps",[]);Factory_1$g.Factory.addGetterSetter(Transformer,"rotateAnchorOffset",50,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"rotateAnchorCursor","crosshair");Factory_1$g.Factory.addGetterSetter(Transformer,"rotationSnapTolerance",5,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"borderEnabled",!0);Factory_1$g.Factory.addGetterSetter(Transformer,"anchorStroke","rgb(0, 161, 255)");Factory_1$g.Factory.addGetterSetter(Transformer,"anchorStrokeWidth",1,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"anchorFill","white");Factory_1$g.Factory.addGetterSetter(Transformer,"anchorCornerRadius",0,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"borderStroke","rgb(0, 161, 255)");Factory_1$g.Factory.addGetterSetter(Transformer,"borderStrokeWidth",1,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"borderDash");Factory_1$g.Factory.addGetterSetter(Transformer,"keepRatio",!0);Factory_1$g.Factory.addGetterSetter(Transformer,"shiftBehavior","default");Factory_1$g.Factory.addGetterSetter(Transformer,"centeredScaling",!1);Factory_1$g.Factory.addGetterSetter(Transformer,"ignoreStroke",!1);Factory_1$g.Factory.addGetterSetter(Transformer,"padding",0,(0,Validators_1$g.getNumberValidator)());Factory_1$g.Factory.addGetterSetter(Transformer,"node");Factory_1$g.Factory.addGetterSetter(Transformer,"nodes");Factory_1$g.Factory.addGetterSetter(Transformer,"boundBoxFunc");Factory_1$g.Factory.addGetterSetter(Transformer,"anchorDragBoundFunc");Factory_1$g.Factory.addGetterSetter(Transformer,"anchorStyleFunc");Factory_1$g.Factory.addGetterSetter(Transformer,"shouldOverdrawWholeArea",!1);Factory_1$g.Factory.addGetterSetter(Transformer,"useSingleNodeRotation",!0);Factory_1$g.Factory.backCompat(Transformer,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Wedge$1={};Object.defineProperty(Wedge$1,"__esModule",{value:!0});Wedge$1.Wedge=void 0;const Factory_1$f=Factory,Shape_1=Shape,Global_1=Global,Validators_1$f=Validators,Global_2=Global;class Wedge extends Shape_1.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Global_1.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Wedge$1.Wedge=Wedge;Wedge.prototype.className="Wedge";Wedge.prototype._centroid=!0;Wedge.prototype._attrsAffectingSize=["radius"];(0,Global_2._registerNode)(Wedge);Factory_1$f.Factory.addGetterSetter(Wedge,"radius",0,(0,Validators_1$f.getNumberValidator)());Factory_1$f.Factory.addGetterSetter(Wedge,"angle",0,(0,Validators_1$f.getNumberValidator)());Factory_1$f.Factory.addGetterSetter(Wedge,"clockwise",!1);Factory_1$f.Factory.backCompat(Wedge,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Blur$1={};Object.defineProperty(Blur$1,"__esModule",{value:!0});Blur$1.Blur=void 0;const Factory_1$e=Factory,Node_1$e=Node$1,Validators_1$e=Validators;function BlurStack(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var mul_table=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],shg_table=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function filterGaussBlurRGBA(o,e){var r=o.data,t=o.width,n=o.height,a,l,u,f,d,h,y,E,p,_,g,x,C,R,S,A,T,w,P,O,k,D,F,G,V=e+e+1,W=t-1,ee=n-1,q=e+1,z=q*(q+1)/2,U=new BlurStack,$=null,I=U,B=null,X=null,Q=mul_table[e],J=shg_table[e];for(u=1;u<V;u++)I=I.next=new BlurStack,u===q&&($=I);for(I.next=U,y=h=0,l=0;l<n;l++){for(A=T=w=P=E=p=_=g=0,x=q*(O=r[h]),C=q*(k=r[h+1]),R=q*(D=r[h+2]),S=q*(F=r[h+3]),E+=z*O,p+=z*k,_+=z*D,g+=z*F,I=U,u=0;u<q;u++)I.r=O,I.g=k,I.b=D,I.a=F,I=I.next;for(u=1;u<q;u++)f=h+((W<u?W:u)<<2),E+=(I.r=O=r[f])*(G=q-u),p+=(I.g=k=r[f+1])*G,_+=(I.b=D=r[f+2])*G,g+=(I.a=F=r[f+3])*G,A+=O,T+=k,w+=D,P+=F,I=I.next;for(B=U,X=$,a=0;a<t;a++)r[h+3]=F=g*Q>>J,F!==0?(F=255/F,r[h]=(E*Q>>J)*F,r[h+1]=(p*Q>>J)*F,r[h+2]=(_*Q>>J)*F):r[h]=r[h+1]=r[h+2]=0,E-=x,p-=C,_-=R,g-=S,x-=B.r,C-=B.g,R-=B.b,S-=B.a,f=y+((f=a+e+1)<W?f:W)<<2,A+=B.r=r[f],T+=B.g=r[f+1],w+=B.b=r[f+2],P+=B.a=r[f+3],E+=A,p+=T,_+=w,g+=P,B=B.next,x+=O=X.r,C+=k=X.g,R+=D=X.b,S+=F=X.a,A-=O,T-=k,w-=D,P-=F,X=X.next,h+=4;y+=t}for(a=0;a<t;a++){for(T=w=P=A=p=_=g=E=0,h=a<<2,x=q*(O=r[h]),C=q*(k=r[h+1]),R=q*(D=r[h+2]),S=q*(F=r[h+3]),E+=z*O,p+=z*k,_+=z*D,g+=z*F,I=U,u=0;u<q;u++)I.r=O,I.g=k,I.b=D,I.a=F,I=I.next;for(d=t,u=1;u<=e;u++)h=d+a<<2,E+=(I.r=O=r[h])*(G=q-u),p+=(I.g=k=r[h+1])*G,_+=(I.b=D=r[h+2])*G,g+=(I.a=F=r[h+3])*G,A+=O,T+=k,w+=D,P+=F,I=I.next,u<ee&&(d+=t);for(h=a,B=U,X=$,l=0;l<n;l++)f=h<<2,r[f+3]=F=g*Q>>J,F>0?(F=255/F,r[f]=(E*Q>>J)*F,r[f+1]=(p*Q>>J)*F,r[f+2]=(_*Q>>J)*F):r[f]=r[f+1]=r[f+2]=0,E-=x,p-=C,_-=R,g-=S,x-=B.r,C-=B.g,R-=B.b,S-=B.a,f=a+((f=l+q)<ee?f:ee)*t<<2,E+=A+=B.r=r[f],p+=T+=B.g=r[f+1],_+=w+=B.b=r[f+2],g+=P+=B.a=r[f+3],B=B.next,x+=O=X.r,C+=k=X.g,R+=D=X.b,S+=F=X.a,A-=O,T-=k,w-=D,P-=F,X=X.next,h+=t}}const Blur=function o(e){var r=Math.round(this.blurRadius());r>0&&filterGaussBlurRGBA(e,r)};Blur$1.Blur=Blur;Factory_1$e.Factory.addGetterSetter(Node_1$e.Node,"blurRadius",0,(0,Validators_1$e.getNumberValidator)(),Factory_1$e.Factory.afterSetFilter);var Brighten$1={};Object.defineProperty(Brighten$1,"__esModule",{value:!0});Brighten$1.Brighten=void 0;const Factory_1$d=Factory,Node_1$d=Node$1,Validators_1$d=Validators,Brighten=function(o){var e=this.brightness()*255,r=o.data,t=r.length,n;for(n=0;n<t;n+=4)r[n]+=e,r[n+1]+=e,r[n+2]+=e};Brighten$1.Brighten=Brighten;Factory_1$d.Factory.addGetterSetter(Node_1$d.Node,"brightness",0,(0,Validators_1$d.getNumberValidator)(),Factory_1$d.Factory.afterSetFilter);var Contrast$1={};Object.defineProperty(Contrast$1,"__esModule",{value:!0});Contrast$1.Contrast=void 0;const Factory_1$c=Factory,Node_1$c=Node$1,Validators_1$c=Validators,Contrast=function(o){var e=Math.pow((this.contrast()+100)/100,2),r=o.data,t=r.length,n=150,a=150,l=150,u;for(u=0;u<t;u+=4)n=r[u],a=r[u+1],l=r[u+2],n/=255,n-=.5,n*=e,n+=.5,n*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,l/=255,l-=.5,l*=e,l+=.5,l*=255,n=n<0?0:n>255?255:n,a=a<0?0:a>255?255:a,l=l<0?0:l>255?255:l,r[u]=n,r[u+1]=a,r[u+2]=l};Contrast$1.Contrast=Contrast;Factory_1$c.Factory.addGetterSetter(Node_1$c.Node,"contrast",0,(0,Validators_1$c.getNumberValidator)(),Factory_1$c.Factory.afterSetFilter);var Emboss$1={};Object.defineProperty(Emboss$1,"__esModule",{value:!0});Emboss$1.Emboss=void 0;const Factory_1$b=Factory,Node_1$b=Node$1,Util_1$2=Util,Validators_1$b=Validators,Emboss=function(o){var e=this.embossStrength()*10,r=this.embossWhiteLevel()*255,t=this.embossDirection(),n=this.embossBlend(),a=0,l=0,u=o.data,f=o.width,d=o.height,h=f*4,y=d;switch(t){case"top-left":a=-1,l=-1;break;case"top":a=-1,l=0;break;case"top-right":a=-1,l=1;break;case"right":a=0,l=1;break;case"bottom-right":a=1,l=1;break;case"bottom":a=1,l=0;break;case"bottom-left":a=1,l=-1;break;case"left":a=0,l=-1;break;default:Util_1$2.Util.error("Unknown emboss direction: "+t)}do{var E=(y-1)*h,p=a;y+p<1&&(p=0),y+p>d&&(p=0);var _=(y-1+p)*f*4,g=f;do{var x=E+(g-1)*4,C=l;g+C<1&&(C=0),g+C>f&&(C=0);var R=_+(g-1+C)*4,S=u[x]-u[R],A=u[x+1]-u[R+1],T=u[x+2]-u[R+2],w=S,P=w>0?w:-w,O=A>0?A:-A,k=T>0?T:-T;if(O>P&&(w=A),k>P&&(w=T),w*=e,n){var D=u[x]+w,F=u[x+1]+w,G=u[x+2]+w;u[x]=D>255?255:D<0?0:D,u[x+1]=F>255?255:F<0?0:F,u[x+2]=G>255?255:G<0?0:G}else{var V=r-w;V<0?V=0:V>255&&(V=255),u[x]=u[x+1]=u[x+2]=V}}while(--g)}while(--y)};Emboss$1.Emboss=Emboss;Factory_1$b.Factory.addGetterSetter(Node_1$b.Node,"embossStrength",.5,(0,Validators_1$b.getNumberValidator)(),Factory_1$b.Factory.afterSetFilter);Factory_1$b.Factory.addGetterSetter(Node_1$b.Node,"embossWhiteLevel",.5,(0,Validators_1$b.getNumberValidator)(),Factory_1$b.Factory.afterSetFilter);Factory_1$b.Factory.addGetterSetter(Node_1$b.Node,"embossDirection","top-left",null,Factory_1$b.Factory.afterSetFilter);Factory_1$b.Factory.addGetterSetter(Node_1$b.Node,"embossBlend",!1,null,Factory_1$b.Factory.afterSetFilter);var Enhance$1={};Object.defineProperty(Enhance$1,"__esModule",{value:!0});Enhance$1.Enhance=void 0;const Factory_1$a=Factory,Node_1$a=Node$1,Validators_1$a=Validators;function remap(o,e,r,t,n){var a=r-e,l=n-t,u;return a===0?t+l/2:l===0?t:(u=(o-e)/a,u=l*u+t,u)}const Enhance=function(o){var e=o.data,r=e.length,t=e[0],n=t,a,l=e[1],u=l,f,d=e[2],h=d,y,E,p=this.enhance();if(p!==0){for(E=0;E<r;E+=4)a=e[E+0],a<t?t=a:a>n&&(n=a),f=e[E+1],f<l?l=f:f>u&&(u=f),y=e[E+2],y<d?d=y:y>h&&(h=y);n===t&&(n=255,t=0),u===l&&(u=255,l=0),h===d&&(h=255,d=0);var _,g,x,C,R,S,A,T,w;for(p>0?(g=n+p*(255-n),x=t-p*(t-0),R=u+p*(255-u),S=l-p*(l-0),T=h+p*(255-h),w=d-p*(d-0)):(_=(n+t)*.5,g=n+p*(n-_),x=t+p*(t-_),C=(u+l)*.5,R=u+p*(u-C),S=l+p*(l-C),A=(h+d)*.5,T=h+p*(h-A),w=d+p*(d-A)),E=0;E<r;E+=4)e[E+0]=remap(e[E+0],t,n,x,g),e[E+1]=remap(e[E+1],l,u,S,R),e[E+2]=remap(e[E+2],d,h,w,T)}};Enhance$1.Enhance=Enhance;Factory_1$a.Factory.addGetterSetter(Node_1$a.Node,"enhance",0,(0,Validators_1$a.getNumberValidator)(),Factory_1$a.Factory.afterSetFilter);var Grayscale$1={};Object.defineProperty(Grayscale$1,"__esModule",{value:!0});Grayscale$1.Grayscale=void 0;const Grayscale=function(o){var e=o.data,r=e.length,t,n;for(t=0;t<r;t+=4)n=.34*e[t]+.5*e[t+1]+.16*e[t+2],e[t]=n,e[t+1]=n,e[t+2]=n};Grayscale$1.Grayscale=Grayscale;var HSL$1={};Object.defineProperty(HSL$1,"__esModule",{value:!0});HSL$1.HSL=void 0;const Factory_1$9=Factory,Node_1$9=Node$1,Validators_1$9=Validators;Factory_1$9.Factory.addGetterSetter(Node_1$9.Node,"hue",0,(0,Validators_1$9.getNumberValidator)(),Factory_1$9.Factory.afterSetFilter);Factory_1$9.Factory.addGetterSetter(Node_1$9.Node,"saturation",0,(0,Validators_1$9.getNumberValidator)(),Factory_1$9.Factory.afterSetFilter);Factory_1$9.Factory.addGetterSetter(Node_1$9.Node,"luminance",0,(0,Validators_1$9.getNumberValidator)(),Factory_1$9.Factory.afterSetFilter);const HSL=function(o){var e=o.data,r=e.length,t=1,n=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,l=this.luminance()*127,u,f=t*n*Math.cos(a*Math.PI/180),d=t*n*Math.sin(a*Math.PI/180),h=.299*t+.701*f+.167*d,y=.587*t-.587*f+.33*d,E=.114*t-.114*f-.497*d,p=.299*t-.299*f-.328*d,_=.587*t+.413*f+.035*d,g=.114*t-.114*f+.293*d,x=.299*t-.3*f+1.25*d,C=.587*t-.586*f-1.05*d,R=.114*t+.886*f-.2*d,S,A,T,w;for(u=0;u<r;u+=4)S=e[u+0],A=e[u+1],T=e[u+2],w=e[u+3],e[u+0]=h*S+y*A+E*T+l,e[u+1]=p*S+_*A+g*T+l,e[u+2]=x*S+C*A+R*T+l,e[u+3]=w};HSL$1.HSL=HSL;var HSV$1={};Object.defineProperty(HSV$1,"__esModule",{value:!0});HSV$1.HSV=void 0;const Factory_1$8=Factory,Node_1$8=Node$1,Validators_1$8=Validators,HSV=function(o){var e=o.data,r=e.length,t=Math.pow(2,this.value()),n=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,l,u=t*n*Math.cos(a*Math.PI/180),f=t*n*Math.sin(a*Math.PI/180),d=.299*t+.701*u+.167*f,h=.587*t-.587*u+.33*f,y=.114*t-.114*u-.497*f,E=.299*t-.299*u-.328*f,p=.587*t+.413*u+.035*f,_=.114*t-.114*u+.293*f,g=.299*t-.3*u+1.25*f,x=.587*t-.586*u-1.05*f,C=.114*t+.886*u-.2*f,R,S,A,T;for(l=0;l<r;l+=4)R=e[l+0],S=e[l+1],A=e[l+2],T=e[l+3],e[l+0]=d*R+h*S+y*A,e[l+1]=E*R+p*S+_*A,e[l+2]=g*R+x*S+C*A,e[l+3]=T};HSV$1.HSV=HSV;Factory_1$8.Factory.addGetterSetter(Node_1$8.Node,"hue",0,(0,Validators_1$8.getNumberValidator)(),Factory_1$8.Factory.afterSetFilter);Factory_1$8.Factory.addGetterSetter(Node_1$8.Node,"saturation",0,(0,Validators_1$8.getNumberValidator)(),Factory_1$8.Factory.afterSetFilter);Factory_1$8.Factory.addGetterSetter(Node_1$8.Node,"value",0,(0,Validators_1$8.getNumberValidator)(),Factory_1$8.Factory.afterSetFilter);var Invert$1={};Object.defineProperty(Invert$1,"__esModule",{value:!0});Invert$1.Invert=void 0;const Invert=function(o){var e=o.data,r=e.length,t;for(t=0;t<r;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]};Invert$1.Invert=Invert;var Kaleidoscope$1={};Object.defineProperty(Kaleidoscope$1,"__esModule",{value:!0});Kaleidoscope$1.Kaleidoscope=void 0;const Factory_1$7=Factory,Node_1$7=Node$1,Util_1$1=Util,Validators_1$7=Validators;var ToPolar=function(o,e,r){var t=o.data,n=e.data,a=o.width,l=o.height,u=r.polarCenterX||a/2,f=r.polarCenterY||l/2,d,h,y,E=0,p=0,_=0,g=0,x,C=Math.sqrt(u*u+f*f);h=a-u,y=l-f,x=Math.sqrt(h*h+y*y),C=x>C?x:C;var R=l,S=a,A,T,w=360/S*Math.PI/180,P,O;for(T=0;T<S;T+=1)for(P=Math.sin(T*w),O=Math.cos(T*w),A=0;A<R;A+=1)h=Math.floor(u+C*A/R*O),y=Math.floor(f+C*A/R*P),d=(y*a+h)*4,E=t[d+0],p=t[d+1],_=t[d+2],g=t[d+3],d=(T+A*a)*4,n[d+0]=E,n[d+1]=p,n[d+2]=_,n[d+3]=g},FromPolar=function(o,e,r){var t=o.data,n=e.data,a=o.width,l=o.height,u=r.polarCenterX||a/2,f=r.polarCenterY||l/2,d,h,y,E,p,_=0,g=0,x=0,C=0,R,S=Math.sqrt(u*u+f*f);h=a-u,y=l-f,R=Math.sqrt(h*h+y*y),S=R>S?R:S;var A=l,T=a,w,P,O=r.polarRotation||0,k,D;for(h=0;h<a;h+=1)for(y=0;y<l;y+=1)E=h-u,p=y-f,w=Math.sqrt(E*E+p*p)*A/S,P=(Math.atan2(p,E)*180/Math.PI+360+O)%360,P=P*T/360,k=Math.floor(P),D=Math.floor(w),d=(D*a+k)*4,_=t[d+0],g=t[d+1],x=t[d+2],C=t[d+3],d=(y*a+h)*4,n[d+0]=_,n[d+1]=g,n[d+2]=x,n[d+3]=C};const Kaleidoscope=function(o){var e=o.width,r=o.height,t,n,a,l,u,f,d,h,y,E,p=Math.round(this.kaleidoscopePower()),_=Math.round(this.kaleidoscopeAngle()),g=Math.floor(e*(_%360)/360);if(!(p<1)){var x=Util_1$1.Util.createCanvasElement();x.width=e,x.height=r;var C=x.getContext("2d").getImageData(0,0,e,r);Util_1$1.Util.releaseCanvas(x),ToPolar(o,C,{polarCenterX:e/2,polarCenterY:r/2});for(var R=e/Math.pow(2,p);R<=8;)R=R*2,p-=1;R=Math.ceil(R);var S=R,A=0,T=S,w=1;for(g+R>e&&(A=S,T=0,w=-1),n=0;n<r;n+=1)for(t=A;t!==T;t+=w)a=Math.round(t+g)%e,y=(e*n+a)*4,u=C.data[y+0],f=C.data[y+1],d=C.data[y+2],h=C.data[y+3],E=(e*n+t)*4,C.data[E+0]=u,C.data[E+1]=f,C.data[E+2]=d,C.data[E+3]=h;for(n=0;n<r;n+=1)for(S=Math.floor(R),l=0;l<p;l+=1){for(t=0;t<S+1;t+=1)y=(e*n+t)*4,u=C.data[y+0],f=C.data[y+1],d=C.data[y+2],h=C.data[y+3],E=(e*n+S*2-t-1)*4,C.data[E+0]=u,C.data[E+1]=f,C.data[E+2]=d,C.data[E+3]=h;S*=2}FromPolar(C,o,{polarRotation:0})}};Kaleidoscope$1.Kaleidoscope=Kaleidoscope;Factory_1$7.Factory.addGetterSetter(Node_1$7.Node,"kaleidoscopePower",2,(0,Validators_1$7.getNumberValidator)(),Factory_1$7.Factory.afterSetFilter);Factory_1$7.Factory.addGetterSetter(Node_1$7.Node,"kaleidoscopeAngle",0,(0,Validators_1$7.getNumberValidator)(),Factory_1$7.Factory.afterSetFilter);var Mask$1={};Object.defineProperty(Mask$1,"__esModule",{value:!0});Mask$1.Mask=void 0;const Factory_1$6=Factory,Node_1$6=Node$1,Validators_1$6=Validators;function pixelAt(o,e,r){var t=(r*o.width+e)*4,n=[];return n.push(o.data[t++],o.data[t++],o.data[t++],o.data[t++]),n}function rgbDistance(o,e){return Math.sqrt(Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)+Math.pow(o[2]-e[2],2))}function rgbMean(o){for(var e=[0,0,0],r=0;r<o.length;r++)e[0]+=o[r][0],e[1]+=o[r][1],e[2]+=o[r][2];return e[0]/=o.length,e[1]/=o.length,e[2]/=o.length,e}function backgroundMask(o,e){var r=pixelAt(o,0,0),t=pixelAt(o,o.width-1,0),n=pixelAt(o,0,o.height-1),a=pixelAt(o,o.width-1,o.height-1),l=e||10;if(rgbDistance(r,t)<l&&rgbDistance(t,a)<l&&rgbDistance(a,n)<l&&rgbDistance(n,r)<l){for(var u=rgbMean([t,r,a,n]),f=[],d=0;d<o.width*o.height;d++){var h=rgbDistance(u,[o.data[d*4],o.data[d*4+1],o.data[d*4+2]]);f[d]=h<l?0:255}return f}}function applyMask(o,e){for(var r=0;r<o.width*o.height;r++)o.data[4*r+3]=e[r]}function erodeMask(o,e,r){for(var t=[1,1,1,1,0,1,1,1,1],n=Math.round(Math.sqrt(t.length)),a=Math.floor(n/2),l=[],u=0;u<r;u++)for(var f=0;f<e;f++){for(var d=u*e+f,h=0,y=0;y<n;y++)for(var E=0;E<n;E++){var p=u+y-a,_=f+E-a;if(p>=0&&p<r&&_>=0&&_<e){var g=p*e+_,x=t[y*n+E];h+=o[g]*x}}l[d]=h===255*8?255:0}return l}function dilateMask(o,e,r){for(var t=[1,1,1,1,1,1,1,1,1],n=Math.round(Math.sqrt(t.length)),a=Math.floor(n/2),l=[],u=0;u<r;u++)for(var f=0;f<e;f++){for(var d=u*e+f,h=0,y=0;y<n;y++)for(var E=0;E<n;E++){var p=u+y-a,_=f+E-a;if(p>=0&&p<r&&_>=0&&_<e){var g=p*e+_,x=t[y*n+E];h+=o[g]*x}}l[d]=h>=255*4?255:0}return l}function smoothEdgeMask(o,e,r){for(var t=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],n=Math.round(Math.sqrt(t.length)),a=Math.floor(n/2),l=[],u=0;u<r;u++)for(var f=0;f<e;f++){for(var d=u*e+f,h=0,y=0;y<n;y++)for(var E=0;E<n;E++){var p=u+y-a,_=f+E-a;if(p>=0&&p<r&&_>=0&&_<e){var g=p*e+_,x=t[y*n+E];h+=o[g]*x}}l[d]=h}return l}const Mask=function(o){var e=this.threshold(),r=backgroundMask(o,e);return r&&(r=erodeMask(r,o.width,o.height),r=dilateMask(r,o.width,o.height),r=smoothEdgeMask(r,o.width,o.height),applyMask(o,r)),o};Mask$1.Mask=Mask;Factory_1$6.Factory.addGetterSetter(Node_1$6.Node,"threshold",0,(0,Validators_1$6.getNumberValidator)(),Factory_1$6.Factory.afterSetFilter);var Noise$1={};Object.defineProperty(Noise$1,"__esModule",{value:!0});Noise$1.Noise=void 0;const Factory_1$5=Factory,Node_1$5=Node$1,Validators_1$5=Validators,Noise=function(o){var e=this.noise()*255,r=o.data,t=r.length,n=e/2,a;for(a=0;a<t;a+=4)r[a+0]+=n-2*n*Math.random(),r[a+1]+=n-2*n*Math.random(),r[a+2]+=n-2*n*Math.random()};Noise$1.Noise=Noise;Factory_1$5.Factory.addGetterSetter(Node_1$5.Node,"noise",.2,(0,Validators_1$5.getNumberValidator)(),Factory_1$5.Factory.afterSetFilter);var Pixelate$1={};Object.defineProperty(Pixelate$1,"__esModule",{value:!0});Pixelate$1.Pixelate=void 0;const Factory_1$4=Factory,Util_1=Util,Node_1$4=Node$1,Validators_1$4=Validators,Pixelate=function(o){var e=Math.ceil(this.pixelSize()),r=o.width,t=o.height,n,a,l,u,f,d,h,y=Math.ceil(r/e),E=Math.ceil(t/e),p,_,g,x,C,R,S,A=o.data;if(e<=0){Util_1.Util.error("pixelSize value can not be <= 0");return}for(C=0;C<y;C+=1)for(R=0;R<E;R+=1){for(u=0,f=0,d=0,h=0,p=C*e,_=p+e,g=R*e,x=g+e,S=0,n=p;n<_;n+=1)if(!(n>=r))for(a=g;a<x;a+=1)a>=t||(l=(r*a+n)*4,u+=A[l+0],f+=A[l+1],d+=A[l+2],h+=A[l+3],S+=1);for(u=u/S,f=f/S,d=d/S,h=h/S,n=p;n<_;n+=1)if(!(n>=r))for(a=g;a<x;a+=1)a>=t||(l=(r*a+n)*4,A[l+0]=u,A[l+1]=f,A[l+2]=d,A[l+3]=h)}};Pixelate$1.Pixelate=Pixelate;Factory_1$4.Factory.addGetterSetter(Node_1$4.Node,"pixelSize",8,(0,Validators_1$4.getNumberValidator)(),Factory_1$4.Factory.afterSetFilter);var Posterize$1={};Object.defineProperty(Posterize$1,"__esModule",{value:!0});Posterize$1.Posterize=void 0;const Factory_1$3=Factory,Node_1$3=Node$1,Validators_1$3=Validators,Posterize=function(o){var e=Math.round(this.levels()*254)+1,r=o.data,t=r.length,n=255/e,a;for(a=0;a<t;a+=1)r[a]=Math.floor(r[a]/n)*n};Posterize$1.Posterize=Posterize;Factory_1$3.Factory.addGetterSetter(Node_1$3.Node,"levels",.5,(0,Validators_1$3.getNumberValidator)(),Factory_1$3.Factory.afterSetFilter);var RGB$1={};Object.defineProperty(RGB$1,"__esModule",{value:!0});RGB$1.RGB=void 0;const Factory_1$2=Factory,Node_1$2=Node$1,Validators_1$2=Validators,RGB=function(o){var e=o.data,r=e.length,t=this.red(),n=this.green(),a=this.blue(),l,u;for(l=0;l<r;l+=4)u=(.34*e[l]+.5*e[l+1]+.16*e[l+2])/255,e[l]=u*t,e[l+1]=u*n,e[l+2]=u*a,e[l+3]=e[l+3]};RGB$1.RGB=RGB;Factory_1$2.Factory.addGetterSetter(Node_1$2.Node,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});Factory_1$2.Factory.addGetterSetter(Node_1$2.Node,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});Factory_1$2.Factory.addGetterSetter(Node_1$2.Node,"blue",0,Validators_1$2.RGBComponent,Factory_1$2.Factory.afterSetFilter);var RGBA$1={};Object.defineProperty(RGBA$1,"__esModule",{value:!0});RGBA$1.RGBA=void 0;const Factory_1$1=Factory,Node_1$1=Node$1,Validators_1$1=Validators,RGBA=function(o){var e=o.data,r=e.length,t=this.red(),n=this.green(),a=this.blue(),l=this.alpha(),u,f;for(u=0;u<r;u+=4)f=1-l,e[u]=t*l+e[u]*f,e[u+1]=n*l+e[u+1]*f,e[u+2]=a*l+e[u+2]*f};RGBA$1.RGBA=RGBA;Factory_1$1.Factory.addGetterSetter(Node_1$1.Node,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});Factory_1$1.Factory.addGetterSetter(Node_1$1.Node,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});Factory_1$1.Factory.addGetterSetter(Node_1$1.Node,"blue",0,Validators_1$1.RGBComponent,Factory_1$1.Factory.afterSetFilter);Factory_1$1.Factory.addGetterSetter(Node_1$1.Node,"alpha",1,function(o){return this._filterUpToDate=!1,o>1?1:o<0?0:o});var Sepia$1={};Object.defineProperty(Sepia$1,"__esModule",{value:!0});Sepia$1.Sepia=void 0;const Sepia=function(o){var e=o.data,r=e.length,t,n,a,l;for(t=0;t<r;t+=4)n=e[t+0],a=e[t+1],l=e[t+2],e[t+0]=Math.min(255,n*.393+a*.769+l*.189),e[t+1]=Math.min(255,n*.349+a*.686+l*.168),e[t+2]=Math.min(255,n*.272+a*.534+l*.131)};Sepia$1.Sepia=Sepia;var Solarize$1={};Object.defineProperty(Solarize$1,"__esModule",{value:!0});Solarize$1.Solarize=void 0;const Solarize=function(o){var e=o.data,r=o.width,t=o.height,n=r*4,a=t;do{var l=(a-1)*n,u=r;do{var f=l+(u-1)*4,d=e[f],h=e[f+1],y=e[f+2];d>127&&(d=255-d),h>127&&(h=255-h),y>127&&(y=255-y),e[f]=d,e[f+1]=h,e[f+2]=y}while(--u)}while(--a)};Solarize$1.Solarize=Solarize;var Threshold$1={};Object.defineProperty(Threshold$1,"__esModule",{value:!0});Threshold$1.Threshold=void 0;const Factory_1=Factory,Node_1=Node$1,Validators_1=Validators,Threshold=function(o){var e=this.threshold()*255,r=o.data,t=r.length,n;for(n=0;n<t;n+=1)r[n]=r[n]<e?0:255};Threshold$1.Threshold=Threshold;Factory_1.Factory.addGetterSetter(Node_1.Node,"threshold",.5,(0,Validators_1.getNumberValidator)(),Factory_1.Factory.afterSetFilter);Object.defineProperty(_FullInternals,"__esModule",{value:!0});_FullInternals.Konva=void 0;const _CoreInternals_1=_CoreInternals,Arc_1=Arc$1,Arrow_1=Arrow$1,Circle_1=Circle$1,Ellipse_1=Ellipse$1,Image_1=Image$4,Label_1=Label$1,Line_1=Line$2,Path_1=Path$1,Rect_1=Rect$2,RegularPolygon_1=RegularPolygon$1,Ring_1=Ring$1,Sprite_1=Sprite$1,Star_1=Star$1,Text_1=Text$2,TextPath_1=TextPath$1,Transformer_1=Transformer$1,Wedge_1=Wedge$1,Blur_1=Blur$1,Brighten_1=Brighten$1,Contrast_1=Contrast$1,Emboss_1=Emboss$1,Enhance_1=Enhance$1,Grayscale_1=Grayscale$1,HSL_1=HSL$1,HSV_1=HSV$1,Invert_1=Invert$1,Kaleidoscope_1=Kaleidoscope$1,Mask_1=Mask$1,Noise_1=Noise$1,Pixelate_1=Pixelate$1,Posterize_1=Posterize$1,RGB_1=RGB$1,RGBA_1=RGBA$1,Sepia_1=Sepia$1,Solarize_1=Solarize$1,Threshold_1=Threshold$1;_FullInternals.Konva=_CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva,{Arc:Arc_1.Arc,Arrow:Arrow_1.Arrow,Circle:Circle_1.Circle,Ellipse:Ellipse_1.Ellipse,Image:Image_1.Image,Label:Label_1.Label,Tag:Label_1.Tag,Line:Line_1.Line,Path:Path_1.Path,Rect:Rect_1.Rect,RegularPolygon:RegularPolygon_1.RegularPolygon,Ring:Ring_1.Ring,Sprite:Sprite_1.Sprite,Star:Star_1.Star,Text:Text_1.Text,TextPath:TextPath_1.TextPath,Transformer:Transformer_1.Transformer,Wedge:Wedge_1.Wedge,Filters:{Blur:Blur_1.Blur,Brighten:Brighten_1.Brighten,Contrast:Contrast_1.Contrast,Emboss:Emboss_1.Emboss,Enhance:Enhance_1.Enhance,Grayscale:Grayscale_1.Grayscale,HSL:HSL_1.HSL,HSV:HSV_1.HSV,Invert:Invert_1.Invert,Kaleidoscope:Kaleidoscope_1.Kaleidoscope,Mask:Mask_1.Mask,Noise:Noise_1.Noise,Pixelate:Pixelate_1.Pixelate,Posterize:Posterize_1.Posterize,RGB:RGB_1.RGB,RGBA:RGBA_1.RGBA,Sepia:Sepia_1.Sepia,Solarize:Solarize_1.Solarize,Threshold:Threshold_1.Threshold}});var lib=lib$1.exports;Object.defineProperty(lib,"__esModule",{value:!0});const _FullInternals_1=_FullInternals;lib$1.exports=_FullInternals_1.Konva;var Core={exports:{}};(function(o,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var r=_CoreInternals;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return r.Konva}});const t=_CoreInternals;o.exports=t.Konva})(Core,Core.exports);var CoreExports=Core.exports;const Konva=getDefaultExportFromCjs(CoreExports);var reactReconciler={exports:{}},scheduler={exports:{}},scheduler_production_min={};/**
73
+ * @license React
74
+ * scheduler.production.min.js
75
+ *
76
+ * Copyright (c) Facebook, Inc. and its affiliates.
77
+ *
78
+ * This source code is licensed under the MIT license found in the
79
+ * LICENSE file in the root directory of this source tree.
80
+ */var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(o){function e(U,$){var I=U.length;U.push($);e:for(;0<I;){var B=I-1>>>1,X=U[B];if(0<n(X,$))U[B]=$,U[I]=X,I=B;else break e}}function r(U){return U.length===0?null:U[0]}function t(U){if(U.length===0)return null;var $=U[0],I=U.pop();if(I!==$){U[0]=I;e:for(var B=0,X=U.length,Q=X>>>1;B<Q;){var J=2*(B+1)-1,ne=U[J],ae=J+1,Z=U[ae];if(0>n(ne,I))ae<X&&0>n(Z,ne)?(U[B]=Z,U[ae]=I,B=ae):(U[B]=ne,U[J]=I,B=J);else if(ae<X&&0>n(Z,I))U[B]=Z,U[ae]=I,B=ae;else break e}}return $}function n(U,$){var I=U.sortIndex-$.sortIndex;return I!==0?I:U.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;o.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();o.unstable_now=function(){return l.now()-u}}var f=[],d=[],h=1,y=null,E=3,p=!1,_=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(U){for(var $=r(d);$!==null;){if($.callback===null)t(d);else if($.startTime<=U)t(d),$.sortIndex=$.expirationTime,e(f,$);else break;$=r(d)}}function A(U){if(g=!1,S(U),!_)if(r(f)!==null)_=!0,q(T);else{var $=r(d);$!==null&&z(A,$.startTime-U)}}function T(U,$){_=!1,g&&(g=!1,C(O),O=-1),p=!0;var I=E;try{for(S($),y=r(f);y!==null&&(!(y.expirationTime>$)||U&&!F());){var B=y.callback;if(typeof B=="function"){y.callback=null,E=y.priorityLevel;var X=B(y.expirationTime<=$);$=o.unstable_now(),typeof X=="function"?y.callback=X:y===r(f)&&t(f),S($)}else t(f);y=r(f)}if(y!==null)var Q=!0;else{var J=r(d);J!==null&&z(A,J.startTime-$),Q=!1}return Q}finally{y=null,E=I,p=!1}}var w=!1,P=null,O=-1,k=5,D=-1;function F(){return!(o.unstable_now()-D<k)}function G(){if(P!==null){var U=o.unstable_now();D=U;var $=!0;try{$=P(!0,U)}finally{$?V():(w=!1,P=null)}}else w=!1}var V;if(typeof R=="function")V=function(){R(G)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ee=W.port2;W.port1.onmessage=G,V=function(){ee.postMessage(null)}}else V=function(){x(G,0)};function q(U){P=U,w||(w=!0,V())}function z(U,$){O=x(function(){U(o.unstable_now())},$)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(U){U.callback=null},o.unstable_continueExecution=function(){_||p||(_=!0,q(T))},o.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<U?Math.floor(1e3/U):5},o.unstable_getCurrentPriorityLevel=function(){return E},o.unstable_getFirstCallbackNode=function(){return r(f)},o.unstable_next=function(U){switch(E){case 1:case 2:case 3:var $=3;break;default:$=E}var I=E;E=$;try{return U()}finally{E=I}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(U,$){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var I=E;E=U;try{return $()}finally{E=I}},o.unstable_scheduleCallback=function(U,$,I){var B=o.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?B+I:B):I=B,U){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=I+X,U={id:h++,callback:$,priorityLevel:U,startTime:I,expirationTime:X,sortIndex:-1},I>B?(U.sortIndex=I,e(d,U),r(f)===null&&U===r(d)&&(g?(C(O),O=-1):g=!0,z(A,I-B))):(U.sortIndex=X,e(f,U),_||p||(_=!0,q(T))),U},o.unstable_shouldYield=F,o.unstable_wrapCallback=function(U){var $=E;return function(){var I=E;E=$;try{return U.apply(this,arguments)}finally{E=I}}}}(scheduler_production_min)),scheduler_production_min}var scheduler_development={};/**
81
+ * @license React
82
+ * scheduler.development.js
83
+ *
84
+ * Copyright (c) Facebook, Inc. and its affiliates.
85
+ *
86
+ * This source code is licensed under the MIT license found in the
87
+ * LICENSE file in the root directory of this source tree.
88
+ */var hasRequiredScheduler_development;function requireScheduler_development(){return hasRequiredScheduler_development||(hasRequiredScheduler_development=1,function(o){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=!1,r=!1,t=5;function n(pe,me){var ye=pe.length;pe.push(me),u(pe,me,ye)}function a(pe){return pe.length===0?null:pe[0]}function l(pe){if(pe.length===0)return null;var me=pe[0],ye=pe.pop();return ye!==me&&(pe[0]=ye,f(pe,ye,0)),me}function u(pe,me,ye){for(var De=ye;De>0;){var Be=De-1>>>1,Ce=pe[Be];if(d(Ce,me)>0)pe[Be]=me,pe[De]=Ce,De=Be;else return}}function f(pe,me,ye){for(var De=ye,Be=pe.length,Ce=Be>>>1;De<Ce;){var Ee=(De+1)*2-1,Pe=pe[Ee],Xe=Ee+1,nt=pe[Xe];if(d(Pe,me)<0)Xe<Be&&d(nt,Pe)<0?(pe[De]=nt,pe[Xe]=me,De=Xe):(pe[De]=Pe,pe[Ee]=me,De=Ee);else if(Xe<Be&&d(nt,me)<0)pe[De]=nt,pe[Xe]=me,De=Xe;else return}}function d(pe,me){var ye=pe.sortIndex-me.sortIndex;return ye!==0?ye:pe.id-me.id}var h=1,y=2,E=3,p=4,_=5;function g(pe,me){}var x=typeof performance=="object"&&typeof performance.now=="function";if(x){var C=performance;o.unstable_now=function(){return C.now()}}else{var R=Date,S=R.now();o.unstable_now=function(){return R.now()-S}}var A=1073741823,T=-1,w=250,P=5e3,O=1e4,k=A,D=[],F=[],G=1,V=null,W=E,ee=!1,q=!1,z=!1,U=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(pe){for(var me=a(F);me!==null;){if(me.callback===null)l(F);else if(me.startTime<=pe)l(F),me.sortIndex=me.expirationTime,n(D,me);else return;me=a(F)}}function X(pe){if(z=!1,B(pe),!q)if(a(D)!==null)q=!0,Ze(Q);else{var me=a(F);me!==null&&rt(X,me.startTime-pe)}}function Q(pe,me){q=!1,z&&(z=!1,qt()),ee=!0;var ye=W;try{var De;if(!r)return J(pe,me)}finally{V=null,W=ye,ee=!1}}function J(pe,me){var ye=me;for(B(ye),V=a(D);V!==null&&!e&&!(V.expirationTime>ye&&(!pe||dt()));){var De=V.callback;if(typeof De=="function"){V.callback=null,W=V.priorityLevel;var Be=V.expirationTime<=ye,Ce=De(Be);ye=o.unstable_now(),typeof Ce=="function"?V.callback=Ce:V===a(D)&&l(D),B(ye)}else l(D);V=a(D)}if(V!==null)return!0;var Ee=a(F);return Ee!==null&&rt(X,Ee.startTime-ye),!1}function ne(pe,me){switch(pe){case h:case y:case E:case p:case _:break;default:pe=E}var ye=W;W=pe;try{return me()}finally{W=ye}}function ae(pe){var me;switch(W){case h:case y:case E:me=E;break;default:me=W;break}var ye=W;W=me;try{return pe()}finally{W=ye}}function Z(pe){var me=W;return function(){var ye=W;W=me;try{return pe.apply(this,arguments)}finally{W=ye}}}function se(pe,me,ye){var De=o.unstable_now(),Be;if(typeof ye=="object"&&ye!==null){var Ce=ye.delay;typeof Ce=="number"&&Ce>0?Be=De+Ce:Be=De}else Be=De;var Ee;switch(pe){case h:Ee=T;break;case y:Ee=w;break;case _:Ee=k;break;case p:Ee=O;break;case E:default:Ee=P;break}var Pe=Be+Ee,Xe={id:G++,callback:me,priorityLevel:pe,startTime:Be,expirationTime:Pe,sortIndex:-1};return Be>De?(Xe.sortIndex=Be,n(F,Xe),a(D)===null&&Xe===a(F)&&(z?qt():z=!0,rt(X,Be-De))):(Xe.sortIndex=Pe,n(D,Xe),!q&&!ee&&(q=!0,Ze(Q))),Xe}function oe(){}function fe(){!q&&!ee&&(q=!0,Ze(Q))}function de(){return a(D)}function ce(pe){pe.callback=null}function Se(){return W}var Le=!1,Ne=null,He=-1,Ke=t,Qe=-1;function dt(){var pe=o.unstable_now()-Qe;return!(pe<Ke)}function yt(){}function ut(pe){if(pe<0||pe>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}pe>0?Ke=Math.floor(1e3/pe):Ke=t}var ft=function(){if(Ne!==null){var pe=o.unstable_now();Qe=pe;var me=!0,ye=!0;try{ye=Ne(me,pe)}finally{ye?Xt():(Le=!1,Ne=null)}}else Le=!1},Xt;if(typeof I=="function")Xt=function(){I(ft)};else if(typeof MessageChannel<"u"){var kt=new MessageChannel,Ge=kt.port2;kt.port1.onmessage=ft,Xt=function(){Ge.postMessage(null)}}else Xt=function(){U(ft,0)};function Ze(pe){Ne=pe,Le||(Le=!0,Xt())}function rt(pe,me){He=U(function(){pe(o.unstable_now())},me)}function qt(){$(He),He=-1}var We=yt,at=null;o.unstable_IdlePriority=_,o.unstable_ImmediatePriority=h,o.unstable_LowPriority=p,o.unstable_NormalPriority=E,o.unstable_Profiling=at,o.unstable_UserBlockingPriority=y,o.unstable_cancelCallback=ce,o.unstable_continueExecution=fe,o.unstable_forceFrameRate=ut,o.unstable_getCurrentPriorityLevel=Se,o.unstable_getFirstCallbackNode=de,o.unstable_next=ae,o.unstable_pauseExecution=oe,o.unstable_requestPaint=We,o.unstable_runWithPriority=ne,o.unstable_scheduleCallback=se,o.unstable_shouldYield=dt,o.unstable_wrapCallback=Z,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(scheduler_development)),scheduler_development}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,process.env.NODE_ENV==="production"?scheduler.exports=requireScheduler_production_min():scheduler.exports=requireScheduler_development()),scheduler.exports}/**
89
+ * @license React
90
+ * react-reconciler.production.min.js
91
+ *
92
+ * Copyright (c) Facebook, Inc. and its affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */var reactReconciler_production_min,hasRequiredReactReconciler_production_min;function requireReactReconciler_production_min(){return hasRequiredReactReconciler_production_min||(hasRequiredReactReconciler_production_min=1,reactReconciler_production_min=function(e){var r={},t=React$2,n=requireScheduler(),a=Object.assign;function l(v){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+v,j=1;j<arguments.length;j++)b+="&args[]="+encodeURIComponent(arguments[j]);return"Minified React error #"+v+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),_=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),T=Symbol.iterator;function w(v){return v===null||typeof v!="object"?null:(v=T&&v[T]||v["@@iterator"],typeof v=="function"?v:null)}function P(v){if(v==null)return null;if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case h:return"Fragment";case d:return"Portal";case E:return"Profiler";case y:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case _:return(v.displayName||"Context")+".Consumer";case p:return(v._context.displayName||"Context")+".Provider";case g:var b=v.render;return v=v.displayName,v||(v=b.displayName||b.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case R:return b=v.displayName||null,b!==null?b:P(v.type)||"Memo";case S:b=v._payload,v=v._init;try{return P(v(b))}catch{}}return null}function O(v){var b=v.type;switch(v.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return v=b.render,v=v.displayName||v.name||"",b.displayName||(v!==""?"ForwardRef("+v+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return P(b);case 8:return b===y?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b}return null}function k(v){var b=v,j=v;if(v.alternate)for(;b.return;)b=b.return;else{v=b;do b=v,b.flags&4098&&(j=b.return),v=b.return;while(v)}return b.tag===3?j:null}function D(v){if(k(v)!==v)throw Error(l(188))}function F(v){var b=v.alternate;if(!b){if(b=k(v),b===null)throw Error(l(188));return b!==v?null:v}for(var j=v,H=b;;){var K=j.return;if(K===null)break;var te=K.alternate;if(te===null){if(H=K.return,H!==null){j=H;continue}break}if(K.child===te.child){for(te=K.child;te;){if(te===j)return D(K),v;if(te===H)return D(K),b;te=te.sibling}throw Error(l(188))}if(j.return!==H.return)j=K,H=te;else{for(var ue=!1,_e=K.child;_e;){if(_e===j){ue=!0,j=K,H=te;break}if(_e===H){ue=!0,H=K,j=te;break}_e=_e.sibling}if(!ue){for(_e=te.child;_e;){if(_e===j){ue=!0,j=te,H=K;break}if(_e===H){ue=!0,H=te,j=K;break}_e=_e.sibling}if(!ue)throw Error(l(189))}}if(j.alternate!==H)throw Error(l(190))}if(j.tag!==3)throw Error(l(188));return j.stateNode.current===j?v:b}function G(v){return v=F(v),v!==null?V(v):null}function V(v){if(v.tag===5||v.tag===6)return v;for(v=v.child;v!==null;){var b=V(v);if(b!==null)return b;v=v.sibling}return null}function W(v){if(v.tag===5||v.tag===6)return v;for(v=v.child;v!==null;){if(v.tag!==4){var b=W(v);if(b!==null)return b}v=v.sibling}return null}var ee=Array.isArray,q=e.getPublicInstance,z=e.getRootHostContext,U=e.getChildHostContext,$=e.prepareForCommit,I=e.resetAfterCommit,B=e.createInstance,X=e.appendInitialChild,Q=e.finalizeInitialChildren,J=e.prepareUpdate,ne=e.shouldSetTextContent,ae=e.createTextInstance,Z=e.scheduleTimeout,se=e.cancelTimeout,oe=e.noTimeout,fe=e.isPrimaryRenderer,de=e.supportsMutation,ce=e.supportsPersistence,Se=e.supportsHydration,Le=e.getInstanceFromNode,Ne=e.preparePortalMount,He=e.getCurrentEventPriority,Ke=e.detachDeletedInstance,Qe=e.supportsMicrotasks,dt=e.scheduleMicrotask,yt=e.supportsTestSelectors,ut=e.findFiberRoot,ft=e.getBoundingRect,Xt=e.getTextContent,kt=e.isHiddenSubtree,Ge=e.matchAccessibilityRole,Ze=e.setFocusIfFocusable,rt=e.setupIntersectionObserver,qt=e.appendChild,We=e.appendChildToContainer,at=e.commitTextUpdate,pe=e.commitMount,me=e.commitUpdate,ye=e.insertBefore,De=e.insertInContainerBefore,Be=e.removeChild,Ce=e.removeChildFromContainer,Ee=e.resetTextContent,Pe=e.hideInstance,Xe=e.hideTextInstance,nt=e.unhideInstance,it=e.unhideTextInstance,Ht=e.clearContainer,Sr=e.cloneInstance,Qt=e.createContainerChildSet,Nt=e.appendChildToContainerChildSet,Er=e.finalizeContainerChildren,dn=e.replaceContainerChildren,An=e.cloneHiddenInstance,Br=e.cloneHiddenTextInstance,ui=e.canHydrateInstance,Ii=e.canHydrateTextInstance,Da=e.canHydrateSuspenseInstance,Po=e.isSuspenseInstancePending,Ws=e.isSuspenseInstanceFallback,La=e.getSuspenseInstanceFallbackErrorDetails,qr=e.registerSuspenseInstanceRetry,ge=e.getNextHydratableSibling,ze=e.getFirstHydratableChild,Je=e.getFirstHydratableChildWithinContainer,xt=e.getFirstHydratableChildWithinSuspenseInstance,Vt=e.hydrateInstance,It=e.hydrateTextInstance,Lt=e.hydrateSuspenseInstance,Dt=e.getNextHydratableInstanceAfterSuspenseInstance,br=e.commitHydratedContainer,lr=e.commitHydratedSuspenseInstance,ur=e.clearSuspenseBoundary,_r=e.clearSuspenseBoundaryFromContainer,sa=e.shouldDeleteUnhydratedTailInstances,Fa=e.didNotMatchHydratedContainerTextInstance,ci=e.didNotMatchHydratedTextInstance,Vl;function ls(v){if(Vl===void 0)try{throw Error()}catch(j){var b=j.stack.trim().match(/\n( *(at )?)/);Vl=b&&b[1]||""}return`
97
+ `+Vl+v}var wo=!1;function Ys(v,b){if(!v||wo)return"";wo=!0;var j=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error()},Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(Ve){var H=Ve}Reflect.construct(v,[],b)}else{try{b.call()}catch(Ve){H=Ve}v.call(b.prototype)}else{try{throw Error()}catch(Ve){H=Ve}v()}}catch(Ve){if(Ve&&H&&typeof Ve.stack=="string"){for(var K=Ve.stack.split(`
98
+ `),te=H.stack.split(`
99
+ `),ue=K.length-1,_e=te.length-1;1<=ue&&0<=_e&&K[ue]!==te[_e];)_e--;for(;1<=ue&&0<=_e;ue--,_e--)if(K[ue]!==te[_e]){if(ue!==1||_e!==1)do if(ue--,_e--,0>_e||K[ue]!==te[_e]){var Oe=`
100
+ `+K[ue].replace(" at new "," at ");return v.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",v.displayName)),Oe}while(1<=ue&&0<=_e);break}}}finally{wo=!1,Error.prepareStackTrace=j}return(v=v?v.displayName||v.name:"")?ls(v):""}var vc=Object.prototype.hasOwnProperty,Wl=[],ja=-1;function oa(v){return{current:v}}function $t(v){0>ja||(v.current=Wl[ja],Wl[ja]=null,ja--)}function ir(v,b){ja++,Wl[ja]=v.current,v.current=b}var la={},fn=oa(la),Pn=oa(!1),Ma=la;function us(v,b){var j=v.type.contextTypes;if(!j)return la;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===b)return H.__reactInternalMemoizedMaskedChildContext;var K={},te;for(te in j)K[te]=b[te];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=b,v.__reactInternalMemoizedMaskedChildContext=K),K}function hn(v){return v=v.childContextTypes,v!=null}function Ks(){$t(Pn),$t(fn)}function Yl(v,b,j){if(fn.current!==la)throw Error(l(168));ir(fn,b),ir(Pn,j)}function No(v,b,j){var H=v.stateNode;if(b=b.childContextTypes,typeof H.getChildContext!="function")return j;H=H.getChildContext();for(var K in H)if(!(K in b))throw Error(l(108,O(v)||"Unknown",K));return a({},j,H)}function Xs(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||la,Ma=fn.current,ir(fn,v),ir(Pn,Pn.current),!0}function Kl(v,b,j){var H=v.stateNode;if(!H)throw Error(l(169));j?(v=No(v,b,Ma),H.__reactInternalMemoizedMergedChildContext=v,$t(Pn),$t(fn),ir(fn,v)):$t(Pn),ir(Pn,j)}var di=Math.clz32?Math.clz32:vf,Xl=Math.log,Oo=Math.LN2;function vf(v){return v>>>=0,v===0?32:31-(Xl(v)/Oo|0)|0}var pn=64,Ia=4194304;function mn(v){switch(v&-v){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function ko(v,b){var j=v.pendingLanes;if(j===0)return 0;var H=0,K=v.suspendedLanes,te=v.pingedLanes,ue=j&268435455;if(ue!==0){var _e=ue&~K;_e!==0?H=mn(_e):(te&=ue,te!==0&&(H=mn(te)))}else ue=j&~K,ue!==0?H=mn(ue):te!==0&&(H=mn(te));if(H===0)return 0;if(b!==0&&b!==H&&!(b&K)&&(K=H&-H,te=b&-b,K>=te||K===16&&(te&4194240)!==0))return b;if(H&4&&(H|=j&16),b=v.entangledLanes,b!==0)for(v=v.entanglements,b&=H;0<b;)j=31-di(b),K=1<<j,H|=v[j],b&=~K;return H}function yf(v,b){switch(v){case 1:case 2:case 4:return b+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _f(v,b){for(var j=v.suspendedLanes,H=v.pingedLanes,K=v.expirationTimes,te=v.pendingLanes;0<te;){var ue=31-di(te),_e=1<<ue,Oe=K[ue];Oe===-1?(!(_e&j)||_e&H)&&(K[ue]=yf(_e,b)):Oe<=b&&(v.expiredLanes|=_e),te&=~_e}}function ql(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function yc(){var v=pn;return pn<<=1,!(pn&4194240)&&(pn=64),v}function Ql(v){for(var b=[],j=0;31>j;j++)b.push(v);return b}function Ti(v,b,j){v.pendingLanes|=b,b!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,b=31-di(b),v[b]=j}function xf(v,b){var j=v.pendingLanes&~b;v.pendingLanes=b,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=b,v.mutableReadLanes&=b,v.entangledLanes&=b,b=v.entanglements;var H=v.eventTimes;for(v=v.expirationTimes;0<j;){var K=31-di(j),te=1<<K;b[K]=0,H[K]=-1,v[K]=-1,j&=~te}}function Jl(v,b){var j=v.entangledLanes|=b;for(v=v.entanglements;j;){var H=31-di(j),K=1<<H;K&b|v[H]&b&&(v[H]|=b),j&=~K}}var Jt=0;function cs(v){return v&=-v,1<v?4<v?v&268435455?16:536870912:4:1}var Zl=n.unstable_scheduleCallback,_c=n.unstable_cancelCallback,Sf=n.unstable_shouldYield,Ef=n.unstable_requestPaint,zr=n.unstable_now,eu=n.unstable_ImmediatePriority,bf=n.unstable_UserBlockingPriority,tu=n.unstable_NormalPriority,Rf=n.unstable_IdlePriority,Do=null,Ci=null;function Tf(v){if(Ci&&typeof Ci.onCommitFiberRoot=="function")try{Ci.onCommitFiberRoot(Do,v,void 0,(v.current.flags&128)===128)}catch{}}function xc(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var fi=typeof Object.is=="function"?Object.is:xc,$i=null,Lo=!1,ru=!1;function Sc(v){$i===null?$i=[v]:$i.push(v)}function Cf(v){Lo=!0,Sc(v)}function hi(){if(!ru&&$i!==null){ru=!0;var v=0,b=Jt;try{var j=$i;for(Jt=1;v<j.length;v++){var H=j[v];do H=H(!0);while(H!==null)}$i=null,Lo=!1}catch(K){throw $i!==null&&($i=$i.slice(v+1)),Zl(eu,hi),K}finally{Jt=b,ru=!1}}return null}var $a=[],ds=0,fs=null,qs=0,Un=[],Zn=0,Ua=null,Ui=1,Ai="";function Gi(v,b){$a[ds++]=qs,$a[ds++]=fs,fs=v,qs=b}function Ec(v,b,j){Un[Zn++]=Ui,Un[Zn++]=Ai,Un[Zn++]=Ua,Ua=v;var H=Ui;v=Ai;var K=32-di(H)-1;H&=~(1<<K),j+=1;var te=32-di(b)+K;if(30<te){var ue=K-K%5;te=(H&(1<<ue)-1).toString(32),H>>=ue,K-=ue,Ui=1<<32-di(b)+K|j<<K|H,Ai=te+v}else Ui=1<<te|j<<K|H,Ai=v}function nu(v){v.return!==null&&(Gi(v,1),Ec(v,1,0))}function hs(v){for(;v===fs;)fs=$a[--ds],$a[ds]=null,qs=$a[--ds],$a[ds]=null;for(;v===Ua;)Ua=Un[--Zn],Un[Zn]=null,Ai=Un[--Zn],Un[Zn]=null,Ui=Un[--Zn],Un[Zn]=null}var Gn=null,ei=null,yr=!1,Qs=!1,pi=null;function bc(v,b){var j=ii(5,null,null,0);j.elementType="DELETED",j.stateNode=b,j.return=v,b=v.deletions,b===null?(v.deletions=[j],v.flags|=16):b.push(j)}function Rc(v,b){switch(v.tag){case 5:return b=ui(b,v.type,v.pendingProps),b!==null?(v.stateNode=b,Gn=v,ei=ze(b),!0):!1;case 6:return b=Ii(b,v.pendingProps),b!==null?(v.stateNode=b,Gn=v,ei=null,!0):!1;case 13:if(b=Da(b),b!==null){var j=Ua!==null?{id:Ui,overflow:Ai}:null;return v.memoizedState={dehydrated:b,treeContext:j,retryLane:1073741824},j=ii(18,null,null,0),j.stateNode=b,j.return=v,v.child=j,Gn=v,ei=null,!0}return!1;default:return!1}}function iu(v){return(v.mode&1)!==0&&(v.flags&128)===0}function au(v){if(yr){var b=ei;if(b){var j=b;if(!Rc(v,b)){if(iu(v))throw Error(l(418));b=ge(j);var H=Gn;b&&Rc(v,b)?bc(H,j):(v.flags=v.flags&-4097|2,yr=!1,Gn=v)}}else{if(iu(v))throw Error(l(418));v.flags=v.flags&-4097|2,yr=!1,Gn=v}}}function Tc(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;Gn=v}function Fo(v){if(!Se||v!==Gn)return!1;if(!yr)return Tc(v),yr=!0,!1;if(v.tag!==3&&(v.tag!==5||sa(v.type)&&!ne(v.type,v.memoizedProps))){var b=ei;if(b){if(iu(v))throw Cc(),Error(l(418));for(;b;)bc(v,b),b=ge(b)}}if(Tc(v),v.tag===13){if(!Se)throw Error(l(316));if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(l(317));ei=Dt(v)}else ei=Gn?ge(v.stateNode):null;return!0}function Cc(){for(var v=ei;v;)v=ge(v)}function ps(){Se&&(ei=Gn=null,Qs=yr=!1)}function su(v){pi===null?pi=[v]:pi.push(v)}var Af=u.ReactCurrentBatchConfig;function jo(v,b){if(fi(v,b))return!0;if(typeof v!="object"||v===null||typeof b!="object"||b===null)return!1;var j=Object.keys(v),H=Object.keys(b);if(j.length!==H.length)return!1;for(H=0;H<j.length;H++){var K=j[H];if(!vc.call(b,K)||!fi(v[K],b[K]))return!1}return!0}function Pf(v){switch(v.tag){case 5:return ls(v.type);case 16:return ls("Lazy");case 13:return ls("Suspense");case 19:return ls("SuspenseList");case 0:case 2:case 15:return v=Ys(v.type,!1),v;case 11:return v=Ys(v.type.render,!1),v;case 1:return v=Ys(v.type,!0),v;default:return""}}function mi(v,b){if(v&&v.defaultProps){b=a({},b),v=v.defaultProps;for(var j in v)b[j]===void 0&&(b[j]=v[j]);return b}return b}var Mo=oa(null),Io=null,ms=null,ou=null;function lu(){ou=ms=Io=null}function Ac(v,b,j){fe?(ir(Mo,b._currentValue),b._currentValue=j):(ir(Mo,b._currentValue2),b._currentValue2=j)}function uu(v){var b=Mo.current;$t(Mo),fe?v._currentValue=b:v._currentValue2=b}function cu(v,b,j){for(;v!==null;){var H=v.alternate;if((v.childLanes&b)!==b?(v.childLanes|=b,H!==null&&(H.childLanes|=b)):H!==null&&(H.childLanes&b)!==b&&(H.childLanes|=b),v===j)break;v=v.return}}function gs(v,b){Io=v,ou=ms=null,v=v.dependencies,v!==null&&v.firstContext!==null&&(v.lanes&b&&(Qr=!0),v.firstContext=null)}function gn(v){var b=fe?v._currentValue:v._currentValue2;if(ou!==v)if(v={context:v,memoizedValue:b,next:null},ms===null){if(Io===null)throw Error(l(308));ms=v,Io.dependencies={lanes:0,firstContext:v}}else ms=ms.next=v;return b}var ua=null;function $o(v){ua===null?ua=[v]:ua.push(v)}function du(v,b,j,H){var K=b.interleaved;return K===null?(j.next=j,$o(b)):(j.next=K.next,K.next=j),b.interleaved=j,gi(v,H)}function gi(v,b){v.lanes|=b;var j=v.alternate;for(j!==null&&(j.lanes|=b),j=v,v=v.return;v!==null;)v.childLanes|=b,j=v.alternate,j!==null&&(j.childLanes|=b),j=v,v=v.return;return j.tag===3?j.stateNode:null}var Bi=!1;function Uo(v){v.updateQueue={baseState:v.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fu(v,b){v=v.updateQueue,b.updateQueue===v&&(b.updateQueue={baseState:v.baseState,firstBaseUpdate:v.firstBaseUpdate,lastBaseUpdate:v.lastBaseUpdate,shared:v.shared,effects:v.effects})}function Pi(v,b){return{eventTime:v,lane:b,tag:0,payload:null,callback:null,next:null}}function ca(v,b,j){var H=v.updateQueue;if(H===null)return null;if(H=H.shared,Mt&2){var K=H.pending;return K===null?b.next=b:(b.next=K.next,K.next=b),H.pending=b,gi(v,j)}return K=H.interleaved,K===null?(b.next=b,$o(H)):(b.next=K.next,K.next=b),H.interleaved=b,gi(v,j)}function Go(v,b,j){if(b=b.updateQueue,b!==null&&(b=b.shared,(j&4194240)!==0)){var H=b.lanes;H&=v.pendingLanes,j|=H,b.lanes=j,Jl(v,j)}}function Bo(v,b){var j=v.updateQueue,H=v.alternate;if(H!==null&&(H=H.updateQueue,j===H)){var K=null,te=null;if(j=j.firstBaseUpdate,j!==null){do{var ue={eventTime:j.eventTime,lane:j.lane,tag:j.tag,payload:j.payload,callback:j.callback,next:null};te===null?K=te=ue:te=te.next=ue,j=j.next}while(j!==null);te===null?K=te=b:te=te.next=b}else K=te=b;j={baseState:H.baseState,firstBaseUpdate:K,lastBaseUpdate:te,shared:H.shared,effects:H.effects},v.updateQueue=j;return}v=j.lastBaseUpdate,v===null?j.firstBaseUpdate=b:v.next=b,j.lastBaseUpdate=b}function vs(v,b,j,H){var K=v.updateQueue;Bi=!1;var te=K.firstBaseUpdate,ue=K.lastBaseUpdate,_e=K.shared.pending;if(_e!==null){K.shared.pending=null;var Oe=_e,Ve=Oe.next;Oe.next=null,ue===null?te=Ve:ue.next=Ve,ue=Oe;var ht=v.alternate;ht!==null&&(ht=ht.updateQueue,_e=ht.lastBaseUpdate,_e!==ue&&(_e===null?ht.firstBaseUpdate=Ve:_e.next=Ve,ht.lastBaseUpdate=Oe))}if(te!==null){var _t=K.baseState;ue=0,ht=Ve=Oe=null,_e=te;do{var tt=_e.lane,gr=_e.eventTime;if((H&tt)===tt){ht!==null&&(ht=ht.next={eventTime:gr,lane:0,tag:_e.tag,payload:_e.payload,callback:_e.callback,next:null});e:{var dr=v,ar=_e;switch(tt=b,gr=j,ar.tag){case 1:if(dr=ar.payload,typeof dr=="function"){_t=dr.call(gr,_t,tt);break e}_t=dr;break e;case 3:dr.flags=dr.flags&-65537|128;case 0:if(dr=ar.payload,tt=typeof dr=="function"?dr.call(gr,_t,tt):dr,tt==null)break e;_t=a({},_t,tt);break e;case 2:Bi=!0}}_e.callback!==null&&_e.lane!==0&&(v.flags|=64,tt=K.effects,tt===null?K.effects=[_e]:tt.push(_e))}else gr={eventTime:gr,lane:tt,tag:_e.tag,payload:_e.payload,callback:_e.callback,next:null},ht===null?(Ve=ht=gr,Oe=_t):ht=ht.next=gr,ue|=tt;if(_e=_e.next,_e===null){if(_e=K.shared.pending,_e===null)break;tt=_e,_e=tt.next,tt.next=null,K.lastBaseUpdate=tt,K.shared.pending=null}}while(1);if(ht===null&&(Oe=_t),K.baseState=Oe,K.firstBaseUpdate=Ve,K.lastBaseUpdate=ht,b=K.shared.interleaved,b!==null){K=b;do ue|=K.lane,K=K.next;while(K!==b)}else te===null&&(K.shared.lanes=0);Xa|=ue,v.lanes=ue,v.memoizedState=_t}}function zi(v,b,j){if(v=b.effects,b.effects=null,v!==null)for(b=0;b<v.length;b++){var H=v[b],K=H.callback;if(K!==null){if(H.callback=null,H=j,typeof K!="function")throw Error(l(191,K));K.call(H)}}}var zo=new t.Component().refs;function ys(v,b,j,H){b=v.memoizedState,j=j(H,b),j=j==null?b:a({},b,j),v.memoizedState=j,v.lanes===0&&(v.updateQueue.baseState=j)}var Ho={isMounted:function(v){return(v=v._reactInternals)?k(v)===v:!1},enqueueSetState:function(v,b,j){v=v._reactInternals;var H=rn(),K=nn(v),te=Pi(H,K);te.payload=b,j!=null&&(te.callback=j),b=ca(v,te,K),b!==null&&(Wn(b,v,K,H),Go(b,v,K))},enqueueReplaceState:function(v,b,j){v=v._reactInternals;var H=rn(),K=nn(v),te=Pi(H,K);te.tag=1,te.payload=b,j!=null&&(te.callback=j),b=ca(v,te,K),b!==null&&(Wn(b,v,K,H),Go(b,v,K))},enqueueForceUpdate:function(v,b){v=v._reactInternals;var j=rn(),H=nn(v),K=Pi(j,H);K.tag=2,b!=null&&(K.callback=b),b=ca(v,K,H),b!==null&&(Wn(b,v,H,j),Go(b,v,H))}};function Vo(v,b,j,H,K,te,ue){return v=v.stateNode,typeof v.shouldComponentUpdate=="function"?v.shouldComponentUpdate(H,te,ue):b.prototype&&b.prototype.isPureReactComponent?!jo(j,H)||!jo(K,te):!0}function Pc(v,b,j){var H=!1,K=la,te=b.contextType;return typeof te=="object"&&te!==null?te=gn(te):(K=hn(b)?Ma:fn.current,H=b.contextTypes,te=(H=H!=null)?us(v,K):la),b=new b(j,te),v.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Ho,v.stateNode=b,b._reactInternals=v,H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=K,v.__reactInternalMemoizedMaskedChildContext=te),b}function Wo(v,b,j,H){v=b.state,typeof b.componentWillReceiveProps=="function"&&b.componentWillReceiveProps(j,H),typeof b.UNSAFE_componentWillReceiveProps=="function"&&b.UNSAFE_componentWillReceiveProps(j,H),b.state!==v&&Ho.enqueueReplaceState(b,b.state,null)}function hu(v,b,j,H){var K=v.stateNode;K.props=j,K.state=v.memoizedState,K.refs=zo,Uo(v);var te=b.contextType;typeof te=="object"&&te!==null?K.context=gn(te):(te=hn(b)?Ma:fn.current,K.context=us(v,te)),K.state=v.memoizedState,te=b.getDerivedStateFromProps,typeof te=="function"&&(ys(v,b,te,j),K.state=v.memoizedState),typeof b.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(b=K.state,typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount(),b!==K.state&&Ho.enqueueReplaceState(K,K.state,null),vs(v,j,K,H),K.state=v.memoizedState),typeof K.componentDidMount=="function"&&(v.flags|=4194308)}function Ga(v,b,j){if(v=j.ref,v!==null&&typeof v!="function"&&typeof v!="object"){if(j._owner){if(j=j._owner,j){if(j.tag!==1)throw Error(l(309));var H=j.stateNode}if(!H)throw Error(l(147,v));var K=H,te=""+v;return b!==null&&b.ref!==null&&typeof b.ref=="function"&&b.ref._stringRef===te?b.ref:(b=function(ue){var _e=K.refs;_e===zo&&(_e=K.refs={}),ue===null?delete _e[te]:_e[te]=ue},b._stringRef=te,b)}if(typeof v!="string")throw Error(l(284));if(!j._owner)throw Error(l(290,v))}return v}function Js(v,b){throw v=Object.prototype.toString.call(b),Error(l(31,v==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":v))}function pu(v){var b=v._init;return b(v._payload)}function mu(v){function b(Ae,xe){if(v){var ke=Ae.deletions;ke===null?(Ae.deletions=[xe],Ae.flags|=16):ke.push(xe)}}function j(Ae,xe){if(!v)return null;for(;xe!==null;)b(Ae,xe),xe=xe.sibling;return null}function H(Ae,xe){for(Ae=new Map;xe!==null;)xe.key!==null?Ae.set(xe.key,xe):Ae.set(xe.index,xe),xe=xe.sibling;return Ae}function K(Ae,xe){return Ae=Di(Ae,xe),Ae.index=0,Ae.sibling=null,Ae}function te(Ae,xe,ke){return Ae.index=ke,v?(ke=Ae.alternate,ke!==null?(ke=ke.index,ke<xe?(Ae.flags|=2,xe):ke):(Ae.flags|=2,xe)):(Ae.flags|=1048576,xe)}function ue(Ae){return v&&Ae.alternate===null&&(Ae.flags|=2),Ae}function _e(Ae,xe,ke,st){return xe===null||xe.tag!==6?(xe=vo(ke,Ae.mode,st),xe.return=Ae,xe):(xe=K(xe,ke),xe.return=Ae,xe)}function Oe(Ae,xe,ke,st){var gt=ke.type;return gt===h?ht(Ae,xe,ke.props.children,st,ke.key):xe!==null&&(xe.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===S&&pu(gt)===xe.type)?(st=K(xe,ke.props),st.ref=Ga(Ae,xe,ke),st.return=Ae,st):(st=go(ke.type,ke.key,ke.props,null,Ae.mode,st),st.ref=Ga(Ae,xe,ke),st.return=Ae,st)}function Ve(Ae,xe,ke,st){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==ke.containerInfo||xe.stateNode.implementation!==ke.implementation?(xe=yo(ke,Ae.mode,st),xe.return=Ae,xe):(xe=K(xe,ke.children||[]),xe.return=Ae,xe)}function ht(Ae,xe,ke,st,gt){return xe===null||xe.tag!==7?(xe=Sa(ke,Ae.mode,st,gt),xe.return=Ae,xe):(xe=K(xe,ke),xe.return=Ae,xe)}function _t(Ae,xe,ke){if(typeof xe=="string"&&xe!==""||typeof xe=="number")return xe=vo(""+xe,Ae.mode,ke),xe.return=Ae,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case f:return ke=go(xe.type,xe.key,xe.props,null,Ae.mode,ke),ke.ref=Ga(Ae,null,xe),ke.return=Ae,ke;case d:return xe=yo(xe,Ae.mode,ke),xe.return=Ae,xe;case S:var st=xe._init;return _t(Ae,st(xe._payload),ke)}if(ee(xe)||w(xe))return xe=Sa(xe,Ae.mode,ke,null),xe.return=Ae,xe;Js(Ae,xe)}return null}function tt(Ae,xe,ke,st){var gt=xe!==null?xe.key:null;if(typeof ke=="string"&&ke!==""||typeof ke=="number")return gt!==null?null:_e(Ae,xe,""+ke,st);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case f:return ke.key===gt?Oe(Ae,xe,ke,st):null;case d:return ke.key===gt?Ve(Ae,xe,ke,st):null;case S:return gt=ke._init,tt(Ae,xe,gt(ke._payload),st)}if(ee(ke)||w(ke))return gt!==null?null:ht(Ae,xe,ke,st,null);Js(Ae,ke)}return null}function gr(Ae,xe,ke,st,gt){if(typeof st=="string"&&st!==""||typeof st=="number")return Ae=Ae.get(ke)||null,_e(xe,Ae,""+st,gt);if(typeof st=="object"&&st!==null){switch(st.$$typeof){case f:return Ae=Ae.get(st.key===null?ke:st.key)||null,Oe(xe,Ae,st,gt);case d:return Ae=Ae.get(st.key===null?ke:st.key)||null,Ve(xe,Ae,st,gt);case S:var Ot=st._init;return gr(Ae,xe,ke,Ot(st._payload),gt)}if(ee(st)||w(st))return Ae=Ae.get(ke)||null,ht(xe,Ae,st,gt,null);Js(xe,st)}return null}function dr(Ae,xe,ke,st){for(var gt=null,Ot=null,At=xe,Bt=xe=0,xr=null;At!==null&&Bt<ke.length;Bt++){At.index>Bt?(xr=At,At=null):xr=At.sibling;var zt=tt(Ae,At,ke[Bt],st);if(zt===null){At===null&&(At=xr);break}v&&At&&zt.alternate===null&&b(Ae,At),xe=te(zt,xe,Bt),Ot===null?gt=zt:Ot.sibling=zt,Ot=zt,At=xr}if(Bt===ke.length)return j(Ae,At),yr&&Gi(Ae,Bt),gt;if(At===null){for(;Bt<ke.length;Bt++)At=_t(Ae,ke[Bt],st),At!==null&&(xe=te(At,xe,Bt),Ot===null?gt=At:Ot.sibling=At,Ot=At);return yr&&Gi(Ae,Bt),gt}for(At=H(Ae,At);Bt<ke.length;Bt++)xr=gr(At,Ae,Bt,ke[Bt],st),xr!==null&&(v&&xr.alternate!==null&&At.delete(xr.key===null?Bt:xr.key),xe=te(xr,xe,Bt),Ot===null?gt=xr:Ot.sibling=xr,Ot=xr);return v&&At.forEach(function(ai){return b(Ae,ai)}),yr&&Gi(Ae,Bt),gt}function ar(Ae,xe,ke,st){var gt=w(ke);if(typeof gt!="function")throw Error(l(150));if(ke=gt.call(ke),ke==null)throw Error(l(151));for(var Ot=gt=null,At=xe,Bt=xe=0,xr=null,zt=ke.next();At!==null&&!zt.done;Bt++,zt=ke.next()){At.index>Bt?(xr=At,At=null):xr=At.sibling;var ai=tt(Ae,At,zt.value,st);if(ai===null){At===null&&(At=xr);break}v&&At&&ai.alternate===null&&b(Ae,At),xe=te(ai,xe,Bt),Ot===null?gt=ai:Ot.sibling=ai,Ot=ai,At=xr}if(zt.done)return j(Ae,At),yr&&Gi(Ae,Bt),gt;if(At===null){for(;!zt.done;Bt++,zt=ke.next())zt=_t(Ae,zt.value,st),zt!==null&&(xe=te(zt,xe,Bt),Ot===null?gt=zt:Ot.sibling=zt,Ot=zt);return yr&&Gi(Ae,Bt),gt}for(At=H(Ae,At);!zt.done;Bt++,zt=ke.next())zt=gr(At,Ae,Bt,zt.value,st),zt!==null&&(v&&zt.alternate!==null&&At.delete(zt.key===null?Bt:zt.key),xe=te(zt,xe,Bt),Ot===null?gt=zt:Ot.sibling=zt,Ot=zt);return v&&At.forEach(function(rs){return b(Ae,rs)}),yr&&Gi(Ae,Bt),gt}function nr(Ae,xe,ke,st){if(typeof ke=="object"&&ke!==null&&ke.type===h&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case f:e:{for(var gt=ke.key,Ot=xe;Ot!==null;){if(Ot.key===gt){if(gt=ke.type,gt===h){if(Ot.tag===7){j(Ae,Ot.sibling),xe=K(Ot,ke.props.children),xe.return=Ae,Ae=xe;break e}}else if(Ot.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===S&&pu(gt)===Ot.type){j(Ae,Ot.sibling),xe=K(Ot,ke.props),xe.ref=Ga(Ae,Ot,ke),xe.return=Ae,Ae=xe;break e}j(Ae,Ot);break}else b(Ae,Ot);Ot=Ot.sibling}ke.type===h?(xe=Sa(ke.props.children,Ae.mode,st,ke.key),xe.return=Ae,Ae=xe):(st=go(ke.type,ke.key,ke.props,null,Ae.mode,st),st.ref=Ga(Ae,xe,ke),st.return=Ae,Ae=st)}return ue(Ae);case d:e:{for(Ot=ke.key;xe!==null;){if(xe.key===Ot)if(xe.tag===4&&xe.stateNode.containerInfo===ke.containerInfo&&xe.stateNode.implementation===ke.implementation){j(Ae,xe.sibling),xe=K(xe,ke.children||[]),xe.return=Ae,Ae=xe;break e}else{j(Ae,xe);break}else b(Ae,xe);xe=xe.sibling}xe=yo(ke,Ae.mode,st),xe.return=Ae,Ae=xe}return ue(Ae);case S:return Ot=ke._init,nr(Ae,xe,Ot(ke._payload),st)}if(ee(ke))return dr(Ae,xe,ke,st);if(w(ke))return ar(Ae,xe,ke,st);Js(Ae,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"?(ke=""+ke,xe!==null&&xe.tag===6?(j(Ae,xe.sibling),xe=K(xe,ke),xe.return=Ae,Ae=xe):(j(Ae,xe),xe=vo(ke,Ae.mode,st),xe.return=Ae,Ae=xe),ue(Ae)):j(Ae,xe)}return nr}var Hi=mu(!0),ti=mu(!1),Ba={},yn=oa(Ba),Bn=oa(Ba),zn=oa(Ba);function mr(v){if(v===Ba)throw Error(l(174));return v}function Fr(v,b){ir(zn,b),ir(Bn,v),ir(yn,Ba),v=z(b),$t(yn),ir(yn,v)}function da(){$t(yn),$t(Bn),$t(zn)}function wn(v){var b=mr(zn.current),j=mr(yn.current);b=U(j,v.type,b),j!==b&&(ir(Bn,v),ir(yn,b))}function vi(v){Bn.current===v&&($t(yn),$t(Bn))}var Zt=oa(0);function _s(v){for(var b=v;b!==null;){if(b.tag===13){var j=b.memoizedState;if(j!==null&&(j=j.dehydrated,j===null||Po(j)||Ws(j)))return b}else if(b.tag===19&&b.memoizedProps.revealOrder!==void 0){if(b.flags&128)return b}else if(b.child!==null){b.child.return=b,b=b.child;continue}if(b===v)break;for(;b.sibling===null;){if(b.return===null||b.return===v)return null;b=b.return}b.sibling.return=b.return,b=b.sibling}return null}var fa=[];function Yo(){for(var v=0;v<fa.length;v++){var b=fa[v];fe?b._workInProgressVersionPrimary=null:b._workInProgressVersionSecondary=null}fa.length=0}var Vi=u.ReactCurrentDispatcher,xs=u.ReactCurrentBatchConfig,vn=0,hr=null,Rr=null,jr=null,Zs=!1,ha=!1,Ss=0,wf=0;function Tr(){throw Error(l(321))}function Ko(v,b){if(b===null)return!1;for(var j=0;j<b.length&&j<v.length;j++)if(!fi(v[j],b[j]))return!1;return!0}function Et(v,b,j,H,K,te){if(vn=te,hr=b,b.memoizedState=null,b.updateQueue=null,b.lanes=0,Vi.current=v===null||v.memoizedState===null?xu:Su,v=j(H,K),ha){te=0;do{if(ha=!1,Ss=0,25<=te)throw Error(l(301));te+=1,jr=Rr=null,b.updateQueue=null,Vi.current=Eu,v=j(H,K)}while(ha)}if(Vi.current=Yi,b=Rr!==null&&Rr.next!==null,vn=0,jr=Rr=hr=null,Zs=!1,b)throw Error(l(300));return v}function Ut(){var v=Ss!==0;return Ss=0,v}function Ft(){var v={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jr===null?hr.memoizedState=jr=v:jr=jr.next=v,jr}function tr(){if(Rr===null){var v=hr.alternate;v=v!==null?v.memoizedState:null}else v=Rr.next;var b=jr===null?hr.memoizedState:jr.next;if(b!==null)jr=b,Rr=v;else{if(v===null)throw Error(l(310));Rr=v,v={memoizedState:Rr.memoizedState,baseState:Rr.baseState,baseQueue:Rr.baseQueue,queue:Rr.queue,next:null},jr===null?hr.memoizedState=jr=v:jr=jr.next=v}return jr}function Nn(v,b){return typeof b=="function"?b(v):b}function Xo(v){var b=tr(),j=b.queue;if(j===null)throw Error(l(311));j.lastRenderedReducer=v;var H=Rr,K=H.baseQueue,te=j.pending;if(te!==null){if(K!==null){var ue=K.next;K.next=te.next,te.next=ue}H.baseQueue=K=te,j.pending=null}if(K!==null){te=K.next,H=H.baseState;var _e=ue=null,Oe=null,Ve=te;do{var ht=Ve.lane;if((vn&ht)===ht)Oe!==null&&(Oe=Oe.next={lane:0,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null}),H=Ve.hasEagerState?Ve.eagerState:v(H,Ve.action);else{var _t={lane:ht,action:Ve.action,hasEagerState:Ve.hasEagerState,eagerState:Ve.eagerState,next:null};Oe===null?(_e=Oe=_t,ue=H):Oe=Oe.next=_t,hr.lanes|=ht,Xa|=ht}Ve=Ve.next}while(Ve!==null&&Ve!==te);Oe===null?ue=H:Oe.next=_e,fi(H,b.memoizedState)||(Qr=!0),b.memoizedState=H,b.baseState=ue,b.baseQueue=Oe,j.lastRenderedState=H}if(v=j.interleaved,v!==null){K=v;do te=K.lane,hr.lanes|=te,Xa|=te,K=K.next;while(K!==v)}else K===null&&(j.lanes=0);return[b.memoizedState,j.dispatch]}function gu(v){var b=tr(),j=b.queue;if(j===null)throw Error(l(311));j.lastRenderedReducer=v;var H=j.dispatch,K=j.pending,te=b.memoizedState;if(K!==null){j.pending=null;var ue=K=K.next;do te=v(te,ue.action),ue=ue.next;while(ue!==K);fi(te,b.memoizedState)||(Qr=!0),b.memoizedState=te,b.baseQueue===null&&(b.baseState=te),j.lastRenderedState=te}return[te,H]}function wc(){}function Nc(v,b){var j=hr,H=tr(),K=b(),te=!fi(H.memoizedState,K);if(te&&(H.memoizedState=K,Qr=!0),H=H.queue,eo(Mr.bind(null,j,H,v),[v]),H.getSnapshot!==b||te||jr!==null&&jr.memoizedState.tag&1){if(j.flags|=2048,yi(9,$e.bind(null,j,H,K,b),void 0,null),Vr===null)throw Error(l(349));vn&30||qo(j,b,K)}return K}function qo(v,b,j){v.flags|=16384,v={getSnapshot:b,value:j},b=hr.updateQueue,b===null?(b={lastEffect:null,stores:null},hr.updateQueue=b,b.stores=[v]):(j=b.stores,j===null?b.stores=[v]:j.push(v))}function $e(v,b,j,H){b.value=j,b.getSnapshot=H,Tt(b)&&za(v)}function Mr(v,b,j){return j(function(){Tt(b)&&za(v)})}function Tt(v){var b=v.getSnapshot;v=v.value;try{var j=b();return!fi(v,j)}catch{return!0}}function za(v){var b=gi(v,1);b!==null&&Wn(b,v,1,-1)}function wi(v){var b=Ft();return typeof v=="function"&&(v=v()),b.memoizedState=b.baseState=v,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:v},b.queue=v,v=v.dispatch=_u.bind(null,hr,v),[b.memoizedState,v]}function yi(v,b,j,H){return v={tag:v,create:b,destroy:j,deps:H,next:null},b=hr.updateQueue,b===null?(b={lastEffect:null,stores:null},hr.updateQueue=b,b.lastEffect=v.next=v):(j=b.lastEffect,j===null?b.lastEffect=v.next=v:(H=j.next,j.next=v,v.next=H,b.lastEffect=v)),v}function _i(){return tr().memoizedState}function pa(v,b,j,H){var K=Ft();hr.flags|=v,K.memoizedState=yi(1|b,j,void 0,H===void 0?null:H)}function Wi(v,b,j,H){var K=tr();H=H===void 0?null:H;var te=void 0;if(Rr!==null){var ue=Rr.memoizedState;if(te=ue.destroy,H!==null&&Ko(H,ue.deps)){K.memoizedState=yi(b,j,te,H);return}}hr.flags|=v,K.memoizedState=yi(1|b,j,te,H)}function Es(v,b){return pa(8390656,8,v,b)}function eo(v,b){return Wi(2048,8,v,b)}function Qo(v,b){return Wi(4,2,v,b)}function Jo(v,b){return Wi(4,4,v,b)}function Zo(v,b){if(typeof b=="function")return v=v(),b(v),function(){b(null)};if(b!=null)return v=v(),b.current=v,function(){b.current=null}}function el(v,b,j){return j=j!=null?j.concat([v]):null,Wi(4,4,Zo.bind(null,b,v),j)}function to(){}function tl(v,b){var j=tr();b=b===void 0?null:b;var H=j.memoizedState;return H!==null&&b!==null&&Ko(b,H[1])?H[0]:(j.memoizedState=[v,b],v)}function rl(v,b){var j=tr();b=b===void 0?null:b;var H=j.memoizedState;return H!==null&&b!==null&&Ko(b,H[1])?H[0]:(v=v(),j.memoizedState=[v,b],v)}function nl(v,b,j){return vn&21?(fi(j,b)||(j=yc(),hr.lanes|=j,Xa|=j,v.baseState=!0),b):(v.baseState&&(v.baseState=!1,Qr=!0),v.memoizedState=j)}function vu(v,b){var j=Jt;Jt=j!==0&&4>j?j:4,v(!0);var H=xs.transition;xs.transition={};try{v(!1),b()}finally{Jt=j,xs.transition=H}}function il(){return tr().memoizedState}function yu(v,b,j){var H=nn(v);if(j={lane:H,action:j,hasEagerState:!1,eagerState:null,next:null},al(v))sl(b,j);else if(j=du(v,b,j,H),j!==null){var K=rn();Wn(j,v,H,K),ro(j,b,H)}}function _u(v,b,j){var H=nn(v),K={lane:H,action:j,hasEagerState:!1,eagerState:null,next:null};if(al(v))sl(b,K);else{var te=v.alternate;if(v.lanes===0&&(te===null||te.lanes===0)&&(te=b.lastRenderedReducer,te!==null))try{var ue=b.lastRenderedState,_e=te(ue,j);if(K.hasEagerState=!0,K.eagerState=_e,fi(_e,ue)){var Oe=b.interleaved;Oe===null?(K.next=K,$o(b)):(K.next=Oe.next,Oe.next=K),b.interleaved=K;return}}catch{}finally{}j=du(v,b,K,H),j!==null&&(K=rn(),Wn(j,v,H,K),ro(j,b,H))}}function al(v){var b=v.alternate;return v===hr||b!==null&&b===hr}function sl(v,b){ha=Zs=!0;var j=v.pending;j===null?b.next=b:(b.next=j.next,j.next=b),v.pending=b}function ro(v,b,j){if(j&4194240){var H=b.lanes;H&=v.pendingLanes,j|=H,b.lanes=j,Jl(v,j)}}var Yi={readContext:gn,useCallback:Tr,useContext:Tr,useEffect:Tr,useImperativeHandle:Tr,useInsertionEffect:Tr,useLayoutEffect:Tr,useMemo:Tr,useReducer:Tr,useRef:Tr,useState:Tr,useDebugValue:Tr,useDeferredValue:Tr,useTransition:Tr,useMutableSource:Tr,useSyncExternalStore:Tr,useId:Tr,unstable_isNewReconciler:!1},xu={readContext:gn,useCallback:function(v,b){return Ft().memoizedState=[v,b===void 0?null:b],v},useContext:gn,useEffect:Es,useImperativeHandle:function(v,b,j){return j=j!=null?j.concat([v]):null,pa(4194308,4,Zo.bind(null,b,v),j)},useLayoutEffect:function(v,b){return pa(4194308,4,v,b)},useInsertionEffect:function(v,b){return pa(4,2,v,b)},useMemo:function(v,b){var j=Ft();return b=b===void 0?null:b,v=v(),j.memoizedState=[v,b],v},useReducer:function(v,b,j){var H=Ft();return b=j!==void 0?j(b):b,H.memoizedState=H.baseState=b,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:b},H.queue=v,v=v.dispatch=yu.bind(null,hr,v),[H.memoizedState,v]},useRef:function(v){var b=Ft();return v={current:v},b.memoizedState=v},useState:wi,useDebugValue:to,useDeferredValue:function(v){return Ft().memoizedState=v},useTransition:function(){var v=wi(!1),b=v[0];return v=vu.bind(null,v[1]),Ft().memoizedState=v,[b,v]},useMutableSource:function(){},useSyncExternalStore:function(v,b,j){var H=hr,K=Ft();if(yr){if(j===void 0)throw Error(l(407));j=j()}else{if(j=b(),Vr===null)throw Error(l(349));vn&30||qo(H,b,j)}K.memoizedState=j;var te={value:j,getSnapshot:b};return K.queue=te,Es(Mr.bind(null,H,te,v),[v]),H.flags|=2048,yi(9,$e.bind(null,H,te,j,b),void 0,null),j},useId:function(){var v=Ft(),b=Vr.identifierPrefix;if(yr){var j=Ai,H=Ui;j=(H&~(1<<32-di(H)-1)).toString(32)+j,b=":"+b+"R"+j,j=Ss++,0<j&&(b+="H"+j.toString(32)),b+=":"}else j=wf++,b=":"+b+"r"+j.toString(32)+":";return v.memoizedState=b},unstable_isNewReconciler:!1},Su={readContext:gn,useCallback:tl,useContext:gn,useEffect:eo,useImperativeHandle:el,useInsertionEffect:Qo,useLayoutEffect:Jo,useMemo:rl,useReducer:Xo,useRef:_i,useState:function(){return Xo(Nn)},useDebugValue:to,useDeferredValue:function(v){var b=tr();return nl(b,Rr.memoizedState,v)},useTransition:function(){var v=Xo(Nn)[0],b=tr().memoizedState;return[v,b]},useMutableSource:wc,useSyncExternalStore:Nc,useId:il,unstable_isNewReconciler:!1},Eu={readContext:gn,useCallback:tl,useContext:gn,useEffect:eo,useImperativeHandle:el,useInsertionEffect:Qo,useLayoutEffect:Jo,useMemo:rl,useReducer:gu,useRef:_i,useState:function(){return gu(Nn)},useDebugValue:to,useDeferredValue:function(v){var b=tr();return Rr===null?b.memoizedState=v:nl(b,Rr.memoizedState,v)},useTransition:function(){var v=gu(Nn)[0],b=tr().memoizedState;return[v,b]},useMutableSource:wc,useSyncExternalStore:Nc,useId:il,unstable_isNewReconciler:!1};function ma(v,b){try{var j="",H=b;do j+=Pf(H),H=H.return;while(H);var K=j}catch(te){K=`
101
+ Error generating stack: `+te.message+`
102
+ `+te.stack}return{value:v,source:b,stack:K,digest:null}}function ol(v,b,j){return{value:v,source:null,stack:j??null,digest:b??null}}function Ha(v,b){try{console.error(b.value)}catch(j){setTimeout(function(){throw j})}}var Oc=typeof WeakMap=="function"?WeakMap:Map;function bs(v,b,j){j=Pi(-1,j),j.tag=3,j.payload={element:null};var H=b.value;return j.callback=function(){_l||(_l=!0,Lu=H),Ha(v,b)},j}function ga(v,b,j){j=Pi(-1,j),j.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H=="function"){var K=b.value;j.payload=function(){return H(K)},j.callback=function(){Ha(v,b)}}var te=v.stateNode;return te!==null&&typeof te.componentDidCatch=="function"&&(j.callback=function(){Ha(v,b),typeof H!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var ue=b.stack;this.componentDidCatch(b.value,{componentStack:ue!==null?ue:""})}),j}function On(v,b,j){var H=v.pingCache;if(H===null){H=v.pingCache=new Oc;var K=new Set;H.set(b,K)}else K=H.get(b),K===void 0&&(K=new Set,H.set(b,K));K.has(j)||(K.add(j),v=Ei.bind(null,v,b,j),b.then(v,v))}function kc(v){do{var b;if((b=v.tag===13)&&(b=v.memoizedState,b=b!==null?b.dehydrated!==null:!0),b)return v;v=v.return}while(v!==null);return null}function cr(v,b,j,H,K){return v.mode&1?(v.flags|=65536,v.lanes=K,v):(v===b?v.flags|=65536:(v.flags|=128,j.flags|=131072,j.flags&=-52805,j.tag===1&&(j.alternate===null?j.tag=17:(b=Pi(-1,1),b.tag=2,ca(j,b,1))),j.lanes|=1),v)}var ll=u.ReactCurrentOwner,Qr=!1;function Ir(v,b,j,H){b.child=v===null?ti(b,null,j,H):Hi(b,v.child,j,H)}function no(v,b,j,H,K){j=j.render;var te=b.ref;return gs(b,K),H=Et(v,b,j,H,te,K),j=Ut(),v!==null&&!Qr?(b.updateQueue=v.updateQueue,b.flags&=-2053,v.lanes&=~K,Cr(v,b,K)):(yr&&j&&nu(b),b.flags|=1,Ir(v,b,H,K),b.child)}function Dc(v,b,j,H,K){if(v===null){var te=j.type;return typeof te=="function"&&!Rl(te)&&te.defaultProps===void 0&&j.compare===null&&j.defaultProps===void 0?(b.tag=15,b.type=te,Lc(v,b,te,H,K)):(v=go(j.type,null,H,b,b.mode,K),v.ref=b.ref,v.return=b,b.child=v)}if(te=v.child,!(v.lanes&K)){var ue=te.memoizedProps;if(j=j.compare,j=j!==null?j:jo,j(ue,H)&&v.ref===b.ref)return Cr(v,b,K)}return b.flags|=1,v=Di(te,H),v.ref=b.ref,v.return=b,b.child=v}function Lc(v,b,j,H,K){if(v!==null){var te=v.memoizedProps;if(jo(te,H)&&v.ref===b.ref)if(Qr=!1,b.pendingProps=H=te,(v.lanes&K)!==0)v.flags&131072&&(Qr=!0);else return b.lanes=v.lanes,Cr(v,b,K)}return io(v,b,j,H,K)}function Fc(v,b,j){var H=b.pendingProps,K=H.children,te=v!==null?v.memoizedState:null;if(H.mode==="hidden")if(!(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},ir(Os,Vn),Vn|=j;else{if(!(j&1073741824))return v=te!==null?te.baseLanes|j:j,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:v,cachePool:null,transitions:null},b.updateQueue=null,ir(Os,Vn),Vn|=v,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null},H=te!==null?te.baseLanes:j,ir(Os,Vn),Vn|=H}else te!==null?(H=te.baseLanes|j,b.memoizedState=null):H=j,ir(Os,Vn),Vn|=H;return Ir(v,b,K,j),b.child}function jc(v,b){var j=b.ref;(v===null&&j!==null||v!==null&&v.ref!==j)&&(b.flags|=512,b.flags|=2097152)}function io(v,b,j,H,K){var te=hn(j)?Ma:fn.current;return te=us(b,te),gs(b,K),j=Et(v,b,j,H,te,K),H=Ut(),v!==null&&!Qr?(b.updateQueue=v.updateQueue,b.flags&=-2053,v.lanes&=~K,Cr(v,b,K)):(yr&&H&&nu(b),b.flags|=1,Ir(v,b,j,K),b.child)}function Mc(v,b,j,H,K){if(hn(j)){var te=!0;Xs(b)}else te=!1;if(gs(b,K),b.stateNode===null)Ts(v,b),Pc(b,j,H),hu(b,j,H,K),H=!0;else if(v===null){var ue=b.stateNode,_e=b.memoizedProps;ue.props=_e;var Oe=ue.context,Ve=j.contextType;typeof Ve=="object"&&Ve!==null?Ve=gn(Ve):(Ve=hn(j)?Ma:fn.current,Ve=us(b,Ve));var ht=j.getDerivedStateFromProps,_t=typeof ht=="function"||typeof ue.getSnapshotBeforeUpdate=="function";_t||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||(_e!==H||Oe!==Ve)&&Wo(b,ue,H,Ve),Bi=!1;var tt=b.memoizedState;ue.state=tt,vs(b,H,ue,K),Oe=b.memoizedState,_e!==H||tt!==Oe||Pn.current||Bi?(typeof ht=="function"&&(ys(b,j,ht,H),Oe=b.memoizedState),(_e=Bi||Vo(b,j,_e,H,tt,Oe,Ve))?(_t||typeof ue.UNSAFE_componentWillMount!="function"&&typeof ue.componentWillMount!="function"||(typeof ue.componentWillMount=="function"&&ue.componentWillMount(),typeof ue.UNSAFE_componentWillMount=="function"&&ue.UNSAFE_componentWillMount()),typeof ue.componentDidMount=="function"&&(b.flags|=4194308)):(typeof ue.componentDidMount=="function"&&(b.flags|=4194308),b.memoizedProps=H,b.memoizedState=Oe),ue.props=H,ue.state=Oe,ue.context=Ve,H=_e):(typeof ue.componentDidMount=="function"&&(b.flags|=4194308),H=!1)}else{ue=b.stateNode,fu(v,b),_e=b.memoizedProps,Ve=b.type===b.elementType?_e:mi(b.type,_e),ue.props=Ve,_t=b.pendingProps,tt=ue.context,Oe=j.contextType,typeof Oe=="object"&&Oe!==null?Oe=gn(Oe):(Oe=hn(j)?Ma:fn.current,Oe=us(b,Oe));var gr=j.getDerivedStateFromProps;(ht=typeof gr=="function"||typeof ue.getSnapshotBeforeUpdate=="function")||typeof ue.UNSAFE_componentWillReceiveProps!="function"&&typeof ue.componentWillReceiveProps!="function"||(_e!==_t||tt!==Oe)&&Wo(b,ue,H,Oe),Bi=!1,tt=b.memoizedState,ue.state=tt,vs(b,H,ue,K);var dr=b.memoizedState;_e!==_t||tt!==dr||Pn.current||Bi?(typeof gr=="function"&&(ys(b,j,gr,H),dr=b.memoizedState),(Ve=Bi||Vo(b,j,Ve,H,tt,dr,Oe)||!1)?(ht||typeof ue.UNSAFE_componentWillUpdate!="function"&&typeof ue.componentWillUpdate!="function"||(typeof ue.componentWillUpdate=="function"&&ue.componentWillUpdate(H,dr,Oe),typeof ue.UNSAFE_componentWillUpdate=="function"&&ue.UNSAFE_componentWillUpdate(H,dr,Oe)),typeof ue.componentDidUpdate=="function"&&(b.flags|=4),typeof ue.getSnapshotBeforeUpdate=="function"&&(b.flags|=1024)):(typeof ue.componentDidUpdate!="function"||_e===v.memoizedProps&&tt===v.memoizedState||(b.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===v.memoizedProps&&tt===v.memoizedState||(b.flags|=1024),b.memoizedProps=H,b.memoizedState=dr),ue.props=H,ue.state=dr,ue.context=Oe,H=Ve):(typeof ue.componentDidUpdate!="function"||_e===v.memoizedProps&&tt===v.memoizedState||(b.flags|=4),typeof ue.getSnapshotBeforeUpdate!="function"||_e===v.memoizedProps&&tt===v.memoizedState||(b.flags|=1024),H=!1)}return ao(v,b,j,H,te,K)}function ao(v,b,j,H,K,te){jc(v,b);var ue=(b.flags&128)!==0;if(!H&&!ue)return K&&Kl(b,j,!1),Cr(v,b,te);H=b.stateNode,ll.current=b;var _e=ue&&typeof j.getDerivedStateFromError!="function"?null:H.render();return b.flags|=1,v!==null&&ue?(b.child=Hi(b,v.child,null,te),b.child=Hi(b,null,_e,te)):Ir(v,b,_e,te),b.memoizedState=H.state,K&&Kl(b,j,!0),b.child}function bu(v){var b=v.stateNode;b.pendingContext?Yl(v,b.pendingContext,b.pendingContext!==b.context):b.context&&Yl(v,b.context,!1),Fr(v,b.containerInfo)}function Ic(v,b,j,H,K){return ps(),su(K),b.flags|=256,Ir(v,b,j,H),b.child}var Ru={dehydrated:null,treeContext:null,retryLane:0};function Rs(v){return{baseLanes:v,cachePool:null,transitions:null}}function $c(v,b,j){var H=b.pendingProps,K=Zt.current,te=!1,ue=(b.flags&128)!==0,_e;if((_e=ue)||(_e=v!==null&&v.memoizedState===null?!1:(K&2)!==0),_e?(te=!0,b.flags&=-129):(v===null||v.memoizedState!==null)&&(K|=1),ir(Zt,K&1),v===null)return au(b),v=b.memoizedState,v!==null&&(v=v.dehydrated,v!==null)?(b.mode&1?Ws(v)?b.lanes=8:b.lanes=1073741824:b.lanes=1,null):(ue=H.children,v=H.fallback,te?(H=b.mode,te=b.child,ue={mode:"hidden",children:ue},!(H&1)&&te!==null?(te.childLanes=0,te.pendingProps=ue):te=Fs(ue,H,0,null),v=Sa(v,H,j,null),te.return=b,v.return=b,te.sibling=v,b.child=te,b.child.memoizedState=Rs(j),b.memoizedState=Ru,v):ul(b,ue));if(K=v.memoizedState,K!==null&&(_e=K.dehydrated,_e!==null))return Nf(v,b,ue,H,_e,K,j);if(te){te=H.fallback,ue=b.mode,K=v.child,_e=K.sibling;var Oe={mode:"hidden",children:H.children};return!(ue&1)&&b.child!==K?(H=b.child,H.childLanes=0,H.pendingProps=Oe,b.deletions=null):(H=Di(K,Oe),H.subtreeFlags=K.subtreeFlags&14680064),_e!==null?te=Di(_e,te):(te=Sa(te,ue,j,null),te.flags|=2),te.return=b,H.return=b,H.sibling=te,b.child=H,H=te,te=b.child,ue=v.child.memoizedState,ue=ue===null?Rs(j):{baseLanes:ue.baseLanes|j,cachePool:null,transitions:ue.transitions},te.memoizedState=ue,te.childLanes=v.childLanes&~j,b.memoizedState=Ru,H}return te=v.child,v=te.sibling,H=Di(te,{mode:"visible",children:H.children}),!(b.mode&1)&&(H.lanes=j),H.return=b,H.sibling=null,v!==null&&(j=b.deletions,j===null?(b.deletions=[v],b.flags|=16):j.push(v)),b.child=H,b.memoizedState=null,H}function ul(v,b){return b=Fs({mode:"visible",children:b},v.mode,0,null),b.return=v,v.child=b}function so(v,b,j,H){return H!==null&&su(H),Hi(b,v.child,null,j),v=ul(b,b.pendingProps.children),v.flags|=2,b.memoizedState=null,v}function Nf(v,b,j,H,K,te,ue){if(j)return b.flags&256?(b.flags&=-257,H=ol(Error(l(422))),so(v,b,ue,H)):b.memoizedState!==null?(b.child=v.child,b.flags|=128,null):(te=H.fallback,K=b.mode,H=Fs({mode:"visible",children:H.children},K,0,null),te=Sa(te,K,ue,null),te.flags|=2,H.return=b,te.return=b,H.sibling=te,b.child=H,b.mode&1&&Hi(b,v.child,null,ue),b.child.memoizedState=Rs(ue),b.memoizedState=Ru,te);if(!(b.mode&1))return so(v,b,ue,null);if(Ws(K))return H=La(K).digest,te=Error(l(419)),H=ol(te,H,void 0),so(v,b,ue,H);if(j=(ue&v.childLanes)!==0,Qr||j){if(H=Vr,H!==null){switch(ue&-ue){case 4:K=2;break;case 16:K=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:K=32;break;case 536870912:K=268435456;break;default:K=0}K=K&(H.suspendedLanes|ue)?0:K,K!==0&&K!==te.retryLane&&(te.retryLane=K,gi(v,K),Wn(H,v,K,-1))}return qi(),H=ol(Error(l(421))),so(v,b,ue,H)}return Po(K)?(b.flags|=128,b.child=v.child,b=xa.bind(null,v),qr(K,b),null):(v=te.treeContext,Se&&(ei=xt(K),Gn=b,yr=!0,pi=null,Qs=!1,v!==null&&(Un[Zn++]=Ui,Un[Zn++]=Ai,Un[Zn++]=Ua,Ui=v.id,Ai=v.overflow,Ua=b)),b=ul(b,H.children),b.flags|=4096,b)}function va(v,b,j){v.lanes|=b;var H=v.alternate;H!==null&&(H.lanes|=b),cu(v.return,b,j)}function Va(v,b,j,H,K){var te=v.memoizedState;te===null?v.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:H,tail:j,tailMode:K}:(te.isBackwards=b,te.rendering=null,te.renderingStartTime=0,te.last=H,te.tail=j,te.tailMode=K)}function ya(v,b,j){var H=b.pendingProps,K=H.revealOrder,te=H.tail;if(Ir(v,b,H.children,j),H=Zt.current,H&2)H=H&1|2,b.flags|=128;else{if(v!==null&&v.flags&128)e:for(v=b.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&va(v,j,b);else if(v.tag===19)va(v,j,b);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===b)break e;for(;v.sibling===null;){if(v.return===null||v.return===b)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}H&=1}if(ir(Zt,H),!(b.mode&1))b.memoizedState=null;else switch(K){case"forwards":for(j=b.child,K=null;j!==null;)v=j.alternate,v!==null&&_s(v)===null&&(K=j),j=j.sibling;j=K,j===null?(K=b.child,b.child=null):(K=j.sibling,j.sibling=null),Va(b,!1,K,j,te);break;case"backwards":for(j=null,K=b.child,b.child=null;K!==null;){if(v=K.alternate,v!==null&&_s(v)===null){b.child=K;break}v=K.sibling,K.sibling=j,j=K,K=v}Va(b,!0,j,null,te);break;case"together":Va(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Ts(v,b){!(b.mode&1)&&v!==null&&(v.alternate=null,b.alternate=null,b.flags|=2)}function Cr(v,b,j){if(v!==null&&(b.dependencies=v.dependencies),Xa|=b.lanes,!(j&b.childLanes))return null;if(v!==null&&b.child!==v.child)throw Error(l(153));if(b.child!==null){for(v=b.child,j=Di(v,v.pendingProps),b.child=j,j.return=b;v.sibling!==null;)v=v.sibling,j=j.sibling=Di(v,v.pendingProps),j.return=b;j.sibling=null}return b.child}function Cs(v,b,j){switch(b.tag){case 3:bu(b),ps();break;case 5:wn(b);break;case 1:hn(b.type)&&Xs(b);break;case 4:Fr(b,b.stateNode.containerInfo);break;case 10:Ac(b,b.type._context,b.memoizedProps.value);break;case 13:var H=b.memoizedState;if(H!==null)return H.dehydrated!==null?(ir(Zt,Zt.current&1),b.flags|=128,null):j&b.child.childLanes?$c(v,b,j):(ir(Zt,Zt.current&1),v=Cr(v,b,j),v!==null?v.sibling:null);ir(Zt,Zt.current&1);break;case 19:if(H=(j&b.childLanes)!==0,v.flags&128){if(H)return ya(v,b,j);b.flags|=128}var K=b.memoizedState;if(K!==null&&(K.rendering=null,K.tail=null,K.lastEffect=null),ir(Zt,Zt.current),H)break;return null;case 22:case 23:return b.lanes=0,Fc(v,b,j)}return Cr(v,b,j)}function Rt(v){v.flags|=4}function oo(v,b){if(v!==null&&v.child===b.child)return!0;if(b.flags&16)return!1;for(v=b.child;v!==null;){if(v.flags&12854||v.subtreeFlags&12854)return!1;v=v.sibling}return!0}var As,cl,dl,Ps;if(de)As=function(v,b){for(var j=b.child;j!==null;){if(j.tag===5||j.tag===6)X(v,j.stateNode);else if(j.tag!==4&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===b)break;for(;j.sibling===null;){if(j.return===null||j.return===b)return;j=j.return}j.sibling.return=j.return,j=j.sibling}},cl=function(){},dl=function(v,b,j,H,K){if(v=v.memoizedProps,v!==H){var te=b.stateNode,ue=mr(yn.current);j=J(te,j,v,H,K,ue),(b.updateQueue=j)&&Rt(b)}},Ps=function(v,b,j,H){j!==H&&Rt(b)};else if(ce){As=function(v,b,j,H){for(var K=b.child;K!==null;){if(K.tag===5){var te=K.stateNode;j&&H&&(te=An(te,K.type,K.memoizedProps,K)),X(v,te)}else if(K.tag===6)te=K.stateNode,j&&H&&(te=Br(te,K.memoizedProps,K)),X(v,te);else if(K.tag!==4){if(K.tag===22&&K.memoizedState!==null)te=K.child,te!==null&&(te.return=K),As(v,K,!0,!0);else if(K.child!==null){K.child.return=K,K=K.child;continue}}if(K===b)break;for(;K.sibling===null;){if(K.return===null||K.return===b)return;K=K.return}K.sibling.return=K.return,K=K.sibling}};var ws=function(v,b,j,H){for(var K=b.child;K!==null;){if(K.tag===5){var te=K.stateNode;j&&H&&(te=An(te,K.type,K.memoizedProps,K)),Nt(v,te)}else if(K.tag===6)te=K.stateNode,j&&H&&(te=Br(te,K.memoizedProps,K)),Nt(v,te);else if(K.tag!==4){if(K.tag===22&&K.memoizedState!==null)te=K.child,te!==null&&(te.return=K),ws(v,K,!0,!0);else if(K.child!==null){K.child.return=K,K=K.child;continue}}if(K===b)break;for(;K.sibling===null;){if(K.return===null||K.return===b)return;K=K.return}K.sibling.return=K.return,K=K.sibling}};cl=function(v,b){var j=b.stateNode;if(!oo(v,b)){v=j.containerInfo;var H=Qt(v);ws(H,b,!1,!1),j.pendingChildren=H,Rt(b),Er(v,H)}},dl=function(v,b,j,H,K){var te=v.stateNode,ue=v.memoizedProps;if((v=oo(v,b))&&ue===H)b.stateNode=te;else{var _e=b.stateNode,Oe=mr(yn.current),Ve=null;ue!==H&&(Ve=J(_e,j,ue,H,K,Oe)),v&&Ve===null?b.stateNode=te:(te=Sr(te,Ve,j,ue,H,b,v,_e),Q(te,j,H,K,Oe)&&Rt(b),b.stateNode=te,v?Rt(b):As(te,b,!1,!1))}},Ps=function(v,b,j,H){j!==H?(v=mr(zn.current),j=mr(yn.current),b.stateNode=ae(H,v,j,b),Rt(b)):b.stateNode=v.stateNode}}else cl=function(){},dl=function(){},Ps=function(){};function lo(v,b){if(!yr)switch(v.tailMode){case"hidden":b=v.tail;for(var j=null;b!==null;)b.alternate!==null&&(j=b),b=b.sibling;j===null?v.tail=null:j.sibling=null;break;case"collapsed":j=v.tail;for(var H=null;j!==null;)j.alternate!==null&&(H=j),j=j.sibling;H===null?b||v.tail===null?v.tail=null:v.tail.sibling=null:H.sibling=null}}function Jr(v){var b=v.alternate!==null&&v.alternate.child===v.child,j=0,H=0;if(b)for(var K=v.child;K!==null;)j|=K.lanes|K.childLanes,H|=K.subtreeFlags&14680064,H|=K.flags&14680064,K.return=v,K=K.sibling;else for(K=v.child;K!==null;)j|=K.lanes|K.childLanes,H|=K.subtreeFlags,H|=K.flags,K.return=v,K=K.sibling;return v.subtreeFlags|=H,v.childLanes=j,b}function Of(v,b,j){var H=b.pendingProps;switch(hs(b),b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jr(b),null;case 1:return hn(b.type)&&Ks(),Jr(b),null;case 3:return j=b.stateNode,da(),$t(Pn),$t(fn),Yo(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(v===null||v.child===null)&&(Fo(b)?Rt(b):v===null||v.memoizedState.isDehydrated&&!(b.flags&256)||(b.flags|=1024,pi!==null&&(Ls(pi),pi=null))),cl(v,b),Jr(b),null;case 5:vi(b),j=mr(zn.current);var K=b.type;if(v!==null&&b.stateNode!=null)dl(v,b,K,H,j),v.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!H){if(b.stateNode===null)throw Error(l(166));return Jr(b),null}if(v=mr(yn.current),Fo(b)){if(!Se)throw Error(l(175));v=Vt(b.stateNode,b.type,b.memoizedProps,j,v,b,!Qs),b.updateQueue=v,v!==null&&Rt(b)}else{var te=B(K,H,j,v,b);As(te,b,!1,!1),b.stateNode=te,Q(te,K,H,j,v)&&Rt(b)}b.ref!==null&&(b.flags|=512,b.flags|=2097152)}return Jr(b),null;case 6:if(v&&b.stateNode!=null)Ps(v,b,v.memoizedProps,H);else{if(typeof H!="string"&&b.stateNode===null)throw Error(l(166));if(v=mr(zn.current),j=mr(yn.current),Fo(b)){if(!Se)throw Error(l(176));if(v=b.stateNode,j=b.memoizedProps,(H=It(v,j,b,!Qs))&&(K=Gn,K!==null))switch(K.tag){case 3:Fa(K.stateNode.containerInfo,v,j,(K.mode&1)!==0);break;case 5:ci(K.type,K.memoizedProps,K.stateNode,v,j,(K.mode&1)!==0)}H&&Rt(b)}else b.stateNode=ae(H,v,j,b)}return Jr(b),null;case 13:if($t(Zt),H=b.memoizedState,v===null||v.memoizedState!==null&&v.memoizedState.dehydrated!==null){if(yr&&ei!==null&&b.mode&1&&!(b.flags&128))Cc(),ps(),b.flags|=98560,K=!1;else if(K=Fo(b),H!==null&&H.dehydrated!==null){if(v===null){if(!K)throw Error(l(318));if(!Se)throw Error(l(344));if(K=b.memoizedState,K=K!==null?K.dehydrated:null,!K)throw Error(l(317));Lt(K,b)}else ps(),!(b.flags&128)&&(b.memoizedState=null),b.flags|=4;Jr(b),K=!1}else pi!==null&&(Ls(pi),pi=null),K=!0;if(!K)return b.flags&65536?b:null}return b.flags&128?(b.lanes=j,b):(j=H!==null,j!==(v!==null&&v.memoizedState!==null)&&j&&(b.child.flags|=8192,b.mode&1&&(v===null||Zt.current&1?kr===0&&(kr=3):qi())),b.updateQueue!==null&&(b.flags|=4),Jr(b),null);case 4:return da(),cl(v,b),v===null&&Ne(b.stateNode.containerInfo),Jr(b),null;case 10:return uu(b.type._context),Jr(b),null;case 17:return hn(b.type)&&Ks(),Jr(b),null;case 19:if($t(Zt),K=b.memoizedState,K===null)return Jr(b),null;if(H=(b.flags&128)!==0,te=K.rendering,te===null)if(H)lo(K,!1);else{if(kr!==0||v!==null&&v.flags&128)for(v=b.child;v!==null;){if(te=_s(v),te!==null){for(b.flags|=128,lo(K,!1),v=te.updateQueue,v!==null&&(b.updateQueue=v,b.flags|=4),b.subtreeFlags=0,v=j,j=b.child;j!==null;)H=j,K=v,H.flags&=14680066,te=H.alternate,te===null?(H.childLanes=0,H.lanes=K,H.child=null,H.subtreeFlags=0,H.memoizedProps=null,H.memoizedState=null,H.updateQueue=null,H.dependencies=null,H.stateNode=null):(H.childLanes=te.childLanes,H.lanes=te.lanes,H.child=te.child,H.subtreeFlags=0,H.deletions=null,H.memoizedProps=te.memoizedProps,H.memoizedState=te.memoizedState,H.updateQueue=te.updateQueue,H.type=te.type,K=te.dependencies,H.dependencies=K===null?null:{lanes:K.lanes,firstContext:K.firstContext}),j=j.sibling;return ir(Zt,Zt.current&1|2),b.child}v=v.sibling}K.tail!==null&&zr()>yl&&(b.flags|=128,H=!0,lo(K,!1),b.lanes=4194304)}else{if(!H)if(v=_s(te),v!==null){if(b.flags|=128,H=!0,v=v.updateQueue,v!==null&&(b.updateQueue=v,b.flags|=4),lo(K,!0),K.tail===null&&K.tailMode==="hidden"&&!te.alternate&&!yr)return Jr(b),null}else 2*zr()-K.renderingStartTime>yl&&j!==1073741824&&(b.flags|=128,H=!0,lo(K,!1),b.lanes=4194304);K.isBackwards?(te.sibling=b.child,b.child=te):(v=K.last,v!==null?v.sibling=te:b.child=te,K.last=te)}return K.tail!==null?(b=K.tail,K.rendering=b,K.tail=b.sibling,K.renderingStartTime=zr(),b.sibling=null,v=Zt.current,ir(Zt,H?v&1|2:v&1),b):(Jr(b),null);case 22:case 23:return Si(),j=b.memoizedState!==null,v!==null&&v.memoizedState!==null!==j&&(b.flags|=8192),j&&b.mode&1?Vn&1073741824&&(Jr(b),de&&b.subtreeFlags&6&&(b.flags|=8192)):Jr(b),null;case 24:return null;case 25:return null}throw Error(l(156,b.tag))}function Tu(v,b){switch(hs(b),b.tag){case 1:return hn(b.type)&&Ks(),v=b.flags,v&65536?(b.flags=v&-65537|128,b):null;case 3:return da(),$t(Pn),$t(fn),Yo(),v=b.flags,v&65536&&!(v&128)?(b.flags=v&-65537|128,b):null;case 5:return vi(b),null;case 13:if($t(Zt),v=b.memoizedState,v!==null&&v.dehydrated!==null){if(b.alternate===null)throw Error(l(340));ps()}return v=b.flags,v&65536?(b.flags=v&-65537|128,b):null;case 19:return $t(Zt),null;case 4:return da(),null;case 10:return uu(b.type._context),null;case 22:case 23:return Si(),null;case 24:return null;default:return null}}var fl=!1,Zr=!1,Uc=typeof WeakSet=="function"?WeakSet:Set,ct=null;function _n(v,b){var j=v.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(H){Wt(v,b,H)}else j.current=null}function Wa(v,b,j){try{j()}catch(H){Wt(v,b,H)}}var Ns=!1;function Cu(v,b){for($(v.containerInfo),ct=b;ct!==null;)if(v=ct,b=v.child,(v.subtreeFlags&1028)!==0&&b!==null)b.return=v,ct=b;else for(;ct!==null;){v=ct;try{var j=v.alternate;if(v.flags&1024)switch(v.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var H=j.memoizedProps,K=j.memoizedState,te=v.stateNode,ue=te.getSnapshotBeforeUpdate(v.elementType===v.type?H:mi(v.type,H),K);te.__reactInternalSnapshotBeforeUpdate=ue}break;case 3:de&&Ht(v.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(_e){Wt(v,v.return,_e)}if(b=v.sibling,b!==null){b.return=v.return,ct=b;break}ct=v.return}return j=Ns,Ns=!1,j}function Ki(v,b,j){var H=b.updateQueue;if(H=H!==null?H.lastEffect:null,H!==null){var K=H=H.next;do{if((K.tag&v)===v){var te=K.destroy;K.destroy=void 0,te!==void 0&&Wa(b,j,te)}K=K.next}while(K!==H)}}function kn(v,b){if(b=b.updateQueue,b=b!==null?b.lastEffect:null,b!==null){var j=b=b.next;do{if((j.tag&v)===v){var H=j.create;j.destroy=H()}j=j.next}while(j!==b)}}function wr(v){var b=v.ref;if(b!==null){var j=v.stateNode;switch(v.tag){case 5:v=q(j);break;default:v=j}typeof b=="function"?b(v):b.current=v}}function Gc(v){var b=v.alternate;b!==null&&(v.alternate=null,Gc(b)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(b=v.stateNode,b!==null&&Ke(b)),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function Bc(v){return v.tag===5||v.tag===3||v.tag===4}function zc(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||Bc(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function hl(v,b,j){var H=v.tag;if(H===5||H===6)v=v.stateNode,b?De(j,v,b):We(j,v);else if(H!==4&&(v=v.child,v!==null))for(hl(v,b,j),v=v.sibling;v!==null;)hl(v,b,j),v=v.sibling}function pl(v,b,j){var H=v.tag;if(H===5||H===6)v=v.stateNode,b?ye(j,v,b):qt(j,v);else if(H!==4&&(v=v.child,v!==null))for(pl(v,b,j),v=v.sibling;v!==null;)pl(v,b,j),v=v.sibling}var Hr=null,xi=!1;function Ni(v,b,j){for(j=j.child;j!==null;)Au(v,b,j),j=j.sibling}function Au(v,b,j){if(Ci&&typeof Ci.onCommitFiberUnmount=="function")try{Ci.onCommitFiberUnmount(Do,j)}catch{}switch(j.tag){case 5:Zr||_n(j,b);case 6:if(de){var H=Hr,K=xi;Hr=null,Ni(v,b,j),Hr=H,xi=K,Hr!==null&&(xi?Ce(Hr,j.stateNode):Be(Hr,j.stateNode))}else Ni(v,b,j);break;case 18:de&&Hr!==null&&(xi?_r(Hr,j.stateNode):ur(Hr,j.stateNode));break;case 4:de?(H=Hr,K=xi,Hr=j.stateNode.containerInfo,xi=!0,Ni(v,b,j),Hr=H,xi=K):(ce&&(H=j.stateNode.containerInfo,K=Qt(H),dn(H,K)),Ni(v,b,j));break;case 0:case 11:case 14:case 15:if(!Zr&&(H=j.updateQueue,H!==null&&(H=H.lastEffect,H!==null))){K=H=H.next;do{var te=K,ue=te.destroy;te=te.tag,ue!==void 0&&(te&2||te&4)&&Wa(j,b,ue),K=K.next}while(K!==H)}Ni(v,b,j);break;case 1:if(!Zr&&(_n(j,b),H=j.stateNode,typeof H.componentWillUnmount=="function"))try{H.props=j.memoizedProps,H.state=j.memoizedState,H.componentWillUnmount()}catch(_e){Wt(j,b,_e)}Ni(v,b,j);break;case 21:Ni(v,b,j);break;case 22:j.mode&1?(Zr=(H=Zr)||j.memoizedState!==null,Ni(v,b,j),Zr=H):Ni(v,b,j);break;default:Ni(v,b,j)}}function $r(v){var b=v.updateQueue;if(b!==null){v.updateQueue=null;var j=v.stateNode;j===null&&(j=v.stateNode=new Uc),b.forEach(function(H){var K=Lf.bind(null,v,H);j.has(H)||(j.add(H),H.then(K,K))})}}function Dn(v,b){var j=b.deletions;if(j!==null)for(var H=0;H<j.length;H++){var K=j[H];try{var te=v,ue=b;if(de){var _e=ue;e:for(;_e!==null;){switch(_e.tag){case 5:Hr=_e.stateNode,xi=!1;break e;case 3:Hr=_e.stateNode.containerInfo,xi=!0;break e;case 4:Hr=_e.stateNode.containerInfo,xi=!0;break e}_e=_e.return}if(Hr===null)throw Error(l(160));Au(te,ue,K),Hr=null,xi=!1}else Au(te,ue,K);var Oe=K.alternate;Oe!==null&&(Oe.return=null),K.return=null}catch(Ve){Wt(K,b,Ve)}}if(b.subtreeFlags&12854)for(b=b.child;b!==null;)Pu(b,v),b=b.sibling}function Pu(v,b){var j=v.alternate,H=v.flags;switch(v.tag){case 0:case 11:case 14:case 15:if(Dn(b,v),xn(v),H&4){try{Ki(3,v,v.return),kn(3,v)}catch(tt){Wt(v,v.return,tt)}try{Ki(5,v,v.return)}catch(tt){Wt(v,v.return,tt)}}break;case 1:Dn(b,v),xn(v),H&512&&j!==null&&_n(j,j.return);break;case 5:if(Dn(b,v),xn(v),H&512&&j!==null&&_n(j,j.return),de){if(v.flags&32){var K=v.stateNode;try{Ee(K)}catch(tt){Wt(v,v.return,tt)}}if(H&4&&(K=v.stateNode,K!=null)){var te=v.memoizedProps;if(j=j!==null?j.memoizedProps:te,H=v.type,b=v.updateQueue,v.updateQueue=null,b!==null)try{me(K,b,H,j,te,v)}catch(tt){Wt(v,v.return,tt)}}}break;case 6:if(Dn(b,v),xn(v),H&4&&de){if(v.stateNode===null)throw Error(l(162));K=v.stateNode,te=v.memoizedProps,j=j!==null?j.memoizedProps:te;try{at(K,j,te)}catch(tt){Wt(v,v.return,tt)}}break;case 3:if(Dn(b,v),xn(v),H&4){if(de&&Se&&j!==null&&j.memoizedState.isDehydrated)try{br(b.containerInfo)}catch(tt){Wt(v,v.return,tt)}if(ce){K=b.containerInfo,te=b.pendingChildren;try{dn(K,te)}catch(tt){Wt(v,v.return,tt)}}}break;case 4:if(Dn(b,v),xn(v),H&4&&ce){te=v.stateNode,K=te.containerInfo,te=te.pendingChildren;try{dn(K,te)}catch(tt){Wt(v,v.return,tt)}}break;case 13:Dn(b,v),xn(v),K=v.child,K.flags&8192&&(te=K.memoizedState!==null,K.stateNode.isHidden=te,!te||K.alternate!==null&&K.alternate.memoizedState!==null||(Du=zr())),H&4&&$r(v);break;case 22:var ue=j!==null&&j.memoizedState!==null;if(v.mode&1?(Zr=(j=Zr)||ue,Dn(b,v),Zr=j):Dn(b,v),xn(v),H&8192){if(j=v.memoizedState!==null,(v.stateNode.isHidden=j)&&!ue&&v.mode&1)for(ct=v,H=v.child;H!==null;){for(b=ct=H;ct!==null;){ue=ct;var _e=ue.child;switch(ue.tag){case 0:case 11:case 14:case 15:Ki(4,ue,ue.return);break;case 1:_n(ue,ue.return);var Oe=ue.stateNode;if(typeof Oe.componentWillUnmount=="function"){var Ve=ue,ht=ue.return;try{var _t=Ve;Oe.props=_t.memoizedProps,Oe.state=_t.memoizedState,Oe.componentWillUnmount()}catch(tt){Wt(Ve,ht,tt)}}break;case 5:_n(ue,ue.return);break;case 22:if(ue.memoizedState!==null){Ya(b);continue}}_e!==null?(_e.return=ue,ct=_e):Ya(b)}H=H.sibling}if(de){e:if(H=null,de)for(b=v;;){if(b.tag===5){if(H===null){H=b;try{K=b.stateNode,j?Pe(K):nt(b.stateNode,b.memoizedProps)}catch(tt){Wt(v,v.return,tt)}}}else if(b.tag===6){if(H===null)try{te=b.stateNode,j?Xe(te):it(te,b.memoizedProps)}catch(tt){Wt(v,v.return,tt)}}else if((b.tag!==22&&b.tag!==23||b.memoizedState===null||b===v)&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===v)break e;for(;b.sibling===null;){if(b.return===null||b.return===v)break e;H===b&&(H=null),b=b.return}H===b&&(H=null),b.sibling.return=b.return,b=b.sibling}}}break;case 19:Dn(b,v),xn(v),H&4&&$r(v);break;case 21:break;default:Dn(b,v),xn(v)}}function xn(v){var b=v.flags;if(b&2){try{if(de){e:{for(var j=v.return;j!==null;){if(Bc(j)){var H=j;break e}j=j.return}throw Error(l(160))}switch(H.tag){case 5:var K=H.stateNode;H.flags&32&&(Ee(K),H.flags&=-33);var te=zc(v);pl(v,te,K);break;case 3:case 4:var ue=H.stateNode.containerInfo,_e=zc(v);hl(v,_e,ue);break;default:throw Error(l(161))}}}catch(Oe){Wt(v,v.return,Oe)}v.flags&=-3}b&4096&&(v.flags&=-4097)}function Hc(v,b,j){ct=v,Vc(v)}function Vc(v,b,j){for(var H=(v.mode&1)!==0;ct!==null;){var K=ct,te=K.child;if(K.tag===22&&H){var ue=K.memoizedState!==null||fl;if(!ue){var _e=K.alternate,Oe=_e!==null&&_e.memoizedState!==null||Zr;_e=fl;var Ve=Zr;if(fl=ue,(Zr=Oe)&&!Ve)for(ct=K;ct!==null;)ue=ct,Oe=ue.child,ue.tag===22&&ue.memoizedState!==null?en(K):Oe!==null?(Oe.return=ue,ct=Oe):en(K);for(;te!==null;)ct=te,Vc(te),te=te.sibling;ct=K,fl=_e,Zr=Ve}Wc(v)}else K.subtreeFlags&8772&&te!==null?(te.return=K,ct=te):Wc(v)}}function Wc(v){for(;ct!==null;){var b=ct;if(b.flags&8772){var j=b.alternate;try{if(b.flags&8772)switch(b.tag){case 0:case 11:case 15:Zr||kn(5,b);break;case 1:var H=b.stateNode;if(b.flags&4&&!Zr)if(j===null)H.componentDidMount();else{var K=b.elementType===b.type?j.memoizedProps:mi(b.type,j.memoizedProps);H.componentDidUpdate(K,j.memoizedState,H.__reactInternalSnapshotBeforeUpdate)}var te=b.updateQueue;te!==null&&zi(b,te,H);break;case 3:var ue=b.updateQueue;if(ue!==null){if(j=null,b.child!==null)switch(b.child.tag){case 5:j=q(b.child.stateNode);break;case 1:j=b.child.stateNode}zi(b,ue,j)}break;case 5:var _e=b.stateNode;j===null&&b.flags&4&&pe(_e,b.type,b.memoizedProps,b);break;case 6:break;case 4:break;case 12:break;case 13:if(Se&&b.memoizedState===null){var Oe=b.alternate;if(Oe!==null){var Ve=Oe.memoizedState;if(Ve!==null){var ht=Ve.dehydrated;ht!==null&&lr(ht)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Zr||b.flags&512&&wr(b)}catch(_t){Wt(b,b.return,_t)}}if(b===v){ct=null;break}if(j=b.sibling,j!==null){j.return=b.return,ct=j;break}ct=b.return}}function Ya(v){for(;ct!==null;){var b=ct;if(b===v){ct=null;break}var j=b.sibling;if(j!==null){j.return=b.return,ct=j;break}ct=b.return}}function en(v){for(;ct!==null;){var b=ct;try{switch(b.tag){case 0:case 11:case 15:var j=b.return;try{kn(4,b)}catch(Oe){Wt(b,j,Oe)}break;case 1:var H=b.stateNode;if(typeof H.componentDidMount=="function"){var K=b.return;try{H.componentDidMount()}catch(Oe){Wt(b,K,Oe)}}var te=b.return;try{wr(b)}catch(Oe){Wt(b,te,Oe)}break;case 5:var ue=b.return;try{wr(b)}catch(Oe){Wt(b,ue,Oe)}}}catch(Oe){Wt(b,b.return,Oe)}if(b===v){ct=null;break}var _e=b.sibling;if(_e!==null){_e.return=b.return,ct=_e;break}ct=b.return}}var et=0,Hn=1,Ln=2,ml=3,gl=4;if(typeof Symbol=="function"&&Symbol.for){var uo=Symbol.for;et=uo("selector.component"),Hn=uo("selector.has_pseudo_class"),Ln=uo("selector.role"),ml=uo("selector.test_id"),gl=uo("selector.text")}function wu(v){var b=Le(v);if(b!=null){if(typeof b.memoizedProps["data-testname"]!="string")throw Error(l(364));return b}if(v=ut(v),v===null)throw Error(l(362));return v.stateNode.current}function Nu(v,b){switch(b.$$typeof){case et:if(v.type===b.value)return!0;break;case Hn:e:{b=b.value,v=[v,0];for(var j=0;j<v.length;){var H=v[j++],K=v[j++],te=b[K];if(H.tag!==5||!kt(H)){for(;te!=null&&Nu(H,te);)K++,te=b[K];if(K===b.length){b=!0;break e}else for(H=H.child;H!==null;)v.push(H,K),H=H.sibling}}b=!1}return b;case Ln:if(v.tag===5&&Ge(v.stateNode,b.value))return!0;break;case gl:if((v.tag===5||v.tag===6)&&(v=Xt(v),v!==null&&0<=v.indexOf(b.value)))return!0;break;case ml:if(v.tag===5&&(v=v.memoizedProps["data-testname"],typeof v=="string"&&v.toLowerCase()===b.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function Nr(v){switch(v.$$typeof){case et:return"<"+(P(v.value)||"Unknown")+">";case Hn:return":has("+(Nr(v)||"")+")";case Ln:return'[role="'+v.value+'"]';case gl:return'"'+v.value+'"';case ml:return'[data-testname="'+v.value+'"]';default:throw Error(l(365))}}function Yc(v,b){var j=[];v=[v,0];for(var H=0;H<v.length;){var K=v[H++],te=v[H++],ue=b[te];if(K.tag!==5||!kt(K)){for(;ue!=null&&Nu(K,ue);)te++,ue=b[te];if(te===b.length)j.push(K);else for(K=K.child;K!==null;)v.push(K,te),K=K.sibling}}return j}function Ou(v,b){if(!yt)throw Error(l(363));v=wu(v),v=Yc(v,b),b=[],v=Array.from(v);for(var j=0;j<v.length;){var H=v[j++];if(H.tag===5)kt(H)||b.push(H.stateNode);else for(H=H.child;H!==null;)v.push(H),H=H.sibling}return b}var kf=Math.ceil,co=u.ReactCurrentDispatcher,Ka=u.ReactCurrentOwner,pr=u.ReactCurrentBatchConfig,Mt=0,Vr=null,Or=null,tn=0,Vn=0,Os=oa(0),kr=0,ks=null,Xa=0,vl=0,ku=0,fo=null,Fn=null,Du=0,yl=1/0,Xi=null;function qa(){yl=zr()+500}var _l=!1,Lu=null,Oi=null,xl=!1,Dr=null,ri=0,Qa=0,ho=null,po=-1,Sl=0;function rn(){return Mt&6?zr():po!==-1?po:po=zr()}function nn(v){return v.mode&1?Mt&2&&tn!==0?tn&-tn:Af.transition!==null?(Sl===0&&(Sl=yc()),Sl):(v=Jt,v!==0?v:He()):1}function Wn(v,b,j,H){if(50<Qa)throw Qa=0,ho=null,Error(l(185));Ti(v,j,H),(!(Mt&2)||v!==Vr)&&(v===Vr&&(!(Mt&2)&&(vl|=j),kr===4&&Gr(v,tn)),Ur(v,H),j===1&&Mt===0&&!(b.mode&1)&&(qa(),Lo&&hi()))}function Ur(v,b){var j=v.callbackNode;_f(v,b);var H=ko(v,v===Vr?tn:0);if(H===0)j!==null&&_c(j),v.callbackNode=null,v.callbackPriority=0;else if(b=H&-H,v.callbackPriority!==b){if(j!=null&&_c(j),b===1)v.tag===0?Cf(_a.bind(null,v)):Sc(_a.bind(null,v)),Qe?dt(function(){!(Mt&6)&&hi()}):Zl(eu,hi),j=null;else{switch(cs(H)){case 1:j=eu;break;case 4:j=bf;break;case 16:j=tu;break;case 536870912:j=Rf;break;default:j=tu}j=Qc(j,Ja.bind(null,v))}v.callbackPriority=b,v.callbackNode=j}}function Ja(v,b){if(po=-1,Sl=0,Mt&6)throw Error(l(327));var j=v.callbackNode;if(Yn()&&v.callbackNode!==j)return null;var H=ko(v,v===Vr?tn:0);if(H===0)return null;if(H&30||H&v.expiredLanes||b)b=mo(v,H);else{b=H;var K=Mt;Mt|=2;var te=Xc();(Vr!==v||tn!==b)&&(Xi=null,qa(),Za(v,b));do try{El();break}catch(_e){Kc(v,_e)}while(1);lu(),co.current=te,Mt=K,Or!==null?b=0:(Vr=null,tn=0,b=kr)}if(b!==0){if(b===2&&(K=ql(v),K!==0&&(H=K,b=Ds(v,K))),b===1)throw j=ks,Za(v,0),Gr(v,H),Ur(v,zr()),j;if(b===6)Gr(v,H);else{if(K=v.current.alternate,!(H&30)&&!ni(K)&&(b=mo(v,H),b===2&&(te=ql(v),te!==0&&(H=te,b=Ds(v,te))),b===1))throw j=ks,Za(v,0),Gr(v,H),Ur(v,zr()),j;switch(v.finishedWork=K,v.finishedLanes=H,b){case 0:case 1:throw Error(l(345));case 2:es(v,Fn,Xi);break;case 3:if(Gr(v,H),(H&130023424)===H&&(b=Du+500-zr(),10<b)){if(ko(v,0)!==0)break;if(K=v.suspendedLanes,(K&H)!==H){rn(),v.pingedLanes|=v.suspendedLanes&K;break}v.timeoutHandle=Z(es.bind(null,v,Fn,Xi),b);break}es(v,Fn,Xi);break;case 4:if(Gr(v,H),(H&4194240)===H)break;for(b=v.eventTimes,K=-1;0<H;){var ue=31-di(H);te=1<<ue,ue=b[ue],ue>K&&(K=ue),H&=~te}if(H=K,H=zr()-H,H=(120>H?120:480>H?480:1080>H?1080:1920>H?1920:3e3>H?3e3:4320>H?4320:1960*kf(H/1960))-H,10<H){v.timeoutHandle=Z(es.bind(null,v,Fn,Xi),H);break}es(v,Fn,Xi);break;case 5:es(v,Fn,Xi);break;default:throw Error(l(329))}}}return Ur(v,zr()),v.callbackNode===j?Ja.bind(null,v):null}function Ds(v,b){var j=fo;return v.current.memoizedState.isDehydrated&&(Za(v,b).flags|=256),v=mo(v,b),v!==2&&(b=Fn,Fn=j,b!==null&&Ls(b)),v}function Ls(v){Fn===null?Fn=v:Fn.push.apply(Fn,v)}function ni(v){for(var b=v;;){if(b.flags&16384){var j=b.updateQueue;if(j!==null&&(j=j.stores,j!==null))for(var H=0;H<j.length;H++){var K=j[H],te=K.getSnapshot;K=K.value;try{if(!fi(te(),K))return!1}catch{return!1}}}if(j=b.child,b.subtreeFlags&16384&&j!==null)j.return=b,b=j;else{if(b===v)break;for(;b.sibling===null;){if(b.return===null||b.return===v)return!0;b=b.return}b.sibling.return=b.return,b=b.sibling}}return!0}function Gr(v,b){for(b&=~ku,b&=~vl,v.suspendedLanes|=b,v.pingedLanes&=~b,v=v.expirationTimes;0<b;){var j=31-di(b),H=1<<j;v[j]=-1,b&=~H}}function _a(v){if(Mt&6)throw Error(l(327));Yn();var b=ko(v,0);if(!(b&1))return Ur(v,zr()),null;var j=mo(v,b);if(v.tag!==0&&j===2){var H=ql(v);H!==0&&(b=H,j=Ds(v,H))}if(j===1)throw j=ks,Za(v,0),Gr(v,b),Ur(v,zr()),j;if(j===6)throw Error(l(345));return v.finishedWork=v.current.alternate,v.finishedLanes=b,es(v,Fn,Xi),Ur(v,zr()),null}function ki(v){Dr!==null&&Dr.tag===0&&!(Mt&6)&&Yn();var b=Mt;Mt|=1;var j=pr.transition,H=Jt;try{if(pr.transition=null,Jt=1,v)return v()}finally{Jt=H,pr.transition=j,Mt=b,!(Mt&6)&&hi()}}function Si(){Vn=Os.current,$t(Os)}function Za(v,b){v.finishedWork=null,v.finishedLanes=0;var j=v.timeoutHandle;if(j!==oe&&(v.timeoutHandle=oe,se(j)),Or!==null)for(j=Or.return;j!==null;){var H=j;switch(hs(H),H.tag){case 1:H=H.type.childContextTypes,H!=null&&Ks();break;case 3:da(),$t(Pn),$t(fn),Yo();break;case 5:vi(H);break;case 4:da();break;case 13:$t(Zt);break;case 19:$t(Zt);break;case 10:uu(H.type._context);break;case 22:case 23:Si()}j=j.return}if(Vr=v,Or=v=Di(v.current,null),tn=Vn=b,kr=0,ks=null,ku=vl=Xa=0,Fn=fo=null,ua!==null){for(b=0;b<ua.length;b++)if(j=ua[b],H=j.interleaved,H!==null){j.interleaved=null;var K=H.next,te=j.pending;if(te!==null){var ue=te.next;te.next=K,H.next=ue}j.pending=H}ua=null}return v}function Kc(v,b){do{var j=Or;try{if(lu(),Vi.current=Yi,Zs){for(var H=hr.memoizedState;H!==null;){var K=H.queue;K!==null&&(K.pending=null),H=H.next}Zs=!1}if(vn=0,jr=Rr=hr=null,ha=!1,Ss=0,Ka.current=null,j===null||j.return===null){kr=1,ks=b,Or=null;break}e:{var te=v,ue=j.return,_e=j,Oe=b;if(b=tn,_e.flags|=32768,Oe!==null&&typeof Oe=="object"&&typeof Oe.then=="function"){var Ve=Oe,ht=_e,_t=ht.tag;if(!(ht.mode&1)&&(_t===0||_t===11||_t===15)){var tt=ht.alternate;tt?(ht.updateQueue=tt.updateQueue,ht.memoizedState=tt.memoizedState,ht.lanes=tt.lanes):(ht.updateQueue=null,ht.memoizedState=null)}var gr=kc(ue);if(gr!==null){gr.flags&=-257,cr(gr,ue,_e,te,b),gr.mode&1&&On(te,Ve,b),b=gr,Oe=Ve;var dr=b.updateQueue;if(dr===null){var ar=new Set;ar.add(Oe),b.updateQueue=ar}else dr.add(Oe);break e}else{if(!(b&1)){On(te,Ve,b),qi();break e}Oe=Error(l(426))}}else if(yr&&_e.mode&1){var nr=kc(ue);if(nr!==null){!(nr.flags&65536)&&(nr.flags|=256),cr(nr,ue,_e,te,b),su(ma(Oe,_e));break e}}te=Oe=ma(Oe,_e),kr!==4&&(kr=2),fo===null?fo=[te]:fo.push(te),te=ue;do{switch(te.tag){case 3:te.flags|=65536,b&=-b,te.lanes|=b;var Ae=bs(te,Oe,b);Bo(te,Ae);break e;case 1:_e=Oe;var xe=te.type,ke=te.stateNode;if(!(te.flags&128)&&(typeof xe.getDerivedStateFromError=="function"||ke!==null&&typeof ke.componentDidCatch=="function"&&(Oi===null||!Oi.has(ke)))){te.flags|=65536,b&=-b,te.lanes|=b;var st=ga(te,_e,b);Bo(te,st);break e}}te=te.return}while(te!==null)}bl(j)}catch(gt){b=gt,Or===j&&j!==null&&(Or=j=j.return);continue}break}while(1)}function Xc(){var v=co.current;return co.current=Yi,v===null?Yi:v}function qi(){(kr===0||kr===3||kr===2)&&(kr=4),Vr===null||!(Xa&268435455)&&!(vl&268435455)||Gr(Vr,tn)}function mo(v,b){var j=Mt;Mt|=2;var H=Xc();(Vr!==v||tn!==b)&&(Xi=null,Za(v,b));do try{Fu();break}catch(K){Kc(v,K)}while(1);if(lu(),Mt=j,co.current=H,Or!==null)throw Error(l(261));return Vr=null,tn=0,kr}function Fu(){for(;Or!==null;)qc(Or)}function El(){for(;Or!==null&&!Sf();)qc(Or)}function qc(v){var b=ju(v.alternate,v,Vn);v.memoizedProps=v.pendingProps,b===null?bl(v):Or=b,Ka.current=null}function bl(v){var b=v;do{var j=b.alternate;if(v=b.return,b.flags&32768){if(j=Tu(j,b),j!==null){j.flags&=32767,Or=j;return}if(v!==null)v.flags|=32768,v.subtreeFlags=0,v.deletions=null;else{kr=6,Or=null;return}}else if(j=Of(j,b,Vn),j!==null){Or=j;return}if(b=b.sibling,b!==null){Or=b;return}Or=b=v}while(b!==null);kr===0&&(kr=5)}function es(v,b,j){var H=Jt,K=pr.transition;try{pr.transition=null,Jt=1,Df(v,b,j,H)}finally{pr.transition=K,Jt=H}return null}function Df(v,b,j,H){do Yn();while(Dr!==null);if(Mt&6)throw Error(l(327));j=v.finishedWork;var K=v.finishedLanes;if(j===null)return null;if(v.finishedWork=null,v.finishedLanes=0,j===v.current)throw Error(l(177));v.callbackNode=null,v.callbackPriority=0;var te=j.lanes|j.childLanes;if(xf(v,te),v===Vr&&(Or=Vr=null,tn=0),!(j.subtreeFlags&2064)&&!(j.flags&2064)||xl||(xl=!0,Qc(tu,function(){return Yn(),null})),te=(j.flags&15990)!==0,j.subtreeFlags&15990||te){te=pr.transition,pr.transition=null;var ue=Jt;Jt=1;var _e=Mt;Mt|=4,Ka.current=null,Cu(v,j),Pu(j,v),I(v.containerInfo),v.current=j,Hc(j),Ef(),Mt=_e,Jt=ue,pr.transition=te}else v.current=j;if(xl&&(xl=!1,Dr=v,ri=K),te=v.pendingLanes,te===0&&(Oi=null),Tf(j.stateNode),Ur(v,zr()),b!==null)for(H=v.onRecoverableError,j=0;j<b.length;j++)K=b[j],H(K.value,{componentStack:K.stack,digest:K.digest});if(_l)throw _l=!1,v=Lu,Lu=null,v;return ri&1&&v.tag!==0&&Yn(),te=v.pendingLanes,te&1?v===ho?Qa++:(Qa=0,ho=v):Qa=0,hi(),null}function Yn(){if(Dr!==null){var v=cs(ri),b=pr.transition,j=Jt;try{if(pr.transition=null,Jt=16>v?16:v,Dr===null)var H=!1;else{if(v=Dr,Dr=null,ri=0,Mt&6)throw Error(l(331));var K=Mt;for(Mt|=4,ct=v.current;ct!==null;){var te=ct,ue=te.child;if(ct.flags&16){var _e=te.deletions;if(_e!==null){for(var Oe=0;Oe<_e.length;Oe++){var Ve=_e[Oe];for(ct=Ve;ct!==null;){var ht=ct;switch(ht.tag){case 0:case 11:case 15:Ki(8,ht,te)}var _t=ht.child;if(_t!==null)_t.return=ht,ct=_t;else for(;ct!==null;){ht=ct;var tt=ht.sibling,gr=ht.return;if(Gc(ht),ht===Ve){ct=null;break}if(tt!==null){tt.return=gr,ct=tt;break}ct=gr}}}var dr=te.alternate;if(dr!==null){var ar=dr.child;if(ar!==null){dr.child=null;do{var nr=ar.sibling;ar.sibling=null,ar=nr}while(ar!==null)}}ct=te}}if(te.subtreeFlags&2064&&ue!==null)ue.return=te,ct=ue;else e:for(;ct!==null;){if(te=ct,te.flags&2048)switch(te.tag){case 0:case 11:case 15:Ki(9,te,te.return)}var Ae=te.sibling;if(Ae!==null){Ae.return=te.return,ct=Ae;break e}ct=te.return}}var xe=v.current;for(ct=xe;ct!==null;){ue=ct;var ke=ue.child;if(ue.subtreeFlags&2064&&ke!==null)ke.return=ue,ct=ke;else e:for(ue=xe;ct!==null;){if(_e=ct,_e.flags&2048)try{switch(_e.tag){case 0:case 11:case 15:kn(9,_e)}}catch(gt){Wt(_e,_e.return,gt)}if(_e===ue){ct=null;break e}var st=_e.sibling;if(st!==null){st.return=_e.return,ct=st;break e}ct=_e.return}}if(Mt=K,hi(),Ci&&typeof Ci.onPostCommitFiberRoot=="function")try{Ci.onPostCommitFiberRoot(Do,v)}catch{}H=!0}return H}finally{Jt=j,pr.transition=b}}return!1}function Wr(v,b,j){b=ma(j,b),b=bs(v,b,1),v=ca(v,b,1),b=rn(),v!==null&&(Ti(v,1,b),Ur(v,b))}function Wt(v,b,j){if(v.tag===3)Wr(v,v,j);else for(;b!==null;){if(b.tag===3){Wr(b,v,j);break}else if(b.tag===1){var H=b.stateNode;if(typeof b.type.getDerivedStateFromError=="function"||typeof H.componentDidCatch=="function"&&(Oi===null||!Oi.has(H))){v=ma(j,v),v=ga(b,v,1),b=ca(b,v,1),v=rn(),b!==null&&(Ti(b,1,v),Ur(b,v));break}}b=b.return}}function Ei(v,b,j){var H=v.pingCache;H!==null&&H.delete(b),b=rn(),v.pingedLanes|=v.suspendedLanes&j,Vr===v&&(tn&j)===j&&(kr===4||kr===3&&(tn&130023424)===tn&&500>zr()-Du?Za(v,0):ku|=j),Ur(v,b)}function Qi(v,b){b===0&&(v.mode&1?(b=Ia,Ia<<=1,!(Ia&130023424)&&(Ia=4194304)):b=1);var j=rn();v=gi(v,b),v!==null&&(Ti(v,b,j),Ur(v,j))}function xa(v){var b=v.memoizedState,j=0;b!==null&&(j=b.retryLane),Qi(v,j)}function Lf(v,b){var j=0;switch(v.tag){case 13:var H=v.stateNode,K=v.memoizedState;K!==null&&(j=K.retryLane);break;case 19:H=v.stateNode;break;default:throw Error(l(314))}H!==null&&H.delete(b),Qi(v,j)}var ju;ju=function(v,b,j){if(v!==null)if(v.memoizedProps!==b.pendingProps||Pn.current)Qr=!0;else{if(!(v.lanes&j)&&!(b.flags&128))return Qr=!1,Cs(v,b,j);Qr=!!(v.flags&131072)}else Qr=!1,yr&&b.flags&1048576&&Ec(b,qs,b.index);switch(b.lanes=0,b.tag){case 2:var H=b.type;Ts(v,b),v=b.pendingProps;var K=us(b,fn.current);gs(b,j),K=Et(null,b,H,v,K,j);var te=Ut();return b.flags|=1,typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0?(b.tag=1,b.memoizedState=null,b.updateQueue=null,hn(H)?(te=!0,Xs(b)):te=!1,b.memoizedState=K.state!==null&&K.state!==void 0?K.state:null,Uo(b),K.updater=Ho,b.stateNode=K,K._reactInternals=b,hu(b,H,v,j),b=ao(null,b,H,!0,te,j)):(b.tag=0,yr&&te&&nu(b),Ir(null,b,K,j),b=b.child),b;case 16:H=b.elementType;e:{switch(Ts(v,b),v=b.pendingProps,K=H._init,H=K(H._payload),b.type=H,K=b.tag=Jc(H),v=mi(H,v),K){case 0:b=io(null,b,H,v,j);break e;case 1:b=Mc(null,b,H,v,j);break e;case 11:b=no(null,b,H,v,j);break e;case 14:b=Dc(null,b,H,mi(H.type,v),j);break e}throw Error(l(306,H,""))}return b;case 0:return H=b.type,K=b.pendingProps,K=b.elementType===H?K:mi(H,K),io(v,b,H,K,j);case 1:return H=b.type,K=b.pendingProps,K=b.elementType===H?K:mi(H,K),Mc(v,b,H,K,j);case 3:e:{if(bu(b),v===null)throw Error(l(387));H=b.pendingProps,te=b.memoizedState,K=te.element,fu(v,b),vs(b,H,null,j);var ue=b.memoizedState;if(H=ue.element,Se&&te.isDehydrated)if(te={element:H,isDehydrated:!1,cache:ue.cache,pendingSuspenseBoundaries:ue.pendingSuspenseBoundaries,transitions:ue.transitions},b.updateQueue.baseState=te,b.memoizedState=te,b.flags&256){K=ma(Error(l(423)),b),b=Ic(v,b,H,j,K);break e}else if(H!==K){K=ma(Error(l(424)),b),b=Ic(v,b,H,j,K);break e}else for(Se&&(ei=Je(b.stateNode.containerInfo),Gn=b,yr=!0,pi=null,Qs=!1),j=ti(b,null,H,j),b.child=j;j;)j.flags=j.flags&-3|4096,j=j.sibling;else{if(ps(),H===K){b=Cr(v,b,j);break e}Ir(v,b,H,j)}b=b.child}return b;case 5:return wn(b),v===null&&au(b),H=b.type,K=b.pendingProps,te=v!==null?v.memoizedProps:null,ue=K.children,ne(H,K)?ue=null:te!==null&&ne(H,te)&&(b.flags|=32),jc(v,b),Ir(v,b,ue,j),b.child;case 6:return v===null&&au(b),null;case 13:return $c(v,b,j);case 4:return Fr(b,b.stateNode.containerInfo),H=b.pendingProps,v===null?b.child=Hi(b,null,H,j):Ir(v,b,H,j),b.child;case 11:return H=b.type,K=b.pendingProps,K=b.elementType===H?K:mi(H,K),no(v,b,H,K,j);case 7:return Ir(v,b,b.pendingProps,j),b.child;case 8:return Ir(v,b,b.pendingProps.children,j),b.child;case 12:return Ir(v,b,b.pendingProps.children,j),b.child;case 10:e:{if(H=b.type._context,K=b.pendingProps,te=b.memoizedProps,ue=K.value,Ac(b,H,ue),te!==null)if(fi(te.value,ue)){if(te.children===K.children&&!Pn.current){b=Cr(v,b,j);break e}}else for(te=b.child,te!==null&&(te.return=b);te!==null;){var _e=te.dependencies;if(_e!==null){ue=te.child;for(var Oe=_e.firstContext;Oe!==null;){if(Oe.context===H){if(te.tag===1){Oe=Pi(-1,j&-j),Oe.tag=2;var Ve=te.updateQueue;if(Ve!==null){Ve=Ve.shared;var ht=Ve.pending;ht===null?Oe.next=Oe:(Oe.next=ht.next,ht.next=Oe),Ve.pending=Oe}}te.lanes|=j,Oe=te.alternate,Oe!==null&&(Oe.lanes|=j),cu(te.return,j,b),_e.lanes|=j;break}Oe=Oe.next}}else if(te.tag===10)ue=te.type===b.type?null:te.child;else if(te.tag===18){if(ue=te.return,ue===null)throw Error(l(341));ue.lanes|=j,_e=ue.alternate,_e!==null&&(_e.lanes|=j),cu(ue,j,b),ue=te.sibling}else ue=te.child;if(ue!==null)ue.return=te;else for(ue=te;ue!==null;){if(ue===b){ue=null;break}if(te=ue.sibling,te!==null){te.return=ue.return,ue=te;break}ue=ue.return}te=ue}Ir(v,b,K.children,j),b=b.child}return b;case 9:return K=b.type,H=b.pendingProps.children,gs(b,j),K=gn(K),H=H(K),b.flags|=1,Ir(v,b,H,j),b.child;case 14:return H=b.type,K=mi(H,b.pendingProps),K=mi(H.type,K),Dc(v,b,H,K,j);case 15:return Lc(v,b,b.type,b.pendingProps,j);case 17:return H=b.type,K=b.pendingProps,K=b.elementType===H?K:mi(H,K),Ts(v,b),b.tag=1,hn(H)?(v=!0,Xs(b)):v=!1,gs(b,j),Pc(b,H,K),hu(b,H,K,j),ao(null,b,H,!0,v,j);case 19:return ya(v,b,j);case 22:return Fc(v,b,j)}throw Error(l(156,b.tag))};function Qc(v,b){return Zl(v,b)}function Ff(v,b,j,H){this.tag=v,this.key=j,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=b,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=H,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(v,b,j,H){return new Ff(v,b,j,H)}function Rl(v){return v=v.prototype,!(!v||!v.isReactComponent)}function Jc(v){if(typeof v=="function")return Rl(v)?1:0;if(v!=null){if(v=v.$$typeof,v===g)return 11;if(v===R)return 14}return 2}function Di(v,b){var j=v.alternate;return j===null?(j=ii(v.tag,b,v.key,v.mode),j.elementType=v.elementType,j.type=v.type,j.stateNode=v.stateNode,j.alternate=v,v.alternate=j):(j.pendingProps=b,j.type=v.type,j.flags=0,j.subtreeFlags=0,j.deletions=null),j.flags=v.flags&14680064,j.childLanes=v.childLanes,j.lanes=v.lanes,j.child=v.child,j.memoizedProps=v.memoizedProps,j.memoizedState=v.memoizedState,j.updateQueue=v.updateQueue,b=v.dependencies,j.dependencies=b===null?null:{lanes:b.lanes,firstContext:b.firstContext},j.sibling=v.sibling,j.index=v.index,j.ref=v.ref,j}function go(v,b,j,H,K,te){var ue=2;if(H=v,typeof v=="function")Rl(v)&&(ue=1);else if(typeof v=="string")ue=5;else e:switch(v){case h:return Sa(j.children,K,te,b);case y:ue=8,K|=8;break;case E:return v=ii(12,j,b,K|2),v.elementType=E,v.lanes=te,v;case x:return v=ii(13,j,b,K),v.elementType=x,v.lanes=te,v;case C:return v=ii(19,j,b,K),v.elementType=C,v.lanes=te,v;case A:return Fs(j,K,te,b);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case p:ue=10;break e;case _:ue=9;break e;case g:ue=11;break e;case R:ue=14;break e;case S:ue=16,H=null;break e}throw Error(l(130,v==null?v:typeof v,""))}return b=ii(ue,j,b,K),b.elementType=v,b.type=H,b.lanes=te,b}function Sa(v,b,j,H){return v=ii(7,v,H,b),v.lanes=j,v}function Fs(v,b,j,H){return v=ii(22,v,H,b),v.elementType=A,v.lanes=j,v.stateNode={isHidden:!1},v}function vo(v,b,j){return v=ii(6,v,null,b),v.lanes=j,v}function yo(v,b,j){return b=ii(4,v.children!==null?v.children:[],v.key,b),b.lanes=j,b.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},b}function jf(v,b,j,H,K){this.tag=b,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=H,this.onRecoverableError=K,Se&&(this.mutableSourceEagerHydrationData=null)}function Zc(v,b,j,H,K,te,ue,_e,Oe){return v=new jf(v,b,j,_e,Oe),b===1?(b=1,te===!0&&(b|=8)):b=0,te=ii(3,null,null,b),v.current=te,te.stateNode=v,te.memoizedState={element:H,isDehydrated:j,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uo(te),v}function ed(v){if(!v)return la;v=v._reactInternals;e:{if(k(v)!==v||v.tag!==1)throw Error(l(170));var b=v;do{switch(b.tag){case 3:b=b.stateNode.context;break e;case 1:if(hn(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break e}}b=b.return}while(b!==null);throw Error(l(171))}if(v.tag===1){var j=v.type;if(hn(j))return No(v,j,b)}return b}function td(v){var b=v._reactInternals;if(b===void 0)throw typeof v.render=="function"?Error(l(188)):(v=Object.keys(v).join(","),Error(l(268,v)));return v=G(b),v===null?null:v.stateNode}function Mu(v,b){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var j=v.retryLane;v.retryLane=j!==0&&j<b?j:b}}function ts(v,b){Mu(v,b),(v=v.alternate)&&Mu(v,b)}function Mf(v){return v=G(v),v===null?null:v.stateNode}function rd(){return null}return r.attemptContinuousHydration=function(v){if(v.tag===13){var b=gi(v,134217728);if(b!==null){var j=rn();Wn(b,v,134217728,j)}ts(v,134217728)}},r.attemptDiscreteHydration=function(v){if(v.tag===13){var b=gi(v,1);if(b!==null){var j=rn();Wn(b,v,1,j)}ts(v,1)}},r.attemptHydrationAtCurrentPriority=function(v){if(v.tag===13){var b=nn(v),j=gi(v,b);if(j!==null){var H=rn();Wn(j,v,b,H)}ts(v,b)}},r.attemptSynchronousHydration=function(v){switch(v.tag){case 3:var b=v.stateNode;if(b.current.memoizedState.isDehydrated){var j=mn(b.pendingLanes);j!==0&&(Jl(b,j|1),Ur(b,zr()),!(Mt&6)&&(qa(),hi()))}break;case 13:ki(function(){var H=gi(v,1);if(H!==null){var K=rn();Wn(H,v,1,K)}}),ts(v,1)}},r.batchedUpdates=function(v,b){var j=Mt;Mt|=1;try{return v(b)}finally{Mt=j,Mt===0&&(qa(),Lo&&hi())}},r.createComponentSelector=function(v){return{$$typeof:et,value:v}},r.createContainer=function(v,b,j,H,K,te,ue){return Zc(v,b,!1,null,j,H,K,te,ue)},r.createHasPseudoClassSelector=function(v){return{$$typeof:Hn,value:v}},r.createHydrationContainer=function(v,b,j,H,K,te,ue,_e,Oe){return v=Zc(j,H,!0,v,K,te,ue,_e,Oe),v.context=ed(null),j=v.current,H=rn(),K=nn(j),te=Pi(H,K),te.callback=b??null,ca(j,te,K),v.current.lanes=K,Ti(v,K,H),Ur(v,H),v},r.createPortal=function(v,b,j){var H=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:H==null?null:""+H,children:v,containerInfo:b,implementation:j}},r.createRoleSelector=function(v){return{$$typeof:Ln,value:v}},r.createTestNameSelector=function(v){return{$$typeof:ml,value:v}},r.createTextSelector=function(v){return{$$typeof:gl,value:v}},r.deferredUpdates=function(v){var b=Jt,j=pr.transition;try{return pr.transition=null,Jt=16,v()}finally{Jt=b,pr.transition=j}},r.discreteUpdates=function(v,b,j,H,K){var te=Jt,ue=pr.transition;try{return pr.transition=null,Jt=1,v(b,j,H,K)}finally{Jt=te,pr.transition=ue,Mt===0&&qa()}},r.findAllNodes=Ou,r.findBoundingRects=function(v,b){if(!yt)throw Error(l(363));b=Ou(v,b),v=[];for(var j=0;j<b.length;j++)v.push(ft(b[j]));for(b=v.length-1;0<b;b--){j=v[b];for(var H=j.x,K=H+j.width,te=j.y,ue=te+j.height,_e=b-1;0<=_e;_e--)if(b!==_e){var Oe=v[_e],Ve=Oe.x,ht=Ve+Oe.width,_t=Oe.y,tt=_t+Oe.height;if(H>=Ve&&te>=_t&&K<=ht&&ue<=tt){v.splice(b,1);break}else if(H!==Ve||j.width!==Oe.width||tt<te||_t>ue){if(!(te!==_t||j.height!==Oe.height||ht<H||Ve>K)){Ve>H&&(Oe.width+=Ve-H,Oe.x=H),ht<K&&(Oe.width=K-Ve),v.splice(b,1);break}}else{_t>te&&(Oe.height+=_t-te,Oe.y=te),tt<ue&&(Oe.height=ue-_t),v.splice(b,1);break}}}return v},r.findHostInstance=td,r.findHostInstanceWithNoPortals=function(v){return v=F(v),v=v!==null?W(v):null,v===null?null:v.stateNode},r.findHostInstanceWithWarning=function(v){return td(v)},r.flushControlled=function(v){var b=Mt;Mt|=1;var j=pr.transition,H=Jt;try{pr.transition=null,Jt=1,v()}finally{Jt=H,pr.transition=j,Mt=b,Mt===0&&(qa(),hi())}},r.flushPassiveEffects=Yn,r.flushSync=ki,r.focusWithin=function(v,b){if(!yt)throw Error(l(363));for(v=wu(v),b=Yc(v,b),b=Array.from(b),v=0;v<b.length;){var j=b[v++];if(!kt(j)){if(j.tag===5&&Ze(j.stateNode))return!0;for(j=j.child;j!==null;)b.push(j),j=j.sibling}}return!1},r.getCurrentUpdatePriority=function(){return Jt},r.getFindAllNodesFailureDescription=function(v,b){if(!yt)throw Error(l(363));var j=0,H=[];v=[wu(v),0];for(var K=0;K<v.length;){var te=v[K++],ue=v[K++],_e=b[ue];if((te.tag!==5||!kt(te))&&(Nu(te,_e)&&(H.push(Nr(_e)),ue++,ue>j&&(j=ue)),ue<b.length))for(te=te.child;te!==null;)v.push(te,ue),te=te.sibling}if(j<b.length){for(v=[];j<b.length;j++)v.push(Nr(b[j]));return`findAllNodes was able to match part of the selector:
103
+ `+(H.join(" > ")+`
104
+
105
+ No matching component was found for:
106
+ `)+v.join(" > ")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return q(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:Mf,findFiberByHostInstance:v.findFiberByHostInstance||rd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)v=!0;else{try{Do=b.inject(v),Ci=b}catch{}v=!!b.checkDCE}}return v},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(v,b,j,H){if(!yt)throw Error(l(363));v=Ou(v,b);var K=rt(v,j,H).disconnect;return{disconnect:function(){K()}}},r.registerMutableSourceForHydration=function(v,b){var j=b._getVersion;j=j(b._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[b,j]:v.mutableSourceEagerHydrationData.push(b,j)},r.runWithPriority=function(v,b){var j=Jt;try{return Jt=v,b()}finally{Jt=j}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(v,b,j,H){var K=b.current,te=rn(),ue=nn(K);return j=ed(j),b.context===null?b.context=j:b.pendingContext=j,b=Pi(te,ue),b.payload={element:v},H=H===void 0?null:H,H!==null&&(b.callback=H),v=ca(K,b,ue),v!==null&&(Wn(v,K,ue,te),Go(v,K,ue)),ue},r}),reactReconciler_production_min}var reactReconciler_development={exports:{}};/**
107
+ * @license React
108
+ * react-reconciler.development.js
109
+ *
110
+ * Copyright (c) Facebook, Inc. and its affiliates.
111
+ *
112
+ * This source code is licensed under the MIT license found in the
113
+ * LICENSE file in the root directory of this source tree.
114
+ */var hasRequiredReactReconciler_development;function requireReactReconciler_development(){return hasRequiredReactReconciler_development||(hasRequiredReactReconciler_development=1,process.env.NODE_ENV!=="production"&&(reactReconciler_development.exports=function(e){var r={},t=React$2,n=requireScheduler(),a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=!1;function u(s){l=s}function f(s){if(!l){for(var c=arguments.length,N=new Array(c>1?c-1:0),L=1;L<c;L++)N[L-1]=arguments[L];h("warn",s,N)}}function d(s){if(!l){for(var c=arguments.length,N=new Array(c>1?c-1:0),L=1;L<c;L++)N[L-1]=arguments[L];h("error",s,N)}}function h(s,c,N){{var L=a.ReactDebugCurrentFrame,M=L.getStackAddendum();M!==""&&(c+="%s",N=N.concat([M]));var Y=N.map(function(re){return String(re)});Y.unshift("Warning: "+c),Function.prototype.apply.call(console[s],console,Y)}}var y=Object.assign;function E(s){return s._reactInternals}function p(s,c){s._reactInternals=c}var _=!1,g=!1,x=!1,C=!1,R=!1,S=!0,A=!0,T=!0,w=0,P=1,O=2,k=3,D=4,F=5,G=6,V=7,W=8,ee=9,q=10,z=11,U=12,$=13,I=14,B=15,X=16,Q=17,J=18,ne=19,ae=21,Z=22,se=23,oe=24,fe=25,de=Symbol.for("react.element"),ce=Symbol.for("react.portal"),Se=Symbol.for("react.fragment"),Le=Symbol.for("react.strict_mode"),Ne=Symbol.for("react.profiler"),He=Symbol.for("react.provider"),Ke=Symbol.for("react.context"),Qe=Symbol.for("react.forward_ref"),dt=Symbol.for("react.suspense"),yt=Symbol.for("react.suspense_list"),ut=Symbol.for("react.memo"),ft=Symbol.for("react.lazy"),Xt=Symbol.for("react.scope"),kt=Symbol.for("react.debug_trace_mode"),Ge=Symbol.for("react.offscreen"),Ze=Symbol.for("react.legacy_hidden"),rt=Symbol.for("react.cache"),qt=Symbol.for("react.tracing_marker"),We=Symbol.iterator,at="@@iterator";function pe(s){if(s===null||typeof s!="object")return null;var c=We&&s[We]||s[at];return typeof c=="function"?c:null}function me(s,c,N){var L=s.displayName;if(L)return L;var M=c.displayName||c.name||"";return M!==""?N+"("+M+")":N}function ye(s){return s.displayName||"Context"}function De(s){if(s==null)return null;if(typeof s.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case Se:return"Fragment";case ce:return"Portal";case Ne:return"Profiler";case Le:return"StrictMode";case dt:return"Suspense";case yt:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case Ke:var c=s;return ye(c)+".Consumer";case He:var N=s;return ye(N._context)+".Provider";case Qe:return me(s,s.render,"ForwardRef");case ut:var L=s.displayName||null;return L!==null?L:De(s.type)||"Memo";case ft:{var M=s,Y=M._payload,re=M._init;try{return De(re(Y))}catch{return null}}}return null}function Be(s,c,N){var L=c.displayName||c.name||"";return s.displayName||(L!==""?N+"("+L+")":N)}function Ce(s){return s.displayName||"Context"}function Ee(s){var c=s.tag,N=s.type;switch(c){case oe:return"Cache";case ee:var L=N;return Ce(L)+".Consumer";case q:var M=N;return Ce(M._context)+".Provider";case J:return"DehydratedFragment";case z:return Be(N,N.render,"ForwardRef");case V:return"Fragment";case F:return N;case D:return"Portal";case k:return"Root";case G:return"Text";case X:return De(N);case W:return N===Le?"StrictMode":"Mode";case Z:return"Offscreen";case U:return"Profiler";case ae:return"Scope";case $:return"Suspense";case ne:return"SuspenseList";case fe:return"TracingMarker";case P:case w:case Q:case O:case I:case B:if(typeof N=="function")return N.displayName||N.name||null;if(typeof N=="string")return N;break}return null}var Pe=0,Xe=1,nt=2,it=4,Ht=16,Sr=32,Qt=64,Nt=128,Er=256,dn=512,An=1024,Br=2048,ui=4096,Ii=8192,Da=16384,Po=Br|it|Qt|dn|An|Da,Ws=32767,La=32768,qr=65536,ge=131072,ze=1048576,Je=2097152,xt=4194304,Vt=8388608,It=16777216,Lt=33554432,Dt=it|An|0,br=nt|it|Ht|Sr|dn|ui|Ii,lr=it|Qt|dn|Ii,ur=Br|Ht,_r=xt|Vt|Je,sa=a.ReactCurrentOwner;function Fa(s){var c=s,N=s;if(s.alternate)for(;c.return;)c=c.return;else{var L=c;do c=L,(c.flags&(nt|ui))!==Pe&&(N=c.return),L=c.return;while(L)}return c.tag===k?N:null}function ci(s){return Fa(s)===s}function Vl(s){{var c=sa.current;if(c!==null&&c.tag===P){var N=c,L=N.stateNode;L._warnedAboutRefsInRender||d("%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.",Ee(N)||"A component"),L._warnedAboutRefsInRender=!0}}var M=E(s);return M?Fa(M)===M:!1}function ls(s){if(Fa(s)!==s)throw new Error("Unable to find node on an unmounted component.")}function wo(s){var c=s.alternate;if(!c){var N=Fa(s);if(N===null)throw new Error("Unable to find node on an unmounted component.");return N!==s?null:s}for(var L=s,M=c;;){var Y=L.return;if(Y===null)break;var re=Y.alternate;if(re===null){var ie=Y.return;if(ie!==null){L=M=ie;continue}break}if(Y.child===re.child){for(var le=Y.child;le;){if(le===L)return ls(Y),s;if(le===M)return ls(Y),c;le=le.sibling}throw new Error("Unable to find node on an unmounted component.")}if(L.return!==M.return)L=Y,M=re;else{for(var he=!1,ve=Y.child;ve;){if(ve===L){he=!0,L=Y,M=re;break}if(ve===M){he=!0,M=Y,L=re;break}ve=ve.sibling}if(!he){for(ve=re.child;ve;){if(ve===L){he=!0,L=re,M=Y;break}if(ve===M){he=!0,M=re,L=Y;break}ve=ve.sibling}if(!he)throw new 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(L.alternate!==M)throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(L.tag!==k)throw new Error("Unable to find node on an unmounted component.");return L.stateNode.current===L?s:c}function Ys(s){var c=wo(s);return c!==null?vc(c):null}function vc(s){if(s.tag===F||s.tag===G)return s;for(var c=s.child;c!==null;){var N=vc(c);if(N!==null)return N;c=c.sibling}return null}function Wl(s){var c=wo(s);return c!==null?ja(c):null}function ja(s){if(s.tag===F||s.tag===G)return s;for(var c=s.child;c!==null;){if(c.tag!==D){var N=ja(c);if(N!==null)return N}c=c.sibling}return null}var oa=Array.isArray;function $t(s){return oa(s)}var ir=e.getPublicInstance,la=e.getRootHostContext,fn=e.getChildHostContext,Pn=e.prepareForCommit,Ma=e.resetAfterCommit,us=e.createInstance,hn=e.appendInitialChild,Ks=e.finalizeInitialChildren,Yl=e.prepareUpdate,No=e.shouldSetTextContent,Xs=e.createTextInstance,Kl=e.scheduleTimeout,di=e.cancelTimeout,Xl=e.noTimeout,Oo=e.isPrimaryRenderer,vf=e.warnsIfNotActing,pn=e.supportsMutation,Ia=e.supportsPersistence,mn=e.supportsHydration,ko=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var yf=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var _f=e.getCurrentEventPriority,ql=e.detachDeletedInstance,yc=e.supportsMicrotasks,Ql=e.scheduleMicrotask,Ti=e.supportsTestSelectors,xf=e.findFiberRoot,Jl=e.getBoundingRect,Jt=e.getTextContent,cs=e.isHiddenSubtree,Zl=e.matchAccessibilityRole,_c=e.setFocusIfFocusable,Sf=e.setupIntersectionObserver,Ef=e.appendChild,zr=e.appendChildToContainer,eu=e.commitTextUpdate,bf=e.commitMount,tu=e.commitUpdate,Rf=e.insertBefore,Do=e.insertInContainerBefore,Ci=e.removeChild,Tf=e.removeChildFromContainer,xc=e.resetTextContent,fi=e.hideInstance,$i=e.hideTextInstance,Lo=e.unhideInstance,ru=e.unhideTextInstance,Sc=e.clearContainer,Cf=e.cloneInstance,hi=e.createContainerChildSet,$a=e.appendChildToContainerChildSet,ds=e.finalizeContainerChildren,fs=e.replaceContainerChildren,qs=e.cloneHiddenInstance,Un=e.cloneHiddenTextInstance,Zn=e.canHydrateInstance,Ua=e.canHydrateTextInstance,Ui=e.canHydrateSuspenseInstance,Ai=e.isSuspenseInstancePending,Gi=e.isSuspenseInstanceFallback,Ec=e.getSuspenseInstanceFallbackErrorDetails,nu=e.registerSuspenseInstanceRetry,hs=e.getNextHydratableSibling,Gn=e.getFirstHydratableChild,ei=e.getFirstHydratableChildWithinContainer,yr=e.getFirstHydratableChildWithinSuspenseInstance,Qs=e.hydrateInstance,pi=e.hydrateTextInstance,bc=e.hydrateSuspenseInstance,Rc=e.getNextHydratableInstanceAfterSuspenseInstance,iu=e.commitHydratedContainer,au=e.commitHydratedSuspenseInstance,Tc=e.clearSuspenseBoundary,Fo=e.clearSuspenseBoundaryFromContainer,Cc=e.shouldDeleteUnhydratedTailInstances,ps=e.didNotMatchHydratedContainerTextInstance,su=e.didNotMatchHydratedTextInstance,Af=e.didNotHydrateInstanceWithinContainer,jo=e.didNotHydrateInstanceWithinSuspenseInstance,Pf=e.didNotHydrateInstance,mi=e.didNotFindHydratableInstanceWithinContainer,Mo=e.didNotFindHydratableTextInstanceWithinContainer,Io=e.didNotFindHydratableSuspenseInstanceWithinContainer,ms=e.didNotFindHydratableInstanceWithinSuspenseInstance,ou=e.didNotFindHydratableTextInstanceWithinSuspenseInstance,lu=e.didNotFindHydratableSuspenseInstanceWithinSuspenseInstance,Ac=e.didNotFindHydratableInstance,uu=e.didNotFindHydratableTextInstance,cu=e.didNotFindHydratableSuspenseInstance,gs=e.errorHydratingContainer,gn=0,ua,$o,du,gi,Bi,Uo,fu;function Pi(){}Pi.__reactDisabledLog=!0;function ca(){{if(gn===0){ua=console.log,$o=console.info,du=console.warn,gi=console.error,Bi=console.group,Uo=console.groupCollapsed,fu=console.groupEnd;var s={configurable:!0,enumerable:!0,value:Pi,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}gn++}}function Go(){{if(gn--,gn===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},s,{value:ua}),info:y({},s,{value:$o}),warn:y({},s,{value:du}),error:y({},s,{value:gi}),group:y({},s,{value:Bi}),groupCollapsed:y({},s,{value:Uo}),groupEnd:y({},s,{value:fu})})}gn<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Bo=a.ReactCurrentDispatcher,vs;function zi(s,c,N){{if(vs===void 0)try{throw Error()}catch(M){var L=M.stack.trim().match(/\n( *(at )?)/);vs=L&&L[1]||""}return`
115
+ `+vs+s}}var zo=!1,ys;{var Ho=typeof WeakMap=="function"?WeakMap:Map;ys=new Ho}function Vo(s,c){if(!s||zo)return"";{var N=ys.get(s);if(N!==void 0)return N}var L;zo=!0;var M=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=Bo.current,Bo.current=null,ca();try{if(c){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Ue){L=Ue}Reflect.construct(s,[],re)}else{try{re.call()}catch(Ue){L=Ue}s.call(re.prototype)}}else{try{throw Error()}catch(Ue){L=Ue}s()}}catch(Ue){if(Ue&&L&&typeof Ue.stack=="string"){for(var ie=Ue.stack.split(`
116
+ `),le=L.stack.split(`
117
+ `),he=ie.length-1,ve=le.length-1;he>=1&&ve>=0&&ie[he]!==le[ve];)ve--;for(;he>=1&&ve>=0;he--,ve--)if(ie[he]!==le[ve]){if(he!==1||ve!==1)do if(he--,ve--,ve<0||ie[he]!==le[ve]){var be=`
118
+ `+ie[he].replace(" at new "," at ");return s.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",s.displayName)),typeof s=="function"&&ys.set(s,be),be}while(he>=1&&ve>=0);break}}}finally{zo=!1,Bo.current=Y,Go(),Error.prepareStackTrace=M}var we=s?s.displayName||s.name:"",Me=we?zi(we):"";return typeof s=="function"&&ys.set(s,Me),Me}function Pc(s,c,N){return Vo(s,!0)}function Wo(s,c,N){return Vo(s,!1)}function hu(s){var c=s.prototype;return!!(c&&c.isReactComponent)}function Ga(s,c,N){if(s==null)return"";if(typeof s=="function")return Vo(s,hu(s));if(typeof s=="string")return zi(s);switch(s){case dt:return zi("Suspense");case yt:return zi("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case Qe:return Wo(s.render);case ut:return Ga(s.type,c,N);case ft:{var L=s,M=L._payload,Y=L._init;try{return Ga(Y(M),c,N)}catch{}}}return""}var Js=Object.prototype.hasOwnProperty,pu={},mu=a.ReactDebugCurrentFrame;function Hi(s){if(s){var c=s._owner,N=Ga(s.type,s._source,c?c.type:null);mu.setExtraStackFrame(N)}else mu.setExtraStackFrame(null)}function ti(s,c,N,L,M){{var Y=Function.call.bind(Js);for(var re in s)if(Y(s,re)){var ie=void 0;try{if(typeof s[re]!="function"){var le=Error((L||"React class")+": "+N+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw le.name="Invariant Violation",le}ie=s[re](c,re,L,N,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(he){ie=he}ie&&!(ie instanceof Error)&&(Hi(M),d("%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).",L||"React class",N,re,typeof ie),Hi(null)),ie instanceof Error&&!(ie.message in pu)&&(pu[ie.message]=!0,Hi(M),d("Failed %s type: %s",N,ie.message),Hi(null))}}}var Ba=[],yn;yn=[];var Bn=-1;function zn(s){return{current:s}}function mr(s,c){if(Bn<0){d("Unexpected pop.");return}c!==yn[Bn]&&d("Unexpected Fiber popped."),s.current=Ba[Bn],Ba[Bn]=null,yn[Bn]=null,Bn--}function Fr(s,c,N){Bn++,Ba[Bn]=s.current,yn[Bn]=N,s.current=c}var da;da={};var wn={};Object.freeze(wn);var vi=zn(wn),Zt=zn(!1),_s=wn;function fa(s,c,N){return N&&vn(c)?_s:vi.current}function Yo(s,c,N){{var L=s.stateNode;L.__reactInternalMemoizedUnmaskedChildContext=c,L.__reactInternalMemoizedMaskedChildContext=N}}function Vi(s,c){{var N=s.type,L=N.contextTypes;if(!L)return wn;var M=s.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===c)return M.__reactInternalMemoizedMaskedChildContext;var Y={};for(var re in L)Y[re]=c[re];{var ie=Ee(s)||"Unknown";ti(L,Y,"context",ie)}return M&&Yo(s,c,Y),Y}}function xs(){return Zt.current}function vn(s){{var c=s.childContextTypes;return c!=null}}function hr(s){mr(Zt,s),mr(vi,s)}function Rr(s){mr(Zt,s),mr(vi,s)}function jr(s,c,N){{if(vi.current!==wn)throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");Fr(vi,c,s),Fr(Zt,N,s)}}function Zs(s,c,N){{var L=s.stateNode,M=c.childContextTypes;if(typeof L.getChildContext!="function"){{var Y=Ee(s)||"Unknown";da[Y]||(da[Y]=!0,d("%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.",Y,Y))}return N}var re=L.getChildContext();for(var ie in re)if(!(ie in M))throw new Error((Ee(s)||"Unknown")+'.getChildContext(): key "'+ie+'" is not defined in childContextTypes.');{var le=Ee(s)||"Unknown";ti(M,re,"child context",le)}return y({},N,re)}}function ha(s){{var c=s.stateNode,N=c&&c.__reactInternalMemoizedMergedChildContext||wn;return _s=vi.current,Fr(vi,N,s),Fr(Zt,Zt.current,s),!0}}function Ss(s,c,N){{var L=s.stateNode;if(!L)throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(N){var M=Zs(s,c,_s);L.__reactInternalMemoizedMergedChildContext=M,mr(Zt,s),mr(vi,s),Fr(vi,M,s),Fr(Zt,N,s)}else mr(Zt,s),Fr(Zt,N,s)}}function wf(s){{if(!ci(s)||s.tag!==P)throw new 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 c=s;do{switch(c.tag){case k:return c.stateNode.context;case P:{var N=c.type;if(vn(N))return c.stateNode.__reactInternalMemoizedMergedChildContext;break}}c=c.return}while(c!==null);throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var Tr=0,Ko=1,Et=0,Ut=1,Ft=2,tr=8,Nn=16,Xo=Math.clz32?Math.clz32:Nc,gu=Math.log,wc=Math.LN2;function Nc(s){var c=s>>>0;return c===0?32:31-(gu(c)/wc|0)|0}var qo=31,$e=0,Mr=0,Tt=1,za=2,wi=4,yi=8,_i=16,pa=32,Wi=4194240,Es=64,eo=128,Qo=256,Jo=512,Zo=1024,el=2048,to=4096,tl=8192,rl=16384,nl=32768,vu=65536,il=131072,yu=262144,_u=524288,al=1048576,sl=2097152,ro=130023424,Yi=4194304,xu=8388608,Su=16777216,Eu=33554432,ma=67108864,ol=Yi,Ha=134217728,Oc=268435455,bs=268435456,ga=536870912,On=1073741824;function kc(s){{if(s&Tt)return"Sync";if(s&za)return"InputContinuousHydration";if(s&wi)return"InputContinuous";if(s&yi)return"DefaultHydration";if(s&_i)return"Default";if(s&pa)return"TransitionHydration";if(s&Wi)return"Transition";if(s&ro)return"Retry";if(s&Ha)return"SelectiveHydration";if(s&bs)return"IdleHydration";if(s&ga)return"Idle";if(s&On)return"Offscreen"}}var cr=-1,ll=Es,Qr=Yi;function Ir(s){switch(va(s)){case Tt:return Tt;case za:return za;case wi:return wi;case yi:return yi;case _i:return _i;case pa:return pa;case Es:case eo:case Qo:case Jo:case Zo:case el:case to:case tl:case rl:case nl:case vu:case il:case yu:case _u:case al:case sl:return s&Wi;case Yi:case xu:case Su:case Eu:case ma:return s&ro;case Ha:return Ha;case bs:return bs;case ga:return ga;case On:return On;default:return d("Should have found matching lanes. This is a bug in React."),s}}function no(s,c){var N=s.pendingLanes;if(N===$e)return $e;var L=$e,M=s.suspendedLanes,Y=s.pingedLanes,re=N&Oc;if(re!==$e){var ie=re&~M;if(ie!==$e)L=Ir(ie);else{var le=re&Y;le!==$e&&(L=Ir(le))}}else{var he=N&~M;he!==$e?L=Ir(he):Y!==$e&&(L=Ir(Y))}if(L===$e)return $e;if(c!==$e&&c!==L&&(c&M)===$e){var ve=va(L),be=va(c);if(ve>=be||ve===_i&&(be&Wi)!==$e)return c}(L&wi)!==$e&&(L|=N&_i);var we=s.entangledLanes;if(we!==$e)for(var Me=s.entanglements,Ue=L&we;Ue>0;){var Ie=ya(Ue),vt=1<<Ie;L|=Me[Ie],Ue&=~vt}return L}function Dc(s,c){for(var N=s.eventTimes,L=cr;c>0;){var M=ya(c),Y=1<<M,re=N[M];re>L&&(L=re),c&=~Y}return L}function Lc(s,c){switch(s){case Tt:case za:case wi:return c+250;case yi:case _i:case pa:case Es:case eo:case Qo:case Jo:case Zo:case el:case to:case tl:case rl:case nl:case vu:case il:case yu:case _u:case al:case sl:return c+5e3;case Yi:case xu:case Su:case Eu:case ma:return cr;case Ha:case bs:case ga:case On:return cr;default:return d("Should have found matching lanes. This is a bug in React."),cr}}function Fc(s,c){for(var N=s.pendingLanes,L=s.suspendedLanes,M=s.pingedLanes,Y=s.expirationTimes,re=N;re>0;){var ie=ya(re),le=1<<ie,he=Y[ie];he===cr?((le&L)===$e||(le&M)!==$e)&&(Y[ie]=Lc(le,c)):he<=c&&(s.expiredLanes|=le),re&=~le}}function jc(s){return Ir(s.pendingLanes)}function io(s){var c=s.pendingLanes&~On;return c!==$e?c:c&On?On:$e}function Mc(s){return(s&Tt)!==$e}function ao(s){return(s&Oc)!==$e}function bu(s){return(s&ro)===s}function Ic(s){var c=Tt|wi|_i;return(s&c)===$e}function Ru(s){return(s&Wi)===s}function Rs(s,c){var N=za|wi|yi|_i;return(c&N)!==$e}function $c(s,c){return(c&s.expiredLanes)!==$e}function ul(s){return(s&Wi)!==$e}function so(){var s=ll;return ll<<=1,(ll&Wi)===$e&&(ll=Es),s}function Nf(){var s=Qr;return Qr<<=1,(Qr&ro)===$e&&(Qr=Yi),s}function va(s){return s&-s}function Va(s){return va(s)}function ya(s){return 31-Xo(s)}function Ts(s){return ya(s)}function Cr(s,c){return(s&c)!==$e}function Cs(s,c){return(s&c)===c}function Rt(s,c){return s|c}function oo(s,c){return s&~c}function As(s,c){return s&c}function cl(s){return s}function dl(s,c){return s!==Mr&&s<c?s:c}function Ps(s){for(var c=[],N=0;N<qo;N++)c.push(s);return c}function ws(s,c,N){s.pendingLanes|=c,c!==ga&&(s.suspendedLanes=$e,s.pingedLanes=$e);var L=s.eventTimes,M=Ts(c);L[M]=N}function lo(s,c){s.suspendedLanes|=c,s.pingedLanes&=~c;for(var N=s.expirationTimes,L=c;L>0;){var M=ya(L),Y=1<<M;N[M]=cr,L&=~Y}}function Jr(s,c,N){s.pingedLanes|=s.suspendedLanes&c}function Of(s,c){var N=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=$e,s.pingedLanes=$e,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c;for(var L=s.entanglements,M=s.eventTimes,Y=s.expirationTimes,re=N;re>0;){var ie=ya(re),le=1<<ie;L[ie]=$e,M[ie]=cr,Y[ie]=cr,re&=~le}}function Tu(s,c){for(var N=s.entangledLanes|=c,L=s.entanglements,M=N;M;){var Y=ya(M),re=1<<Y;re&c|L[Y]&c&&(L[Y]|=c),M&=~re}}function fl(s,c){var N=va(c),L;switch(N){case wi:L=za;break;case _i:L=yi;break;case Es:case eo:case Qo:case Jo:case Zo:case el:case to:case tl:case rl:case nl:case vu:case il:case yu:case _u:case al:case sl:case Yi:case xu:case Su:case Eu:case ma:L=pa;break;case ga:L=bs;break;default:L=Mr;break}return(L&(s.suspendedLanes|c))!==Mr?Mr:L}function Zr(s,c,N){if(Ln)for(var L=s.pendingUpdatersLaneMap;N>0;){var M=Ts(N),Y=1<<M,re=L[M];re.add(c),N&=~Y}}function Uc(s,c){if(Ln)for(var N=s.pendingUpdatersLaneMap,L=s.memoizedUpdaters;c>0;){var M=Ts(c),Y=1<<M,re=N[M];re.size>0&&(re.forEach(function(ie){var le=ie.alternate;(le===null||!L.has(le))&&L.add(ie)}),re.clear()),c&=~Y}}function ct(s,c){return null}var _n=Tt,Wa=wi,Ns=_i,Cu=ga,Ki=Mr;function kn(){return Ki}function wr(s){Ki=s}function Gc(s,c){var N=Ki;try{return Ki=s,c()}finally{Ki=N}}function Bc(s,c){return s!==0&&s<c?s:c}function zc(s,c){return s===0||s>c?s:c}function hl(s,c){return s!==0&&s<c}function pl(s){var c=va(s);return hl(_n,c)?hl(Wa,c)?ao(c)?Ns:Cu:Wa:_n}var Hr=n.unstable_scheduleCallback,xi=n.unstable_cancelCallback,Ni=n.unstable_shouldYield,Au=n.unstable_requestPaint,$r=n.unstable_now,Dn=n.unstable_ImmediatePriority,Pu=n.unstable_UserBlockingPriority,xn=n.unstable_NormalPriority,Hc=n.unstable_IdlePriority,Vc=n.unstable_yieldValue,Wc=n.unstable_setDisableYieldValue,Ya=null,en=null,et=null,Hn=!1,Ln=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function ml(s){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled)return!0;if(!c.supportsFiber)return d("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{S&&(s=y({},s,{getLaneLabelMap:Ou,injectProfilingHooks:Yc})),Ya=c.inject(s),en=c}catch(N){d("React instrumentation encountered an error: %s.",N)}return!!c.checkDCE}function gl(s,c){if(en&&typeof en.onScheduleFiberRoot=="function")try{en.onScheduleFiberRoot(Ya,s,c)}catch(N){Hn||(Hn=!0,d("React instrumentation encountered an error: %s",N))}}function uo(s,c){if(en&&typeof en.onCommitFiberRoot=="function")try{var N=(s.current.flags&Nt)===Nt;if(A){var L;switch(c){case _n:L=Dn;break;case Wa:L=Pu;break;case Ns:L=xn;break;case Cu:L=Hc;break;default:L=xn;break}en.onCommitFiberRoot(Ya,s,L,N)}}catch(M){Hn||(Hn=!0,d("React instrumentation encountered an error: %s",M))}}function wu(s){if(en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Ya,s)}catch(c){Hn||(Hn=!0,d("React instrumentation encountered an error: %s",c))}}function Nu(s){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ya,s)}catch(c){Hn||(Hn=!0,d("React instrumentation encountered an error: %s",c))}}function Nr(s){if(typeof Vc=="function"&&(Wc(s),u(s)),en&&typeof en.setStrictMode=="function")try{en.setStrictMode(Ya,s)}catch(c){Hn||(Hn=!0,d("React instrumentation encountered an error: %s",c))}}function Yc(s){et=s}function Ou(){{for(var s=new Map,c=1,N=0;N<qo;N++){var L=kc(c);s.set(c,L),c*=2}return s}}function kf(s){et!==null&&typeof et.markCommitStarted=="function"&&et.markCommitStarted(s)}function co(){et!==null&&typeof et.markCommitStopped=="function"&&et.markCommitStopped()}function Ka(s){et!==null&&typeof et.markComponentRenderStarted=="function"&&et.markComponentRenderStarted(s)}function pr(){et!==null&&typeof et.markComponentRenderStopped=="function"&&et.markComponentRenderStopped()}function Mt(s){et!==null&&typeof et.markComponentPassiveEffectMountStarted=="function"&&et.markComponentPassiveEffectMountStarted(s)}function Vr(){et!==null&&typeof et.markComponentPassiveEffectMountStopped=="function"&&et.markComponentPassiveEffectMountStopped()}function Or(s){et!==null&&typeof et.markComponentPassiveEffectUnmountStarted=="function"&&et.markComponentPassiveEffectUnmountStarted(s)}function tn(){et!==null&&typeof et.markComponentPassiveEffectUnmountStopped=="function"&&et.markComponentPassiveEffectUnmountStopped()}function Vn(s){et!==null&&typeof et.markComponentLayoutEffectMountStarted=="function"&&et.markComponentLayoutEffectMountStarted(s)}function Os(){et!==null&&typeof et.markComponentLayoutEffectMountStopped=="function"&&et.markComponentLayoutEffectMountStopped()}function kr(s){et!==null&&typeof et.markComponentLayoutEffectUnmountStarted=="function"&&et.markComponentLayoutEffectUnmountStarted(s)}function ks(){et!==null&&typeof et.markComponentLayoutEffectUnmountStopped=="function"&&et.markComponentLayoutEffectUnmountStopped()}function Xa(s,c,N){et!==null&&typeof et.markComponentErrored=="function"&&et.markComponentErrored(s,c,N)}function vl(s,c,N){et!==null&&typeof et.markComponentSuspended=="function"&&et.markComponentSuspended(s,c,N)}function ku(s){et!==null&&typeof et.markLayoutEffectsStarted=="function"&&et.markLayoutEffectsStarted(s)}function fo(){et!==null&&typeof et.markLayoutEffectsStopped=="function"&&et.markLayoutEffectsStopped()}function Fn(s){et!==null&&typeof et.markPassiveEffectsStarted=="function"&&et.markPassiveEffectsStarted(s)}function Du(){et!==null&&typeof et.markPassiveEffectsStopped=="function"&&et.markPassiveEffectsStopped()}function yl(s){et!==null&&typeof et.markRenderStarted=="function"&&et.markRenderStarted(s)}function Xi(){et!==null&&typeof et.markRenderYielded=="function"&&et.markRenderYielded()}function qa(){et!==null&&typeof et.markRenderStopped=="function"&&et.markRenderStopped()}function _l(s){et!==null&&typeof et.markRenderScheduled=="function"&&et.markRenderScheduled(s)}function Lu(s,c){et!==null&&typeof et.markForceUpdateScheduled=="function"&&et.markForceUpdateScheduled(s,c)}function Oi(s,c){et!==null&&typeof et.markStateUpdateScheduled=="function"&&et.markStateUpdateScheduled(s,c)}function xl(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Dr=typeof Object.is=="function"?Object.is:xl,ri=null,Qa=!1,ho=!1;function po(s){ri===null?ri=[s]:ri.push(s)}function Sl(s){Qa=!0,po(s)}function rn(){Qa&&nn()}function nn(){if(!ho&&ri!==null){ho=!0;var s=0,c=kn();try{var N=!0,L=ri;for(wr(_n);s<L.length;s++){var M=L[s];do M=M(N);while(M!==null)}ri=null,Qa=!1}catch(Y){throw ri!==null&&(ri=ri.slice(s+1)),Hr(Dn,nn),Y}finally{wr(c),ho=!1}}return null}function Wn(s){var c=s.current.memoizedState;return c.isDehydrated}var Ur=[],Ja=0,Ds=null,Ls=0,ni=[],Gr=0,_a=null,ki=1,Si="";function Za(s){return Yn(),(s.flags&ze)!==Pe}function Kc(s){return Yn(),Ls}function Xc(){var s=Si,c=ki,N=c&~qc(c);return N.toString(32)+s}function qi(s,c){Yn(),Ur[Ja++]=Ls,Ur[Ja++]=Ds,Ds=s,Ls=c}function mo(s,c,N){Yn(),ni[Gr++]=ki,ni[Gr++]=Si,ni[Gr++]=_a,_a=s;var L=ki,M=Si,Y=El(L)-1,re=L&~(1<<Y),ie=N+1,le=El(c)+Y;if(le>30){var he=Y-Y%5,ve=(1<<he)-1,be=(re&ve).toString(32),we=re>>he,Me=Y-he,Ue=El(c)+Me,Ie=ie<<Me,vt=Ie|we,Ct=be+M;ki=1<<Ue|vt,Si=Ct}else{var St=ie<<Y,or=St|re,Kt=M;ki=1<<le|or,Si=Kt}}function Fu(s){Yn();var c=s.return;if(c!==null){var N=1,L=0;qi(s,N),mo(s,N,L)}}function El(s){return 32-Xo(s)}function qc(s){return 1<<El(s)-1}function bl(s){for(;s===Ds;)Ds=Ur[--Ja],Ur[Ja]=null,Ls=Ur[--Ja],Ur[Ja]=null;for(;s===_a;)_a=ni[--Gr],ni[Gr]=null,Si=ni[--Gr],ni[Gr]=null,ki=ni[--Gr],ni[Gr]=null}function es(){return Yn(),_a!==null?{id:ki,overflow:Si}:null}function Df(s,c){Yn(),ni[Gr++]=ki,ni[Gr++]=Si,ni[Gr++]=_a,ki=c.id,Si=c.overflow,_a=s}function Yn(){j()||d("Expected to be hydrating. This is a bug in React. Please file an issue.")}var Wr=null,Wt=null,Ei=!1,Qi=!1,xa=null;function Lf(){Ei&&d("We should not be hydrating here. This is a bug in React. Please file a bug.")}function ju(){Qi=!0}function Qc(){return Qi}function Ff(s){if(!mn)return!1;var c=s.stateNode.containerInfo;return Wt=ei(c),Wr=s,Ei=!0,xa=null,Qi=!1,!0}function ii(s,c,N){return mn?(Wt=yr(c),Wr=s,Ei=!0,xa=null,Qi=!1,N!==null&&Df(s,N),!0):!1}function Rl(s,c){switch(s.tag){case k:{Af(s.stateNode.containerInfo,c);break}case F:{var N=(s.mode&Ut)!==Et;Pf(s.type,s.memoizedProps,s.stateNode,c,N);break}case $:{var L=s.memoizedState;L.dehydrated!==null&&jo(L.dehydrated,c);break}}}function Jc(s,c){Rl(s,c);var N=B_();N.stateNode=c,N.return=s;var L=s.deletions;L===null?(s.deletions=[N],s.flags|=Ht):L.push(N)}function Di(s,c){{if(Qi)return;switch(s.tag){case k:{var N=s.stateNode.containerInfo;switch(c.tag){case F:var L=c.type,M=c.pendingProps;mi(N,L,M);break;case G:var Y=c.pendingProps;Mo(N,Y);break;case $:Io(N);break}break}case F:{var re=s.type,ie=s.memoizedProps,le=s.stateNode;switch(c.tag){case F:{var he=c.type,ve=c.pendingProps,be=(s.mode&Ut)!==Et;Ac(re,ie,le,he,ve,be);break}case G:{var we=c.pendingProps,Me=(s.mode&Ut)!==Et;uu(re,ie,le,we,Me);break}case $:{cu(re,ie,le);break}}break}case $:{var Ue=s.memoizedState,Ie=Ue.dehydrated;if(Ie!==null)switch(c.tag){case F:var vt=c.type,Ct=c.pendingProps;ms(Ie,vt,Ct);break;case G:var St=c.pendingProps;ou(Ie,St);break;case $:lu(Ie);break}break}default:return}}}function go(s,c){c.flags=c.flags&~ui|nt,Di(s,c)}function Sa(s,c){switch(s.tag){case F:{var N=s.type,L=s.pendingProps,M=Zn(c,N,L);return M!==null?(s.stateNode=M,Wr=s,Wt=Gn(M),!0):!1}case G:{var Y=s.pendingProps,re=Ua(c,Y);return re!==null?(s.stateNode=re,Wr=s,Wt=null,!0):!1}case $:{var ie=Ui(c);if(ie!==null){var le={dehydrated:ie,treeContext:es(),retryLane:On};s.memoizedState=le;var he=z_(ie);return he.return=s,s.child=he,Wr=s,Wt=null,!0}return!1}default:return!1}}function Fs(s){return(s.mode&Ut)!==Et&&(s.flags&Nt)===Pe}function vo(s){throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function yo(s){if(Ei){var c=Wt;if(!c){Fs(s)&&(Di(Wr,s),vo()),go(Wr,s),Ei=!1,Wr=s;return}var N=c;if(!Sa(s,c)){Fs(s)&&(Di(Wr,s),vo()),c=hs(N);var L=Wr;if(!c||!Sa(s,c)){go(Wr,s),Ei=!1,Wr=s;return}Jc(L,N)}}}function jf(s,c,N){if(!mn)throw new Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var L=s.stateNode,M=!Qi,Y=Qs(L,s.type,s.memoizedProps,c,N,s,M);return s.updateQueue=Y,Y!==null}function Zc(s){if(!mn)throw new Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var c=s.stateNode,N=s.memoizedProps,L=!Qi,M=pi(c,N,s,L);if(M){var Y=Wr;if(Y!==null)switch(Y.tag){case k:{var re=Y.stateNode.containerInfo,ie=(Y.mode&Ut)!==Et;ps(re,c,N,ie);break}case F:{var le=Y.type,he=Y.memoizedProps,ve=Y.stateNode,be=(Y.mode&Ut)!==Et;su(le,he,ve,c,N,be);break}}}return M}function ed(s){if(!mn)throw new Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var c=s.memoizedState,N=c!==null?c.dehydrated:null;if(!N)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");bc(N,s)}function td(s){if(!mn)throw new Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");var c=s.memoizedState,N=c!==null?c.dehydrated:null;if(!N)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return Rc(N)}function Mu(s){for(var c=s.return;c!==null&&c.tag!==F&&c.tag!==k&&c.tag!==$;)c=c.return;Wr=c}function ts(s){if(!mn||s!==Wr)return!1;if(!Ei)return Mu(s),Ei=!0,!1;if(s.tag!==k&&(s.tag!==F||Cc(s.type)&&!No(s.type,s.memoizedProps))){var c=Wt;if(c)if(Fs(s))rd(s),vo();else for(;c;)Jc(s,c),c=hs(c)}return Mu(s),s.tag===$?Wt=td(s):Wt=Wr?hs(s.stateNode):null,!0}function Mf(){return Ei&&Wt!==null}function rd(s){for(var c=Wt;c;)Rl(s,c),c=hs(c)}function v(){mn&&(Wr=null,Wt=null,Ei=!1,Qi=!1)}function b(){xa!==null&&(Ug(xa),xa=null)}function j(){return Ei}function H(s){xa===null?xa=[s]:xa.push(s)}var K=a.ReactCurrentBatchConfig,te=null;function ue(){return K.transition}function _e(s,c){if(Dr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var N=Object.keys(s),L=Object.keys(c);if(N.length!==L.length)return!1;for(var M=0;M<N.length;M++){var Y=N[M];if(!Js.call(c,Y)||!Dr(s[Y],c[Y]))return!1}return!0}function Oe(s){switch(s._debugOwner&&s._debugOwner.type,s._debugSource,s.tag){case F:return zi(s.type);case X:return zi("Lazy");case $:return zi("Suspense");case ne:return zi("SuspenseList");case w:case O:case B:return Wo(s.type);case z:return Wo(s.type.render);case P:return Pc(s.type);default:return""}}function Ve(s){try{var c="",N=s;do c+=Oe(N),N=N.return;while(N);return c}catch(L){return`
119
+ Error generating stack: `+L.message+`
120
+ `+L.stack}}var ht=a.ReactDebugCurrentFrame,_t=null,tt=!1;function gr(){{if(_t===null)return null;var s=_t._debugOwner;if(s!==null&&typeof s<"u")return Ee(s)}return null}function dr(){return _t===null?"":Ve(_t)}function ar(){ht.getCurrentStack=null,_t=null,tt=!1}function nr(s){ht.getCurrentStack=s===null?null:dr,_t=s,tt=!1}function Ae(){return _t}function xe(s){tt=s}var ke={recordUnsafeLifecycleWarnings:function(s,c){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(s,c){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var st=function(s){for(var c=null,N=s;N!==null;)N.mode&tr&&(c=N),N=N.return;return c},gt=function(s){var c=[];return s.forEach(function(N){c.push(N)}),c.sort().join(", ")},Ot=[],At=[],Bt=[],xr=[],zt=[],ai=[],rs=new Set;ke.recordUnsafeLifecycleWarnings=function(s,c){rs.has(s.type)||(typeof c.componentWillMount=="function"&&c.componentWillMount.__suppressDeprecationWarning!==!0&&Ot.push(s),s.mode&tr&&typeof c.UNSAFE_componentWillMount=="function"&&At.push(s),typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Bt.push(s),s.mode&tr&&typeof c.UNSAFE_componentWillReceiveProps=="function"&&xr.push(s),typeof c.componentWillUpdate=="function"&&c.componentWillUpdate.__suppressDeprecationWarning!==!0&&zt.push(s),s.mode&tr&&typeof c.UNSAFE_componentWillUpdate=="function"&&ai.push(s))},ke.flushPendingUnsafeLifecycleWarnings=function(){var s=new Set;Ot.length>0&&(Ot.forEach(function(we){s.add(Ee(we)||"Component"),rs.add(we.type)}),Ot=[]);var c=new Set;At.length>0&&(At.forEach(function(we){c.add(Ee(we)||"Component"),rs.add(we.type)}),At=[]);var N=new Set;Bt.length>0&&(Bt.forEach(function(we){N.add(Ee(we)||"Component"),rs.add(we.type)}),Bt=[]);var L=new Set;xr.length>0&&(xr.forEach(function(we){L.add(Ee(we)||"Component"),rs.add(we.type)}),xr=[]);var M=new Set;zt.length>0&&(zt.forEach(function(we){M.add(Ee(we)||"Component"),rs.add(we.type)}),zt=[]);var Y=new Set;if(ai.length>0&&(ai.forEach(function(we){Y.add(Ee(we)||"Component"),rs.add(we.type)}),ai=[]),c.size>0){var re=gt(c);d(`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.
121
+
122
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
123
+
124
+ Please update the following components: %s`,re)}if(L.size>0){var ie=gt(L);d(`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.
125
+
126
+ * Move data fetching code or side effects to componentDidUpdate.
127
+ * 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
128
+
129
+ Please update the following components: %s`,ie)}if(Y.size>0){var le=gt(Y);d(`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.
130
+
131
+ * Move data fetching code or side effects to componentDidUpdate.
132
+
133
+ Please update the following components: %s`,le)}if(s.size>0){var he=gt(s);f(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
134
+
135
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
136
+ * 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.
137
+
138
+ Please update the following components: %s`,he)}if(N.size>0){var ve=gt(N);f(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
139
+
140
+ * Move data fetching code or side effects to componentDidUpdate.
141
+ * 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
142
+ * 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.
143
+
144
+ Please update the following components: %s`,ve)}if(M.size>0){var be=gt(M);f(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
145
+
146
+ * Move data fetching code or side effects to componentDidUpdate.
147
+ * 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.
148
+
149
+ Please update the following components: %s`,be)}};var nd=new Map,Hp=new Set;ke.recordLegacyContextWarning=function(s,c){var N=st(s);if(N===null){d("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(!Hp.has(s.type)){var L=nd.get(N);(s.type.contextTypes!=null||s.type.childContextTypes!=null||c!==null&&typeof c.getChildContext=="function")&&(L===void 0&&(L=[],nd.set(N,L)),L.push(s))}},ke.flushLegacyContextWarning=function(){nd.forEach(function(s,c){if(s.length!==0){var N=s[0],L=new Set;s.forEach(function(Y){L.add(Ee(Y)||"Component"),Hp.add(Y.type)});var M=gt(L);try{nr(N),d(`Legacy context API has been detected within a strict-mode tree.
150
+
151
+ The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
152
+
153
+ Please update the following components: %s
154
+
155
+ Learn more about this warning here: https://reactjs.org/link/legacy-context`,M)}finally{ar()}}})},ke.discardPendingWarnings=function(){Ot=[],At=[],Bt=[],xr=[],zt=[],ai=[],nd=new Map}}function Vp(s){{var c=typeof Symbol=="function"&&Symbol.toStringTag,N=c&&s[Symbol.toStringTag]||s.constructor.name||"Object";return N}}function Wp(s){try{return If(s),!1}catch{return!0}}function If(s){return""+s}function Nv(s){if(Wp(s))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Vp(s)),If(s)}function Ov(s,c){if(Wp(s))return d("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",c,Vp(s)),If(s)}function Ji(s,c){if(s&&s.defaultProps){var N=y({},c),L=s.defaultProps;for(var M in L)N[M]===void 0&&(N[M]=L[M]);return N}return c}var id=zn(null),Iu;Iu={};var ad=null,Tl=null,$f=null,sd=!1;function od(){ad=null,Tl=null,$f=null,sd=!1}function Yp(){sd=!0}function Kp(){sd=!1}function Xp(s,c,N){Oo?(Fr(id,c._currentValue,s),c._currentValue=N,c._currentRenderer!==void 0&&c._currentRenderer!==null&&c._currentRenderer!==Iu&&d("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),c._currentRenderer=Iu):(Fr(id,c._currentValue2,s),c._currentValue2=N,c._currentRenderer2!==void 0&&c._currentRenderer2!==null&&c._currentRenderer2!==Iu&&d("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),c._currentRenderer2=Iu)}function Uf(s,c){var N=id.current;mr(id,c),Oo?s._currentValue=N:s._currentValue2=N}function Gf(s,c,N){for(var L=s;L!==null;){var M=L.alternate;if(Cs(L.childLanes,c)?M!==null&&!Cs(M.childLanes,c)&&(M.childLanes=Rt(M.childLanes,c)):(L.childLanes=Rt(L.childLanes,c),M!==null&&(M.childLanes=Rt(M.childLanes,c))),L===N)break;L=L.return}L!==N&&d("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function kv(s,c,N){Dv(s,c,N)}function Dv(s,c,N){var L=s.child;for(L!==null&&(L.return=s);L!==null;){var M=void 0,Y=L.dependencies;if(Y!==null){M=L.child;for(var re=Y.firstContext;re!==null;){if(re.context===c){if(L.tag===P){var ie=Va(N),le=ns(cr,ie);le.tag=ud;var he=L.updateQueue;if(he!==null){var ve=he.shared,be=ve.pending;be===null?le.next=le:(le.next=be.next,be.next=le),ve.pending=le}}L.lanes=Rt(L.lanes,N);var we=L.alternate;we!==null&&(we.lanes=Rt(we.lanes,N)),Gf(L.return,N,s),Y.lanes=Rt(Y.lanes,N);break}re=re.next}}else if(L.tag===q)M=L.type===s.type?null:L.child;else if(L.tag===J){var Me=L.return;if(Me===null)throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");Me.lanes=Rt(Me.lanes,N);var Ue=Me.alternate;Ue!==null&&(Ue.lanes=Rt(Ue.lanes,N)),Gf(Me,N,s),M=L.sibling}else M=L.child;if(M!==null)M.return=L;else for(M=L;M!==null;){if(M===s){M=null;break}var Ie=M.sibling;if(Ie!==null){Ie.return=M.return,M=Ie;break}M=M.return}L=M}}function Cl(s,c){ad=s,Tl=null,$f=null;var N=s.dependencies;if(N!==null){var L=N.firstContext;L!==null&&(Cr(N.lanes,c)&&Zu(),N.firstContext=null)}}function Yr(s){sd&&d("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().");var c=Oo?s._currentValue:s._currentValue2;if($f!==s){var N={context:s,memoizedValue:c,next:null};if(Tl===null){if(ad===null)throw new 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().");Tl=N,ad.dependencies={lanes:$e,firstContext:N}}else Tl=Tl.next=N}return c}var _o=null;function Bf(s){_o===null?_o=[s]:_o.push(s)}function Lv(){if(_o!==null){for(var s=0;s<_o.length;s++){var c=_o[s],N=c.interleaved;if(N!==null){c.interleaved=null;var L=N.next,M=c.pending;if(M!==null){var Y=M.next;M.next=L,N.next=Y}c.pending=N}}_o=null}}function qp(s,c,N,L){var M=c.interleaved;return M===null?(N.next=N,Bf(c)):(N.next=M.next,M.next=N),c.interleaved=N,ld(s,L)}function Fv(s,c,N,L){var M=c.interleaved;M===null?(N.next=N,Bf(c)):(N.next=M.next,M.next=N),c.interleaved=N}function jv(s,c,N,L){var M=c.interleaved;return M===null?(N.next=N,Bf(c)):(N.next=M.next,M.next=N),c.interleaved=N,ld(s,L)}function Kn(s,c){return ld(s,c)}var Mv=ld;function ld(s,c){s.lanes=Rt(s.lanes,c);var N=s.alternate;N!==null&&(N.lanes=Rt(N.lanes,c)),N===null&&(s.flags&(nt|ui))!==Pe&&Qg(s);for(var L=s,M=s.return;M!==null;)M.childLanes=Rt(M.childLanes,c),N=M.alternate,N!==null?N.childLanes=Rt(N.childLanes,c):(M.flags&(nt|ui))!==Pe&&Qg(s),L=M,M=M.return;if(L.tag===k){var Y=L.stateNode;return Y}else return null}var Qp=0,Jp=1,ud=2,zf=3,cd=!1,Hf,dd;Hf=!1,dd=null;function Vf(s){var c={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:$e},effects:null};s.updateQueue=c}function Zp(s,c){var N=c.updateQueue,L=s.updateQueue;if(N===L){var M={baseState:L.baseState,firstBaseUpdate:L.firstBaseUpdate,lastBaseUpdate:L.lastBaseUpdate,shared:L.shared,effects:L.effects};c.updateQueue=M}}function ns(s,c){var N={eventTime:s,lane:c,tag:Qp,payload:null,callback:null,next:null};return N}function js(s,c,N){var L=s.updateQueue;if(L===null)return null;var M=L.shared;if(dd===M&&!Hf&&(d("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."),Hf=!0),qy()){var Y=M.pending;return Y===null?c.next=c:(c.next=Y.next,Y.next=c),M.pending=c,Mv(s,N)}else return jv(s,M,c,N)}function fd(s,c,N){var L=c.updateQueue;if(L!==null){var M=L.shared;if(ul(N)){var Y=M.lanes;Y=As(Y,s.pendingLanes);var re=Rt(Y,N);M.lanes=re,Tu(s,re)}}}function Wf(s,c){var N=s.updateQueue,L=s.alternate;if(L!==null){var M=L.updateQueue;if(N===M){var Y=null,re=null,ie=N.firstBaseUpdate;if(ie!==null){var le=ie;do{var he={eventTime:le.eventTime,lane:le.lane,tag:le.tag,payload:le.payload,callback:le.callback,next:null};re===null?Y=re=he:(re.next=he,re=he),le=le.next}while(le!==null);re===null?Y=re=c:(re.next=c,re=c)}else Y=re=c;N={baseState:M.baseState,firstBaseUpdate:Y,lastBaseUpdate:re,shared:M.shared,effects:M.effects},s.updateQueue=N;return}}var ve=N.lastBaseUpdate;ve===null?N.firstBaseUpdate=c:ve.next=c,N.lastBaseUpdate=c}function Iv(s,c,N,L,M,Y){switch(N.tag){case Jp:{var re=N.payload;if(typeof re=="function"){Yp();var ie=re.call(Y,L,M);{if(s.mode&tr){Nr(!0);try{re.call(Y,L,M)}finally{Nr(!1)}}Kp()}return ie}return re}case zf:s.flags=s.flags&~qr|Nt;case Qp:{var le=N.payload,he;if(typeof le=="function"){Yp(),he=le.call(Y,L,M);{if(s.mode&tr){Nr(!0);try{le.call(Y,L,M)}finally{Nr(!1)}}Kp()}}else he=le;return he==null?L:y({},L,he)}case ud:return cd=!0,L}return L}function hd(s,c,N,L){var M=s.updateQueue;cd=!1,dd=M.shared;var Y=M.firstBaseUpdate,re=M.lastBaseUpdate,ie=M.shared.pending;if(ie!==null){M.shared.pending=null;var le=ie,he=le.next;le.next=null,re===null?Y=he:re.next=he,re=le;var ve=s.alternate;if(ve!==null){var be=ve.updateQueue,we=be.lastBaseUpdate;we!==re&&(we===null?be.firstBaseUpdate=he:we.next=he,be.lastBaseUpdate=le)}}if(Y!==null){var Me=M.baseState,Ue=$e,Ie=null,vt=null,Ct=null,St=Y;do{var or=St.lane,Kt=St.eventTime;if(Cs(L,or)){if(Ct!==null){var Fe={eventTime:Kt,lane:Mr,tag:St.tag,payload:St.payload,callback:St.callback,next:null};Ct=Ct.next=Fe}Me=Iv(s,M,St,Me,c,N);var Re=St.callback;if(Re!==null&&St.lane!==Mr){s.flags|=Qt;var Ye=M.effects;Ye===null?M.effects=[St]:Ye.push(St)}}else{var Te={eventTime:Kt,lane:or,tag:St.tag,payload:St.payload,callback:St.callback,next:null};Ct===null?(vt=Ct=Te,Ie=Me):Ct=Ct.next=Te,Ue=Rt(Ue,or)}if(St=St.next,St===null){if(ie=M.shared.pending,ie===null)break;var mt=ie,lt=mt.next;mt.next=null,St=lt,M.lastBaseUpdate=mt,M.shared.pending=null}}while(!0);Ct===null&&(Ie=Me),M.baseState=Ie,M.firstBaseUpdate=vt,M.lastBaseUpdate=Ct;var Yt=M.shared.interleaved;if(Yt!==null){var Pt=Yt;do Ue=Rt(Ue,Pt.lane),Pt=Pt.next;while(Pt!==Yt)}else Y===null&&(M.shared.lanes=$e);hc(Ue),s.lanes=Ue,s.memoizedState=Me}dd=null}function $v(s,c){if(typeof s!="function")throw new Error("Invalid argument passed as callback. Expected a function. Instead "+("received: "+s));s.call(c)}function em(){cd=!1}function pd(){return cd}function tm(s,c,N){var L=c.effects;if(c.effects=null,L!==null)for(var M=0;M<L.length;M++){var Y=L[M],re=Y.callback;re!==null&&(Y.callback=null,$v(re,N))}}var Yf={},rm=new t.Component().refs,Kf,Xf,qf,Qf,Jf,nm,md,Zf,eh,th;{Kf=new Set,Xf=new Set,qf=new Set,Qf=new Set,Zf=new Set,Jf=new Set,eh=new Set,th=new Set;var im=new Set;md=function(s,c){if(!(s===null||typeof s=="function")){var N=c+"_"+s;im.has(N)||(im.add(N),d("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",c,s))}},nm=function(s,c){if(c===void 0){var N=De(s)||"Component";Jf.has(N)||(Jf.add(N),d("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",N))}},Object.defineProperty(Yf,"_processChildContext",{enumerable:!1,value:function(){throw new 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(Yf)}function rh(s,c,N,L){var M=s.memoizedState,Y=N(L,M);{if(s.mode&tr){Nr(!0);try{Y=N(L,M)}finally{Nr(!1)}}nm(c,Y)}var re=Y==null?M:y({},M,Y);if(s.memoizedState=re,s.lanes===$e){var ie=s.updateQueue;ie.baseState=re}}var nh={isMounted:Vl,enqueueSetState:function(s,c,N){var L=E(s),M=Mn(),Y=zs(L),re=ns(M,Y);re.payload=c,N!=null&&(md(N,"setState"),re.callback=N);var ie=js(L,re,Y);ie!==null&&(Xr(ie,L,Y,M),fd(ie,L,Y)),Oi(L,Y)},enqueueReplaceState:function(s,c,N){var L=E(s),M=Mn(),Y=zs(L),re=ns(M,Y);re.tag=Jp,re.payload=c,N!=null&&(md(N,"replaceState"),re.callback=N);var ie=js(L,re,Y);ie!==null&&(Xr(ie,L,Y,M),fd(ie,L,Y)),Oi(L,Y)},enqueueForceUpdate:function(s,c){var N=E(s),L=Mn(),M=zs(N),Y=ns(L,M);Y.tag=ud,c!=null&&(md(c,"forceUpdate"),Y.callback=c);var re=js(N,Y,M);re!==null&&(Xr(re,N,M,L),fd(re,N,M)),Lu(N,M)}};function am(s,c,N,L,M,Y,re){var ie=s.stateNode;if(typeof ie.shouldComponentUpdate=="function"){var le=ie.shouldComponentUpdate(L,Y,re);{if(s.mode&tr){Nr(!0);try{le=ie.shouldComponentUpdate(L,Y,re)}finally{Nr(!1)}}le===void 0&&d("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",De(c)||"Component")}return le}return c.prototype&&c.prototype.isPureReactComponent?!_e(N,L)||!_e(M,Y):!0}function Uv(s,c,N){var L=s.stateNode;{var M=De(c)||"Component",Y=L.render;Y||(c.prototype&&typeof c.prototype.render=="function"?d("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",M):d("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",M)),L.getInitialState&&!L.getInitialState.isReactClassApproved&&!L.state&&d("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?",M),L.getDefaultProps&&!L.getDefaultProps.isReactClassApproved&&d("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.",M),L.propTypes&&d("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",M),L.contextType&&d("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",M),L.contextTypes&&d("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",M),c.contextType&&c.contextTypes&&!eh.has(c)&&(eh.add(c),d("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",M)),typeof L.componentShouldUpdate=="function"&&d("%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.",M),c.prototype&&c.prototype.isPureReactComponent&&typeof L.shouldComponentUpdate<"u"&&d("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",De(c)||"A pure component"),typeof L.componentDidUnmount=="function"&&d("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",M),typeof L.componentDidReceiveProps=="function"&&d("%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().",M),typeof L.componentWillRecieveProps=="function"&&d("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",M),typeof L.UNSAFE_componentWillRecieveProps=="function"&&d("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",M);var re=L.props!==N;L.props!==void 0&&re&&d("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",M,M),L.defaultProps&&d("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",M,M),typeof L.getSnapshotBeforeUpdate=="function"&&typeof L.componentDidUpdate!="function"&&!qf.has(c)&&(qf.add(c),d("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",De(c))),typeof L.getDerivedStateFromProps=="function"&&d("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",M),typeof L.getDerivedStateFromError=="function"&&d("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",M),typeof c.getSnapshotBeforeUpdate=="function"&&d("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",M);var ie=L.state;ie&&(typeof ie!="object"||$t(ie))&&d("%s.state: must be set to an object or null",M),typeof L.getChildContext=="function"&&typeof c.childContextTypes!="object"&&d("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",M)}}function sm(s,c){c.updater=nh,s.stateNode=c,p(c,s),c._reactInternalInstance=Yf}function om(s,c,N){var L=!1,M=wn,Y=wn,re=c.contextType;if("contextType"in c){var ie=re===null||re!==void 0&&re.$$typeof===Ke&&re._context===void 0;if(!ie&&!th.has(c)){th.add(c);var le="";re===void 0?le=" 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 re!="object"?le=" However, it is set to a "+typeof re+".":re.$$typeof===He?le=" Did you accidentally pass the Context.Provider instead?":re._context!==void 0?le=" Did you accidentally pass the Context.Consumer instead?":le=" However, it is set to an object with keys {"+Object.keys(re).join(", ")+"}.",d("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",De(c)||"Component",le)}}if(typeof re=="object"&&re!==null)Y=Yr(re);else{M=fa(s,c,!0);var he=c.contextTypes;L=he!=null,Y=L?Vi(s,M):wn}var ve=new c(N,Y);if(s.mode&tr){Nr(!0);try{ve=new c(N,Y)}finally{Nr(!1)}}var be=s.memoizedState=ve.state!==null&&ve.state!==void 0?ve.state:null;sm(s,ve);{if(typeof c.getDerivedStateFromProps=="function"&&be===null){var we=De(c)||"Component";Xf.has(we)||(Xf.add(we),d("`%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.",we,ve.state===null?"null":"undefined",we))}if(typeof c.getDerivedStateFromProps=="function"||typeof ve.getSnapshotBeforeUpdate=="function"){var Me=null,Ue=null,Ie=null;if(typeof ve.componentWillMount=="function"&&ve.componentWillMount.__suppressDeprecationWarning!==!0?Me="componentWillMount":typeof ve.UNSAFE_componentWillMount=="function"&&(Me="UNSAFE_componentWillMount"),typeof ve.componentWillReceiveProps=="function"&&ve.componentWillReceiveProps.__suppressDeprecationWarning!==!0?Ue="componentWillReceiveProps":typeof ve.UNSAFE_componentWillReceiveProps=="function"&&(Ue="UNSAFE_componentWillReceiveProps"),typeof ve.componentWillUpdate=="function"&&ve.componentWillUpdate.__suppressDeprecationWarning!==!0?Ie="componentWillUpdate":typeof ve.UNSAFE_componentWillUpdate=="function"&&(Ie="UNSAFE_componentWillUpdate"),Me!==null||Ue!==null||Ie!==null){var vt=De(c)||"Component",Ct=typeof c.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";Qf.has(vt)||(Qf.add(vt),d(`Unsafe legacy lifecycles will not be called for components using new component APIs.
156
+
157
+ %s uses %s but also contains the following legacy lifecycles:%s%s%s
158
+
159
+ The above lifecycles should be removed. Learn more about this warning here:
160
+ https://reactjs.org/link/unsafe-component-lifecycles`,vt,Ct,Me!==null?`
161
+ `+Me:"",Ue!==null?`
162
+ `+Ue:"",Ie!==null?`
163
+ `+Ie:""))}}}return L&&Yo(s,M,Y),ve}function Gv(s,c){var N=c.state;typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),N!==c.state&&(d("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Ee(s)||"Component"),nh.enqueueReplaceState(c,c.state,null))}function lm(s,c,N,L){var M=c.state;if(typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(N,L),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(N,L),c.state!==M){{var Y=Ee(s)||"Component";Kf.has(Y)||(Kf.add(Y),d("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",Y))}nh.enqueueReplaceState(c,c.state,null)}}function ih(s,c,N,L){Uv(s,c,N);var M=s.stateNode;M.props=N,M.state=s.memoizedState,M.refs=rm,Vf(s);var Y=c.contextType;if(typeof Y=="object"&&Y!==null)M.context=Yr(Y);else{var re=fa(s,c,!0);M.context=Vi(s,re)}{if(M.state===N){var ie=De(c)||"Component";Zf.has(ie)||(Zf.add(ie),d("%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.",ie))}s.mode&tr&&ke.recordLegacyContextWarning(s,M),ke.recordUnsafeLifecycleWarnings(s,M)}M.state=s.memoizedState;var le=c.getDerivedStateFromProps;if(typeof le=="function"&&(rh(s,c,le,N),M.state=s.memoizedState),typeof c.getDerivedStateFromProps!="function"&&typeof M.getSnapshotBeforeUpdate!="function"&&(typeof M.UNSAFE_componentWillMount=="function"||typeof M.componentWillMount=="function")&&(Gv(s,M),hd(s,N,M,L),M.state=s.memoizedState),typeof M.componentDidMount=="function"){var he=it;he|=xt,(s.mode&Nn)!==Et&&(he|=It),s.flags|=he}}function Bv(s,c,N,L){var M=s.stateNode,Y=s.memoizedProps;M.props=Y;var re=M.context,ie=c.contextType,le=wn;if(typeof ie=="object"&&ie!==null)le=Yr(ie);else{var he=fa(s,c,!0);le=Vi(s,he)}var ve=c.getDerivedStateFromProps,be=typeof ve=="function"||typeof M.getSnapshotBeforeUpdate=="function";!be&&(typeof M.UNSAFE_componentWillReceiveProps=="function"||typeof M.componentWillReceiveProps=="function")&&(Y!==N||re!==le)&&lm(s,M,N,le),em();var we=s.memoizedState,Me=M.state=we;if(hd(s,N,M,L),Me=s.memoizedState,Y===N&&we===Me&&!xs()&&!pd()){if(typeof M.componentDidMount=="function"){var Ue=it;Ue|=xt,(s.mode&Nn)!==Et&&(Ue|=It),s.flags|=Ue}return!1}typeof ve=="function"&&(rh(s,c,ve,N),Me=s.memoizedState);var Ie=pd()||am(s,c,Y,N,we,Me,le);if(Ie){if(!be&&(typeof M.UNSAFE_componentWillMount=="function"||typeof M.componentWillMount=="function")&&(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"){var vt=it;vt|=xt,(s.mode&Nn)!==Et&&(vt|=It),s.flags|=vt}}else{if(typeof M.componentDidMount=="function"){var Ct=it;Ct|=xt,(s.mode&Nn)!==Et&&(Ct|=It),s.flags|=Ct}s.memoizedProps=N,s.memoizedState=Me}return M.props=N,M.state=Me,M.context=le,Ie}function zv(s,c,N,L,M){var Y=c.stateNode;Zp(s,c);var re=c.memoizedProps,ie=c.type===c.elementType?re:Ji(c.type,re);Y.props=ie;var le=c.pendingProps,he=Y.context,ve=N.contextType,be=wn;if(typeof ve=="object"&&ve!==null)be=Yr(ve);else{var we=fa(c,N,!0);be=Vi(c,we)}var Me=N.getDerivedStateFromProps,Ue=typeof Me=="function"||typeof Y.getSnapshotBeforeUpdate=="function";!Ue&&(typeof Y.UNSAFE_componentWillReceiveProps=="function"||typeof Y.componentWillReceiveProps=="function")&&(re!==le||he!==be)&&lm(c,Y,L,be),em();var Ie=c.memoizedState,vt=Y.state=Ie;if(hd(c,L,Y,M),vt=c.memoizedState,re===le&&Ie===vt&&!xs()&&!pd()&&!g)return typeof Y.componentDidUpdate=="function"&&(re!==s.memoizedProps||Ie!==s.memoizedState)&&(c.flags|=it),typeof Y.getSnapshotBeforeUpdate=="function"&&(re!==s.memoizedProps||Ie!==s.memoizedState)&&(c.flags|=An),!1;typeof Me=="function"&&(rh(c,N,Me,L),vt=c.memoizedState);var Ct=pd()||am(c,N,ie,L,Ie,vt,be)||g;return Ct?(!Ue&&(typeof Y.UNSAFE_componentWillUpdate=="function"||typeof Y.componentWillUpdate=="function")&&(typeof Y.componentWillUpdate=="function"&&Y.componentWillUpdate(L,vt,be),typeof Y.UNSAFE_componentWillUpdate=="function"&&Y.UNSAFE_componentWillUpdate(L,vt,be)),typeof Y.componentDidUpdate=="function"&&(c.flags|=it),typeof Y.getSnapshotBeforeUpdate=="function"&&(c.flags|=An)):(typeof Y.componentDidUpdate=="function"&&(re!==s.memoizedProps||Ie!==s.memoizedState)&&(c.flags|=it),typeof Y.getSnapshotBeforeUpdate=="function"&&(re!==s.memoizedProps||Ie!==s.memoizedState)&&(c.flags|=An),c.memoizedProps=L,c.memoizedState=vt),Y.props=L,Y.state=vt,Y.context=be,Ct}var ah,sh,oh,lh,uh,um=function(s,c){};ah=!1,sh=!1,oh={},lh={},uh={},um=function(s,c){if(!(s===null||typeof s!="object")&&!(!s._store||s._store.validated||s.key!=null)){if(typeof s._store!="object")throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");s._store.validated=!0;var N=Ee(c)||"Component";lh[N]||(lh[N]=!0,d('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};function $u(s,c,N){var L=N.ref;if(L!==null&&typeof L!="function"&&typeof L!="object"){if((s.mode&tr||R)&&!(N._owner&&N._self&&N._owner.stateNode!==N._self)){var M=Ee(s)||"Component";oh[M]||(d('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',L),oh[M]=!0)}if(N._owner){var Y=N._owner,re;if(Y){var ie=Y;if(ie.tag!==P)throw new 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");re=ie.stateNode}if(!re)throw new Error("Missing owner for string ref "+L+". This error is likely caused by a bug in React. Please file an issue.");var le=re;Ov(L,"ref");var he=""+L;if(c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===he)return c.ref;var ve=function(be){var we=le.refs;we===rm&&(we=le.refs={}),be===null?delete we[he]:we[he]=be};return ve._stringRef=he,ve}else{if(typeof L!="string")throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!N._owner)throw new Error("Element ref was specified as a string ("+L+`) but no owner was set. This could happen for one of the following reasons:
164
+ 1. You may be adding a ref to a function component
165
+ 2. You may be adding a ref to a component that was not created inside a component's render method
166
+ 3. You have multiple copies of React loaded
167
+ See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return L}function gd(s,c){var N=Object.prototype.toString.call(c);throw new Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}function vd(s){{var c=Ee(s)||"Component";if(uh[c])return;uh[c]=!0,d("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 cm(s){var c=s._payload,N=s._init;return N(c)}function dm(s){function c(Te,Fe){if(s){var Re=Te.deletions;Re===null?(Te.deletions=[Fe],Te.flags|=Ht):Re.push(Fe)}}function N(Te,Fe){if(!s)return null;for(var Re=Fe;Re!==null;)c(Te,Re),Re=Re.sibling;return null}function L(Te,Fe){for(var Re=new Map,Ye=Fe;Ye!==null;)Ye.key!==null?Re.set(Ye.key,Ye):Re.set(Ye.index,Ye),Ye=Ye.sibling;return Re}function M(Te,Fe){var Re=Ao(Te,Fe);return Re.index=0,Re.sibling=null,Re}function Y(Te,Fe,Re){if(Te.index=Re,!s)return Te.flags|=ze,Fe;var Ye=Te.alternate;if(Ye!==null){var mt=Ye.index;return mt<Fe?(Te.flags|=nt,Fe):mt}else return Te.flags|=nt,Fe}function re(Te){return s&&Te.alternate===null&&(Te.flags|=nt),Te}function ie(Te,Fe,Re,Ye){if(Fe===null||Fe.tag!==G){var mt=$p(Re,Te.mode,Ye);return mt.return=Te,mt}else{var lt=M(Fe,Re);return lt.return=Te,lt}}function le(Te,Fe,Re,Ye){var mt=Re.type;if(mt===Se)return ve(Te,Fe,Re.props.children,Ye,Re.key);if(Fe!==null&&(Fe.elementType===mt||tv(Fe,Re)||typeof mt=="object"&&mt!==null&&mt.$$typeof===ft&&cm(mt)===Fe.type)){var lt=M(Fe,Re.props);return lt.ref=$u(Te,Fe,Re),lt.return=Te,lt._debugSource=Re._source,lt._debugOwner=Re._owner,lt}var Yt=Ip(Re,Te.mode,Ye);return Yt.ref=$u(Te,Fe,Re),Yt.return=Te,Yt}function he(Te,Fe,Re,Ye){if(Fe===null||Fe.tag!==D||Fe.stateNode.containerInfo!==Re.containerInfo||Fe.stateNode.implementation!==Re.implementation){var mt=Up(Re,Te.mode,Ye);return mt.return=Te,mt}else{var lt=M(Fe,Re.children||[]);return lt.return=Te,lt}}function ve(Te,Fe,Re,Ye,mt){if(Fe===null||Fe.tag!==V){var lt=Vs(Re,Te.mode,Ye,mt);return lt.return=Te,lt}else{var Yt=M(Fe,Re);return Yt.return=Te,Yt}}function be(Te,Fe,Re){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"){var Ye=$p(""+Fe,Te.mode,Re);return Ye.return=Te,Ye}if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case de:{var mt=Ip(Fe,Te.mode,Re);return mt.ref=$u(Te,null,Fe),mt.return=Te,mt}case ce:{var lt=Up(Fe,Te.mode,Re);return lt.return=Te,lt}case ft:{var Yt=Fe._payload,Pt=Fe._init;return be(Te,Pt(Yt),Re)}}if($t(Fe)||pe(Fe)){var er=Vs(Fe,Te.mode,Re,null);return er.return=Te,er}gd(Te,Fe)}return typeof Fe=="function"&&vd(Te),null}function we(Te,Fe,Re,Ye){var mt=Fe!==null?Fe.key:null;if(typeof Re=="string"&&Re!==""||typeof Re=="number")return mt!==null?null:ie(Te,Fe,""+Re,Ye);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case de:return Re.key===mt?le(Te,Fe,Re,Ye):null;case ce:return Re.key===mt?he(Te,Fe,Re,Ye):null;case ft:{var lt=Re._payload,Yt=Re._init;return we(Te,Fe,Yt(lt),Ye)}}if($t(Re)||pe(Re))return mt!==null?null:ve(Te,Fe,Re,Ye,null);gd(Te,Re)}return typeof Re=="function"&&vd(Te),null}function Me(Te,Fe,Re,Ye,mt){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number"){var lt=Te.get(Re)||null;return ie(Fe,lt,""+Ye,mt)}if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case de:{var Yt=Te.get(Ye.key===null?Re:Ye.key)||null;return le(Fe,Yt,Ye,mt)}case ce:{var Pt=Te.get(Ye.key===null?Re:Ye.key)||null;return he(Fe,Pt,Ye,mt)}case ft:var er=Ye._payload,Gt=Ye._init;return Me(Te,Fe,Re,Gt(er),mt)}if($t(Ye)||pe(Ye)){var vr=Te.get(Re)||null;return ve(Fe,vr,Ye,mt,null)}gd(Fe,Ye)}return typeof Ye=="function"&&vd(Fe),null}function Ue(Te,Fe,Re){{if(typeof Te!="object"||Te===null)return Fe;switch(Te.$$typeof){case de:case ce:um(Te,Re);var Ye=Te.key;if(typeof Ye!="string")break;if(Fe===null){Fe=new Set,Fe.add(Ye);break}if(!Fe.has(Ye)){Fe.add(Ye);break}d("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.",Ye);break;case ft:var mt=Te._payload,lt=Te._init;Ue(lt(mt),Fe,Re);break}}return Fe}function Ie(Te,Fe,Re,Ye){for(var mt=null,lt=0;lt<Re.length;lt++){var Yt=Re[lt];mt=Ue(Yt,mt,Te)}for(var Pt=null,er=null,Gt=Fe,vr=0,bt=0,Lr=null;Gt!==null&&bt<Re.length;bt++){Gt.index>bt?(Lr=Gt,Gt=null):Lr=Gt.sibling;var In=we(Te,Gt,Re[bt],Ye);if(In===null){Gt===null&&(Gt=Lr);break}s&&Gt&&In.alternate===null&&c(Te,Gt),vr=Y(In,vr,bt),er===null?Pt=In:er.sibling=In,er=In,Gt=Lr}if(bt===Re.length){if(N(Te,Gt),j()){var Cn=bt;qi(Te,Cn)}return Pt}if(Gt===null){for(;bt<Re.length;bt++){var Ri=be(Te,Re[bt],Ye);Ri!==null&&(vr=Y(Ri,vr,bt),er===null?Pt=Ri:er.sibling=Ri,er=Ri)}if(j()){var Qn=bt;qi(Te,Qn)}return Pt}for(var Jn=L(Te,Gt);bt<Re.length;bt++){var $n=Me(Jn,Te,bt,Re[bt],Ye);$n!==null&&(s&&$n.alternate!==null&&Jn.delete($n.key===null?bt:$n.key),vr=Y($n,vr,bt),er===null?Pt=$n:er.sibling=$n,er=$n)}if(s&&Jn.forEach(function(zl){return c(Te,zl)}),j()){var os=bt;qi(Te,os)}return Pt}function vt(Te,Fe,Re,Ye){var mt=pe(Re);if(typeof mt!="function")throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Re[Symbol.toStringTag]==="Generator"&&(sh||d("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."),sh=!0),Re.entries===mt&&(ah||d("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ah=!0);var lt=mt.call(Re);if(lt)for(var Yt=null,Pt=lt.next();!Pt.done;Pt=lt.next()){var er=Pt.value;Yt=Ue(er,Yt,Te)}}var Gt=mt.call(Re);if(Gt==null)throw new Error("An iterable object provided no iterator.");for(var vr=null,bt=null,Lr=Fe,In=0,Cn=0,Ri=null,Qn=Gt.next();Lr!==null&&!Qn.done;Cn++,Qn=Gt.next()){Lr.index>Cn?(Ri=Lr,Lr=null):Ri=Lr.sibling;var Jn=we(Te,Lr,Qn.value,Ye);if(Jn===null){Lr===null&&(Lr=Ri);break}s&&Lr&&Jn.alternate===null&&c(Te,Lr),In=Y(Jn,In,Cn),bt===null?vr=Jn:bt.sibling=Jn,bt=Jn,Lr=Ri}if(Qn.done){if(N(Te,Lr),j()){var $n=Cn;qi(Te,$n)}return vr}if(Lr===null){for(;!Qn.done;Cn++,Qn=Gt.next()){var os=be(Te,Qn.value,Ye);os!==null&&(In=Y(os,In,Cn),bt===null?vr=os:bt.sibling=os,bt=os)}if(j()){var zl=Cn;qi(Te,zl)}return vr}for(var gc=L(Te,Lr);!Qn.done;Cn++,Qn=Gt.next()){var ka=Me(gc,Te,Cn,Qn.value,Ye);ka!==null&&(s&&ka.alternate!==null&&gc.delete(ka.key===null?Cn:ka.key),In=Y(ka,In,Cn),bt===null?vr=ka:bt.sibling=ka,bt=ka)}if(s&&gc.forEach(function(l1){return c(Te,l1)}),j()){var o1=Cn;qi(Te,o1)}return vr}function Ct(Te,Fe,Re,Ye){if(Fe!==null&&Fe.tag===G){N(Te,Fe.sibling);var mt=M(Fe,Re);return mt.return=Te,mt}N(Te,Fe);var lt=$p(Re,Te.mode,Ye);return lt.return=Te,lt}function St(Te,Fe,Re,Ye){for(var mt=Re.key,lt=Fe;lt!==null;){if(lt.key===mt){var Yt=Re.type;if(Yt===Se){if(lt.tag===V){N(Te,lt.sibling);var Pt=M(lt,Re.props.children);return Pt.return=Te,Pt._debugSource=Re._source,Pt._debugOwner=Re._owner,Pt}}else if(lt.elementType===Yt||tv(lt,Re)||typeof Yt=="object"&&Yt!==null&&Yt.$$typeof===ft&&cm(Yt)===lt.type){N(Te,lt.sibling);var er=M(lt,Re.props);return er.ref=$u(Te,lt,Re),er.return=Te,er._debugSource=Re._source,er._debugOwner=Re._owner,er}N(Te,lt);break}else c(Te,lt);lt=lt.sibling}if(Re.type===Se){var Gt=Vs(Re.props.children,Te.mode,Ye,Re.key);return Gt.return=Te,Gt}else{var vr=Ip(Re,Te.mode,Ye);return vr.ref=$u(Te,Fe,Re),vr.return=Te,vr}}function or(Te,Fe,Re,Ye){for(var mt=Re.key,lt=Fe;lt!==null;){if(lt.key===mt)if(lt.tag===D&&lt.stateNode.containerInfo===Re.containerInfo&&lt.stateNode.implementation===Re.implementation){N(Te,lt.sibling);var Yt=M(lt,Re.children||[]);return Yt.return=Te,Yt}else{N(Te,lt);break}else c(Te,lt);lt=lt.sibling}var Pt=Up(Re,Te.mode,Ye);return Pt.return=Te,Pt}function Kt(Te,Fe,Re,Ye){var mt=typeof Re=="object"&&Re!==null&&Re.type===Se&&Re.key===null;if(mt&&(Re=Re.props.children),typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case de:return re(St(Te,Fe,Re,Ye));case ce:return re(or(Te,Fe,Re,Ye));case ft:var lt=Re._payload,Yt=Re._init;return Kt(Te,Fe,Yt(lt),Ye)}if($t(Re))return Ie(Te,Fe,Re,Ye);if(pe(Re))return vt(Te,Fe,Re,Ye);gd(Te,Re)}return typeof Re=="string"&&Re!==""||typeof Re=="number"?re(Ct(Te,Fe,""+Re,Ye)):(typeof Re=="function"&&vd(Te),N(Te,Fe))}return Kt}var Al=dm(!0),fm=dm(!1);function Hv(s,c){if(s!==null&&c.child!==s.child)throw new Error("Resuming work not yet implemented.");if(c.child!==null){var N=c.child,L=Ao(N,N.pendingProps);for(c.child=L,L.return=c;N.sibling!==null;)N=N.sibling,L=L.sibling=Ao(N,N.pendingProps),L.return=c;L.sibling=null}}function Vv(s,c){for(var N=s.child;N!==null;)M_(N,c),N=N.sibling}var Uu={},Ms=zn(Uu),Gu=zn(Uu),yd=zn(Uu);function _d(s){if(s===Uu)throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return s}function ch(){var s=_d(yd.current);return s}function dh(s,c){Fr(yd,c,s),Fr(Gu,s,s),Fr(Ms,Uu,s);var N=la(c);mr(Ms,s),Fr(Ms,N,s)}function Pl(s){mr(Ms,s),mr(Gu,s),mr(yd,s)}function Bu(){var s=_d(Ms.current);return s}function hm(s){var c=_d(yd.current),N=_d(Ms.current),L=fn(N,s.type,c);N!==L&&(Fr(Gu,s,s),Fr(Ms,L,s))}function fh(s){Gu.current===s&&(mr(Ms,s),mr(Gu,s))}var Wv=0,pm=1,mm=1,zu=2,Zi=zn(Wv);function hh(s,c){return(s&c)!==0}function wl(s){return s&pm}function ph(s,c){return s&pm|c}function Yv(s,c){return s|c}function Is(s,c){Fr(Zi,c,s)}function Nl(s){mr(Zi,s)}function Kv(s,c){var N=s.memoizedState;return N!==null?N.dehydrated!==null:(s.memoizedProps,!0)}function xd(s){for(var c=s;c!==null;){if(c.tag===$){var N=c.memoizedState;if(N!==null){var L=N.dehydrated;if(L===null||Ai(L)||Gi(L))return c}}else if(c.tag===ne&&c.memoizedProps.revealOrder!==void 0){var M=(c.flags&Nt)!==Pe;if(M)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)return null;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var si=0,an=1,Ea=2,sn=4,Sn=8,mh=[];function gh(){for(var s=0;s<mh.length;s++){var c=mh[s];Oo?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}mh.length=0}function Xv(s,c){var N=c._getVersion,L=N(c._source);s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,L]:s.mutableSourceEagerHydrationData.push(c,L)}var ot=a.ReactCurrentDispatcher,Hu=a.ReactCurrentBatchConfig,vh,Ol;vh=new Set;var xo=$e,sr=null,on=null,ln=null,Sd=!1,Vu=!1,Wu=0,qv=0,Qv=25,je=null,Li=null,$s=-1,yh=!1;function rr(){{var s=je;Li===null?Li=[s]:Li.push(s)}}function qe(){{var s=je;Li!==null&&($s++,Li[$s]!==s&&Jv(s))}}function kl(s){s!=null&&!$t(s)&&d("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",je,typeof s)}function Jv(s){{var c=Ee(sr);if(!vh.has(c)&&(vh.add(c),Li!==null)){for(var N="",L=30,M=0;M<=$s;M++){for(var Y=Li[M],re=M===$s?s:Y,ie=M+1+". "+Y;ie.length<L;)ie+=" ";ie+=re+`
168
+ `,N+=ie}d(`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
169
+
170
+ Previous render Next render
171
+ ------------------------------------------------------
172
+ %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173
+ `,c,N)}}}function jn(){throw new 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:
174
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
175
+ 2. You might be breaking the Rules of Hooks
176
+ 3. You might have more than one copy of React in the same app
177
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function _h(s,c){if(yh)return!1;if(c===null)return d("%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.",je),!1;s.length!==c.length&&d(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
178
+
179
+ Previous: %s
180
+ Incoming: %s`,je,"["+c.join(", ")+"]","["+s.join(", ")+"]");for(var N=0;N<c.length&&N<s.length;N++)if(!Dr(s[N],c[N]))return!1;return!0}function Dl(s,c,N,L,M,Y){xo=Y,sr=c,Li=s!==null?s._debugHookTypes:null,$s=-1,yh=s!==null&&s.type!==c.type,c.memoizedState=null,c.updateQueue=null,c.lanes=$e,s!==null&&s.memoizedState!==null?ot.current=Mm:Li!==null?ot.current=jm:ot.current=Fm;var re=N(L,M);if(Vu){var ie=0;do{if(Vu=!1,Wu=0,ie>=Qv)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");ie+=1,yh=!1,on=null,ln=null,c.updateQueue=null,$s=-1,ot.current=Im,re=N(L,M)}while(Vu)}ot.current=Ld,c._debugHookTypes=Li;var le=on!==null&&on.next!==null;if(xo=$e,sr=null,on=null,ln=null,je=null,Li=null,$s=-1,s!==null&&(s.flags&_r)!==(c.flags&_r)&&(s.mode&Ut)!==Et&&d("Internal React error: Expected static flag was missing. Please notify the React team."),Sd=!1,le)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return re}function Ll(){var s=Wu!==0;return Wu=0,s}function gm(s,c,N){c.updateQueue=s.updateQueue,(c.mode&Nn)!==Et?c.flags&=~(Lt|It|Br|it):c.flags&=~(Br|it),s.lanes=oo(s.lanes,N)}function vm(){if(ot.current=Ld,Sd){for(var s=sr.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}Sd=!1}xo=$e,sr=null,on=null,ln=null,Li=null,$s=-1,je=null,Nm=!1,Vu=!1,Wu=0}function ba(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?sr.memoizedState=ln=s:ln=ln.next=s,ln}function Fi(){var s;if(on===null){var c=sr.alternate;c!==null?s=c.memoizedState:s=null}else s=on.next;var N;if(ln===null?N=sr.memoizedState:N=ln.next,N!==null)ln=N,N=ln.next,on=s;else{if(s===null)throw new Error("Rendered more hooks than during the previous render.");on=s;var L={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null};ln===null?sr.memoizedState=ln=L:ln=ln.next=L}return ln}function ym(){return{lastEffect:null,stores:null}}function xh(s,c){return typeof c=="function"?c(s):c}function Sh(s,c,N){var L=ba(),M;N!==void 0?M=N(c):M=c,L.memoizedState=L.baseState=M;var Y={pending:null,interleaved:null,lanes:$e,dispatch:null,lastRenderedReducer:s,lastRenderedState:M};L.queue=Y;var re=Y.dispatch=r0.bind(null,sr,Y);return[L.memoizedState,re]}function Eh(s,c,N){var L=Fi(),M=L.queue;if(M===null)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");M.lastRenderedReducer=s;var Y=on,re=Y.baseQueue,ie=M.pending;if(ie!==null){if(re!==null){var le=re.next,he=ie.next;re.next=he,ie.next=le}Y.baseQueue!==re&&d("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),Y.baseQueue=re=ie,M.pending=null}if(re!==null){var ve=re.next,be=Y.baseState,we=null,Me=null,Ue=null,Ie=ve;do{var vt=Ie.lane;if(Cs(xo,vt)){if(Ue!==null){var St={lane:Mr,action:Ie.action,hasEagerState:Ie.hasEagerState,eagerState:Ie.eagerState,next:null};Ue=Ue.next=St}if(Ie.hasEagerState)be=Ie.eagerState;else{var or=Ie.action;be=s(be,or)}}else{var Ct={lane:vt,action:Ie.action,hasEagerState:Ie.hasEagerState,eagerState:Ie.eagerState,next:null};Ue===null?(Me=Ue=Ct,we=be):Ue=Ue.next=Ct,sr.lanes=Rt(sr.lanes,vt),hc(vt)}Ie=Ie.next}while(Ie!==null&&Ie!==ve);Ue===null?we=be:Ue.next=Me,Dr(be,L.memoizedState)||Zu(),L.memoizedState=be,L.baseState=we,L.baseQueue=Ue,M.lastRenderedState=be}var Kt=M.interleaved;if(Kt!==null){var Te=Kt;do{var Fe=Te.lane;sr.lanes=Rt(sr.lanes,Fe),hc(Fe),Te=Te.next}while(Te!==Kt)}else re===null&&(M.lanes=$e);var Re=M.dispatch;return[L.memoizedState,Re]}function bh(s,c,N){var L=Fi(),M=L.queue;if(M===null)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");M.lastRenderedReducer=s;var Y=M.dispatch,re=M.pending,ie=L.memoizedState;if(re!==null){M.pending=null;var le=re.next,he=le;do{var ve=he.action;ie=s(ie,ve),he=he.next}while(he!==le);Dr(ie,L.memoizedState)||Zu(),L.memoizedState=ie,L.baseQueue===null&&(L.baseState=ie),M.lastRenderedState=ie}return[ie,Y]}function u1(s,c,N){}function c1(s,c,N){}function Rh(s,c,N){var L=sr,M=ba(),Y,re=j();if(re){if(N===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");Y=N(),Ol||Y!==N()&&(d("The result of getServerSnapshot should be cached to avoid an infinite loop"),Ol=!0)}else{if(Y=c(),!Ol){var ie=c();Dr(Y,ie)||(d("The result of getSnapshot should be cached to avoid an infinite loop"),Ol=!0)}var le=uf();if(le===null)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Rs(le,xo)||_m(L,c,Y)}M.memoizedState=Y;var he={value:Y,getSnapshot:c};return M.queue=he,Cd(Sm.bind(null,L,he,s),[s]),L.flags|=Br,Yu(an|Sn,xm.bind(null,L,he,Y,c),void 0,null),Y}function Ed(s,c,N){var L=sr,M=Fi(),Y=c();if(!Ol){var re=c();Dr(Y,re)||(d("The result of getSnapshot should be cached to avoid an infinite loop"),Ol=!0)}var ie=M.memoizedState,le=!Dr(ie,Y);le&&(M.memoizedState=Y,Zu());var he=M.queue;if(Xu(Sm.bind(null,L,he,s),[s]),he.getSnapshot!==c||le||ln!==null&&ln.memoizedState.tag&an){L.flags|=Br,Yu(an|Sn,xm.bind(null,L,he,Y,c),void 0,null);var ve=uf();if(ve===null)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");Rs(ve,xo)||_m(L,c,Y)}return Y}function _m(s,c,N){s.flags|=Da;var L={getSnapshot:c,value:N},M=sr.updateQueue;if(M===null)M=ym(),sr.updateQueue=M,M.stores=[L];else{var Y=M.stores;Y===null?M.stores=[L]:Y.push(L)}}function xm(s,c,N,L){c.value=N,c.getSnapshot=L,Em(c)&&bm(s)}function Sm(s,c,N){var L=function(){Em(c)&&bm(s)};return N(L)}function Em(s){var c=s.getSnapshot,N=s.value;try{var L=c();return!Dr(N,L)}catch{return!0}}function bm(s){var c=Kn(s,Tt);c!==null&&Xr(c,s,Tt,cr)}function bd(s){var c=ba();typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s;var N={pending:null,interleaved:null,lanes:$e,dispatch:null,lastRenderedReducer:xh,lastRenderedState:s};c.queue=N;var L=N.dispatch=n0.bind(null,sr,N);return[c.memoizedState,L]}function Th(s){return Eh(xh)}function Ch(s){return bh(xh)}function Yu(s,c,N,L){var M={tag:s,create:c,destroy:N,deps:L,next:null},Y=sr.updateQueue;if(Y===null)Y=ym(),sr.updateQueue=Y,Y.lastEffect=M.next=M;else{var re=Y.lastEffect;if(re===null)Y.lastEffect=M.next=M;else{var ie=re.next;re.next=M,M.next=ie,Y.lastEffect=M}}return M}function Ah(s){var c=ba();{var N={current:s};return c.memoizedState=N,N}}function Rd(s){var c=Fi();return c.memoizedState}function Ku(s,c,N,L){var M=ba(),Y=L===void 0?null:L;sr.flags|=s,M.memoizedState=Yu(an|c,N,void 0,Y)}function Td(s,c,N,L){var M=Fi(),Y=L===void 0?null:L,re=void 0;if(on!==null){var ie=on.memoizedState;if(re=ie.destroy,Y!==null){var le=ie.deps;if(_h(Y,le)){M.memoizedState=Yu(c,N,re,Y);return}}}sr.flags|=s,M.memoizedState=Yu(an|c,N,re,Y)}function Cd(s,c){return(sr.mode&Nn)!==Et?Ku(Lt|Br|Vt,Sn,s,c):Ku(Br|Vt,Sn,s,c)}function Xu(s,c){return Td(Br,Sn,s,c)}function Ph(s,c){return Ku(it,Ea,s,c)}function Ad(s,c){return Td(it,Ea,s,c)}function wh(s,c){var N=it;return N|=xt,(sr.mode&Nn)!==Et&&(N|=It),Ku(N,sn,s,c)}function Pd(s,c){return Td(it,sn,s,c)}function Rm(s,c){if(typeof c=="function"){var N=c,L=s();return N(L),function(){N(null)}}else if(c!=null){var M=c;M.hasOwnProperty("current")||d("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(M).join(", ")+"}");var Y=s();return M.current=Y,function(){M.current=null}}}function Nh(s,c,N){typeof c!="function"&&d("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",c!==null?typeof c:"null");var L=N!=null?N.concat([s]):null,M=it;return M|=xt,(sr.mode&Nn)!==Et&&(M|=It),Ku(M,sn,Rm.bind(null,c,s),L)}function wd(s,c,N){typeof c!="function"&&d("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",c!==null?typeof c:"null");var L=N!=null?N.concat([s]):null;return Td(it,sn,Rm.bind(null,c,s),L)}function Zv(s,c){}var Nd=Zv;function Oh(s,c){var N=ba(),L=c===void 0?null:c;return N.memoizedState=[s,L],s}function Od(s,c){var N=Fi(),L=c===void 0?null:c,M=N.memoizedState;if(M!==null&&L!==null){var Y=M[1];if(_h(L,Y))return M[0]}return N.memoizedState=[s,L],s}function kh(s,c){var N=ba(),L=c===void 0?null:c,M=s();return N.memoizedState=[M,L],M}function kd(s,c){var N=Fi(),L=c===void 0?null:c,M=N.memoizedState;if(M!==null&&L!==null){var Y=M[1];if(_h(L,Y))return M[0]}var re=s();return N.memoizedState=[re,L],re}function Dh(s){var c=ba();return c.memoizedState=s,s}function Tm(s){var c=Fi(),N=on,L=N.memoizedState;return Am(c,L,s)}function Cm(s){var c=Fi();if(on===null)return c.memoizedState=s,s;var N=on.memoizedState;return Am(c,N,s)}function Am(s,c,N){var L=!Ic(xo);if(L){if(!Dr(N,c)){var M=so();sr.lanes=Rt(sr.lanes,M),hc(M),s.baseState=!0}return c}else return s.baseState&&(s.baseState=!1,Zu()),s.memoizedState=N,N}function e0(s,c,N){var L=kn();wr(Bc(L,Wa)),s(!0);var M=Hu.transition;Hu.transition={};var Y=Hu.transition;Hu.transition._updatedFibers=new Set;try{s(!1),c()}finally{if(wr(L),Hu.transition=M,M===null&&Y._updatedFibers){var re=Y._updatedFibers.size;re>10&&f("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),Y._updatedFibers.clear()}}}function Lh(){var s=bd(!1),c=s[0],N=s[1],L=e0.bind(null,N),M=ba();return M.memoizedState=L,[c,L]}function Pm(){var s=Th(),c=s[0],N=Fi(),L=N.memoizedState;return[c,L]}function wm(){var s=Ch(),c=s[0],N=Fi(),L=N.memoizedState;return[c,L]}var Nm=!1;function t0(){return Nm}function Fh(){var s=ba(),c=uf(),N=c.identifierPrefix,L;if(j()){var M=Xc();L=":"+N+"R"+M;var Y=Wu++;Y>0&&(L+="H"+Y.toString(32)),L+=":"}else{var re=qv++;L=":"+N+"r"+re.toString(32)+":"}return s.memoizedState=L,L}function Dd(){var s=Fi(),c=s.memoizedState;return c}function r0(s,c,N){typeof arguments[3]=="function"&&d("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 L=zs(s),M={lane:L,action:N,hasEagerState:!1,eagerState:null,next:null};if(Om(s))km(c,M);else{var Y=qp(s,c,M,L);if(Y!==null){var re=Mn();Xr(Y,s,L,re),Dm(Y,c,L)}}Lm(s,L)}function n0(s,c,N){typeof arguments[3]=="function"&&d("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 L=zs(s),M={lane:L,action:N,hasEagerState:!1,eagerState:null,next:null};if(Om(s))km(c,M);else{var Y=s.alternate;if(s.lanes===$e&&(Y===null||Y.lanes===$e)){var re=c.lastRenderedReducer;if(re!==null){var ie;ie=ot.current,ot.current=ea;try{var le=c.lastRenderedState,he=re(le,N);if(M.hasEagerState=!0,M.eagerState=he,Dr(he,le)){Fv(s,c,M,L);return}}catch{}finally{ot.current=ie}}}var ve=qp(s,c,M,L);if(ve!==null){var be=Mn();Xr(ve,s,L,be),Dm(ve,c,L)}}Lm(s,L)}function Om(s){var c=s.alternate;return s===sr||c!==null&&c===sr}function km(s,c){Vu=Sd=!0;var N=s.pending;N===null?c.next=c:(c.next=N.next,N.next=c),s.pending=c}function Dm(s,c,N){if(ul(N)){var L=c.lanes;L=As(L,s.pendingLanes);var M=Rt(L,N);c.lanes=M,Tu(s,M)}}function Lm(s,c,N){Oi(s,c)}var Ld={readContext:Yr,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useInsertionEffect:jn,useLayoutEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useMutableSource:jn,useSyncExternalStore:jn,useId:jn,unstable_isNewReconciler:_},Fm=null,jm=null,Mm=null,Im=null,Ra=null,ea=null,Fd=null;{var jh=function(){d("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().")},wt=function(){d("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")};Fm={readContext:function(s){return Yr(s)},useCallback:function(s,c){return je="useCallback",rr(),kl(c),Oh(s,c)},useContext:function(s){return je="useContext",rr(),Yr(s)},useEffect:function(s,c){return je="useEffect",rr(),kl(c),Cd(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",rr(),kl(N),Nh(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",rr(),kl(c),Ph(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",rr(),kl(c),wh(s,c)},useMemo:function(s,c){je="useMemo",rr(),kl(c);var N=ot.current;ot.current=Ra;try{return kh(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",rr();var L=ot.current;ot.current=Ra;try{return Sh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",rr(),Ah(s)},useState:function(s){je="useState",rr();var c=ot.current;ot.current=Ra;try{return bd(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",rr(),void 0},useDeferredValue:function(s){return je="useDeferredValue",rr(),Dh(s)},useTransition:function(){return je="useTransition",rr(),Lh()},useMutableSource:function(s,c,N){return je="useMutableSource",rr(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",rr(),Rh(s,c,N)},useId:function(){return je="useId",rr(),Fh()},unstable_isNewReconciler:_},jm={readContext:function(s){return Yr(s)},useCallback:function(s,c){return je="useCallback",qe(),Oh(s,c)},useContext:function(s){return je="useContext",qe(),Yr(s)},useEffect:function(s,c){return je="useEffect",qe(),Cd(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",qe(),Nh(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",qe(),Ph(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",qe(),wh(s,c)},useMemo:function(s,c){je="useMemo",qe();var N=ot.current;ot.current=Ra;try{return kh(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",qe();var L=ot.current;ot.current=Ra;try{return Sh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",qe(),Ah(s)},useState:function(s){je="useState",qe();var c=ot.current;ot.current=Ra;try{return bd(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",qe(),void 0},useDeferredValue:function(s){return je="useDeferredValue",qe(),Dh(s)},useTransition:function(){return je="useTransition",qe(),Lh()},useMutableSource:function(s,c,N){return je="useMutableSource",qe(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",qe(),Rh(s,c,N)},useId:function(){return je="useId",qe(),Fh()},unstable_isNewReconciler:_},Mm={readContext:function(s){return Yr(s)},useCallback:function(s,c){return je="useCallback",qe(),Od(s,c)},useContext:function(s){return je="useContext",qe(),Yr(s)},useEffect:function(s,c){return je="useEffect",qe(),Xu(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",qe(),wd(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",qe(),Ad(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",qe(),Pd(s,c)},useMemo:function(s,c){je="useMemo",qe();var N=ot.current;ot.current=ea;try{return kd(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",qe();var L=ot.current;ot.current=ea;try{return Eh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",qe(),Rd()},useState:function(s){je="useState",qe();var c=ot.current;ot.current=ea;try{return Th(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",qe(),Nd()},useDeferredValue:function(s){return je="useDeferredValue",qe(),Tm(s)},useTransition:function(){return je="useTransition",qe(),Pm()},useMutableSource:function(s,c,N){return je="useMutableSource",qe(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",qe(),Ed(s,c)},useId:function(){return je="useId",qe(),Dd()},unstable_isNewReconciler:_},Im={readContext:function(s){return Yr(s)},useCallback:function(s,c){return je="useCallback",qe(),Od(s,c)},useContext:function(s){return je="useContext",qe(),Yr(s)},useEffect:function(s,c){return je="useEffect",qe(),Xu(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",qe(),wd(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",qe(),Ad(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",qe(),Pd(s,c)},useMemo:function(s,c){je="useMemo",qe();var N=ot.current;ot.current=Fd;try{return kd(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",qe();var L=ot.current;ot.current=Fd;try{return bh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",qe(),Rd()},useState:function(s){je="useState",qe();var c=ot.current;ot.current=Fd;try{return Ch(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",qe(),Nd()},useDeferredValue:function(s){return je="useDeferredValue",qe(),Cm(s)},useTransition:function(){return je="useTransition",qe(),wm()},useMutableSource:function(s,c,N){return je="useMutableSource",qe(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",qe(),Ed(s,c)},useId:function(){return je="useId",qe(),Dd()},unstable_isNewReconciler:_},Ra={readContext:function(s){return jh(),Yr(s)},useCallback:function(s,c){return je="useCallback",wt(),rr(),Oh(s,c)},useContext:function(s){return je="useContext",wt(),rr(),Yr(s)},useEffect:function(s,c){return je="useEffect",wt(),rr(),Cd(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",wt(),rr(),Nh(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",wt(),rr(),Ph(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",wt(),rr(),wh(s,c)},useMemo:function(s,c){je="useMemo",wt(),rr();var N=ot.current;ot.current=Ra;try{return kh(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",wt(),rr();var L=ot.current;ot.current=Ra;try{return Sh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",wt(),rr(),Ah(s)},useState:function(s){je="useState",wt(),rr();var c=ot.current;ot.current=Ra;try{return bd(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",wt(),rr(),void 0},useDeferredValue:function(s){return je="useDeferredValue",wt(),rr(),Dh(s)},useTransition:function(){return je="useTransition",wt(),rr(),Lh()},useMutableSource:function(s,c,N){return je="useMutableSource",wt(),rr(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",wt(),rr(),Rh(s,c,N)},useId:function(){return je="useId",wt(),rr(),Fh()},unstable_isNewReconciler:_},ea={readContext:function(s){return jh(),Yr(s)},useCallback:function(s,c){return je="useCallback",wt(),qe(),Od(s,c)},useContext:function(s){return je="useContext",wt(),qe(),Yr(s)},useEffect:function(s,c){return je="useEffect",wt(),qe(),Xu(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",wt(),qe(),wd(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",wt(),qe(),Ad(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",wt(),qe(),Pd(s,c)},useMemo:function(s,c){je="useMemo",wt(),qe();var N=ot.current;ot.current=ea;try{return kd(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",wt(),qe();var L=ot.current;ot.current=ea;try{return Eh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",wt(),qe(),Rd()},useState:function(s){je="useState",wt(),qe();var c=ot.current;ot.current=ea;try{return Th(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",wt(),qe(),Nd()},useDeferredValue:function(s){return je="useDeferredValue",wt(),qe(),Tm(s)},useTransition:function(){return je="useTransition",wt(),qe(),Pm()},useMutableSource:function(s,c,N){return je="useMutableSource",wt(),qe(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",wt(),qe(),Ed(s,c)},useId:function(){return je="useId",wt(),qe(),Dd()},unstable_isNewReconciler:_},Fd={readContext:function(s){return jh(),Yr(s)},useCallback:function(s,c){return je="useCallback",wt(),qe(),Od(s,c)},useContext:function(s){return je="useContext",wt(),qe(),Yr(s)},useEffect:function(s,c){return je="useEffect",wt(),qe(),Xu(s,c)},useImperativeHandle:function(s,c,N){return je="useImperativeHandle",wt(),qe(),wd(s,c,N)},useInsertionEffect:function(s,c){return je="useInsertionEffect",wt(),qe(),Ad(s,c)},useLayoutEffect:function(s,c){return je="useLayoutEffect",wt(),qe(),Pd(s,c)},useMemo:function(s,c){je="useMemo",wt(),qe();var N=ot.current;ot.current=ea;try{return kd(s,c)}finally{ot.current=N}},useReducer:function(s,c,N){je="useReducer",wt(),qe();var L=ot.current;ot.current=ea;try{return bh(s,c,N)}finally{ot.current=L}},useRef:function(s){return je="useRef",wt(),qe(),Rd()},useState:function(s){je="useState",wt(),qe();var c=ot.current;ot.current=ea;try{return Ch(s)}finally{ot.current=c}},useDebugValue:function(s,c){return je="useDebugValue",wt(),qe(),Nd()},useDeferredValue:function(s){return je="useDeferredValue",wt(),qe(),Cm(s)},useTransition:function(){return je="useTransition",wt(),qe(),wm()},useMutableSource:function(s,c,N){return je="useMutableSource",wt(),qe(),void 0},useSyncExternalStore:function(s,c,N){return je="useSyncExternalStore",wt(),qe(),Ed(s,c)},useId:function(){return je="useId",wt(),qe(),Dd()},unstable_isNewReconciler:_}}var Us=n.unstable_now,$m=0,jd=-1,qu=-1,Md=-1,Mh=!1,Id=!1;function Um(){return Mh}function i0(){Id=!0}function a0(){Mh=!1,Id=!1}function s0(){Mh=Id,Id=!1}function Gm(){return $m}function Bm(){$m=Us()}function Ih(s){qu=Us(),s.actualStartTime<0&&(s.actualStartTime=Us())}function zm(s){qu=-1}function $d(s,c){if(qu>=0){var N=Us()-qu;s.actualDuration+=N,c&&(s.selfBaseDuration=N),qu=-1}}function Ta(s){if(jd>=0){var c=Us()-jd;jd=-1;for(var N=s.return;N!==null;){switch(N.tag){case k:var L=N.stateNode;L.effectDuration+=c;return;case U:var M=N.stateNode;M.effectDuration+=c;return}N=N.return}}}function $h(s){if(Md>=0){var c=Us()-Md;Md=-1;for(var N=s.return;N!==null;){switch(N.tag){case k:var L=N.stateNode;L!==null&&(L.passiveEffectDuration+=c);return;case U:var M=N.stateNode;M!==null&&(M.passiveEffectDuration+=c);return}N=N.return}}}function Ca(){jd=Us()}function Uh(){Md=Us()}function Gh(s){for(var c=s.child;c;)s.actualDuration+=c.actualDuration,c=c.sibling}function So(s,c){return{value:s,source:c,stack:Ve(c),digest:null}}function Bh(s,c,N){return{value:s,source:null,stack:N??null,digest:c??null}}function o0(s,c){return!0}function zh(s,c){try{var N=o0(s,c);if(N===!1)return;var L=c.value,M=c.source,Y=c.stack,re=Y!==null?Y:"";if(L!=null&&L._suppressLogging){if(s.tag===P)return;console.error(L)}var ie=M?Ee(M):null,le=ie?"The above error occurred in the <"+ie+"> component:":"The above error occurred in one of your React components:",he;if(s.tag===k)he=`Consider adding an error boundary to your tree to customize error handling behavior.
181
+ Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;else{var ve=Ee(s)||"Anonymous";he="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+ve+".")}var be=le+`
182
+ `+re+`
183
+
184
+ `+(""+he);console.error(be)}catch(we){setTimeout(function(){throw we})}}var l0=typeof WeakMap=="function"?WeakMap:Map;function Hm(s,c,N){var L=ns(cr,N);L.tag=zf,L.payload={element:null};var M=c.value;return L.callback=function(){v_(M),zh(s,c)},L}function Hh(s,c,N){var L=ns(cr,N);L.tag=zf;var M=s.type.getDerivedStateFromError;if(typeof M=="function"){var Y=c.value;L.payload=function(){return M(Y)},L.callback=function(){rv(s),zh(s,c)}}var re=s.stateNode;return re!==null&&typeof re.componentDidCatch=="function"&&(L.callback=function(){rv(s),zh(s,c),typeof M!="function"&&m_(this);var le=c.value,he=c.stack;this.componentDidCatch(le,{componentStack:he!==null?he:""}),typeof M!="function"&&(Cr(s.lanes,Tt)||d("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",Ee(s)||"Unknown"))}),L}function Vm(s,c,N){var L=s.pingCache,M;if(L===null?(L=s.pingCache=new l0,M=new Set,L.set(c,M)):(M=L.get(c),M===void 0&&(M=new Set,L.set(c,M))),!M.has(N)){M.add(N);var Y=y_.bind(null,s,c,N);Ln&&pc(s,N),c.then(Y,Y)}}function u0(s,c,N,L){var M=s.updateQueue;if(M===null){var Y=new Set;Y.add(N),s.updateQueue=Y}else M.add(N)}function c0(s,c){var N=s.tag;if((s.mode&Ut)===Et&&(N===w||N===z||N===B)){var L=s.alternate;L?(s.updateQueue=L.updateQueue,s.memoizedState=L.memoizedState,s.lanes=L.lanes):(s.updateQueue=null,s.memoizedState=null)}}function Wm(s){var c=s;do{if(c.tag===$&&Kv(c))return c;c=c.return}while(c!==null);return null}function Ym(s,c,N,L,M){if((s.mode&Ut)===Et){if(s===c)s.flags|=qr;else{if(s.flags|=Nt,N.flags|=ge,N.flags&=~(Po|La),N.tag===P){var Y=N.alternate;if(Y===null)N.tag=Q;else{var re=ns(cr,Tt);re.tag=ud,js(N,re,Tt)}}N.lanes=Rt(N.lanes,Tt)}return s}return s.flags|=qr,s.lanes=M,s}function d0(s,c,N,L,M){if(N.flags|=La,Ln&&pc(s,M),L!==null&&typeof L=="object"&&typeof L.then=="function"){var Y=L;c0(N),j()&&N.mode&Ut&&ju();var re=Wm(c);if(re!==null){re.flags&=~Er,Ym(re,c,N,s,M),re.mode&Ut&&Vm(s,Y,M),u0(re,s,Y);return}else{if(!Mc(M)){Vm(s,Y,M),Ap();return}var ie=new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");L=ie}}else if(j()&&N.mode&Ut){ju();var le=Wm(c);if(le!==null){(le.flags&qr)===Pe&&(le.flags|=Er),Ym(le,c,N,s,M),H(So(L,N));return}}L=So(L,N),o_(L);var he=c;do{switch(he.tag){case k:{var ve=L;he.flags|=qr;var be=Va(M);he.lanes=Rt(he.lanes,be);var we=Hm(he,ve,be);Wf(he,we);return}case P:var Me=L,Ue=he.type,Ie=he.stateNode;if((he.flags&Nt)===Pe&&(typeof Ue.getDerivedStateFromError=="function"||Ie!==null&&typeof Ie.componentDidCatch=="function"&&!Yg(Ie))){he.flags|=qr;var vt=Va(M);he.lanes=Rt(he.lanes,vt);var Ct=Hh(he,Me,vt);Wf(he,Ct);return}break}he=he.return}while(he!==null)}function f0(){return null}var Qu=a.ReactCurrentOwner,ta=!1,Vh,Ju,Wh,Yh,Kh,Eo,Xh,Ud;Vh={},Ju={},Wh={},Yh={},Kh={},Eo=!1,Xh={},Ud={};function Xn(s,c,N,L){s===null?c.child=fm(c,null,N,L):c.child=Al(c,s.child,N,L)}function h0(s,c,N,L){c.child=Al(c,s.child,null,L),c.child=Al(c,null,N,L)}function Km(s,c,N,L,M){if(c.type!==c.elementType){var Y=N.propTypes;Y&&ti(Y,L,"prop",De(N))}var re=N.render,ie=c.ref,le,he;Cl(c,M),Ka(c);{if(Qu.current=c,xe(!0),le=Dl(s,c,re,L,ie,M),he=Ll(),c.mode&tr){Nr(!0);try{le=Dl(s,c,re,L,ie,M),he=Ll()}finally{Nr(!1)}}xe(!1)}return pr(),s!==null&&!ta?(gm(s,c,M),is(s,c,M)):(j()&&he&&Fu(c),c.flags|=Xe,Xn(s,c,le,M),c.child)}function Xm(s,c,N,L,M){if(s===null){var Y=N.type;if(F_(Y)&&N.compare===null&&N.defaultProps===void 0){var re=Y;return re=Bl(Y),c.tag=B,c.type=re,Jh(c,Y),qm(s,c,re,L,M)}{var ie=Y.propTypes;ie&&ti(ie,L,"prop",De(Y))}var le=Mp(N.type,null,L,c,c.mode,M);return le.ref=c.ref,le.return=c,c.child=le,le}{var he=N.type,ve=he.propTypes;ve&&ti(ve,L,"prop",De(he))}var be=s.child,we=ip(s,M);if(!we){var Me=be.memoizedProps,Ue=N.compare;if(Ue=Ue!==null?Ue:_e,Ue(Me,L)&&s.ref===c.ref)return is(s,c,M)}c.flags|=Xe;var Ie=Ao(be,L);return Ie.ref=c.ref,Ie.return=c,c.child=Ie,Ie}function qm(s,c,N,L,M){if(c.type!==c.elementType){var Y=c.elementType;if(Y.$$typeof===ft){var re=Y,ie=re._payload,le=re._init;try{Y=le(ie)}catch{Y=null}var he=Y&&Y.propTypes;he&&ti(he,L,"prop",De(Y))}}if(s!==null){var ve=s.memoizedProps;if(_e(ve,L)&&s.ref===c.ref&&c.type===s.type)if(ta=!1,c.pendingProps=L=ve,ip(s,M))(s.flags&ge)!==Pe&&(ta=!0);else return c.lanes=s.lanes,is(s,c,M)}return qh(s,c,N,L,M)}function Qm(s,c,N){var L=c.pendingProps,M=L.children,Y=s!==null?s.memoizedState:null;if(L.mode==="hidden"||x)if((c.mode&Ut)===Et){var re={baseLanes:$e,cachePool:null,transitions:null};c.memoizedState=re,df(c,N)}else if(Cr(N,On)){var be={baseLanes:$e,cachePool:null,transitions:null};c.memoizedState=be;var we=Y!==null?Y.baseLanes:N;df(c,we)}else{var ie=null,le;if(Y!==null){var he=Y.baseLanes;le=Rt(he,N)}else le=N;c.lanes=c.childLanes=On;var ve={baseLanes:le,cachePool:ie,transitions:null};return c.memoizedState=ve,c.updateQueue=null,df(c,le),null}else{var Me;Y!==null?(Me=Rt(Y.baseLanes,N),c.memoizedState=null):Me=N,df(c,Me)}return Xn(s,c,M,N),c.child}function p0(s,c,N){var L=c.pendingProps;return Xn(s,c,L,N),c.child}function m0(s,c,N){var L=c.pendingProps.children;return Xn(s,c,L,N),c.child}function g0(s,c,N){{c.flags|=it;{var L=c.stateNode;L.effectDuration=0,L.passiveEffectDuration=0}}var M=c.pendingProps,Y=M.children;return Xn(s,c,Y,N),c.child}function Jm(s,c){var N=c.ref;(s===null&&N!==null||s!==null&&s.ref!==N)&&(c.flags|=dn,c.flags|=Je)}function qh(s,c,N,L,M){if(c.type!==c.elementType){var Y=N.propTypes;Y&&ti(Y,L,"prop",De(N))}var re;{var ie=fa(c,N,!0);re=Vi(c,ie)}var le,he;Cl(c,M),Ka(c);{if(Qu.current=c,xe(!0),le=Dl(s,c,N,L,re,M),he=Ll(),c.mode&tr){Nr(!0);try{le=Dl(s,c,N,L,re,M),he=Ll()}finally{Nr(!1)}}xe(!1)}return pr(),s!==null&&!ta?(gm(s,c,M),is(s,c,M)):(j()&&he&&Fu(c),c.flags|=Xe,Xn(s,c,le,M),c.child)}function Zm(s,c,N,L,M){{switch(dv(c)){case!1:{var Y=c.stateNode,re=c.type,ie=new re(c.memoizedProps,Y.context),le=ie.state;Y.updater.enqueueSetState(Y,le,null);break}case!0:{c.flags|=Nt,c.flags|=qr;var he=new Error("Simulated error coming from DevTools"),ve=Va(M);c.lanes=Rt(c.lanes,ve);var be=Hh(c,So(he,c),ve);Wf(c,be);break}}if(c.type!==c.elementType){var we=N.propTypes;we&&ti(we,L,"prop",De(N))}}var Me;vn(N)?(Me=!0,ha(c)):Me=!1,Cl(c,M);var Ue=c.stateNode,Ie;Ue===null?(Bd(s,c),om(c,N,L),ih(c,N,L,M),Ie=!0):s===null?Ie=Bv(c,N,L,M):Ie=zv(s,c,N,L,M);var vt=Qh(s,c,N,Ie,Me,M);{var Ct=c.stateNode;Ie&&Ct.props!==L&&(Eo||d("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Ee(c)||"a component"),Eo=!0)}return vt}function Qh(s,c,N,L,M,Y){Jm(s,c);var re=(c.flags&Nt)!==Pe;if(!L&&!re)return M&&Ss(c,N,!1),is(s,c,Y);var ie=c.stateNode;Qu.current=c;var le;if(re&&typeof N.getDerivedStateFromError!="function")le=null,zm();else{Ka(c);{if(xe(!0),le=ie.render(),c.mode&tr){Nr(!0);try{ie.render()}finally{Nr(!1)}}xe(!1)}pr()}return c.flags|=Xe,s!==null&&re?h0(s,c,le,Y):Xn(s,c,le,Y),c.memoizedState=ie.state,M&&Ss(c,N,!0),c.child}function eg(s){var c=s.stateNode;c.pendingContext?jr(s,c.pendingContext,c.pendingContext!==c.context):c.context&&jr(s,c.context,!1),dh(s,c.containerInfo)}function v0(s,c,N){if(eg(c),s===null)throw new Error("Should have a current fiber. This is a bug in React.");var L=c.pendingProps,M=c.memoizedState,Y=M.element;Zp(s,c),hd(c,L,null,N);var re=c.memoizedState;c.stateNode;var ie=re.element;if(mn&&M.isDehydrated){var le={element:ie,isDehydrated:!1,cache:re.cache,pendingSuspenseBoundaries:re.pendingSuspenseBoundaries,transitions:re.transitions},he=c.updateQueue;if(he.baseState=le,c.memoizedState=le,c.flags&Er){var ve=So(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),c);return tg(s,c,ie,N,ve)}else if(ie!==Y){var be=So(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),c);return tg(s,c,ie,N,be)}else{Ff(c);var we=fm(c,null,ie,N);c.child=we;for(var Me=we;Me;)Me.flags=Me.flags&~nt|ui,Me=Me.sibling}}else{if(v(),ie===Y)return is(s,c,N);Xn(s,c,ie,N)}return c.child}function tg(s,c,N,L,M){return v(),H(M),c.flags|=Er,Xn(s,c,N,L),c.child}function y0(s,c,N){hm(c),s===null&&yo(c);var L=c.type,M=c.pendingProps,Y=s!==null?s.memoizedProps:null,re=M.children,ie=No(L,M);return ie?re=null:Y!==null&&No(L,Y)&&(c.flags|=Sr),Jm(s,c),Xn(s,c,re,N),c.child}function _0(s,c){return s===null&&yo(c),null}function x0(s,c,N,L){Bd(s,c);var M=c.pendingProps,Y=N,re=Y._payload,ie=Y._init,le=ie(re);c.type=le;var he=c.tag=j_(le),ve=Ji(le,M),be;switch(he){case w:return Jh(c,le),c.type=le=Bl(le),be=qh(null,c,le,ve,L),be;case P:return c.type=le=Op(le),be=Zm(null,c,le,ve,L),be;case z:return c.type=le=kp(le),be=Km(null,c,le,ve,L),be;case I:{if(c.type!==c.elementType){var we=le.propTypes;we&&ti(we,ve,"prop",De(le))}return be=Xm(null,c,le,Ji(le.type,ve),L),be}}var Me="";throw le!==null&&typeof le=="object"&&le.$$typeof===ft&&(Me=" Did you wrap a component in React.lazy() more than once?"),new Error("Element type is invalid. Received a promise that resolves to: "+le+". "+("Lazy element type must resolve to a class or function."+Me))}function S0(s,c,N,L,M){Bd(s,c),c.tag=P;var Y;return vn(N)?(Y=!0,ha(c)):Y=!1,Cl(c,M),om(c,N,L),ih(c,N,L,M),Qh(null,c,N,!0,Y,M)}function E0(s,c,N,L){Bd(s,c);var M=c.pendingProps,Y;{var re=fa(c,N,!1);Y=Vi(c,re)}Cl(c,L);var ie,le;Ka(c);{if(N.prototype&&typeof N.prototype.render=="function"){var he=De(N)||"Unknown";Vh[he]||(d("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.",he,he),Vh[he]=!0)}c.mode&tr&&ke.recordLegacyContextWarning(c,null),xe(!0),Qu.current=c,ie=Dl(null,c,N,M,Y,L),le=Ll(),xe(!1)}if(pr(),c.flags|=Xe,typeof ie=="object"&&ie!==null&&typeof ie.render=="function"&&ie.$$typeof===void 0){var ve=De(N)||"Unknown";Ju[ve]||(d("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.",ve,ve,ve),Ju[ve]=!0)}if(typeof ie=="object"&&ie!==null&&typeof ie.render=="function"&&ie.$$typeof===void 0){{var be=De(N)||"Unknown";Ju[be]||(d("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.",be,be,be),Ju[be]=!0)}c.tag=P,c.memoizedState=null,c.updateQueue=null;var we=!1;return vn(N)?(we=!0,ha(c)):we=!1,c.memoizedState=ie.state!==null&&ie.state!==void 0?ie.state:null,Vf(c),sm(c,ie),ih(c,N,M,L),Qh(null,c,N,!0,we,L)}else{if(c.tag=w,c.mode&tr){Nr(!0);try{ie=Dl(null,c,N,M,Y,L),le=Ll()}finally{Nr(!1)}}return j()&&le&&Fu(c),Xn(null,c,ie,L),Jh(c,N),c.child}}function Jh(s,c){{if(c&&c.childContextTypes&&d("%s(...): childContextTypes cannot be defined on a function component.",c.displayName||c.name||"Component"),s.ref!==null){var N="",L=gr();L&&(N+=`
185
+
186
+ Check the render method of \``+L+"`.");var M=L||"",Y=s._debugSource;Y&&(M=Y.fileName+":"+Y.lineNumber),Kh[M]||(Kh[M]=!0,d("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",N))}if(typeof c.getDerivedStateFromProps=="function"){var re=De(c)||"Unknown";Yh[re]||(d("%s: Function components do not support getDerivedStateFromProps.",re),Yh[re]=!0)}if(typeof c.contextType=="object"&&c.contextType!==null){var ie=De(c)||"Unknown";Wh[ie]||(d("%s: Function components do not support contextType.",ie),Wh[ie]=!0)}}}var Zh={dehydrated:null,treeContext:null,retryLane:Mr};function ep(s){return{baseLanes:s,cachePool:f0(),transitions:null}}function b0(s,c){var N=null;return{baseLanes:Rt(s.baseLanes,c),cachePool:N,transitions:s.transitions}}function R0(s,c,N,L){if(c!==null){var M=c.memoizedState;if(M===null)return!1}return hh(s,zu)}function T0(s,c){return oo(s.childLanes,c)}function rg(s,c,N){var L=c.pendingProps;hv(c)&&(c.flags|=Nt);var M=Zi.current,Y=!1,re=(c.flags&Nt)!==Pe;if(re||R0(M,s)?(Y=!0,c.flags&=~Nt):(s===null||s.memoizedState!==null)&&(M=Yv(M,mm)),M=wl(M),Is(c,M),s===null){yo(c);var ie=c.memoizedState;if(ie!==null){var le=ie.dehydrated;if(le!==null)return N0(c,le)}var he=L.children,ve=L.fallback;if(Y){var be=C0(c,he,ve,N),we=c.child;return we.memoizedState=ep(N),c.memoizedState=Zh,be}else return tp(c,he)}else{var Me=s.memoizedState;if(Me!==null){var Ue=Me.dehydrated;if(Ue!==null)return O0(s,c,re,L,Ue,Me,N)}if(Y){var Ie=L.fallback,vt=L.children,Ct=P0(s,c,vt,Ie,N),St=c.child,or=s.child.memoizedState;return St.memoizedState=or===null?ep(N):b0(or,N),St.childLanes=T0(s,N),c.memoizedState=Zh,Ct}else{var Kt=L.children,Te=A0(s,c,Kt,N);return c.memoizedState=null,Te}}}function tp(s,c,N){var L=s.mode,M={mode:"visible",children:c},Y=rp(M,L);return Y.return=s,s.child=Y,Y}function C0(s,c,N,L){var M=s.mode,Y=s.child,re={mode:"hidden",children:c},ie,le;return(M&Ut)===Et&&Y!==null?(ie=Y,ie.childLanes=$e,ie.pendingProps=re,s.mode&Ft&&(ie.actualDuration=0,ie.actualStartTime=-1,ie.selfBaseDuration=0,ie.treeBaseDuration=0),le=Vs(N,M,L,null)):(ie=rp(re,M),le=Vs(N,M,L,null)),ie.return=s,le.return=s,ie.sibling=le,s.child=ie,le}function rp(s,c,N){return iv(s,c,$e,null)}function ng(s,c){return Ao(s,c)}function A0(s,c,N,L){var M=s.child,Y=M.sibling,re=ng(M,{mode:"visible",children:N});if((c.mode&Ut)===Et&&(re.lanes=L),re.return=c,re.sibling=null,Y!==null){var ie=c.deletions;ie===null?(c.deletions=[Y],c.flags|=Ht):ie.push(Y)}return c.child=re,re}function P0(s,c,N,L,M){var Y=c.mode,re=s.child,ie=re.sibling,le={mode:"hidden",children:N},he;if((Y&Ut)===Et&&c.child!==re){var ve=c.child;he=ve,he.childLanes=$e,he.pendingProps=le,c.mode&Ft&&(he.actualDuration=0,he.actualStartTime=-1,he.selfBaseDuration=re.selfBaseDuration,he.treeBaseDuration=re.treeBaseDuration),c.deletions=null}else he=ng(re,le),he.subtreeFlags=re.subtreeFlags&_r;var be;return ie!==null?be=Ao(ie,L):(be=Vs(L,Y,M,null),be.flags|=nt),be.return=c,he.return=c,he.sibling=be,c.child=he,be}function Gd(s,c,N,L){L!==null&&H(L),Al(c,s.child,null,N);var M=c.pendingProps,Y=M.children,re=tp(c,Y);return re.flags|=nt,c.memoizedState=null,re}function w0(s,c,N,L,M){var Y=c.mode,re={mode:"visible",children:N},ie=rp(re,Y),le=Vs(L,Y,M,null);return le.flags|=nt,ie.return=c,le.return=c,ie.sibling=le,c.child=ie,(c.mode&Ut)!==Et&&Al(c,s.child,null,M),le}function N0(s,c,N){return(s.mode&Ut)===Et?(d("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),s.lanes=Tt):Gi(c)?s.lanes=yi:s.lanes=On,null}function O0(s,c,N,L,M,Y,re){if(N)if(c.flags&Er){c.flags&=~Er;var Te=Bh(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));return Gd(s,c,re,Te)}else{if(c.memoizedState!==null)return c.child=s.child,c.flags|=Nt,null;var Fe=L.children,Re=L.fallback,Ye=w0(s,c,Fe,Re,re),mt=c.child;return mt.memoizedState=ep(re),c.memoizedState=Zh,Ye}else{if(Lf(),(c.mode&Ut)===Et)return Gd(s,c,re,null);if(Gi(M)){var ie,le,he;{var ve=Ec(M);ie=ve.digest,le=ve.message,he=ve.stack}var be;le?be=new Error(le):be=new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");var we=Bh(be,ie,he);return Gd(s,c,re,we)}var Me=Cr(re,s.childLanes);if(ta||Me){var Ue=uf();if(Ue!==null){var Ie=fl(Ue,re);if(Ie!==Mr&&Ie!==Y.retryLane){Y.retryLane=Ie;var vt=cr;Kn(s,Ie),Xr(Ue,s,Ie,vt)}}Ap();var Ct=Bh(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));return Gd(s,c,re,Ct)}else if(Ai(M)){c.flags|=Nt,c.child=s.child;var St=__.bind(null,s);return nu(M,St),null}else{ii(c,M,Y.treeContext);var or=L.children,Kt=tp(c,or);return Kt.flags|=ui,Kt}}}function ig(s,c,N){s.lanes=Rt(s.lanes,c);var L=s.alternate;L!==null&&(L.lanes=Rt(L.lanes,c)),Gf(s.return,c,N)}function k0(s,c,N){for(var L=c;L!==null;){if(L.tag===$){var M=L.memoizedState;M!==null&&ig(L,N,s)}else if(L.tag===ne)ig(L,N,s);else if(L.child!==null){L.child.return=L,L=L.child;continue}if(L===s)return;for(;L.sibling===null;){if(L.return===null||L.return===s)return;L=L.return}L.sibling.return=L.return,L=L.sibling}}function D0(s){for(var c=s,N=null;c!==null;){var L=c.alternate;L!==null&&xd(L)===null&&(N=c),c=c.sibling}return N}function L0(s){if(s!==void 0&&s!=="forwards"&&s!=="backwards"&&s!=="together"&&!Xh[s])if(Xh[s]=!0,typeof s=="string")switch(s.toLowerCase()){case"together":case"forwards":case"backwards":{d('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',s,s.toLowerCase());break}case"forward":case"backward":{d('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',s,s.toLowerCase());break}default:d('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',s);break}else d('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',s)}function F0(s,c){s!==void 0&&!Ud[s]&&(s!=="collapsed"&&s!=="hidden"?(Ud[s]=!0,d('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',s)):c!=="forwards"&&c!=="backwards"&&(Ud[s]=!0,d('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',s)))}function ag(s,c){{var N=$t(s),L=!N&&typeof pe(s)=="function";if(N||L){var M=N?"array":"iterable";return d("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>",M,c,M),!1}}return!0}function j0(s,c){if((c==="forwards"||c==="backwards")&&s!==void 0&&s!==null&&s!==!1)if($t(s)){for(var N=0;N<s.length;N++)if(!ag(s[N],N))return}else{var L=pe(s);if(typeof L=="function"){var M=L.call(s);if(M)for(var Y=M.next(),re=0;!Y.done;Y=M.next()){if(!ag(Y.value,re))return;re++}}else d('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?',c)}}function np(s,c,N,L,M){var Y=s.memoizedState;Y===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:L,tail:N,tailMode:M}:(Y.isBackwards=c,Y.rendering=null,Y.renderingStartTime=0,Y.last=L,Y.tail=N,Y.tailMode=M)}function sg(s,c,N){var L=c.pendingProps,M=L.revealOrder,Y=L.tail,re=L.children;L0(M),F0(Y,M),j0(re,M),Xn(s,c,re,N);var ie=Zi.current,le=hh(ie,zu);if(le)ie=ph(ie,zu),c.flags|=Nt;else{var he=s!==null&&(s.flags&Nt)!==Pe;he&&k0(c,c.child,N),ie=wl(ie)}if(Is(c,ie),(c.mode&Ut)===Et)c.memoizedState=null;else switch(M){case"forwards":{var ve=D0(c.child),be;ve===null?(be=c.child,c.child=null):(be=ve.sibling,ve.sibling=null),np(c,!1,be,ve,Y);break}case"backwards":{var we=null,Me=c.child;for(c.child=null;Me!==null;){var Ue=Me.alternate;if(Ue!==null&&xd(Ue)===null){c.child=Me;break}var Ie=Me.sibling;Me.sibling=we,we=Me,Me=Ie}np(c,!0,we,null,Y);break}case"together":{np(c,!1,null,null,void 0);break}default:c.memoizedState=null}return c.child}function M0(s,c,N){dh(c,c.stateNode.containerInfo);var L=c.pendingProps;return s===null?c.child=Al(c,null,L,N):Xn(s,c,L,N),c.child}var og=!1;function I0(s,c,N){var L=c.type,M=L._context,Y=c.pendingProps,re=c.memoizedProps,ie=Y.value;{"value"in Y||og||(og=!0,d("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var le=c.type.propTypes;le&&ti(le,Y,"prop","Context.Provider")}if(Xp(c,M,ie),re!==null){var he=re.value;if(Dr(he,ie)){if(re.children===Y.children&&!xs())return is(s,c,N)}else kv(c,M,N)}var ve=Y.children;return Xn(s,c,ve,N),c.child}var lg=!1;function $0(s,c,N){var L=c.type;L._context===void 0?L!==L.Consumer&&(lg||(lg=!0,d("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):L=L._context;var M=c.pendingProps,Y=M.children;typeof Y!="function"&&d("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."),Cl(c,N);var re=Yr(L);Ka(c);var ie;return Qu.current=c,xe(!0),ie=Y(re),xe(!1),pr(),c.flags|=Xe,Xn(s,c,ie,N),c.child}function Zu(){ta=!0}function Bd(s,c){(c.mode&Ut)===Et&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=nt)}function is(s,c,N){return s!==null&&(c.dependencies=s.dependencies),zm(),hc(c.lanes),Cr(N,c.childLanes)?(Hv(s,c),c.child):null}function U0(s,c,N){{var L=c.return;if(L===null)throw new Error("Cannot swap the root fiber.");if(s.alternate=null,c.alternate=null,N.index=c.index,N.sibling=c.sibling,N.return=c.return,N.ref=c.ref,c===L.child)L.child=N;else{var M=L.child;if(M===null)throw new Error("Expected parent to have a child.");for(;M.sibling!==c;)if(M=M.sibling,M===null)throw new Error("Expected to find the previous sibling.");M.sibling=N}var Y=L.deletions;return Y===null?(L.deletions=[s],L.flags|=Ht):Y.push(s),N.flags|=nt,N}}function ip(s,c){var N=s.lanes;return!!Cr(N,c)}function G0(s,c,N){switch(c.tag){case k:eg(c),c.stateNode,v();break;case F:hm(c);break;case P:{var L=c.type;vn(L)&&ha(c);break}case D:dh(c,c.stateNode.containerInfo);break;case q:{var M=c.memoizedProps.value,Y=c.type._context;Xp(c,Y,M);break}case U:{var re=Cr(N,c.childLanes);re&&(c.flags|=it);{var ie=c.stateNode;ie.effectDuration=0,ie.passiveEffectDuration=0}}break;case $:{var le=c.memoizedState;if(le!==null){if(le.dehydrated!==null)return Is(c,wl(Zi.current)),c.flags|=Nt,null;var he=c.child,ve=he.childLanes;if(Cr(N,ve))return rg(s,c,N);Is(c,wl(Zi.current));var be=is(s,c,N);return be!==null?be.sibling:null}else Is(c,wl(Zi.current));break}case ne:{var we=(s.flags&Nt)!==Pe,Me=Cr(N,c.childLanes);if(we){if(Me)return sg(s,c,N);c.flags|=Nt}var Ue=c.memoizedState;if(Ue!==null&&(Ue.rendering=null,Ue.tail=null,Ue.lastEffect=null),Is(c,Zi.current),Me)break;return null}case Z:case se:return c.lanes=$e,Qm(s,c,N)}return is(s,c,N)}function ug(s,c,N){if(c._debugNeedsRemount&&s!==null)return U0(s,c,Mp(c.type,c.key,c.pendingProps,c._debugOwner||null,c.mode,c.lanes));if(s!==null){var L=s.memoizedProps,M=c.pendingProps;if(L!==M||xs()||c.type!==s.type)ta=!0;else{var Y=ip(s,N);if(!Y&&(c.flags&Nt)===Pe)return ta=!1,G0(s,c,N);(s.flags&ge)!==Pe?ta=!0:ta=!1}}else if(ta=!1,j()&&Za(c)){var re=c.index,ie=Kc();mo(c,ie,re)}switch(c.lanes=$e,c.tag){case O:return E0(s,c,c.type,N);case X:{var le=c.elementType;return x0(s,c,le,N)}case w:{var he=c.type,ve=c.pendingProps,be=c.elementType===he?ve:Ji(he,ve);return qh(s,c,he,be,N)}case P:{var we=c.type,Me=c.pendingProps,Ue=c.elementType===we?Me:Ji(we,Me);return Zm(s,c,we,Ue,N)}case k:return v0(s,c,N);case F:return y0(s,c,N);case G:return _0(s,c);case $:return rg(s,c,N);case D:return M0(s,c,N);case z:{var Ie=c.type,vt=c.pendingProps,Ct=c.elementType===Ie?vt:Ji(Ie,vt);return Km(s,c,Ie,Ct,N)}case V:return p0(s,c,N);case W:return m0(s,c,N);case U:return g0(s,c,N);case q:return I0(s,c,N);case ee:return $0(s,c,N);case I:{var St=c.type,or=c.pendingProps,Kt=Ji(St,or);if(c.type!==c.elementType){var Te=St.propTypes;Te&&ti(Te,Kt,"prop",De(St))}return Kt=Ji(St.type,Kt),Xm(s,c,St,Kt,N)}case B:return qm(s,c,c.type,c.pendingProps,N);case Q:{var Fe=c.type,Re=c.pendingProps,Ye=c.elementType===Fe?Re:Ji(Fe,Re);return S0(s,c,Fe,Ye,N)}case ne:return sg(s,c,N);case ae:break;case Z:return Qm(s,c,N)}throw new Error("Unknown unit of work tag ("+c.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Aa(s){s.flags|=it}function cg(s){s.flags|=dn,s.flags|=Je}function dg(s,c){var N=s!==null&&s.child===c.child;if(N)return!0;if((c.flags&Ht)!==Pe)return!1;for(var L=c.child;L!==null;){if((L.flags&br)!==Pe||(L.subtreeFlags&br)!==Pe)return!1;L=L.sibling}return!0}var ec,tc,zd,Hd;if(pn)ec=function(s,c,N,L){for(var M=c.child;M!==null;){if(M.tag===F||M.tag===G)hn(s,M.stateNode);else if(M.tag!==D){if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===c)return;for(;M.sibling===null;){if(M.return===null||M.return===c)return;M=M.return}M.sibling.return=M.return,M=M.sibling}},tc=function(s,c){},zd=function(s,c,N,L,M){var Y=s.memoizedProps;if(Y!==L){var re=c.stateNode,ie=Bu(),le=Yl(re,N,Y,L,M,ie);c.updateQueue=le,le&&Aa(c)}},Hd=function(s,c,N,L){N!==L&&Aa(c)};else if(Ia){ec=function(s,c,N,L){for(var M=c.child;M!==null;){if(M.tag===F){var Y=M.stateNode;if(N&&L){var re=M.memoizedProps,ie=M.type;Y=qs(Y,ie,re,M)}hn(s,Y)}else if(M.tag===G){var le=M.stateNode;if(N&&L){var he=M.memoizedProps;le=Un(le,he,M)}hn(s,le)}else if(M.tag!==D){if(M.tag===Z&&M.memoizedState!==null){var ve=M.child;ve!==null&&(ve.return=M),ec(s,M,!0,!0)}else if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M=M,M===c)return;for(;M.sibling===null;){if(M.return===null||M.return===c)return;M=M.return}M.sibling.return=M.return,M=M.sibling}};var fg=function(s,c,N,L){for(var M=c.child;M!==null;){if(M.tag===F){var Y=M.stateNode;if(N&&L){var re=M.memoizedProps,ie=M.type;Y=qs(Y,ie,re,M)}$a(s,Y)}else if(M.tag===G){var le=M.stateNode;if(N&&L){var he=M.memoizedProps;le=Un(le,he,M)}$a(s,le)}else if(M.tag!==D){if(M.tag===Z&&M.memoizedState!==null){var ve=M.child;ve!==null&&(ve.return=M),fg(s,M,!0,!0)}else if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M=M,M===c)return;for(;M.sibling===null;){if(M.return===null||M.return===c)return;M=M.return}M.sibling.return=M.return,M=M.sibling}};tc=function(s,c){var N=c.stateNode,L=dg(s,c);if(!L){var M=N.containerInfo,Y=hi(M);fg(Y,c,!1,!1),N.pendingChildren=Y,Aa(c),ds(M,Y)}},zd=function(s,c,N,L,M){var Y=s.stateNode,re=s.memoizedProps,ie=dg(s,c);if(ie&&re===L){c.stateNode=Y;return}var le=c.stateNode,he=Bu(),ve=null;if(re!==L&&(ve=Yl(le,N,re,L,M,he)),ie&&ve===null){c.stateNode=Y;return}var be=Cf(Y,ve,N,re,L,c,ie,le);Ks(be,N,L,M,he)&&Aa(c),c.stateNode=be,ie?Aa(c):ec(be,c,!1,!1)},Hd=function(s,c,N,L){if(N!==L){var M=ch(),Y=Bu();c.stateNode=Xs(L,M,Y,c),Aa(c)}else c.stateNode=s.stateNode}}else tc=function(s,c){},zd=function(s,c,N,L,M){},Hd=function(s,c,N,L){};function rc(s,c){if(!j())switch(s.tailMode){case"hidden":{for(var N=s.tail,L=null;N!==null;)N.alternate!==null&&(L=N),N=N.sibling;L===null?s.tail=null:L.sibling=null;break}case"collapsed":{for(var M=s.tail,Y=null;M!==null;)M.alternate!==null&&(Y=M),M=M.sibling;Y===null?!c&&s.tail!==null?s.tail.sibling=null:s.tail=null:Y.sibling=null;break}}}function En(s){var c=s.alternate!==null&&s.alternate.child===s.child,N=$e,L=Pe;if(c){if((s.mode&Ft)!==Et){for(var le=s.selfBaseDuration,he=s.child;he!==null;)N=Rt(N,Rt(he.lanes,he.childLanes)),L|=he.subtreeFlags&_r,L|=he.flags&_r,le+=he.treeBaseDuration,he=he.sibling;s.treeBaseDuration=le}else for(var ve=s.child;ve!==null;)N=Rt(N,Rt(ve.lanes,ve.childLanes)),L|=ve.subtreeFlags&_r,L|=ve.flags&_r,ve.return=s,ve=ve.sibling;s.subtreeFlags|=L}else{if((s.mode&Ft)!==Et){for(var M=s.actualDuration,Y=s.selfBaseDuration,re=s.child;re!==null;)N=Rt(N,Rt(re.lanes,re.childLanes)),L|=re.subtreeFlags,L|=re.flags,M+=re.actualDuration,Y+=re.treeBaseDuration,re=re.sibling;s.actualDuration=M,s.treeBaseDuration=Y}else for(var ie=s.child;ie!==null;)N=Rt(N,Rt(ie.lanes,ie.childLanes)),L|=ie.subtreeFlags,L|=ie.flags,ie.return=s,ie=ie.sibling;s.subtreeFlags|=L}return s.childLanes=N,c}function B0(s,c,N){if(Mf()&&(c.mode&Ut)!==Et&&(c.flags&Nt)===Pe)return rd(c),v(),c.flags|=Er|La|qr,!1;var L=ts(c);if(N!==null&&N.dehydrated!==null)if(s===null){if(!L)throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(ed(c),En(c),(c.mode&Ft)!==Et){var M=N!==null;if(M){var Y=c.child;Y!==null&&(c.treeBaseDuration-=Y.treeBaseDuration)}}return!1}else{if(v(),(c.flags&Nt)===Pe&&(c.memoizedState=null),c.flags|=it,En(c),(c.mode&Ft)!==Et){var re=N!==null;if(re){var ie=c.child;ie!==null&&(c.treeBaseDuration-=ie.treeBaseDuration)}}return!1}else return b(),!0}function hg(s,c,N){var L=c.pendingProps;switch(bl(c),c.tag){case O:case X:case B:case w:case z:case V:case W:case U:case ee:case I:return En(c),null;case P:{var M=c.type;return vn(M)&&hr(c),En(c),null}case k:{var Y=c.stateNode;if(Pl(c),Rr(c),gh(),Y.pendingContext&&(Y.context=Y.pendingContext,Y.pendingContext=null),s===null||s.child===null){var re=ts(c);if(re)Aa(c);else if(s!==null){var ie=s.memoizedState;(!ie.isDehydrated||(c.flags&Er)!==Pe)&&(c.flags|=An,b())}}return tc(s,c),En(c),null}case F:{fh(c);var le=ch(),he=c.type;if(s!==null&&c.stateNode!=null)zd(s,c,he,L,le),s.ref!==c.ref&&cg(c);else{if(!L){if(c.stateNode===null)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return En(c),null}var ve=Bu(),be=ts(c);if(be)jf(c,le,ve)&&Aa(c);else{var we=us(he,L,le,ve,c);ec(we,c,!1,!1),c.stateNode=we,Ks(we,he,L,le,ve)&&Aa(c)}c.ref!==null&&cg(c)}return En(c),null}case G:{var Me=L;if(s&&c.stateNode!=null){var Ue=s.memoizedProps;Hd(s,c,Ue,Me)}else{if(typeof Me!="string"&&c.stateNode===null)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var Ie=ch(),vt=Bu(),Ct=ts(c);Ct?Zc(c)&&Aa(c):c.stateNode=Xs(Me,Ie,vt,c)}return En(c),null}case $:{Nl(c);var St=c.memoizedState;if(s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){var or=B0(s,c,St);if(!or)return c.flags&qr?c:null}if((c.flags&Nt)!==Pe)return c.lanes=N,(c.mode&Ft)!==Et&&Gh(c),c;var Kt=St!==null,Te=s!==null&&s.memoizedState!==null;if(Kt!==Te&&Kt){var Fe=c.child;if(Fe.flags|=Ii,(c.mode&Ut)!==Et){var Re=s===null&&(c.memoizedProps.unstable_avoidThisFallback!==!0||!C);Re||hh(Zi.current,mm)?s_():Ap()}}var Ye=c.updateQueue;if(Ye!==null&&(c.flags|=it),En(c),(c.mode&Ft)!==Et&&Kt){var mt=c.child;mt!==null&&(c.treeBaseDuration-=mt.treeBaseDuration)}return null}case D:return Pl(c),tc(s,c),s===null&&yf(c.stateNode.containerInfo),En(c),null;case q:var lt=c.type._context;return Uf(lt,c),En(c),null;case Q:{var Yt=c.type;return vn(Yt)&&hr(c),En(c),null}case ne:{Nl(c);var Pt=c.memoizedState;if(Pt===null)return En(c),null;var er=(c.flags&Nt)!==Pe,Gt=Pt.rendering;if(Gt===null)if(er)rc(Pt,!1);else{var vr=l_()&&(s===null||(s.flags&Nt)===Pe);if(!vr)for(var bt=c.child;bt!==null;){var Lr=xd(bt);if(Lr!==null){er=!0,c.flags|=Nt,rc(Pt,!1);var In=Lr.updateQueue;return In!==null&&(c.updateQueue=In,c.flags|=it),c.subtreeFlags=Pe,Vv(c,N),Is(c,ph(Zi.current,zu)),c.child}bt=bt.sibling}Pt.tail!==null&&$r()>Mg()&&(c.flags|=Nt,er=!0,rc(Pt,!1),c.lanes=ol)}else{if(!er){var Cn=xd(Gt);if(Cn!==null){c.flags|=Nt,er=!0;var Ri=Cn.updateQueue;if(Ri!==null&&(c.updateQueue=Ri,c.flags|=it),rc(Pt,!0),Pt.tail===null&&Pt.tailMode==="hidden"&&!Gt.alternate&&!j())return En(c),null}else $r()*2-Pt.renderingStartTime>Mg()&&N!==On&&(c.flags|=Nt,er=!0,rc(Pt,!1),c.lanes=ol)}if(Pt.isBackwards)Gt.sibling=c.child,c.child=Gt;else{var Qn=Pt.last;Qn!==null?Qn.sibling=Gt:c.child=Gt,Pt.last=Gt}}if(Pt.tail!==null){var Jn=Pt.tail;Pt.rendering=Jn,Pt.tail=Jn.sibling,Pt.renderingStartTime=$r(),Jn.sibling=null;var $n=Zi.current;return er?$n=ph($n,zu):$n=wl($n),Is(c,$n),Jn}return En(c),null}case ae:break;case Z:case se:{Cp(c);var os=c.memoizedState,zl=os!==null;if(s!==null){var gc=s.memoizedState,ka=gc!==null;ka!==zl&&!x&&(c.flags|=Ii)}return!zl||(c.mode&Ut)===Et?En(c):Cr(Na,On)&&(En(c),pn&&c.subtreeFlags&(nt|it)&&(c.flags|=Ii)),null}case oe:return null;case fe:return null}throw new Error("Unknown unit of work tag ("+c.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function z0(s,c,N){switch(bl(c),c.tag){case P:{var L=c.type;vn(L)&&hr(c);var M=c.flags;return M&qr?(c.flags=M&~qr|Nt,(c.mode&Ft)!==Et&&Gh(c),c):null}case k:{c.stateNode,Pl(c),Rr(c),gh();var Y=c.flags;return(Y&qr)!==Pe&&(Y&Nt)===Pe?(c.flags=Y&~qr|Nt,c):null}case F:return fh(c),null;case $:{Nl(c);var re=c.memoizedState;if(re!==null&&re.dehydrated!==null){if(c.alternate===null)throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");v()}var ie=c.flags;return ie&qr?(c.flags=ie&~qr|Nt,(c.mode&Ft)!==Et&&Gh(c),c):null}case ne:return Nl(c),null;case D:return Pl(c),null;case q:var le=c.type._context;return Uf(le,c),null;case Z:case se:return Cp(c),null;case oe:return null;default:return null}}function pg(s,c,N){switch(bl(c),c.tag){case P:{var L=c.type.childContextTypes;L!=null&&hr(c);break}case k:{c.stateNode,Pl(c),Rr(c),gh();break}case F:{fh(c);break}case D:Pl(c);break;case $:Nl(c);break;case ne:Nl(c);break;case q:var M=c.type._context;Uf(M,c);break;case Z:case se:Cp(c);break}}function mg(s,c,N,L,M,Y,re,ie,le){var he=Array.prototype.slice.call(arguments,3);try{c.apply(N,he)}catch(ve){this.onError(ve)}}var gg=mg;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var ap=document.createElement("react");gg=function(c,N,L,M,Y,re,ie,le,he){if(typeof document>"u"||document===null)throw new 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 ve=document.createEvent("Event"),be=!1,we=!0,Me=window.event,Ue=Object.getOwnPropertyDescriptor(window,"event");function Ie(){ap.removeEventListener(Fe,Ct,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=Me)}var vt=Array.prototype.slice.call(arguments,3);function Ct(){be=!0,Ie(),N.apply(L,vt),we=!1}var St,or=!1,Kt=!1;function Te(Re){if(St=Re.error,or=!0,St===null&&Re.colno===0&&Re.lineno===0&&(Kt=!0),Re.defaultPrevented&&St!=null&&typeof St=="object")try{St._suppressLogging=!0}catch{}}var Fe="react-"+(c||"invokeguardedcallback");if(window.addEventListener("error",Te),ap.addEventListener(Fe,Ct,!1),ve.initEvent(Fe,!1,!1),ap.dispatchEvent(ve),Ue&&Object.defineProperty(window,"event",Ue),be&&we&&(or?Kt&&(St=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):St=new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(St)),window.removeEventListener("error",Te),!be)return Ie(),mg.apply(this,arguments)}}var H0=gg,nc=!1,Vd=null,V0={onError:function(s){nc=!0,Vd=s}};function vg(s,c,N,L,M,Y,re,ie,le){nc=!1,Vd=null,H0.apply(V0,arguments)}function W0(){return nc}function yg(){if(nc){var s=Vd;return nc=!1,Vd=null,s}else throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}var _g=null;_g=new Set;var Wd=!1,bn=!1,Y0=typeof WeakSet=="function"?WeakSet:Set,pt=null,Fl=null,jl=null;function K0(s){vg(null,function(){throw s}),yg()}var X0=function(s,c){if(c.props=s.memoizedProps,c.state=s.memoizedState,s.mode&Ft)try{Ca(),c.componentWillUnmount()}finally{Ta(s)}else c.componentWillUnmount()};function xg(s,c){try{Gs(sn,s)}catch(N){fr(s,c,N)}}function sp(s,c,N){try{X0(s,N)}catch(L){fr(s,c,L)}}function q0(s,c,N){try{N.componentDidMount()}catch(L){fr(s,c,L)}}function Sg(s,c){try{bg(s)}catch(N){fr(s,c,N)}}function Ml(s,c){var N=s.ref;if(N!==null)if(typeof N=="function"){var L;try{if(A&&T&&s.mode&Ft)try{Ca(),L=N(null)}finally{Ta(s)}else L=N(null)}catch(M){fr(s,c,M)}typeof L=="function"&&d("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",Ee(s))}else N.current=null}function Yd(s,c,N){try{N()}catch(L){fr(s,c,L)}}var Eg=!1;function Q0(s,c){Pn(s.containerInfo),pt=c,J0();var N=Eg;return Eg=!1,N}function J0(){for(;pt!==null;){var s=pt,c=s.child;(s.subtreeFlags&Dt)!==Pe&&c!==null?(c.return=s,pt=c):Z0()}}function Z0(){for(;pt!==null;){var s=pt;nr(s);try{ey(s)}catch(N){fr(s,s.return,N)}ar();var c=s.sibling;if(c!==null){c.return=s.return,pt=c;return}pt=s.return}}function ey(s){var c=s.alternate,N=s.flags;if((N&An)!==Pe){switch(nr(s),s.tag){case w:case z:case B:break;case P:{if(c!==null){var L=c.memoizedProps,M=c.memoizedState,Y=s.stateNode;s.type===s.elementType&&!Eo&&(Y.props!==s.memoizedProps&&d("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.",Ee(s)||"instance"),Y.state!==s.memoizedState&&d("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.",Ee(s)||"instance"));var re=Y.getSnapshotBeforeUpdate(s.elementType===s.type?L:Ji(s.type,L),M);{var ie=_g;re===void 0&&!ie.has(s.type)&&(ie.add(s.type),d("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",Ee(s)))}Y.__reactInternalSnapshotBeforeUpdate=re}break}case k:{if(pn){var le=s.stateNode;Sc(le.containerInfo)}break}case F:case G:case D:case Q:break;default:throw new 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.")}ar()}}function ra(s,c,N){var L=c.updateQueue,M=L!==null?L.lastEffect:null;if(M!==null){var Y=M.next,re=Y;do{if((re.tag&s)===s){var ie=re.destroy;re.destroy=void 0,ie!==void 0&&((s&Sn)!==si?Or(c):(s&sn)!==si&&kr(c),(s&Ea)!==si&&mc(!0),Yd(c,N,ie),(s&Ea)!==si&&mc(!1),(s&Sn)!==si?tn():(s&sn)!==si&&ks())}re=re.next}while(re!==Y)}}function Gs(s,c){var N=c.updateQueue,L=N!==null?N.lastEffect:null;if(L!==null){var M=L.next,Y=M;do{if((Y.tag&s)===s){(s&Sn)!==si?Mt(c):(s&sn)!==si&&Vn(c);var re=Y.create;(s&Ea)!==si&&mc(!0),Y.destroy=re(),(s&Ea)!==si&&mc(!1),(s&Sn)!==si?Vr():(s&sn)!==si&&Os();{var ie=Y.destroy;if(ie!==void 0&&typeof ie!="function"){var le=void 0;(Y.tag&sn)!==Pe?le="useLayoutEffect":(Y.tag&Ea)!==Pe?le="useInsertionEffect":le="useEffect";var he=void 0;ie===null?he=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof ie.then=="function"?he=`
187
+
188
+ It looks like you wrote `+le+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
189
+
190
+ `+le+`(() => {
191
+ async function fetchData() {
192
+ // You can await here
193
+ const response = await MyAPI.getData(someId);
194
+ // ...
195
+ }
196
+ fetchData();
197
+ }, [someId]); // Or [] if effect doesn't need props or state
198
+
199
+ Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:he=" You returned: "+ie,d("%s must not return anything besides a function, which is used for clean-up.%s",le,he)}}}Y=Y.next}while(Y!==M)}}function ty(s,c){if((c.flags&it)!==Pe)switch(c.tag){case U:{var N=c.stateNode.passiveEffectDuration,L=c.memoizedProps,M=L.id,Y=L.onPostCommit,re=Gm(),ie=c.alternate===null?"mount":"update";Um()&&(ie="nested-update"),typeof Y=="function"&&Y(M,ie,N,re);var le=c.return;e:for(;le!==null;){switch(le.tag){case k:var he=le.stateNode;he.passiveEffectDuration+=N;break e;case U:var ve=le.stateNode;ve.passiveEffectDuration+=N;break e}le=le.return}break}}}function ry(s,c,N,L){if((N.flags&lr)!==Pe)switch(N.tag){case w:case z:case B:{if(!bn)if(N.mode&Ft)try{Ca(),Gs(sn|an,N)}finally{Ta(N)}else Gs(sn|an,N);break}case P:{var M=N.stateNode;if(N.flags&it&&!bn)if(c===null)if(N.type===N.elementType&&!Eo&&(M.props!==N.memoizedProps&&d("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.",Ee(N)||"instance"),M.state!==N.memoizedState&&d("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.",Ee(N)||"instance")),N.mode&Ft)try{Ca(),M.componentDidMount()}finally{Ta(N)}else M.componentDidMount();else{var Y=N.elementType===N.type?c.memoizedProps:Ji(N.type,c.memoizedProps),re=c.memoizedState;if(N.type===N.elementType&&!Eo&&(M.props!==N.memoizedProps&&d("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.",Ee(N)||"instance"),M.state!==N.memoizedState&&d("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.",Ee(N)||"instance")),N.mode&Ft)try{Ca(),M.componentDidUpdate(Y,re,M.__reactInternalSnapshotBeforeUpdate)}finally{Ta(N)}else M.componentDidUpdate(Y,re,M.__reactInternalSnapshotBeforeUpdate)}var ie=N.updateQueue;ie!==null&&(N.type===N.elementType&&!Eo&&(M.props!==N.memoizedProps&&d("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.",Ee(N)||"instance"),M.state!==N.memoizedState&&d("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.",Ee(N)||"instance")),tm(N,ie,M));break}case k:{var le=N.updateQueue;if(le!==null){var he=null;if(N.child!==null)switch(N.child.tag){case F:he=ir(N.child.stateNode);break;case P:he=N.child.stateNode;break}tm(N,le,he)}break}case F:{var ve=N.stateNode;if(c===null&&N.flags&it){var be=N.type,we=N.memoizedProps;bf(ve,be,we,N)}break}case G:break;case D:break;case U:{{var Me=N.memoizedProps,Ue=Me.onCommit,Ie=Me.onRender,vt=N.stateNode.effectDuration,Ct=Gm(),St=c===null?"mount":"update";Um()&&(St="nested-update"),typeof Ie=="function"&&Ie(N.memoizedProps.id,St,N.actualDuration,N.treeBaseDuration,N.actualStartTime,Ct);{typeof Ue=="function"&&Ue(N.memoizedProps.id,St,vt,Ct),h_(N);var or=N.return;e:for(;or!==null;){switch(or.tag){case k:var Kt=or.stateNode;Kt.effectDuration+=vt;break e;case U:var Te=or.stateNode;Te.effectDuration+=vt;break e}or=or.return}}}break}case $:{dy(s,N);break}case ne:case Q:case ae:case Z:case se:case fe:break;default:throw new 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.")}bn||N.flags&dn&&bg(N)}function ny(s){switch(s.tag){case w:case z:case B:{if(s.mode&Ft)try{Ca(),xg(s,s.return)}finally{Ta(s)}else xg(s,s.return);break}case P:{var c=s.stateNode;typeof c.componentDidMount=="function"&&q0(s,s.return,c),Sg(s,s.return);break}case F:{Sg(s,s.return);break}}}function iy(s,c){var N=null;if(pn)for(var L=s;;){if(L.tag===F){if(N===null){N=L;try{var M=L.stateNode;c?fi(M):Lo(L.stateNode,L.memoizedProps)}catch(re){fr(s,s.return,re)}}}else if(L.tag===G){if(N===null)try{var Y=L.stateNode;c?$i(Y):ru(Y,L.memoizedProps)}catch(re){fr(s,s.return,re)}}else if(!((L.tag===Z||L.tag===se)&&L.memoizedState!==null&&L!==s)){if(L.child!==null){L.child.return=L,L=L.child;continue}}if(L===s)return;for(;L.sibling===null;){if(L.return===null||L.return===s)return;N===L&&(N=null),L=L.return}N===L&&(N=null),L.sibling.return=L.return,L=L.sibling}}function bg(s){var c=s.ref;if(c!==null){var N=s.stateNode,L;switch(s.tag){case F:L=ir(N);break;default:L=N}if(typeof c=="function"){var M;if(s.mode&Ft)try{Ca(),M=c(L)}finally{Ta(s)}else M=c(L);typeof M=="function"&&d("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",Ee(s))}else c.hasOwnProperty("current")||d("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",Ee(s)),c.current=L}}function ay(s){var c=s.alternate;c!==null&&(c.return=null),s.return=null}function Rg(s){var c=s.alternate;c!==null&&(s.alternate=null,Rg(c));{if(s.child=null,s.deletions=null,s.sibling=null,s.tag===F){var N=s.stateNode;N!==null&&ql(N)}s.stateNode=null,s._debugOwner=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}}function sy(s){if(Ia){var c=s.stateNode,N=c.containerInfo,L=hi(N);fs(N,L)}}function oy(s){for(var c=s.return;c!==null;){if(Tg(c))return c;c=c.return}throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function Tg(s){return s.tag===F||s.tag===k||s.tag===D}function Cg(s){var c=s;e:for(;;){for(;c.sibling===null;){if(c.return===null||Tg(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==F&&c.tag!==G&&c.tag!==J;){if(c.flags&nt||c.child===null||c.tag===D)continue e;c.child.return=c,c=c.child}if(!(c.flags&nt))return c.stateNode}}function ly(s){if(pn){var c=oy(s);switch(c.tag){case F:{var N=c.stateNode;c.flags&Sr&&(xc(N),c.flags&=~Sr);var L=Cg(s);lp(s,L,N);break}case k:case D:{var M=c.stateNode.containerInfo,Y=Cg(s);op(s,Y,M);break}default:throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function op(s,c,N){var L=s.tag,M=L===F||L===G;if(M){var Y=s.stateNode;c?Do(N,Y,c):zr(N,Y)}else if(L!==D){var re=s.child;if(re!==null){op(re,c,N);for(var ie=re.sibling;ie!==null;)op(ie,c,N),ie=ie.sibling}}}function lp(s,c,N){var L=s.tag,M=L===F||L===G;if(M){var Y=s.stateNode;c?Rf(N,Y,c):Ef(N,Y)}else if(L!==D){var re=s.child;if(re!==null){lp(re,c,N);for(var ie=re.sibling;ie!==null;)lp(ie,c,N),ie=ie.sibling}}}var Rn=null,na=!1;function uy(s,c,N){if(pn){var L=c;e:for(;L!==null;){switch(L.tag){case F:{Rn=L.stateNode,na=!1;break e}case k:{Rn=L.stateNode.containerInfo,na=!0;break e}case D:{Rn=L.stateNode.containerInfo,na=!0;break e}}L=L.return}if(Rn===null)throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");up(s,c,N),Rn=null,na=!1}else up(s,c,N);ay(N)}function Pa(s,c,N){for(var L=N.child;L!==null;)up(s,c,L),L=L.sibling}function up(s,c,N){switch(Nu(N),N.tag){case F:bn||Ml(N,c);case G:{if(pn){var L=Rn,M=na;Rn=null,Pa(s,c,N),Rn=L,na=M,Rn!==null&&(na?Tf(Rn,N.stateNode):Ci(Rn,N.stateNode))}else Pa(s,c,N);return}case J:{pn&&Rn!==null&&(na?Fo(Rn,N.stateNode):Tc(Rn,N.stateNode));return}case D:{if(pn){var Y=Rn,re=na;Rn=N.stateNode.containerInfo,na=!0,Pa(s,c,N),Rn=Y,na=re}else sy(N),Pa(s,c,N);return}case w:case z:case I:case B:{if(!bn){var ie=N.updateQueue;if(ie!==null){var le=ie.lastEffect;if(le!==null){var he=le.next,ve=he;do{var be=ve,we=be.destroy,Me=be.tag;we!==void 0&&((Me&Ea)!==si?Yd(N,c,we):(Me&sn)!==si&&(kr(N),N.mode&Ft?(Ca(),Yd(N,c,we),Ta(N)):Yd(N,c,we),ks())),ve=ve.next}while(ve!==he)}}}Pa(s,c,N);return}case P:{if(!bn){Ml(N,c);var Ue=N.stateNode;typeof Ue.componentWillUnmount=="function"&&sp(N,c,Ue)}Pa(s,c,N);return}case ae:{Pa(s,c,N);return}case Z:{if(N.mode&Ut){var Ie=bn;bn=Ie||N.memoizedState!==null,Pa(s,c,N),bn=Ie}else Pa(s,c,N);break}default:{Pa(s,c,N);return}}}function cy(s){s.memoizedState}function dy(s,c){if(mn){var N=c.memoizedState;if(N===null){var L=c.alternate;if(L!==null){var M=L.memoizedState;if(M!==null){var Y=M.dehydrated;Y!==null&&au(Y)}}}}}function Ag(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var N=s.stateNode;N===null&&(N=s.stateNode=new Y0),c.forEach(function(L){var M=x_.bind(null,s,L);if(!N.has(L)){if(N.add(L),Ln)if(Fl!==null&&jl!==null)pc(jl,Fl);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");L.then(M,M)}})}}function fy(s,c,N){Fl=N,jl=s,nr(c),Pg(c,s),nr(c),Fl=null,jl=null}function ia(s,c,N){var L=c.deletions;if(L!==null)for(var M=0;M<L.length;M++){var Y=L[M];try{uy(s,c,Y)}catch(le){fr(Y,c,le)}}var re=Ae();if(c.subtreeFlags&br)for(var ie=c.child;ie!==null;)nr(ie),Pg(ie,s),ie=ie.sibling;nr(re)}function Pg(s,c,N){var L=s.alternate,M=s.flags;switch(s.tag){case w:case z:case I:case B:{if(ia(c,s),wa(s),M&it){try{ra(Ea|an,s,s.return),Gs(Ea|an,s)}catch(bt){fr(s,s.return,bt)}if(s.mode&Ft){try{Ca(),ra(sn|an,s,s.return)}catch(bt){fr(s,s.return,bt)}Ta(s)}else try{ra(sn|an,s,s.return)}catch(bt){fr(s,s.return,bt)}}return}case P:{ia(c,s),wa(s),M&dn&&L!==null&&Ml(L,L.return);return}case F:{if(ia(c,s),wa(s),M&dn&&L!==null&&Ml(L,L.return),pn){if(s.flags&Sr){var Y=s.stateNode;try{xc(Y)}catch(bt){fr(s,s.return,bt)}}if(M&it){var re=s.stateNode;if(re!=null){var ie=s.memoizedProps,le=L!==null?L.memoizedProps:ie,he=s.type,ve=s.updateQueue;if(s.updateQueue=null,ve!==null)try{tu(re,ve,he,le,ie,s)}catch(bt){fr(s,s.return,bt)}}}}return}case G:{if(ia(c,s),wa(s),M&it&&pn){if(s.stateNode===null)throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var be=s.stateNode,we=s.memoizedProps,Me=L!==null?L.memoizedProps:we;try{eu(be,Me,we)}catch(bt){fr(s,s.return,bt)}}return}case k:{if(ia(c,s),wa(s),M&it){if(pn&&mn&&L!==null){var Ue=L.memoizedState;if(Ue.isDehydrated)try{iu(c.containerInfo)}catch(bt){fr(s,s.return,bt)}}if(Ia){var Ie=c.containerInfo,vt=c.pendingChildren;try{fs(Ie,vt)}catch(bt){fr(s,s.return,bt)}}}return}case D:{if(ia(c,s),wa(s),M&it&&Ia){var Ct=s.stateNode,St=Ct.containerInfo,or=Ct.pendingChildren;try{fs(St,or)}catch(bt){fr(s,s.return,bt)}}return}case $:{ia(c,s),wa(s);var Kt=s.child;if(Kt.flags&Ii){var Te=Kt.stateNode,Fe=Kt.memoizedState,Re=Fe!==null;if(Te.isHidden=Re,Re){var Ye=Kt.alternate!==null&&Kt.alternate.memoizedState!==null;Ye||a_()}}if(M&it){try{cy(s)}catch(bt){fr(s,s.return,bt)}Ag(s)}return}case Z:{var mt=L!==null&&L.memoizedState!==null;if(s.mode&Ut){var lt=bn;bn=lt||mt,ia(c,s),bn=lt}else ia(c,s);if(wa(s),M&Ii){var Yt=s.stateNode,Pt=s.memoizedState,er=Pt!==null,Gt=s;if(Yt.isHidden=er,er&&!mt&&(Gt.mode&Ut)!==Et){pt=Gt;for(var vr=Gt.child;vr!==null;)pt=vr,py(vr),vr=vr.sibling}pn&&iy(Gt,er)}return}case ne:{ia(c,s),wa(s),M&it&&Ag(s);return}case ae:return;default:{ia(c,s),wa(s);return}}}function wa(s){var c=s.flags;if(c&nt){try{ly(s)}catch(N){fr(s,s.return,N)}s.flags&=~nt}c&ui&&(s.flags&=~ui)}function hy(s,c,N){Fl=N,jl=c,pt=s,wg(s,c,N),Fl=null,jl=null}function wg(s,c,N){for(var L=(s.mode&Ut)!==Et;pt!==null;){var M=pt,Y=M.child;if(M.tag===Z&&L){var re=M.memoizedState!==null,ie=re||Wd;if(ie){cp(s,c,N);continue}else{var le=M.alternate,he=le!==null&&le.memoizedState!==null,ve=he||bn,be=Wd,we=bn;Wd=ie,bn=ve,bn&&!we&&(pt=M,my(M));for(var Me=Y;Me!==null;)pt=Me,wg(Me,c,N),Me=Me.sibling;pt=M,Wd=be,bn=we,cp(s,c,N);continue}}(M.subtreeFlags&lr)!==Pe&&Y!==null?(Y.return=M,pt=Y):cp(s,c,N)}}function cp(s,c,N){for(;pt!==null;){var L=pt;if((L.flags&lr)!==Pe){var M=L.alternate;nr(L);try{ry(c,M,L,N)}catch(re){fr(L,L.return,re)}ar()}if(L===s){pt=null;return}var Y=L.sibling;if(Y!==null){Y.return=L.return,pt=Y;return}pt=L.return}}function py(s){for(;pt!==null;){var c=pt,N=c.child;switch(c.tag){case w:case z:case I:case B:{if(c.mode&Ft)try{Ca(),ra(sn,c,c.return)}finally{Ta(c)}else ra(sn,c,c.return);break}case P:{Ml(c,c.return);var L=c.stateNode;typeof L.componentWillUnmount=="function"&&sp(c,c.return,L);break}case F:{Ml(c,c.return);break}case Z:{var M=c.memoizedState!==null;if(M){Ng(s);continue}break}}N!==null?(N.return=c,pt=N):Ng(s)}}function Ng(s){for(;pt!==null;){var c=pt;if(c===s){pt=null;return}var N=c.sibling;if(N!==null){N.return=c.return,pt=N;return}pt=c.return}}function my(s){for(;pt!==null;){var c=pt,N=c.child;if(c.tag===Z){var L=c.memoizedState!==null;if(L){Og(s);continue}}N!==null?(N.return=c,pt=N):Og(s)}}function Og(s){for(;pt!==null;){var c=pt;nr(c);try{ny(c)}catch(L){fr(c,c.return,L)}if(ar(),c===s){pt=null;return}var N=c.sibling;if(N!==null){N.return=c.return,pt=N;return}pt=c.return}}function gy(s,c,N,L){pt=c,vy(c,s,N,L)}function vy(s,c,N,L){for(;pt!==null;){var M=pt,Y=M.child;(M.subtreeFlags&ur)!==Pe&&Y!==null?(Y.return=M,pt=Y):yy(s,c,N,L)}}function yy(s,c,N,L){for(;pt!==null;){var M=pt;if((M.flags&Br)!==Pe){nr(M);try{_y(c,M,N,L)}catch(re){fr(M,M.return,re)}ar()}if(M===s){pt=null;return}var Y=M.sibling;if(Y!==null){Y.return=M.return,pt=Y;return}pt=M.return}}function _y(s,c,N,L){switch(c.tag){case w:case z:case B:{if(c.mode&Ft){Uh();try{Gs(Sn|an,c)}finally{$h(c)}}else Gs(Sn|an,c);break}}}function xy(s){pt=s,Sy()}function Sy(){for(;pt!==null;){var s=pt,c=s.child;if((pt.flags&Ht)!==Pe){var N=s.deletions;if(N!==null){for(var L=0;L<N.length;L++){var M=N[L];pt=M,Ry(M,s)}{var Y=s.alternate;if(Y!==null){var re=Y.child;if(re!==null){Y.child=null;do{var ie=re.sibling;re.sibling=null,re=ie}while(re!==null)}}}pt=s}}(s.subtreeFlags&ur)!==Pe&&c!==null?(c.return=s,pt=c):Ey()}}function Ey(){for(;pt!==null;){var s=pt;(s.flags&Br)!==Pe&&(nr(s),by(s),ar());var c=s.sibling;if(c!==null){c.return=s.return,pt=c;return}pt=s.return}}function by(s){switch(s.tag){case w:case z:case B:{s.mode&Ft?(Uh(),ra(Sn|an,s,s.return),$h(s)):ra(Sn|an,s,s.return);break}}}function Ry(s,c){for(;pt!==null;){var N=pt;nr(N),Cy(N,c),ar();var L=N.child;L!==null?(L.return=N,pt=L):Ty(s)}}function Ty(s){for(;pt!==null;){var c=pt,N=c.sibling,L=c.return;if(Rg(c),c===s){pt=null;return}if(N!==null){N.return=L,pt=N;return}pt=L}}function Cy(s,c){switch(s.tag){case w:case z:case B:{s.mode&Ft?(Uh(),ra(Sn,s,c),$h(s)):ra(Sn,s,c);break}}}function Ay(s){switch(s.tag){case w:case z:case B:{try{Gs(sn|an,s)}catch(N){fr(s,s.return,N)}break}case P:{var c=s.stateNode;try{c.componentDidMount()}catch(N){fr(s,s.return,N)}break}}}function Py(s){switch(s.tag){case w:case z:case B:{try{Gs(Sn|an,s)}catch(c){fr(s,s.return,c)}break}}}function wy(s){switch(s.tag){case w:case z:case B:{try{ra(sn|an,s,s.return)}catch(N){fr(s,s.return,N)}break}case P:{var c=s.stateNode;typeof c.componentWillUnmount=="function"&&sp(s,s.return,c);break}}}function Ny(s){switch(s.tag){case w:case z:case B:try{ra(Sn|an,s,s.return)}catch(c){fr(s,s.return,c)}}}var Kd=0,Xd=1,qd=2,Qd=3,Jd=4;if(typeof Symbol=="function"&&Symbol.for){var ic=Symbol.for;Kd=ic("selector.component"),Xd=ic("selector.has_pseudo_class"),qd=ic("selector.role"),Qd=ic("selector.test_id"),Jd=ic("selector.text")}function Oy(s){return{$$typeof:Kd,value:s}}function ky(s){return{$$typeof:Xd,value:s}}function Dy(s){return{$$typeof:qd,value:s}}function Ly(s){return{$$typeof:Jd,value:s}}function Fy(s){return{$$typeof:Qd,value:s}}function dp(s){var c=ko(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw new Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return c}else{var N=xf(s);if(N===null)throw new Error("Could not find React container within specified host subtree.");return N.stateNode.current}}function fp(s,c){switch(c.$$typeof){case Kd:if(s.type===c.value)return!0;break;case Xd:return jy(s,c.value);case qd:if(s.tag===F){var N=s.stateNode;if(Zl(N,c.value))return!0}break;case Jd:if(s.tag===F||s.tag===G){var L=Jt(s);if(L!==null&&L.indexOf(c.value)>=0)return!0}break;case Qd:if(s.tag===F){var M=s.memoizedProps["data-testname"];if(typeof M=="string"&&M.toLowerCase()===c.value.toLowerCase())return!0}break;default:throw new Error("Invalid selector type specified.")}return!1}function hp(s){switch(s.$$typeof){case Kd:var c=De(s.value)||"Unknown";return"<"+c+">";case Xd:return":has("+(hp(s)||"")+")";case qd:return'[role="'+s.value+'"]';case Jd:return'"'+s.value+'"';case Qd:return'[data-testname="'+s.value+'"]';default:throw new Error("Invalid selector type specified.")}}function kg(s,c){for(var N=[],L=[s,0],M=0;M<L.length;){var Y=L[M++],re=L[M++],ie=c[re];if(!(Y.tag===F&&cs(Y))){for(;ie!=null&&fp(Y,ie);)re++,ie=c[re];if(re===c.length)N.push(Y);else for(var le=Y.child;le!==null;)L.push(le,re),le=le.sibling}}return N}function jy(s,c){for(var N=[s,0],L=0;L<N.length;){var M=N[L++],Y=N[L++],re=c[Y];if(!(M.tag===F&&cs(M))){for(;re!=null&&fp(M,re);)Y++,re=c[Y];if(Y===c.length)return!0;for(var ie=M.child;ie!==null;)N.push(ie,Y),ie=ie.sibling}}return!1}function Zd(s,c){if(!Ti)throw new Error("Test selector API is not supported by this renderer.");for(var N=dp(s),L=kg(N,c),M=[],Y=Array.from(L),re=0;re<Y.length;){var ie=Y[re++];if(ie.tag===F){if(cs(ie))continue;M.push(ie.stateNode)}else for(var le=ie.child;le!==null;)Y.push(le),le=le.sibling}return M}function My(s,c){if(!Ti)throw new Error("Test selector API is not supported by this renderer.");for(var N=dp(s),L=0,M=[],Y=[N,0],re=0;re<Y.length;){var ie=Y[re++],le=Y[re++],he=c[le];if(!(ie.tag===F&&cs(ie))&&(fp(ie,he)&&(M.push(hp(he)),le++,le>L&&(L=le)),le<c.length))for(var ve=ie.child;ve!==null;)Y.push(ve,le),ve=ve.sibling}if(L<c.length){for(var be=[],we=L;we<c.length;we++)be.push(hp(c[we]));return`findAllNodes was able to match part of the selector:
200
+ `+(" "+M.join(" > ")+`
201
+
202
+ `)+`No matching component was found for:
203
+ `+(" "+be.join(" > "))}return null}function Iy(s,c){if(!Ti)throw new Error("Test selector API is not supported by this renderer.");for(var N=Zd(s,c),L=[],M=0;M<N.length;M++)L.push(Jl(N[M]));for(var Y=L.length-1;Y>0;Y--)for(var re=L[Y],ie=re.x,le=ie+re.width,he=re.y,ve=he+re.height,be=Y-1;be>=0;be--)if(Y!==be){var we=L[be],Me=we.x,Ue=Me+we.width,Ie=we.y,vt=Ie+we.height;if(ie>=Me&&he>=Ie&&le<=Ue&&ve<=vt){L.splice(Y,1);break}else if(ie===Me&&re.width===we.width&&!(vt<he)&&!(Ie>ve)){Ie>he&&(we.height+=Ie-he,we.y=he),vt<ve&&(we.height=ve-Ie),L.splice(Y,1);break}else if(he===Ie&&re.height===we.height&&!(Ue<ie)&&!(Me>le)){Me>ie&&(we.width+=Me-ie,we.x=ie),Ue<le&&(we.width=le-Me),L.splice(Y,1);break}}return L}function $y(s,c){if(!Ti)throw new Error("Test selector API is not supported by this renderer.");for(var N=dp(s),L=kg(N,c),M=Array.from(L),Y=0;Y<M.length;){var re=M[Y++];if(!cs(re)){if(re.tag===F){var ie=re.stateNode;if(_c(ie))return!0}for(var le=re.child;le!==null;)M.push(le),le=le.sibling}}return!1}var ef=[];function Uy(){Ti&&ef.forEach(function(s){return s()})}function Gy(s,c,N,L){if(!Ti)throw new Error("Test selector API is not supported by this renderer.");var M=Zd(s,c),Y=Sf(M,N,L),re=Y.disconnect,ie=Y.observe,le=Y.unobserve,he=function(){var ve=Zd(s,c);M.forEach(function(be){ve.indexOf(be)<0&&le(be)}),ve.forEach(function(be){M.indexOf(be)<0&&ie(be)})};return ef.push(he),{disconnect:function(){var ve=ef.indexOf(he);ve>=0&&ef.splice(ve,1),re()}}}var By=a.ReactCurrentActQueue;function zy(s){{var c=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0,N=typeof jest<"u";return vf&&N&&c!==!1}}function Dg(){{var s=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return!s&&By.current!==null&&d("The current testing environment is not configured to support act(...)"),s}}var Hy=Math.ceil,pp=a.ReactCurrentDispatcher,mp=a.ReactCurrentOwner,Ar=a.ReactCurrentBatchConfig,aa=a.ReactCurrentActQueue,Kr=0,gp=1,Tn=2,ji=4,as=0,ac=1,bo=2,tf=3,sc=4,Lg=5,vp=6,jt=Kr,qn=null,Pr=null,un=$e,Na=$e,yp=zn($e),cn=as,oc=null,rf=$e,lc=$e,nf=$e,uc=null,oi=null,_p=0,Fg=500,jg=1/0,Vy=500,ss=null;function Il(){jg=$r()+Vy}function Mg(){return jg}var af=!1,xp=null,$l=null,Ro=!1,Bs=null,cc=$e,Sp=[],Ep=null,Wy=50,dc=0,bp=null,Rp=!1,sf=!1,Yy=50,Ul=0,of=null,fc=cr,lf=$e,Ig=!1;function uf(){return qn}function Mn(){return(jt&(Tn|ji))!==Kr?$r():(fc!==cr||(fc=$r()),fc)}function zs(s){var c=s.mode;if((c&Ut)===Et)return Tt;if((jt&Tn)!==Kr&&un!==$e)return Va(un);var N=ue()!==te;if(N){if(Ar.transition!==null){var L=Ar.transition;L._updatedFibers||(L._updatedFibers=new Set),L._updatedFibers.add(s)}return lf===Mr&&(lf=so()),lf}var M=kn();if(M!==Mr)return M;var Y=_f();return Y}function Ky(s){var c=s.mode;return(c&Ut)===Et?Tt:Nf()}function Xr(s,c,N,L){E_(),Ig&&d("useInsertionEffect must not schedule updates."),Rp&&(sf=!0),ws(s,N,L),(jt&Tn)!==$e&&s===qn?T_(c):(Ln&&Zr(s,c,N),C_(c),s===qn&&((jt&Tn)===Kr&&(lc=Rt(lc,N)),cn===sc&&Hs(s,un)),li(s,L),N===Tt&&jt===Kr&&(c.mode&Ut)===Et&&!aa.isBatchingLegacy&&(Il(),rn()))}function Xy(s,c,N){var L=s.current;L.lanes=c,ws(s,c,N),li(s,N)}function qy(s){return(jt&Tn)!==Kr}function li(s,c){var N=s.callbackNode;Fc(s,c);var L=no(s,s===qn?un:$e);if(L===$e){N!==null&&Zg(N),s.callbackNode=null,s.callbackPriority=Mr;return}var M=va(L),Y=s.callbackPriority;if(Y===M&&!(aa.current!==null&&N!==Np)){N==null&&Y!==Tt&&d("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");return}N!=null&&Zg(N);var re;if(M===Tt)s.tag===Tr?(aa.isBatchingLegacy!==null&&(aa.didScheduleLegacyUpdate=!0),Sl(Gg.bind(null,s))):po(Gg.bind(null,s)),yc?aa.current!==null?aa.current.push(nn):Ql(function(){(jt&(Tn|ji))===Kr&&nn()}):mf(Dn,nn),re=null;else{var ie;switch(pl(L)){case _n:ie=Dn;break;case Wa:ie=Pu;break;case Ns:ie=xn;break;case Cu:ie=Hc;break;default:ie=xn;break}re=mf(ie,$g.bind(null,s))}s.callbackPriority=M,s.callbackNode=re}function $g(s,c){if(a0(),fc=cr,lf=$e,(jt&(Tn|ji))!==Kr)throw new Error("Should not already be working.");var N=s.callbackNode,L=Oa();if(L&&s.callbackNode!==N)return null;var M=no(s,s===qn?un:$e);if(M===$e)return null;var Y=!Rs(s,M)&&!$c(s,M)&&!c,re=Y?c_(s,M):ff(s,M);if(re!==as){if(re===bo){var ie=io(s);ie!==$e&&(M=ie,re=Tp(s,ie))}if(re===ac){var le=oc;throw To(s,$e),Hs(s,M),li(s,$r()),le}if(re===vp)Hs(s,M);else{var he=!Rs(s,M),ve=s.current.alternate;if(he&&!Jy(ve)){if(re=ff(s,M),re===bo){var be=io(s);be!==$e&&(M=be,re=Tp(s,be))}if(re===ac){var we=oc;throw To(s,$e),Hs(s,M),li(s,$r()),we}}s.finishedWork=ve,s.finishedLanes=M,Qy(s,re,M)}}return li(s,$r()),s.callbackNode===N?$g.bind(null,s):null}function Tp(s,c){var N=uc;if(Wn(s)){var L=To(s,c);L.flags|=Er,gs(s.containerInfo)}var M=ff(s,c);if(M!==bo){var Y=oi;oi=N,Y!==null&&Ug(Y)}return M}function Ug(s){oi===null?oi=s:oi.push.apply(oi,s)}function Qy(s,c,N){switch(c){case as:case ac:throw new Error("Root did not complete. This is a bug in React.");case bo:{Co(s,oi,ss);break}case tf:{if(Hs(s,N),bu(N)&&!ev()){var L=_p+Fg-$r();if(L>10){var M=no(s,$e);if(M!==$e)break;var Y=s.suspendedLanes;if(!Cs(Y,N)){Mn(),Jr(s,Y);break}s.timeoutHandle=Kl(Co.bind(null,s,oi,ss),L);break}}Co(s,oi,ss);break}case sc:{if(Hs(s,N),Ru(N))break;if(!ev()){var re=Dc(s,N),ie=re,le=$r()-ie,he=S_(le)-le;if(he>10){s.timeoutHandle=Kl(Co.bind(null,s,oi,ss),he);break}}Co(s,oi,ss);break}case Lg:{Co(s,oi,ss);break}default:throw new Error("Unknown root exit status.")}}function Jy(s){for(var c=s;;){if(c.flags&Da){var N=c.updateQueue;if(N!==null){var L=N.stores;if(L!==null)for(var M=0;M<L.length;M++){var Y=L[M],re=Y.getSnapshot,ie=Y.value;try{if(!Dr(re(),ie))return!1}catch{return!1}}}}var le=c.child;if(c.subtreeFlags&Da&&le!==null){le.return=c,c=le;continue}if(c===s)return!0;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}return!0}function Hs(s,c){c=oo(c,nf),c=oo(c,lc),lo(s,c)}function Gg(s){if(s0(),(jt&(Tn|ji))!==Kr)throw new Error("Should not already be working.");Oa();var c=no(s,$e);if(!Cr(c,Tt))return li(s,$r()),null;var N=ff(s,c);if(s.tag!==Tr&&N===bo){var L=io(s);L!==$e&&(c=L,N=Tp(s,L))}if(N===ac){var M=oc;throw To(s,$e),Hs(s,c),li(s,$r()),M}if(N===vp)throw new Error("Root did not complete. This is a bug in React.");var Y=s.current.alternate;return s.finishedWork=Y,s.finishedLanes=c,Co(s,oi,ss),li(s,$r()),null}function Zy(s,c){c!==$e&&(Tu(s,Rt(c,Tt)),li(s,$r()),(jt&(Tn|ji))===Kr&&(Il(),nn()))}function e_(s){var c=kn(),N=Ar.transition;try{return Ar.transition=null,wr(Ns),s()}finally{wr(c),Ar.transition=N}}function t_(s,c){var N=jt;jt|=gp;try{return s(c)}finally{jt=N,jt===Kr&&!aa.isBatchingLegacy&&(Il(),rn())}}function r_(s,c,N,L,M){var Y=kn(),re=Ar.transition;try{return Ar.transition=null,wr(_n),s(c,N,L,M)}finally{wr(Y),Ar.transition=re,jt===Kr&&Il()}}function cf(s){Bs!==null&&Bs.tag===Tr&&(jt&(Tn|ji))===Kr&&Oa();var c=jt;jt|=gp;var N=Ar.transition,L=kn();try{return Ar.transition=null,wr(_n),s?s():void 0}finally{wr(L),Ar.transition=N,jt=c,(jt&(Tn|ji))===Kr&&nn()}}function n_(){return(jt&(Tn|ji))!==Kr}function i_(s){var c=jt;jt|=gp;var N=Ar.transition,L=kn();try{Ar.transition=null,wr(_n),s()}finally{wr(L),Ar.transition=N,jt=c,jt===Kr&&(Il(),nn())}}function df(s,c){Fr(yp,Na,s),Na=Rt(Na,c)}function Cp(s){Na=yp.current,mr(yp,s)}function To(s,c){s.finishedWork=null,s.finishedLanes=$e;var N=s.timeoutHandle;if(N!==Xl&&(s.timeoutHandle=Xl,di(N)),Pr!==null)for(var L=Pr.return;L!==null;){var M=L.alternate;pg(M,L),L=L.return}qn=s;var Y=Ao(s.current,null);return Pr=Y,un=Na=c,cn=as,oc=null,rf=$e,lc=$e,nf=$e,uc=null,oi=null,Lv(),ke.discardPendingWarnings(),Y}function Bg(s,c){do{var N=Pr;try{if(od(),vm(),ar(),mp.current=null,N===null||N.return===null){cn=ac,oc=c,Pr=null;return}if(A&&N.mode&Ft&&$d(N,!0),S)if(pr(),c!==null&&typeof c=="object"&&typeof c.then=="function"){var L=c;vl(N,L,un)}else Xa(N,c,un);d0(s,N.return,N,c,un),Wg(N)}catch(M){c=M,Pr===N&&N!==null?(N=N.return,Pr=N):N=Pr;continue}return}while(!0)}function zg(){var s=pp.current;return pp.current=Ld,s===null?Ld:s}function Hg(s){pp.current=s}function a_(){_p=$r()}function hc(s){rf=Rt(s,rf)}function s_(){cn===as&&(cn=tf)}function Ap(){(cn===as||cn===tf||cn===bo)&&(cn=sc),qn!==null&&(ao(rf)||ao(lc))&&Hs(qn,un)}function o_(s){cn!==sc&&(cn=bo),uc===null?uc=[s]:uc.push(s)}function l_(){return cn===as}function ff(s,c){var N=jt;jt|=Tn;var L=zg();if(qn!==s||un!==c){if(Ln){var M=s.memoizedUpdaters;M.size>0&&(pc(s,un),M.clear()),Uc(s,c)}ss=ct(),To(s,c)}yl(c);do try{u_();break}catch(Y){Bg(s,Y)}while(!0);if(od(),jt=N,Hg(L),Pr!==null)throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return qa(),qn=null,un=$e,cn}function u_(){for(;Pr!==null;)Vg(Pr)}function c_(s,c){var N=jt;jt|=Tn;var L=zg();if(qn!==s||un!==c){if(Ln){var M=s.memoizedUpdaters;M.size>0&&(pc(s,un),M.clear()),Uc(s,c)}ss=ct(),Il(),To(s,c)}yl(c);do try{d_();break}catch(Y){Bg(s,Y)}while(!0);return od(),Hg(L),jt=N,Pr!==null?(Xi(),as):(qa(),qn=null,un=$e,cn)}function d_(){for(;Pr!==null&&!Ni();)Vg(Pr)}function Vg(s){var c=s.alternate;nr(s);var N;(s.mode&Ft)!==Et?(Ih(s),N=Pp(c,s,Na),$d(s,!0)):N=Pp(c,s,Na),ar(),s.memoizedProps=s.pendingProps,N===null?Wg(s):Pr=N,mp.current=null}function Wg(s){var c=s;do{var N=c.alternate,L=c.return;if((c.flags&La)===Pe){nr(c);var M=void 0;if((c.mode&Ft)===Et?M=hg(N,c,Na):(Ih(c),M=hg(N,c,Na),$d(c,!1)),ar(),M!==null){Pr=M;return}}else{var Y=z0(N,c);if(Y!==null){Y.flags&=Ws,Pr=Y;return}if((c.mode&Ft)!==Et){$d(c,!1);for(var re=c.actualDuration,ie=c.child;ie!==null;)re+=ie.actualDuration,ie=ie.sibling;c.actualDuration=re}if(L!==null)L.flags|=La,L.subtreeFlags=Pe,L.deletions=null;else{cn=vp,Pr=null;return}}var le=c.sibling;if(le!==null){Pr=le;return}c=L,Pr=c}while(c!==null);cn===as&&(cn=Lg)}function Co(s,c,N){var L=kn(),M=Ar.transition;try{Ar.transition=null,wr(_n),f_(s,c,N,L)}finally{Ar.transition=M,wr(L)}return null}function f_(s,c,N,L){do Oa();while(Bs!==null);if(b_(),(jt&(Tn|ji))!==Kr)throw new Error("Should not already be working.");var M=s.finishedWork,Y=s.finishedLanes;if(kf(Y),M===null)return co(),null;if(Y===$e&&d("root.finishedLanes should not be empty during a commit. This is a bug in React."),s.finishedWork=null,s.finishedLanes=$e,M===s.current)throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");s.callbackNode=null,s.callbackPriority=Mr;var re=Rt(M.lanes,M.childLanes);Of(s,re),s===qn&&(qn=null,Pr=null,un=$e),((M.subtreeFlags&ur)!==Pe||(M.flags&ur)!==Pe)&&(Ro||(Ro=!0,Ep=N,mf(xn,function(){return Oa(),null})));var ie=(M.subtreeFlags&(Dt|br|lr|ur))!==Pe,le=(M.flags&(Dt|br|lr|ur))!==Pe;if(ie||le){var he=Ar.transition;Ar.transition=null;var ve=kn();wr(_n);var be=jt;jt|=ji,mp.current=null,Q0(s,M),Bm(),fy(s,M,Y),Ma(s.containerInfo),s.current=M,ku(Y),hy(M,s,Y),fo(),Au(),jt=be,wr(ve),Ar.transition=he}else s.current=M,Bm();var we=Ro;if(Ro?(Ro=!1,Bs=s,cc=Y):(Ul=0,of=null),re=s.pendingLanes,re===$e&&($l=null),we||qg(s.current,!1),uo(M.stateNode,L),Ln&&s.memoizedUpdaters.clear(),Uy(),li(s,$r()),c!==null)for(var Me=s.onRecoverableError,Ue=0;Ue<c.length;Ue++){var Ie=c[Ue],vt=Ie.stack,Ct=Ie.digest;Me(Ie.value,{componentStack:vt,digest:Ct})}if(af){af=!1;var St=xp;throw xp=null,St}return Cr(cc,Tt)&&s.tag!==Tr&&Oa(),re=s.pendingLanes,Cr(re,Tt)?(i0(),s===bp?dc++:(dc=0,bp=s)):dc=0,nn(),co(),null}function Oa(){if(Bs!==null){var s=pl(cc),c=zc(Ns,s),N=Ar.transition,L=kn();try{return Ar.transition=null,wr(c),p_()}finally{wr(L),Ar.transition=N}}return!1}function h_(s){Sp.push(s),Ro||(Ro=!0,mf(xn,function(){return Oa(),null}))}function p_(){if(Bs===null)return!1;var s=Ep;Ep=null;var c=Bs,N=cc;if(Bs=null,cc=$e,(jt&(Tn|ji))!==Kr)throw new Error("Cannot flush passive effects while already rendering.");Rp=!0,sf=!1,Fn(N);var L=jt;jt|=ji,xy(c.current),gy(c,c.current,N,s);{var M=Sp;Sp=[];for(var Y=0;Y<M.length;Y++){var re=M[Y];ty(c,re)}}Du(),qg(c.current,!0),jt=L,nn(),sf?c===of?Ul++:(Ul=0,of=c):Ul=0,Rp=!1,sf=!1,wu(c);{var ie=c.current.stateNode;ie.effectDuration=0,ie.passiveEffectDuration=0}return!0}function Yg(s){return $l!==null&&$l.has(s)}function m_(s){$l===null?$l=new Set([s]):$l.add(s)}function g_(s){af||(af=!0,xp=s)}var v_=g_;function Kg(s,c,N){var L=So(N,c),M=Hm(s,L,Tt),Y=js(s,M,Tt),re=Mn();Y!==null&&(ws(Y,Tt,re),li(Y,re))}function fr(s,c,N){if(K0(N),mc(!1),s.tag===k){Kg(s,s,N);return}var L=null;for(L=c;L!==null;){if(L.tag===k){Kg(L,s,N);return}else if(L.tag===P){var M=L.type,Y=L.stateNode;if(typeof M.getDerivedStateFromError=="function"||typeof Y.componentDidCatch=="function"&&!Yg(Y)){var re=So(N,s),ie=Hh(L,re,Tt),le=js(L,ie,Tt),he=Mn();le!==null&&(ws(le,Tt,he),li(le,he));return}}L=L.return}d(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
204
+
205
+ Error message:
206
+
207
+ %s`,N)}function y_(s,c,N){var L=s.pingCache;L!==null&&L.delete(c);var M=Mn();Jr(s,N),A_(s),qn===s&&Cs(un,N)&&(cn===sc||cn===tf&&bu(un)&&$r()-_p<Fg?To(s,$e):nf=Rt(nf,N)),li(s,M)}function Xg(s,c){c===Mr&&(c=Ky(s));var N=Mn(),L=Kn(s,c);L!==null&&(ws(L,c,N),li(L,N))}function __(s){var c=s.memoizedState,N=Mr;c!==null&&(N=c.retryLane),Xg(s,N)}function x_(s,c){var N=Mr,L;switch(s.tag){case $:L=s.stateNode;var M=s.memoizedState;M!==null&&(N=M.retryLane);break;case ne:L=s.stateNode;break;default:throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}L!==null&&L.delete(c),Xg(s,N)}function S_(s){return s<120?120:s<480?480:s<1080?1080:s<1920?1920:s<3e3?3e3:s<4320?4320:Hy(s/1960)*1960}function E_(){if(dc>Wy)throw dc=0,bp=null,new 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.");Ul>Yy&&(Ul=0,of=null,d("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 b_(){ke.flushLegacyContextWarning(),ke.flushPendingUnsafeLifecycleWarnings()}function qg(s,c){nr(s),hf(s,It,wy),c&&hf(s,Lt,Ny),hf(s,It,Ay),c&&hf(s,Lt,Py),ar()}function hf(s,c,N){for(var L=s,M=null;L!==null;){var Y=L.subtreeFlags&c;L!==M&&L.child!==null&&Y!==Pe?L=L.child:((L.flags&c)!==Pe&&N(L),L.sibling!==null?L=L.sibling:L=M=L.return)}}var pf=null;function Qg(s){{if((jt&Tn)!==Kr||!(s.mode&Ut))return;var c=s.tag;if(c!==O&&c!==k&&c!==P&&c!==w&&c!==z&&c!==I&&c!==B)return;var N=Ee(s)||"ReactComponent";if(pf!==null){if(pf.has(N))return;pf.add(N)}else pf=new Set([N]);var L=_t;try{nr(s),d("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{L?nr(s):ar()}}}var Pp;{var R_=null;Pp=function(s,c,N){var L=av(R_,c);try{return ug(s,c,N)}catch(Y){if(Qc()||Y!==null&&typeof Y=="object"&&typeof Y.then=="function")throw Y;if(od(),vm(),pg(s,c),av(c,L),c.mode&Ft&&Ih(c),vg(null,ug,null,s,c,N),W0()){var M=yg();typeof M=="object"&&M!==null&&M._suppressLogging&&typeof Y=="object"&&Y!==null&&!Y._suppressLogging&&(Y._suppressLogging=!0)}throw Y}}}var Jg=!1,wp;wp=new Set;function T_(s){if(tt&&!t0())switch(s.tag){case w:case z:case B:{var c=Pr&&Ee(Pr)||"Unknown",N=c;if(!wp.has(N)){wp.add(N);var L=Ee(s)||"Unknown";d("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",L,c,c)}break}case P:{Jg||(d("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),Jg=!0);break}}}function pc(s,c){if(Ln){var N=s.memoizedUpdaters;N.forEach(function(L){Zr(s,L,c)})}}var Np={};function mf(s,c){{var N=aa.current;return N!==null?(N.push(c),Np):Hr(s,c)}}function Zg(s){if(s!==Np)return xi(s)}function ev(){return aa.current!==null}function C_(s){{if(s.mode&Ut){if(!Dg())return}else if(!zy()||jt!==Kr||s.tag!==w&&s.tag!==z&&s.tag!==B)return;if(aa.current===null){var c=_t;try{nr(s),d(`An update to %s inside a test was not wrapped in act(...).
208
+
209
+ When testing, code that causes React state updates should be wrapped into act(...):
210
+
211
+ act(() => {
212
+ /* fire events that update state */
213
+ });
214
+ /* assert on the output */
215
+
216
+ 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`,Ee(s))}finally{c?nr(s):ar()}}}}function A_(s){s.tag!==Tr&&Dg()&&aa.current===null&&d(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
217
+
218
+ When testing, code that resolves suspended data should be wrapped into act(...):
219
+
220
+ act(() => {
221
+ /* finish loading suspended data */
222
+ });
223
+ /* assert on the output */
224
+
225
+ 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`)}function mc(s){Ig=s}var Mi=null,Gl=null,P_=function(s){Mi=s};function Bl(s){{if(Mi===null)return s;var c=Mi(s);return c===void 0?s:c.current}}function Op(s){return Bl(s)}function kp(s){{if(Mi===null)return s;var c=Mi(s);if(c===void 0){if(s!=null&&typeof s.render=="function"){var N=Bl(s.render);if(s.render!==N){var L={$$typeof:Qe,render:N};return s.displayName!==void 0&&(L.displayName=s.displayName),L}}return s}return c.current}}function tv(s,c){{if(Mi===null)return!1;var N=s.elementType,L=c.type,M=!1,Y=typeof L=="object"&&L!==null?L.$$typeof:null;switch(s.tag){case P:{typeof L=="function"&&(M=!0);break}case w:{(typeof L=="function"||Y===ft)&&(M=!0);break}case z:{(Y===Qe||Y===ft)&&(M=!0);break}case I:case B:{(Y===ut||Y===ft)&&(M=!0);break}default:return!1}if(M){var re=Mi(N);if(re!==void 0&&re===Mi(L))return!0}return!1}}function rv(s){{if(Mi===null||typeof WeakSet!="function")return;Gl===null&&(Gl=new WeakSet),Gl.add(s)}}var w_=function(s,c){{if(Mi===null)return;var N=c.staleFamilies,L=c.updatedFamilies;Oa(),cf(function(){Dp(s.current,L,N)})}},N_=function(s,c){{if(s.context!==wn)return;Oa(),cf(function(){lv(c,s,null,null)})}};function Dp(s,c,N){{var L=s.alternate,M=s.child,Y=s.sibling,re=s.tag,ie=s.type,le=null;switch(re){case w:case B:case P:le=ie;break;case z:le=ie.render;break}if(Mi===null)throw new Error("Expected resolveFamily to be set during hot reload.");var he=!1,ve=!1;if(le!==null){var be=Mi(le);be!==void 0&&(N.has(be)?ve=!0:c.has(be)&&(re===P?ve=!0:he=!0))}if(Gl!==null&&(Gl.has(s)||L!==null&&Gl.has(L))&&(ve=!0),ve&&(s._debugNeedsRemount=!0),ve||he){var we=Kn(s,Tt);we!==null&&Xr(we,s,Tt,cr)}M!==null&&!ve&&Dp(M,c,N),Y!==null&&Dp(Y,c,N)}}var O_=function(s,c){{var N=new Set,L=new Set(c.map(function(M){return M.current}));return Lp(s.current,L,N),N}};function Lp(s,c,N){{var L=s.child,M=s.sibling,Y=s.tag,re=s.type,ie=null;switch(Y){case w:case B:case P:ie=re;break;case z:ie=re.render;break}var le=!1;ie!==null&&c.has(ie)&&(le=!0),le?k_(s,N):L!==null&&Lp(L,c,N),M!==null&&Lp(M,c,N)}}function k_(s,c){{var N=D_(s,c);if(N)return;for(var L=s;;){switch(L.tag){case F:c.add(L.stateNode);return;case D:c.add(L.stateNode.containerInfo);return;case k:c.add(L.stateNode.containerInfo);return}if(L.return===null)throw new Error("Expected to reach root first.");L=L.return}}}function D_(s,c){for(var N=s,L=!1;;){if(N.tag===F)L=!0,c.add(N.stateNode);else if(N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)return L;for(;N.sibling===null;){if(N.return===null||N.return===s)return L;N=N.return}N.sibling.return=N.return,N=N.sibling}return!1}var Fp;{Fp=!1;try{var nv=Object.preventExtensions({})}catch{Fp=!0}}function L_(s,c,N,L){this.tag=s,this.key=N,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=c,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=L,this.flags=Pe,this.subtreeFlags=Pe,this.deletions=null,this.lanes=$e,this.childLanes=$e,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._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!Fp&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var bi=function(s,c,N,L){return new L_(s,c,N,L)};function jp(s){var c=s.prototype;return!!(c&&c.isReactComponent)}function F_(s){return typeof s=="function"&&!jp(s)&&s.defaultProps===void 0}function j_(s){if(typeof s=="function")return jp(s)?P:w;if(s!=null){var c=s.$$typeof;if(c===Qe)return z;if(c===ut)return I}return O}function Ao(s,c){var N=s.alternate;N===null?(N=bi(s.tag,c,s.key,s.mode),N.elementType=s.elementType,N.type=s.type,N.stateNode=s.stateNode,N._debugSource=s._debugSource,N._debugOwner=s._debugOwner,N._debugHookTypes=s._debugHookTypes,N.alternate=s,s.alternate=N):(N.pendingProps=c,N.type=s.type,N.flags=Pe,N.subtreeFlags=Pe,N.deletions=null,N.actualDuration=0,N.actualStartTime=-1),N.flags=s.flags&_r,N.childLanes=s.childLanes,N.lanes=s.lanes,N.child=s.child,N.memoizedProps=s.memoizedProps,N.memoizedState=s.memoizedState,N.updateQueue=s.updateQueue;var L=s.dependencies;switch(N.dependencies=L===null?null:{lanes:L.lanes,firstContext:L.firstContext},N.sibling=s.sibling,N.index=s.index,N.ref=s.ref,N.selfBaseDuration=s.selfBaseDuration,N.treeBaseDuration=s.treeBaseDuration,N._debugNeedsRemount=s._debugNeedsRemount,N.tag){case O:case w:case B:N.type=Bl(s.type);break;case P:N.type=Op(s.type);break;case z:N.type=kp(s.type);break}return N}function M_(s,c){s.flags&=_r|nt;var N=s.alternate;if(N===null)s.childLanes=$e,s.lanes=c,s.child=null,s.subtreeFlags=Pe,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null,s.selfBaseDuration=0,s.treeBaseDuration=0;else{s.childLanes=N.childLanes,s.lanes=N.lanes,s.child=N.child,s.subtreeFlags=Pe,s.deletions=null,s.memoizedProps=N.memoizedProps,s.memoizedState=N.memoizedState,s.updateQueue=N.updateQueue,s.type=N.type;var L=N.dependencies;s.dependencies=L===null?null:{lanes:L.lanes,firstContext:L.firstContext},s.selfBaseDuration=N.selfBaseDuration,s.treeBaseDuration=N.treeBaseDuration}return s}function I_(s,c,N){var L;return s===Ko?(L=Ut,c===!0&&(L|=tr,L|=Nn)):L=Et,Ln&&(L|=Ft),bi(k,null,null,L)}function Mp(s,c,N,L,M,Y){var re=O,ie=s;if(typeof s=="function")jp(s)?(re=P,ie=Op(ie)):ie=Bl(ie);else if(typeof s=="string")re=F;else e:switch(s){case Se:return Vs(N.children,M,Y,c);case Le:re=W,M|=tr,(M&Ut)!==Et&&(M|=Nn);break;case Ne:return $_(N,M,Y,c);case dt:return U_(N,M,Y,c);case yt:return G_(N,M,Y,c);case Ge:return iv(N,M,Y,c);case Ze:case Xt:case rt:case qt:case kt:default:{if(typeof s=="object"&&s!==null)switch(s.$$typeof){case He:re=q;break e;case Ke:re=ee;break e;case Qe:re=z,ie=kp(ie);break e;case ut:re=I;break e;case ft:re=X,ie=null;break e}var le="";{(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(le+=" 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 he=L?Ee(L):null;he&&(le+=`
226
+
227
+ Check the render method of \``+he+"`.")}throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(s==null?s:typeof s)+"."+le))}}var ve=bi(re,N,c,M);return ve.elementType=s,ve.type=ie,ve.lanes=Y,ve._debugOwner=L,ve}function Ip(s,c,N){var L=null;L=s._owner;var M=s.type,Y=s.key,re=s.props,ie=Mp(M,Y,re,L,c,N);return ie._debugSource=s._source,ie._debugOwner=s._owner,ie}function Vs(s,c,N,L){var M=bi(V,s,L,c);return M.lanes=N,M}function $_(s,c,N,L){typeof s.id!="string"&&d('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof s.id);var M=bi(U,s,L,c|Ft);return M.elementType=Ne,M.lanes=N,M.stateNode={effectDuration:0,passiveEffectDuration:0},M}function U_(s,c,N,L){var M=bi($,s,L,c);return M.elementType=dt,M.lanes=N,M}function G_(s,c,N,L){var M=bi(ne,s,L,c);return M.elementType=yt,M.lanes=N,M}function iv(s,c,N,L){var M=bi(Z,s,L,c);M.elementType=Ge,M.lanes=N;var Y={isHidden:!1};return M.stateNode=Y,M}function $p(s,c,N){var L=bi(G,s,null,c);return L.lanes=N,L}function B_(){var s=bi(F,null,null,Et);return s.elementType="DELETED",s}function z_(s){var c=bi(J,null,null,Et);return c.stateNode=s,c}function Up(s,c,N){var L=s.children!==null?s.children:[],M=bi(D,L,s.key,c);return M.lanes=N,M.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},M}function av(s,c){return s===null&&(s=bi(O,null,null,Et)),s.tag=c.tag,s.key=c.key,s.elementType=c.elementType,s.type=c.type,s.stateNode=c.stateNode,s.return=c.return,s.child=c.child,s.sibling=c.sibling,s.index=c.index,s.ref=c.ref,s.pendingProps=c.pendingProps,s.memoizedProps=c.memoizedProps,s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.dependencies=c.dependencies,s.mode=c.mode,s.flags=c.flags,s.subtreeFlags=c.subtreeFlags,s.deletions=c.deletions,s.lanes=c.lanes,s.childLanes=c.childLanes,s.alternate=c.alternate,s.actualDuration=c.actualDuration,s.actualStartTime=c.actualStartTime,s.selfBaseDuration=c.selfBaseDuration,s.treeBaseDuration=c.treeBaseDuration,s._debugSource=c._debugSource,s._debugOwner=c._debugOwner,s._debugNeedsRemount=c._debugNeedsRemount,s._debugHookTypes=c._debugHookTypes,s}function H_(s,c,N,L,M){this.tag=c,this.containerInfo=s,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=Xl,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=Mr,this.eventTimes=Ps($e),this.expirationTimes=Ps(cr),this.pendingLanes=$e,this.suspendedLanes=$e,this.pingedLanes=$e,this.expiredLanes=$e,this.mutableReadLanes=$e,this.finishedLanes=$e,this.entangledLanes=$e,this.entanglements=Ps($e),this.identifierPrefix=L,this.onRecoverableError=M,mn&&(this.mutableSourceEagerHydrationData=null),this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;for(var Y=this.pendingUpdatersLaneMap=[],re=0;re<qo;re++)Y.push(new Set)}switch(c){case Ko:this._debugRootType=N?"hydrateRoot()":"createRoot()";break;case Tr:this._debugRootType=N?"hydrate()":"render()";break}}function sv(s,c,N,L,M,Y,re,ie,le,he){var ve=new H_(s,c,N,ie,le),be=I_(c,Y);ve.current=be,be.stateNode=ve;{var we={element:L,isDehydrated:N,cache:null,transitions:null,pendingSuspenseBoundaries:null};be.memoizedState=we}return Vf(be),ve}var V_="18.2.0";function W_(s,c,N){var L=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Nv(L),{$$typeof:ce,key:L==null?null:""+L,children:s,containerInfo:c,implementation:N}}var Gp,Bp;Gp=!1,Bp={};function ov(s){if(!s)return wn;var c=E(s),N=wf(c);if(c.tag===P){var L=c.type;if(vn(L))return Zs(c,L,N)}return N}function Y_(s){var c=E(s);if(c===void 0){if(typeof s.render=="function")throw new Error("Unable to find node on an unmounted component.");var N=Object.keys(s).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+N)}var L=Ys(c);return L===null?null:L.stateNode}function K_(s,c){{var N=E(s);if(N===void 0){if(typeof s.render=="function")throw new Error("Unable to find node on an unmounted component.");var L=Object.keys(s).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+L)}var M=Ys(N);if(M===null)return null;if(M.mode&tr){var Y=Ee(N)||"Component";if(!Bp[Y]){Bp[Y]=!0;var re=_t;try{nr(M),N.mode&tr?d("%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",c,c,Y):d("%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",c,c,Y)}finally{re?nr(re):ar()}}}return M.stateNode}}function X_(s,c,N,L,M,Y,re,ie){var le=!1,he=null;return sv(s,c,le,he,N,L,M,Y,re)}function q_(s,c,N,L,M,Y,re,ie,le,he){var ve=!0,be=sv(N,L,ve,s,M,Y,re,ie,le);be.context=ov(null);var we=be.current,Me=Mn(),Ue=zs(we),Ie=ns(Me,Ue);return Ie.callback=c??null,js(we,Ie,Ue),Xy(be,Ue,Me),be}function lv(s,c,N,L){gl(c,s);var M=c.current,Y=Mn(),re=zs(M);_l(re);var ie=ov(N);c.context===null?c.context=ie:c.pendingContext=ie,tt&&_t!==null&&!Gp&&(Gp=!0,d(`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.
228
+
229
+ Check the render method of %s.`,Ee(_t)||"Unknown"));var le=ns(Y,re);le.payload={element:s},L=L===void 0?null:L,L!==null&&(typeof L!="function"&&d("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",L),le.callback=L);var he=js(M,le,re);return he!==null&&(Xr(he,M,re,Y),fd(he,M,re)),re}function Q_(s){var c=s.current;if(!c.child)return null;switch(c.child.tag){case F:return ir(c.child.stateNode);default:return c.child.stateNode}}function J_(s){switch(s.tag){case k:{var c=s.stateNode;if(Wn(c)){var N=jc(c);Zy(c,N)}break}case $:{cf(function(){var M=Kn(s,Tt);if(M!==null){var Y=Mn();Xr(M,s,Tt,Y)}});var L=Tt;gf(s,L);break}}}function uv(s,c){var N=s.memoizedState;N!==null&&N.dehydrated!==null&&(N.retryLane=dl(N.retryLane,c))}function gf(s,c){uv(s,c);var N=s.alternate;N&&uv(N,c)}function Z_(s){if(s.tag===$){var c=Tt,N=Kn(s,c);if(N!==null){var L=Mn();Xr(N,s,c,L)}gf(s,c)}}function e1(s){if(s.tag===$){var c=Ha,N=Kn(s,c);if(N!==null){var L=Mn();Xr(N,s,c,L)}gf(s,c)}}function t1(s){if(s.tag===$){var c=zs(s),N=Kn(s,c);if(N!==null){var L=Mn();Xr(N,s,c,L)}gf(s,c)}}function r1(s){var c=Wl(s);return c===null?null:c.stateNode}var cv=function(s){return null};function dv(s){return cv(s)}var fv=function(s){return!1};function hv(s){return fv(s)}var pv=null,mv=null,gv=null,vv=null,yv=null,_v=null,xv=null,Sv=null,Ev=null;{var bv=function(s,c,N){var L=c[N],M=$t(s)?s.slice():y({},s);return N+1===c.length?($t(M)?M.splice(L,1):delete M[L],M):(M[L]=bv(s[L],c,N+1),M)},Rv=function(s,c){return bv(s,c,0)},Tv=function(s,c,N,L){var M=c[L],Y=$t(s)?s.slice():y({},s);if(L+1===c.length){var re=N[L];Y[re]=Y[M],$t(Y)?Y.splice(M,1):delete Y[M]}else Y[M]=Tv(s[M],c,N,L+1);return Y},Cv=function(s,c,N){if(c.length!==N.length){f("copyWithRename() expects paths of the same length");return}else for(var L=0;L<N.length-1;L++)if(c[L]!==N[L]){f("copyWithRename() expects paths to be the same except for the deepest key");return}return Tv(s,c,N,0)},Av=function(s,c,N,L){if(N>=c.length)return L;var M=c[N],Y=$t(s)?s.slice():y({},s);return Y[M]=Av(s[M],c,N+1,L),Y},Pv=function(s,c,N){return Av(s,c,0,N)},zp=function(s,c){for(var N=s.memoizedState;N!==null&&c>0;)N=N.next,c--;return N};pv=function(s,c,N,L){var M=zp(s,c);if(M!==null){var Y=Pv(M.memoizedState,N,L);M.memoizedState=Y,M.baseState=Y,s.memoizedProps=y({},s.memoizedProps);var re=Kn(s,Tt);re!==null&&Xr(re,s,Tt,cr)}},mv=function(s,c,N){var L=zp(s,c);if(L!==null){var M=Rv(L.memoizedState,N);L.memoizedState=M,L.baseState=M,s.memoizedProps=y({},s.memoizedProps);var Y=Kn(s,Tt);Y!==null&&Xr(Y,s,Tt,cr)}},gv=function(s,c,N,L){var M=zp(s,c);if(M!==null){var Y=Cv(M.memoizedState,N,L);M.memoizedState=Y,M.baseState=Y,s.memoizedProps=y({},s.memoizedProps);var re=Kn(s,Tt);re!==null&&Xr(re,s,Tt,cr)}},vv=function(s,c,N){s.pendingProps=Pv(s.memoizedProps,c,N),s.alternate&&(s.alternate.pendingProps=s.pendingProps);var L=Kn(s,Tt);L!==null&&Xr(L,s,Tt,cr)},yv=function(s,c){s.pendingProps=Rv(s.memoizedProps,c),s.alternate&&(s.alternate.pendingProps=s.pendingProps);var N=Kn(s,Tt);N!==null&&Xr(N,s,Tt,cr)},_v=function(s,c,N){s.pendingProps=Cv(s.memoizedProps,c,N),s.alternate&&(s.alternate.pendingProps=s.pendingProps);var L=Kn(s,Tt);L!==null&&Xr(L,s,Tt,cr)},xv=function(s){var c=Kn(s,Tt);c!==null&&Xr(c,s,Tt,cr)},Sv=function(s){cv=s},Ev=function(s){fv=s}}function n1(s){var c=Ys(s);return c===null?null:c.stateNode}function i1(s){return null}function a1(){return _t}function s1(s){var c=s.findFiberByHostInstance,N=a.ReactCurrentDispatcher;return ml({bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:pv,overrideHookStateDeletePath:mv,overrideHookStateRenamePath:gv,overrideProps:vv,overridePropsDeletePath:yv,overridePropsRenamePath:_v,setErrorHandler:Sv,setSuspenseHandler:Ev,scheduleUpdate:xv,currentDispatcherRef:N,findHostInstanceByFiber:n1,findFiberByHostInstance:c||i1,findHostInstancesForRefresh:O_,scheduleRefresh:w_,scheduleRoot:N_,setRefreshHandler:P_,getCurrentFiber:a1,reconcilerVersion:V_})}return r.attemptContinuousHydration=e1,r.attemptDiscreteHydration=Z_,r.attemptHydrationAtCurrentPriority=t1,r.attemptSynchronousHydration=J_,r.batchedUpdates=t_,r.createComponentSelector=Oy,r.createContainer=X_,r.createHasPseudoClassSelector=ky,r.createHydrationContainer=q_,r.createPortal=W_,r.createRoleSelector=Dy,r.createTestNameSelector=Fy,r.createTextSelector=Ly,r.deferredUpdates=e_,r.discreteUpdates=r_,r.findAllNodes=Zd,r.findBoundingRects=Iy,r.findHostInstance=Y_,r.findHostInstanceWithNoPortals=r1,r.findHostInstanceWithWarning=K_,r.flushControlled=i_,r.flushPassiveEffects=Oa,r.flushSync=cf,r.focusWithin=$y,r.getCurrentUpdatePriority=kn,r.getFindAllNodesFailureDescription=My,r.getPublicRootInstance=Q_,r.injectIntoDevTools=s1,r.isAlreadyRendering=n_,r.observeVisibleRects=Gy,r.registerMutableSourceForHydration=Xv,r.runWithPriority=Gc,r.shouldError=dv,r.shouldSuspend=hv,r.updateContainer=lv,r})),reactReconciler_development.exports}process.env.NODE_ENV==="production"?reactReconciler.exports=requireReactReconciler_production_min():reactReconciler.exports=requireReactReconciler_development();var reactReconcilerExports=reactReconciler.exports;const ReactFiberReconciler=getDefaultExportFromCjs(reactReconcilerExports);var constants={exports:{}},reactReconcilerConstants_production_min={};/**
230
+ * @license React
231
+ * react-reconciler-constants.production.min.js
232
+ *
233
+ * Copyright (c) Facebook, Inc. and its affiliates.
234
+ *
235
+ * This source code is licensed under the MIT license found in the
236
+ * LICENSE file in the root directory of this source tree.
237
+ */var hasRequiredReactReconcilerConstants_production_min;function requireReactReconcilerConstants_production_min(){return hasRequiredReactReconcilerConstants_production_min||(hasRequiredReactReconcilerConstants_production_min=1,reactReconcilerConstants_production_min.ConcurrentRoot=1,reactReconcilerConstants_production_min.ContinuousEventPriority=4,reactReconcilerConstants_production_min.DefaultEventPriority=16,reactReconcilerConstants_production_min.DiscreteEventPriority=1,reactReconcilerConstants_production_min.IdleEventPriority=536870912,reactReconcilerConstants_production_min.LegacyRoot=0),reactReconcilerConstants_production_min}var reactReconcilerConstants_development={};/**
238
+ * @license React
239
+ * react-reconciler-constants.development.js
240
+ *
241
+ * Copyright (c) Facebook, Inc. and its affiliates.
242
+ *
243
+ * This source code is licensed under the MIT license found in the
244
+ * LICENSE file in the root directory of this source tree.
245
+ */var hasRequiredReactReconcilerConstants_development;function requireReactReconcilerConstants_development(){return hasRequiredReactReconcilerConstants_development||(hasRequiredReactReconcilerConstants_development=1,process.env.NODE_ENV!=="production"&&function(){var o=1,e=4,r=16,t=536870912,n=o,a=e,l=r,u=t,f=0,d=1;reactReconcilerConstants_development.ConcurrentRoot=d,reactReconcilerConstants_development.ContinuousEventPriority=a,reactReconcilerConstants_development.DefaultEventPriority=l,reactReconcilerConstants_development.DiscreteEventPriority=n,reactReconcilerConstants_development.IdleEventPriority=u,reactReconcilerConstants_development.LegacyRoot=f}()),reactReconcilerConstants_development}process.env.NODE_ENV==="production"?constants.exports=requireReactReconcilerConstants_production_min():constants.exports=requireReactReconcilerConstants_development();var constantsExports=constants.exports;const propsToSkip={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let zIndexWarningShowed=!1,dragWarningShowed=!1;const EVENTS_NAMESPACE=".react-konva-event",DRAGGABLE_WARNING=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
246
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
247
+ Consider to add onDragMove or onDragEnd events.
248
+ For more info see: https://github.com/konvajs/react-konva/issues/256
249
+ `,Z_INDEX_WARNING=`ReactKonva: You are using "zIndex" attribute for a Konva node.
250
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
251
+ For more info see: https://github.com/konvajs/react-konva/issues/194
252
+ `,EMPTY_PROPS={};function applyNodeProps(o,e,r=EMPTY_PROPS){if(!zIndexWarningShowed&&"zIndex"in e&&(console.warn(Z_INDEX_WARNING),zIndexWarningShowed=!0),!dragWarningShowed&&e.draggable){var t=e.x!==void 0||e.y!==void 0,n=e.onDragEnd||e.onDragMove;t&&!n&&(console.warn(DRAGGABLE_WARNING),dragWarningShowed=!0)}for(var a in r)if(!propsToSkip[a]){var l=a.slice(0,2)==="on",u=r[a]!==e[a];if(l&&u){var f=a.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),o.off(f,r[a])}var d=!e.hasOwnProperty(a);d&&o.setAttr(a,void 0)}var h=e._useStrictMode,y={},E=!1;const p={};for(var a in e)if(!propsToSkip[a]){var l=a.slice(0,2)==="on",_=r[a]!==e[a];if(l&&_){var f=a.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e[a]&&(p[f]=e[a])}!l&&(e[a]!==r[a]||h&&e[a]!==o.getAttr(a))&&(E=!0,y[a]=e[a])}E&&(o.setAttrs(y),updatePicture(o));for(var f in p)o.on(f+EVENTS_NAMESPACE,p[f])}function updatePicture(o){if(!Global.Konva.autoDrawEnabled){var e=o.getLayer()||o.getStage();e&&e.batchDraw()}}var schedulerExports=requireScheduler();const NO_CONTEXT={},UPDATE_SIGNAL={};Konva.Node.prototype._applyProps=applyNodeProps;function appendInitialChild(o,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}o.add(e),updatePicture(o)}function createInstance(o,e,r){let t=Konva[o];t||(console.error(`Konva has no node with the type ${o}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${o}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),t=Konva.Group);const n={},a={};for(var l in e){var u=l.slice(0,2)==="on";u?a[l]=e[l]:n[l]=e[l]}const f=new t(n);return applyNodeProps(f,a),f}function createTextInstance(o,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${o}"`)}function finalizeInitialChildren(o,e,r){return!1}function getPublicInstance(o){return o}function prepareForCommit(){return null}function preparePortalMount(){return null}function prepareUpdate(o,e,r,t){return UPDATE_SIGNAL}function resetAfterCommit(){}function resetTextContent(o){}function shouldDeprioritizeSubtree(o,e){return!1}function getRootHostContext(){return NO_CONTEXT}function getChildHostContext(){return NO_CONTEXT}const scheduleTimeout=setTimeout,cancelTimeout=clearTimeout,noTimeout=-1;function shouldSetTextContent(o,e){return!1}const isPrimaryRenderer=!1,warnsIfNotActing=!0,supportsMutation=!0;function appendChild(o,e){e.parent===o?e.moveToTop():o.add(e),updatePicture(o)}function appendChildToContainer(o,e){e.parent===o?e.moveToTop():o.add(e),updatePicture(o)}function insertBefore(o,e,r){e._remove(),o.add(e),e.setZIndex(r.getZIndex()),updatePicture(o)}function insertInContainerBefore(o,e,r){insertBefore(o,e,r)}function removeChild(o,e){e.destroy(),e.off(EVENTS_NAMESPACE),updatePicture(o)}function removeChildFromContainer(o,e){e.destroy(),e.off(EVENTS_NAMESPACE),updatePicture(o)}function commitTextUpdate(o,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function commitMount(o,e,r){}function commitUpdate(o,e,r,t,n){applyNodeProps(o,n,t)}function hideInstance(o){o.hide(),updatePicture(o)}function hideTextInstance(o){}function unhideInstance(o,e){(e.visible==null||e.visible)&&o.show()}function unhideTextInstance(o,e){}function clearContainer(o){}function detachDeletedInstance(){}const getCurrentEventPriority=()=>constantsExports.DefaultEventPriority,HostConfig=Object.freeze(Object.defineProperty({__proto__:null,appendChild,appendChildToContainer,appendInitialChild,cancelTimeout,clearContainer,commitMount,commitTextUpdate,commitUpdate,createInstance,createTextInstance,detachDeletedInstance,finalizeInitialChildren,getChildHostContext,getCurrentEventPriority,getPublicInstance,getRootHostContext,hideInstance,hideTextInstance,idlePriority:schedulerExports.unstable_IdlePriority,insertBefore,insertInContainerBefore,isPrimaryRenderer,noTimeout,now:schedulerExports.unstable_now,prepareForCommit,preparePortalMount,prepareUpdate,removeChild,removeChildFromContainer,resetAfterCommit,resetTextContent,run:schedulerExports.unstable_runWithPriority,scheduleTimeout,shouldDeprioritizeSubtree,shouldSetTextContent,supportsMutation,unhideInstance,unhideTextInstance,warnsIfNotActing},Symbol.toStringTag,{value:"Module"}));var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,e,r)=>e in o?__defProp(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,__spreadValues=(o,e)=>{for(var r in e||(e={}))__hasOwnProp.call(e,r)&&__defNormalProp(o,r,e[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))__propIsEnum.call(e,r)&&__defNormalProp(o,r,e[r]);return o},__spreadProps=(o,e)=>__defProps(o,__getOwnPropDescs(e));function traverseFiber(o,e,r){if(!o)return;if(r(o)===!0)return o;let t=e?o.return:o.child;for(;t;){const n=traverseFiber(t,e,r);if(n)return n;t=e?null:t.sibling}}function wrapContext(o){try{return Object.defineProperties(o,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return o}}const FiberContext=wrapContext(React__namespace.createContext(null));class FiberProvider extends React__namespace.Component{render(){return React__namespace.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner,ReactCurrentDispatcher}=React__namespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const o=React__namespace.useContext(FiberContext);if(o===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=React__namespace.useId();return React__namespace.useMemo(()=>{for(const t of[ReactCurrentOwner==null?void 0:ReactCurrentOwner.current,o,o==null?void 0:o.alternate]){if(!t)continue;const n=traverseFiber(t,!1,a=>{let l=a.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(n)return n}},[o,e])}function useContextMap(){var o,e;const r=useFiber(),[t]=React__namespace.useState(()=>new Map);t.clear();let n=r;for(;n;){const a=(o=n.type)==null?void 0:o._context;a&&a!==FiberContext&&!t.has(a)&&t.set(a,(e=ReactCurrentDispatcher==null?void 0:ReactCurrentDispatcher.current)==null?void 0:e.readContext(wrapContext(a))),n=n.return}return t}function useContextBridge(){const o=useContextMap();return React__namespace.useMemo(()=>Array.from(o.keys()).reduce((e,r)=>t=>React__namespace.createElement(e,null,React__namespace.createElement(r.Provider,__spreadProps(__spreadValues({},t),{value:o.get(r)}))),e=>React__namespace.createElement(FiberProvider,__spreadValues({},e))),[o])}function usePrevious(o){const e=React$2.useRef({});return React$2.useLayoutEffect(()=>{e.current=o}),React$2.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const StageWrap=o=>{const e=React$2.useRef(),r=React$2.useRef(),t=React$2.useRef(),n=usePrevious(o),a=useContextBridge(),l=u=>{const{forwardedRef:f}=o;f&&(typeof f=="function"?f(u):f.current=u)};return React$2.useLayoutEffect(()=>(r.current=new Konva.Stage({width:o.width,height:o.height,container:e.current}),l(r.current),t.current=KonvaRenderer.createContainer(r.current,constantsExports.LegacyRoot,!1,null),KonvaRenderer.updateContainer(React$2.createElement(a,{},o.children),t.current),()=>{Konva.isBrowser&&(l(null),KonvaRenderer.updateContainer(null,t.current,null),r.current.destroy())}),[]),React$2.useLayoutEffect(()=>{l(r.current),applyNodeProps(r.current,o,n),KonvaRenderer.updateContainer(React$2.createElement(a,{},o.children),t.current,null)}),React$2.createElement("div",{ref:e,id:o.id,accessKey:o.accessKey,className:o.className,role:o.role,style:o.style,tabIndex:o.tabIndex,title:o.title})},Layer="Layer",Group="Group",Rect="Rect",Line="Line",Image$2="Image",Text="Text",KonvaRenderer=ReactFiberReconciler(HostConfig);KonvaRenderer.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:process.env.NODE_ENV!=="production"?1:0,version:React$2.version,rendererPackageName:"react-konva"});const Stage=React$2.forwardRef((o,e)=>React$2.createElement(FiberProvider,{},React$2.createElement(StageWrap,{...o,forwardedRef:e})));var client={},m=require$$0;if(process.env.NODE_ENV==="production")client.createRoot=m.createRoot,client.hydrateRoot=m.hydrateRoot;else{var i=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;client.createRoot=function(o,e){i.usingClientEntryPoint=!0;try{return m.createRoot(o,e)}finally{i.usingClientEntryPoint=!1}},client.hydrateRoot=function(o,e,r){i.usingClientEntryPoint=!0;try{return m.hydrateRoot(o,e,r)}finally{i.usingClientEntryPoint=!1}}}var __rest=globalThis&&globalThis.__rest||function(o,e){var r={};for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&e.indexOf(t)<0&&(r[t]=o[t]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(o);n<t.length;n++)e.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(o,t[n])&&(r[t[n]]=o[t[n]]);return r};const needForceStyle=o=>{const e=window.getComputedStyle(o).position;return!(e==="absolute"||e==="relative")};function useEvent(o=()=>{}){const e=React$2.useRef(o);return e.current=o,React$2.useCallback((...r)=>e.current.apply(null,r),[])}const Html=({children:o,groupProps:e,divProps:r,transform:t,transformFunc:n})=>{const a=React$2.useRef(null);React$2.useRef();const[l]=React$2.useState(()=>document.createElement("div")),u=React$2.useMemo(()=>client.createRoot(l),[l]),f=t??!0,d=useEvent(()=>{if(f&&a.current){let _=a.current.getAbsoluteTransform().decompose();n&&(_=n(_)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${_.x}px, ${_.y}px) rotate(${_.rotation}deg) scaleX(${_.scaleX}) scaleY(${_.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const h=r||{},{style:y}=h,E=__rest(h,["style"]);Object.assign(l.style,y),Object.assign(l,E)});return React$2.useLayoutEffect(()=>{var h;const y=a.current;if(!y)return;const E=(h=y.getStage())===null||h===void 0?void 0:h.container();if(E)return E.appendChild(l),f&&needForceStyle(E)&&(E.style.position="relative"),y.on("absoluteTransformChange",d),d(),()=>{var p;y.off("absoluteTransformChange",d),(p=l.parentNode)===null||p===void 0||p.removeChild(l)}},[f]),React$2.useLayoutEffect(()=>{d()},[r,n]),React$2.useLayoutEffect(()=>{u.render(o)}),React$2.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),React$2.createElement(Group,Object.assign({ref:a},e))};function Area({area:o,finished:e,isClicked:r,isBad:t,hasHighlights:n,completed:a,onClick:l,onClickOutside:u}){const f=React$2.useRef(),[d,h]=React$2.useState(),y=t?"rgba(255, 99, 77, 0.32)":"rgba(75, 215, 169, 0.32)",E=t?"#ff634d":"#4bd7a9",p=DeviceDetection(),_=()=>{var S,A,T;n&&!a&&!r&&((S=f.current)==null||S.setAttr("fill","rgba(130, 134, 142, 0.4)"),(A=f.current)==null||A.setAttr("stroke","rgba(255, 255, 255, 0.3)"),(T=f.current)==null||T.to({duration:.25,opacity:1}))},g=()=>{var S;n&&!a&&!r&&((S=f.current)==null||S.to({duration:.25,opacity:0}))};React$2.useEffect(()=>{var S,A,T;a&&!e&&(t?(T=f.current)==null||T.to({duration:.25,opacity:0}):((S=f.current)==null||S.to({duration:.25,opacity:1}),(A=f.current)==null||A.globalCompositeOperation("destination-out")))},[a,e,t]);const x=()=>{var S,A;a||(t?u(o):l(o),(S=f.current)==null||S.setAttr("fill",y),(A=f.current)==null||A.setAttr("stroke",E))},C=o.scaleX?o.scaleX:1,R=o.scaleY?o.scaleY:1;return React$2.useLayoutEffect(()=>{const S=f.current.getStage();S.on("stage-loaded",()=>{const A=f.current.getClientRect({relativeTo:f.current.getParent()});h({x:A.x+A.width/2,y:A.y+A.height/2}),S.batchDraw()})},[o]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[d?jsxRuntimeExports.jsx(Html,{transform:!0,groupProps:{id:"projection",...d},divProps:{style:{pointerEvents:"none"}},children:jsxRuntimeExports.jsx("div",{style:{width:"50px",height:"50px",pointerEvents:"none"},id:o.id})}):null,jsxRuntimeExports.jsx(Line,{name:o.id,ref:f,onFocus:()=>_(),onMouseOver:()=>_(),onMouseLeave:g,onClick:()=>x(),onTap:()=>x(),x:o.x,y:o.y,scale:{x:C,y:R},skew:{x:o.skewX,y:o.skewY},rotation:o.rotation,points:o.points,shape:"poly",fill:e?"":y,stroke:e||r?E:"",strokeWidth:p?10:4,opacity:e||r?1:0,closed:!0})]})}Area.defaultProps={finished:!1,isBad:!1,isClicked:!1,hasHighlights:!1,completed:!1,onClick:()=>{},onClickOutside:()=>{}};const useWindowSize=()=>{const[o,e]=React$2.useState([0,0]);return React$2.useLayoutEffect(()=>{function r(){e([window.innerWidth,window.innerHeight])}return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[]),o};function KonvaMapper({areas:o,badAreas:e,imageUrl:r,completed:t,onClick:n,onClickOutside:a,hasHighlights:l,clickedZones:u}){const f=React$2.useRef(),d=React$2.useRef(),h=React$2.useRef(),y=React$2.useRef(),E=React$2.useRef(),p=React$2.useRef(),_=React$2.useRef(),[g,x]=React$2.useState(new window.Image),[C,R]=useWindowSize(),S=e.find(w=>w.id==="AllArea")||!1,A=e.filter(w=>w.id!=="AllArea");React$2.useEffect(()=>{_.current&&d.current&&t&&(_.current.to({duration:.25,opacity:.5}),d.current.setAttr("visible",!0))},[t]);const T=w=>{S&&!w.target.attrs.shape&&a(S)};return React$2.useEffect(()=>{g.src=r,g.addEventListener("load",()=>{if(f.current){const w={x:C/2,y:R/2,width:g.width,height:g.height,offsetX:g.width/2,offsetY:g.height/2,scale:{x:Math.min(C/g.width,R/g.height),y:Math.min(C/g.width,R/g.height)}};y.current&&y.current.setAttrs(w),E.current&&E.current.setAttrs(w),d.current&&d.current.setAttrs(w),h.current&&h.current.setAttrs(w),p.current&&p.current.setAttrs(w),f.current.batchDraw(),x(g),f.current.fire("stage-loaded")}})},[g,R,r,C]),jsxRuntimeExports.jsxs(Stage,{ref:f,width:C,height:R,onClick:T,onTouchEnd:T,children:[jsxRuntimeExports.jsx(Layer,{children:jsxRuntimeExports.jsx(Image$2,{ref:p,image:g})}),jsxRuntimeExports.jsxs(Layer,{children:[jsxRuntimeExports.jsx(Rect,{ref:_,width:C,height:R,fill:"black",opacity:0}),jsxRuntimeExports.jsx(Group,{ref:E,children:A.map((w,P)=>jsxRuntimeExports.jsx(Area,{hasHighlights:l,completed:t,onClick:n,onClickOutside:a,area:w,isBad:!0},w.name+"_"+P))}),jsxRuntimeExports.jsx(Group,{ref:y,children:o.map((w,P)=>jsxRuntimeExports.jsx(Area,{hasHighlights:l,completed:t,onClick:n,onClickOutside:a,area:w,isClicked:u.some(O=>O.index===w.index)},w.name+"_"+P))}),jsxRuntimeExports.jsx(Group,{ref:h,visible:!1,children:A.map((w,P)=>jsxRuntimeExports.jsx(Area,{hasHighlights:l,completed:t,onClick:n,onClickOutside:a,area:w,isBad:!0,finished:!0},w.name+"_"+P))}),jsxRuntimeExports.jsx(Group,{ref:d,visible:!1,children:o.map((w,P)=>jsxRuntimeExports.jsx(Area,{hasHighlights:l,completed:t,onClick:n,onClickOutside:a,area:w,finished:!0},w.name+"_"+P))})]})]})}KonvaMapper.defaultProps={hasHighlights:!1,onClick:()=>{},completed:!1,onClickOutside:()=>{}};function TimerDialog({retry:o,translate:e,onInit:r}){return jsxRuntimeExports.jsx("div",{className:"timer-dialog",children:jsxRuntimeExports.jsxs("div",{className:"timer-dialog__container",children:[jsxRuntimeExports.jsx("div",{className:"timer-dialog__title",children:e("storylines.misc.ready")}),jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary",onClick:r,children:jsxRuntimeExports.jsx("span",{children:e(o?"storylines.misc.start":"storylines.misc.retry")})})]})})}function CountDown({time:o}){const e=Math.floor(o/60),r=o%60;return jsxRuntimeExports.jsx("div",{className:`count-down count-down--in-puzzle-frame ${o<10?"count-down--finalseconds":""}`,children:jsxRuntimeExports.jsxs("div",{children:[e<10?`0${e}`:e," : ",r<10?`0${Math.floor(r)}`:Math.floor(r)]})})}const defaultImg="https://min.gamelearn.io/css-resources/gamelearn/resources/puzzle-login-low.png";function ImageReview(){return jsxRuntimeExports.jsx("div",{className:"puzzle--image__preview",children:jsxRuntimeExports.jsx("img",{alt:"img",src:"https://min.gamelearn.io/css-resources/gamelearn/resources/image-click.jpg"})})}function ImageClickWrapperComponent(o){var ye,De;const{soundActions:e,emitEvent:r,handleClick:t,disableExit:n,setResolveAction:a,info:l,image:u,areas:f,badAreas:d,hasClickOrder:h,timer:y,hasClickOnce:E,hasHighlights:p,hasImageReview:_,defaultCompleted:g,className:x,emitFinish:C,emitResolve:R,translateFromParent:S,specificFeedbacks:A,slideNumber:T,emitResetPuzzle:w,firstTryForFrame:P,puzzlesAutoCompleted:O,emitOpenPopupCounterInfo:k,pause:D,keyboardControl:F}=o,[G,V]=React$2.useState([]),[W,ee]=React$2.useState(!1),[q,z]=React$2.useState(!1),[U,$]=React$2.useState({show:!1,success:!1,text:"",rewards:[]}),I=React$2.useRef(!1),[B,X]=React$2.useState(!0),[Q,J]=React$2.useState(!1),ne=React$2.useRef(null),ae=React$2.useRef(null),Z=React$2.useRef(null),se=React$2.useRef(null),oe=React$2.useRef(null),fe=React$2.useRef(null),de=React$2.useRef(null),ce=React$2.useRef(null),Se=React$2.useRef(null),[Le,Ne]=React$2.useState(y),He=Be=>S?S(Be):r({type:"translate",payload:Be}),[Ke]=e,{solution:Qe}=l,dt=u.img.url||defaultImg,yt=f.map((Be,Ce)=>({index:Ce,shape:"poly",...Be})),ut=d.map((Be,Ce)=>({index:Ce,shape:"poly",...Be})),ft=React$2.useCallback(()=>{if(!B){const Be=setInterval(()=>{Ne(Ce=>Ce>1?Ce-1:0)},1e3);Se.current=Be}},[B]),Xt=React$2.useCallback((Be,Ce)=>{C?C(Be,Ce):r({type:"addPoints",payload:Be})},[r,C]);React$2.useEffect(()=>{W&&n(!0)},[W,n]),React$2.useEffect(()=>{ee(g)},[g]);const kt=React$2.useCallback(()=>{clearInterval(Z.current)},[]),Ge=React$2.useCallback(()=>{clearInterval(Se.current)},[]),Ze=React$2.useCallback(Be=>{oe.current=Date.now(),se.current?(de.current=se.current-oe.current,kt()):(de.current=oe.current-(oe.current-Be*1e3),kt())},[kt]),rt=React$2.useCallback(()=>{$(()=>{var Be,Ce;return{show:!0,success:!1,text:(Be=l==null?void 0:l.timerFeedback)!=null&&Be.desc?l.timerFeedback.desc:"",rewards:(Ce=l==null?void 0:l.timerFeedback)==null?void 0:Ce.rewards}}),J(!0),Ge(),kt()},[Ge,kt,(ye=l.timerFeedback)==null?void 0:ye.desc,(De=l.timerFeedback)==null?void 0:De.rewards]),qt=React$2.useCallback(()=>{clearInterval(Z.current),Z.current=setInterval(()=>{ae.current=Date.now(),ae.current>se.current&&rt()},250)},[rt]);React$2.useEffect(()=>{var Be;if((f.length===G.length||E&&G.length>0)&&!W){ee(!0);const Ce=G[G.length-1],Ee=A==null?void 0:A.correctFeedbacks.find(Pe=>Pe.id===Ce.id);(!((Be=A==null?void 0:A.correctFeedbacks)!=null&&Be.length)||A!=null&&A.correctFeedbacks.some(Pe=>!Pe.desc)||E)&&($(Pe=>({...Pe,show:!0,success:!0,text:Ee?Ee.desc:l.solution.right.desc,rewards:Ee?Ee.rewards:l.solution.right.rewards})),y&&(Ge(),Ze()))}},[G,f.length,A,E,W,l.solution.right,Ze,y,Ge]),React$2.useEffect(()=>{a(Be=>{y&&(Ge(),X(!1),U.show?$(Ce=>({...Ce,show:!1,success:!1,text:"",rewards:[]})):kt()),ee(!0),z(!0),setTimeout(()=>{R?R(Be):Be()},4e3)})},[a,R,Ke,y,U.show,kt,Ge]),React$2.useEffect(()=>{q&&n(!0)},[q,n]);const We=(Be,Ce=!1)=>{var Ee,Pe;if(!W){const{rewards:Xe,desc:nt}=Qe.wrong;let it=nt,Ht=Xe;const Sr=(Ee=A==null?void 0:A.wrongFeedbacks)==null?void 0:Ee.find(Qt=>Qt.id===Be.id);Sr&&(it=Sr.desc,Ht=Sr.rewards),h&&(V([]),Ce&&(Pe=l==null?void 0:l.orderFeedback)!=null&&Pe.desc&&(it=l.orderFeedback.desc,Ht=l.orderFeedback.rewards)),y&&(Ge(),Ze()),$(Qt=>({...Qt,show:!0,success:!1,text:it,rewards:Ht})),Ke("fail")}},at=React$2.useCallback(()=>{fe.current=Date.now();const Be=fe.current+de.current;ae.current=null,se.current=Be,(y||Q)&&(U.success?f.length===G.length||E&&G.length>0?Ge():(Ne(de.current*.001),ft(),qt()):(V([]),X(!0),w())),Xt(U.rewards,U.success),Ke("click-ui"),$(Ce=>({...Ce,show:!1,success:!1,text:"",rewards:[]}))},[y,Q,Xt,U.rewards,U.success,Ke,f.length,G.length,E,w,Ge,ft,qt]),pe=Be=>{var Ce,Ee;if(!G.some(Pe=>Pe.index===Be.index)&&!U.show&&!W){Ke("click-ui");let Pe=Qe.right.desc,{rewards:Xe}=Qe.right;const nt=[...G,Be];if(h&&Be.index===G.length||!h){if(y&&Ze(Le),t(),(Ce=A==null?void 0:A.correctFeedbacks)!=null&&Ce.length){const it=(Ee=A.correctFeedbacks)==null?void 0:Ee.find(Ht=>Ht.id===Be.id);it&&(Pe=it.desc,Xe=it.rewards),!Pe&&f.length>nt.length&&!E?Xt(Xe,!0):Pe&&!E&&($(Ht=>({...Ht,show:!0,success:!0,text:Pe,rewards:Xe})),y&&Ge())}V(nt)}else We(Be,!0)}},me=React$2.useCallback(()=>{Ge(),Ne(y),ft(),!I.current&&P&&k(),X(!1),ne.current=Date.now(),se.current=ne.current+y*1e3,qt()},[Ge,y,ft,P,qt,k]);return React$2.useEffect(()=>{y&&T>0&&!ce.current&&(P&&Object.keys(O).length&&O[T-1]?(X(!0),ce.current=!0):X(!1))},[g,P,O,T,y]),React$2.useEffect(()=>{y&&Le===0&&rt()},[Le,rt,y]),React$2.useEffect(()=>{y&&(D?(Ge(),Ze()):ft())},[Ge,qt,D,Ze,ft,y]),jsxRuntimeExports.jsxs("div",{className:x,children:[U.show?jsxRuntimeExports.jsx(FeedbackComponent$1,{playSound:Ke,text:U.text,success:U.success,translate:He,hasTimeout:!U.text,delay:y?1e3:2e3,functionOnClose:at,timeExpired:Q,keyboardControl:F}):null,jsxRuntimeExports.jsx(KonvaMapper,{completed:W,imageUrl:dt,areas:E&&G.length?[G[0]]:yt,badAreas:ut,clickedZones:G,onClick:pe,onClickOutside:We,hasHighlights:p,emitEvent:r}),_?jsxRuntimeExports.jsx(ImageReview,{}):null,y&&B?jsxRuntimeExports.jsx(TimerDialog,{retry:P||O[T-1],translate:He,onInit:me}):null,y?jsxRuntimeExports.jsx(CountDown,{time:Le}):null]})}ImageClickWrapperComponent.defaultProps={info:{instructions:"",resolve:{},solution:{},hint:{},title:""},badAreas:[],className:"puzzle--image__click",hasClickOrder:!1,hasClickOnce:!1,hasHighlights:!1,hasImageReview:!1,defaultCompleted:!1,hideContinue:!1,emitAreaClick:()=>{},handleClick:()=>{}};function ImageClickPuzzleComponent(o){const e=(r,t)=>{t?(o.emitEvent({type:"addPoints",complex:!0,finish:!0,payload:r}),o.emitEvent({type:"passPuzzle"})):(o.emitEvent({type:"addPoints",payload:r,finish:!1}),o.emitEvent({type:"failPuzzle"}))};return jsxRuntimeExports.jsx(ImageClickWrapperComponent,{...o,emitFinish:e,name:"image-click-puzzle"})}const GREEN="#44d7ab",ORANGE="#FFB34B",RED="#FF634D",getDistance=(o,e)=>Math.max(Math.abs(o[0]-e[0]),Math.abs(o[1]-e[1])),generatePasswordPositions=(o,e,r,t)=>{const n=[],a=o;for(const l of e.toLowerCase()){const u=Math.floor(Math.random()*r),f=Math.floor(Math.random()*t);a[u][f].value=l,n.push({char:l,position:[u,f]})}return[a,n]},paintedGridPassword=(o,e,r,t)=>{const n=o;for(let a=0;a<e;a+=1)for(let l=0;l<r;l+=1)switch(t.reduce((f,d)=>{const h=[a,l],y=getDistance(d.position,h);return y<f?y:f},9999)){case 0:n[a][l].hiddenColor=GREEN;break;case 1:n[a][l].hiddenColor=ORANGE;break;case 2:n[a][l].hiddenColor=RED;break}return n},resetColors=(o,e,r)=>{const t=r;for(let n=0;n<o;n+=1)for(let a=0;a<e;a+=1)t[n][a].color="",t[n][a].hiddenColor=RED;return t},repaintGridPassword=(o,e,r,t)=>{const n=resetColors(r,t,o),[a,l]=generatePasswordPositions(n,e,r,t);return paintedGridPassword(a,r,t,l)},prepareAcceptedChars=(o,e)=>e.split("").filter(r=>!o.includes(r)).join(""),generateBasicGrid=(o,e,r)=>{const t=[];for(let n=0;n<o;n+=1){const a=[];for(let l=0;l<e;l+=1){const u={color:"",hiddenColor:RED,value:r[Math.floor(Math.random()*r.length)]};a.push(u)}t.push(a)}return t},makeSomeNoise=({numberOfColumns:o,numberOfRows:e,password:r})=>{const t=LangIsRtl()?"٠١٢٣٤٥٦٧٨٩شزذيثبلاهتنمورخحضقسفعدصطغظ":"0123456789abcdefghijklmnopqrstuvwxyz",n=prepareAcceptedChars(r,t),a=generateBasicGrid(e,o,n),[l,u]=generatePasswordPositions(a,r,e,o);return paintedGridPassword(l,e,o,u)};function DrawItem({item:o,rowIndex:e,columnIndex:r,setCursorPosition:t,cursorPosition:n}){const a=Math.abs(e-n[0])<3&&Math.abs(r-n[1])<3;return jsxRuntimeExports.jsx("span",{className:"puzzle--cracker__item",style:{backgroundColor:`${a?o.hiddenColor:o.color}`,flexGrow:1,textAlign:"center"},onMouseOver:()=>{t([e,r])},onFocus:()=>{t([e,r])},children:o.value})}DrawItem.defaultProps={setCursorPosition:()=>{}};DrawItem.propTypes={item:PropTypes.shape({color:PropTypes.string,hiddenColor:PropTypes.string,value:PropTypes.string}).isRequired,rowIndex:PropTypes.number.isRequired,columnIndex:PropTypes.number.isRequired,cursorPosition:PropTypes.arrayOf(PropTypes.number).isRequired,setCursorPosition:PropTypes.func};function DrawRow({row:o,rowIndex:e,setCursorPosition:r,cursorPosition:t}){return o.length?jsxRuntimeExports.jsx("div",{className:"puzzle--cracker",children:o.map((n,a)=>jsxRuntimeExports.jsx(DrawItem,{item:n,rowIndex:e,columnIndex:a,setCursorPosition:r,cursorPosition:t},a))}):null}DrawRow.defaultProps={row:[]};DrawRow.propTypes={row:PropTypes.arrayOf(PropTypes.shape({})),rowIndex:PropTypes.number.isRequired,setCursorPosition:PropTypes.func.isRequired,cursorPosition:PropTypes.arrayOf(PropTypes.number).isRequired};function DrawGrid({grid:o,cursorPosition:e,setCursorPosition:r}){return jsxRuntimeExports.jsx("div",{className:"puzzle--cracker__canvas",children:o.map((t,n)=>jsxRuntimeExports.jsx(DrawRow,{row:t,rowIndex:n,cursorPosition:e,setCursorPosition:r},n))})}DrawGrid.defaultProps={setCursorPosition:()=>{}};const VELOCITY_MAP={slow:2,fast:5,fastest:10},DIFFICULTY_MAP={easy:{visibleRows:"auto",visibleColumns:40,totalRows:25},medium:{visibleRows:"auto",visibleColumns:40,totalRows:40},hard:{visibleRows:"auto",visibleColumns:40,totalRows:80}};function CrackerPuzzleComponent({emitEvent:o,soundActions:e,info:r,velocity:t,password:n,disableExit:a,difficulty:l,setResolveAction:u}){const[f]=e,d=X=>o({type:"translate",payload:X}),h=React$2.useRef(),y=React$2.useRef(),{solution:E}=r,[p,_]=React$2.useState(n.toLowerCase()),[g,x]=React$2.useState(),[C,R]=React$2.useState(Array(n.toLowerCase().length).fill("")),[S,A]=React$2.useState(!1),[T,w]=React$2.useState([0,0]),P=d("puzzle.cracker.crackedPassword"),O=r.solution.right.desc&&r.solution.right.desc!==""?r.solution.right.desc:"",k=d("puzzle.cracker.congratulations"),[D,F]=React$2.useState([[]]),{visibleRows:G,visibleColumns:V}=DIFFICULTY_MAP[l];let W=G==="auto"?Math.ceil(window.innerHeight*.025):G;W=W>=20?W:20,React$2.useEffect(()=>{S&&a(!0)},[S,a]),React$2.useEffect(()=>{u(X=>{f("score"),A(!0),setTimeout(()=>{o({type:"hidePuzzleButtons",payload:!1}),X()},0)})},[u,f]);const ee=()=>{f("click-ui");const{rewards:X}=E.right;o({type:"addPoints",complex:!0,finish:!0,payload:X}),o({type:"passPuzzle"})},q=()=>n.toLowerCase().split("").map((Q,J)=>({char:Q,index:J,used:!1})),z=X=>X.filter(Q=>Q.used===!1).map(Q=>Q.char).join(""),U=X=>{if(X[0].length>0&&!S){const Q=[...X];return Q.push(Q.shift()),Q}return X};let $=0;const I=X=>{if(y.current!==void 0){const Q=X-y.current;$+=Q,$>1e3/VELOCITY_MAP[t]&&(F(U),$=0)}y.current=X,h.current=requestAnimationFrame(I)};React$2.useEffect(()=>{_(n.toLowerCase());const X=makeSomeNoise({numberOfColumns:V,numberOfRows:W,password:n.toLowerCase()});return F(X),x(q()),h.current=requestAnimationFrame(I),()=>cancelAnimationFrame(h.current)},[]);const B=()=>{if(D.length<=1)return;const[X,Q]=T,J=D[X][Q];if(J.hiddenColor===GREEN){const ne=g.filter(ae=>ae.char===J.value.toLowerCase()&&ae.used===!1)[0];if(ne){const{index:ae}=ne;f("score");const Z=g;Z[ae].used=!0,x(Z);const se=[...C];se[ae]=J.value;const oe=z(Z);_(oe);const fe=repaintGridPassword(D,oe,W,V);F(fe),R(se)}}p<=0&&(f("score"),A(!0))};return React$2.useEffect(()=>{S||B()},[T]),jsxRuntimeExports.jsxs("div",{className:"puzzle--cracker__container",children:[jsxRuntimeExports.jsxs("div",{className:"puzzle--cracker__header",children:[jsxRuntimeExports.jsx("span",{className:"title",children:"Dcoder.exe"}),jsxRuntimeExports.jsx("div",{className:"puzzle--pieces",children:C.map((X,Q)=>jsxRuntimeExports.jsx("span",{className:"puzzle--pieces__item",children:X&&jsxRuntimeExports.jsx("span",{className:"character success-transition-animation","data-testid":`solution${Q}`,children:X})},`${X+Q}`))})]}),jsxRuntimeExports.jsx(DrawGrid,{grid:S?[[]]:D,cursorPosition:T,setCursorPosition:w}),S&&P&&k&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Typist,{avgTypingDelay:110,cursor:{hideWhenDone:!0},className:"puzzle--cracker__result",children:[jsxRuntimeExports.jsx(Typist.Delay,{ms:300}),jsxRuntimeExports.jsxs("span",{children:[`${P} ${n.toLowerCase()}`," "]}),jsxRuntimeExports.jsxs("span",{children:[k," "]}),O!==""&&jsxRuntimeExports.jsx("span",{children:O})]}),jsxRuntimeExports.jsx("div",{className:"position--absolute bottom center",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary gat--btn__cracker",onClick:ee,children:d("screens.continue")})})]})]})}CrackerPuzzleComponent.defaultProps={velocity:"slow",difficulty:"easy",context:{},info:{}};const ARABIC=/[\u0600-\u06FF]/,restrictCharacters=(o,e)=>{let r=!1;return e==="or"&&(r=o===""||o===" "||o===","||o==="."||o==="/"),e==="and"&&(r=o&&o!==" "&&o!==","&&o!=="."&&o!==""&&o!=="/"),r},sortChar=(o,e)=>o.char>e.char?1:o.char<e.char?-1:0,analyzeChars=o=>{const e={anyArabic:!1,anyNumber:!1,anyWestern:!1};for(let r=0;r<o.length;r+=1){const t=o[r].charCodeAt(0);t>=65&&t<=90?e.anyWestern=!0:t>=48&&t<=57?e.anyNumber=!0:ARABIC.test(o[r])&&(e.anyArabic=!0)}return e},makeChar=o=>{const e="شزذيثبلاهتنمورخحضثقسفعدصطغظ",r="ABCDEFGHIJKLMNOPQRSTUVWXYZ",t="0123456789";let n="";return o.anyWestern&&(n+=r),o.anyNumber&&(n+=t),o.anyArabic&&(n+=e),n.charAt(Math.floor(Math.random()*n.length))},MAX_POOL_LETTERS=26,MAX_EXTRA_LETTERS=8,AnswerPanel=({answer:o,flickerPosition:e,show:r=!1,showCorrectSolution:t})=>{const n=[];let a=0;return o.forEach(l=>{n[a]||(n[a]=[]),n[a]=[...n[a],l],l.char===" "&&(a+=1),t||(l.positionInitial=l.index)}),n.map((l,u)=>jsxRuntimeExports.jsx("div",{dir:"auto",className:"puzzle--hanged__word","data-testid":`result-${u}`,children:r?l.map((f,d)=>jsxRuntimeExports.jsx("span",{className:"puzzle--hanged__letter active",children:f},`${f+d}`)):l.filter(({char:f})=>f!==" ").map(({char:f,fixed:d},h)=>jsxRuntimeExports.jsx("span",{className:`puzzle--hanged__letter ${d?"":"active"} ${l[h].positionInitial===e?"fakeFocus":""}`,children:f},`${f+h}`))},`${l+u}`))},defaultImage="https://min.gamelearn.io/css-resources/gamelearn/resources/partenon.jpg";function HangedPuzzleComponent({soundActions:o,emitEvent:e,disableExit:r,question:t,image:n,info:a,answer:l,hintUsed:u,setResolveAction:f,setHintAction:d,keyboardControl:h}){var fe;const[y]=o,E=((fe=n.img)==null?void 0:fe.url)||defaultImage,[p,_]=React$2.useState(0),[g,x]=React$2.useState(!1),[C,R]=React$2.useState([]),[S,A]=React$2.useState(!1),[T,w]=React$2.useState([]),[P,O]=React$2.useState(""),[k,D]=React$2.useState(!1),[F,G]=React$2.useState([]),[V,W]=React$2.useState(!1),ee=l.toUpperCase().split(""),q=ee.filter(de=>restrictCharacters(de,"and")),z=de=>e({type:"translate",payload:de}),U=React$2.useCallback(()=>{const de=q.map(Le=>({char:Le}));let ce=[];const Se=analyzeChars(q);for(;ce.length<MAX_EXTRA_LETTERS;){const Le=makeChar(Se);ce=[...ce,{char:Le}]}return[...de,...ce]},[q]),$=l.toUpperCase().split("").map((de,ce)=>restrictCharacters(de,"or")?{index:ce,letter:de,char:de,fixed:!0}:{index:ce,letter:de,char:""}),I=React$2.useCallback(()=>{let de=U();for(;de.length>MAX_POOL_LETTERS;){const ce=Math.trunc(Math.random()*(de.length-1))+1,Se=de[ce],Le=$.find((Ne,He)=>Se.char===Ne.letter&&!$[He].fixed);Le&&(de.splice(ce,1),$[Le.index]={...Le,char:Le.letter,fixed:!0})}u&&(de=[],$.forEach(({letter:ce})=>{ce!==" "&&de.push({char:ce})})),w($),R(de)},[$,u,U]),B=(de,ce)=>C.map((Le,Ne)=>Ne===ce?{...Le,deleted:!0}:{...Le}),X=(de,ce,Se)=>{const Le=ce.map((He,Ke)=>Se.find(dt=>dt.poolIndex===Ke)?{char:He.char}:He);R(Le),w(de);const Ne=de.find(He=>He.char==="");_(Ne.index)},Q=(de,ce)=>{y("click-ui");let Se=!1;const Le=T.map(Ke=>!Ke.char&&!Se?(Se=!0,{...Ke,char:de,poolIndex:ce}):Ke),Ne=B(de,ce),He=Le.filter(Ke=>Ke.char).length;R(Ne),w(Le),J(),He===T.length&&se(Le,Ne)},J=()=>{var de;if(g){const ce=T.find(Se=>Se.index!==p&&Se.letter!==" "&&Se.char===""&&Se.poolIndex===!1);ce&&_(ce.index)}else{const ce=T.find(Se=>Se.char==="");_(ce.index+1),((de=T[ce.index+1])==null?void 0:de.letter)===" "&&_(ce.index+2)}},ne=()=>{y("click-ui");const de=T.map((ce,Se)=>T[T.length-1-Se]).find(ce=>ce.char&&!ce.fixed);if(de){const ce=T.map(Ne=>Ne.index===de.index?{...de,char:""}:Ne);let Se=!1;const Le=C.map((Ne,He)=>He===de.poolIndex&&(Ne.deleted||!Se)?(Se=!0,{char:Ne.char}):Ne);R(Le),w(ce),_(de.index)}},ae=()=>{r(!0),O("");const de=[...F,...a.solution.right.rewards];y("score"),e({type:"hidePuzzleButtons",payload:!1}),e({type:"addPoints",complex:!0,finish:!0,payload:de}),e({type:"passPuzzle"})},Z=()=>{y("fail"),e({type:"hidePuzzleButtons",payload:!1}),G([...F,...a.solution.wrong.rewards]),O(""),D(!1),e({type:"failPuzzle"}),x(!0)},se=(de,ce)=>{let Se=[];D(!0);const Le=de.map((He,Ke)=>ee[Ke]===He.char?{...He,fixed:!0}:(Se=[...Se,He],{...He,poolIndex:!1,char:""})),Ne=Le.filter(He=>He.fixed).length;e({type:"hidePuzzleButtons",payload:!0}),Ne===ee.length?(O("success"),a.solution.right.desc===""&&setTimeout(()=>{ae()},2e3)):(O("failed"),X(Le,ce,Se),a.solution.wrong.desc===""&&setTimeout(()=>{Z()},2e3))},oe=()=>{if(P==="success")ae();else{Z();const de=T.find(ce=>ce.char==="");_(de.index)}};return React$2.useEffect(()=>{S||(A(!0),I()),f(de=>{W(!0),setTimeout(()=>{e({type:"hidePuzzleButtons",payload:!1}),de()},2e3)}),d(de=>{const ce=[];$.forEach(({letter:Se})=>{Se!==" "&&ce.push({char:Se})}),R(ce),de()})},[I,S,l,f,e,F,a.resolve.rewards,$,d]),jsxRuntimeExports.jsxs("div",{className:"puzzle--hanged",style:{backgroundImage:`url("${E}")`},children:[P?jsxRuntimeExports.jsx(FeedbackComponent$1,{playSound:y,text:a.solution[P==="success"?"right":"wrong"].desc,success:P==="success",translate:z,functionOnClose:oe,keyboardControl:h}):null,jsxRuntimeExports.jsx("div",{className:"puzzle--hanged__content",children:jsxRuntimeExports.jsxs("div",{className:"puzzle--hanged__controls",children:[jsxRuntimeExports.jsx("div",{dir:"auto",className:"puzzle--hanged__header",children:t}),jsxRuntimeExports.jsx("div",{dir:"auto",className:`puzzle--hanged__solution ${P}`,"data-testid":`${P}`,children:V?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(AnswerPanel,{showCorrectSolution:V,answer:l.split(""),show:!0})}):jsxRuntimeExports.jsx(AnswerPanel,{showCorrectSolution:V,flickerPosition:p,answer:T})}),jsxRuntimeExports.jsxs("div",{className:"puzzle--hanged__keyboard",children:[C.sort((de,ce)=>sortChar(de,ce)).map((de,ce)=>jsxRuntimeExports.jsx("button",{"data-testid":`key-${de.char}`,type:"button",onClick:()=>{!de.deleted&&!P&&!k&&(Q(de.char,ce),y("click-ui"))},className:`puzzle--hanged__keyboard--item ${de.deleted||k?"disabled":""}`,children:de.char},`${de+ce}`)),jsxRuntimeExports.jsx("button",{onClick:k?null:()=>ne(),type:"button",disabled:k?"disabled":null,"aria-label":z("puzzles.hanged-puzzle.deleteButton"),className:`puzzle--hanged__keyboard--item delete ${k?"disabled":""}`,children:jsxRuntimeExports.jsx("span",{className:"icon-delete-keyboard"})})]})]})})]})}HangedPuzzleComponent.defaultProps={question:"",answer:"",image:{},hintBought:!1,info:{description:"",instructions:"",resolve:{},solution:{},hintBought:{}}};function CurrentImageClickPuzzle({list:o,description:e,nodeId:r,setInfo:t,emitEvent:n,disableExit:a,setResolveAction:l,soundActions:u,setSelected:f,selected:d,pause:h,loadPuzzleStatus:y,index:E,setIndex:p,slidesCompleted:_,setSlidesCompleted:g,keyboardControl:x,totalCorrects:C}){const R=React$2.useRef([]),S=React$2.useRef(0),A=React$2.useRef(0),T=`chained-image-click-puzzle_${E}_${r}`,[w]=u,P=ee=>{R.current=[...R.current,...ee]},O=React$2.useCallback(ee=>{w("score"),n({type:"hidePuzzleButtons",payload:!1}),n({type:"addPoints",complex:!0,finish:!0,payload:[...R.current,...ee]}),n({type:"passPuzzle"})},[w,n]),k=o[E],{info:D,specificFeedbacks:F}=k;D.description=e,React$2.useEffect(()=>{S.current=0,A.current=0},[E]);const G=React$2.useCallback((ee,q=!1)=>{var U;let z={..._};if(q){if((U=F==null?void 0:F.correctFeedbacks)!=null&&U.length&&!k.hasClickOnce)S.current+=1;else{let $=d;A.current&&($-=A.current),S.current=k.areas.length,f($+S.current)}S.current===k.areas.length&&(E+1>=o.length?O(ee):p(E+1),z={...z,[E]:!0},g(z)),P(ee)}else n({type:"addPoints",payload:ee,finish:!1}),n({type:"failPuzzle"}),k.hasClickOrder&&(f(d-S.current),S.current===0&&Object.entries(_).length===0?f(0):S.current=0),Object.entries(_).length===0&&k.hasClickOrder&&!d&&f(0)},[_,F,k.hasClickOnce,k.areas.length,k.hasClickOrder,d,f,E,o.length,g,O,p,n]),V=()=>{E>=o.length-1&&f(C),w("score"),n({type:"puzzleAction",action:"resolve",payload:{element:T,rewards:D.resolve.rewards,finish:E+1>=o.length}})};React$2.useEffect(()=>{t({...D,hintId:T})},[D,T,t]),React$2.useEffect(()=>{y&&E!==o.length-1&&G([],!0)},[E,o.length,y,G]);const W=()=>{const ee=k.hasClickOnce?k.areas.length:1;A.current+=ee,f(d+ee)};return jsxRuntimeExports.jsx(ImageClickWrapperComponent,{...k,puzzle:{name:T,component:"chained-image-click-puzzle"},specificFeedbacks:F,emitFinish:G,emitError:P,emitResolve:V,isLast:E+1===o.length,defaultCompleted:_[E]||!!y,hideContinue:E+1!==o.length,handleClick:W,emitEvent:n,disableExit:a,soundActions:u,setResolveAction:l,pause:h,keyboardControl:x},E)}function ChainedImageClickPuzzleComponent(o){const{setInfo:e,emitEvent:r,nodeId:t,list:n,description:a,soundActions:l,showFrames:u,disableExit:f,setResolveAction:d,keyboardControl:h}=o,[y,E]=React$2.useState(0),[p,_]=React$2.useState(0),[g,x]=React$2.useState({}),C=`chained-image-click-puzzle_${p}_${t}`,R=React$2.useMemo(()=>r({type:"loadObjectStatus",payload:C}),[r,C]),S=n.reduce((T,w)=>T+w.areas.length,0),A={list:n,description:a,nodeId:t,disableExit:f,setResolveAction:d,emitEvent:r,soundActions:l,setInfo:e,setSelected:E,selected:y,index:p,setIndex:_,slidesCompleted:g,setSlidesCompleted:x,loadPuzzleStatus:R,keyboardControl:h,totalCorrects:S};return jsxRuntimeExports.jsxs("div",{className:"puzzle--image__click",children:[u?jsxRuntimeExports.jsxs("div",{className:"puzzle-image__info",children:[jsxRuntimeExports.jsx("span",{className:"info-circle"}),jsxRuntimeExports.jsxs("span",{children:[y," / ",S]})]}):null,jsxRuntimeExports.jsx(CurrentImageClickPuzzle,{...A})]})}function CurrentFramePuzzle({list:o,index:e,puzzlesCompiledRef:r,framesCompleted:t,handleFinish:n,setRewards:a,setIndex:l,setFramesCompleted:u,loadPuzzleStatus:f,soundActions:d,setResolveAction:h,disableExit:y,description:E,translateFromParent:p,setInfo:_,emitEvent:g,nodeId:x,setSelected:C,selected:R,emitResetPuzzle:S,firstTryForFrame:A,setPuzzlesAutoCompleted:T,puzzlesAutoCompleted:w,emitOpenPopupCounterInfo:P,resetValues:O,setResetValues:k,pause:D,keyboardControl:F,totalCorrects:G}){var J;const[V]=d,W=o[e],{info:ee,specificFeedbacks:q}=W;ee.description=E;const z=React$2.useRef(0),U=React$2.useRef(0),$=`frame-image-click-puzzle_${e}_${x}`;React$2.useEffect(()=>{r.current+=1},[r]),React$2.useEffect(()=>{_({...ee,hintId:$})},[_,ee,$]),React$2.useEffect(()=>{O&&(U.current=0,z.current=0,C(0),k(!1))},[O,k,C]),React$2.useEffect(()=>{U.current=0,z.current=0},[e]);const I=React$2.useCallback((ne,ae=!1)=>{var se;let Z={...t};if(ae){if((se=q==null?void 0:q.correctFeedbacks)!=null&&se.length&&!W.hasClickOnce)U.current+=1;else{let oe=R;z.current&&(oe-=z.current),U.current=W.areas.length,w[0]&&Object.entries(t).length===0?C(U.current):C(oe+U.current)}U.current===W.areas.length&&(e+1>=o.length&&n(ne),Z={...Z,[e]:!0},u(Z),l(e+1>o.length-1?0:e+1)),a(ne)}else g({type:"addPoints",payload:ne,finish:!1}),g({type:"failPuzzle"}),W.hasClickOrder&&(C(R-U.current),U.current=0)},[t,(J=q==null?void 0:q.correctFeedbacks)==null?void 0:J.length,W.hasClickOnce,W.areas.length,W.hasClickOrder,a,R,w,C,e,o.length,u,l,n,g]),B=React$2.useCallback(()=>{e>=o.length-1&&C(G),V("score"),g({type:"hidePuzzleButtons",payload:!1}),T(ne=>({...ne,[e]:!0})),g({type:"puzzleAction",action:"resolve",payload:{element:$,rewards:ee.resolve.rewards,finish:e+1>=o.length}})},[e,o.length,V,g,T,$,ee.resolve.rewards,C,G]),X=React$2.useCallback(()=>{u({}),U.current=0,z.current=0,S()},[S,u]);React$2.useEffect(()=>{f&&e!==o.length-1&&I([],!0)},[t,e,o.length,f,I]);const Q=()=>{const ne=W.hasClickOnce?W.areas.length:1;z.current+=ne,C(R+ne)};return jsxRuntimeExports.jsx(ImageClickWrapperComponent,{...W,className:"puzzle-frame__canvas",puzzle:{name:"",component:"frame-click-puzzle"},specificFeedbacks:q,emitFinish:I,emitResolve:B,hideContinue:!0,disableInfo:r.current>1,defaultCompleted:t[e]||!!f,soundActions:d,setResolveAction:h,disableExit:y,translateFromParent:p,emitEvent:g,slideNumber:e,handleClick:Q,emitResetPuzzle:X,firstTryForFrame:A,puzzlesAutoCompleted:w,emitOpenPopupCounterInfo:P,pause:D,keyboardControl:F},e)}function Tooltip({emitEvent:o}){const e=r=>o({type:"translate",payload:r});return jsxRuntimeExports.jsx("div",{dir:"auto",className:"puzzle-frame__info--tooltip",children:e("puzzles.counterTooltip")})}function Counter({current:o,total:e,tooltip:r,emitEvent:t}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[r?jsxRuntimeExports.jsx(Tooltip,{emitEvent:t}):null,jsxRuntimeExports.jsxs("div",{className:"puzzle-frame__info--frames",children:[jsxRuntimeExports.jsx("span",{className:"info-circle"}),jsxRuntimeExports.jsxs("span",{children:[o," / ",e]})]})]})}function FrameImageClickComponent({emitEvent:o,nodeId:e,list:r,description:t,showFrames:n,soundActions:a,disableExit:l,setResolveAction:u,setInfo:f,pause:d,keyboardControl:h}){const[y,E]=React$2.useState({}),p=React$2.useRef([]),[_,g]=React$2.useState(0),[x,C]=React$2.useState({}),[R,S]=React$2.useState(0),A=React$2.useRef(0),[T,w]=React$2.useState(!0),[P,O]=React$2.useState(!0),[k,D]=React$2.useState(!1),F=r.reduce((B,X)=>B+X.areas.length,0),G=B=>{p.current=[...p.current,...B]},V=`frame-image-click-puzzle_${_}_${e}`,W=React$2.useMemo(()=>o({type:"loadObjectStatus",payload:V}),[o,V]),ee=React$2.useCallback(B=>{o({type:"addPoints",complex:!0,finish:!0,payload:[...p.current,...B]}),o({type:"passPuzzle"})},[o]),q=React$2.useCallback(()=>{O(!1),p.current=[],S(0),g(0),C({}),w(!0),D(!0)},[]),z=B=>o({type:"translate",payload:B}),U=()=>{w(!0)},I={firstTryForFrame:P,list:r,description:t,index:_,puzzlesCompiledRef:A,framesCompleted:x,handleFinish:ee,setRewards:G,accRewards:p,setSelected:S,selected:R,setIndex:g,setFramesCompleted:C,loadPuzzleStatus:W,soundActions:a,setResolveAction:u,disableExit:l,translateFromParent:z,setInfo:f,emitEvent:o,nodeId:e,emitResetPuzzle:q,resetValues:k,setResetValues:D,setPuzzlesAutoCompleted:E,puzzlesAutoCompleted:y,emitOpenPopupCounterInfo:()=>{_===0&&w(!1)},pause:d,keyboardControl:h,totalCorrects:F};return jsxRuntimeExports.jsxs("div",{className:"puzzle-frame",children:[jsxRuntimeExports.jsx(CurrentFramePuzzle,{...I}),jsxRuntimeExports.jsxs("div",{className:"puzzle-frame__content",children:[jsxRuntimeExports.jsx("div",{className:"puzzle-frame__controls",children:jsxRuntimeExports.jsx("div",{className:"puzzle-frame__progress",children:jsxRuntimeExports.jsx("div",{style:{width:`${R/F*100}%`},className:"puzzle-frame__progress--handle"})})}),n?jsxRuntimeExports.jsx("button",{disabled:T,"aria-hidden":T,type:"button",className:"puzzle-frame__info",onClick:U,children:jsxRuntimeExports.jsx(Counter,{current:R,total:F,tooltip:!T,emitEvent:o})}):null]})]})}FrameImageClickComponent.defaultProps={description:"",context:{},nodeId:0,showFrames:!1};function EditButton({action:o,className:e}){return jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,"aria-label":`${o} edit button`,onKeyUp:()=>{},className:`puzzle--webBuilder__edit ${e}`,onClick:o,children:jsxRuntimeExports.jsx("span",{className:"icon-fb-edit"})})}EditButton.defaultProps={action:()=>{},className:""};const path="https://min.gamelearn.io/css-resources/gamelearn/resources/",imagesOptions=[{name:"webbuilder.imageOptions.image1",src:"Amor.jpg"},{name:"webbuilder.imageOptions.image2",src:"Bancorp.svg"},{name:"webbuilder.imageOptions.image3",src:"Amanda.jpg"},{name:"webbuilder.imageOptions.image4",src:"keyboard.jpg"},{name:"webbuilder.imageOptions.image5",src:"Melanie.jpg"},{name:"webbuilder.imageOptions.image6",src:"Sharon.jpg"},{name:"webbuilder.imageOptions.image7",src:"Bankex.svg"},{name:"webbuilder.imageOptions.image8",src:"Futbol.jpg"},{name:"webbuilder.imageOptions.image9",src:"GBL.svg"},{name:"webbuilder.imageOptions.image10",src:"Fooder.jpg"},{name:"webbuilder.imageOptions.image11",src:"Corporate.jpg"},{name:"webbuilder.imageOptions.image12",src:"Bank of Zamunda.svg"},{name:"webbuilder.imageOptions.image13",src:"mindfullness.jpg"},{name:"webbuilder.imageOptions.image14",src:"Nature.jpg"},{name:"webbuilder.imageOptions.image15",src:"Shopper.jpg"},{name:"webbuilder.imageOptions.image16",src:"Lab.jpg"}],colorOptions=["#c66a46","#3c9dc0","#6236ff","#21254f"],colorOptions2=["#39b7b9","#25a1d4","#f5a623","#080269"],titleOptions=[{title:"webbuilder.bank.titleOptions.title1.text",desc:"webbuilder.bank.titleOptions.title1.description"},{title:"webbuilder.bank.titleOptions.title2.text",desc:"webbuilder.bank.titleOptions.title2.description"},{title:"webbuilder.bank.titleOptions.title3.text",desc:"webbuilder.bank.titleOptions.title3.description"},{title:"webbuilder.bank.titleOptions.title4.text",desc:"webbuilder.bank.titleOptions.title4.description"},{title:"webbuilder.bank.titleOptions.title5.text",desc:"webbuilder.bank.titleOptions.title5.description"}],bankProps={backgroundImage:imagesOptions[10].src,backgroundLogo:imagesOptions[11].src,backgroundColor:"#21254f",btnColor:"#25a1d4"},BankTemplate={header:{color:bankProps.backgroundColor,logo:bankProps.backgroundLogo},body:{bankTitle:titleOptions[0].title,bankDesc:titleOptions[0].desc,bgImage:bankProps.backgroundImage,btnColor:bankProps.btnColor}};function BankHeader({showingReference:o,usingTemplate:e,openPopup:r,onSave:t,header:n,translate:a}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[o?jsxRuntimeExports.jsx("div",{className:"bank--edit__logo",children:jsxRuntimeExports.jsx("img",{src:path+e.header.logo,alt:"",title:""})}):jsxRuntimeExports.jsxs("div",{className:"bank--edit__logo",children:[n.logo?jsxRuntimeExports.jsx("img",{src:path+n.logo,alt:"",title:""}):jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx("b",{children:a("webbuilder.bank.header.title")}),jsxRuntimeExports.jsx("b",{children:a("webbuilder.bank.header.logo")})]}),jsxRuntimeExports.jsx(EditButton,{action:()=>r("PopupImageComponent",{text:"Documents",images:imagesOptions,onSave:l=>t({logo:l})})})]}),jsxRuntimeExports.jsxs("div",{className:"flex align-center",children:[jsxRuntimeExports.jsxs("ul",{className:"bank--navigation",children:[jsxRuntimeExports.jsx("li",{className:"bank-navigation__item",children:a("webbuilder.bank.header.account")}),jsxRuntimeExports.jsx("li",{className:"bank-navigation__item",children:a("webbuilder.bank.header.invest")}),jsxRuntimeExports.jsx("li",{className:"bank-navigation__item",children:a("webbuilder.bank.header.loans")}),jsxRuntimeExports.jsx("li",{className:"bank-navigation__item",children:a("webbuilder.bank.header.mortgage")})]}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>r("PopupColorComponent",{colors:colorOptions,onSave:l=>t({color:l})})})]})]})}BankHeader.defaultProps={showingReference:!1,usingTemplate:{},openPopup:()=>{},onSave:()=>{},header:{}};BankHeader.propTypes={showingReference:PropTypes.bool,usingTemplate:PropTypes.shape({}),openPopup:PropTypes.func,onSave:PropTypes.func,header:PropTypes.shape({})};function FacebookHeader({showingReference:o,usingTemplate:e,header:r,translate:t}){const n=o?e.header.userImage:r.userImage,a=o?e.header.username:r.username;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"facebook--header__logo",children:jsxRuntimeExports.jsx("span",{className:"icon-fb-logo"})}),jsxRuntimeExports.jsxs("span",{className:"facebook--header__user",children:[jsxRuntimeExports.jsx("span",{className:"facebook--header__user--circle",style:{backgroundImage:`url(${path+n})`}}),jsxRuntimeExports.jsx("span",{className:"facebook--header__user--text",children:t(a||"webbuilder.facebook.header.userName")})]})]})}FacebookHeader.defaultProps={showingReference:!1,usingTemplate:{},header:{}};function WebBuilderHeader(o){const{isFacebook:e,header:r,showingReference:t,usingTemplate:n}=o,a=t?n.header.color:r.color;return jsxRuntimeExports.jsx("div",{className:`puzzle--webBuilder__header ${e?"":"bank"}`,style:e?{}:{backgroundColor:`${a}`},children:jsxRuntimeExports.jsx("div",{className:`${e?"facebook":"bank"}--header`,children:e?jsxRuntimeExports.jsx(FacebookHeader,{...o}):jsxRuntimeExports.jsx(BankHeader,{...o})})})}WebBuilderHeader.defaultProps={isFacebook:!1,showingReference:!1,usingTemplate:{},header:{}};WebBuilderHeader.propTypes={isFacebook:PropTypes.bool,showingReference:PropTypes.bool,usingTemplate:PropTypes.shape({}),header:PropTypes.shape({})};const facebookProps={backgroundImage:imagesOptions[12].src,backgroundUser:imagesOptions[5].src},userOptions=["webbuilder.userOptions.user1","webbuilder.userOptions.user2","webbuilder.userOptions.user3"],workOptions=["webbuilder.workOptions.work1","webbuilder.workOptions.work2","webbuilder.workOptions.work3"],studiesOptions=["webbuilder.studiesOptions.study1","webbuilder.studiesOptions.study2","webbuilder.studiesOptions.study3"],mailOptions=["webbuilder.mailOptions.mail1","webbuilder.mailOptions.mail2","webbuilder.mailOptions.mail3"],homeOptions=["webbuilder.homeOptions.home1","webbuilder.homeOptions.home2","webbuilder.homeOptions.home3"],FacebookTemplate={header:{username:userOptions[1],userImage:facebookProps.backgroundUser,bgImage:facebookProps.backgroundImage},body:{work:workOptions[2],home:homeOptions[1],studies:studiesOptions[0],mail:mailOptions[0]}};function WebBuilderFront({showingReference:o,usingTemplate:e,header:r,onSave:t,translate:n,openPopup:a}){const l=o?e.header.userImage:r.userImage,u=o?e.header.username:r.username,f=o?e.header.bgImage:r.bgImage;return jsxRuntimeExports.jsxs("div",{className:"puzzle--webBuilder__front",style:{backgroundImage:`url(${path+f})`},children:[jsxRuntimeExports.jsxs("div",{className:"facebook--user",children:[jsxRuntimeExports.jsx("span",{className:"facebook--user__circle",style:{backgroundImage:`url(${path+l})`},children:o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{a("PopupImageComponent",{images:imagesOptions,onSave:d=>t({userImage:d})})}})}),jsxRuntimeExports.jsx("span",{className:"facebook--user__text",children:n(u||"webbuilder.facebook.header.userName")}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{a("PopupTextComponent",{options:userOptions,onSave:d=>t({username:d})})}})]}),o?null:jsxRuntimeExports.jsx(EditButton,{className:"position--absolute right top",action:()=>{a("PopupImageComponent",{images:imagesOptions,onSave:d=>t({bgImage:d})})}})]})}WebBuilderFront.defaultProps={showingReference:!1,usingTemplate:{},openPopup:()=>{},onSave:()=>{},header:{}};WebBuilderFront.propTypes={showingReference:PropTypes.bool,usingTemplate:PropTypes.shape({}),openPopup:PropTypes.func,onSave:PropTypes.func,header:PropTypes.shape({})};function FacebookBody({showingReference:o,usingTemplate:e,body:r,onSave:t,openPopup:n,translate:a}){const l=o?e.body.work:r.work,u=o?e.body.studies:r.studies,f=o?e.body.home:r.home,d=o?e.body.mail:r.mail;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("ul",{className:"facebook--sidebar",dir:"auto",children:[jsxRuntimeExports.jsxs("li",{className:`facebook--sidebar__item ${l||o?"selected":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex align-center",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-work"}),jsxRuntimeExports.jsx("span",{className:"text",children:a(l||"webbuilder.facebook.body.work")})]}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupTextComponent",{options:workOptions,onSave:h=>t({work:h})})}})]}),jsxRuntimeExports.jsxs("li",{className:`facebook--sidebar__item ${u||o?"selected":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex align-center",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-education"}),jsxRuntimeExports.jsx("span",{className:"text",children:a(u||"webbuilder.facebook.body.studies")})]}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupTextComponent",{options:studiesOptions,onSave:h=>t({studies:h})})}})]}),jsxRuntimeExports.jsxs("li",{className:`facebook--sidebar__item ${f||o?"selected":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex align-center",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-home"}),jsxRuntimeExports.jsx("span",{className:"text",children:a(f||"webbuilder.facebook.body.home")})]}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupTextComponent",{options:homeOptions,onSave:h=>t({home:h})})}})]})]}),jsxRuntimeExports.jsxs("div",{className:"facebook--board",children:[jsxRuntimeExports.jsx("div",{className:"facebook--mail__label",children:"E-mail"}),jsxRuntimeExports.jsxs("div",{className:`facebook--mail__box ${d||o?"active":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex align-center",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-mail"}),jsxRuntimeExports.jsx("span",{className:"text",children:a(d||"webbuilder.facebook.body.email")})]}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupTextComponent",{options:mailOptions,onSave:h=>t({mail:h})})}})]}),jsxRuntimeExports.jsxs("div",{className:"facebook--tabs",children:[jsxRuntimeExports.jsxs("div",{className:"facebook--tabs__item",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-edit"}),a("webbuilder.facebook.body.editPost")]}),jsxRuntimeExports.jsxs("div",{className:"facebook--tabs__item",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-photo"}),a("webbuilder.facebook.body.editPhoto")]}),jsxRuntimeExports.jsxs("div",{className:"facebook--tabs__item",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-video"}),a("webbuilder.facebook.body.liveVideo")]}),jsxRuntimeExports.jsxs("div",{className:"facebook--tabs__item",children:[jsxRuntimeExports.jsx("span",{className:"icon-fb-events"}),a("webbuilder.facebook.body.facebookEvent")]})]}),jsxRuntimeExports.jsxs("div",{className:"facebook--thinking",children:[jsxRuntimeExports.jsxs("div",{className:"facebook--textarea",children:[jsxRuntimeExports.jsx("div",{className:"facebook--textarea__circle"}),jsxRuntimeExports.jsx("div",{className:"facebook--textarea__placeholder",children:a("webbuilder.facebook.body.think")})]}),jsxRuntimeExports.jsxs("div",{className:"facebook--chips",children:[jsxRuntimeExports.jsx("span",{className:"facebook--chips__item",children:a("webbuilder.facebook.body.photo")}),jsxRuntimeExports.jsx("span",{className:"facebook--chips__item",children:a("webbuilder.facebook.body.label")}),jsxRuntimeExports.jsx("span",{className:"facebook--chips__item",children:a("webbuilder.facebook.body.feeling")})]})]})]})]})}FacebookBody.defaultProps={showingReference:!1,usingTemplate:{},openPopup:()=>{},onSave:()=>{},body:{}};function BankBody({showingReference:o,usingTemplate:e,body:r,onSave:t,openPopup:n,translate:a}){const l=o?e.body.bgImage:r.bgImage,u=o?e.body.btnColor:r.btnColor,f=a(o?e.body.bankTitle:"webbuilder.bank.body.image.title"),d=a(o?e.body.bankDesc:"webbuilder.bank.body.image.description");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"bank--image__front",style:{backgroundImage:`url(${path+l})`},children:jsxRuntimeExports.jsxs("div",{className:"bank--image__text",children:[jsxRuntimeExports.jsx("span",{className:"title",children:r.bankTitle&&!o?a(r.bankTitle):f}),jsxRuntimeExports.jsx("span",{children:r.bankDesc&&!o?a(r.bankDesc):d}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupTextComponent",{options:titleOptions,onSave:h=>t({bankTitle:h.title,bankDesc:h.desc})})}}),o?null:jsxRuntimeExports.jsx(EditButton,{className:"position--absolute top right",action:()=>{n("PopupImageComponent",{images:imagesOptions,onSave:h=>t({bgImage:h})})}})]})}),jsxRuntimeExports.jsx("div",{dir:"auto",className:"bank--sidebar",children:jsxRuntimeExports.jsxs("div",{className:"bank--form",children:[jsxRuntimeExports.jsx("div",{className:"bank--form__title",children:a("webbuilder.bank.body.password.title")}),jsxRuntimeExports.jsxs("div",{className:"bank--form__group",children:[jsxRuntimeExports.jsx("div",{className:"bank--form__label",children:a("webbuilder.bank.body.password.current")}),jsxRuntimeExports.jsx("input",{disabled:!0,className:"bank--form__input",type:"password",placeholder:"********"}),jsxRuntimeExports.jsx("span",{className:"icon-circle-check"})]}),jsxRuntimeExports.jsxs("div",{className:"bank--form__group",children:[jsxRuntimeExports.jsx("div",{className:"bank--form__label",children:a("webbuilder.bank.body.password.new")}),jsxRuntimeExports.jsx("input",{disabled:!0,className:"bank--form__input",type:"password",placeholder:"********"}),jsxRuntimeExports.jsx("span",{className:"icon-circle-check"})]}),jsxRuntimeExports.jsxs("div",{className:"bank--form__group",children:[jsxRuntimeExports.jsx("div",{className:"bank--form__label",children:a("webbuilder.bank.body.password.confirm")}),jsxRuntimeExports.jsx("input",{disabled:!0,className:"bank--form__input",type:"password",placeholder:"********"}),jsxRuntimeExports.jsx("span",{className:"icon-circle-check"})]}),jsxRuntimeExports.jsxs("div",{className:"bank--form__buttons",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"bank--form__btn",style:{backgroundColor:`${u}`},children:a("webbuilder.save")}),o?null:jsxRuntimeExports.jsx(EditButton,{action:()=>{n("PopupColorComponent",{colors:colorOptions2,onSave:h=>t({btnColor:h})})}})]})]})})]})}function WebBuilderBody(o){const{isFacebook:e}=o;return jsxRuntimeExports.jsx("div",{className:`puzzle--webBuilder__body ${e?"":"bank"}`,children:e?jsxRuntimeExports.jsx(FacebookBody,{...o}):jsxRuntimeExports.jsx(BankBody,{...o})})}WebBuilderBody.defaultProps={isFacebook:!1};WebBuilderBody.propTypes={isFacebook:PropTypes.bool};function CurrentButton({translate:o,backActive:e,action:r}){return jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__topbar--buttons",children:jsxRuntimeExports.jsx("button",{type:"button",className:"puzzle--webBuilder__topbar--buttons__item",onClick:r,children:o(`webbuilder.${e?"return":"showReference"}`)})})}function WebBuilderTopBar({backActive:o,displayButton:e,clickAction:r,translate:t}){return jsxRuntimeExports.jsxs("div",{className:"puzzle--webBuilder__topbar",children:[e?jsxRuntimeExports.jsx(CurrentButton,{backActive:o,action:r,translate:t}):null,jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__title",children:"web builder 3.0"})]})}function FeedbackResult({onNext:o,success:e,showButton:r,translate:t}){const n=t(e?"webbuilder.feedback.successTitle":"webbuilder.feedback.failTitle"),a=t(e?"webbuilder.feedback.success":"webbuilder.feedback.fail");return jsxRuntimeExports.jsxs("div",{dir:"auto",className:`puzzle--webBuilder__feedback bottom ${e?"success":"failed"}`,style:e?{zIndex:"11"}:{},children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"title",children:n}),jsxRuntimeExports.jsx("div",{className:"description",children:a})]}),r?jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn gat--btn__secondary ${e?"green":"red"}`,onClick:o,style:{marginRight:"64px"},children:t("webbuilder.continue")}):null]})}FeedbackResult.defaultProps={onNext:()=>{},success:!1,showButton:!0};function PublishButton({onPublish:o,translate:e}){return jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,onKeyUp:()=>{},"aria-label":"publish",className:"position--absolute bottom center",onClick:o,children:jsxRuntimeExports.jsxs("div",{className:"gat--btn gat--btn__primary",children:[jsxRuntimeExports.jsx("span",{className:"icon-download-cloud"}),e("webbuilder.publish")]})})}PublishButton.defaultProps={onPublish:()=>{}};function PopupColorComponent({colors:o,onSave:e,closingAction:r,translate:t,soundActions:n}){const[a]=n,[l,u]=React$2.useState(),f=l===null;return jsxRuntimeExports.jsx("div",{className:"popup--layer",children:jsxRuntimeExports.jsxs("div",{className:"popup",children:[jsxRuntimeExports.jsx("div",{className:"popup--info",children:jsxRuntimeExports.jsx("span",{className:"popup--info__item",children:jsxRuntimeExports.jsxs("div",{className:"puzzle--webBuilder__colors",children:[jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__colors--title",children:jsxRuntimeExports.jsx("span",{children:t("webbuilder.colorSelect.title")})}),jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__colors--items",children:o.map(d=>jsxRuntimeExports.jsx("div",{className:`puzzle--webBuilder__color--select ${l===d?"selected":""}`,style:{borderColor:`${d}`},onClick:()=>u(d),children:jsxRuntimeExports.jsx("span",{style:{backgroundColor:`${d}`}})},d+Date.now()))})]})})}),jsxRuntimeExports.jsxs("div",{className:"popup--buttons",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__secondary",onClick:r,children:jsxRuntimeExports.jsx("span",{children:t("webbuilder.cancel")})}),jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn gat--btn__primary ${f?"disabled":""}`,onClick:f?null:()=>{a("click-ui"),e(l)},children:t("webbuilder.save")})]})]})})}PopupColorComponent.defaultProps={closingAction:()=>{},onSave:()=>{},colors:{}};PopupColorComponent.propTypes={closingAction:PropTypes.func,onSave:PropTypes.func,colors:PropTypes.arrayOf(PropTypes.string)};function PopupImageComponent({images:o,onSave:e,closingAction:r,translate:t,soundActions:n}){const[a]=n,[l,u]=React$2.useState(),f=!l;return jsxRuntimeExports.jsx("div",{className:"folder-popup",children:jsxRuntimeExports.jsxs("div",{className:"folder-popup__content",children:[jsxRuntimeExports.jsxs("div",{className:"folder-popup__header",children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsxs("div",{className:"folder-popup__title",children:[jsxRuntimeExports.jsx("span",{className:"folder-popup__icon-header icon-fb-search"}),jsxRuntimeExports.jsx("span",{children:t("webbuilder.imageSelect.title")})]}),jsxRuntimeExports.jsx("button",{onClick:r,className:"folder-popup__close",type:"button",children:jsxRuntimeExports.jsx("span",{className:"icon-close-fit"})})]}),jsxRuntimeExports.jsxs("div",{className:"folder-popup__body",children:[jsxRuntimeExports.jsx("div",{className:"folder-popup__scroll",children:jsxRuntimeExports.jsx("ul",{className:"folder-popup__list",children:o.map(d=>jsxRuntimeExports.jsxs("li",{className:"folder-item-file",children:[jsxRuntimeExports.jsx("div",{className:"folder-item-file__imagewrap",onClick:()=>u(d),onKeyUp:()=>{},role:"button",tabIndex:0,children:jsxRuntimeExports.jsx("img",{alt:d.src,src:path+d.src})}),jsxRuntimeExports.jsx("div",{className:"folder-item-file__title",title:d.src,children:d.src})]},d.src+Date.now()))})}),jsxRuntimeExports.jsxs("div",{className:"folder-popup__buttons",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__secondary",onClick:r,children:t("webbuilder.cancel")}),jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn gat--btn__primary ${f?"disabled":""}`,onClick:f?null:()=>{a("click-ui"),e(l.src)},children:t("webbuilder.open")})]})]})]})})}PopupImageComponent.defaultProps={closingAction:()=>{},onSave:()=>{},images:[]};function Selected({item:o,translate:e}){return o instanceof Object?e(o.title.toString()):jsxRuntimeExports.jsx("span",{children:e(o||"webbuilder.textSelect.title")})}function PopupTextComponent({closingAction:o,onSave:e,options:r,translate:t,soundActions:n}){const[a]=n,[l,u]=React$2.useState(""),f=l==="",[d,h]=React$2.useState(!1),y=d?"puzzle--webBuilder__select--item open":"puzzle--webBuilder__select--item",E=()=>{h(!d)};return jsxRuntimeExports.jsx("div",{className:"popup--layer",children:jsxRuntimeExports.jsxs("div",{className:"popup",children:[jsxRuntimeExports.jsx("div",{className:"popup--info",children:jsxRuntimeExports.jsx("span",{className:"popup--info__item",children:jsxRuntimeExports.jsxs("div",{className:"puzzle--webBuilder__select",children:[jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__select--label",children:jsxRuntimeExports.jsx("div",{dir:"auto",children:t("webbuilder.textSelect.title")})}),jsxRuntimeExports.jsxs("div",{dir:"auto",className:y,onClick:()=>E(),role:"presentation",children:[jsxRuntimeExports.jsx(Selected,{item:l,translate:t}),jsxRuntimeExports.jsx("span",{className:"icon-down-arrow"}),jsxRuntimeExports.jsx("div",{className:"puzzle--webBuilder__dropdown",children:r.map(p=>p instanceof Object?jsxRuntimeExports.jsxs("span",{role:"button",tabIndex:0,onKeyUp:()=>{},className:"puzzle--webBuilder__dropdown--option",onClick:()=>{u(p)},children:[jsxRuntimeExports.jsx("span",{children:t(p.title)}),jsxRuntimeExports.jsx("span",{className:"subtitle",children:t(p.desc)})]},p.title):jsxRuntimeExports.jsx("span",{role:"button",tabIndex:0,onKeyUp:()=>{},className:"puzzle--webBuilder__dropdown--option",onClick:()=>{u(p)},children:t(p)},p))})]})]})})}),jsxRuntimeExports.jsxs("div",{className:"popup--buttons",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__secondary",onClick:o,children:t("webbuilder.cancel")}),jsxRuntimeExports.jsx("button",{type:"button",className:`gat--btn gat--btn__primary ${f?"disabled":""}`,disabled:f,onClick:()=>{a("click-ui"),e(l)},children:t("webbuilder.save")})]})]})})}const POPUPS=Object.freeze(Object.defineProperty({__proto__:null,PopupColorComponent,PopupImageComponent,PopupTextComponent},Symbol.toStringTag,{value:"Module"})),defaultHeader={username:null,logo:null,userImage:null,bgImage:null,color:""},defaultBody={bankTitle:null,color:"",btnColor:"",work:null,home:null,mail:null,studies:null,bgImage:null};function PopupComponent({type:o,close:e,translate:r,soundActions:t,...n}){const a=POPUPS[o];return a?jsxRuntimeExports.jsx(a,{type:o,...n,closingAction:e,translate:r,soundActions:t}):null}function DisplayingFeedback({feed:o,resolved:e,translate:r,onNext:t}){return o==="success"?jsxRuntimeExports.jsx(FeedbackResult,{success:!0,showButton:!e,onNext:t,translate:r}):o==="failed"?jsxRuntimeExports.jsx(FeedbackResult,{onNext:t,translate:r}):null}function WebBuilderPuzzleComponent({type:o,info:e,emitEvent:r,setResolveAction:t,soundActions:n,disableExit:a,keyboardControl:l}){const[u,f]=React$2.useState(!1),[d,h]=React$2.useState(!1),[y,E]=React$2.useState(!1),[p,_]=React$2.useState(!1),[g,x]=React$2.useState(!1),[C,R]=React$2.useState(null),S=o==="facebook",A=S?FacebookTemplate:BankTemplate,[T,w]=React$2.useState({type:"",props:{}}),[P,O]=React$2.useState(defaultHeader),[k,D]=React$2.useState(defaultBody),[F]=n,G=Q=>r({type:"translate",payload:Q}),V=()=>{w({type:"",props:{}})},W=(Q,J={})=>{w({type:Q,props:J})},ee=()=>{if(e.solution){const{rewards:Q}=e.solution.right,{rewards:J}=e.solution.wrong;F(y?"fail":"score"),r({type:"addPoints",complex:!0,finish:!0,payload:y?J:Q}),r({type:"passPuzzle"})}};l(null,C==="success"?ee:null,C==="success"?ee:null);const q=(Q,J)=>{const ne=Object.keys(Q),ae={existing:0,equal:0};return ne.forEach(Z=>{J[Z]!==null&&J[Z]!==""&&(ae.existing+=1),Q[Z]===J[Z]&&(ae.equal+=1)}),ae},z=(Q,J)=>{const ne=Object.keys(A.header).length,ae=Object.keys(A.body).length,Z=q(A.header,Q),se=q(A.body,J),oe=se.existing+Z.existing===ne+ae,fe=se.equal+Z.equal===ne+ae;return{exist:oe,equal:fe}},U=()=>{F("click-ui");const{exist:Q,equal:J}=z(P,k);r({type:"hidePuzzleButtons",payload:!0}),Q&&!J?(g&&x(!1),R("failed"),E(!0),r({type:"failPuzzle"})):Q&&J&&(g&&(a(!1),x(!1)),_(!0),R("success"))},$=Q=>{if(Object.keys(Q).length>0){const J={...P,...Q};O(J),V();const{exist:ne}=z(J,k);x(!!ne)}},I=Q=>{if(Object.keys(Q).length>0){const J={...k,...Q};D(J),V();const{exist:ne}=z(P,J);x(!!ne)}};React$2.useEffect(()=>{t(Q=>{h(!0),R("success"),f(!1),setTimeout(()=>{R(""),Q()},4e3)}),a(!0)},[t,a,e.resolve.rewards,r]);const B={showingReference:u||d,isFacebook:S,openPopup:W,usingTemplate:A,translate:G},X=()=>{C==="failed"?(R(null),r({type:"hidePuzzleButtons",payload:!1})):C==="success"&&ee()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PopupComponent,{type:T.type,...T,close:V,soundActions:n,translate:G}),jsxRuntimeExports.jsxs("div",{className:"puzzle--webBuilder",children:[jsxRuntimeExports.jsx(WebBuilderTopBar,{backActive:u,displayButton:!d&&!p,translate:G,clickAction:()=>{F("click-ui"),f(!u)}}),jsxRuntimeExports.jsx(WebBuilderHeader,{...B,header:P,onSave:$}),S?jsxRuntimeExports.jsx(WebBuilderFront,{...B,header:P,onSave:$}):null,jsxRuntimeExports.jsx(WebBuilderBody,{...B,body:k,onSave:I})]}),!g&&!u?jsxRuntimeExports.jsx(DisplayingFeedback,{feed:C,onNext:X,resolved:d,translate:G}):null,g&&!u?jsxRuntimeExports.jsx(PublishButton,{onPublish:U,translate:G}):null]})}function Card({card:o,handleClick:e,flipped:r,cardIndex:t,wrongOrder:n}){const a=()=>!(o.img||o.text),l=()=>{const _=(o.img||{}).url;return jsxRuntimeExports.jsx("img",{src:_,alt:""})},u=()=>o.text?jsxRuntimeExports.jsx("div",{className:`card-selector-item__textbox ${o.img?"":"card-selector-item__textbox--noimage"}`,children:jsxRuntimeExports.jsx("div",{className:"card-selector-item__text",children:jsxRuntimeExports.jsx("span",{children:o.text||"_"})})}):null,f=()=>!!(r&&!o.correct||!r),d=()=>jsxRuntimeExports.jsx("div",{className:"card-selector-item__feedback card-selector-item__feedback--error",children:jsxRuntimeExports.jsx("div",{className:"card-selector-item__feedbackicon",children:jsxRuntimeExports.jsx("div",{className:"icon-error-circle-black"})})}),h=()=>o.order?jsxRuntimeExports.jsx("div",{className:"card-selector-item__order",children:jsxRuntimeExports.jsx("div",{children:o.order})}):null,y=()=>jsxRuntimeExports.jsxs("div",{className:"card-selector-item__feedback card-selector-item__feedback--success ",children:[h(),jsxRuntimeExports.jsx("div",{className:"card-selector-item__feedbackicon",children:jsxRuntimeExports.jsx("div",{className:"icon-check-circle-black"})})]}),E=()=>!a()&&r&&o.correct&&!n?y():!a()&&r?d():null;return jsxRuntimeExports.jsxs("button",{type:"button",order:o.order,onClick:()=>{!a()&&f()&&e(t)},className:`unset-button card-selector-item ${a()?"card-selector-item--empty":""}`,"aria-label":o.text?o.text:null,children:[l(),u(),E()]})}Card.defaultProps={handleClick:()=>{},documentsDict:{},card:{},flipped:!1,wrongOrder:!1,cardIndex:0};Card.propTypes={wrongOrder:PropTypes.bool,handleClick:PropTypes.func,cardIndex:PropTypes.number,flipped:PropTypes.bool,documentsDict:PropTypes.shape({}),card:PropTypes.shape({correct:PropTypes.bool,order:PropTypes.number,text:PropTypes.string,imgId:PropTypes.string,status:PropTypes.string})};function Board({cards:o,currentOrder:e,setCurrentOrder:r,handleError:t,feedbackIsShown:n,resolvePuzzle:a,soundActions:l,onFinish:u,handleSuccess:f,resolveWithAnyCard:d}){const[h,y]=React$2.useState(Array(o.length).fill(!1)),[E,p]=React$2.useState(Array(o.length).fill(!1)),[_,g]=React$2.useState(0),[x,C]=React$2.useState(!1),[R]=l,S=o.filter(F=>F.correct===!0).length,A=o.filter(F=>F.order).length>0,T=React$2.useCallback(()=>{y(Array(o.length).fill(!1)),p(Array(o.length).fill(!1)),g(0),r(1)},[o.length,r]),w=()=>{setTimeout(()=>{T()},1e3)};function P(F){const G=Array.from(h);G[F]=F,y(G)}const O=React$2.useCallback(()=>{const F=[];o.forEach((G,V)=>{G.correct===!0&&F.push(V)}),y(F)},[o]);React$2.useEffect(()=>{a&&O()},[O,a]),React$2.useEffect(()=>{(d&&_||_===S&&S>0)&&(u(),C(!0),g(0))},[_,u,S,d]);const k=F=>{P(F),f(o[F].id||null),g(_+1)},D=F=>{var G,V;if(!x&&!n)if(R("click-ui"),o[F].correct&&!A)k(F);else if(A)if(o[F].order===e)r(e+1),k(F);else{if(o[F].order!==e){const W=Array.from(E);W[F]=F,p(W),t(((G=o[F])==null?void 0:G.id)||null,o[F].correct),w()}P(F)}else t(((V=o[F])==null?void 0:V.id)||null),w(),P(F)};return jsxRuntimeExports.jsx("div",{className:`cards-selector__content cards-selector__content-${o.length}`,children:o&&o.map((F,G)=>jsxRuntimeExports.jsx(Card,{setCurrentOrder:r,card:F,handleClick:()=>D(G),flipped:h.includes(G),wrongOrder:E.includes(G),cardIndex:G},`cardPuzzle ${o.indexOf(F)}`))})}Board.defaultProps={setCurrentOrder:()=>{},handleError:()=>{},onFinish:()=>{},handleSuccess:()=>{},documentsDict:{},cards:[],currentOrder:1,resolvePuzzle:!1,feedbackIsShown:!1,resolveWithAnyCard:!1};function CardsSelectorPuzzleComponent({emitEvent:o,info:e,cards:r,resolveWithAnyCard:t,specificFeedbacks:n,disableExit:a,setResolveAction:l,soundActions:u,backgroundImage:f,nodeId:d,keyboardControl:h}){var I,B;const[y,E]=React$2.useState(!1),[p,_]=React$2.useState(1),[g,x]=React$2.useState(!1),[C,R]=React$2.useState(!1),[S,A]=React$2.useState(!1),[T,w]=React$2.useState([]),[P,O]=React$2.useState(!1),[k,D]=React$2.useState(""),[F]=u,G=X=>o({type:"translate",payload:X}),V=`cards-selector-puzzle_${d}`,W=React$2.useCallback(X=>{x(!1),A(!1),o({type:"hidePuzzleButtons",payload:!1}),o({type:"addPoints",complex:!0,finish:!0,payload:X}),o({type:"passPuzzle"})},[o]),ee=React$2.useCallback(()=>{var ne,ae;o({type:"hidePuzzleButtons",payload:!0}),x(!0);const{rewards:X}=((ne=e==null?void 0:e.solution)==null?void 0:ne.right)||{},Q=((ae=n==null?void 0:n.correctFeedbacks)==null?void 0:ae.map(Z=>Z.rewards).flat())||[],J=[...T,...X,...Q];F("score"),W(J)},[T,W,o,(I=e==null?void 0:e.solution)==null?void 0:I.right,F,n==null?void 0:n.correctFeedbacks]),q=()=>{E(!0),e.solution.right.desc&&!(n!=null&&n.specificCorrectFeedbacks)&&D(e.solution.right.desc),A(!0)},z=()=>{g||y?ee():(x(!1),a(!1),A(!1),o({type:"hidePuzzleButtons",payload:!1})),D("")},U=X=>{if(R(!0),n!=null&&n.specificCorrectFeedbacks){const Q=n.correctFeedbacks.find(J=>J.id===X);Q!=null&&Q.desc&&(D(Q.desc),A(!0))}F("score"),o({type:"hidePuzzleButtons",payload:!0})},$=(X,Q=!1)=>{var J,ne;if(R(!1),Q)D((J=e.orderFeedback)==null?void 0:J.desc),A(!0),w([...T,...((ne=e.orderFeedback)==null?void 0:ne.rewards)||[]]);else if(n!=null&&n.specificWrongFeedbacks){const ae=n.wrongFeedbacks.find(Z=>Z.id===X);ae!=null&&ae.desc?(D(ae.desc),A(!0)):(A(!0),setTimeout(()=>{z(),o({type:"hidePuzzleButtons",payload:!1})},2e3)),w([...T,...(ae==null?void 0:ae.rewards)||[]])}else e.solution.wrong.desc?(D(e.solution.wrong.desc),A(!0)):(A(!0),setTimeout(()=>{z(),o({type:"hidePuzzleButtons",payload:!1})},3e3));a(!0),!(n!=null&&n.specificWrongFeedbacks)&&!Q&&w([...T,...e.solution.wrong.rewards]),F("fail"),o({type:"hidePuzzleButtons",payload:!0}),o({type:"failPuzzle"})};return React$2.useEffect(()=>{y&&a(!0)},[a,y]),React$2.useEffect(()=>{l(()=>{var Q;o({type:"hidePuzzleButtons",payload:!0}),O(!0);const X=[...T,...((Q=e==null?void 0:e.resolve)==null?void 0:Q.rewards)||{}];setTimeout(()=>{x(!1),A(!1),o({type:"hidePuzzleButtons",payload:!1}),o({type:"puzzleAction",action:"resolve",payload:{element:V,rewards:X,finish:!0}})},2e3)})},[l,a,T,(B=e==null?void 0:e.resolve)==null?void 0:B.rewards,o,V]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:`cards-selector ${f!=null&&f.url?"cards-selector--with-custom-bg":""}`,style:f!=null&&f.url?{backgroundImage:`url("${f.url}")`}:{},children:jsxRuntimeExports.jsx(Board,{setCurrentOrder:_,currentOrder:p,cards:r,onFinish:q,resolveWithAnyCard:t,handleError:$,feedbackIsShown:S,resolvePuzzle:P,soundActions:u,handleSuccess:U})}),S&&jsxRuntimeExports.jsx(FeedbackComponent$1,{success:g||C,text:k,hasTimeout:!k,translate:G,functionOnClose:z,keyboardControl:h})]})}CardsSelectorPuzzleComponent.defaultProps={cards:[],info:{},resolveWithAnyCard:!1,backgroundImage:{url:""}};function Fakecursor(){return jsxRuntimeExports.jsx("span",{className:"fakecursor",children:"|"})}function FixedComponent({delay:o,index:e,length:r,textToPrint:t,setDoneTyping:n,nextParagraphType:a,isWriting:l}){const[u,f]=React$2.useState(!0),[d,h]=React$2.useState(""),[y,E]=React$2.useState(!1);React$2.useEffect(()=>{E(e===r-1)},[e,r]);const p=C=>{if(!C||!C.length)return"";const R=C.replace(/<script.*?>.*?<\/script>/gim,""),S=document.createElement("DIV");return S.innerHTML=R,S.textContent||S.innerText||""};React$2.useEffect(()=>{const C=()=>{const S=t.trim().split(" ");return R(S,S.length-1).join(" ")},R=(S,A)=>{if(A<0)return[""];const T=[...S];if(p(S[A]).length!==0){const w=S[A];return T[A]=`<span class="lastWord" >${w}</span>`,T}return R(S,A-1)};a==="election"?h(C()):setTimeout(()=>{h(t)},200)},[a,t]);const _=()=>{n(!0),f(!1)},g=t.split("<p>");g.shift();const x=g.length>1;return u&&t!==""&&d!==""?jsxRuntimeExports.jsx("span",{className:`writer-inline ${x?"multiple":""} ${y?"Typist":""}`,"data-testid":`result-${e}`,children:jsxRuntimeExports.jsx(Typist,{startDelay:300,avgTypingDelay:o,stdTypingDelay:10,onCharacterTyped:l,onTypingDone:_,cursor:{hideWhenDone:!0,hideWhenDoneDelay:200},blink:!0,children:HTMLReactParser$1(t)})}):jsxRuntimeExports.jsxs("span",{className:`writer-inline ${x?"multiple":""} ${y?"Typist":""}`,"data-testid":`result-${e}`,children:[HTMLReactParser$1(d),a==="election"&&y&&jsxRuntimeExports.jsx(Fakecursor,{})]})}FixedComponent.defaultProps={delay:0,textToPrint:"",setDoneTyping:()=>{},nextParagraphType:"",isWriting:()=>{}};function SingleElection({option:o,decisionInspected:e,setCurrentDecisionSelected:r,index:t,setCurrentDecisionInspected:n,soundActions:a}){const[l]=a,u=E=>E.previewText!==""?HTMLReactParser$1(E.previewText):HTMLReactParser$1(E.fullText),f=E=>E.previewText!==""?e===t?"icon-eye inspected":"icon-eye":"",d=()=>{l("click-ui"),r(t)},h=E=>{E.keyCode===13&&y(E)},y=E=>{E.preventDefault(),E.stopPropagation(),e===t?(E.target.style.background="",n("")):n(t)};return jsxRuntimeExports.jsxs("div",{className:"single-election",children:[jsxRuntimeExports.jsxs("button",{className:"single-election__cta",type:"button",onClick:()=>d(),children:[jsxRuntimeExports.jsx("div",{className:"single-election__btn",children:jsxRuntimeExports.jsx("span",{children:u(o)})}),jsxRuntimeExports.jsx("div",{onClick:y,onKeyDown:h,className:f(o),"aria-label":"Inspect",role:"button",tabIndex:0})]}),e===t&&jsxRuntimeExports.jsx("div",{className:"single-election__complete",children:jsxRuntimeExports.jsx("div",{children:HTMLReactParser$1(o.fullText)})})]})}SingleElection.defaultProps={setCurrentDecisionSelected:()=>{},setCurrentDecisionInspected:()=>{},option:{},index:0};function SingleElectionRender({decisionInspected:o,opt:e,index:r,setCurrentDecisionSelected:t,setCurrentDecisionInspected:n,soundActions:a}){return e&&e.fullText&&e.fullText!==""?jsxRuntimeExports.jsx(SingleElection,{decisionInspected:o,setCurrentDecisionSelected:t,setCurrentDecisionInspected:n,option:e,soundActions:a,index:r}):null}function ElectionComponent({textWithOpts:o,setCurrentDecisionSelected:e,printed:r,soundActions:t}){const[n,a]=React$2.useState("");return React$2.useEffect(()=>{r()},[r]),jsxRuntimeExports.jsx("div",{className:`elections-box pos${n+1}-${o.filter(l=>!!l.fullText).length}`,children:o&&o.map((l,u)=>jsxRuntimeExports.jsx(SingleElectionRender,{opt:l,soundActions:t,index:u,setCurrentDecisionSelected:e,setCurrentDecisionInspected:a,decisionInspected:n},u))})}ElectionComponent.defaultProps={textWithOpts:[],setCurrentDecisionSelected:()=>{},printed:()=>{}};function FeedbackElement({decision:o}){const{title:e,body:r}=o.feedback;return jsxRuntimeExports.jsx("div",{children:r!==""&&jsxRuntimeExports.jsxs("div",{className:"writer-feedback-decision-item",children:[e&&jsxRuntimeExports.jsxs("div",{dir:"auto",className:"writer-feedback-decision-item__title",children:[e," "]}),r&&jsxRuntimeExports.jsxs("div",{dir:"auto",className:"writer-feedback-decision-item__message",children:[o.correct?jsxRuntimeExports.jsx("span",{className:"icon-check-circle-black color--success"}):jsxRuntimeExports.jsx("span",{className:"icon-error-circle-black color--error"}),jsxRuntimeExports.jsx("span",{children:r})]})]})})}FeedbackElement.defaultProps={decision:{}};function FeedbackComponent({emitEvent:o,closingAction:e,feedbackIsDone:r,decisionsList:t,texts:n,retryAction:a,retry:l,skip:u,checkCorrect:f,rewardsStack:d,setFailed:h,soundActions:y}){const[E]=y,p=g=>o({type:"translate",payload:g}),_=()=>{E("click-ui"),e(),h(),r()};return jsxRuntimeExports.jsxs("div",{className:`writer-feedback ${d.length?"":"start"}`,children:[jsxRuntimeExports.jsx("div",{className:"writer-feedback__title",children:p("puzzles.feedback")}),jsxRuntimeExports.jsx("div",{className:"writer-feedback__decisions",children:t.map(g=>n[g.currenTextParagraph].electionTexts[g.index].feedback.body?jsxRuntimeExports.jsx(FeedbackElement,{decision:n[g.currenTextParagraph].electionTexts[g.index]},g.index):null)}),jsxRuntimeExports.jsxs("div",{className:"writer-feedback__btns",children:[u&&jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__secondary writer-feedback__btn-mobile",onClick:()=>{_()},children:p("puzzles.skip")}),l&&jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary writer-feedback__btn-mobile",onClick:()=>{f()?_():(E("click-ui"),a())},children:p(f()?"puzzles.continue":"puzzles.retry")}),!l&&jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary writer-feedback__btn-mobile",onClick:()=>_(),children:p("puzzles.continue")})]})]})}FeedbackComponent.defaultProps={emitEvent:()=>{},closingAction:()=>{},feedbackIsDone:()=>{},decisionsList:[],texts:[],retryAction:()=>{},retry:!1,skip:!1,checkCorrect:()=>{},nodeId:"0"};function FinishedTextComponent({textToPrint:o,correct:e}){const r=o.split("<p>");r.shift();const t=r.length>1;return jsxRuntimeExports.jsx("span",{className:`writer-inline ${t?"multiple":""} ${e}`,children:HTMLReactParser$1(o)})}FinishedTextComponent.defaultProps={correct:"",textToPrint:""};function WriterPuzzleComponent({emitEvent:o,styles:e,nodeId:r,retry:t,skip:n,type:a,info:l,setResolveAction:u,documentTitle:f,documentTitle_labelId:d,texts:h,soundActions:y,backgroundImage:E}){const p=Ge=>o({type:"translate",payload:Ge}),_=React$2.useRef(),[g,x]=React$2.useState(!1),[C,R]=React$2.useState(!1),[S,A]=React$2.useState(0),[T,w]=React$2.useState({[`text_${S}`]:{...h[S],id:`text_${S}`,correct:""}}),[P,O]=React$2.useState(!1),[k,D]=React$2.useState([]),[F,G]=React$2.useState(!1),[V,W]=React$2.useState(!1),[ee,q]=React$2.useState(!1),[z,U]=React$2.useState(!0),[$,I]=React$2.useState([]),[B,X]=React$2.useState(!0),[Q]=y,J=React$2.useRef({}),ne=Ge=>{let Ze;return Ge.electionTexts.forEach((rt,qt)=>{rt.correct&&(Ze=qt)}),Ze},ae=React$2.useCallback(Ge=>k.filter(rt=>rt.currenTextParagraph===Ge)[0].fullText_labelId,[k]),Z=React$2.useCallback(()=>h.map((Ge,Ze)=>{if(Ge.type==="fixed")return Ge.fullText_labelId??Ge.fullText;if(Ge.type==="election"){const rt=ne(Ge);return rt>=0?Ge.electionTexts[rt].fullText_labelId:ae(Ze)}return""}),[ae,h]),se=12,oe=()=>{if(k){const Ge=k.length;let Ze=0;for(let rt=0;rt<Ge;rt+=1)k[rt].isCorrect==="none"&&(Ze+=1);return Ze===Ge}return!0},fe=React$2.useCallback(()=>{if(k){const Ge=k.length;let Ze=0;for(let rt=0;rt<Ge;rt+=1)k[rt].isCorrect==="green"&&(Ze+=1);return Ze===Ge}return!0},[k]),de=()=>!!(k&&k.length),ce=()=>k.find(Ge=>{const{feedback:Ze}=h[Ge.currenTextParagraph].electionTexts[Ge.index];return Ze.body!==""}),Se=React$2.useCallback(()=>{const Ge=Z();o({type:"finishMedia",payload:{name:d,text:Ge,documentType:a,type:"text"}})},[Z,d,o,a]),Le=React$2.useCallback(Ge=>{const Ze=fe();Q(C?"fail":Ze?"score":"fail"),o({type:"addPoints",complex:!0,finish:!0,payload:Ge||$,onFinish:a!=="view"?Se:null}),o({type:"passPuzzle"})},[fe,o,C,Se,Q,$,a]);React$2.useEffect(()=>{g&&X(!1),u(()=>{Le(l.resolve.rewards)})},[o,Le,g,Se,l.resolve.rewards,u,a]);const Ne=()=>{x(!1),A(0),D([]),I([]),R(!1),q(!1),O(!1),W(!1),G(!1),w({text_0:{...h[0],id:"text_0",correct:""}}),U(!0),o({type:"addPoints",complex:!0,finish:!1,payload:$}),o({type:"failPuzzle"})},He=()=>{de()?oe()&&(G(!0),Le()):(G(!0),q(!0),Le()),F?(U(!1),ee&&!V?W(!0):(V||!ee&&!V)&&(!ee&&!V&&t?fe()?Le():Ne():Le())):(G(!0),ce()&&q(!0))},Ke=()=>{const Ge=h[S].electionTexts.filter(rt=>rt.correct).length,Ze=h[S].electionTexts;return Ge===0||Ge===Ze},Qe=Ge=>{const Ze=h[S].electionTexts[Ge],rt=Ze.feedback.rewards;rt&&rt[0]&&rt[0].points&&(J.current[`t${S}_e${Ge}`]||(Ze.correct&&(J.current[`t${S}_e${Ge}`]=!0),I([...$,...rt])));const qt=()=>Ke()?"none":Ze.correct?"green":"red",We={currenTextParagraph:S,fullText:Ze.fullText,index:Ge,isCorrect:qt()};w({...T,[`text_${S}`]:{type:"fixed",fullText:Ze.fullText,correct:We.isCorrect}}),D([...k,We])},dt=()=>{_.current.scrollTop=_.current.scrollHeight+100},yt=()=>{if(_.current.querySelector(".wrapfixed").offsetHeight>_.current.offsetHeight){const Ge=_.current.querySelector(".wrapfixed").offsetHeight;_.current.scrollTo({top:Ge,behavior:"smooth"})}},ut=(Ge,Ze,rt)=>{const qt=Ge.fullText,We=h[rt+1]?h[rt+1].type:"",at=T[`text_${rt+1}`]&&T[`text_${rt+1}`].type?T[`text_${rt+1}`].type:We;return jsxRuntimeExports.jsx(FixedComponent,{length:Ze,doneTyping:P,index:rt,delay:se,setDoneTyping:O,nextParagraphType:at,isWriting:yt,textToPrint:qt},rt.toString())},ft=(Ge,Ze)=>{const rt=Ge.fullText;return jsxRuntimeExports.jsx(FinishedTextComponent,{textToPrint:rt,correct:Ge.correct},Ze)},Xt=Ge=>jsxRuntimeExports.jsx(ElectionComponent,{soundActions:y,textWithOpts:Ge.electionTexts,setCurrentDecisionSelected:Qe,printed:dt,disableExit:B},Ge.electionTexts),kt=(Ge,Ze,rt)=>Ge.type==="fixed"?ut(Ge,Ze,rt):Xt(Ge);return React$2.useEffect(()=>{P===!0&&(()=>{h[S+1]?(w({...T,[`text_${S+1}`]:{...h[S+1],id:`text_${S+1}`,correct:""}}),A(S+1),O(!1)):x(!0)})()},[P,S,T,h]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`writer-puzzle writer-puzzle--${e}`,style:E!=null&&E.url?{backgroundImage:`url("${E.url}")`}:{},children:jsxRuntimeExports.jsxs("div",{className:"writer-puzzle__overlay",children:[V&&jsxRuntimeExports.jsx(FeedbackComponent,{emitEvent:o,texts:h,setFailed:()=>R(!0),decisionsList:k,closingAction:He,retry:t,skip:n,checkCorrect:fe,retryAction:Ne,rewardsStack:$,nodeId:r,soundActions:y}),!V&&jsxRuntimeExports.jsxs("div",{className:"writer-puzzle__container",children:[jsxRuntimeExports.jsx("div",{dir:"auto",className:"writer-puzzle__title",children:f!==""&&f}),jsxRuntimeExports.jsx("div",{className:"writer-puzzle__body",dir:LangIsRtl()?"rtl":"auto",children:jsxRuntimeExports.jsxs("div",{className:"writer-puzzle__scroll",tabIndex:0,style:{overflowX:"hidden",padding:"0 0 20px 0",height:"95%"},ref:_,children:[jsxRuntimeExports.jsx("div",{className:"wrapfixed",children:z&&!F&&Object.values(T).map((Ge,Ze)=>kt(Ge,Object.values(T).length-1,Ze))}),F&&Object.values(T).map((Ge,Ze)=>ft(Ge,Ze))]})}),g&&jsxRuntimeExports.jsx("div",{className:"writer-puzzle__footer",children:jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary",onClick:He,children:p("screens.continue")})})]})]})})})}WriterPuzzleComponent.defaultProps={emitEvent:()=>{},info:{},styles:"",nodeId:"0",retry:!1,skip:!1,type:"",documentTitle:"",texts:[]};function Image$1({document:o,name:e,isWallpaper:r}){const t=(o==null?void 0:o.url)||null;return jsxRuntimeExports.jsx("div",{className:`puzzle--terminal__image ${r?"puzzle--terminal__image--wallpaper":""}`,children:t?jsxRuntimeExports.jsx("img",{src:t,alt:e||""}):null})}const ICONS$1={image:"image-icon",video:"video-icon",embedded_video:"video-icon",pdf:"pdf-icon",terminal:"console-icon",cracker:"cracker-icon",folder:"folder-icon",world:"world-icon"};function Visor({file:o,solution:e,showContinue:r,info:t,resolvePuzzle:n,backFile:a,translate:l,soundActions:u,keyboardControl:f}){var R;const{fileId:d}=o,h=((R=o.document)==null?void 0:R.url)||"",[y]=u,E={image:{component:Image$1,props:{...o,url:h,soundActions:u}},video:{component:VideoVisor,props:{...o,url:h,endVideo:n,soundActions:u,translate:l}},embedded_video:{component:VideoVisor,props:{...o,url:h,soundActions:u}},pdf:{component:PdfVisor,props:{...o,url:h,translate:l,soundActions:u,emitNumberOfPages:()=>{},endPdf:()=>{},keyboardControl:f}},application:{component:PdfVisor,props:{...o,url:h,translate:l,soundActions:u,emitNumberOfPages:()=>{},keyboardControl:f,endPdf:()=>{}}}};if(!E[o.type])return null;const p=E[o.type].component,_=E[o.type].props,x=o.name.replace(/.jpg|.png|.pdf|.mp4/gi,""),C=e.fileId;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"puzzle--terminal__visor",children:[jsxRuntimeExports.jsx(FeedbackComponent$1,{playSound:y,shortText:!0,success:d===C,text:d===C?t.solution.right.desc:t.solution.wrong.desc,functionOnClose:d===C?n:a,additionalStyle:ICONS$1[o.type],secondText:x,translate:l,puzzleHeaderClass:"puzzle--terminal__visor--message",keyboardControl:f}),jsxRuntimeExports.jsx("div",{className:"puzzle--terminal__visor--body",children:jsxRuntimeExports.jsx(p,{..._})}),jsxRuntimeExports.jsx("div",{className:"puzzle--terminal__button",children:d===C&&r?jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary green",type:"button",onClick:n,children:l("screens.continue")}):null})]})})}const ICONS={image:"image-icon",video:"video-icon",embedded_video:"video-icon",pdf:"pdf-icon",terminal:"console-icon",cracker:"cracker-icon",folder:"folder-icon",application:"pdf-icon",world:"world-icon"};function Item({item:o,selectItem:e}){const r=o.name;return jsxRuntimeExports.jsx("li",{className:"puzzle--terminal__folder__list--item",children:jsxRuntimeExports.jsxs("button",{type:"button",title:r,className:`unset-button puzzle--terminal__item id-${o.id}`,onClick:()=>o.fixed?null:e(o),children:[jsxRuntimeExports.jsx("span",{className:`puzzle--terminal__icon ${ICONS[o.type]}`}),jsxRuntimeExports.jsx("span",{children:r})]})})}function FilesGroup({initFile:o,backFile:e,file:r,closeFolder:t,selectItem:n}){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:r.id==="init"?jsxRuntimeExports.jsx("ul",{className:"puzzle--terminal__folder__list desktop",children:r.children.map((a,l)=>jsxRuntimeExports.jsx(Item,{selectItem:n,item:a},`${`${l}${a.id}`}`))}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("ul",{className:"puzzle--terminal__folder__list desktop",children:o.children.map((a,l)=>jsxRuntimeExports.jsx(Item,{selectItem:n,item:a},`${l+a.id}`))}),jsxRuntimeExports.jsxs("div",{className:"puzzle--terminal__folder",children:[jsxRuntimeExports.jsxs("div",{className:"puzzle--terminal__folder--head",children:[jsxRuntimeExports.jsx("span",{role:"button",onKeyUp:()=>{},"aria-label":"back file",tabIndex:0,onClick:()=>e(),className:"puzzle--terminal__folder--back",children:jsxRuntimeExports.jsx("span",{className:"icon-back"})}),jsxRuntimeExports.jsx("span",{className:`puzzle--terminal__folder--head__icon ${ICONS[r.type]}`}),jsxRuntimeExports.jsx("span",{className:"text",children:r.name}),jsxRuntimeExports.jsx("span",{role:"button",tabIndex:0,"aria-label":"close folder",onKeyUp:()=>{},onClick:()=>t(),className:"puzzle--terminal__folder--close",children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})]}),jsxRuntimeExports.jsx("div",{className:"puzzle--terminal__folder--body",children:jsxRuntimeExports.jsx("ul",{className:"puzzle--terminal__folder__list",children:r.children.map((a,l)=>jsxRuntimeExports.jsx(Item,{selectItem:n,item:a},`${l+a.id}`))})})]})]})})}const DEFAULT_IMG="https://min.gamelearn.io/css-resources/gamelearn/resources/cosmos-bg-min.jpg",FIXED_ITEMS=[{fileId:"ids1",type:"world",fixed:!0,name:"Web builder 3.0"},{fileId:"ids2",type:"cracker",fixed:!0,name:"Decoder.exe"},{fileId:"ids3",type:"terminal",fixed:!0,name:"terminal"}];function TerminalPuzzleComponent({emitEvent:o,items:e,backgroundImage:r,solution:t,info:n,disableExit:a,soundActions:l,setResolveAction:u,nodeId:f,keyboardControl:d}){const[h,y]=React$2.useState({}),[E]=React$2.useState(!1),[p,_]=React$2.useState([]),g=React$2.useRef([]),[x]=l,C=k=>o({type:"translate",payload:k}),R=`terminal-puzzle_${f}`,S=React$2.useMemo(()=>({name:"init",children:[...FIXED_ITEMS,...e],id:"init"}),[e]),A=React$2.useCallback(k=>{x("click-ui"),y(k),_([...p,k]),k.type!=="folder"&&(o({type:"hidePuzzleButtons",payload:!0}),a(!0))},[p,a,o,x]);React$2.useEffect(()=>{y(S),_([S])},[S]),React$2.useEffect(()=>{u(()=>{g.current=[...g.current,...n.resolve.rewards];const k=g.current.map(D=>{var q;const{name:F,points:G,type:V,id:W}=D,ee={name:F,points:G,type:V,id:W};return(q=D==null?void 0:D.document)!=null&&q.resourceId&&(ee.id=D.document.resourceId),ee});o({type:"hidePuzzleButtons",payload:!1}),o({type:"puzzleAction",action:"resolve",payload:{element:R,rewards:k,finish:!0}})})},[u,n.resolve.rewards,o,R]);const T=()=>{g.current=[...g.current,...n.solution.wrong.rewards];const k=p.length-1,D=p.filter((F,G)=>k>G);y(p[k-1]),_(D),a(!1),o({type:"hidePuzzleButtons",payload:!1})},w=()=>{x("click-ui");const k=p[0];y(k),_([k])},P=()=>{g.current=[...g.current,...n.solution.right.rewards];const k=g.current.map(D=>{var q;const{name:F,points:G,type:V,id:W}=D,ee={name:F,points:G,type:V,id:W};return(q=D==null?void 0:D.document)!=null&&q.resourceId&&(ee.id=D.document.resourceId),ee});o({type:"hidePuzzleButtons",payload:!1}),x("score"),o({type:"addPoints",complex:!0,finish:!0,payload:k}),o({type:"passPuzzle"})},O=(r==null?void 0:r.url)||DEFAULT_IMG;return jsxRuntimeExports.jsx("div",{className:"puzzle--terminal",children:h.children?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Image$1,{isWallpaper:!0,document:{url:O}}),jsxRuntimeExports.jsx(FilesGroup,{backFile:T,initFile:S,selectItem:A,breadcrumb:p,closeFolder:w,file:h,translate:C})]}):jsxRuntimeExports.jsx(Visor,{soundActions:l,backFile:T,resolvePuzzle:P,info:n,showContinue:!E,solution:t,file:h,translate:C,keyboardControl:d})})}function DragItemPuzzleComponent({area:o,image:e,resolveObject:r,info:t,hasHighlights:n,consume:a,disableExit:l,emitEvent:u,soundActions:f,keyboardControl:d}){const{solution:h}=t,y=React$2.useRef(),E=React$2.useRef(),p=React$2.useRef(),_=React$2.useRef(),g=React$2.useRef({}),[x,C]=React$2.useState(""),[R,S]=React$2.useState(!1),[A,T]=React$2.useState(!1),[w,P]=React$2.useState(),[O]=React$2.useState(new window.Image),k=React$2.useRef([]),[D]=f,F=J=>u({type:"translate",payload:J});React$2.useEffect(()=>{l(x!=="")},[x,l]);const G=(J,ne)=>(J.x+J.width>ne.x&&J.x+J.width<=ne.x+ne.width||ne.x+ne.width>J.x&&ne.x+ne.width<=J.x+J.width)&&(J.y+J.height>ne.y&&J.y+J.height<=ne.y+ne.height||ne.y+ne.height>J.y&&ne.y+ne.height<=J.y+J.height),V=()=>{y&&n&&(y.current.to({duration:.25,opacity:.75}),E.current.to({duration:.25,opacity:.4}))},W=()=>{y&&n&&(y.current.to({duration:.25,opacity:0}),E.current.to({duration:.25,opacity:0}))},ee=React$2.useCallback(J=>{let ne=!1;if(J){const ae=p.current;ae.setPointersPositions(J);const Z=ae.getPointerPosition(),se=y.current.getClientRect({relativeTo:ae});ne=G({...Z,width:1,height:1},se)}return ne},[]),q=React$2.useCallback(J=>J&&r.uid===JSON.parse(J).uid,[r.uid]),z=React$2.useCallback(()=>{C(""),u({type:"hidePuzzleButtons",payload:!1}),u({type:"addPoints",complex:!0,finish:!0,payload:k.current}),u({type:"passPuzzle"}),a&&u({type:"consumeItem",payload:{uid:r.uid,targetId:r.uid,name:r.name}}),u({type:"closeUI",ui:"inventory"})},[a,u,r.name,r.uid]),U=React$2.useCallback(()=>{C("success"),u({type:"hidePuzzleButtons",payload:!0}),k.current=[...k.current,...h.right.rewards],setTimeout(()=>{z()},2e3)},[u,z,h.right.rewards]),$=React$2.useCallback(()=>{u({type:"openUI",ui:"inventory",onFinish:()=>{}}),C(""),u({type:"hidePuzzleButtons",payload:!1}),u({type:"failPuzzle"}),k.current=[...k.current,...h.wrong.rewards]},[u,h.wrong.rewards]),I=React$2.useCallback(J=>{const ne=J.dataTransfer.getData("item");p.current.setPointersPositions(J);const ae=ee(J);u({type:"hidePuzzleButtons",payload:!0}),ae&&q(ne)?(C("success"),u({type:"closeUI",ui:"inventory"}),t.solution.right.desc===""&&U()):(u({type:"closeUI",ui:"inventory"}),C("failed"),t.solution.wrong.desc===""&&setTimeout(()=>{$()},2e3))},[ee,q,u,U,$,t.solution.right.desc,t.solution.wrong.desc]),B=()=>{x==="success"?U():$()};React$2.useEffect(()=>{const J=e.img.url||"";O.src=J,O.onload=()=>{_.current&&(g.current={x:_.current.clientWidth/2,y:_.current.clientHeight/2,width:O.width,height:O.height,offsetX:O.width/2,offsetY:O.height/2,scale:{x:Math.min(_.current.clientWidth/O.width,_.current.clientHeight/O.height),y:Math.min(_.current.clientWidth/O.width,_.current.clientHeight/O.height)}},S(!0))}},[O,e.img.url]),React$2.useEffect(()=>{A||(u({type:"openUI",ui:"inventory",onFinish:()=>{}}),T(!0))},[A,u]);const X=J=>{J!==null&&(y.current=J)},Q=J=>{if(J!==null&&(E.current=J,y.current)){const{x:ne,y:ae,width:Z,height:se}=y.current.getClientRect();J.setAttr("x",ne),J.setAttr("y",ae),J.setAttr("height",se),J.setAttr("width",Z)}};return React$2.useLayoutEffect(()=>{if(y.current&&R){const J=y.current.getClientRect({relativeTo:y.current.getParent()});P({x:J.x+J.width/2,y:J.y+J.height/2})}},[R]),jsxRuntimeExports.jsxs("div",{className:"puzzle--drag__mask100",onDrop:I,onDragOver:J=>{J.preventDefault()},children:[jsxRuntimeExports.jsx("div",{className:"puzzle--drag__mask",children:jsxRuntimeExports.jsx("div",{ref:_,"data-testid":"mask_canvas",className:"puzzle--drag__mask--canvas",children:R?jsxRuntimeExports.jsx(Stage,{ref:p,width:_.current.clientWidth,height:_.current.clientHeight,children:jsxRuntimeExports.jsxs(Layer,{children:[jsxRuntimeExports.jsx(Image$2,{image:O,...g.current}),jsxRuntimeExports.jsxs(Group,{...g.current,children:[w?jsxRuntimeExports.jsx(Html,{transform:!0,groupProps:{id:"projection",...w},divProps:{style:{pointerEvents:"none"}},children:jsxRuntimeExports.jsx("div",{style:{width:"50px",height:"50px",pointerEvents:"none"},id:"object-area-projection"})}):null,jsxRuntimeExports.jsx(Line,{onMouseEnter:V,onMouseLeave:W,ref:X,...o,shape:"poly",fill:"#262a31d9",stroke:"white",strokeWidth:1,opacity:0,dash:[3,2],closed:!0,draggable:!1})]}),jsxRuntimeExports.jsx(Text,{onMouseEnter:V,onMouseLeave:W,ref:Q,text:F("puzzle.drag.dropzone"),fontSize:12,align:"center",verticalAlign:"middle",fill:"#ffffff",opacity:0})]})}):null})}),x!==""?jsxRuntimeExports.jsx(FeedbackComponent$1,{text:t.solution[x==="success"?"right":"wrong"].desc,success:x==="success",translate:F,playSound:D,functionOnClose:B,keyboardControl:d}):null]})}const LABELS_INDEX$1=["A","B","C","D","E","F","G","H","I","J"];function Questions({disabled:o,answered:e,question:r,updateForm:t,result:n,correctQuestions:a,translate:l}){const[u,f]=React$2.useState(!1),d=r.answers.filter(x=>x.text),h=x=>{let C=!1;return n[r.id].find(R=>R.id===x)&&(C=!0),C},y=x=>{let C="";return u?(e&&h(x.id)&&(C="selected"),o&&h(x.id)&&a.includes(x.id)&&(C="success"),o&&h(x.id)&&!a.includes(x.id)&&(C="failed")):(e&&x.id===n[r.id][0].id&&(C="selected"),o&&x.id===n[r.id][0].id&&(C=n[r.id][0].isCorrect?"success":"failed")),C},E=x=>{const C=y(x);return C==="selected"?"icon-check-circle-black color--selected":C==="success"?"icon-check-circle-black color--success":C==="failed"?"icon-error-circle-black color--error":""},p=x=>o&&x.feedback&&(u&&h(x.id)||x.id===n[r.id][0].id),_=(x,C)=>C===0?"tooltip--right__top":C===x.length-1?"tooltip--right__bottom":"tooltip--center__right",g=r.answers.filter(x=>x.isCorrect);return React$2.useEffect(()=>{g.length===1?f(!1):f(!0)},[g.length,u,r.answers]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"test--questions__item",children:jsxRuntimeExports.jsx("span",{children:r.text})}),u&&!o?jsxRuntimeExports.jsx("div",{className:"test--questions__intertitle test--questions__intertitle--multiresponse",children:l("tests.chooseMoreOneAnswer")}):null,d.map((x,C)=>jsxRuntimeExports.jsxs("div",{className:"test--response__fakeinput",children:[u?jsxRuntimeExports.jsx("input",{checked:e&&h(x.id),disabled:o&&!h(x.id),readOnly:o,type:"checkbox",id:x.id,onChange:()=>o?null:t(x,r.id,C,"isCheckbox",x.id)}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("input",{checked:e&&x.id===n[r.id][0].id,disabled:o&&!y(x),type:"radio",name:"name",id:x.id,onChange:()=>o?null:t(x,r.id,C,"isRadio")})}),jsxRuntimeExports.jsxs("label",{htmlFor:x.id,className:`test--response__item ${y(x)}`,children:[jsxRuntimeExports.jsx("div",{className:"test--response__index",children:LABELS_INDEX$1[C]}),jsxRuntimeExports.jsx("div",{className:"test--response__text",children:jsxRuntimeExports.jsx("span",{children:x.text})}),jsxRuntimeExports.jsx("div",{className:`test--response__icon ${E(x)}`})]}),o?jsxRuntimeExports.jsxs("div",{className:`test--feedback__info ${p(x)?"":"test--feedback__info--hidden"}`,children:[jsxRuntimeExports.jsx("span",{className:`icon-info2 ${y(x)==="success"?"color--success":"color--error"}`}),jsxRuntimeExports.jsxs("div",{id:`tooltipFeedback-${C}`,className:`tooltip ${_(d,C)}`,children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("b",{children:jsxRuntimeExports.jsx("span",{children:l("test.feedback")})})}),jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx("span",{children:x.feedback})})]})]}):null]},x.text))]})}const LABELS_INDEX=["A","B","C","D","E","F","G","H","I","J"];function FeedbackItem({selectedAnswers:o,correctQuestions:e,question:r,translate:t}){const n=u=>e.includes(u),a=(u,f)=>u.index<f.index?-1:u.index>f.index?1:0,l=o.sort(a);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"test--questions__item",children:jsxRuntimeExports.jsx("span",{children:r})}),l.map(u=>jsxRuntimeExports.jsxs("div",{className:"test--response__itemwrap",children:[jsxRuntimeExports.jsxs("div",{className:`test--response__item ${n(u.id)?"success":"failed"}`,children:[jsxRuntimeExports.jsx("div",{className:"test--response__index",children:LABELS_INDEX[u.index]}),jsxRuntimeExports.jsx("div",{className:"test--response__text",children:jsxRuntimeExports.jsx("span",{children:u.text})}),jsxRuntimeExports.jsx("div",{className:`test--response__icon ${n(u.id)?"icon-check-circle-black color--success":"icon-error-circle-black color--error"}`})]}),jsxRuntimeExports.jsxs("div",{className:"test--feedback",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("b",{children:jsxRuntimeExports.jsxs("span",{children:[t("test.feedback")," ",o.length>1?LABELS_INDEX[u.index]:""]})})}),jsxRuntimeExports.jsx("span",{children:u.feedback})]})]},u.text))]})}function Container({questions:o,setTime:e,saveInterval:r,result:t,setTries:n,tries:a,time:l,showResults:u,answered:f,answerPage:d,updateForm:h,disabled:y,translate:E,soundActions:p,paused:_,view:g,correctQuestions:x,feedbacksOnlyWhenReview:C}){const R=document.querySelector(".test--container"),[S,A]=React$2.useState(0),[T,w]=React$2.useState(),P=o[S].id,[O]=p;React$2.useEffect(()=>{if(l>=0&&!y&&!_){const q=setInterval(()=>{T||e(z=>z-1)},1e3);return r(q),()=>{clearInterval(q)}}},[y,T,_,r,e,l]);const k=()=>{R.scrollTo(0,0),O("click-ui"),f&&(t[P][0].feedback&&!y&&!C?w(!0):(d(!1),A(S+1)))},D=()=>{O("click-ui"),A(S-1)},F=()=>{R.scrollTo(0,0),o[S+1]?(w(!1),d(!1),A(S+1)):u()},G=()=>{R.scrollTo(0,0),n(a+1),t[P][0].feedback&&!y&&!C?w(!0):u()},V=Math.floor(l/60),W=l%60;React$2.useEffect(()=>{if(g==="review"){const q=t[`q${S}`][0].id,z=document.querySelector(`#${q}`);R.scrollTo(0,z.offsetTop)}},[S,R,t,g]);const ee=()=>{if(f){const q=x[o[S].id.substring(1)].answers,z=t[P],U=z.find(I=>I.isCorrect===!1);let $=0;return z.forEach(I=>{q.includes(I.id)&&($+=1)}),!U&&$===q.length}return!1};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[g==="review"||T?jsxRuntimeExports.jsx("div",{className:`test-feedback-header ${ee()?"success":"failed"}`,children:jsxRuntimeExports.jsxs("h2",{children:[jsxRuntimeExports.jsx("span",{className:`${ee()?"icon-correct-thumb":"icon-incorrect-thumb"}`}),jsxRuntimeExports.jsx("span",{className:"test-feedback-header__title",children:ee()?E("tests.resolvedQuestion"):E("tests.notResolvedQuestion")})]})}):null,jsxRuntimeExports.jsxs("div",{className:"test--questions",children:[jsxRuntimeExports.jsx("div",{className:"test--questions__container",children:T?jsxRuntimeExports.jsx(FeedbackItem,{selectedAnswers:t[P],correctQuestions:x[o[S].id.substring(1)].answers,question:o[S].text,translate:E}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"test--questions__intertitle",children:[jsxRuntimeExports.jsx("div",{children:LangIsRtl()?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[S+1,"/",o.length," ",jsxRuntimeExports.jsx("span",{children:E("tests.question")})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:E("tests.question")})," ",S+1,"/",o.length]})}),g!=="review"&&l>=0?jsxRuntimeExports.jsx("div",{dir:"ltr",className:`count-down ${l<10?"count-down--finalseconds":""}`,children:jsxRuntimeExports.jsxs("div",{id:"test-time",children:[V<10?`0${V}`:V," : ",W<10?`0${W}`:W]})}):null]}),jsxRuntimeExports.jsx(Questions,{result:t,disabled:y,answered:f,updateForm:h,question:o[S],correctQuestions:y?x[o[S].id.substring(1)].answers:[],translate:E},o[S].id)]})}),jsxRuntimeExports.jsxs("div",{className:`test--buttons ${g==="review"?"reviewmode":"next"}`,children:[g==="review"?jsxRuntimeExports.jsx("button",{disabled:S===0,id:"back-button",onClick:()=>D(),type:"button",className:`gat--btn__navigation ${S===0?"disabled":""}`,"aria-label":LangIsRtl()?E("survey.next"):E("survey.previous"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}):null,!T&&o[S+1]?jsxRuntimeExports.jsx("button",{disabled:!f,id:"next-button",onClick:()=>k(),type:"button",className:`gat--btn__navigation ${f?"":"disabled"}`,"aria-label":LangIsRtl()?E("survey.previous"):E("survey.next"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null,T?jsxRuntimeExports.jsx("button",{id:"next-button",onClick:()=>F(),type:"button",className:"gat--btn__navigation",children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null,!T&&o[S].id.substring(1)===(o.length-1).toString()?jsxRuntimeExports.jsx("button",{disabled:!f,id:"finish-button",onClick:()=>{O("click-ui"),f&&G()},type:"button",className:`gat--btn__navigation ${f?"":"disabled"}`,"aria-label":LangIsRtl()?E("survey.previous"):E("survey.next"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null]})]})]})}function ResultsComponent({result:o,time:e,mandatory:r,correctQuestions:t,isFirst:n,reviewTest:a,finishTest:l,restartTest:u,timeOver:f,timeOverText:d,emitEvent:h,minimumPercentage:y}){const[E,p]=React$2.useState(0),[_,g]=React$2.useState(),[x,C]=React$2.useState([]),[R,S]=React$2.useState([]),[A,T]=React$2.useState([]),w=React$2.useCallback(()=>{const z=[];return t.forEach(U=>z.push(U.answers)),z},[t]),P=React$2.useCallback(()=>{const z=[];return Object.values(o).forEach(U=>{if(U.length>1){const $=U.find(B=>B.isCorrect===!1),I=[];$?z.push([]):(U.forEach(B=>{B.isCorrect&&I.push(B.id)}),z.push(I))}else U[0].isCorrect?z.push([U[0].id]):U[0].isCorrect===!1&&z.push("")}),z},[o]),O=React$2.useCallback(()=>{let z=0;return R.length>0&&x.forEach((U,$)=>{U.length>1?U.every(I=>R[$].includes(I))&&(z+=1):U.length===1&&R[$]&&U[0]===R[$][0]&&(z+=1)}),z},[x,R]);React$2.useEffect(()=>{C(w),S(P),T(O)},[w,P,O]);const k=t.length,D=O()===k,F=A<y,G=A>=y,V=!r||G,W=Math.trunc(E/k*100),ee=(z,U)=>h({type:"translate",payload:z,values:U}),q={"--chart-color":"var(--color-error)"};return React$2.useEffect(()=>{if(E<A){const z=setInterval(()=>{p(U=>U+1)},100);return g(z),()=>{clearInterval(z)}}},[A,E]),React$2.useEffect(()=>{E>=A&&clearInterval(_)},[A,_,E]),jsxRuntimeExports.jsxs("div",{className:`test--results ${F||f?"test--results--failed":""}`,children:[n&&D?jsxRuntimeExports.jsxs("div",{className:"fireworks",children:[jsxRuntimeExports.jsx("div",{className:"before"}),jsxRuntimeExports.jsx("div",{className:"after"})]}):null,!f&&F?jsxRuntimeExports.jsx("div",{className:"test--results__title",children:jsxRuntimeExports.jsx("span",{children:ee("tests.NotFinishedSuccessfully")})}):null,!f&&G||D?jsxRuntimeExports.jsx("div",{className:"test--results__title",children:jsxRuntimeExports.jsx("span",{children:ee("tests.finishedSuccessfully")})}):null,f?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"test--results__title",children:jsxRuntimeExports.jsx("span",{children:d})}),jsxRuntimeExports.jsx("div",{className:"test--results__time",id:"results-time",children:jsxRuntimeExports.jsx("span",{children:ee("tests.time",e)})})]}):null,jsxRuntimeExports.jsxs("div",{className:`chart center chart${W}`,children:[jsxRuntimeExports.jsxs("div",{className:"chart-slice",children:[jsxRuntimeExports.jsx("div",{className:"chart-bar",style:F||f?q:{}}),jsxRuntimeExports.jsx("div",{className:"chart-fill",style:F||f?q:{}})]}),jsxRuntimeExports.jsxs("span",{className:"chart-value",children:[jsxRuntimeExports.jsxs("div",{className:"test--results__chart",children:[jsxRuntimeExports.jsx("span",{children:E}),jsxRuntimeExports.jsxs("span",{children:["/",k]})]}),jsxRuntimeExports.jsx("div",{className:"test--results__chart--label",children:jsxRuntimeExports.jsx("span",{children:ee("tests.success")})})]})]}),jsxRuntimeExports.jsxs("div",{className:"test--results__minimum",children:[jsxRuntimeExports.jsx("div",{className:"icon-bell"}),jsxRuntimeExports.jsx("div",{children:ee("tests.minimumQuestionsMessage",{minimumPercentage:y})})]}),jsxRuntimeExports.jsxs("div",{className:"test--results__buttons",children:[f?null:jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__secondary",id:"review-button",onClick:()=>a(),type:"button",children:jsxRuntimeExports.jsx("span",{children:ee("tests.review")})}),V?null:jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",id:"restart-button",onClick:()=>u(),type:"button",children:jsxRuntimeExports.jsx("span",{children:ee("tests.restart")})}),V?jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",id:"finish-button",onClick:()=>l(),type:"button",children:jsxRuntimeExports.jsx("span",{children:ee("tests.continue")})}):null]})]})}function TestComponent({test:o,countdown:e={},emitEvent:r,soundActions:t,audio:n,required:a,pause:l,minimumPercentage:u=100,feedbacksOnlyWhenReview:f}){const{questions:d}=o,[h,y]=React$2.useState({}),[E,p]=React$2.useState(),[_,g]=React$2.useState(0),[x,C]=React$2.useState([]),[R,S]=React$2.useState(e.time),[A,T]=React$2.useState(!1),[w,P]=React$2.useState("test"),[O,k]=React$2.useState(!0),[D,F]=React$2.useState({}),[G,V]=React$2.useState({}),[W,ee]=React$2.useState(!1),q=a||o.required||!1,z=React$2.useRef({}),[U,$]=React$2.useState(),[I,B]=t,X=(se,oe,fe,de,ce)=>{const Se={...se,index:fe};if(_>0&&(Se.rewards=Se.rewards.filter(Ne=>!G[se.id]||Ne.points<0)),h[oe]){const Ne=h[oe].find(He=>He.id===ce);if(Ne){if(Ne.id===se.id){const He=h[oe].find(Qe=>Qe.id===ce),Ke=h[oe].indexOf(He);if(h[oe].splice(Ke,1),h[oe].length===0){T(!1);return}}}else h[oe].push(Se)}else h[oe]=[Se];let Le;de==="isRadio"?Le={...h,[oe]:[Se]}:Le={...h},y(Le),F(Le),V({...G,[se.id]:{...se}}),T(!0)};React$2.useEffect(()=>{n!=null&&n.url&&I(n.url,"tts")},[I,n]);const Q=d.map(se=>{const oe=se.answers.filter(de=>de.isCorrect),fe=[];return oe.forEach(de=>{fe.push(de.id)}),{question:se.id,answers:fe}});React$2.useEffect(()=>{C(Q)},[Q]),React$2.useEffect(()=>{if(u){const se=Math.ceil(d.length*u/100);$(se)}},[d.length,u]),React$2.useEffect(()=>{R===0&&(clearInterval(E),T(!1),ee(!0),P("results"),B("tts"))},[E,B,R]);const J=()=>{clearInterval(E),T(!1),P("results");const se={...D};F(se),B("tts")},ne=()=>{const se={correctQuestions:x.length,result:h,status:"resolved"};Object.keys(h).forEach(fe=>{h[fe].forEach(de=>{z.current[de.id]&&(de.rewards=[])})}),r({type:"saveTest",payload:se})},ae=()=>{const se=()=>{F({}),V({}),P("test"),y({}),S(e.time),ee(!1),n!=null&&n.url&&I(n.url,"tts")},oe=Object.values(h);oe.forEach(de=>{de.forEach(ce=>{ce.isCorrect&&(z.current[ce.id]?ce.rewards=[]:z.current[ce.id]=!0)})});let fe=oe.reduce((de,ce)=>{const Se=[];return ce.forEach(Le=>{Se.push(Le.rewards)}),[...de,...Se.flat()]},[]);W&&e.rewards&&(fe=[...fe,...e.rewards]),r({type:"addPoints",payload:fe,complex:!0,finish:!1,onFinish:se}),r({type:"failTest"})},Z=(se,oe)=>r({type:"translate",payload:se,values:oe});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"test--container__overlay"}),jsxRuntimeExports.jsx("div",{className:"test--container",dir:"auto",children:w!=="results"?jsxRuntimeExports.jsx(Container,{result:h,time:R,setTries:g,tries:_,answerPage:T,setTime:S,paused:l,saveInterval:p,disabled:w!=="test",answered:A||w!=="test",questions:d,updateForm:X,showResults:J,translate:Z,soundActions:t,view:w,correctQuestions:x,feedbacksOnlyWhenReview:f}):jsxRuntimeExports.jsx(ResultsComponent,{reviewTest:()=>{k(!1),P("review")},isFirst:O,finishTest:ne,time:R,mandatory:q,restartTest:ae,result:h,correctQuestions:x,timeOver:W,timeOverText:e.text,emitEvent:r,soundActions:t,minimumPercentage:U})})]})}const OPTIONS=["yes","no"],LETTERS=["A","B"];function ApplicableBox({setSurveyData:o,survey:e,id:r,translate:t,changePage:n}){const a=l=>{o({...e,[r]:l}),n()};return jsxRuntimeExports.jsx("div",{className:"survey--page__item",children:OPTIONS.map((l,u)=>jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>a(l),className:`unset-button survey--response__item ${e[r]===l?"selected":""}`,children:[jsxRuntimeExports.jsx("div",{className:"survey--response__index",children:LETTERS[u]}),jsxRuntimeExports.jsx("div",{className:"survey--response__text",children:t(`survey.${l}`)})]},l))})}const OPINION_OPTIONS=[0,1,2,3,4,5,6,7,8,9,10];function OpinionBox({setSurveyData:o,survey:e,id:r,translate:t,changePage:n}){const a=l=>{o({...e,[r]:l}),n()};return jsxRuntimeExports.jsxs("div",{className:"survey--page__item","aria-label":"opinion box",children:[jsxRuntimeExports.jsx("div",{className:"survey--points",children:OPINION_OPTIONS.map(l=>jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>a(l),className:`unset-button survey--points__item ${e[r]===l?"selected":""}`,children:l},l))}),jsxRuntimeExports.jsxs("div",{className:"survey--points__labels",children:[jsxRuntimeExports.jsx("span",{children:t("survey.bad")}),jsxRuntimeExports.jsx("span",{children:t("survey.excellent")})]})]})}function TextBox({setSurveyData:o,survey:e,id:r,literalLabel:t}){const n=a=>{o({...e,[r]:a})};return jsxRuntimeExports.jsx("div",{className:"survey--page__item",children:jsxRuntimeExports.jsx("textarea",{ref:a=>{a&&a.focus()},className:"survey--textarea",id:t,value:e[r],onChange:a=>n(a.target.value)})})}const INIT_SURVEY={applicable:"",opinion:"",comments:"",suggestions:""},PAGES=[{component:ApplicableBox,id:"applicable"},{component:OpinionBox,id:"opinion"},{component:TextBox,id:"comments"},{component:TextBox,id:"suggestions"}];function SurveyComponent({emitEvent:o,soundActions:e}){const[r,t]=React$2.useState(INIT_SURVEY),[n,a]=React$2.useState(0),[l,u]=React$2.useState(!1),[f]=e,d=(E,p)=>o({type:"translate",payload:E,values:p}),h=(E=!1)=>{if(f("click-ui"),!E&&n+1>=PAGES.length)u(!0);else{E&&u(!1);const p=E?n-1:n+1;a(p)}},y=PAGES[n].component;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"survey--container__overlay"}),jsxRuntimeExports.jsx("div",{className:"survey--container",dir:"auto",children:jsxRuntimeExports.jsxs("div",{className:"survey--questions",children:[jsxRuntimeExports.jsxs("div",{className:"survey--questions__container",children:[jsxRuntimeExports.jsxs("div",{className:"survey--questions__intertitle",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("span",{children:d("survey.numQuestion",{init:n+1,page:PAGES.length})})}),jsxRuntimeExports.jsx("div",{children:d("auto-evaluation.allQuestionsMandatory")})]}),jsxRuntimeExports.jsx("label",{className:"survey--questions__item",htmlFor:d(`survey.question${n+1}`,{ordinal:n+1}),children:d(`survey.question${n+1}`,{ordinal:n+1})}),jsxRuntimeExports.jsx(y,{setSurveyData:t,id:PAGES[n].id,survey:r,translate:d,changePage:E=>h(!1),literalLabel:d(`survey.question${n+1}`,{ordinal:n+1})})]}),jsxRuntimeExports.jsxs("div",{className:"test--buttons next",children:[jsxRuntimeExports.jsx("button",{id:"survey-button-back",type:"button",disabled:n===0,onClick:()=>h(!0),className:`gat--btn__navigation ${n===0?"disabled":""}`,"aria-label":LangIsRtl()?d("survey.next"):d("survey.previous"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),l&&n===PAGES.length-1?jsxRuntimeExports.jsx("button",{id:"survey-button",type:"button",disabled:!r[PAGES[n].id],onClick:()=>{f("click-ui"),o({type:"saveSurvey",payload:r})},className:`gat--btn gat--btn__primary ${r[PAGES[n].id]?"":"disabled"} not-transition`,children:d("survey.finish")}):null,!l&&n!==PAGES.length?jsxRuntimeExports.jsx("button",{id:"survey-button",type:"button",disabled:!r[PAGES[n].id],onClick:()=>h(!1),className:`gat--btn__navigation ${r[PAGES[n].id]?"":"disabled"}`,"aria-label":LangIsRtl()?d("survey.previous"):d("survey.next"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})}):null]})]})})]})}function EndScreen({onFinish:o,translate:e}){return React$2.useEffect(()=>{let r;return o&&(r=setTimeout(()=>{o()},2e3)),()=>{r&&clearTimeout(r)}},[o]),jsxRuntimeExports.jsx("div",{className:"auto-evaluation__endscreen","aria-label":"auto evaluation endscreen",children:jsxRuntimeExports.jsxs("div",{className:"auto-evaluation__finishband","aria-label":"auto evaluation finishband",children:[jsxRuntimeExports.jsx("span",{className:"icon-check-laptop auto-evaluation__iconendscreen","aria-label":"icon-check",role:"img"}),jsxRuntimeExports.jsx("span",{className:"auto-evaluation__thanks","aria-label":"auto evaluation thanks",role:"contentinfo",children:e("auto-evaluation.thanks")})]})})}function StartScreen({onNext:o,description:e,translate:r}){return jsxRuntimeExports.jsxs("div",{className:"auto-evaluation__startscreen",role:"alertdialog","aria-modal":"true","aria-label":"ae start screen",children:[jsxRuntimeExports.jsx("span",{className:"icon-happy-laptop auto-evaluation__starticon","aria-label":"icon laptop",role:"img"}),jsxRuntimeExports.jsx("div",{className:"auto-evaluation__starttext","aria-label":"desciption",children:jsxRuntimeExports.jsx("span",{children:e})}),jsxRuntimeExports.jsx("button",{type:"button",className:"gat--btn gat--btn__primary auto-evaluation__button auto-evaluation__button--start",onClick:o,children:jsxRuntimeExports.jsx("span",{children:r("auto-evaluation.start")})})]})}function AutoEvaluation({description:o,questions:e,type:r,emitEvent:t,soundActions:n}){var A,T,w;const[a,l]=React$2.useState(null),[u,f]=React$2.useState("start"),[d,h]=React$2.useState(!1),[y,E]=React$2.useState(0),[p,_]=React$2.useState({current:{questions:[],type:r}}),[g]=n,x=P=>t({type:"translate",payload:P}),C=P=>{P.keyCode===13&&P.target.blur()},R=()=>{g("click-ui"),t({type:"saveSurveyPrePos",payload:p.current})};React$2.useEffect(()=>{!e.length&&u==="questions"&&f("end")},[e,u]);const S=(P,O=!1)=>{var D;const k=P!==null?P:(D=p.current.questions.find(F=>F.id===e[y].id))==null?void 0:D.answer;if(g("click-ui"),O)E(y-1),h(!1);else{const F=p.current.questions.findIndex(V=>V.id===e[y].id),G=[...p.current.questions];F>-1?G.splice(F,1,{id:e[y].id,answer:k}):G.push({id:e[y].id,answer:k}),_({...p,current:{...p.current,questions:G}}),y===e.length-1?h(!0):(E(y+1),h(!1))}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"test--container__overlay","aria-label":"test container overlay"}),jsxRuntimeExports.jsxs("div",{className:"test--container",dir:"auto","aria-label":"test container",children:[u==="start"&&jsxRuntimeExports.jsx(StartScreen,{description:o,onNext:()=>{f("questions"),g("click-ui")},translate:x}),u==="questions"&&jsxRuntimeExports.jsxs("div",{className:"survey--questions","aria-label":"survey questions",children:[jsxRuntimeExports.jsxs("div",{className:"survey--questions__container","aria-label":"survey questions container",children:[jsxRuntimeExports.jsxs("div",{className:"survey--questions__intertitle",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs("span",{children:[x("auto-evaluation.question")," ",y+1," ",x("storylines.misc.of")," ",e.length]})}),jsxRuntimeExports.jsx("div",{children:x("auto-evaluation.allQuestionsMandatory")})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"survey--questions__item","aria-label":"survey questions item",children:(A=e[y])==null?void 0:A.text}),jsxRuntimeExports.jsx("div",{className:"survey--page__item","aria-label":"survey page item",children:jsxRuntimeExports.jsx("div",{className:"survey--points","aria-label":"survey points",children:Array(11).fill(0).map((P,O)=>{var k;return jsxRuntimeExports.jsx("button",{type:"button",onTouchStart:()=>{l(O)},onTouchEnd:()=>{l(null)},onKeyUp:D=>{C(D)},onClick:()=>{S(O,!1)},className:`survey--points__item ${((k=p.current.questions[y])==null?void 0:k.answer)===O||a===O?"selected":""}`,children:O},`${0+O}`)})})})]},`${e[y]}`)]}),jsxRuntimeExports.jsxs("div",{className:"test--buttons next","aria-label":"test buttons",children:[jsxRuntimeExports.jsx("button",{type:"button",disabled:y===0,onClick:()=>S(null,!0),"aria-label":LangIsRtl()?x("survey.next"):x("survey.previous"),className:`gat--btn__navigation ${y===0?"disabled":""}`,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back","aria-label":"icon button"})}),d?jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f("end"),g("click-ui")},className:`gat--btn gat--btn__primary auto-evaluation__button not-transition
253
+ `,children:jsxRuntimeExports.jsx("span",{children:x("auto-evaluation.end")})}):jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>S(null,!1),disabled:((T=p.current.questions[y])==null?void 0:T.answer)===void 0,"aria-label":LangIsRtl()?x("survey.previous"):x("survey.next"),className:`gat--btn__navigation ${((w=p.current.questions[y])==null?void 0:w.answer)===void 0?"disabled":""}`,children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})]}),u==="end"&&jsxRuntimeExports.jsx(EndScreen,{onFinish:R,translate:x})]})]})}function PatternComponent({img:o,name:e,viewed:r,emitEvent:t,soundActions:n,keyboardControl:a}){const[l]=n,u=h=>t({type:"translate",payload:h});if(!o)return null;const f=o.url,d=()=>{l("click-ui"),t({type:"emitSavePattern",payload:{imgId:o.resourceId,name:e,viewed:!0,url:f,type:"pattern"}})};return a(null,r?null:d,r?null:d),jsxRuntimeExports.jsx("div",{className:r?"notes--results":"readings--container pattern-wrap--overlay",children:jsxRuntimeExports.jsx("div",{className:r?"notes--results__text":"pattern-wrap",children:r?jsxRuntimeExports.jsx("div",{children:f&&jsxRuntimeExports.jsx("img",{src:f,alt:"pattern"})}):jsxRuntimeExports.jsxs("div",{className:"pattern",children:[jsxRuntimeExports.jsxs("div",{className:"pattern__header",children:[jsxRuntimeExports.jsx("div",{className:"pattern__title",children:u("phone.pattern")}),jsxRuntimeExports.jsx("button",{type:"button","aria-label":u("storylines.misc.closePiece"),className:"pattern__close gat--btn__round gat--btn__close",onClick:()=>d(),children:jsxRuntimeExports.jsx("span",{className:"icon-close"})})]}),jsxRuntimeExports.jsx("figure",{className:"pattern__figure",children:f&&jsxRuntimeExports.jsx("img",{src:f,alt:"pattern"})})]})})})}const getRecursiveJSX=(o,e=0,r,t,n)=>{var a,l;if((a=o.props)!=null&&a.children){const u=o.type,{children:f,...d}=o.props;if(o.props["data-text-id"]){if(d.dir="auto",d.onClick=h=>t(h,d["data-text-id"]||-1),r!=null&&r.hasHighlights){const h=[...r.correctTexts,...r.wrongTexts];for(let y=0;y<h.length;y+=1)d["data-text-id"]===h[y].id&&(d.className="text-click__hover-correct")}}else r!=null&&r.allWrong&&!o.props["data-text-id"]&&(d.onClick=h=>t(h,"allWrong"));return Array.isArray(f)?jsxRuntimeExports.jsx(u,{...d,children:f.map((h,y)=>getRecursiveJSX(h,y,r,t))},`${o.type}_${e}`):jsxRuntimeExports.jsx(u,{...d,children:getRecursiveJSX(f,e,r,t)},`${o.type}_${e}`)}return((l=o.props)==null?void 0:l.children)!==null?o.split(" ").filter(u=>u!=="").map(u=>jsxRuntimeExports.jsx("span",{dir:"auto",children:u},u)):null};function TextClickPuzzleComponent({emitEvent:o,showFrames:e,styles:r,list:t,soundActions:n,description:a,setInfo:l,setResolveAction:u,keyboardControl:f,backgroundImage:d}){const[h,y]=React$2.useState({result:null,show:!1,text:"",timeout:!1}),[E]=n,[p,_]=React$2.useState(0),[g,x]=React$2.useState(0),[C,R]=React$2.useState(0),S=React$2.useRef(0),A=React$2.useRef([]),[T,w]=React$2.useState(0),[P,O]=React$2.useState(),k=React$2.useCallback(I=>o({type:"translate",payload:I}),[o]),D=React$2.useRef(null),F=React$2.useCallback(()=>S.current===t[p].correctTexts.length||t[p].hasClickOnce&&S.current>=1,[p,t]),G=React$2.useCallback((I,B)=>{I&&o({type:"hidePuzzleButtons",payload:!0}),y(X=>({...X,show:I,...B}))},[o]),V=React$2.useCallback(()=>{if(F())if(y(I=>({...I,result:!1})),S.current=0,C===g){const I=A.current.reduce((B,X)=>{const Q=B.findIndex(J=>J.id===X.id);return Q>=0?B[Q].points+=X.points:B.push({...X}),B},[]);o({type:"addPoints",complex:!0,finish:!0,payload:I}),o({type:"passPuzzle"})}else D.current=null,_(p+1),w(0),O(!0),setTimeout(()=>{O(!1)},1200)},[F,C,g,o,p]),W=React$2.useCallback(()=>{o({type:"hidePuzzleButtons",payload:!1}),V(),y(B=>({...B,show:!1,text:""}));const I=document.querySelectorAll(".text-click__failed");I.length>0&&I.forEach(B=>B.classList.remove("text-click__failed"))},[o,V]),ee=React$2.useCallback((I,B)=>{var X,Q;I.forEach(J=>J.classList.add("text-click__success")),R(C+1),S.current+=1,E("score"),(X=t[p].info.solution.right)!=null&&X.desc?F()&&(A.current=[...A.current,...t[p].info.solution.right.rewards],G(!0,{result:!0,text:t[p].info.solution.right.desc,timeout:!1})):t[p].info.solution.right.desc===""&&(B!=null&&B.desc)?(A.current=((Q=B==null?void 0:B.rewards)==null?void 0:Q.length)>0?[...A.current,...(B==null?void 0:B.rewards)||{}]:[...A.current],G(!0,{result:!0,text:B.desc,timeout:!1})):t[p].specificFeedbacks.specificCorrectFeedbacks?(A.current=[...A.current,...(B==null?void 0:B.rewards)||{}],F()&&G(!0,{result:!0,timeout:!0})):F()&&(A.current=[...A.current,...t[p].info.solution.right.rewards],G(!0,{result:!0,timeout:!0}))},[C,E,t,p,F,G]),q=React$2.useCallback((I,B)=>{var X;I.forEach(Q=>Q.classList.add("text-click__failed")),E("fail"),o({type:"failPuzzle"}),t[p].info.solution.wrong.desc!==""?(A.current=[...A.current,...t[p].info.solution.wrong.rewards],G(!0,{result:!1,text:t[p].info.solution.wrong.desc,timeout:!1})):t[p].info.solution.wrong.desc===""&&(B!=null&&B.desc)?(A.current=(X=B==null?void 0:B.rewards)!=null&&X.length?[...A.current,...(B==null?void 0:B.rewards)||{}]:[...A.current],G(!0,{result:!1,text:B.desc,timeout:!1})):t[p].specificFeedbacks.specificWrongFeedbacks?(A.current=[...A.current,...(B==null?void 0:B.rewards)||{}],G(!0,{result:!1,timeout:!0})):(A.current=[...A.current,...t[p].info.solution.wrong.rewards],G(!0,{result:!1,timeout:!0}))},[E,o,t,p,G]),z=React$2.useCallback((I,B)=>{var se,oe,fe,de;I.stopPropagation();const X=document.querySelectorAll(`[data-text-id="${B}"]`),Q=document.querySelectorAll("[data-text-id]"),J=t[p].correctTexts.find(ce=>ce.id===B),ne=t[p].wrongTexts.find(ce=>ce.id===B),ae=(oe=(se=t[p])==null?void 0:se.specificFeedbacks)==null?void 0:oe.correctFeedbacks.find(ce=>ce.id===B),Z=(de=(fe=t[p])==null?void 0:fe.specificFeedbacks)==null?void 0:de.wrongFeedbacks.find(ce=>ce.id===B);E("click-ui"),t[p].hasClickOrder?t[p].correctTexts[T].id===B?(w(T+1),ee(X,ae)):t[p].correctTexts.find(ce=>ce.id===B)&&t[p].correctTexts[T].id!==B?(Q.forEach(ce=>ce.classList.remove("text-click__success")),w(0),R(0),S.current=0,G(!0,{result:!1,text:t[p].info.orderFeedback.desc||k("puzzles.incorrectOrder"),timeout:!1}),_(0)):q(X,Z):(J==null?void 0:J.id)===B?ee(X,ae):((ne==null?void 0:ne.id)===B||B==="allWrong")&&q(X,Z)},[t,p,E,T,ee,G,k,q]),U=React$2.useCallback(I=>getRecursiveJSX(I,0,t[p],z),[p,t,z]),$=React$2.useCallback(()=>{let I=0;for(let B=0;B<t.length;B+=1)if(t[B].hasClickOnce)I+=1,x(I);else for(let X=0;X<t[B].correctTexts.length;X+=1)I+=1,x(I)},[t]);return React$2.useEffect(()=>{var I;if(t!=null&&t[p]&&l({...t[p].info,description:a}),(I=t[p])!=null&&I.text){const B=HTMLReactParser$1(t[p].text);D.current=U(B),$()}else D.current=""},[p,a,$,t,U,l]),React$2.useEffect(()=>{u(I=>{o({type:"hidePuzzleButtons",payload:!0}),setTimeout(()=>{o({type:"hidePuzzleButtons",payload:!1}),I()},2e3)})},[u,o,t,p]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`text-click text-click--${r}`,style:(h.show,d!=null&&d.url?{backgroundImage:`url("${d.url}")`}:{}),children:[jsxRuntimeExports.jsx("div",{className:"text-click__overlay",children:jsxRuntimeExports.jsx("div",{className:`text-click__container ${P?"slideInLeft":""} `,children:jsxRuntimeExports.jsx("div",{className:"text-click__body",children:jsxRuntimeExports.jsx("div",{className:"text-click__scroll",dir:LangIsRtl()?"rtl":"auto",children:D.current})})})}),e&&jsxRuntimeExports.jsxs("div",{className:"text-click__paginator",children:[jsxRuntimeExports.jsx("div",{className:"text-click__icon-check-circle-black",children:jsxRuntimeExports.jsx("span",{className:"icon-check-circle-black"})}),jsxRuntimeExports.jsxs("span",{className:"text-click__slide",children:[C," / ",g]})]})]}),h.show&&jsxRuntimeExports.jsx(FeedbackComponent$1,{playSound:E,success:h.result,text:h.text,translate:k,functionOnClose:W,hasTimeout:h.timeout,keyboardControl:f})]})}function ZoomTest({targetId:o,emitEvent:e}){const[r,t]=React$2.useState(!1),n=fiber.useThree(d=>d.camera),a=React$2.useRef(!1),l=React$2.useRef(null),u=({scene:d,camera:h},y)=>{const E=d.getObjectByName(o);if(E){const p=E.getObjectByName("Head_M"),_=p.getWorldPosition(new three.Vector3);h.position.distanceTo(new three.Vector3)<=5?f({scene:d,camera:h}):(p.attach(h),h.position.lerp(new three.Vector3,y*.5),h.lookAt(_))}else a.current=!1},f=({camera:d})=>{a.current=!1,d.parent=null,d.copy(l.current),e({type:"success"})};return React$2.useEffect(()=>{r||(a.current=!0,l.current=n.clone(),t(!0))},[n,r]),fiber.useFrame((d,h)=>{a.current&&u(d,h)}),null}function _assertThisInitialized(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function _inheritsLoose(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.__proto__=e}/*!
254
+ * GSAP 3.12.4
255
+ * https://gsap.com
256
+ *
257
+ * @license Copyright 2008-2023, GreenSock. All rights reserved.
258
+ * Subject to the terms at https://gsap.com/standard-license or for
259
+ * Club GSAP members, the agreement issued with that membership.
260
+ * @author: Jack Doyle, jack@greensock.com
261
+ */var _config={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},_defaults={duration:.5,overwrite:!1,delay:0},_suppressOverwrites,_reverting$1,_context,_bigNum$1=1e8,_tinyNum=1/_bigNum$1,_2PI=Math.PI*2,_HALF_PI=_2PI/4,_gsID=0,_sqrt=Math.sqrt,_cos=Math.cos,_sin=Math.sin,_isString=function o(e){return typeof e=="string"},_isFunction=function o(e){return typeof e=="function"},_isNumber=function o(e){return typeof e=="number"},_isUndefined=function o(e){return typeof e>"u"},_isObject=function o(e){return typeof e=="object"},_isNotFalse=function o(e){return e!==!1},_windowExists$1=function o(){return typeof window<"u"},_isFuncOrString=function o(e){return _isFunction(e)||_isString(e)},_isTypedArray=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},_isArray=Array.isArray,_strictNumExp=/(?:-?\.?\d|\.)+/gi,_numExp=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,_numWithUnitExp=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,_complexStringNumExp=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_relExp=/[+-]=-?[.\d]+/,_delimitedValueExp=/[^,'"\[\]\s]+/gi,_unitExp=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,_globalTimeline,_win$1,_coreInitted,_doc$1,_globals={},_installScope={},_coreReady,_install=function o(e){return(_installScope=_merge(e,_globals))&&gsap},_missingPlugin=function o(e,r){return console.warn("Invalid property",e,"set to",r,"Missing plugin? gsap.registerPlugin()")},_warn=function o(e,r){return!r&&console.warn(e)},_addGlobal=function o(e,r){return e&&(_globals[e]=r)&&_installScope&&(_installScope[e]=r)||_globals},_emptyFunc=function o(){return 0},_startAtRevertConfig={suppressEvents:!0,isStart:!0,kill:!1},_revertConfigNoKill={suppressEvents:!0,kill:!1},_revertConfig={suppressEvents:!0},_reservedProps={},_lazyTweens=[],_lazyLookup={},_lastRenderedFrame,_plugins={},_effects={},_nextGCFrame=30,_harnessPlugins=[],_callbackNames="",_harness=function o(e){var r=e[0],t,n;if(_isObject(r)||_isFunction(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=_harnessPlugins.length;n--&&!_harnessPlugins[n].targetTest(r););t=_harnessPlugins[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new GSCache(e[n],t)))||e.splice(n,1);return e},_getCache=function o(e){return e._gsap||_harness(toArray(e))[0]._gsap},_getProperty=function o(e,r,t){return(t=e[r])&&_isFunction(t)?e[r]():_isUndefined(t)&&e.getAttribute&&e.getAttribute(r)||t},_forEachName=function o(e,r){return(e=e.split(",")).forEach(r)||e},_round=function o(e){return Math.round(e*1e5)/1e5||0},_roundPrecise=function o(e){return Math.round(e*1e7)/1e7||0},_parseRelative=function o(e,r){var t=r.charAt(0),n=parseFloat(r.substr(2));return e=parseFloat(e),t==="+"?e+n:t==="-"?e-n:t==="*"?e*n:e/n},_arrayContainsAny=function o(e,r){for(var t=r.length,n=0;e.indexOf(r[n])<0&&++n<t;);return n<t},_lazyRender=function o(){var e=_lazyTweens.length,r=_lazyTweens.slice(0),t,n;for(_lazyLookup={},_lazyTweens.length=0,t=0;t<e;t++)n=r[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},_lazySafeRender=function o(e,r,t,n){_lazyTweens.length&&!_reverting$1&&_lazyRender(),e.render(r,t,n||_reverting$1&&r<0&&(e._initted||e._startAt)),_lazyTweens.length&&!_reverting$1&&_lazyRender()},_numericIfPossible=function o(e){var r=parseFloat(e);return(r||r===0)&&(e+"").match(_delimitedValueExp).length<2?r:_isString(e)?e.trim():e},_passThrough=function o(e){return e},_setDefaults=function o(e,r){for(var t in r)t in e||(e[t]=r[t]);return e},_setKeyframeDefaults=function o(e){return function(r,t){for(var n in t)n in r||n==="duration"&&e||n==="ease"||(r[n]=t[n])}},_merge=function o(e,r){for(var t in r)e[t]=r[t];return e},_mergeDeep=function o(e,r){for(var t in r)t!=="__proto__"&&t!=="constructor"&&t!=="prototype"&&(e[t]=_isObject(r[t])?o(e[t]||(e[t]={}),r[t]):r[t]);return e},_copyExcluding=function o(e,r){var t={},n;for(n in e)n in r||(t[n]=e[n]);return t},_inheritDefaults=function o(e){var r=e.parent||_globalTimeline,t=e.keyframes?_setKeyframeDefaults(_isArray(e.keyframes)):_setDefaults;if(_isNotFalse(e.inherit))for(;r;)t(e,r.vars.defaults),r=r.parent||r._dp;return e},_arraysMatch=function o(e,r){for(var t=e.length,n=t===r.length;n&&t--&&e[t]===r[t];);return t<0},_addLinkedListItem=function o(e,r,t,n,a){t===void 0&&(t="_first"),n===void 0&&(n="_last");var l=e[n],u;if(a)for(u=r[a];l&&l[a]>u;)l=l._prev;return l?(r._next=l._next,l._next=r):(r._next=e[t],e[t]=r),r._next?r._next._prev=r:e[n]=r,r._prev=l,r.parent=r._dp=e,r},_removeLinkedListItem=function o(e,r,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var a=r._prev,l=r._next;a?a._next=l:e[t]===r&&(e[t]=l),l?l._prev=a:e[n]===r&&(e[n]=a),r._next=r._prev=r.parent=null},_removeFromParent=function o(e,r){e.parent&&(!r||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},_uncache=function o(e,r){if(e&&(!r||r._end>e._dur||r._start<0))for(var t=e;t;)t._dirty=1,t=t.parent;return e},_recacheAncestors=function o(e){for(var r=e.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return e},_rewindStartAt=function o(e,r,t,n){return e._startAt&&(_reverting$1?e._startAt.revert(_revertConfigNoKill):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(r,!0,n))},_hasNoPausedAncestors=function o(e){return!e||e._ts&&o(e.parent)},_elapsedCycleDuration=function o(e){return e._repeat?_animationCycle(e._tTime,e=e.duration()+e._rDelay)*e:0},_animationCycle=function o(e,r){var t=Math.floor(e/=r);return e&&t===e?t-1:t},_parentToChildTotalTime=function o(e,r){return(e-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},_setEnd=function o(e){return e._end=_roundPrecise(e._start+(e._tDur/Math.abs(e._ts||e._rts||_tinyNum)||0))},_alignPlayhead=function o(e,r){var t=e._dp;return t&&t.smoothChildTiming&&e._ts&&(e._start=_roundPrecise(t._time-(e._ts>0?r/e._ts:((e._dirty?e.totalDuration():e._tDur)-r)/-e._ts)),_setEnd(e),t._dirty||_uncache(t,e)),e},_postAddChecks=function o(e,r){var t;if((r._time||!r._dur&&r._initted||r._start<e._time&&(r._dur||!r.add))&&(t=_parentToChildTotalTime(e.rawTime(),r),(!r._dur||_clamp(0,r.totalDuration(),t)-r._tTime>_tinyNum)&&r.render(t,!0)),_uncache(e,r)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(t=e;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;e._zTime=-_tinyNum}},_addToTimeline=function o(e,r,t,n){return r.parent&&_removeFromParent(r),r._start=_roundPrecise((_isNumber(t)?t:t||e!==_globalTimeline?_parsePosition(e,t,r):e._time)+r._delay),r._end=_roundPrecise(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),_addLinkedListItem(e,r,"_first","_last",e._sort?"_start":0),_isFromOrFromStart(r)||(e._recent=r),n||_postAddChecks(e,r),e._ts<0&&_alignPlayhead(e,e._tTime),e},_scrollTrigger=function o(e,r){return(_globals.ScrollTrigger||_missingPlugin("scrollTrigger",r))&&_globals.ScrollTrigger.create(r,e)},_attemptInitTween=function o(e,r,t,n,a){if(_initTween(e,r,a),!e._initted)return 1;if(!t&&e._pt&&!_reverting$1&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&_lastRenderedFrame!==_ticker.frame)return _lazyTweens.push(e),e._lazy=[a,n],1},_parentPlayheadIsBeforeStart=function o(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||o(r))},_isFromOrFromStart=function o(e){var r=e.data;return r==="isFromStart"||r==="isStart"},_renderZeroDurationTween=function o(e,r,t,n){var a=e.ratio,l=r<0||!r&&(!e._start&&_parentPlayheadIsBeforeStart(e)&&!(!e._initted&&_isFromOrFromStart(e))||(e._ts<0||e._dp._ts<0)&&!_isFromOrFromStart(e))?0:1,u=e._rDelay,f=0,d,h,y;if(u&&e._repeat&&(f=_clamp(0,e._tDur,r),h=_animationCycle(f,u),e._yoyo&&h&1&&(l=1-l),h!==_animationCycle(e._tTime,u)&&(a=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==a||_reverting$1||n||e._zTime===_tinyNum||!r&&e._zTime){if(!e._initted&&_attemptInitTween(e,r,n,t,f))return;for(y=e._zTime,e._zTime=r||(t?_tinyNum:0),t||(t=r&&!y),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=f,d=e._pt;d;)d.r(l,d.d),d=d._next;r<0&&_rewindStartAt(e,r,t,!0),e._onUpdate&&!t&&_callback(e,"onUpdate"),f&&e._repeat&&!t&&e.parent&&_callback(e,"onRepeat"),(r>=e._tDur||r<0)&&e.ratio===l&&(l&&_removeFromParent(e,1),!t&&!_reverting$1&&(_callback(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=r)},_findNextPauseTween=function o(e,r,t){var n;if(t>r)for(n=e._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>r)return n;n=n._next}else for(n=e._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<r)return n;n=n._prev}},_setDuration=function o(e,r,t,n){var a=e._repeat,l=_roundPrecise(r)||0,u=e._tTime/e._tDur;return u&&!n&&(e._time*=l/e._dur),e._dur=l,e._tDur=a?a<0?1e10:_roundPrecise(l*(a+1)+e._rDelay*a):l,u>0&&!n&&_alignPlayhead(e,e._tTime=e._tDur*u),e.parent&&_setEnd(e),t||_uncache(e.parent,e),e},_onUpdateTotalDuration=function o(e){return e instanceof Timeline?_uncache(e):_setDuration(e,e._dur)},_zeroPosition={_start:0,endTime:_emptyFunc,totalDuration:_emptyFunc},_parsePosition=function o(e,r,t){var n=e.labels,a=e._recent||_zeroPosition,l=e.duration()>=_bigNum$1?a.endTime(!1):e._dur,u,f,d;return _isString(r)&&(isNaN(r)||r in n)?(f=r.charAt(0),d=r.substr(-1)==="%",u=r.indexOf("="),f==="<"||f===">"?(u>=0&&(r=r.replace(/=/,"")),(f==="<"?a._start:a.endTime(a._repeat>=0))+(parseFloat(r.substr(1))||0)*(d?(u<0?a:t).totalDuration()/100:1)):u<0?(r in n||(n[r]=l),n[r]):(f=parseFloat(r.charAt(u-1)+r.substr(u+1)),d&&t&&(f=f/100*(_isArray(t)?t[0]:t).totalDuration()),u>1?o(e,r.substr(0,u-1),t)+f:l+f)):r==null?l:+r},_createTweenType=function o(e,r,t){var n=_isNumber(r[1]),a=(n?2:1)+(e<2?0:1),l=r[a],u,f;if(n&&(l.duration=r[1]),l.parent=t,e){for(u=l,f=t;f&&!("immediateRender"in u);)u=f.vars.defaults||{},f=_isNotFalse(f.vars.inherit)&&f.parent;l.immediateRender=_isNotFalse(u.immediateRender),e<2?l.runBackwards=1:l.startAt=r[a-1]}return new Tween(r[0],l,r[a+1])},_conditionalReturn=function o(e,r){return e||e===0?r(e):r},_clamp=function o(e,r,t){return t<e?e:t>r?r:t},getUnit=function o(e,r){return!_isString(e)||!(r=_unitExp.exec(e))?"":r[1]},clamp=function o(e,r,t){return _conditionalReturn(t,function(n){return _clamp(e,r,n)})},_slice=[].slice,_isArrayLike=function o(e,r){return e&&_isObject(e)&&"length"in e&&(!r&&!e.length||e.length-1 in e&&_isObject(e[0]))&&!e.nodeType&&e!==_win$1},_flatten=function o(e,r,t){return t===void 0&&(t=[]),e.forEach(function(n){var a;return _isString(n)&&!r||_isArrayLike(n,1)?(a=t).push.apply(a,toArray(n)):t.push(n)})||t},toArray=function o(e,r,t){return _context&&!r&&_context.selector?_context.selector(e):_isString(e)&&!t&&(_coreInitted||!_wake())?_slice.call((r||_doc$1).querySelectorAll(e),0):_isArray(e)?_flatten(e,t):_isArrayLike(e)?_slice.call(e,0):e?[e]:[]},selector=function o(e){return e=toArray(e)[0]||_warn("Invalid scope")||{},function(r){var t=e.current||e.nativeElement||e;return toArray(r,t.querySelectorAll?t:t===e?_warn("Invalid scope")||_doc$1.createElement("div"):e)}},shuffle=function o(e){return e.sort(function(){return .5-Math.random()})},distribute=function o(e){if(_isFunction(e))return e;var r=_isObject(e)?e:{each:e},t=_parseEase(r.ease),n=r.from||0,a=parseFloat(r.base)||0,l={},u=n>0&&n<1,f=isNaN(n)||u,d=r.axis,h=n,y=n;return _isString(n)?h=y={center:.5,edges:.5,end:1}[n]||0:!u&&f&&(h=n[0],y=n[1]),function(E,p,_){var g=(_||r).length,x=l[g],C,R,S,A,T,w,P,O,k;if(!x){if(k=r.grid==="auto"?0:(r.grid||[1,_bigNum$1])[1],!k){for(P=-_bigNum$1;P<(P=_[k++].getBoundingClientRect().left)&&k<g;);k<g&&k--}for(x=l[g]=[],C=f?Math.min(k,g)*h-.5:n%k,R=k===_bigNum$1?0:f?g*y/k-.5:n/k|0,P=0,O=_bigNum$1,w=0;w<g;w++)S=w%k-C,A=R-(w/k|0),x[w]=T=d?Math.abs(d==="y"?A:S):_sqrt(S*S+A*A),T>P&&(P=T),T<O&&(O=T);n==="random"&&shuffle(x),x.max=P-O,x.min=O,x.v=g=(parseFloat(r.amount)||parseFloat(r.each)*(k>g?g-1:d?d==="y"?g/k:k:Math.max(k,g/k))||0)*(n==="edges"?-1:1),x.b=g<0?a-g:a,x.u=getUnit(r.amount||r.each)||0,t=t&&g<0?_invertEase(t):t}return g=(x[E]-x.min)/x.max||0,_roundPrecise(x.b+(t?t(g):g)*x.v)+x.u}},_roundModifier=function o(e){var r=Math.pow(10,((e+"").split(".")[1]||"").length);return function(t){var n=_roundPrecise(Math.round(parseFloat(t)/e)*e*r);return(n-n%1)/r+(_isNumber(t)?0:getUnit(t))}},snap=function o(e,r){var t=_isArray(e),n,a;return!t&&_isObject(e)&&(n=t=e.radius||_bigNum$1,e.values?(e=toArray(e.values),(a=!_isNumber(e[0]))&&(n*=n)):e=_roundModifier(e.increment)),_conditionalReturn(r,t?_isFunction(e)?function(l){return a=e(l),Math.abs(a-l)<=n?a:l}:function(l){for(var u=parseFloat(a?l.x:l),f=parseFloat(a?l.y:0),d=_bigNum$1,h=0,y=e.length,E,p;y--;)a?(E=e[y].x-u,p=e[y].y-f,E=E*E+p*p):E=Math.abs(e[y]-u),E<d&&(d=E,h=y);return h=!n||d<=n?e[h]:l,a||h===l||_isNumber(l)?h:h+getUnit(l)}:_roundModifier(e))},random=function o(e,r,t,n){return _conditionalReturn(_isArray(e)?!r:t===!0?!!(t=0):!n,function(){return _isArray(e)?e[~~(Math.random()*e.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((e-t/2+Math.random()*(r-e+t*.99))/t)*t*n)/n})},pipe=function o(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(n){return r.reduce(function(a,l){return l(a)},n)}},unitize=function o(e,r){return function(t){return e(parseFloat(t))+(r||getUnit(t))}},normalize=function o(e,r,t){return mapRange(e,r,0,1,t)},_wrapArray=function o(e,r,t){return _conditionalReturn(t,function(n){return e[~~r(n)]})},wrap=function o(e,r,t){var n=r-e;return _isArray(e)?_wrapArray(e,o(0,e.length),r):_conditionalReturn(t,function(a){return(n+(a-e)%n)%n+e})},wrapYoyo=function o(e,r,t){var n=r-e,a=n*2;return _isArray(e)?_wrapArray(e,o(0,e.length-1),r):_conditionalReturn(t,function(l){return l=(a+(l-e)%a)%a||0,e+(l>n?a-l:l)})},_replaceRandom=function o(e){for(var r=0,t="",n,a,l,u;~(n=e.indexOf("random(",r));)l=e.indexOf(")",n),u=e.charAt(n+7)==="[",a=e.substr(n+7,l-n-7).match(u?_delimitedValueExp:_strictNumExp),t+=e.substr(r,n-r)+random(u?a:+a[0],u?0:+a[1],+a[2]||1e-5),r=l+1;return t+e.substr(r,e.length-r)},mapRange=function o(e,r,t,n,a){var l=r-e,u=n-t;return _conditionalReturn(a,function(f){return t+((f-e)/l*u||0)})},interpolate=function o(e,r,t,n){var a=isNaN(e+r)?0:function(p){return(1-p)*e+p*r};if(!a){var l=_isString(e),u={},f,d,h,y,E;if(t===!0&&(n=1)&&(t=null),l)e={p:e},r={p:r};else if(_isArray(e)&&!_isArray(r)){for(h=[],y=e.length,E=y-2,d=1;d<y;d++)h.push(o(e[d-1],e[d]));y--,a=function(_){_*=y;var g=Math.min(E,~~_);return h[g](_-g)},t=r}else n||(e=_merge(_isArray(e)?[]:{},e));if(!h){for(f in r)_addPropTween.call(u,e,f,"get",r[f]);a=function(_){return _renderPropTweens(_,u)||(l?e.p:e)}}}return _conditionalReturn(t,a)},_getLabelInDirection=function o(e,r,t){var n=e.labels,a=_bigNum$1,l,u,f;for(l in n)u=n[l]-r,u<0==!!t&&u&&a>(u=Math.abs(u))&&(f=l,a=u);return f},_callback=function o(e,r,t){var n=e.vars,a=n[r],l=_context,u=e._ctx,f,d,h;if(a)return f=n[r+"Params"],d=n.callbackScope||e,t&&_lazyTweens.length&&_lazyRender(),u&&(_context=u),h=f?a.apply(d,f):a.call(d),_context=l,h},_interrupt=function o(e){return _removeFromParent(e),e.scrollTrigger&&e.scrollTrigger.kill(!!_reverting$1),e.progress()<1&&_callback(e,"onInterrupt"),e},_quickTween,_registerPluginQueue=[],_createPlugin=function o(e){if(_windowExists$1()&&e){e=!e.name&&e.default||e;var r=e.name,t=_isFunction(e),n=r&&!t&&e.init?function(){this._props=[]}:e,a={init:_emptyFunc,render:_renderPropTweens,add:_addPropTween,kill:_killPropTweensOf,modifier:_addPluginModifier,rawVars:0},l={targetTest:0,get:0,getSetter:_getSetter,aliases:{},register:0};if(_wake(),e!==n){if(_plugins[r])return;_setDefaults(n,_setDefaults(_copyExcluding(e,a),l)),_merge(n.prototype,_merge(a,_copyExcluding(e,l))),_plugins[n.prop=r]=n,e.targetTest&&(_harnessPlugins.push(n),_reservedProps[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}_addGlobal(r,n),e.register&&e.register(gsap,n,PropTween)}else e&&_registerPluginQueue.push(e)},_255=255,_colorLookup={aqua:[0,_255,_255],lime:[0,_255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,_255],navy:[0,0,128],white:[_255,_255,_255],olive:[128,128,0],yellow:[_255,_255,0],orange:[_255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[_255,0,0],pink:[_255,192,203],cyan:[0,_255,_255],transparent:[_255,_255,_255,0]},_hue=function o(e,r,t){return e+=e<0?1:e>1?-1:0,(e*6<1?r+(t-r)*e*6:e<.5?t:e*3<2?r+(t-r)*(2/3-e)*6:r)*_255+.5|0},splitColor=function o(e,r,t){var n=e?_isNumber(e)?[e>>16,e>>8&_255,e&_255]:0:_colorLookup.black,a,l,u,f,d,h,y,E,p,_;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),_colorLookup[e])n=_colorLookup[e];else if(e.charAt(0)==="#"){if(e.length<6&&(a=e.charAt(1),l=e.charAt(2),u=e.charAt(3),e="#"+a+a+l+l+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&_255,n&_255,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&_255,e&_255]}else if(e.substr(0,3)==="hsl"){if(n=_=e.match(_strictNumExp),!r)f=+n[0]%360/360,d=+n[1]/100,h=+n[2]/100,l=h<=.5?h*(d+1):h+d-h*d,a=h*2-l,n.length>3&&(n[3]*=1),n[0]=_hue(f+1/3,a,l),n[1]=_hue(f,a,l),n[2]=_hue(f-1/3,a,l);else if(~e.indexOf("="))return n=e.match(_numExp),t&&n.length<4&&(n[3]=1),n}else n=e.match(_strictNumExp)||_colorLookup.transparent;n=n.map(Number)}return r&&!_&&(a=n[0]/_255,l=n[1]/_255,u=n[2]/_255,y=Math.max(a,l,u),E=Math.min(a,l,u),h=(y+E)/2,y===E?f=d=0:(p=y-E,d=h>.5?p/(2-y-E):p/(y+E),f=y===a?(l-u)/p+(l<u?6:0):y===l?(u-a)/p+2:(a-l)/p+4,f*=60),n[0]=~~(f+.5),n[1]=~~(d*100+.5),n[2]=~~(h*100+.5)),t&&n.length<4&&(n[3]=1),n},_colorOrderData=function o(e){var r=[],t=[],n=-1;return e.split(_colorExp).forEach(function(a){var l=a.match(_numWithUnitExp)||[];r.push.apply(r,l),t.push(n+=l.length+1)}),r.c=t,r},_formatColors=function o(e,r,t){var n="",a=(e+n).match(_colorExp),l=r?"hsla(":"rgba(",u=0,f,d,h,y;if(!a)return e;if(a=a.map(function(E){return(E=splitColor(E,r,1))&&l+(r?E[0]+","+E[1]+"%,"+E[2]+"%,"+E[3]:E.join(","))+")"}),t&&(h=_colorOrderData(e),f=t.c,f.join(n)!==h.c.join(n)))for(d=e.replace(_colorExp,"1").split(_numWithUnitExp),y=d.length-1;u<y;u++)n+=d[u]+(~f.indexOf(u)?a.shift()||l+"0,0,0,0)":(h.length?h:a.length?a:t).shift());if(!d)for(d=e.split(_colorExp),y=d.length-1;u<y;u++)n+=d[u]+a[u];return n+d[y]},_colorExp=function(){var o="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in _colorLookup)o+="|"+e+"\\b";return new RegExp(o+")","gi")}(),_hslExp=/hsl[a]?\(/,_colorStringFilter=function o(e){var r=e.join(" "),t;if(_colorExp.lastIndex=0,_colorExp.test(r))return t=_hslExp.test(r),e[1]=_formatColors(e[1],t),e[0]=_formatColors(e[0],t,_colorOrderData(e[1])),!0},_tickerActive,_ticker=function(){var o=Date.now,e=500,r=33,t=o(),n=t,a=1e3/240,l=a,u=[],f,d,h,y,E,p,_=function g(x){var C=o()-n,R=x===!0,S,A,T,w;if(C>e&&(t+=C-r),n+=C,T=n-t,S=T-l,(S>0||R)&&(w=++y.frame,E=T-y.time*1e3,y.time=T=T/1e3,l+=S+(S>=a?4:a-S),A=1),R||(f=d(g)),A)for(p=0;p<u.length;p++)u[p](T,E,w,x)};return y={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(x){return E/(1e3/(x||60))},wake:function(){_coreReady&&(!_coreInitted&&_windowExists$1()&&(_win$1=_coreInitted=window,_doc$1=_win$1.document||{},_globals.gsap=gsap,(_win$1.gsapVersions||(_win$1.gsapVersions=[])).push(gsap.version),_install(_installScope||_win$1.GreenSockGlobals||!_win$1.gsap&&_win$1||{}),h=_win$1.requestAnimationFrame,_registerPluginQueue.forEach(_createPlugin)),f&&y.sleep(),d=h||function(x){return setTimeout(x,l-y.time*1e3+1|0)},_tickerActive=1,_(2))},sleep:function(){(h?_win$1.cancelAnimationFrame:clearTimeout)(f),_tickerActive=0,d=_emptyFunc},lagSmoothing:function(x,C){e=x||1/0,r=Math.min(C||33,e)},fps:function(x){a=1e3/(x||240),l=y.time*1e3+a},add:function(x,C,R){var S=C?function(A,T,w,P){x(A,T,w,P),y.remove(S)}:x;return y.remove(x),u[R?"unshift":"push"](S),_wake(),S},remove:function(x,C){~(C=u.indexOf(x))&&u.splice(C,1)&&p>=C&&p--},_listeners:u},y}(),_wake=function o(){return!_tickerActive&&_ticker.wake()},_easeMap={},_customEaseExp=/^[\d.\-M][\d.\-,\s]/,_quotesExp=/["']/g,_parseObjectInString=function o(e){for(var r={},t=e.substr(1,e.length-3).split(":"),n=t[0],a=1,l=t.length,u,f,d;a<l;a++)f=t[a],u=a!==l-1?f.lastIndexOf(","):f.length,d=f.substr(0,u),r[n]=isNaN(d)?d.replace(_quotesExp,"").trim():+d,n=f.substr(u+1).trim();return r},_valueInParentheses=function o(e){var r=e.indexOf("(")+1,t=e.indexOf(")"),n=e.indexOf("(",r);return e.substring(r,~n&&n<t?e.indexOf(")",t+1):t)},_configEaseFromString=function o(e){var r=(e+"").split("("),t=_easeMap[r[0]];return t&&r.length>1&&t.config?t.config.apply(null,~e.indexOf("{")?[_parseObjectInString(r[1])]:_valueInParentheses(e).split(",").map(_numericIfPossible)):_easeMap._CE&&_customEaseExp.test(e)?_easeMap._CE("",e):t},_invertEase=function o(e){return function(r){return 1-e(1-r)}},_propagateYoyoEase=function o(e,r){for(var t=e._first,n;t;)t instanceof Timeline?o(t,r):t.vars.yoyoEase&&(!t._yoyo||!t._repeat)&&t._yoyo!==r&&(t.timeline?o(t.timeline,r):(n=t._ease,t._ease=t._yEase,t._yEase=n,t._yoyo=r)),t=t._next},_parseEase=function o(e,r){return e&&(_isFunction(e)?e:_easeMap[e]||_configEaseFromString(e))||r},_insertEase=function o(e,r,t,n){t===void 0&&(t=function(f){return 1-r(1-f)}),n===void 0&&(n=function(f){return f<.5?r(f*2)/2:1-r((1-f)*2)/2});var a={easeIn:r,easeOut:t,easeInOut:n},l;return _forEachName(e,function(u){_easeMap[u]=_globals[u]=a,_easeMap[l=u.toLowerCase()]=t;for(var f in a)_easeMap[l+(f==="easeIn"?".in":f==="easeOut"?".out":".inOut")]=_easeMap[u+"."+f]=a[f]}),a},_easeInOutFromOut=function o(e){return function(r){return r<.5?(1-e(1-r*2))/2:.5+e((r-.5)*2)/2}},_configElastic=function o(e,r,t){var n=r>=1?r:1,a=(t||(e?.3:.45))/(r<1?r:1),l=a/_2PI*(Math.asin(1/n)||0),u=function(h){return h===1?1:n*Math.pow(2,-10*h)*_sin((h-l)*a)+1},f=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:_easeInOutFromOut(u);return a=_2PI/a,f.config=function(d,h){return o(e,d,h)},f},_configBack=function o(e,r){r===void 0&&(r=1.70158);var t=function(l){return l?--l*l*((r+1)*l+r)+1:0},n=e==="out"?t:e==="in"?function(a){return 1-t(1-a)}:_easeInOutFromOut(t);return n.config=function(a){return o(e,a)},n};_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong",function(o,e){var r=e<5?e+1:e;_insertEase(o+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(t*2,r)/2:1-Math.pow((1-t)*2,r)/2})});_easeMap.Linear.easeNone=_easeMap.none=_easeMap.Linear.easeIn;_insertEase("Elastic",_configElastic("in"),_configElastic("out"),_configElastic());(function(o,e){var r=1/e,t=2*r,n=2.5*r,a=function(u){return u<r?o*u*u:u<t?o*Math.pow(u-1.5/e,2)+.75:u<n?o*(u-=2.25/e)*u+.9375:o*Math.pow(u-2.625/e,2)+.984375};_insertEase("Bounce",function(l){return 1-a(1-l)},a)})(7.5625,2.75);_insertEase("Expo",function(o){return o?Math.pow(2,10*(o-1)):0});_insertEase("Circ",function(o){return-(_sqrt(1-o*o)-1)});_insertEase("Sine",function(o){return o===1?1:-_cos(o*_HALF_PI)+1});_insertEase("Back",_configBack("in"),_configBack("out"),_configBack());_easeMap.SteppedEase=_easeMap.steps=_globals.SteppedEase={config:function o(e,r){e===void 0&&(e=1);var t=1/e,n=e+(r?0:1),a=r?1:0,l=1-_tinyNum;return function(u){return((n*_clamp(0,l,u)|0)+a)*t}}};_defaults.ease=_easeMap["quad.out"];_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(o){return _callbackNames+=o+","+o+"Params,"});var GSCache=function o(e,r){this.id=_gsID++,e._gsap=this,this.target=e,this.harness=r,this.get=r?r.get:_getProperty,this.set=r?r.getSetter:_getSetter},Animation=function(){function o(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,_setDuration(this,+r.duration,1,1),this.data=r.data,_context&&(this._ctx=_context,_context.data.push(this)),_tickerActive||_ticker.wake()}var e=o.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,_setDuration(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(_wake(),!arguments.length)return this._tTime;var a=this._dp;if(a&&a.smoothChildTiming&&this._ts){for(_alignPlayhead(this,t),!a._dp||a.parent||_postAddChecks(a,this);a&&a.parent;)a.parent._time!==a._start+(a._ts>=0?a._tTime/a._ts:(a.totalDuration()-a._tTime)/-a._ts)&&a.totalTime(a._tTime,!0),a=a.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&_addToTimeline(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===_tinyNum||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),_lazySafeRender(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+_elapsedCycleDuration(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+_elapsedCycleDuration(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var a=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*a,n):this._repeat?_animationCycle(this._tTime,a)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-_tinyNum?0:this._rts;if(this._rts===t)return this;var a=this.parent&&this._ts?_parentToChildTotalTime(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-_tinyNum?0:this._rts,this.totalTime(_clamp(-Math.abs(this._delay),this._tDur,a),n!==!1),_setEnd(this),_recacheAncestors(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(_wake(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==_tinyNum&&(this._tTime-=_tinyNum)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&_addToTimeline(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(_isNotFalse(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?_parentToChildTotalTime(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=_revertConfig);var n=_reverting$1;return _reverting$1=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),_reverting$1=n,this},e.globalTime=function(t){for(var n=this,a=arguments.length?t:n.rawTime();n;)a=n._start+a/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):a},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,_onUpdateTotalDuration(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,_onUpdateTotalDuration(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(_parsePosition(this,t),_isNotFalse(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,_isNotFalse(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-_tinyNum:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-_tinyNum,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,a;return!!(!t||this._ts&&this._initted&&t.isActive()&&(a=t.rawTime(!0))>=n&&a<this.endTime(!0)-_tinyNum)},e.eventCallback=function(t,n,a){var l=this.vars;return arguments.length>1?(n?(l[t]=n,a&&(l[t+"Params"]=a),t==="onUpdate"&&(this._onUpdate=n)):delete l[t],this):l[t]},e.then=function(t){var n=this;return new Promise(function(a){var l=_isFunction(t)?t:_passThrough,u=function(){var d=n.then;n.then=null,_isFunction(l)&&(l=l(n))&&(l.then||l===n)&&(n.then=d),a(l),n.then=d};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?u():n._prom=u})},e.kill=function(){_interrupt(this)},o}();_setDefaults(Animation.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-_tinyNum,_prom:0,_ps:!1,_rts:1});var Timeline=function(o){_inheritsLoose(e,o);function e(t,n){var a;return t===void 0&&(t={}),a=o.call(this,t)||this,a.labels={},a.smoothChildTiming=!!t.smoothChildTiming,a.autoRemoveChildren=!!t.autoRemoveChildren,a._sort=_isNotFalse(t.sortChildren),_globalTimeline&&_addToTimeline(t.parent||_globalTimeline,_assertThisInitialized(a),n),t.reversed&&a.reverse(),t.paused&&a.paused(!0),t.scrollTrigger&&_scrollTrigger(_assertThisInitialized(a),t.scrollTrigger),a}var r=e.prototype;return r.to=function(n,a,l){return _createTweenType(0,arguments,this),this},r.from=function(n,a,l){return _createTweenType(1,arguments,this),this},r.fromTo=function(n,a,l,u){return _createTweenType(2,arguments,this),this},r.set=function(n,a,l){return a.duration=0,a.parent=this,_inheritDefaults(a).repeatDelay||(a.repeat=0),a.immediateRender=!!a.immediateRender,new Tween(n,a,_parsePosition(this,l),1),this},r.call=function(n,a,l){return _addToTimeline(this,Tween.delayedCall(0,n,a),l)},r.staggerTo=function(n,a,l,u,f,d,h){return l.duration=a,l.stagger=l.stagger||u,l.onComplete=d,l.onCompleteParams=h,l.parent=this,new Tween(n,l,_parsePosition(this,f)),this},r.staggerFrom=function(n,a,l,u,f,d,h){return l.runBackwards=1,_inheritDefaults(l).immediateRender=_isNotFalse(l.immediateRender),this.staggerTo(n,a,l,u,f,d,h)},r.staggerFromTo=function(n,a,l,u,f,d,h,y){return u.startAt=l,_inheritDefaults(u).immediateRender=_isNotFalse(u.immediateRender),this.staggerTo(n,a,u,f,d,h,y)},r.render=function(n,a,l){var u=this._time,f=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=n<=0?0:_roundPrecise(n),y=this._zTime<0!=n<0&&(this._initted||!d),E,p,_,g,x,C,R,S,A,T,w,P;if(this!==_globalTimeline&&h>f&&n>=0&&(h=f),h!==this._tTime||l||y){if(u!==this._time&&d&&(h+=this._time-u,n+=this._time-u),E=h,A=this._start,S=this._ts,C=!S,y&&(d||(u=this._zTime),(n||!a)&&(this._zTime=n)),this._repeat){if(w=this._yoyo,x=d+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(x*100+n,a,l);if(E=_roundPrecise(h%x),h===f?(g=this._repeat,E=d):(g=~~(h/x),g&&g===h/x&&(E=d,g--),E>d&&(E=d)),T=_animationCycle(this._tTime,x),!u&&this._tTime&&T!==g&&this._tTime-T*x-this._dur<=0&&(T=g),w&&g&1&&(E=d-E,P=1),g!==T&&!this._lock){var O=w&&T&1,k=O===(w&&g&1);if(g<T&&(O=!O),u=O?0:h%d?d:h,this._lock=1,this.render(u||(P?0:_roundPrecise(g*x)),a,!d)._lock=0,this._tTime=h,!a&&this.parent&&_callback(this,"onRepeat"),this.vars.repeatRefresh&&!P&&(this.invalidate()._lock=1),u&&u!==this._time||C!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,f=this._tDur,k&&(this._lock=2,u=O?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!P&&this.invalidate()),this._lock=0,!this._ts&&!C)return this;_propagateYoyoEase(this,P)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(R=_findNextPauseTween(this,_roundPrecise(u),_roundPrecise(E)),R&&(h-=E-(E=R._start))),this._tTime=h,this._time=E,this._act=!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,u=0),!u&&E&&!a&&!g&&(_callback(this,"onStart"),this._tTime!==h))return this;if(E>=u&&n>=0)for(p=this._first;p;){if(_=p._next,(p._act||E>=p._start)&&p._ts&&R!==p){if(p.parent!==this)return this.render(n,a,l);if(p.render(p._ts>0?(E-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(E-p._start)*p._ts,a,l),E!==this._time||!this._ts&&!C){R=0,_&&(h+=this._zTime=-_tinyNum);break}}p=_}else{p=this._last;for(var D=n<0?n:E;p;){if(_=p._prev,(p._act||D<=p._end)&&p._ts&&R!==p){if(p.parent!==this)return this.render(n,a,l);if(p.render(p._ts>0?(D-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(D-p._start)*p._ts,a,l||_reverting$1&&(p._initted||p._startAt)),E!==this._time||!this._ts&&!C){R=0,_&&(h+=this._zTime=D?-_tinyNum:_tinyNum);break}}p=_}}if(R&&!a&&(this.pause(),R.render(E>=u?0:-_tinyNum)._zTime=E>=u?1:-1,this._ts))return this._start=A,_setEnd(this),this.render(n,a,l);this._onUpdate&&!a&&_callback(this,"onUpdate",!0),(h===f&&this._tTime>=this.totalDuration()||!h&&u)&&(A===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((n||!d)&&(h===f&&this._ts>0||!h&&this._ts<0)&&_removeFromParent(this,1),!a&&!(n<0&&!u)&&(h||u||!f)&&(_callback(this,h===f&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<f&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(n,a){var l=this;if(_isNumber(a)||(a=_parsePosition(this,a,n)),!(n instanceof Animation)){if(_isArray(n))return n.forEach(function(u){return l.add(u,a)}),this;if(_isString(n))return this.addLabel(n,a);if(_isFunction(n))n=Tween.delayedCall(0,n);else return this}return this!==n?_addToTimeline(this,n,a):this},r.getChildren=function(n,a,l,u){n===void 0&&(n=!0),a===void 0&&(a=!0),l===void 0&&(l=!0),u===void 0&&(u=-_bigNum$1);for(var f=[],d=this._first;d;)d._start>=u&&(d instanceof Tween?a&&f.push(d):(l&&f.push(d),n&&f.push.apply(f,d.getChildren(!0,a,l)))),d=d._next;return f},r.getById=function(n){for(var a=this.getChildren(1,1,1),l=a.length;l--;)if(a[l].vars.id===n)return a[l]},r.remove=function(n){return _isString(n)?this.removeLabel(n):_isFunction(n)?this.killTweensOf(n):(_removeLinkedListItem(this,n),n===this._recent&&(this._recent=this._last),_uncache(this))},r.totalTime=function(n,a){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=_roundPrecise(_ticker.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),o.prototype.totalTime.call(this,n,a),this._forcing=0,this):this._tTime},r.addLabel=function(n,a){return this.labels[n]=_parsePosition(this,a),this},r.removeLabel=function(n){return delete this.labels[n],this},r.addPause=function(n,a,l){var u=Tween.delayedCall(0,a||_emptyFunc,l);return u.data="isPause",this._hasPause=1,_addToTimeline(this,u,_parsePosition(this,n))},r.removePause=function(n){var a=this._first;for(n=_parsePosition(this,n);a;)a._start===n&&a.data==="isPause"&&_removeFromParent(a),a=a._next},r.killTweensOf=function(n,a,l){for(var u=this.getTweensOf(n,l),f=u.length;f--;)_overwritingTween!==u[f]&&u[f].kill(n,a);return this},r.getTweensOf=function(n,a){for(var l=[],u=toArray(n),f=this._first,d=_isNumber(a),h;f;)f instanceof Tween?_arrayContainsAny(f._targets,u)&&(d?(!_overwritingTween||f._initted&&f._ts)&&f.globalTime(0)<=a&&f.globalTime(f.totalDuration())>a:!a||f.isActive())&&l.push(f):(h=f.getTweensOf(u,a)).length&&l.push.apply(l,h),f=f._next;return l},r.tweenTo=function(n,a){a=a||{};var l=this,u=_parsePosition(l,n),f=a,d=f.startAt,h=f.onStart,y=f.onStartParams,E=f.immediateRender,p,_=Tween.to(l,_setDefaults({ease:a.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:a.duration||Math.abs((u-(d&&"time"in d?d.time:l._time))/l.timeScale())||_tinyNum,onStart:function(){if(l.pause(),!p){var x=a.duration||Math.abs((u-(d&&"time"in d?d.time:l._time))/l.timeScale());_._dur!==x&&_setDuration(_,x,0,1).render(_._time,!0,!0),p=1}h&&h.apply(_,y||[])}},a));return E?_.render(0):_},r.tweenFromTo=function(n,a,l){return this.tweenTo(a,_setDefaults({startAt:{time:_parsePosition(this,n)}},l))},r.recent=function(){return this._recent},r.nextLabel=function(n){return n===void 0&&(n=this._time),_getLabelInDirection(this,_parsePosition(this,n))},r.previousLabel=function(n){return n===void 0&&(n=this._time),_getLabelInDirection(this,_parsePosition(this,n),1)},r.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+_tinyNum)},r.shiftChildren=function(n,a,l){l===void 0&&(l=0);for(var u=this._first,f=this.labels,d;u;)u._start>=l&&(u._start+=n,u._end+=n),u=u._next;if(a)for(d in f)f[d]>=l&&(f[d]+=n);return _uncache(this)},r.invalidate=function(n){var a=this._first;for(this._lock=0;a;)a.invalidate(n),a=a._next;return o.prototype.invalidate.call(this,n)},r.clear=function(n){n===void 0&&(n=!0);for(var a=this._first,l;a;)l=a._next,this.remove(a),a=l;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),_uncache(this)},r.totalDuration=function(n){var a=0,l=this,u=l._last,f=_bigNum$1,d,h,y;if(arguments.length)return l.timeScale((l._repeat<0?l.duration():l.totalDuration())/(l.reversed()?-n:n));if(l._dirty){for(y=l.parent;u;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>f&&l._sort&&u._ts&&!l._lock?(l._lock=1,_addToTimeline(l,u,h-u._delay,1)._lock=0):f=h,h<0&&u._ts&&(a-=h,(!y&&!l._dp||y&&y.smoothChildTiming)&&(l._start+=h/l._ts,l._time-=h,l._tTime-=h),l.shiftChildren(-h,!1,-1/0),f=0),u._end>a&&u._ts&&(a=u._end),u=d;_setDuration(l,l===_globalTimeline&&l._time>a?l._time:a,1,1),l._dirty=0}return l._tDur},e.updateRoot=function(n){if(_globalTimeline._ts&&(_lazySafeRender(_globalTimeline,_parentToChildTotalTime(n,_globalTimeline)),_lastRenderedFrame=_ticker.frame),_ticker.frame>=_nextGCFrame){_nextGCFrame+=_config.autoSleep||120;var a=_globalTimeline._first;if((!a||!a._ts)&&_config.autoSleep&&_ticker._listeners.length<2){for(;a&&!a._ts;)a=a._next;a||_ticker.sleep()}}},e}(Animation);_setDefaults(Timeline.prototype,{_lock:0,_hasPause:0,_forcing:0});var _addComplexStringPropTween=function o(e,r,t,n,a,l,u){var f=new PropTween(this._pt,e,r,0,1,_renderComplexString,null,a),d=0,h=0,y,E,p,_,g,x,C,R;for(f.b=t,f.e=n,t+="",n+="",(C=~n.indexOf("random("))&&(n=_replaceRandom(n)),l&&(R=[t,n],l(R,e,r),t=R[0],n=R[1]),E=t.match(_complexStringNumExp)||[];y=_complexStringNumExp.exec(n);)_=y[0],g=n.substring(d,y.index),p?p=(p+1)%5:g.substr(-5)==="rgba("&&(p=1),_!==E[h++]&&(x=parseFloat(E[h-1])||0,f._pt={_next:f._pt,p:g||h===1?g:",",s:x,c:_.charAt(1)==="="?_parseRelative(x,_)-x:parseFloat(_)-x,m:p&&p<4?Math.round:0},d=_complexStringNumExp.lastIndex);return f.c=d<n.length?n.substring(d,n.length):"",f.fp=u,(_relExp.test(n)||C)&&(f.e=0),this._pt=f,f},_addPropTween=function o(e,r,t,n,a,l,u,f,d,h){_isFunction(n)&&(n=n(a||0,e,l));var y=e[r],E=t!=="get"?t:_isFunction(y)?d?e[r.indexOf("set")||!_isFunction(e["get"+r.substr(3)])?r:"get"+r.substr(3)](d):e[r]():y,p=_isFunction(y)?d?_setterFuncWithParam:_setterFunc:_setterPlain,_;if(_isString(n)&&(~n.indexOf("random(")&&(n=_replaceRandom(n)),n.charAt(1)==="="&&(_=_parseRelative(E,n)+(getUnit(E)||0),(_||_===0)&&(n=_))),!h||E!==n||_forceAllPropTweens)return!isNaN(E*n)&&n!==""?(_=new PropTween(this._pt,e,r,+E||0,n-(E||0),typeof y=="boolean"?_renderBoolean:_renderPlain,0,p),d&&(_.fp=d),u&&_.modifier(u,this,e),this._pt=_):(!y&&!(r in e)&&_missingPlugin(r,n),_addComplexStringPropTween.call(this,e,r,E,n,p,f||_config.stringFilter,d))},_processVars=function o(e,r,t,n,a){if(_isFunction(e)&&(e=_parseFuncOrString(e,a,r,t,n)),!_isObject(e)||e.style&&e.nodeType||_isArray(e)||_isTypedArray(e))return _isString(e)?_parseFuncOrString(e,a,r,t,n):e;var l={},u;for(u in e)l[u]=_parseFuncOrString(e[u],a,r,t,n);return l},_checkPlugin=function o(e,r,t,n,a,l){var u,f,d,h;if(_plugins[e]&&(u=new _plugins[e]).init(a,u.rawVars?r[e]:_processVars(r[e],n,a,l,t),t,n,l)!==!1&&(t._pt=f=new PropTween(t._pt,a,e,0,1,u.render,u,0,u.priority),t!==_quickTween))for(d=t._ptLookup[t._targets.indexOf(a)],h=u._props.length;h--;)d[u._props[h]]=f;return u},_overwritingTween,_forceAllPropTweens,_initTween=function o(e,r,t){var n=e.vars,a=n.ease,l=n.startAt,u=n.immediateRender,f=n.lazy,d=n.onUpdate,h=n.runBackwards,y=n.yoyoEase,E=n.keyframes,p=n.autoRevert,_=e._dur,g=e._startAt,x=e._targets,C=e.parent,R=C&&C.data==="nested"?C.vars.targets:x,S=e._overwrite==="auto"&&!_suppressOverwrites,A=e.timeline,T,w,P,O,k,D,F,G,V,W,ee,q,z;if(A&&(!E||!a)&&(a="none"),e._ease=_parseEase(a,_defaults.ease),e._yEase=y?_invertEase(_parseEase(y===!0?a:y,_defaults.ease)):0,y&&e._yoyo&&!e._repeat&&(y=e._yEase,e._yEase=e._ease,e._ease=y),e._from=!A&&!!n.runBackwards,!A||E&&!n.stagger){if(G=x[0]?_getCache(x[0]).harness:0,q=G&&n[G.prop],T=_copyExcluding(n,_reservedProps),g&&(g._zTime<0&&g.progress(1),r<0&&h&&u&&!p?g.render(-1,!0):g.revert(h&&_?_revertConfigNoKill:_startAtRevertConfig),g._lazy=0),l){if(_removeFromParent(e._startAt=Tween.set(x,_setDefaults({data:"isStart",overwrite:!1,parent:C,immediateRender:!0,lazy:!g&&_isNotFalse(f),startAt:null,delay:0,onUpdate:d&&function(){return _callback(e,"onUpdate")},stagger:0},l))),e._startAt._dp=0,e._startAt._sat=e,r<0&&(_reverting$1||!u&&!p)&&e._startAt.revert(_revertConfigNoKill),u&&_&&r<=0&&t<=0){r&&(e._zTime=r);return}}else if(h&&_&&!g){if(r&&(u=!1),P=_setDefaults({overwrite:!1,data:"isFromStart",lazy:u&&!g&&_isNotFalse(f),immediateRender:u,stagger:0,parent:C},T),q&&(P[G.prop]=q),_removeFromParent(e._startAt=Tween.set(x,P)),e._startAt._dp=0,e._startAt._sat=e,r<0&&(_reverting$1?e._startAt.revert(_revertConfigNoKill):e._startAt.render(-1,!0)),e._zTime=r,!u)o(e._startAt,_tinyNum,_tinyNum);else if(!r)return}for(e._pt=e._ptCache=0,f=_&&_isNotFalse(f)||f&&!_,w=0;w<x.length;w++){if(k=x[w],F=k._gsap||_harness(x)[w]._gsap,e._ptLookup[w]=W={},_lazyLookup[F.id]&&_lazyTweens.length&&_lazyRender(),ee=R===x?w:R.indexOf(k),G&&(V=new G).init(k,q||T,e,ee,R)!==!1&&(e._pt=O=new PropTween(e._pt,k,V.name,0,1,V.render,V,0,V.priority),V._props.forEach(function(U){W[U]=O}),V.priority&&(D=1)),!G||q)for(P in T)_plugins[P]&&(V=_checkPlugin(P,T,e,ee,k,R))?V.priority&&(D=1):W[P]=O=_addPropTween.call(e,k,P,"get",T[P],ee,R,0,n.stringFilter);e._op&&e._op[w]&&e.kill(k,e._op[w]),S&&e._pt&&(_overwritingTween=e,_globalTimeline.killTweensOf(k,W,e.globalTime(r)),z=!e.parent,_overwritingTween=0),e._pt&&f&&(_lazyLookup[F.id]=1)}D&&_sortPropTweensByPriority(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!z,E&&r<=0&&A.render(_bigNum$1,!0,!0)},_updatePropTweens=function o(e,r,t,n,a,l,u,f){var d=(e._pt&&e._ptCache||(e._ptCache={}))[r],h,y,E,p;if(!d)for(d=e._ptCache[r]=[],E=e._ptLookup,p=e._targets.length;p--;){if(h=E[p][r],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==r&&h.fp!==r;)h=h._next;if(!h)return _forceAllPropTweens=1,e.vars[r]="+=0",_initTween(e,u),_forceAllPropTweens=0,f?_warn(r+" not eligible for reset"):1;d.push(h)}for(p=d.length;p--;)y=d[p],h=y._pt||y,h.s=(n||n===0)&&!a?n:h.s+(n||0)+l*h.c,h.c=t-h.s,y.e&&(y.e=_round(t)+getUnit(y.e)),y.b&&(y.b=h.s+getUnit(y.b))},_addAliasesToVars=function o(e,r){var t=e[0]?_getCache(e[0]).harness:0,n=t&&t.aliases,a,l,u,f;if(!n)return r;a=_merge({},r);for(l in n)if(l in a)for(f=n[l].split(","),u=f.length;u--;)a[f[u]]=a[l];return a},_parseKeyframe=function o(e,r,t,n){var a=r.ease||n||"power1.inOut",l,u;if(_isArray(r))u=t[e]||(t[e]=[]),r.forEach(function(f,d){return u.push({t:d/(r.length-1)*100,v:f,e:a})});else for(l in r)u=t[l]||(t[l]=[]),l==="ease"||u.push({t:parseFloat(e),v:r[l],e:a})},_parseFuncOrString=function o(e,r,t,n,a){return _isFunction(e)?e.call(r,t,n,a):_isString(e)&&~e.indexOf("random(")?_replaceRandom(e):e},_staggerTweenProps=_callbackNames+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",_staggerPropsToSkip={};_forEachName(_staggerTweenProps+",id,stagger,delay,duration,paused,scrollTrigger",function(o){return _staggerPropsToSkip[o]=1});var Tween=function(o){_inheritsLoose(e,o);function e(t,n,a,l){var u;typeof n=="number"&&(a.duration=n,n=a,a=null),u=o.call(this,l?n:_inheritDefaults(n))||this;var f=u.vars,d=f.duration,h=f.delay,y=f.immediateRender,E=f.stagger,p=f.overwrite,_=f.keyframes,g=f.defaults,x=f.scrollTrigger,C=f.yoyoEase,R=n.parent||_globalTimeline,S=(_isArray(t)||_isTypedArray(t)?_isNumber(t[0]):"length"in n)?[t]:toArray(t),A,T,w,P,O,k,D,F;if(u._targets=S.length?_harness(S):_warn("GSAP target "+t+" not found. https://gsap.com",!_config.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=p,_||E||_isFuncOrString(d)||_isFuncOrString(h)){if(n=u.vars,A=u.timeline=new Timeline({data:"nested",defaults:g||{},targets:R&&R.data==="nested"?R.vars.targets:S}),A.kill(),A.parent=A._dp=_assertThisInitialized(u),A._start=0,E||_isFuncOrString(d)||_isFuncOrString(h)){if(P=S.length,D=E&&distribute(E),_isObject(E))for(O in E)~_staggerTweenProps.indexOf(O)&&(F||(F={}),F[O]=E[O]);for(T=0;T<P;T++)w=_copyExcluding(n,_staggerPropsToSkip),w.stagger=0,C&&(w.yoyoEase=C),F&&_merge(w,F),k=S[T],w.duration=+_parseFuncOrString(d,_assertThisInitialized(u),T,k,S),w.delay=(+_parseFuncOrString(h,_assertThisInitialized(u),T,k,S)||0)-u._delay,!E&&P===1&&w.delay&&(u._delay=h=w.delay,u._start+=h,w.delay=0),A.to(k,w,D?D(T,k,S):0),A._ease=_easeMap.none;A.duration()?d=h=0:u.timeline=0}else if(_){_inheritDefaults(_setDefaults(A.vars.defaults,{ease:"none"})),A._ease=_parseEase(_.ease||n.ease||"none");var G=0,V,W,ee;if(_isArray(_))_.forEach(function(q){return A.to(S,q,">")}),A.duration();else{w={};for(O in _)O==="ease"||O==="easeEach"||_parseKeyframe(O,_[O],w,_.easeEach);for(O in w)for(V=w[O].sort(function(q,z){return q.t-z.t}),G=0,T=0;T<V.length;T++)W=V[T],ee={ease:W.e,duration:(W.t-(T?V[T-1].t:0))/100*d},ee[O]=W.v,A.to(S,ee,G),G+=ee.duration;A.duration()<d&&A.to({},{duration:d-A.duration()})}}d||u.duration(d=A.duration())}else u.timeline=0;return p===!0&&!_suppressOverwrites&&(_overwritingTween=_assertThisInitialized(u),_globalTimeline.killTweensOf(S),_overwritingTween=0),_addToTimeline(R,_assertThisInitialized(u),a),n.reversed&&u.reverse(),n.paused&&u.paused(!0),(y||!d&&!_&&u._start===_roundPrecise(R._time)&&_isNotFalse(y)&&_hasNoPausedAncestors(_assertThisInitialized(u))&&R.data!=="nested")&&(u._tTime=-_tinyNum,u.render(Math.max(0,-h)||0)),x&&_scrollTrigger(_assertThisInitialized(u),x),u}var r=e.prototype;return r.render=function(n,a,l){var u=this._time,f=this._tDur,d=this._dur,h=n<0,y=n>f-_tinyNum&&!h?f:n<_tinyNum?0:n,E,p,_,g,x,C,R,S,A;if(!d)_renderZeroDurationTween(this,n,a,l);else if(y!==this._tTime||!n||l||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h){if(E=y,S=this.timeline,this._repeat){if(g=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(g*100+n,a,l);if(E=_roundPrecise(y%g),y===f?(_=this._repeat,E=d):(_=~~(y/g),_&&_===_roundPrecise(y/g)&&(E=d,_--),E>d&&(E=d)),C=this._yoyo&&_&1,C&&(A=this._yEase,E=d-E),x=_animationCycle(this._tTime,g),E===u&&!l&&this._initted&&_===x)return this._tTime=y,this;_!==x&&(S&&this._yEase&&_propagateYoyoEase(S,C),this.vars.repeatRefresh&&!C&&!this._lock&&this._time!==d&&this._initted&&(this._lock=l=1,this.render(_roundPrecise(g*_),!0).invalidate()._lock=0))}if(!this._initted){if(_attemptInitTween(this,h?n:E,l,a,y))return this._tTime=0,this;if(u!==this._time&&!(l&&this.vars.repeatRefresh&&_!==x))return this;if(d!==this._dur)return this.render(n,a,l)}if(this._tTime=y,this._time=E,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=R=(A||this._ease)(E/d),this._from&&(this.ratio=R=1-R),E&&!u&&!a&&!_&&(_callback(this,"onStart"),this._tTime!==y))return this;for(p=this._pt;p;)p.r(R,p.d),p=p._next;S&&S.render(n<0?n:!E&&C?-_tinyNum:S._dur*S._ease(E/this._dur),a,l)||this._startAt&&(this._zTime=n),this._onUpdate&&!a&&(h&&_rewindStartAt(this,n,a,l),_callback(this,"onUpdate")),this._repeat&&_!==x&&this.vars.onRepeat&&!a&&this.parent&&_callback(this,"onRepeat"),(y===this._tDur||!y)&&this._tTime===y&&(h&&!this._onUpdate&&_rewindStartAt(this,n,!0,!0),(n||!d)&&(y===this._tDur&&this._ts>0||!y&&this._ts<0)&&_removeFromParent(this,1),!a&&!(h&&!u)&&(y||u||C)&&(_callback(this,y===f?"onComplete":"onReverseComplete",!0),this._prom&&!(y<f&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),o.prototype.invalidate.call(this,n)},r.resetTo=function(n,a,l,u,f){_tickerActive||_ticker.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||_initTween(this,d),h=this._ease(d/this._dur),_updatePropTweens(this,n,a,l,u,h,d,f)?this.resetTo(n,a,l,u,1):(_alignPlayhead(this,0),this.parent||_addLinkedListItem(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(n,a){if(a===void 0&&(a="all"),!n&&(!a||a==="all"))return this._lazy=this._pt=0,this.parent?_interrupt(this):this;if(this.timeline){var l=this.timeline.totalDuration();return this.timeline.killTweensOf(n,a,_overwritingTween&&_overwritingTween.vars.overwrite!==!0)._first||_interrupt(this),this.parent&&l!==this.timeline.totalDuration()&&_setDuration(this,this._dur*this.timeline._tDur/l,0,1),this}var u=this._targets,f=n?toArray(n):u,d=this._ptLookup,h=this._pt,y,E,p,_,g,x,C;if((!a||a==="all")&&_arraysMatch(u,f))return a==="all"&&(this._pt=0),_interrupt(this);for(y=this._op=this._op||[],a!=="all"&&(_isString(a)&&(g={},_forEachName(a,function(R){return g[R]=1}),a=g),a=_addAliasesToVars(u,a)),C=u.length;C--;)if(~f.indexOf(u[C])){E=d[C],a==="all"?(y[C]=a,_=E,p={}):(p=y[C]=y[C]||{},_=a);for(g in _)x=E&&E[g],x&&((!("kill"in x.d)||x.d.kill(g)===!0)&&_removeLinkedListItem(this,x,"_pt"),delete E[g]),p!=="all"&&(p[g]=1)}return this._initted&&!this._pt&&h&&_interrupt(this),this},e.to=function(n,a){return new e(n,a,arguments[2])},e.from=function(n,a){return _createTweenType(1,arguments)},e.delayedCall=function(n,a,l,u){return new e(a,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:a,onReverseComplete:a,onCompleteParams:l,onReverseCompleteParams:l,callbackScope:u})},e.fromTo=function(n,a,l){return _createTweenType(2,arguments)},e.set=function(n,a){return a.duration=0,a.repeatDelay||(a.repeat=0),new e(n,a)},e.killTweensOf=function(n,a,l){return _globalTimeline.killTweensOf(n,a,l)},e}(Animation);_setDefaults(Tween.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});_forEachName("staggerTo,staggerFrom,staggerFromTo",function(o){Tween[o]=function(){var e=new Timeline,r=_slice.call(arguments,0);return r.splice(o==="staggerFromTo"?5:4,0,0),e[o].apply(e,r)}});var _setterPlain=function o(e,r,t){return e[r]=t},_setterFunc=function o(e,r,t){return e[r](t)},_setterFuncWithParam=function o(e,r,t,n){return e[r](n.fp,t)},_setterAttribute=function o(e,r,t){return e.setAttribute(r,t)},_getSetter=function o(e,r){return _isFunction(e[r])?_setterFunc:_isUndefined(e[r])&&e.setAttribute?_setterAttribute:_setterPlain},_renderPlain=function o(e,r){return r.set(r.t,r.p,Math.round((r.s+r.c*e)*1e6)/1e6,r)},_renderBoolean=function o(e,r){return r.set(r.t,r.p,!!(r.s+r.c*e),r)},_renderComplexString=function o(e,r){var t=r._pt,n="";if(!e&&r.b)n=r.b;else if(e===1&&r.e)n=r.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*e):Math.round((t.s+t.c*e)*1e4)/1e4)+n,t=t._next;n+=r.c}r.set(r.t,r.p,n,r)},_renderPropTweens=function o(e,r){for(var t=r._pt;t;)t.r(e,t.d),t=t._next},_addPluginModifier=function o(e,r,t,n){for(var a=this._pt,l;a;)l=a._next,a.p===n&&a.modifier(e,r,t),a=l},_killPropTweensOf=function o(e){for(var r=this._pt,t,n;r;)n=r._next,r.p===e&&!r.op||r.op===e?_removeLinkedListItem(this,r,"_pt"):r.dep||(t=1),r=n;return!t},_setterWithModifier=function o(e,r,t,n){n.mSet(e,r,n.m.call(n.tween,t,n.mt),n)},_sortPropTweensByPriority=function o(e){for(var r=e._pt,t,n,a,l;r;){for(t=r._next,n=a;n&&n.pr>r.pr;)n=n._next;(r._prev=n?n._prev:l)?r._prev._next=r:a=r,(r._next=n)?n._prev=r:l=r,r=t}e._pt=a},PropTween=function(){function o(r,t,n,a,l,u,f,d,h){this.t=t,this.s=a,this.c=l,this.p=n,this.r=u||_renderPlain,this.d=f||this,this.set=d||_setterPlain,this.pr=h||0,this._next=r,r&&(r._prev=this)}var e=o.prototype;return e.modifier=function(t,n,a){this.mSet=this.mSet||this.set,this.set=_setterWithModifier,this.m=t,this.mt=a,this.tween=n},o}();_forEachName(_callbackNames+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(o){return _reservedProps[o]=1});_globals.TweenMax=_globals.TweenLite=Tween;_globals.TimelineLite=_globals.TimelineMax=Timeline;_globalTimeline=new Timeline({sortChildren:!1,defaults:_defaults,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});_config.stringFilter=_colorStringFilter;var _media=[],_listeners={},_emptyArray=[],_lastMediaTime=0,_contextID=0,_dispatch=function o(e){return(_listeners[e]||_emptyArray).map(function(r){return r()})},_onMediaChange=function o(){var e=Date.now(),r=[];e-_lastMediaTime>2&&(_dispatch("matchMediaInit"),_media.forEach(function(t){var n=t.queries,a=t.conditions,l,u,f,d;for(u in n)l=_win$1.matchMedia(n[u]).matches,l&&(f=1),l!==a[u]&&(a[u]=l,d=1);d&&(t.revert(),f&&r.push(t))}),_dispatch("matchMediaRevert"),r.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),_lastMediaTime=e,_dispatch("matchMedia"))},Context=function(){function o(r,t){this.selector=t&&selector(t),this.data=[],this._r=[],this.isReverted=!1,this.id=_contextID++,r&&this.add(r)}var e=o.prototype;return e.add=function(t,n,a){_isFunction(t)&&(a=n,n=t,t=_isFunction);var l=this,u=function(){var d=_context,h=l.selector,y;return d&&d!==l&&d.data.push(l),a&&(l.selector=selector(a)),_context=l,y=n.apply(l,arguments),_isFunction(y)&&l._r.push(y),_context=d,l.selector=h,l.isReverted=!1,y};return l.last=u,t===_isFunction?u(l,function(f){return l.add(null,f)}):t?l[t]=u:u},e.ignore=function(t){var n=_context;_context=null,t(this),_context=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof o?t.push.apply(t,n.getTweens()):n instanceof Tween&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var a=this;if(t?function(){for(var u=a.getTweens(),f=a.data.length,d;f--;)d=a.data[f],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,y){return y.g-h.g||-1/0}).forEach(function(h){return h.t.revert(t)}),f=a.data.length;f--;)d=a.data[f],d instanceof Timeline?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Tween)&&d.revert&&d.revert(t);a._r.forEach(function(h){return h(t,a)}),a.isReverted=!0}():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),n)for(var l=_media.length;l--;)_media[l].id===this.id&&_media.splice(l,1)},e.revert=function(t){this.kill(t||{})},o}(),MatchMedia=function(){function o(r){this.contexts=[],this.scope=r}var e=o.prototype;return e.add=function(t,n,a){_isObject(t)||(t={matches:t});var l=new Context(0,a||this.scope),u=l.conditions={},f,d,h;_context&&!l.selector&&(l.selector=_context.selector),this.contexts.push(l),n=l.add("onMatch",n),l.queries=t;for(d in t)d==="all"?h=1:(f=_win$1.matchMedia(t[d]),f&&(_media.indexOf(l)<0&&_media.push(l),(u[d]=f.matches)&&(h=1),f.addListener?f.addListener(_onMediaChange):f.addEventListener("change",_onMediaChange)));return h&&n(l,function(y){return l.add(null,y)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},o}(),_gsap={registerPlugin:function o(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];r.forEach(function(n){return _createPlugin(n)})},timeline:function o(e){return new Timeline(e)},getTweensOf:function o(e,r){return _globalTimeline.getTweensOf(e,r)},getProperty:function o(e,r,t,n){_isString(e)&&(e=toArray(e)[0]);var a=_getCache(e||{}).get,l=t?_passThrough:_numericIfPossible;return t==="native"&&(t=""),e&&(r?l((_plugins[r]&&_plugins[r].get||a)(e,r,t,n)):function(u,f,d){return l((_plugins[u]&&_plugins[u].get||a)(e,u,f,d))})},quickSetter:function o(e,r,t){if(e=toArray(e),e.length>1){var n=e.map(function(h){return gsap.quickSetter(h,r,t)}),a=n.length;return function(h){for(var y=a;y--;)n[y](h)}}e=e[0]||{};var l=_plugins[r],u=_getCache(e),f=u.harness&&(u.harness.aliases||{})[r]||r,d=l?function(h){var y=new l;_quickTween._pt=0,y.init(e,t?h+t:h,_quickTween,0,[e]),y.render(1,y),_quickTween._pt&&_renderPropTweens(1,_quickTween)}:u.set(e,f);return l?d:function(h){return d(e,f,t?h+t:h,u,1)}},quickTo:function o(e,r,t){var n,a=gsap.to(e,_merge((n={},n[r]="+=0.1",n.paused=!0,n),t||{})),l=function(f,d,h){return a.resetTo(r,f,d,h)};return l.tween=a,l},isTweening:function o(e){return _globalTimeline.getTweensOf(e,!0).length>0},defaults:function o(e){return e&&e.ease&&(e.ease=_parseEase(e.ease,_defaults.ease)),_mergeDeep(_defaults,e||{})},config:function o(e){return _mergeDeep(_config,e||{})},registerEffect:function o(e){var r=e.name,t=e.effect,n=e.plugins,a=e.defaults,l=e.extendTimeline;(n||"").split(",").forEach(function(u){return u&&!_plugins[u]&&!_globals[u]&&_warn(r+" effect requires "+u+" plugin.")}),_effects[r]=function(u,f,d){return t(toArray(u),_setDefaults(f||{},a),d)},l&&(Timeline.prototype[r]=function(u,f,d){return this.add(_effects[r](u,_isObject(f)?f:(d=f)&&{},this),d)})},registerEase:function o(e,r){_easeMap[e]=_parseEase(r)},parseEase:function o(e,r){return arguments.length?_parseEase(e,r):_easeMap},getById:function o(e){return _globalTimeline.getById(e)},exportRoot:function o(e,r){e===void 0&&(e={});var t=new Timeline(e),n,a;for(t.smoothChildTiming=_isNotFalse(e.smoothChildTiming),_globalTimeline.remove(t),t._dp=0,t._time=t._tTime=_globalTimeline._time,n=_globalTimeline._first;n;)a=n._next,(r||!(!n._dur&&n instanceof Tween&&n.vars.onComplete===n._targets[0]))&&_addToTimeline(t,n,n._start-n._delay),n=a;return _addToTimeline(_globalTimeline,t,0),t},context:function o(e,r){return e?new Context(e,r):_context},matchMedia:function o(e){return new MatchMedia(e)},matchMediaRefresh:function o(){return _media.forEach(function(e){var r=e.conditions,t,n;for(n in r)r[n]&&(r[n]=!1,t=1);t&&e.revert()})||_onMediaChange()},addEventListener:function o(e,r){var t=_listeners[e]||(_listeners[e]=[]);~t.indexOf(r)||t.push(r)},removeEventListener:function o(e,r){var t=_listeners[e],n=t&&t.indexOf(r);n>=0&&t.splice(n,1)},utils:{wrap,wrapYoyo,distribute,random,snap,normalize,getUnit,clamp,splitColor,toArray,selector,mapRange,pipe,unitize,interpolate,shuffle},install:_install,effects:_effects,ticker:_ticker,updateRoot:Timeline.updateRoot,plugins:_plugins,globalTimeline:_globalTimeline,core:{PropTween,globals:_addGlobal,Tween,Timeline,Animation,getCache:_getCache,_removeLinkedListItem,reverting:function o(){return _reverting$1},context:function o(e){return e&&_context&&(_context.data.push(e),e._ctx=_context),_context},suppressOverwrites:function o(e){return _suppressOverwrites=e}}};_forEachName("to,from,fromTo,delayedCall,set,killTweensOf",function(o){return _gsap[o]=Tween[o]});_ticker.add(Timeline.updateRoot);_quickTween=_gsap.to({},{duration:0});var _getPluginPropTween=function o(e,r){for(var t=e._pt;t&&t.p!==r&&t.op!==r&&t.fp!==r;)t=t._next;return t},_addModifiers=function o(e,r){var t=e._targets,n,a,l;for(n in r)for(a=t.length;a--;)l=e._ptLookup[a][n],l&&(l=l.d)&&(l._pt&&(l=_getPluginPropTween(l,n)),l&&l.modifier&&l.modifier(r[n],e,t[a],n))},_buildModifierPlugin=function o(e,r){return{name:e,rawVars:1,init:function(n,a,l){l._onInit=function(u){var f,d;if(_isString(a)&&(f={},_forEachName(a,function(h){return f[h]=1}),a=f),r){f={};for(d in a)f[d]=r(a[d]);a=f}_addModifiers(u,a)}}}},gsap=_gsap.registerPlugin({name:"attr",init:function o(e,r,t,n,a){var l,u,f;this.tween=t;for(l in r)f=e.getAttribute(l)||"",u=this.add(e,"setAttribute",(f||0)+"",r[l],n,a,0,0,l),u.op=l,u.b=f,this._props.push(l)},render:function o(e,r){for(var t=r._pt;t;)_reverting$1?t.set(t.t,t.p,t.b,t):t.r(e,t.d),t=t._next}},{name:"endArray",init:function o(e,r){for(var t=r.length;t--;)this.add(e,t,e[t]||0,r[t],0,0,0,0,0,1)}},_buildModifierPlugin("roundProps",_roundModifier),_buildModifierPlugin("modifiers"),_buildModifierPlugin("snap",snap))||_gsap;Tween.version=Timeline.version=gsap.version="3.12.4";_coreReady=1;_windowExists$1()&&_wake();_easeMap.Power0;_easeMap.Power1;_easeMap.Power2;_easeMap.Power3;_easeMap.Power4;_easeMap.Linear;_easeMap.Quad;_easeMap.Cubic;_easeMap.Quart;_easeMap.Quint;_easeMap.Strong;_easeMap.Elastic;_easeMap.Back;_easeMap.SteppedEase;_easeMap.Bounce;_easeMap.Sine;_easeMap.Expo;_easeMap.Circ;/*!
262
+ * CSSPlugin 3.12.4
263
+ * https://gsap.com
264
+ *
265
+ * Copyright 2008-2023, GreenSock. All rights reserved.
266
+ * Subject to the terms at https://gsap.com/standard-license or for
267
+ * Club GSAP members, the agreement issued with that membership.
268
+ * @author: Jack Doyle, jack@greensock.com
269
+ */var _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function o(){return typeof window<"u"},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function o(e,r){return r.set(r.t,r.p,Math.round((r.s+r.c*e)*1e4)/1e4+r.u,r)},_renderPropWithEnd=function o(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e4)/1e4+r.u,r)},_renderCSSPropWithBeginning=function o(e,r){return r.set(r.t,r.p,e?Math.round((r.s+r.c*e)*1e4)/1e4+r.u:r.b,r)},_renderRoundedCSSProp=function o(e,r){var t=r.s+r.c*e;r.set(r.t,r.p,~~(t+(t<0?-.5:.5))+r.u,r)},_renderNonTweeningValue=function o(e,r){return r.set(r.t,r.p,e?r.e:r.b,r)},_renderNonTweeningValueOnlyAtEnd=function o(e,r){return r.set(r.t,r.p,e!==1?r.b:r.e,r)},_setterCSSStyle=function o(e,r,t){return e.style[r]=t},_setterCSSProp=function o(e,r,t){return e.style.setProperty(r,t)},_setterTransform=function o(e,r,t){return e._gsap[r]=t},_setterScale=function o(e,r,t){return e._gsap.scaleX=e._gsap.scaleY=t},_setterScaleWithRender=function o(e,r,t,n,a){var l=e._gsap;l.scaleX=l.scaleY=t,l.renderTransform(a,l)},_setterTransformWithRender=function o(e,r,t,n,a){var l=e._gsap;l[r]=t,l.renderTransform(a,l)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function o(e,r){var t=this,n=this.target,a=n.style,l=n._gsap;if(e in _transformProps&&a){if(this.tfm=this.tfm||{},e!=="transform")e=_propertyAliases[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return t.tfm[u]=_get(n,u)}):this.tfm[e]=l.x?l[e]:_get(n,e),e===_transformOriginProp&&(this.tfm.zOrigin=l.zOrigin);else return _propertyAliases.transform.split(",").forEach(function(u){return o.call(t,u,r)});if(this.props.indexOf(_transformProp)>=0)return;l.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,r,"")),e=_transformProp}(a||r)&&this.props.push(e,r,a[e])},_removeIndependentTransforms=function o(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},_revertStyle=function o(){var e=this.props,r=this.target,t=r.style,n=r._gsap,a,l;for(a=0;a<e.length;a+=3)e[a+1]?r[e[a]]=e[a+2]:e[a+2]?t[e[a]]=e[a+2]:t.removeProperty(e[a].substr(0,2)==="--"?e[a]:e[a].replace(_capsExp,"-$1").toLowerCase());if(this.tfm){for(l in this.tfm)n[l]=this.tfm[l];n.svg&&(n.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),a=_reverting(),(!a||!a.isStart)&&!t[_transformProp]&&(_removeIndependentTransforms(t),n.zOrigin&&t[_transformOriginProp]&&(t[_transformOriginProp]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},_getStyleSaver=function o(e,r){var t={target:e,props:[],revert:_revertStyle,save:_saveStyle};return e._gsap||gsap.core.getCache(e),r&&r.split(",").forEach(function(n){return t.save(n)}),t},_supports3D,_createElement=function o(e,r){var t=_doc.createElementNS?_doc.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):_doc.createElement(e);return t&&t.style?t:_doc.createElement(e)},_getComputedProperty=function o(e,r,t){var n=getComputedStyle(e);return n[r]||n.getPropertyValue(r.replace(_capsExp,"-$1").toLowerCase())||n.getPropertyValue(r)||!t&&o(e,_checkPropPrefix(r)||r,1)||""},_prefixes="O,Moz,ms,Ms,Webkit".split(","),_checkPropPrefix=function o(e,r,t){var n=r||_tempDiv,a=n.style,l=5;if(e in a&&!t)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);l--&&!(_prefixes[l]+e in a););return l<0?null:(l===3?"ms":l>=0?_prefixes[l]:"")+e},_initCore=function o(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function o(e){var r=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),t=this.parentNode,n=this.nextSibling,a=this.style.cssText,l;if(_docElement.appendChild(r),r.appendChild(this),this.style.display="block",e)try{l=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=o}catch{}else this._gsapBBox&&(l=this._gsapBBox());return t&&(n?t.insertBefore(this,n):t.appendChild(this)),_docElement.removeChild(r),this.style.cssText=a,l},_getAttributeFallbacks=function o(e,r){for(var t=r.length;t--;)if(e.hasAttribute(r[t]))return e.getAttribute(r[t])},_getBBox=function o(e){var r;try{r=e.getBBox()}catch{r=_getBBoxHack.call(e,!0)}return r&&(r.width||r.height)||e.getBBox===_getBBoxHack||(r=_getBBoxHack.call(e,!0)),r&&!r.width&&!r.x&&!r.y?{x:+_getAttributeFallbacks(e,["x","cx","x1"])||0,y:+_getAttributeFallbacks(e,["y","cy","y1"])||0,width:0,height:0}:r},_isSVG=function o(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&_getBBox(e))},_removeProperty=function o(e,r){if(r){var t=e.style,n;r in _transformProps&&r!==_transformOriginProp&&(r=_transformProp),t.removeProperty?(n=r.substr(0,2),(n==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),t.removeProperty(n==="--"?r:r.replace(_capsExp,"-$1").toLowerCase())):t.removeAttribute(r)}},_addNonTweeningPT=function o(e,r,t,n,a,l){var u=new PropTween(e._pt,r,t,0,1,l?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return e._pt=u,u.b=n,u.e=a,e._props.push(t),u},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function o(e,r,t,n){var a=parseFloat(t)||0,l=(t+"").trim().substr((a+"").length)||"px",u=_tempDiv.style,f=_horizontalExp.test(r),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(f?"Width":"Height"),y=100,E=n==="px",p=n==="%",_,g,x,C;if(n===l||!a||_nonConvertibleUnits[n]||_nonConvertibleUnits[l])return a;if(l!=="px"&&!E&&(a=o(e,r,t,"px")),C=e.getCTM&&_isSVG(e),(p||l==="%")&&(_transformProps[r]||~r.indexOf("adius")))return _=C?e.getBBox()[f?"width":"height"]:e[h],_round(p?a/_*y:a/100*_);if(u[f?"width":"height"]=y+(E?l:n),g=~r.indexOf("adius")||n==="em"&&e.appendChild&&!d?e:e.parentNode,C&&(g=(e.ownerSVGElement||{}).parentNode),(!g||g===_doc||!g.appendChild)&&(g=_doc.body),x=g._gsap,x&&p&&x.width&&f&&x.time===_ticker.time&&!x.uncache)return _round(a/x.width*y);if(p&&(r==="height"||r==="width")){var R=e.style[r];e.style[r]=y+n,_=e[h],R?e.style[r]=R:_removeProperty(e,r)}else(p||l==="%")&&!_nonStandardLayouts[_getComputedProperty(g,"display")]&&(u.position=_getComputedProperty(e,"position")),g===e&&(u.position="static"),g.appendChild(_tempDiv),_=_tempDiv[h],g.removeChild(_tempDiv),u.position="absolute";return f&&p&&(x=_getCache(g),x.time=_ticker.time,x.width=g[h]),_round(E?_*a/y:_&&a?y/_*a:0)},_get=function o(e,r,t,n){var a;return _pluginInitted||_initCore(),r in _propertyAliases&&r!=="transform"&&(r=_propertyAliases[r],~r.indexOf(",")&&(r=r.split(",")[0])),_transformProps[r]&&r!=="transform"?(a=_parseTransform(e,n),a=r!=="transformOrigin"?a[r]:a.svg?a.origin:_firstTwoOnly(_getComputedProperty(e,_transformOriginProp))+" "+a.zOrigin+"px"):(a=e.style[r],(!a||a==="auto"||n||~(a+"").indexOf("calc("))&&(a=_specialProps[r]&&_specialProps[r](e,r,t)||_getComputedProperty(e,r)||_getProperty(e,r)||(r==="opacity"?1:0))),t&&!~(a+"").trim().indexOf(" ")?_convertToUnit(e,r,a,t)+t:a},_tweenComplexCSSString=function o(e,r,t,n){if(!t||t==="none"){var a=_checkPropPrefix(r,e,1),l=a&&_getComputedProperty(e,a,1);l&&l!==t?(r=a,t=l):r==="borderColor"&&(t=_getComputedProperty(e,"borderTopColor"))}var u=new PropTween(this._pt,e.style,r,0,1,_renderComplexString),f=0,d=0,h,y,E,p,_,g,x,C,R,S,A,T;if(u.b=t,u.e=n,t+="",n+="",n==="auto"&&(g=e.style[r],e.style[r]=n,n=_getComputedProperty(e,r)||n,g?e.style[r]=g:_removeProperty(e,r)),h=[t,n],_colorStringFilter(h),t=h[0],n=h[1],E=t.match(_numWithUnitExp)||[],T=n.match(_numWithUnitExp)||[],T.length){for(;y=_numWithUnitExp.exec(n);)x=y[0],R=n.substring(f,y.index),_?_=(_+1)%5:(R.substr(-5)==="rgba("||R.substr(-5)==="hsla(")&&(_=1),x!==(g=E[d++]||"")&&(p=parseFloat(g)||0,A=g.substr((p+"").length),x.charAt(1)==="="&&(x=_parseRelative(p,x)+A),C=parseFloat(x),S=x.substr((C+"").length),f=_numWithUnitExp.lastIndex-S.length,S||(S=S||_config.units[r]||A,f===n.length&&(n+=S,u.e+=S)),A!==S&&(p=_convertToUnit(e,r,g,S)||0),u._pt={_next:u._pt,p:R||d===1?R:",",s:p,c:C-p,m:_&&_<4||r==="zIndex"?Math.round:0});u.c=f<n.length?n.substring(f,n.length):""}else u.r=r==="display"&&n==="none"?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue;return _relExp.test(n)&&(u.e=0),this._pt=u,u},_keywordToPercent={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_convertKeywordsToPercentages=function o(e){var r=e.split(" "),t=r[0],n=r[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(e=t,t=n,n=e),r[0]=_keywordToPercent[t]||t,r[1]=_keywordToPercent[n]||n,r.join(" ")},_renderClearProps=function o(e,r){if(r.tween&&r.tween._time===r.tween._dur){var t=r.t,n=t.style,a=r.u,l=t._gsap,u,f,d;if(a==="all"||a===!0)n.cssText="",f=1;else for(a=a.split(","),d=a.length;--d>-1;)u=a[d],_transformProps[u]&&(f=1,u=u==="transformOrigin"?_transformOriginProp:_transformProp),_removeProperty(t,u);f&&(_removeProperty(t,_transformProp),l&&(l.svg&&t.removeAttribute("transform"),_parseTransform(t,1),l.uncache=1,_removeIndependentTransforms(n)))}},_specialProps={clearProps:function o(e,r,t,n,a){if(a.data!=="isFromStart"){var l=e._pt=new PropTween(e._pt,r,t,0,0,_renderClearProps);return l.u=n,l.pr=-10,l.tween=a,e._props.push(t),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function o(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},_getComputedTransformMatrixAsArray=function o(e){var r=_getComputedProperty(e,_transformProp);return _isNullTransform(r)?_identity2DMatrix:r.substr(7).match(_numExp).map(_round)},_getMatrix=function o(e,r){var t=e._gsap||_getCache(e),n=e.style,a=_getComputedTransformMatrixAsArray(e),l,u,f,d;return t.svg&&e.getAttribute("transform")?(f=e.transform.baseVal.consolidate().matrix,a=[f.a,f.b,f.c,f.d,f.e,f.f],a.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:a):(a===_identity2DMatrix&&!e.offsetParent&&e!==_docElement&&!t.svg&&(f=n.display,n.display="block",l=e.parentNode,(!l||!e.offsetParent)&&(d=1,u=e.nextElementSibling,_docElement.appendChild(e)),a=_getComputedTransformMatrixAsArray(e),f?n.display=f:_removeProperty(e,"display"),d&&(u?l.insertBefore(e,u):l?l.appendChild(e):_docElement.removeChild(e))),r&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)},_applySVGOrigin=function o(e,r,t,n,a,l){var u=e._gsap,f=a||_getMatrix(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,y=u.xOffset||0,E=u.yOffset||0,p=f[0],_=f[1],g=f[2],x=f[3],C=f[4],R=f[5],S=r.split(" "),A=parseFloat(S[0])||0,T=parseFloat(S[1])||0,w,P,O,k;t?f!==_identity2DMatrix&&(P=p*x-_*g)&&(O=A*(x/P)+T*(-g/P)+(g*R-x*C)/P,k=A*(-_/P)+T*(p/P)-(p*R-_*C)/P,A=O,T=k):(w=_getBBox(e),A=w.x+(~S[0].indexOf("%")?A/100*w.width:A),T=w.y+(~(S[1]||S[0]).indexOf("%")?T/100*w.height:T)),n||n!==!1&&u.smooth?(C=A-d,R=T-h,u.xOffset=y+(C*p+R*g)-C,u.yOffset=E+(C*_+R*x)-R):u.xOffset=u.yOffset=0,u.xOrigin=A,u.yOrigin=T,u.smooth=!!n,u.origin=r,u.originIsAbsolute=!!t,e.style[_transformOriginProp]="0px 0px",l&&(_addNonTweeningPT(l,u,"xOrigin",d,A),_addNonTweeningPT(l,u,"yOrigin",h,T),_addNonTweeningPT(l,u,"xOffset",y,u.xOffset),_addNonTweeningPT(l,u,"yOffset",E,u.yOffset)),e.setAttribute("data-svg-origin",A+" "+T)},_parseTransform=function o(e,r){var t=e._gsap||new GSCache(e);if("x"in t&&!r&&!t.uncache)return t;var n=e.style,a=t.scaleX<0,l="px",u="deg",f=getComputedStyle(e),d=_getComputedProperty(e,_transformOriginProp)||"0",h,y,E,p,_,g,x,C,R,S,A,T,w,P,O,k,D,F,G,V,W,ee,q,z,U,$,I,B,X,Q,J,ne;return h=y=E=g=x=C=R=S=A=0,p=_=1,t.svg=!!(e.getCTM&&_isSVG(e)),f.translate&&((f.translate!=="none"||f.scale!=="none"||f.rotate!=="none")&&(n[_transformProp]=(f.translate!=="none"?"translate3d("+(f.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(f.rotate!=="none"?"rotate("+f.rotate+") ":"")+(f.scale!=="none"?"scale("+f.scale.split(" ").join(",")+") ":"")+(f[_transformProp]!=="none"?f[_transformProp]:"")),n.scale=n.rotate=n.translate="none"),P=_getMatrix(e,t.svg),t.svg&&(t.uncache?(U=e.getBBox(),d=t.xOrigin-U.x+"px "+(t.yOrigin-U.y)+"px",z=""):z=!r&&e.getAttribute("data-svg-origin"),_applySVGOrigin(e,z||d,!!z||t.originIsAbsolute,t.smooth!==!1,P)),T=t.xOrigin||0,w=t.yOrigin||0,P!==_identity2DMatrix&&(F=P[0],G=P[1],V=P[2],W=P[3],h=ee=P[4],y=q=P[5],P.length===6?(p=Math.sqrt(F*F+G*G),_=Math.sqrt(W*W+V*V),g=F||G?_atan2(G,F)*_RAD2DEG:0,R=V||W?_atan2(V,W)*_RAD2DEG+g:0,R&&(_*=Math.abs(Math.cos(R*_DEG2RAD))),t.svg&&(h-=T-(T*F+w*V),y-=w-(T*G+w*W))):(ne=P[6],Q=P[7],I=P[8],B=P[9],X=P[10],J=P[11],h=P[12],y=P[13],E=P[14],O=_atan2(ne,X),x=O*_RAD2DEG,O&&(k=Math.cos(-O),D=Math.sin(-O),z=ee*k+I*D,U=q*k+B*D,$=ne*k+X*D,I=ee*-D+I*k,B=q*-D+B*k,X=ne*-D+X*k,J=Q*-D+J*k,ee=z,q=U,ne=$),O=_atan2(-V,X),C=O*_RAD2DEG,O&&(k=Math.cos(-O),D=Math.sin(-O),z=F*k-I*D,U=G*k-B*D,$=V*k-X*D,J=W*D+J*k,F=z,G=U,V=$),O=_atan2(G,F),g=O*_RAD2DEG,O&&(k=Math.cos(O),D=Math.sin(O),z=F*k+G*D,U=ee*k+q*D,G=G*k-F*D,q=q*k-ee*D,F=z,ee=U),x&&Math.abs(x)+Math.abs(g)>359.9&&(x=g=0,C=180-C),p=_round(Math.sqrt(F*F+G*G+V*V)),_=_round(Math.sqrt(q*q+ne*ne)),O=_atan2(ee,q),R=Math.abs(O)>2e-4?O*_RAD2DEG:0,A=J?1/(J<0?-J:J):0),t.svg&&(z=e.getAttribute("transform"),t.forceCSS=e.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(e,_transformProp)),z&&e.setAttribute("transform",z))),Math.abs(R)>90&&Math.abs(R)<270&&(a?(p*=-1,R+=g<=0?180:-180,g+=g<=0?180:-180):(_*=-1,R+=R<=0?180:-180)),r=r||t.uncache,t.x=h-((t.xPercent=h&&(!r&&t.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*t.xPercent/100:0)+l,t.y=y-((t.yPercent=y&&(!r&&t.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-y)?-50:0)))?e.offsetHeight*t.yPercent/100:0)+l,t.z=E+l,t.scaleX=_round(p),t.scaleY=_round(_),t.rotation=_round(g)+u,t.rotationX=_round(x)+u,t.rotationY=_round(C)+u,t.skewX=R+u,t.skewY=S+u,t.transformPerspective=A+l,(t.zOrigin=parseFloat(d.split(" ")[2])||!r&&t.zOrigin||0)&&(n[_transformOriginProp]=_firstTwoOnly(d)),t.xOffset=t.yOffset=0,t.force3D=_config.force3D,t.renderTransform=t.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,t.uncache=0,t},_firstTwoOnly=function o(e){return(e=e.split(" "))[0]+" "+e[1]},_addPxTranslate=function o(e,r,t){var n=getUnit(r);return _round(parseFloat(r)+parseFloat(_convertToUnit(e,"x",t+"px",n)))+n},_renderNon3DTransforms=function o(e,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,_renderCSSTransforms(e,r)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function o(e,r){var t=r||this,n=t.xPercent,a=t.yPercent,l=t.x,u=t.y,f=t.z,d=t.rotation,h=t.rotationY,y=t.rotationX,E=t.skewX,p=t.skewY,_=t.scaleX,g=t.scaleY,x=t.transformPerspective,C=t.force3D,R=t.target,S=t.zOrigin,A="",T=C==="auto"&&e&&e!==1||C===!0;if(S&&(y!==_zeroDeg||h!==_zeroDeg)){var w=parseFloat(h)*_DEG2RAD,P=Math.sin(w),O=Math.cos(w),k;w=parseFloat(y)*_DEG2RAD,k=Math.cos(w),l=_addPxTranslate(R,l,P*k*-S),u=_addPxTranslate(R,u,-Math.sin(w)*-S),f=_addPxTranslate(R,f,O*k*-S+S)}x!==_zeroPx&&(A+="perspective("+x+_endParenthesis),(n||a)&&(A+="translate("+n+"%, "+a+"%) "),(T||l!==_zeroPx||u!==_zeroPx||f!==_zeroPx)&&(A+=f!==_zeroPx||T?"translate3d("+l+", "+u+", "+f+") ":"translate("+l+", "+u+_endParenthesis),d!==_zeroDeg&&(A+="rotate("+d+_endParenthesis),h!==_zeroDeg&&(A+="rotateY("+h+_endParenthesis),y!==_zeroDeg&&(A+="rotateX("+y+_endParenthesis),(E!==_zeroDeg||p!==_zeroDeg)&&(A+="skew("+E+", "+p+_endParenthesis),(_!==1||g!==1)&&(A+="scale("+_+", "+g+_endParenthesis),R.style[_transformProp]=A||"translate(0, 0)"},_renderSVGTransforms=function o(e,r){var t=r||this,n=t.xPercent,a=t.yPercent,l=t.x,u=t.y,f=t.rotation,d=t.skewX,h=t.skewY,y=t.scaleX,E=t.scaleY,p=t.target,_=t.xOrigin,g=t.yOrigin,x=t.xOffset,C=t.yOffset,R=t.forceCSS,S=parseFloat(l),A=parseFloat(u),T,w,P,O,k;f=parseFloat(f),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,f+=h),f||d?(f*=_DEG2RAD,d*=_DEG2RAD,T=Math.cos(f)*y,w=Math.sin(f)*y,P=Math.sin(f-d)*-E,O=Math.cos(f-d)*E,d&&(h*=_DEG2RAD,k=Math.tan(d-h),k=Math.sqrt(1+k*k),P*=k,O*=k,h&&(k=Math.tan(h),k=Math.sqrt(1+k*k),T*=k,w*=k)),T=_round(T),w=_round(w),P=_round(P),O=_round(O)):(T=y,O=E,w=P=0),(S&&!~(l+"").indexOf("px")||A&&!~(u+"").indexOf("px"))&&(S=_convertToUnit(p,"x",l,"px"),A=_convertToUnit(p,"y",u,"px")),(_||g||x||C)&&(S=_round(S+_-(_*T+g*P)+x),A=_round(A+g-(_*w+g*O)+C)),(n||a)&&(k=p.getBBox(),S=_round(S+n/100*k.width),A=_round(A+a/100*k.height)),k="matrix("+T+","+w+","+P+","+O+","+S+","+A+")",p.setAttribute("transform",k),R&&(p.style[_transformProp]=k)},_addRotationalPropTween=function o(e,r,t,n,a){var l=360,u=_isString(a),f=parseFloat(a)*(u&&~a.indexOf("rad")?_RAD2DEG:1),d=f-n,h=n+d+"deg",y,E;return u&&(y=a.split("_")[1],y==="short"&&(d%=l,d!==d%(l/2)&&(d+=d<0?l:-l)),y==="cw"&&d<0?d=(d+l*_bigNum)%l-~~(d/l)*l:y==="ccw"&&d>0&&(d=(d-l*_bigNum)%l-~~(d/l)*l)),e._pt=E=new PropTween(e._pt,r,t,n,d,_renderPropWithEnd),E.e=h,E.u="deg",e._props.push(t),E},_assign=function o(e,r){for(var t in r)e[t]=r[t];return e},_addRawTransformPTs=function o(e,r,t){var n=_assign({},t._gsap),a="perspective,force3D,transformOrigin,svgOrigin",l=t.style,u,f,d,h,y,E,p,_;n.svg?(d=t.getAttribute("transform"),t.setAttribute("transform",""),l[_transformProp]=r,u=_parseTransform(t,1),_removeProperty(t,_transformProp),t.setAttribute("transform",d)):(d=getComputedStyle(t)[_transformProp],l[_transformProp]=r,u=_parseTransform(t,1),l[_transformProp]=d);for(f in _transformProps)d=n[f],h=u[f],d!==h&&a.indexOf(f)<0&&(p=getUnit(d),_=getUnit(h),y=p!==_?_convertToUnit(t,f,d,_):parseFloat(d),E=parseFloat(h),e._pt=new PropTween(e._pt,u,f,y,E-y,_renderCSSProp),e._pt.u=_||0,e._props.push(f));_assign(u,n)};_forEachName("padding,margin,Width,Radius",function(o,e){var r="Top",t="Right",n="Bottom",a="Left",l=(e<3?[r,t,n,a]:[r+a,r+t,n+t,n+a]).map(function(u){return e<2?o+u:"border"+u+o});_specialProps[e>1?"border"+o:o]=function(u,f,d,h,y){var E,p;if(arguments.length<4)return E=l.map(function(_){return _get(u,_,d)}),p=E.join(" "),p.split(E[0]).length===5?E[0]:p;E=(h+"").split(" "),p={},l.forEach(function(_,g){return p[_]=E[g]=E[g]||E[(g-1)/2|0]}),u.init(f,p,y)}});var CSSPlugin={name:"css",register:_initCore,targetTest:function o(e){return e.style&&e.nodeType},init:function o(e,r,t,n,a){var l=this._props,u=e.style,f=t.vars.startAt,d,h,y,E,p,_,g,x,C,R,S,A,T,w,P,O;_pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(e),O=this.styles.props,this.tween=t;for(g in r)if(g!=="autoRound"&&(h=r[g],!(_plugins[g]&&_checkPlugin(g,r,t,n,e,a)))){if(p=typeof h,_=_specialProps[g],p==="function"&&(h=h.call(t,n,e,a),p=typeof h),p==="string"&&~h.indexOf("random(")&&(h=_replaceRandom(h)),_)_(this,e,g,h,t)&&(P=1);else if(g.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(g)+"").trim(),h+="",_colorExp.lastIndex=0,_colorExp.test(d)||(x=getUnit(d),C=getUnit(h)),C?x!==C&&(d=_convertToUnit(e,g,d,C)+C):x&&(h+=x),this.add(u,"setProperty",d,h,n,a,0,0,g),l.push(g),O.push(g,0,u[g]);else if(p!=="undefined"){if(f&&g in f?(d=typeof f[g]=="function"?f[g].call(t,n,e,a):f[g],_isString(d)&&~d.indexOf("random(")&&(d=_replaceRandom(d)),getUnit(d+"")||d==="auto"||(d+=_config.units[g]||getUnit(_get(e,g))||""),(d+"").charAt(1)==="="&&(d=_get(e,g))):d=_get(e,g),E=parseFloat(d),R=p==="string"&&h.charAt(1)==="="&&h.substr(0,2),R&&(h=h.substr(2)),y=parseFloat(h),g in _propertyAliases&&(g==="autoAlpha"&&(E===1&&_get(e,"visibility")==="hidden"&&y&&(E=0),O.push("visibility",0,u.visibility),_addNonTweeningPT(this,u,"visibility",E?"inherit":"hidden",y?"inherit":"hidden",!y)),g!=="scale"&&g!=="transform"&&(g=_propertyAliases[g],~g.indexOf(",")&&(g=g.split(",")[0]))),S=g in _transformProps,S){if(this.styles.save(g),A||(T=e._gsap,T.renderTransform&&!r.parseTransform||_parseTransform(e,r.parseTransform),w=r.smoothOrigin!==!1&&T.smooth,A=this._pt=new PropTween(this._pt,u,_transformProp,0,1,T.renderTransform,T,0,-1),A.dep=1),g==="scale")this._pt=new PropTween(this._pt,T,"scaleY",T.scaleY,(R?_parseRelative(T.scaleY,R+y):y)-T.scaleY||0,_renderCSSProp),this._pt.u=0,l.push("scaleY",g),g+="X";else if(g==="transformOrigin"){O.push(_transformOriginProp,0,u[_transformOriginProp]),h=_convertKeywordsToPercentages(h),T.svg?_applySVGOrigin(e,h,0,w,0,this):(C=parseFloat(h.split(" ")[2])||0,C!==T.zOrigin&&_addNonTweeningPT(this,T,"zOrigin",T.zOrigin,C),_addNonTweeningPT(this,u,g,_firstTwoOnly(d),_firstTwoOnly(h)));continue}else if(g==="svgOrigin"){_applySVGOrigin(e,h,1,w,0,this);continue}else if(g in _rotationalProperties){_addRotationalPropTween(this,T,g,E,R?_parseRelative(E,R+h):h);continue}else if(g==="smoothOrigin"){_addNonTweeningPT(this,T,"smooth",T.smooth,h);continue}else if(g==="force3D"){T[g]=h;continue}else if(g==="transform"){_addRawTransformPTs(this,h,e);continue}}else g in u||(g=_checkPropPrefix(g)||g);if(S||(y||y===0)&&(E||E===0)&&!_complexExp.test(h)&&g in u)x=(d+"").substr((E+"").length),y||(y=0),C=getUnit(h)||(g in _config.units?_config.units[g]:x),x!==C&&(E=_convertToUnit(e,g,d,C)),this._pt=new PropTween(this._pt,S?T:u,g,E,(R?_parseRelative(E,R+y):y)-E,!S&&(C==="px"||g==="zIndex")&&r.autoRound!==!1?_renderRoundedCSSProp:_renderCSSProp),this._pt.u=C||0,x!==C&&C!=="%"&&(this._pt.b=d,this._pt.r=_renderCSSPropWithBeginning);else if(g in u)_tweenComplexCSSString.call(this,e,g,d,R?R+h:h);else if(g in e)this.add(e,g,d||e[g],R?R+h:h,n,a);else if(g!=="parseTransform"){_missingPlugin(g,h);continue}S||(g in u?O.push(g,0,u[g]):O.push(g,1,d||e[g])),l.push(g)}}P&&_sortPropTweensByPriority(this)},render:function o(e,r){if(r.tween._time||!_reverting())for(var t=r._pt;t;)t.r(e,t.d),t=t._next;else r.styles.revert()},get:_get,aliases:_propertyAliases,getSetter:function o(e,r,t){var n=_propertyAliases[r];return n&&n.indexOf(",")<0&&(r=n),r in _transformProps&&r!==_transformOriginProp&&(e._gsap.x||_get(e,"x"))?t&&_recentSetterPlugin===t?r==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=t||{})&&(r==="scale"?_setterScaleWithRender:_setterTransformWithRender):e.style&&!_isUndefined(e.style[r])?_setterCSSStyle:~r.indexOf("-")?_setterCSSProp:_getSetter(e,r)},core:{_removeProperty,_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(o,e,r,t){var n=_forEachName(o+","+e+","+r,function(a){_transformProps[a]=1});_forEachName(e,function(a){_config.units[a]="deg",_rotationalProperties[a]=1}),_propertyAliases[n[13]]=o+","+e,_forEachName(t,function(a){var l=a.split(":");_propertyAliases[l[1]]=n[l[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(o){_config.units[o]="px"});gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;function SpeechBubbleComponent({message:o,translate:e},r){const[t,n]=React$2.useState(!1),a=()=>{const l=o.avatar,u=l.lastIndexOf("/");return l.includes("/object/")?l.slice(0,u).concat("/mini-thumbnail.png"):l.includes("/character/")?l.slice(0,u).concat("/mini-face.png"):l};return React$2.useLayoutEffect(()=>{t||n(!0)},[t]),jsxRuntimeExports.jsxs("div",{dir:"auto",ref:r,className:`
270
+ speech-bubble
271
+ ${o.thinkful?"speech-bubble--italic":""}
272
+ `,children:[jsxRuntimeExports.jsxs("div",{className:`speech-bubble__header ${o.thinkful?"speech-bubble__header--thinking":""}`,children:[o.thinkful?jsxRuntimeExports.jsx("div",{className:"thinking-icon-wrap",children:jsxRuntimeExports.jsx("div",{className:"icon-bubble-thinkful-black"})}):null,o.avatar?jsxRuntimeExports.jsx("div",{className:"speech-bubble__avatar",children:jsxRuntimeExports.jsx("img",{src:a(),alt:o.name})}):null,o.voiceOver?jsxRuntimeExports.jsx("div",{className:"speech-bubble__avatar",children:jsxRuntimeExports.jsx("div",{className:"icon-narrator"})}):null,jsxRuntimeExports.jsxs("div",{className:"speech-bubble__name",children:[jsxRuntimeExports.jsx("span",{children:o.name}),o.thinkful?jsxRuntimeExports.jsxs("span",{children:["[ ",e("emotion.thinking")," ]"]}):null]})]}),o.text?jsxRuntimeExports.jsx("div",{className:"speech-bubble__text",children:o.text}):null]})}const SpeechBubbleComponent$1=React$2.forwardRef(SpeechBubbleComponent);function BubbleWrapper({currentMessage:o,translate:e}){const r=document.querySelector(".screens--container");return jsxRuntimeExports.jsx("group",{children:jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{wrapperClass:"htmlpro-wrap-100-h",onOcclude:()=>null,zIndexRange:[5,5],portal:r?{current:r}:void 0,style:{width:"100vw",height:"100%",position:"static",outline:"1px solid yellow"},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsx(SpeechBubbleComponent$1,{translate:e,message:o})})})}const cleanStyle={width:"100vw",height:"100vh",position:"static"};function DialogDecision(o){const e=document.querySelector(".screens--container");return React$2.useEffect(()=>(o.onMount&&o.onMount(),()=>{o.onUnMount&&o.onUnMount()}),[]),jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{zIndexRange:[6,6],style:cleanStyle,portal:e?{current:e}:void 0,onOcclude:()=>{},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsx(DecisionComponent,{inScene:!0,...o})})}const cache={},loader=new GLTFLoader;function useStateMachine(o){const e=fiber.useThree(l=>l.scene),r=React$2.useMemo(()=>{var u,f;const l={};for(const d of o)if(d.slots)for(const h of d.slots){if(!h.uid)continue;const y=(u=h.character)==null?void 0:u.resource.animations;y&&(l[h.uid]?l[h.uid]={...l[h.uid],[h.emotion]:y[h.emotion].url}:l[h.uid]={[h.emotion]:y[h.emotion].url},h.emotion.includes("seated")||(l[h.uid]={...l[h.uid],[`${h.emotion}-seated`]:((f=y[`${h.emotion}-seated`])==null?void 0:f.url)||y["idle-seated"].url}),l[h.uid].talking=y.talking.url)}return l},[o]),t=React$2.useMemo(()=>{const l=new Set;for(const u of o)if(u.slots)for(const f of u.slots)f.uid&&l.add(f.uid);return Array.from(l)},[o]),n=()=>{t.forEach(l=>{a(l,"idle")})},a=async(l,u)=>{var y;const f=e.getObjectByProperty("uid",l);if(cache[l]||(cache[l]={}),!f)return;const{clipAction:d,defaultAnim:h}=f.userData.animation;if(u==="idle")d(h,f);else{const E=r[l],p=(y=cache[l])==null?void 0:y[u],_=cache[l].talking,g=x=>{(!f.userData._active||f.userData._active!==u)&&(f.userData._active=u,f.userData.animation.clipAction(x,f))};if(!_){const{animations:x}=await loader.loadAsync(E.talking);x[0].name="talking",cache[l].talking=x[0]}if(p)p&&g(p);else{if(u.includes("talking")){const x=u.split("_")[0];let C=cache[l][x];if(!C){const{animations:R}=await loader.loadAsync(E[x]);R[0].name=x,C=cache[l][x]=R[0]}cache[l][u]=mixWithTalkingClip(cache[l].talking,C)}else{const{animations:x}=await loader.loadAsync(E[u]);cache[l][u]=x[0]}g(cache[l][u])}}};return{startAnimation:a,resetActives:n}}const characterMs=75,minMs=1400,headSize=2,raycast=new three.Raycaster,animationTarget=new three.Object3D,maxCharacterToSwitch=70;raycast.firstHitOnly=!0;function DialogComponent({keyboardControl:o,emitEvent:e,lines:r,actors:t,edges:n,soundActions:a,zoomInActor:l,autoPlay:u,autoEnd:f,pause:d,progress:h}){var Be;const y=(h==null?void 0:h.line)||0,[E,p]=React$2.useState(y),[_,g]=React$2.useState(!!u),[x,C]=React$2.useState(!1),[R,S]=React$2.useState(!1),A=fiber.useThree(Ce=>Ce.scene),T=fiber.useThree(Ce=>Ce.camera),{start:w,stop:P}=useTimeout(),O=React$2.useRef([]),k=React$2.useMemo(()=>T.clone(),[]),D=React$2.useRef({pos:[0,0,0],child:null}),F=r[E],G=r[E-1],V=React$2.useRef(!1),W=!!n,{voiceOver:ee,decision:q}=F||{},z=React$2.useRef({}),U=(Be=F==null?void 0:F.slots)==null?void 0:Be.find(Ce=>Ce.talking),$=React$2.useRef(!1),{startAnimation:I,resetActives:B}=useStateMachine(r),X=_&&!(F!=null&&F.decision),Q=Object.keys((F==null?void 0:F.audio)||{}).length,J=Object.keys((F==null?void 0:F.voice)||{}).length,ne=ee||(F==null?void 0:F.type)==="conversationalNarration",ae=q||(F==null?void 0:F.type)==="conversationalDecision",[Z,se]=React$2.useState({text:"",name:"",inScene:!1,thinkful:!1,voiceOver:!1,avatar:"",show:!1}),oe=React$2.useMemo(()=>r.reduce((Ce,Ee)=>(Ee.slots&&Ee.slots.filter(Xe=>Xe.uid).forEach(Xe=>{Ce.includes(Xe.uid)||Ce.push(Xe.uid)}),Ce),[]),[r]),fe=React$2.useCallback(Ce=>e({type:"translate",payload:Ce}),[e]),[de,ce]=React$2.useState([]),Se=React$2.useMemo(()=>de[de.length-1],[de]),Le=React$2.useCallback(()=>{const Ce=n.find(Pe=>Pe.fromId===Se)||n.find(Pe=>Pe.toId===Se),Ee=r.find(Pe=>Pe.id===(Ce==null?void 0:Ce.fromId));return!Se&&(h==null?void 0:h.line)>=0?{decision:!0}:Ee},[n,r,Se]),Ne=React$2.useCallback(()=>{if(W){const Ee=Le();return Ee==null?void 0:Ee.decision}const Ce=r[E-1]?r[E-1]:{};return E>0&&(Ce==null?void 0:Ce.decision)},[F,W,r,Se,n]),He=React$2.useCallback(Ce=>{if(!Ce)return null;let Ee;return A.traverseVisible(Pe=>{Pe.uid===Ce&&!Ee&&(Ee=Pe)}),Ee},[A]),Ke=React$2.useCallback(Ce=>{var Pe,Xe;const Ee=t.find(nt=>(nt==null?void 0:nt.uid)===(Ce==null?void 0:Ce.uid)?nt:"");return((Xe=(Pe=Ce==null?void 0:Ce.character)==null?void 0:Pe.resource)==null?void 0:Xe.url)||(Ee==null?void 0:Ee.completeUrl)||""},[t]),Qe=(Ce=()=>{})=>{if($.current)$.current&&($.current=!1);else{T.updateProjectionMatrix(),T.updateMatrixWorld(!0);const Ee=D.current.child?D.current.pos:k.position.toArray();if(animationTarget.position.fromArray(Ee),D.current.parent){animationTarget.quaternion.equals(T.quaternion)||animationTarget.applyQuaternion(T.quaternion);const Pe=D.current.isLeft?-1:1,Xe=headSize*Pe;animationTarget.translateX(-10*Pe+Xe),animationTarget.translateY(-2),animationTarget.translateZ(30)}gsapWithCSS.to(T.position,{duration:.9,ease:"power3.easeInOut",onStart:()=>{$.current=!0},onUpdate:()=>{O.current.length&&O.current.forEach(Pe=>{const{object:Xe}=Pe;Xe.material.visible=!0})},onComplete:()=>{Ce(),raycast.set(T.getWorldPosition(new three.Vector3(0,0,0)),T.getWorldDirection(new three.Vector3));const Pe=raycast.intersectObjects(A.children,!0);O.current=Pe.filter(Xe=>Xe.distance<10),O.current.length&&O.current.forEach(Xe=>{const{object:nt}=Xe;nt.material.side=0}),$.current=!1,V.current&&e({type:"success"}),D.current.child||T.copy(k)},...animationTarget.position})}},dt=React$2.useCallback(()=>{D.current.child=null,D.current.parent=null,l&&Qe()},[l]),yt=()=>{if(!(U!=null&&U.emotion)||V.current)return;const{emotion:Ce,uid:Ee}=U,Pe=He(Ee);if(Pe){const{isSeated:Xe}=Pe,nt=Ce.includes("seated");I==null||I(Ee,Xe&&!nt?`${Ce}-seated_talking`:`${Ce}_talking`)}},ut=()=>{if(!(U!=null&&U.uid)||V.current)return;const{emotion:Ce,uid:Ee}=U,Pe=He(Ee);if(Pe){const{isSeated:Xe}=Pe,nt=Ce.includes("seated");I==null||I(Ee,Xe&&!nt?`${Ce}-seated`:Ce)}},ft=React$2.useCallback(()=>{V.current=!0,p(0),se({show:!1}),dt(),B(),l||e({type:"success"})},[T,e,dt,l]);React$2.useEffect(()=>()=>{z.current={}},[]);const Xt=React$2.useCallback((Ce=!0)=>{const Ee=Ce?["fromId","toId"]:["toId","fromId"],Pe=n.filter(it=>it[Ee[0]]===F.id),Xe=Pe.length===1?Pe[0]:Pe.find(it=>it[Ee[1]]===Se);if(!(Xe!=null&&Xe[Ee[0]]))return;Ce||ce(de.slice(0,de.length-1));const nt=r.findIndex(it=>it.id===Xe[Ee[1]]);nt>=0?(se({show:!1}),p(nt),e({type:"notifyProgress",payload:{line:nt}})):ft()},[F==null?void 0:F.id,e,n,ft,r]),kt=React$2.useCallback((Ce,Ee)=>{const Pe=[3,2,1][Ce.id],nt=n.filter(Ht=>Ht.fromId===(F==null?void 0:F.id)).find(Ht=>parseInt(Ht.fromPointIndex)===Pe),it=r.findIndex(Ht=>Ht.id===(nt==null?void 0:nt.toId));it>=0?(nt==null?void 0:nt.fromId)===(nt==null?void 0:nt.toId)?Ee():(se({show:!1}),p(it),e({type:"notifyProgress",payload:{line:it}})):ft()},[F==null?void 0:F.id,n,ft,r]),Ge=React$2.useCallback(()=>{if(z.current={...U},S(!1),ut(),W)Xt(!1);else if(!Ne()){const Ce=E-1;se({show:!1}),p(Ce),e({type:"notifyProgress",payload:{line:Ce}})}},[Xt,e,W,G,E,U]),Ze=React$2.useCallback(Ce=>{if(W){if(Ce){const Ee=[3,2,1][Ce.id],Xe=n.filter(nt=>nt.fromId===F.id).find(nt=>parseInt(nt.fromPointIndex)===Ee);if(Xe){const nt=r.findIndex(it=>it.id===Xe.toId);nt>=0&&e({type:"notifyProgress",payload:{line:nt}})}else e({type:"saveNode"})}}else if(E<r.length-1){const Ee=E+1;e({type:"notifyProgress",payload:{line:Ee}})}else e({type:"saveNode"})},[n,E,r,e,F.id,W]),rt=React$2.useCallback((Ce,Ee)=>{if(z.current={...U},ce([...de,F.id]),S(!1),ut(),W)Ce?kt(Ce,Ee):Xt();else if(E<r.length-1){const Pe=E+1;se({show:!1}),p(Pe),e({type:"notifyProgress",payload:{line:Pe}})}else(f||F.decision)&&ft()},[e,F==null?void 0:F.decision,W,E,r.length,kt,Xt,ft,U]),qt=()=>{g(!1),Ge()},We=()=>W?F&&F.type!=="conversationalDecision"&&!n.find(Ce=>Ce.fromId===F.id):E===r.length-1,at=()=>{We()?ft():(g(!1),rt())};React$2.useEffect(()=>{if(W&&!x){const Ce=h==null?void 0:h.line;if(Ce>=0){C(!0),p(Ce);return}const Ee=r.filter(Pe=>!n.find(Xe=>Xe.toId===Pe.id));if(Ee.length){const Pe=Ee[0],Xe=r.indexOf(Pe);Xe>=0&&(C(!0),p(Xe))}}},[n,W,r,x]);const pe=Ce=>{if(z.current.uid===Ce.uid)return;const Ee=new three.Object3D,Pe=Ce.getObjectByName("Head_M");Pe.updateMatrixWorld(!0),Ee.applyMatrix4(Pe.matrixWorld),Ee.applyQuaternion(T.quaternion);const Xe=l?2.5:2,nt=l?1.2:1.5;Ee.translateY(Xe),Ee.translateX(nt);const it=new three.Vector3;it.setFromMatrixPosition(Pe.matrixWorld);const Sr=it.project(T).x<0;D.current={pos:Ee.position.toArray(),child:Pe,parent:Ce,isLeft:Sr}};React$2.useEffect(()=>{var Ce,Ee,Pe;if(ne)dt(),se({text:F==null?void 0:F.text,name:(F==null?void 0:F.alias)||(F==null?void 0:F.name)||`[ ${fe("storylines.misc.voiceOver")} ]`,inScene:!1,voiceOver:!0,thinkful:!1,top:!1,avatar:Ke(U),show:!0});else if(!V.current&&!ae)if(console.log("START"),U){const Xe=F==null?void 0:F.slots.filter(Qt=>Qt.uid&&!Qt.talking),nt=[...Xe.map(Qt=>Qt.uid)||[],U==null?void 0:U.uid];oe.filter(Qt=>!nt.includes(Qt)).forEach(Qt=>{I(Qt,"idle")}),Xe.forEach(Qt=>{const Nt=He(Qt.uid);if(Nt){const{isSeated:Er}=Nt,dn=Qt.emotion.includes("seated");I(Qt.uid,Er&&!dn?`${Qt.emotion}-seated`:Qt.emotion)}});const Ht=He(U.uid),Sr=t.find(Qt=>Qt.uid===U.uid);if(Ht&&!V.current){if(U.uid===Ht.uid){pe(Ht);const{isSeated:Qt,userData:Nt}=Ht,{emotion:Er}=U,dn=Er.includes("seated");!((Ce=Nt.active)!=null&&Ce.includes("talking"))&&!((Ee=Nt.active)!=null&&Ee.includes(Er))&&I(U.uid,Qt&&!dn?`${Er}-seated`:Er);const An=()=>{var Br;se({text:U.text,name:U.alias||((Br=U.character)==null?void 0:Br.name),inScene:!0,thinkful:U.emotion.includes("think"),avatar:Ke(U),show:!0})};l?Qe(An):An()}}else dt(),se({text:U.text,name:U.alias||((Pe=U.character)==null?void 0:Pe.name)||(Sr==null?void 0:Sr.name),left:!1,top:U.text.length>maxCharacterToSwitch,inScene:!1,thinkful:U.emotion.includes("think"),avatar:Ke(U),show:!0})}else dt(),se({show:!0})},[t,F,l,He,fe,Ke,dt,ae,ne,oe]);const me=useEkho({audioType:F==null?void 0:F.audioType,volume:F==null?void 0:F.audioVolume,voice:F==null?void 0:F.voice,started:Z.show,text:Z==null?void 0:Z.text,audio:F==null?void 0:F.audio,slide:E,soundActions:a,emitEvent:e,pauseTTS:d,onStart:()=>{var Ce;(Ce=U==null?void 0:U.emotion)!=null&&Ce.includes("think")||yt()},onError:()=>{S(!0)},onFinish:()=>{ut(),X&&!d&&rt()}});React$2.useEffect(()=>(me(),()=>{me()}),[E,me]),React$2.useEffect(()=>{var Ce;if(((F==null?void 0:F.audioType)==="none"||R)&&(Z!=null&&Z.show)&&!(U!=null&&U.emotion.includes("think"))){yt();const Ee=characterMs*(((Ce=Z==null?void 0:Z.text)==null?void 0:Ce.length)||0);setTimeout(()=>{ut()},Ee<minMs?minMs:Ee)}},[R,F==null?void 0:F.audioType,U==null?void 0:U.emotion,Z]),React$2.useEffect(()=>{var Ce;if(X&&Z.show&&((F==null?void 0:F.audioType)==="none"||R)&&!d){const Ee=characterMs*(((Ce=Z==null?void 0:Z.text)==null?void 0:Ce.length)||0);(!We()||We()&&f)&&w(rt,Ee<minMs?minMs:Ee)}return()=>{P()}},[Z,rt,w,f,P,F==null?void 0:F.audioType,X,Q,J,R]);const ye=React$2.useMemo(()=>E===0||Ne(),[E,Ne]);o(ae||ye||!Z.show?null:qt,ae||!Z.show?null:at);const De=document.querySelector(".screens--container");if(ae){const Ce={...F.payload,decisionNumber:r.filter(Ee=>Ee.decision).findIndex(Ee=>Ee.id===F.id)+1,inheritProps:{slots:[],disableBackground:!0},required:!W,branched:W,onAddPoints:Ze,onFinish:rt,emitEvent:e,pause:d,soundActions:a,keyboardControl:o,onMount:()=>{dt()},onUnMount:()=>{$.current=!1}};return jsxRuntimeExports.jsx(DialogDecision,{...Ce})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Z.text?jsxRuntimeExports.jsx(BubbleWrapper,{translate:fe,currentMessage:Z}):null,jsxRuntimeExports.jsx(arcadeThreeCore.HtmlPro,{wrapperClass:"htmlpro-wrap-100-h",style:{width:"100vw",height:"100%",position:"static"},portal:De?{current:De}:void 0,zIndexRange:[6,6],onOcclude:()=>{},calculatePosition:()=>[0,0],children:jsxRuntimeExports.jsxs("div",{dir:LangIsRtl()?"rtl":"ltr",className:"dialog-component-controls",children:[jsxRuntimeExports.jsx("button",{type:"button",onClick:qt,disabled:ye||!Z.show,className:`gat--btn__round ${ye||!Z.show?"disabled":""}`,"aria-label":LangIsRtl()?fe("storylines.misc.forward"):fe("storylines.misc.rewind"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-next":"icon-back"})}),jsxRuntimeExports.jsx("button",{type:"button",onClick:at,disabled:!Z.show,className:`gat--btn__round
273
+ ${Z.show?"":"disabled"}
274
+ ${_&&We()?"glowing-animation":""}`,"aria-label":LangIsRtl()?fe("storylines.misc.rewind"):fe("storylines.misc.forward"),children:jsxRuntimeExports.jsx("span",{className:LangIsRtl()?"icon-back":"icon-next"})})]})})]})}function AnimationComponent({animation:o,loopTimes:e,resource:r,enableInteraction:t,makeDefault:n,emitEvent:a}){const[l,u]=React$2.useState(!1),f=fiber.useThree(h=>h.scene),d=React$2.useMemo(()=>new GLTFLoader,[]);return React$2.useEffect(()=>{u(!1)},[r.uid,o==null?void 0:o.url]),React$2.useEffect(()=>{if(!l){let h;if(f.traverseVisible(y=>{r.uid&&y.uid===r.uid&&!h&&(h=y)}),h&&o&&h.skeletonId===o.skeletonId)if(n)a({type:"saveAnimation",payload:{uid:r.uid,animation:o.id,index:h.index}}),a({type:"success"});else{const y=t;y||a({type:"success"}),d.load(o.url,E=>{const{mixer:p,clipAction:_,defaultAnim:g}=h.userData.animation;_(E.animations[0],h).setLoop(three.LoopRepeat,e),console.log(g);const C=()=>{p.removeEventListener("finished",C),_(g,h),y&&a({type:"success"})};p.addEventListener("finished",C),u(!0)})}else a({type:"success"})}},[f,o==null?void 0:o.url,e,a,l,d,r.uid,n,o,r,t]),null}function EmailPill({text:o,error:e,handleClick:r}){return jsxRuntimeExports.jsxs("div",{"data-testid":`${e?" pill--error":"pill--ok"}`,className:`email-pill ${e?" email-pill--error":""}`,children:[jsxRuntimeExports.jsx("div",{children:o}),jsxRuntimeExports.jsx("div",{className:"email-pill__delete",children:jsxRuntimeExports.jsx("button",{type:"button",onClick:r,className:"icon-close unset-button","aria-label":"icon click"})})]})}function StepOne({handleContinue:o,handleCancel:e,translate:r,text:t}){const[n,a]=React$2.useState([]),[l,u]=React$2.useState(0),[f,d]=React$2.useState(0),h=React$2.useRef(null),y=(g,x,C)=>{g.stopPropagation(),a(n.filter(R=>R!==n[C])),x.error&&u(l-1),x.isRepeat&&d(f-1)},E=()=>{h.current&&h.current.focus()},p=()=>{[" ",",",";","."].includes(h.current.value)&&(h.current.value="")},_=g=>{const x=h.current.value,C=["Space","Comma","Period","Enter"],R=["Space","Comma","Enter","Tab"];x===""&&(C.includes(g.code)||g.keyCode==="186"||g.key==="Enter"||g.key===" ")?g.preventDefault():h.current.value.length>1&&(R.includes(g.code)||g.type==="blur")&&(g.preventDefault(),/[A-Za-z0-9._%+-]{3,}@[A-Za-z0-9_+-]{2,}([.]{1}[a-zA-Z]{2,}|[.]{1}[a-zA-Z]{2,}[.]{1}[a-zA-Z]{2,})/.test(x)?n.find(A=>A.text===x)?(d(f+1),a([...n,{text:x,error:!0,isRepeat:!0}])):a([...n,{text:x}]):(a([...n,{text:x,error:!0}]),u(l+1)),h.current.value="")};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:r("puzzles.referrals.inviter.titleStep1")}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__subtitle",children:t}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__form",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__instructions",children:[jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.instructions")}),jsxRuntimeExports.jsx("div",{dir:"auto",children:r("puzzles.referrals.inviter.limit")})]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__faketextarea",onKeyUp:()=>{},role:"button",tabIndex:"-1",onClick:E,"aria-labelledby":"list of emails",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__scrollarea",id:"list of emails",children:[n&&n.map((g,x)=>jsxRuntimeExports.jsx(EmailPill,{text:g.text,error:g.error,handleClick:C=>y(C,g,x),emailPillIndex:x},`${n.indexOf(g)}`)),n.length<=9?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("input",{id:"email",ref:h,className:"referrals-piece__inputemail",onChange:p,onKeyDown:_,onBlur:_,type:"email",autoComplete:"off"}),jsxRuntimeExports.jsx("label",{className:"referrals-piece__emaillabel",htmlFor:"email",children:jsxRuntimeExports.jsx("span",{children:r("puzzles.referrals.inviter.skipButton")})})]}):null]})}),jsxRuntimeExports.jsxs("div",{dir:LangIsRtl()?"rtl":"auto",className:"referrals-piece__footervalidation",children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__errormessage",children:[jsxRuntimeExports.jsx("div",{children:f>0?r("puzzles.referrals.inviter.errorEmailRepeat"):null}),jsxRuntimeExports.jsx("div",{children:l>0?r("puzzles.referrals.inviter.errorMessage"):null})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__counter","data-testid":"pillcounter",children:[n.length,"/10"]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"referrals-piece__buttons",children:[jsxRuntimeExports.jsx("button",{"data-testid":"cancelButton",className:"gat--btn gat--btn__secondary",type:"button",onClick:e,children:r("puzzles.referrals.inviter.skipButton")}),jsxRuntimeExports.jsx("button",{className:`gat--btn gat--btn__primary ${f>0||l>0||n.length===0?" disabled":""}`,type:"button",disabled:l>0||n.length===0,onClick:()=>o(n),children:r("puzzles.referrals.inviter.inviteButton")})]})]})}function StepTwo({handleFinish:o,translate:e,valid:r,invalid:t}){const[n,a]=React$2.useState(!1),l=()=>{a(!n)},u=r===1?"invitationSend":"invitationsSend",f=t===1?"invitationNotSend":"invitationsNotSend";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"referrals-piece__body",dir:"auto",children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__title",children:e("puzzles.referrals.inviter.titleStep2")}),jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__feedback",children:[!!r.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-check-circle-black color--success"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:r.current})," ",e(`puzzles.referrals.inviter.${u}`)]})]}),!!t.current&&jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("div",{className:"referrals-piece__feedbackicon icon-error-circle-black color--error"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:t.current})," ",e(`puzzles.referrals.inviter.${f}`)]}),jsxRuntimeExports.jsx("button",{className:"un-button",type:"button",onClick:l,children:e("puzzles.referrals.inviter.whyFail")})]})]}),n?jsxRuntimeExports.jsxs("ul",{className:"referrals-piece__failsreasons",children:[jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons1")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons2")}),jsxRuntimeExports.jsx("li",{children:e("puzzles.referrals.inviter.failReasons3")})]}):null]}),jsxRuntimeExports.jsx("div",{className:"referrals-piece__buttons",children:jsxRuntimeExports.jsx("button",{className:"gat--btn gat--btn__primary",type:"button",onClick:o,children:e("puzzles.referrals.inviter.continueButton")})})]})}function ReferralComponent({emitEvent:o,text:e,rewards:r,referrals:t}){const n=E=>o({type:"translate",payload:E}),[a,l]=React$2.useState("step1"),u=React$2.useRef(0),f=React$2.useRef(0),d=async E=>{const p=E.map(g=>g.text),_=await o({type:"sendReferrals",payload:p});u.current=_&&_.data?_.data.valid.length:0,f.current=p.length-u.current,l("step2")};if(!t)return o({type:"success"}),null;const h=()=>{o({type:"success"})},y=()=>{if(u.current){const E=r.map(p=>(p.points*=u.current,p));o({type:"addPoints",complex:!0,finish:!0,payload:E})}else o({type:"success"})};return jsxRuntimeExports.jsx("div",{className:"referrals-piece",children:jsxRuntimeExports.jsxs("div",{className:"referrals-piece__center",children:[a==="step1"&&jsxRuntimeExports.jsx(StepOne,{translate:n,handleContinue:d,handleCancel:h,text:e}),a==="step2"&&jsxRuntimeExports.jsx(StepTwo,{translate:n,handleFinish:y,valid:u,invalid:f})]})})}exports.AnimationComponent=AnimationComponent;exports.AutoEvaluationComponent=AutoEvaluation;exports.CardsSelectorPuzzleComponent=CardsSelectorPuzzleComponent;exports.CartelComponent=CartelComponent;exports.ChainedImageClickPuzzleComponent=ChainedImageClickPuzzleComponent;exports.ComicComponent=ComicComponent;exports.ConversationalComponent=ConversationalComponent;exports.ConversationalProComponent=ConversationalProComponent;exports.CrackerPuzzleComponent=CrackerPuzzleComponent;exports.DecisionComponent=DecisionComponent;exports.DialogComponent=DialogComponent;exports.DragItemPuzzleComponent=DragItemPuzzleComponent;exports.FrameImageClickComponent=FrameImageClickComponent;exports.HackerPuzzleComponent=HackerPuzzleComponent;exports.HangedPuzzleComponent=HangedPuzzleComponent;exports.ImageClickPuzzleComponent=ImageClickPuzzleComponent;exports.ImageComponent=ImageComponent;exports.InventoryItem=InventoryItem;exports.KeyboardPuzzleComponent=KeyboardPuzzleComponent;exports.LecturesComponent=LecturesComponent;exports.LoginPuzzleComponent=LoginPuzzleComponent;exports.NoticeComponent=NoticeComponent;exports.PatternComponent=PatternComponent;exports.PdfComponent=PdfComponent;exports.PdfVisor=PdfVisor;exports.ReferralComponent=ReferralComponent;exports.SurveyComponent=SurveyComponent;exports.TerminalPuzzleComponent=TerminalPuzzleComponent;exports.TestComponent=TestComponent;exports.TextClickPuzzleComponent=TextClickPuzzleComponent;exports.UrlComponent=UrlComponent;exports.VideoComponent=VideoComponent;exports.VideoVisor=VideoVisor;exports.WebBuilderPuzzleComponent=WebBuilderPuzzleComponent;exports.WriterPuzzleComponent=WriterPuzzleComponent;exports.ZoomTest=ZoomTest;